add inventory daily

This commit is contained in:
2017-03-25 22:18:27 +01:00
parent 2b5f5f60fd
commit b9c442fe22
13 changed files with 262 additions and 34 deletions

View File

@@ -96,6 +96,7 @@ class AdminMenuStructure{
$items[] = ['label' => 'Leltár', 'url' => ['/inventory/index'] ];
$items[] = ['label' => 'Részletes eladások', 'url' => ['/transfer/sale' ,'TransferSaleSearch[start]' =>$todayDatetime,'TransferSaleSearch[end]' => $tomorrowDatetime ] ];
$items[] = ['label' => 'Termék összesítő', 'url' => ['/product/statistics' ,'ProductStatisticsSearch[start]' =>$todayDatetime,'ProductStatisticsSearch[end]' => $tomorrowDatetime ] ];
$items[] = ['label' => 'Leltár pillanat képek', 'url' => ['/inventory/daily' ] ];
$this->menuItems[] = ['label' => 'Termékek', 'url' => $this->emptyUrl,
'items' => $items
];

View File

@@ -0,0 +1,22 @@
<?php
namespace backend\components;
use common\models\Inventory;
class InventoryManager
{
/**
* @return Inventory
*/
public function generateDaily(){
$model = new Inventory();
$model->status = Inventory::$STATUS_CLOSED;
$model->type = Inventory::$TYPE_DAILY;
$model->name = 'Automatikus Napi '.date('Ymd_His') ;
$model->save(false);
return $model;
}
}
?>