Add property reception show stock.

This commit is contained in:
2017-02-06 08:20:18 +01:00
parent 7bbd4dcfa4
commit c8e3ef6754
7 changed files with 91 additions and 26 deletions

View File

@@ -285,6 +285,7 @@ class ContractController extends Controller {
'id' => $contract->id_contract
] );
}
public function actionMake($id) {
$customer = Customer::findOne ( $id );
@@ -301,7 +302,6 @@ class ContractController extends Controller {
$model->started_at = date(date('Y.m.d'));
$model->fillOut ();
if ($model->load ( Yii::$app->request->post () ) && $model->validate ()) {

View File

@@ -133,7 +133,7 @@ class ContractForm extends Model {
],
[
[
'ticket_type'
'ticket_type'
],
'validateTicketType'
] ,
@@ -154,7 +154,7 @@ class ContractForm extends Model {
public function validateTicketType($attribute, $params) {
$this->ticketType = TicketType::findOne ( $this->ticket_type );
if (! isset ( $this->ticketType )) {
if (! isset ( $this->ticketType ) ) {
$this->addError ( $attribute, "Bérlet típus nem található" );
}else{
$contracts = Contract::find()

View File

@@ -203,7 +203,9 @@ class ProductSaleForm extends Model
$paid_at = date('Y-m-d H:i:s' ) ;
}
$this->transfer = Transfer::createProductTransfer($this->sale,$this->account, $this->discount, $this->currency, $this->count, $this->product,$status,$customer);
$this->transfer = Transfer::createProductTransfer($this->sale, $this->account, $this->discount,
$this->currency, $this->count,
$this->product,$status,$customer);
$this->transfer->payment_method = $this->payment_method;
if ( isset($this->comment)){
$this->transfer->comment = $this->comment;

View File

@@ -25,6 +25,7 @@
</td>
</tr>
<tr>
<?php if ( \common\components\Helper::isReceptionShowStock() ) {?>
<th>
<?php echo Yii::t('frontend/product','Stock'). ' (Db)'?>
</th>
@@ -37,6 +38,14 @@
<td>
<span class="product-count">1</span>
</td>
<?php }else { ?>
<th colspan="3">
<?php echo Yii::t('frontend/product','Count'). ' (Db)'?>
</th>
<td>
<span class="product-count">1</span>
</td>
<?php } ?>
</tr>
<tr>
<th>