Fix Detsta Import -> Transfer type cash , when unsuccessful

This commit is contained in:
Roland Schneider 2016-09-07 21:31:17 +02:00
parent 179b47c454
commit 2828a6f236
4 changed files with 29 additions and 10 deletions

View File

@ -152,6 +152,9 @@ class InventoryItemForm extends Model{
$query->andWhere([ '>', 'procurement.created_at' ,$this->last_inventory_item->created_at]);
}
//$query->andWhere([ '>', 'procurement.created_at' ,$this->inventory->created_at]);
if ( $this->type == 'product') {
$query->andWhere(['product.id_product' => $this->product->id_product]);
}else{

View File

@ -39,6 +39,19 @@ $this->registerJs('inventoryItemIndex.init( ' . json_encode($options) . ' );');
text-align: right;
}
.col-b{
/*background-color: #00a157;*/
}
.table-striped > tbody > tr:nth-of-type(even) td.col-b {
background-color: #DFE3E8;
/*background-color: #D3D7DC;*/
}
.table-striped > tbody > tr:nth-of-type(odd) td.col-b {
/*background-color: #E0E0E0;*/
background-color: #ECECEC;
}
</style>
<div class="inventory-item-index">
<h1><?= Html::encode($this->title) ?></h1>
@ -101,7 +114,8 @@ $this->registerJs('inventoryItemIndex.init( ' . json_encode($options) . ' );');
],
[
'attribute' => 'inventory_prev_name',
'label' => 'Utolsó leltár'
'label' => 'Utolsó leltár',
'contentOptions' => ['class' => 'col-b']
],
[
'attribute' => 'item_count_system',
@ -112,7 +126,7 @@ $this->registerJs('inventoryItemIndex.init( ' . json_encode($options) . ' );');
[
'attribute' => 'item_count',
'label' => 'Leltározott mennyiség (db)',
'contentOptions' => ['class' => 'numeric']
'contentOptions' => ['class' => 'numeric col-b']
],
[
@ -124,7 +138,7 @@ $this->registerJs('inventoryItemIndex.init( ' . json_encode($options) . ' );');
[
'attribute' => 'item_count_in',
'label' => 'Beszerzett mennyiség (db)',
'contentOptions' => ['class' => 'numeric']
'contentOptions' => ['class' => 'numeric col-b' ]
],
[
@ -136,7 +150,7 @@ $this->registerJs('inventoryItemIndex.init( ' . json_encode($options) . ' );');
[
'attribute' => 'item_difference',
'label' => 'Különbség (db)',
'contentOptions' => ['class' => 'numeric']
'contentOptions' => ['class' => 'numeric col-b']
],
[
@ -147,7 +161,7 @@ $this->registerJs('inventoryItemIndex.init( ' . json_encode($options) . ' );');
[
'attribute' => 'item_total_price_brutto',
'label' => 'Összeg (Ft)',
'contentOptions' => ['class' => 'numeric']
'contentOptions' => ['class' => 'numeric col-b']
],

View File

@ -149,7 +149,8 @@ class DetStatTetelProcessor extends Object {
'discount'=> $discount,
'contract'=> $this->contract,
'ticketInstallmentRequest' => $megbizas,
'transferStatus' => Transfer::STATUS_NOT_PAID
'transferStatus' => Transfer::STATUS_NOT_PAID,
'paymentMethod' => Transfer::PAYMENT_METHOD_CASH
]
);
@ -219,7 +220,7 @@ class DetStatTetelProcessor extends Object {
* Szerződés módosítása, ha a detsta üzenetben a megbízás el lett fogadva
* */
protected function updateContractOnSuccess(){
\Yii::info('Szerződés frissítése - megbizás elfogadva ' );
\Yii::info('Szerződés frissítése - megbízás elfogadva ' );
$this->incRequiredParts();
$this->contract->part_paid = $this->contract->part_paid +1;
$this->updateContractPaidStatus();
@ -232,7 +233,7 @@ class DetStatTetelProcessor extends Object {
}
protected function updateContractOnFail(){
\Yii::info('Szerződés frissítése - megbizás visszautasítva ' );
\Yii::info('Szerződés frissítése - megbízás visszautasítva ' );
$this->incRequiredParts();
$this->updateContractPaidStatus();
// $this->contract->status = Contract::$STATUS_NOT_PAID;

View File

@ -45,10 +45,11 @@ class InventoryConsoleController extends Controller{
$query->innerJoin('product','sale.id_product = product.id_product');
$query->andWhere(['transfer.type' => Transfer::TYPE_PRODUCT]);
$query->andWhere(['in', 'transfer.type', [Transfer::STATUS_NOT_PAID, Transfer::STATUS_PAID]]);
$query->andWhere(['in', 'transfer.status', [Transfer::STATUS_NOT_PAID, Transfer::STATUS_PAID]]);
$query->andWhere(['product.id_product' => $prev->id_product]);
$query->andWhere([ '>','transfer.created_at',$start ]);
$query->andWhere([ '<','transfer.created_at',$end ]);
$products = $query->scalar();