Finish version/v.0.0.55
This commit is contained in:
commit
120ce58e0b
31
backend/assets/InventoryItemIndexAsset.php
Normal file
31
backend/assets/InventoryItemIndexAsset.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
/**
|
||||
* @link http://www.yiiframework.com/
|
||||
* @copyright Copyright (c) 2008 Yii Software LLC
|
||||
* @license http://www.yiiframework.com/license/
|
||||
*/
|
||||
|
||||
namespace backend\assets;
|
||||
|
||||
use yii\web\AssetBundle;
|
||||
|
||||
/**
|
||||
* @author Qiang Xue <qiang.xue@gmail.com>
|
||||
* @since 2.0
|
||||
*/
|
||||
class InventoryItemIndexAsset extends AssetBundle
|
||||
{
|
||||
public $basePath = '@webroot';
|
||||
public $baseUrl = '@web';
|
||||
public $css = [
|
||||
];
|
||||
public $js = [
|
||||
'js/app.js',
|
||||
'js/inventory.item.index.js',
|
||||
];
|
||||
public $depends = [
|
||||
'backend\assets\AppAsset',
|
||||
'yii\jui\JuiAsset',
|
||||
'common\assets\TypeAheadAsset',
|
||||
];
|
||||
}
|
||||
@ -106,6 +106,7 @@ class AdminMenuStructure{
|
||||
// $items[] = ['label' => 'Bevétel', 'url' => ['/transfer/summary' , 'TransferSummarySearch[start]' =>$today,'TransferSummarySearch[end]' => $tomorrow ] ];
|
||||
$items[] = ['label' => 'Napi bevételek', 'url' => ['/transfer/list', 'TransferListSearch[start]' =>$todayDatetime,'TransferListSearch[end]' => $tomorrowDatetime ] ];
|
||||
$items[] = ['label' => 'Kassza müveletek', 'url' => ['/account-state/index'] ];
|
||||
$items[] = ['label' => 'Későbbi utalások', 'url' => ['/transfer/payment-later','TransferLaterSearch[start]' =>$todayDatetime,'TransferLaterSearch[end]' => $tomorrowDatetime ] ];
|
||||
//$items[] = ['label' => 'Zárások', 'url' => ['/collection/index' , 'CollectionSearch[start]' =>$todayDatetime,'CollectionSearch[end]' => $tomorrowDatetime ] ];
|
||||
$this->menuItems[] = ['label' => 'Pénzügy', 'url' => $this->emptyUrl,
|
||||
'items' => $items
|
||||
|
||||
@ -69,7 +69,6 @@ class AccountStateController extends \backend\controllers\BackendController
|
||||
* @return mixed
|
||||
*/
|
||||
public function actionView($id) {
|
||||
echo "view";
|
||||
$accountState = $this->findModel ( $id );
|
||||
$output = Yii::$app->getRequest ()->getQueryParam ( 'output' );
|
||||
$details = null;
|
||||
|
||||
@ -8,13 +8,7 @@ use backend\models\InventorySearch;
|
||||
use yii\web\Controller;
|
||||
use yii\web\NotFoundHttpException;
|
||||
use yii\filters\VerbFilter;
|
||||
use common\models\InventoryItem;
|
||||
use yii\data\ActiveDataProvider;
|
||||
use common\components\Helper;
|
||||
use common\models\User;
|
||||
use common\models\Product;
|
||||
use common\models\InventoryGroup;
|
||||
use yii\db\Expression;
|
||||
use yii\db\Query;
|
||||
use backend\models\InventoryItemSearch;
|
||||
|
||||
@ -50,26 +44,6 @@ class InventoryController extends Controller
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays a single Inventory model.
|
||||
* @param integer $id
|
||||
* @return mixed
|
||||
*/
|
||||
public function actionView($id)
|
||||
{
|
||||
$inventory = $this->findModel($id);
|
||||
|
||||
$searchModel = new InventoryItemSearch(['inventory' => $inventory]);
|
||||
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
|
||||
|
||||
|
||||
$query = new Query();
|
||||
|
||||
return $this->render('view', [
|
||||
'model' => $inventory,
|
||||
'dataProvider' => $dataProvider
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new Inventory model.
|
||||
@ -88,43 +62,13 @@ class InventoryController extends Controller
|
||||
if ($model->load(Yii::$app->request->post()) && $model->save()) {
|
||||
return $this->redirect(['view', 'id' => $model->id_inventory]);
|
||||
} else {
|
||||
}
|
||||
return $this->render('create', [
|
||||
'model' => $model,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates an existing Inventory model.
|
||||
* If update is successful, the browser will be redirected to the 'view' page.
|
||||
* @param integer $id
|
||||
* @return mixed
|
||||
*/
|
||||
public function actionUpdate($id)
|
||||
{
|
||||
$model = $this->findModel($id);
|
||||
|
||||
if ($model->load(Yii::$app->request->post()) && $model->save()) {
|
||||
return $this->redirect(['view', 'id' => $model->id_inventory]);
|
||||
} else {
|
||||
return $this->render('update', [
|
||||
'model' => $model,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes an existing Inventory model.
|
||||
* If deletion is successful, the browser will be redirected to the 'index' page.
|
||||
* @param integer $id
|
||||
* @return mixed
|
||||
*/
|
||||
public function actionDelete($id)
|
||||
{
|
||||
$this->findModel($id)->delete();
|
||||
|
||||
return $this->redirect(['index']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds the Inventory model based on its primary key value.
|
||||
|
||||
@ -10,6 +10,8 @@ use yii\web\NotFoundHttpException;
|
||||
use yii\filters\VerbFilter;
|
||||
use backend\models\InventoryItemForm;
|
||||
use common\models\Inventory;
|
||||
use yii\helpers\Url;
|
||||
use common\models\Product;
|
||||
|
||||
/**
|
||||
* InventoryItemController implements the CRUD actions for InventoryItem model.
|
||||
@ -43,13 +45,94 @@ class InventoryItemController extends Controller
|
||||
$searchModel = new InventoryItemSearch(['inventory' => $inventory]);
|
||||
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
|
||||
|
||||
$productOptions = Product::buildProductAndInventoryGroupList();
|
||||
|
||||
if ($searchModel->output == 'xls') {
|
||||
$this->downloadIndexXls($dataProvider);
|
||||
}else{
|
||||
Url::remember(Url::current(),"inventory-item-index");
|
||||
}
|
||||
|
||||
|
||||
return $this->render('index', [
|
||||
'model' => $inventory,
|
||||
'searchModel' => $searchModel,
|
||||
'dataProvider' => $dataProvider,
|
||||
'productOptions' =>$productOptions
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
protected function downloadIndexXls($dataProvider){
|
||||
|
||||
|
||||
$defs = [['item_created_at', 'Létrehozva'],
|
||||
['item_name', 'Termék/Termék csoport'],
|
||||
['user_username', 'Felhasználó'],
|
||||
['item_count_prev', 'Előző leltár (db)'],
|
||||
['item_count_sold', 'Eladott mennyiség (db)'],
|
||||
['item_count_in', 'Beszerzett mennyiség (db)'],
|
||||
['item_count', 'Leltározott mennyiség (db)'],
|
||||
['item_difference', 'Különbség (db)'],
|
||||
['item_count_system', 'Rendszer szerinti mennyiség (db)'],
|
||||
];
|
||||
$cols = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P'];
|
||||
|
||||
$models = $dataProvider->getModels ();
|
||||
$objPHPExcel = new \PHPExcel ();
|
||||
|
||||
$sheet = $objPHPExcel->setActiveSheetIndex ( 0 );
|
||||
/**
|
||||
* Termék azonosító Termék neve Termék szám Termék vonalkód Termék raktáron Termék eladva
|
||||
*/
|
||||
$row = 1;
|
||||
$col = 0;
|
||||
foreach ( $defs as $def ) {
|
||||
$sheet->setCellValue ( $cols [$col] . $row, $def [1] );
|
||||
$col ++;
|
||||
}
|
||||
|
||||
foreach ( $models as $model ) {
|
||||
$row ++;
|
||||
$col = 0;
|
||||
foreach ( $defs as $def ) {
|
||||
$sheet->setCellValue ( $cols [$col] . $row, $model[$def [0]] );
|
||||
$col ++;
|
||||
}
|
||||
}
|
||||
|
||||
$styleArray = array (
|
||||
'font' => array (
|
||||
'bold' => true
|
||||
)
|
||||
);
|
||||
// 'color' => array('rgb' => 'FF0000'),
|
||||
// 'size' => 15,
|
||||
// 'name' => 'Verdana'
|
||||
|
||||
|
||||
|
||||
foreach ( range ( 'A', 'I' ) as $columnID ) {
|
||||
$sheet->getColumnDimension ( $columnID )->setAutoSize ( true );
|
||||
$sheet->getStyle ( $columnID . '1' )->applyFromArray ( $styleArray );
|
||||
}
|
||||
|
||||
// Redirect output to a client’s web browser (Excel5)
|
||||
header ( 'Content-Type: application/vnd.ms-excel' );
|
||||
header ( 'Content-Disposition: attachment;filename="leltar.xls"' );
|
||||
header ( 'Cache-Control: max-age=0' );
|
||||
// If you're serving to IE 9, then the following may be needed
|
||||
header ( 'Cache-Control: max-age=1' );
|
||||
// If you're serving to IE over SSL, then the following may be needed
|
||||
header ( 'Expires: Mon, 26 Jul 1997 05:00:00 GMT' ); // Date in the past
|
||||
header ( 'Last-Modified: ' . gmdate ( 'D, d M Y H:i:s' ) . ' GMT' ); // always modified
|
||||
header ( 'Cache-Control: cache, must-revalidate' ); // HTTP/1.1
|
||||
header ( 'Pragma: public' ); // HTTP/1.0
|
||||
$objWriter = \PHPExcel_IOFactory::createWriter ( $objPHPExcel, 'Excel5' );
|
||||
$objWriter->save ( 'php://output' );
|
||||
exit ();
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays a single InventoryItem model.
|
||||
* @param integer $id
|
||||
@ -93,12 +176,21 @@ class InventoryItemController extends Controller
|
||||
public function actionUpdate($id)
|
||||
{
|
||||
$model = $this->findModel($id);
|
||||
$inventory = Inventory::findOne($model->id_inventory);
|
||||
|
||||
if ($model->load(Yii::$app->request->post()) && $model->save()) {
|
||||
return $this->redirect(['view', 'id' => $model->id_inventory_item]);
|
||||
|
||||
$prev = Url::previous("inventory-item-index");
|
||||
if ( isset($prev)){
|
||||
return $this->redirect($prev);
|
||||
}else{
|
||||
return $this->redirect([ 'index', 'id' => $inventory->id_inventory ]);
|
||||
}
|
||||
|
||||
} else {
|
||||
return $this->render('update', [
|
||||
'model' => $model,
|
||||
'inventory' => $inventory,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -15,6 +15,8 @@ use backend\models\TransferSaleSearch;
|
||||
use common\models\ProductCategory;
|
||||
use common\models\Product;
|
||||
use backend\models\TransferListUserGroupedSearch;
|
||||
use backend\models\TransferLaterSearch;
|
||||
use yii\helpers\Url;
|
||||
|
||||
/**
|
||||
* TransferController implements the CRUD actions for Transfer model.
|
||||
@ -29,7 +31,14 @@ class TransferController extends \backend\controllers\BackendController
|
||||
'rules' => [
|
||||
// allow authenticated users
|
||||
[
|
||||
'actions' => [ 'index','view','summary','list',"sale","sale-pdf" ,'list-user-grouped'],
|
||||
'actions' => [ 'index',
|
||||
'view',
|
||||
'summary',
|
||||
'list',
|
||||
"sale",
|
||||
"sale-pdf" ,
|
||||
'list-user-grouped',
|
||||
'payment-later'],
|
||||
'allow' => true,
|
||||
'roles' => ['admin','employee','reception'],
|
||||
],
|
||||
@ -40,6 +49,34 @@ class TransferController extends \backend\controllers\BackendController
|
||||
}
|
||||
|
||||
|
||||
public function actionPaymentLater(){
|
||||
$searchModel = new TransferLaterSearch();
|
||||
|
||||
|
||||
if ( \Yii::$app->request->isPost){
|
||||
$searchModel->load(Yii::$app->request->post());
|
||||
if ( $searchModel->doPayout()) {
|
||||
return $this->redirect(['transfer/payment-later' ]);
|
||||
}
|
||||
}
|
||||
|
||||
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
|
||||
|
||||
$accounts = Account::read();
|
||||
|
||||
|
||||
$users = User::read();
|
||||
|
||||
Url::remember("payment_later",Url::current());
|
||||
|
||||
return $this->render('payment_later', [
|
||||
'searchModel' => $searchModel,
|
||||
'dataProvider' => $dataProvider,
|
||||
'accounts' => $accounts,
|
||||
'users' => $users,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists all Transfer models.
|
||||
* @return mixed
|
||||
|
||||
@ -89,7 +89,6 @@ class InventoryItemForm extends Model{
|
||||
}
|
||||
|
||||
public function save(){
|
||||
if ( $this->validate()) {
|
||||
|
||||
|
||||
$this->loadLastInventory();
|
||||
@ -109,10 +108,14 @@ class InventoryItemForm extends Model{
|
||||
if ( isset( $this->last_inventory_item ) ){
|
||||
$item->id_inventory_item_prev = $this->last_inventory_item->id_inventory_item;
|
||||
$item->count_prev = $this->last_inventory_item->count;
|
||||
if ( !isset($item->count_prev)){
|
||||
$item->count_prev = 0;
|
||||
}
|
||||
}else{
|
||||
$item->count_prev = 0;
|
||||
}
|
||||
|
||||
|
||||
$item->id_user = \Yii::$app->user->id;
|
||||
|
||||
if ( $this->type == 'product'){
|
||||
@ -122,19 +125,18 @@ class InventoryItemForm extends Model{
|
||||
}
|
||||
$item->id_inventory = $this->inventory->id_inventory;
|
||||
|
||||
if ( !$item->save() ){
|
||||
if ( !$item->save(false) ){
|
||||
throw new \Exception("Nem sikerült a leltár végrehajtása");
|
||||
}
|
||||
$this->inventory_item = $item;
|
||||
return true;
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
protected function loadProductIn(){
|
||||
$query = new Query();
|
||||
$query->select(['sum(procurement.count) as total_in']);
|
||||
$query->select(['coalesce(sum(procurement.count),0) as total_in']);
|
||||
$query->from(Procurement::tableName());
|
||||
$query->innerJoin(Product::tableName(),"product.id_product = procurement.id_product");
|
||||
|
||||
@ -155,7 +157,7 @@ class InventoryItemForm extends Model{
|
||||
protected function loadProductSold(){
|
||||
|
||||
$query = new Query();
|
||||
$query->select(['sum(transfer.count) as total_sold']);
|
||||
$query->select(['coalesce(sum(transfer.count),0) as total_sold']);
|
||||
$query->from(Transfer::tableName());
|
||||
$query->innerJoin(Sale::tableName(),"sale.id_sale = transfer.id_object and transfer.type = " .Transfer::TYPE_PRODUCT);
|
||||
$query->innerJoin(Product::tableName(),"product.id_product = sale.id_product ");
|
||||
@ -174,7 +176,7 @@ class InventoryItemForm extends Model{
|
||||
protected function loadProductStock(){
|
||||
|
||||
$query = new Query();
|
||||
$query->select(['sum(product.stock) as total_stock']);
|
||||
$query->select(['coalesce(sum(product.stock),0) as total_stock']);
|
||||
$query->from(Product::tableName());
|
||||
|
||||
if ( $this->type == 'product') {
|
||||
|
||||
@ -20,7 +20,10 @@ use common\models\Inventory;
|
||||
class InventoryItemSearch extends InventoryItem
|
||||
{
|
||||
public $inventory;
|
||||
|
||||
public $output;
|
||||
public $item_name;
|
||||
public $item_type;
|
||||
public $item_id;
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
@ -28,6 +31,10 @@ class InventoryItemSearch extends InventoryItem
|
||||
{
|
||||
return [
|
||||
[['id_inventory_item', 'id_inventory', 'count_in', 'count_sold', 'count', 'type', 'id_product', 'id_inventory_group', 'id_user'], 'integer'],
|
||||
['output', 'string'],
|
||||
['item_name', 'string'],
|
||||
['item_type', 'string'],
|
||||
['item_id', 'integer'],
|
||||
];
|
||||
}
|
||||
|
||||
@ -50,6 +57,7 @@ class InventoryItemSearch extends InventoryItem
|
||||
public function search($params)
|
||||
{
|
||||
$query = new Query();
|
||||
|
||||
$query->select([
|
||||
'inventory_item.id_inventory_item as item_id_inventory_item',
|
||||
'inventory_item.created_at as item_created_at',
|
||||
@ -63,8 +71,9 @@ class InventoryItemSearch extends InventoryItem
|
||||
'inventory.created_at as inventory_created_at',
|
||||
'inventory_prev.id_inventory as inventory_prev_id_inventory',
|
||||
'inventory_prev.name as inventory_prev_name',
|
||||
new Expression('(inventory_item.count - ( inventory_item.count_prev + inventory_item.count_in - inventory_item.count_sold )) as item_difference'),
|
||||
new Expression('(coalesce(inventory_item.count,0) - ( coalesce(inventory_item.count_prev,0) + coalesce(inventory_item.count_in,0) - coalesce(inventory_item.count_sold,0) )) as item_difference'),
|
||||
]);
|
||||
|
||||
$query->from(InventoryItem::tableName());
|
||||
|
||||
|
||||
@ -78,9 +87,19 @@ class InventoryItemSearch extends InventoryItem
|
||||
|
||||
$query->andWhere( ['inventory_item.id_inventory' => $this->inventory->id_inventory] );
|
||||
|
||||
$this->load($params);
|
||||
|
||||
if (!$this->validate()) {
|
||||
// uncomment the following line if you do not want to return any records when validation fails
|
||||
// $query->where('0=1');
|
||||
return $dataProvider;
|
||||
}
|
||||
|
||||
$dataProvider = new ActiveDataProvider(
|
||||
['query' => $query ,
|
||||
'pagination' => ( empty($this->output) ? [] : false ),
|
||||
'sort' => [
|
||||
'defaultOrder' => ['item_name' => SORT_ASC],
|
||||
'attributes' => Helper::mkYiiSortItems([
|
||||
['item_created_at', 'item_created_at'],
|
||||
['item_name', 'item_name'],
|
||||
@ -100,22 +119,16 @@ class InventoryItemSearch extends InventoryItem
|
||||
]
|
||||
]
|
||||
);
|
||||
$this->load($params);
|
||||
|
||||
if (!$this->validate()) {
|
||||
// uncomment the following line if you do not want to return any records when validation fails
|
||||
// $query->where('0=1');
|
||||
return $dataProvider;
|
||||
|
||||
if ( !empty($this->item_type) && is_numeric($this->item_id) ){
|
||||
if ( $this->item_type == 'product'){
|
||||
$query->andFilterWhere(['product.id_product' => $this->item_id]);
|
||||
}else if ( $this->item_type == 'group' ){
|
||||
$query->andFilterWhere(['inventory_group.id_inventory_group' => $this->item_id]);
|
||||
}
|
||||
}
|
||||
|
||||
$query->andFilterWhere([
|
||||
'inventory_item.id_inventory_item' => $this->id_inventory_item,
|
||||
'inventory_item.type' => $this->type,
|
||||
'inventory_item.id_product' => $this->id_product,
|
||||
'inventory_item.id_inventory_group' => $this->id_inventory_group,
|
||||
'inventory_item.id_user' => $this->id_user,
|
||||
'inventory_item.created_at' => $this->created_at,
|
||||
]);
|
||||
|
||||
return $dataProvider;
|
||||
}
|
||||
|
||||
@ -45,6 +45,9 @@ class InventorySearch extends Inventory
|
||||
|
||||
$dataProvider = new ActiveDataProvider([
|
||||
'query' => $query,
|
||||
'sort' => [
|
||||
'defaultOrder' => ['created_at' => SORT_DESC]
|
||||
]
|
||||
]);
|
||||
|
||||
$this->load($params);
|
||||
|
||||
195
backend/models/TransferLaterSearch.php
Normal file
195
backend/models/TransferLaterSearch.php
Normal file
@ -0,0 +1,195 @@
|
||||
<?php
|
||||
|
||||
namespace backend\models;
|
||||
|
||||
use Yii;
|
||||
use yii\base\Model;
|
||||
use yii\data\ActiveDataProvider;
|
||||
use common\models\Transfer;
|
||||
use yii\db\Expression;
|
||||
use yii\base\Object;
|
||||
use yii\db\Query;
|
||||
use yii\helpers\ArrayHelper;
|
||||
use common\models\Account;
|
||||
use common\components\Helper;
|
||||
use common\components\RoleDefinition;
|
||||
|
||||
/**
|
||||
* TransferSearch represents the model behind the search form about `common\models\Transfer`.
|
||||
*/
|
||||
class TransferLaterSearch extends Transfer
|
||||
{
|
||||
public $start;
|
||||
public $end;
|
||||
|
||||
public $timestampStart;
|
||||
public $timestampEnd;
|
||||
|
||||
public $id_ticket_type;
|
||||
|
||||
|
||||
public $ticket_type;
|
||||
public $selected = [];
|
||||
|
||||
public $total_money;
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
[[ 'id_ticket_type','id_user'], 'integer'],
|
||||
[[ 'start', ], 'date', 'format' =>Yii::$app->formatter->datetimeFormat , 'timestampAttribute' => 'timestampStart' ,'timestampAttributeFormat' => 'yyyy-MM-dd HH:mm' ,'timeZone' => 'UTC' ],
|
||||
[[ 'end' , ], 'date' ,'format' =>Yii::$app->formatter->datetimeFormat , 'timestampAttribute' => 'timestampEnd' ,'timestampAttributeFormat' => 'yyyy-MM-dd HH:mm' ,'timeZone' => 'UTC' ],
|
||||
['selected', 'each', 'rule' => ['integer']],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function scenarios()
|
||||
{
|
||||
// bypass scenarios() implementation in the parent class
|
||||
return Model::scenarios();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates data provider instance with search query applied
|
||||
*
|
||||
* @param array $params
|
||||
*
|
||||
* @return ActiveDataProvider
|
||||
*/
|
||||
public function search($params)
|
||||
{
|
||||
$query = new Query();
|
||||
|
||||
$query->select([
|
||||
'transfer.id_transfer as transfer_id_transfer',
|
||||
'transfer.created_at as transfer_created_at',
|
||||
'transfer.money as transfer_money',
|
||||
'transfer.status as transfer_status',
|
||||
'user.username as user_username',
|
||||
'customer.name as customer_name',
|
||||
'ticket_type.name as ticket_type_name',
|
||||
'product.name as product_name',
|
||||
'ticket.start as ticket_start',
|
||||
'ticket.end as ticket_end',
|
||||
]);
|
||||
$query->from("transfer");
|
||||
$query->innerJoin('user', " user.id = transfer.id_user");
|
||||
$query->leftJoin('customer', " transfer.id_customer = customer.id_customer");
|
||||
$query->leftJoin('ticket', " transfer.type = ".Transfer::TYPE_TICKET." and transfer.id_object = ticket.id_ticket");
|
||||
$query->leftJoin('ticket_type', " ticket.id_ticket_type = ticket_type.id_ticket_type");
|
||||
$query->leftJoin('sale', " transfer.type = ".Transfer::TYPE_PRODUCT." and transfer.id_object = sale.id_sale");
|
||||
$query->leftJoin('product', " product.id_product = sale.id_product");
|
||||
|
||||
$query->andWhere(["transfer.payment_method" => Transfer::PAYMENT_METHOD_TRANSFER_LATER ]);
|
||||
|
||||
$query->andWhere(['transfer.status' => Transfer::STATUS_NOT_PAID]);
|
||||
|
||||
$dataProvider = new ActiveDataProvider([
|
||||
'query' => $query,
|
||||
'sort' =>[
|
||||
'defaultOrder' =>[
|
||||
'transfer_created_at' => SORT_DESC
|
||||
],
|
||||
'attributes' => Helper::mkYiiSortItems([
|
||||
['transfer_created_at'],
|
||||
['transfer_money'],
|
||||
['transfer_status'],
|
||||
['user_username'],
|
||||
['customer_name'],
|
||||
['ticket_type_name'],
|
||||
['product_name'],
|
||||
['ticket_start'],
|
||||
['ticket_end'],
|
||||
])
|
||||
|
||||
]
|
||||
]);
|
||||
|
||||
|
||||
// $query->addSelect( ['*' ]);
|
||||
|
||||
$this->load($params);
|
||||
|
||||
if (!$this->validate()) {
|
||||
// uncomment the following line if you do not want to return any records when validation fails
|
||||
$query->where('0=1');
|
||||
return $dataProvider;
|
||||
}
|
||||
|
||||
|
||||
|
||||
$query->andFilterWhere([
|
||||
'ticket_type.id_ticket_type' => $this->id_ticket_type,
|
||||
'transfer.id_user' => $this->id_user,
|
||||
]);
|
||||
|
||||
$created_condition = ['and',[ '>=', 'transfer.created_at', $this->timestampStart ] ,[ '<', 'transfer.created_at', $this->timestampEnd ] ];
|
||||
$paid_condition = ['and',[ '>=', 'transfer.paid_at', $this->timestampStart ] ,[ '<', 'transfer.paid_at', $this->timestampEnd ] ];
|
||||
|
||||
$query->andFilterWhere(['or' , $created_condition , $paid_condition]);
|
||||
|
||||
$qtotal = Query::create($query);
|
||||
$qtotal->select([ new Expression("coalesce(sum(transfer.money),0) as transfer_money" )]);
|
||||
$this->total_money = $qtotal->scalar();
|
||||
|
||||
|
||||
return $dataProvider;
|
||||
}
|
||||
|
||||
|
||||
public function totalsTransfers( ){
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function doPayout(){
|
||||
|
||||
if ( !isset($this->selected) || count($this->selected) == 0){
|
||||
Helper::flash("error", "Nincs kiválasztott tranzakció");
|
||||
return false;
|
||||
}
|
||||
|
||||
$transfers = Transfer::find()
|
||||
->andWhere(['status' => Transfer::STATUS_NOT_PAID ])
|
||||
->andWhere(['payment_method' => Transfer::PAYMENT_METHOD_TRANSFER_LATER])
|
||||
->andWhere(['in','transfer.id_transfer',$this->selected])
|
||||
->all();
|
||||
|
||||
if ( count($transfers) != count($this->selected)){
|
||||
Helper::flash("warning", "A kiválasztott tranzakciókban időközben változás történt");
|
||||
return false;
|
||||
}
|
||||
|
||||
$db = \Yii::$app->db;
|
||||
$tx = $db->beginTransaction();
|
||||
try{
|
||||
foreach ($transfers as $transfer){
|
||||
if ( !$transfer->payout($transfer->id_account) ){
|
||||
\Yii::error("Failed to payout transaction: " .$transfer->id_transfer);
|
||||
throw new \Exception("Nem sikerült mententi a tranzakciókat");
|
||||
}
|
||||
}
|
||||
$tx->commit();
|
||||
Helper::flash("success", "Tranzakciók fizetettnek jelölve: " .count($transfers) . " db");
|
||||
}catch (\Exception $e){
|
||||
$tx->rollBack();
|
||||
Helper::flash("error", "Hiba történt a művelet közben");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -143,7 +143,6 @@ class TransferSearch extends Transfer
|
||||
return $dataProvider;
|
||||
}
|
||||
|
||||
echo "start date:" .$this->timestampStart;
|
||||
|
||||
$query->andFilterWhere([
|
||||
'transfer.id_account' => $this->id_account,
|
||||
|
||||
@ -7,6 +7,7 @@ use yii\base\Widget;
|
||||
<?php
|
||||
echo AccountStateBanknoteCountWidget::widget([
|
||||
'model' => $model,
|
||||
'showDailyDownload' =>false
|
||||
]);
|
||||
?>
|
||||
|
||||
|
||||
@ -12,8 +12,6 @@ use yii\widgets\ActiveForm;
|
||||
|
||||
<?php $form = ActiveForm::begin(); ?>
|
||||
|
||||
<?= $form->field($model, 'name')->textInput(['autocomplete' => 'off']) ?>
|
||||
<?= $form->field($model, 'id_product')->hiddenInput()->label(false) ?>
|
||||
<?= $form->field($model, 'type')->hiddenInput()->label(false) ?>
|
||||
<?= $form->field($model, 'count')->textInput() ?>
|
||||
|
||||
|
||||
@ -11,36 +11,22 @@ use yii\widgets\ActiveForm;
|
||||
<div class="inventory-item-search">
|
||||
|
||||
<?php $form = ActiveForm::begin([
|
||||
'action' => ['index'],
|
||||
'action' => ['index','id' => $model->inventory->id_inventory],
|
||||
'method' => 'get',
|
||||
]); ?>
|
||||
|
||||
<?= $form->field($model, 'id_inventory_item') ?>
|
||||
|
||||
<?= $form->field($model, 'id_inventory') ?>
|
||||
|
||||
<?= $form->field($model, 'count_in') ?>
|
||||
|
||||
<?= $form->field($model, 'count_sold') ?>
|
||||
|
||||
<?= $form->field($model, 'count') ?>
|
||||
|
||||
<?php // echo $form->field($model, 'type') ?>
|
||||
|
||||
<?php // echo $form->field($model, 'id_product') ?>
|
||||
|
||||
<?php // echo $form->field($model, 'id_inventory_group') ?>
|
||||
|
||||
<?php // echo $form->field($model, 'id_user') ?>
|
||||
<?= $form->field($model, 'item_type')->hiddenInput()->label(false) ?>
|
||||
<?= $form->field($model, 'item_id')->hiddenInput()->label(false) ?>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<?= $form->field($model, 'item_name')->label("Termék/Termék csoport neve") ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<?php // echo $form->field($model, 'created_at') ?>
|
||||
|
||||
<?php // echo $form->field($model, 'updated_at') ?>
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton(Yii::t('common/inventory-item', 'Search'), ['class' => 'btn btn-primary']) ?>
|
||||
<?= Html::resetButton(Yii::t('common/inventory-item', 'Reset'), ['class' => 'btn btn-default']) ?>
|
||||
<?= Html::submitButton(Yii::t('common/inventory-item', 'Keresés'), ['class' => 'btn btn-primary']) ?>
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
||||
@ -4,6 +4,7 @@ use yii\helpers\Html;
|
||||
use yii\grid\GridView;
|
||||
use yii\widgets\DetailView;
|
||||
use yii\helpers\Url;
|
||||
use backend\assets\InventoryItemIndexAsset;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $searchModel backend\models\InventoryItemSearch */
|
||||
@ -11,6 +12,15 @@ use yii\helpers\Url;
|
||||
|
||||
$this->title = Yii::t('common/inventory-item', 'Leltár részletei');
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
|
||||
|
||||
InventoryItemIndexAsset::register($this);
|
||||
|
||||
$options = [];
|
||||
$options['products'] = $productOptions;
|
||||
|
||||
$this->registerJs('inventoryItemIndex.init( '. json_encode($options) .' );');
|
||||
|
||||
?>
|
||||
<div class="inventory-item-index">
|
||||
|
||||
@ -23,17 +33,17 @@ $this->params['breadcrumbs'][] = $this->title;
|
||||
'name',
|
||||
['attribute'=>'id_user',
|
||||
'value'=>$model->userName
|
||||
],
|
||||
['attribute'=>'id_account',
|
||||
'value'=>$model->accountName
|
||||
],
|
||||
'created_at:datetime',
|
||||
],
|
||||
]) ?>
|
||||
|
||||
<?php // echo $this->render('_search', ['model' => $searchModel]); ?>
|
||||
<?php echo $this->render('_search', ['model' => $searchModel]); ?>
|
||||
|
||||
|
||||
<p>
|
||||
<?= Html::a(Yii::t('common/inventory', 'Új termék felvétele a leltárba'), ['inventory-item/create','id' =>$model->id_inventory], ['class' => 'btn btn-success']) ?>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Magyarázat:
|
||||
@ -59,6 +69,10 @@ $this->params['breadcrumbs'][] = $this->title;
|
||||
</ul>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<?php echo Html::a("XLS letöltése", Url::current(['InventoryItemSearch[output]' =>'xls']),['class' =>'btn btn-primary'])?>
|
||||
</p>
|
||||
|
||||
<?php
|
||||
echo GridView::widget( [
|
||||
'dataProvider' => $dataProvider,
|
||||
@ -114,16 +128,14 @@ $this->params['breadcrumbs'][] = $this->title;
|
||||
|
||||
],
|
||||
['class' => 'yii\grid\ActionColumn',
|
||||
'template' => '{delete}',
|
||||
'template' => '',
|
||||
'urlCreator' => function ($action, $model, $key, $index){
|
||||
return Url::to(['inventory-item/delete', 'id' => $model['item_id_inventory_item' ] ]) ;
|
||||
return Url::to(['inventory-item/update', 'id' => $model['item_id_inventory_item' ] ]) ;
|
||||
},
|
||||
'buttons' =>[
|
||||
'delete' =>function ($url, $model, $key) {
|
||||
return Html::a('Törlés', $url,['class' => 'btn btn-xs btn-danger',
|
||||
'update' =>function ($url, $model, $key) {
|
||||
return Html::a('Módosítás', $url,['class' => 'btn btn-xs btn-success',
|
||||
'data' => [
|
||||
'confirm' => Yii::t('common/inventory-item', 'Biztosan törlöd ezt az elemet?'),
|
||||
'method' => 'post',
|
||||
],
|
||||
]) ;
|
||||
}
|
||||
|
||||
@ -1,13 +1,12 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\DetailView;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model common\models\InventoryItem */
|
||||
|
||||
$this->title = Yii::t('common/inventory-item', 'Update {modelClass}: ', [
|
||||
'modelClass' => 'Inventory Item',
|
||||
]) . ' ' . $model->id_inventory_item;
|
||||
$this->title = Yii::t('common/inventory-item', 'Leltár termék');
|
||||
$this->params['breadcrumbs'][] = ['label' => Yii::t('common/inventory-item', 'Inventory Items'), 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = ['label' => $model->id_inventory_item, 'url' => ['view', 'id' => $model->id_inventory_item]];
|
||||
$this->params['breadcrumbs'][] = Yii::t('common/inventory-item', 'Update');
|
||||
@ -16,6 +15,37 @@ $this->params['breadcrumbs'][] = Yii::t('common/inventory-item', 'Update');
|
||||
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
|
||||
<h2>Leltár</h2>
|
||||
<?= DetailView::widget([
|
||||
'model' => $inventory,
|
||||
'attributes' => [
|
||||
'id_inventory',
|
||||
'name',
|
||||
['attribute'=>'id_user',
|
||||
'value'=>$inventory->userName
|
||||
],
|
||||
['attribute'=>'id_account',
|
||||
'value'=>$inventory->accountName
|
||||
],
|
||||
'created_at:datetime',
|
||||
],
|
||||
]) ?>
|
||||
|
||||
<h2>Termék</h2>
|
||||
<?= DetailView::widget([
|
||||
'model' => $model,
|
||||
'attributes' => [
|
||||
[
|
||||
|
||||
'value' => $model->name,
|
||||
'label' =>"Név"
|
||||
],
|
||||
|
||||
|
||||
|
||||
],
|
||||
]) ?>
|
||||
|
||||
<?= $this->render('_form', [
|
||||
'model' => $model,
|
||||
]) ?>
|
||||
|
||||
@ -2,18 +2,27 @@
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
use common\models\Account;
|
||||
use common\components\Helper;
|
||||
use frontend\components\HtmlHelper;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model common\models\Inventory */
|
||||
/* @var $form yii\widgets\ActiveForm */
|
||||
?>
|
||||
|
||||
<?php
|
||||
|
||||
$accounts = ['' =>'Mind'] + HtmlHelper::mkAccountOptions( Account::readAccounts() );
|
||||
?>
|
||||
|
||||
<div class="inventory-form">
|
||||
|
||||
<?php $form = ActiveForm::begin(); ?>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<?php echo $form->field($model, "id_account")->dropDownList($accounts)?>
|
||||
<?php echo $form->field($model, "name")->textInput()?>
|
||||
<?= Html::submitButton($model->isNewRecord ? Yii::t('common/inventory', 'Létrehoz') : Yii::t('common/inventory', 'Módosít'), [ 'name'=>'Inventory[submit]' ,'class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
|
||||
</div>
|
||||
|
||||
@ -17,7 +17,7 @@ $this->params['breadcrumbs'][] = $this->title;
|
||||
<?php // echo $this->render('_search', ['model' => $searchModel]); ?>
|
||||
|
||||
<p>
|
||||
<?= Html::a(Yii::t('common/inventory', 'Új leltár'), ['create'], ['class' => 'btn btn-success']) ?>
|
||||
<?php //echo Html::a(Yii::t('common/inventory', 'Új leltár'), ['create'], ['class' => 'btn btn-success']) ?>
|
||||
</p>
|
||||
|
||||
<?= GridView::widget([
|
||||
|
||||
65
backend/views/transfer/_search_payment_later.php
Normal file
65
backend/views/transfer/_search_payment_later.php
Normal file
@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
use kartik\widgets\DatePicker;
|
||||
use frontend\components\HtmlHelper;
|
||||
use common\models\Transfer;
|
||||
use kartik\widgets\DateTimePicker;
|
||||
use common\models\TicketType;
|
||||
use common\models\User;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model common\models\TransferSearch */
|
||||
/* @var $form yii\widgets\ActiveForm */
|
||||
?>
|
||||
|
||||
<?php
|
||||
$userOptions = ['' => 'Mind'] + HtmlHelper::mkOptions(User::find()->all(),'id','username');
|
||||
$ticketTypeOptions = ['' => 'Mind'] + HtmlHelper::mkTicketTypeOptions(TicketType::find()->all());
|
||||
?>
|
||||
|
||||
<div class="transfer-search">
|
||||
|
||||
<?php $form = ActiveForm::begin([
|
||||
// 'action' => ['list'],
|
||||
'method' => 'get',
|
||||
]); ?>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<?= $form->field($model, 'start')->widget(DateTimePicker::classname(), [
|
||||
'pluginOptions' => [
|
||||
'autoclose'=>true,
|
||||
'format' => 'yyyy.mm.dd hh:ii'
|
||||
]
|
||||
]) ?>
|
||||
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<?= $form->field($model, 'end') ->widget(DateTimePicker::classname(), [
|
||||
'pluginOptions' => [
|
||||
'autoclose'=>true,
|
||||
'format' => 'yyyy.mm.dd hh:ii'
|
||||
]
|
||||
]) ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<?= $form->field($model, 'id_ticket_type')->dropDownList($ticketTypeOptions)->label("Bérlet típus") ?>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<?= $form->field($model, 'id_user')->dropDownList($userOptions) ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton(Yii::t('frontend/transfer', 'Search'), ['class' => 'btn btn-primary']) ?>
|
||||
</div>
|
||||
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
||||
</div>
|
||||
129
backend/views/transfer/payment_later.php
Normal file
129
backend/views/transfer/payment_later.php
Normal file
@ -0,0 +1,129 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\grid\GridView;
|
||||
use yii\widgets\DetailView;
|
||||
use yii\base\Widget;
|
||||
use yii\base\Object;
|
||||
use yii\data\ArrayDataProvider;
|
||||
use common\components\AccountStatisticWidget;
|
||||
use common\components\DataProviderTotal;
|
||||
use common\components\Helper;
|
||||
use common\models\Transfer;
|
||||
use yii\helpers\VarDumper;
|
||||
use yii\widgets\ActiveForm;
|
||||
use yii\helpers\Url;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $searchModel backend\models\TransferSearch */
|
||||
/* @var $dataProvider yii\data\ActiveDataProvider */
|
||||
|
||||
$this->title = "Tranzakciók későbbi utalás fizetés típussal";
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
|
||||
?>
|
||||
<style>
|
||||
.table-transfer .money,
|
||||
.table-transfer .count,
|
||||
.table-transfer .item-price
|
||||
{
|
||||
text-align: right;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="transfer-index">
|
||||
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
<?php echo $this->render('_search_payment_later', ['model' => $searchModel, ]); ?>
|
||||
|
||||
|
||||
<div style="margin-bottom: 6px;">
|
||||
<?php
|
||||
echo Html::a("Összes kiválasztása",null, ['class' => 'btn btn-primary select-all' ,'style' => 'margin-right: 6px;',
|
||||
'onclick' => "$('.table-transfer').find(\"input[type='checkbox']\").prop('checked',true);"
|
||||
]);
|
||||
echo Html::a("Egyiket sem",null, ['class' => 'btn btn-primary deselect-all',
|
||||
'onclick' => "$('.table-transfer').find(\"input[type='checkbox']\").prop('checked',false);"
|
||||
|
||||
]);
|
||||
|
||||
?>
|
||||
</div>
|
||||
<div class="transfer-form">
|
||||
|
||||
<?php $form = ActiveForm::begin(
|
||||
[ 'action' => Url::current() ]
|
||||
); ?>
|
||||
<p>
|
||||
Összesen: <?php echo $searchModel->total_money;?> Ft
|
||||
</p>
|
||||
<?= GridView::widget([
|
||||
'tableOptions' => ['class' => 'table table-striped table-bordered table-transfer'],
|
||||
'dataProvider' => $dataProvider,
|
||||
'showFooter'=>TRUE,
|
||||
|
||||
'columns' => [
|
||||
[
|
||||
'label' => '',
|
||||
'value' => function ($model, $key, $index, $column) use ( &$searchModel){
|
||||
|
||||
|
||||
return Html::checkbox(Html::getInputName($searchModel, 'selected[]') , in_array($model['transfer_id_transfer'], $searchModel->selected) , [ 'class' => 'cart-item', 'value' => $model['transfer_id_transfer']] );
|
||||
},
|
||||
'format' => 'raw'
|
||||
],
|
||||
[
|
||||
'attribute' => 'user_username',
|
||||
'label' => 'Felhasználó'
|
||||
],
|
||||
[
|
||||
'attribute' => 'customer_name',
|
||||
'label' => 'Vendég'
|
||||
],
|
||||
[
|
||||
'attribute' => 'ticket_type_name',
|
||||
'label' => 'Bérlet típus'
|
||||
],
|
||||
[
|
||||
'attribute' => 'ticket_start',
|
||||
'label' => 'Érvényes -tól',
|
||||
'format' => 'date'
|
||||
],
|
||||
[
|
||||
'attribute' => 'ticket_end',
|
||||
'label' => 'Érvényes -ig',
|
||||
'format' => 'date'
|
||||
],
|
||||
[
|
||||
'attribute' => 'product_name',
|
||||
'label' => 'Termék'
|
||||
],
|
||||
[
|
||||
'attribute' => 'transfer_created_at',
|
||||
'label' => 'Kiadva',
|
||||
'format' => 'datetime'
|
||||
],
|
||||
[
|
||||
'attribute' => 'transfer_money',
|
||||
'label' => 'Összeg'
|
||||
],
|
||||
[
|
||||
'attribute' => 'transfer_status',
|
||||
'label' => 'Státusz',
|
||||
'value' => function ($model, $key, $index, $column){
|
||||
return Helper::getArrayValue(Transfer::statuses(), $model['transfer_status'],'');
|
||||
},
|
||||
],
|
||||
],
|
||||
]); ?>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton( 'Fizetettnek jelöl', [ 'class' => 'btn btn-success' ] ) ?>
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
58
backend/web/js/inventory.item.index.js
Normal file
58
backend/web/js/inventory.item.index.js
Normal file
@ -0,0 +1,58 @@
|
||||
|
||||
|
||||
var inventoryItemIndex = {
|
||||
|
||||
defaults : {
|
||||
products: [],
|
||||
selector_type : '#inventoryitemsearch-item_type',
|
||||
selector_name : '#inventoryitemsearch-item_name',
|
||||
selector_id : '#inventoryitemsearch-item_id',
|
||||
},
|
||||
product: null,
|
||||
init: function(o){
|
||||
this.defaults = $.extend( this.defaults, o );
|
||||
this.initAutocomplete();
|
||||
|
||||
},
|
||||
|
||||
initAutocomplete : function (){
|
||||
var self = this;
|
||||
|
||||
var $input = $(self.defaults.selector_name);
|
||||
$input.typeahead({source : self.defaults.products,
|
||||
autoSelect: true,
|
||||
items: 20,
|
||||
minLength: 3,
|
||||
});
|
||||
$input.change(function() {
|
||||
var current = $input.typeahead("getActive");
|
||||
$("#filter_text").val('');
|
||||
if (current) {
|
||||
// Some item from your model is active!
|
||||
if (current.name == $input.val()) {
|
||||
self.product = current;
|
||||
} else {
|
||||
self.product = null;
|
||||
}
|
||||
} else {
|
||||
self.product = null;
|
||||
}
|
||||
self.productChange();
|
||||
});
|
||||
},
|
||||
productChange: function( ){
|
||||
this.clearProductData();
|
||||
this.setProductData();
|
||||
},
|
||||
clearProductData: function(){
|
||||
$(this.defaults.selector_type).val('');
|
||||
$(this.defaults.selector_id).val('');
|
||||
},
|
||||
setProductData: function(){
|
||||
if ( this.product ){
|
||||
$(this.defaults.selector_type).val( this.product.type);
|
||||
$(this.defaults.selector_id ).val( this.product.id);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@ -1,3 +1,5 @@
|
||||
-0.0.55
|
||||
- new type transfer later
|
||||
-0.0.54
|
||||
- add ticket usage count increment trigger
|
||||
- add log
|
||||
|
||||
@ -4,7 +4,7 @@ return [
|
||||
'supportEmail' => 'rocho02@gmail.com',
|
||||
'infoEmail' => 'info@rocho-net.hu',
|
||||
'user.passwordResetTokenExpire' => 3600,
|
||||
'version' => 'v0.0.54',
|
||||
'version' => 'v0.0.55',
|
||||
'company' => 'movar',//gyor
|
||||
'company_name' => "Freimann Kft.",
|
||||
'product_visiblity' => 'account',// on reception which products to display. account or global
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
<b>Felhasználó:</b> <?php echo $model->username ;?><br>
|
||||
<b>Idő:</b> <?php echo \Yii::$app->formatter->asDatetime(time());?><br>
|
||||
<?php
|
||||
if ( isset($geoip->city)){
|
||||
if ( isset($geoip) && isset($geoip->city)){
|
||||
?>
|
||||
<b>Ip cím:</b> <?php echo $geoip->ip?><br>
|
||||
<b>Város:</b> <?php echo $geoip->city?><br>
|
||||
|
||||
@ -5,12 +5,16 @@ namespace common\models;
|
||||
use Yii;
|
||||
use common\components\UserAwareBehavior;
|
||||
use yii\helpers\ArrayHelper;
|
||||
use yii\db\Query;
|
||||
use backend\models\InventoryItemForm;
|
||||
use common\components\AccountAwareBehavior;
|
||||
|
||||
/**
|
||||
* This is the model class for table "inventory".
|
||||
*
|
||||
* @property integer $id_inventory
|
||||
* @property integer $id_user
|
||||
* @property integer $id_account
|
||||
* @property string $name
|
||||
* @property string $created_at
|
||||
* @property string $updated_at
|
||||
@ -27,13 +31,15 @@ class Inventory extends \common\models\BaseFitnessActiveRecord
|
||||
return 'inventory';
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
[['name'], 'string']
|
||||
[['name'], 'string'],
|
||||
[['id_account'], 'integer'],
|
||||
];
|
||||
}
|
||||
|
||||
@ -46,6 +52,7 @@ class Inventory extends \common\models\BaseFitnessActiveRecord
|
||||
'id_inventory' => Yii::t('common/inventory', 'Leltár azonosító'),
|
||||
'name' => Yii::t('common/inventory', 'Megnevezés'),
|
||||
'id_user' => Yii::t('common/inventory', 'Felhasználó'),
|
||||
'id_account' => Yii::t('common/inventory', 'Kassza'),
|
||||
'created_at' => Yii::t('common/inventory', 'Létrehozás'),
|
||||
'updated_at' => Yii::t('common/inventory', 'Módosítás'),
|
||||
];
|
||||
@ -59,7 +66,59 @@ class Inventory extends \common\models\BaseFitnessActiveRecord
|
||||
return ArrayHelper::merge( [
|
||||
[
|
||||
'class' => UserAwareBehavior::className(),
|
||||
],
|
||||
[
|
||||
'class' => AccountAwareBehavior::className()
|
||||
|
||||
]
|
||||
], parent::behaviors());
|
||||
}
|
||||
|
||||
public function afterSave($insert, $changedAttributes){
|
||||
if ( $insert ){
|
||||
|
||||
$query = Product::find();
|
||||
if ( isset($this->id_account) && is_numeric($this->id_account)){
|
||||
$query->andWhere(['id_account' => $this->id_account]);
|
||||
|
||||
}
|
||||
// $query->andWhere("product.id_inventory_group is null");
|
||||
$products = $query->all();
|
||||
|
||||
echo "Products found: " . count($products);
|
||||
|
||||
$inventoryGroups = InventoryGroup::find()->all();
|
||||
|
||||
|
||||
foreach ($products as $product){
|
||||
$form = new InventoryItemForm(
|
||||
[
|
||||
'inventory' => $this,
|
||||
'id_product' => $product->id_product,
|
||||
'product' => $product,
|
||||
'type' => 'product'
|
||||
]
|
||||
);
|
||||
$form->save();
|
||||
}
|
||||
|
||||
foreach ($inventoryGroups as $group){
|
||||
$form = new InventoryItemForm(
|
||||
[
|
||||
'inventory' => $this,
|
||||
'id_product' => $group->id_inventory_group,
|
||||
'inventoryGroup' => $group,
|
||||
'type' => 'group'
|
||||
]
|
||||
);
|
||||
$form->save();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -6,6 +6,7 @@ use Yii;
|
||||
use yii\helpers\ArrayHelper;
|
||||
use common\components\UserAwareBehavior;
|
||||
use common\components\Helper;
|
||||
use common\components\ProductAwareBehavior;
|
||||
|
||||
/**
|
||||
* This is the model class for table "inventory_item".
|
||||
@ -45,6 +46,8 @@ class InventoryItem extends BaseFitnessActiveRecord
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
[['count'],'integer'] ,
|
||||
[['count'],'required'] ,
|
||||
];
|
||||
}
|
||||
|
||||
@ -58,7 +61,7 @@ class InventoryItem extends BaseFitnessActiveRecord
|
||||
'id_inventory' => Yii::t('common/inventory_item', 'Id Inventory'),
|
||||
'count_in' => Yii::t('common/inventory_item', 'Count In'),
|
||||
'count_sold' => Yii::t('common/inventory_item', 'Count Sold'),
|
||||
'count' => Yii::t('common/inventory_item', 'Count'),
|
||||
'count' => Yii::t('common/inventory_item', 'Leltározott mennyiség'),
|
||||
'type' => Yii::t('common/inventory_item', 'Type'),
|
||||
'id_product' => Yii::t('common/inventory_item', 'Id Product'),
|
||||
'id_inventory_group' => Yii::t('common/inventory_item', 'Id Inventory Group'),
|
||||
@ -72,6 +75,9 @@ class InventoryItem extends BaseFitnessActiveRecord
|
||||
return ArrayHelper::merge( [
|
||||
[
|
||||
'class' => UserAwareBehavior::className(),
|
||||
],
|
||||
[
|
||||
'class' => ProductAwareBehavior::className(),
|
||||
]
|
||||
], parent::behaviors());
|
||||
}
|
||||
@ -133,4 +139,18 @@ class InventoryItem extends BaseFitnessActiveRecord
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function afterSave($insert, $changedAttributes){
|
||||
if ( !$insert ){
|
||||
if ( $this->type == 'product'){
|
||||
$product = $this->product;
|
||||
$product->stock = $this->count;
|
||||
if ( !$product->save(false) ){
|
||||
\Yii::error("Failed to save product stock");
|
||||
throw new \Exception("A leltár elem mentése nem sikerült");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -264,4 +264,36 @@ class Product extends \common\models\BaseFitnessActiveRecord {
|
||||
$product->stock = $product->stock - $count;
|
||||
}
|
||||
|
||||
|
||||
public static function readProductsNotPartOfInventoryGroup( $id_account = null ){
|
||||
$query = Product::find();
|
||||
$query->andWhere("id_inventory_group is null");
|
||||
$query->andWhere(['status' => Product::STATUS_ACTIVE]);
|
||||
return $query->all();
|
||||
}
|
||||
|
||||
public static function readInventoryGroups(){
|
||||
$query = InventoryGroup::find();
|
||||
$query->andWhere(['status' => Product::STATUS_ACTIVE]);
|
||||
return $query->all();
|
||||
}
|
||||
|
||||
public static function buildProductAndInventoryGroupList($id_account = null){
|
||||
$productOptions = [];
|
||||
|
||||
$products = Product::readProductsNotPartOfInventoryGroup($id_account);
|
||||
$inventoryGroups = Product::readInventoryGroups();
|
||||
|
||||
foreach ($products as $product ){
|
||||
$productOptions[]= [ 'type' =>'product', 'id' => $product->id_product ,'name' => $product->name . " (Termék/" .$product->productCategoryName ."/" . $product->accountName .")" ];
|
||||
}
|
||||
|
||||
foreach ($inventoryGroups as $inventoryGroup ){
|
||||
$productOptions[] = ['type' =>'group', 'id' =>$inventoryGroup->id_inventory_group ,'name' =>$inventoryGroup->name ."/Termékcsoport" ];
|
||||
|
||||
}
|
||||
return $productOptions;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -53,6 +53,7 @@ class Transfer extends \common\models\BaseFitnessActiveRecord {
|
||||
const PAYMENT_METHOD_CAFETERY = 40; // SZÉCHENYI KÁRTYA
|
||||
// const PAYMENT_METHOD_DEBIT_MANDATE = 50;//CSOPORTOS BESZEDÉSI MEGBÍZÁS
|
||||
|
||||
const PAYMENT_METHOD_TRANSFER_LATER = 50;
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
@ -526,11 +527,24 @@ class Transfer extends \common\models\BaseFitnessActiveRecord {
|
||||
self::PAYMENT_METHOD_CASH => Yii::t ( 'common/transfer', 'Készpénz' ),
|
||||
self::PAYMENT_METHOD_BANCCARD => Yii::t ( 'common/transfer', 'Bankkártyás fizetés' ),
|
||||
self::PAYMENT_METHOD_TRANSFER => Yii::t ( 'common/transfer', 'Átutalás' ),
|
||||
self::PAYMENT_METHOD_CAFETERY => Yii::t ( 'common/transfer', 'Széchenyi kártya' )
|
||||
self::PAYMENT_METHOD_CAFETERY => Yii::t ( 'common/transfer', 'Széchenyi kártya' ),
|
||||
self::PAYMENT_METHOD_TRANSFER_LATER => Yii::t ( 'common/transfer', 'Átutalás később' )
|
||||
]
|
||||
// self::PAYMENT_METHOD_DEBIT_MANDATE => Yii::t('common/transfer','Csoportos beszedési megbízás'),
|
||||
;
|
||||
}
|
||||
|
||||
public static function paymentMethodsForProduct() {
|
||||
return [
|
||||
self::PAYMENT_METHOD_CASH => Yii::t ( 'common/transfer', 'Készpénz' ),
|
||||
self::PAYMENT_METHOD_BANCCARD => Yii::t ( 'common/transfer', 'Bankkártyás fizetés' ),
|
||||
self::PAYMENT_METHOD_TRANSFER => Yii::t ( 'common/transfer', 'Átutalás' ),
|
||||
self::PAYMENT_METHOD_CAFETERY => Yii::t ( 'common/transfer', 'Széchenyi kártya' ),
|
||||
]
|
||||
// self::PAYMENT_METHOD_DEBIT_MANDATE => Yii::t('common/transfer','Csoportos beszedési megbízás'),
|
||||
;
|
||||
}
|
||||
|
||||
public static function statuses() {
|
||||
return [
|
||||
self::STATUS_NOT_PAID => Yii::t ( 'common/transfer', 'Nincs fizetve' ),
|
||||
@ -946,7 +960,7 @@ class Transfer extends \common\models\BaseFitnessActiveRecord {
|
||||
ShoppingCart::deleteAll(['id_transfer' => $this->id_transfer]);
|
||||
UserSoldItem::deleteAll(['id_transfer' => $this->id_transfer]);
|
||||
}
|
||||
public function payout() {
|
||||
public function payout($id_account = null) {
|
||||
|
||||
if ($this->status != Transfer::STATUS_NOT_PAID) {
|
||||
return false;
|
||||
@ -956,14 +970,18 @@ class Transfer extends \common\models\BaseFitnessActiveRecord {
|
||||
$this->paid_at = Helper::getDateTimeString ();
|
||||
$this->paid_by = \Yii::$app->user->id;
|
||||
|
||||
if ( isset($id_account)){
|
||||
$this->id_account = $id_account;
|
||||
}else{
|
||||
if( Helper::isUserCartVisibilityAll() ){
|
||||
$this->id_account = Account::readDefault();
|
||||
}
|
||||
}
|
||||
|
||||
ShoppingCart::deleteAll ( [ 'id_transfer' => $this->id_transfer ] );
|
||||
UserSoldItem::deleteAll ( [ 'id_transfer' => $this->id_transfer
|
||||
] );
|
||||
return $this->save ();
|
||||
return $this->save (false);
|
||||
}
|
||||
|
||||
|
||||
@ -1067,4 +1085,19 @@ class Transfer extends \common\models\BaseFitnessActiveRecord {
|
||||
|
||||
return [$transfer,$ticket];
|
||||
}
|
||||
|
||||
public static function canBeAddedToCart($payment_method) {
|
||||
if ( $payment_method == Transfer::PAYMENT_METHOD_TRANSFER_LATER){
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static function canMarkPaidByReception($payment_method) {
|
||||
if ( $payment_method == Transfer::PAYMENT_METHOD_TRANSFER_LATER){
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -23,18 +23,24 @@
|
||||
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<?php if ( count($model->moneyMovements ) == 0 ) {
|
||||
?>
|
||||
<tr>
|
||||
<td colspan="7" style="text-align: right; padding: 3px;">
|
||||
Nincs találat
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}else{?>
|
||||
}?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
<?php if ( count($model->moneyMovements ) > 0 ) {
|
||||
?>
|
||||
<div class="row">
|
||||
<div class="col-md-12 text-right" style="text-decoration: underline;">
|
||||
Összesen: <?php echo \Yii::$app->formatter->asInteger( $model->moneyMovementMoneis); ?> Ft
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
|
||||
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
use yii\db\Schema;
|
||||
use yii\db\Migration;
|
||||
|
||||
class m160321_082725_alter__inventory__add__column__id_account extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
$this->addColumn("inventory", "id_account", "int");
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
echo "m160321_082725_alter__inventory__add__column__id_account cannot be reverted.\n";
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
// Use safeUp/safeDown to run migration code within a transaction
|
||||
public function safeUp()
|
||||
{
|
||||
}
|
||||
|
||||
public function safeDown()
|
||||
{
|
||||
}
|
||||
*/
|
||||
}
|
||||
39
console/migrations/m160324_203543_devlog.php
Normal file
39
console/migrations/m160324_203543_devlog.php
Normal file
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
use yii\db\Schema;
|
||||
use yii\db\Migration;
|
||||
|
||||
class m160324_203543_devlog extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
$tableOptions = null;
|
||||
if ($this->db->driverName === 'mysql') {
|
||||
// http://stackoverflow.com/questions/766809/whats-the-difference-between-utf8-general-ci-and-utf8-unicode-ci
|
||||
$tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB';
|
||||
}
|
||||
|
||||
$this->createTable( '{{%devlog}}', [
|
||||
'id_devlog' => $this->primaryKey(),
|
||||
'msg' => $this->string(),
|
||||
], $tableOptions );
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
echo "m160324_203543_devlog cannot be reverted.\n";
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
// Use safeUp/safeDown to run migration code within a transaction
|
||||
public function safeUp()
|
||||
{
|
||||
}
|
||||
|
||||
public function safeDown()
|
||||
{
|
||||
}
|
||||
*/
|
||||
}
|
||||
30
frontend/assets/InventoryItemIndexAsset.php
Normal file
30
frontend/assets/InventoryItemIndexAsset.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
/**
|
||||
* @link http://www.yiiframework.com/
|
||||
* @copyright Copyright (c) 2008 Yii Software LLC
|
||||
* @license http://www.yiiframework.com/license/
|
||||
*/
|
||||
|
||||
namespace frontend\assets;
|
||||
|
||||
use yii\web\AssetBundle;
|
||||
|
||||
/**
|
||||
* @author Qiang Xue <qiang.xue@gmail.com>
|
||||
* @since 2.0
|
||||
*/
|
||||
class InventoryItemIndexAsset extends AssetBundle
|
||||
{
|
||||
public $basePath = '@webroot';
|
||||
public $baseUrl = '@web';
|
||||
public $css = [
|
||||
];
|
||||
public $js = [
|
||||
'js/inventory.item.index.js',
|
||||
];
|
||||
public $depends = [
|
||||
'frontend\assets\AppAsset',
|
||||
'yii\jui\JuiAsset',
|
||||
'common\assets\TypeAheadAsset',
|
||||
];
|
||||
}
|
||||
@ -22,6 +22,7 @@ class AccountStateBanknoteCountWidget extends Widget{
|
||||
public $model;
|
||||
public $layout;
|
||||
public $index;
|
||||
public $showDailyDownload = true;
|
||||
|
||||
public function run(){
|
||||
|
||||
@ -60,12 +61,14 @@ class AccountStateBanknoteCountWidget extends Widget{
|
||||
$s .= Html::a( Html::tag("span","",['class' =>'glyphicon glyphicon-download-alt']) ." Pdf", Url::to([ 'view', 'id' =>$this->model->id_account_state, 'output' =>'pdf']) ,['class' => 'btn btn-primary btn-pdf','style' =>'margin-bottom: 12px; margin-right: 6px;']);
|
||||
|
||||
if ( $this->model->isTypeClose() ){
|
||||
if ( $this->showDailyDownload ){
|
||||
$s .= Html::a('<span class="glyphicon glyphicon-eye-open"></span> Napi összefoglaló', Url::toRoute(['mixed','id' =>$this->model->id_account_state]), [
|
||||
'title' => 'Napi összefoglaló',
|
||||
'class' => 'btn btn-success',
|
||||
'style' =>'margin-bottom: 12px; margin-right: 6px;'
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
$s .= Html::a('<span class="glyphicon glyphicon-eye-open"></span> Részletek', Url::toRoute(['view','id' =>$this->model->id_account_state]), [
|
||||
'title' => 'Részletek',
|
||||
|
||||
@ -88,7 +88,8 @@ class FrontendMenuStructure{
|
||||
// }
|
||||
|
||||
$items[] = ['label' => Yii::t('frontend/card','Vendégek'), 'url' => [ '/card/index' ] ];
|
||||
$items[] = ['label' => Yii::t('frontend/card','Leltár'), 'url' => [ '/product/inventory' ] ];
|
||||
// $items[] = ['label' => Yii::t('frontend/card','Leltár'), 'url' => [ '/product/inventory' ] ];
|
||||
$items[] = ['label' => Yii::t('frontend/card','Leltár'), 'url' => [ '/inventory/index' ] ];
|
||||
|
||||
|
||||
$this->menuItems[] = ['label' => Yii::t('frontend/account', 'Account'),
|
||||
|
||||
86
frontend/controllers/InventoryController.php
Normal file
86
frontend/controllers/InventoryController.php
Normal file
@ -0,0 +1,86 @@
|
||||
<?php
|
||||
|
||||
namespace frontend\controllers;
|
||||
|
||||
use Yii;
|
||||
use common\models\Inventory;
|
||||
use frontend\models\InventorySearch;
|
||||
use yii\web\Controller;
|
||||
use yii\web\NotFoundHttpException;
|
||||
use yii\filters\VerbFilter;
|
||||
use common\models\User;
|
||||
|
||||
/**
|
||||
* InventoryController implements the CRUD actions for Inventory model.
|
||||
*/
|
||||
class InventoryController extends Controller
|
||||
{
|
||||
public function behaviors()
|
||||
{
|
||||
return [
|
||||
'verbs' => [
|
||||
'class' => VerbFilter::className(),
|
||||
'actions' => [
|
||||
'delete' => ['post'],
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists all Inventory models.
|
||||
* @return mixed
|
||||
*/
|
||||
public function actionIndex()
|
||||
{
|
||||
$searchModel = new InventorySearch();
|
||||
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
|
||||
|
||||
return $this->render('index', [
|
||||
'searchModel' => $searchModel,
|
||||
'dataProvider' => $dataProvider,
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Creates a new Inventory model.
|
||||
* If creation is successful, the browser will be redirected to the 'view' page.
|
||||
* @return mixed
|
||||
*/
|
||||
public function actionCreate()
|
||||
{
|
||||
$model = new Inventory();
|
||||
$user = User::findOne(\Yii::$app->user->id);
|
||||
|
||||
|
||||
$model->name = 'Leltár_'.date('Ymd_His') .'_' . $user->username;
|
||||
|
||||
$model->id_user = \Yii::$app->user->id;
|
||||
if ($model->load(Yii::$app->request->post()) && $model->save()) {
|
||||
return $this->redirect(['inventory-item/index', 'id' => $model->id_inventory]);
|
||||
} else {
|
||||
}
|
||||
return $this->render('create', [
|
||||
'model' => $model,
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Finds the Inventory model based on its primary key value.
|
||||
* If the model is not found, a 404 HTTP exception will be thrown.
|
||||
* @param integer $id
|
||||
* @return Inventory the loaded model
|
||||
* @throws NotFoundHttpException if the model cannot be found
|
||||
*/
|
||||
protected function findModel($id)
|
||||
{
|
||||
if (($model = Inventory::findOne($id)) !== null) {
|
||||
return $model;
|
||||
} else {
|
||||
throw new NotFoundHttpException('The requested page does not exist.');
|
||||
}
|
||||
}
|
||||
}
|
||||
228
frontend/controllers/InventoryItemController.php
Normal file
228
frontend/controllers/InventoryItemController.php
Normal file
@ -0,0 +1,228 @@
|
||||
<?php
|
||||
|
||||
namespace frontend\controllers;
|
||||
|
||||
use Yii;
|
||||
use common\models\InventoryItem;
|
||||
use frontend\models\InventoryItemSearch;
|
||||
use yii\web\Controller;
|
||||
use yii\web\NotFoundHttpException;
|
||||
use yii\filters\VerbFilter;
|
||||
use backend\models\InventoryItemForm;
|
||||
use common\models\Inventory;
|
||||
use yii\helpers\Url;
|
||||
use common\models\Product;
|
||||
|
||||
/**
|
||||
* InventoryItemController implements the CRUD actions for InventoryItem model.
|
||||
*/
|
||||
class InventoryItemController extends Controller
|
||||
{
|
||||
public function behaviors()
|
||||
{
|
||||
return [
|
||||
'verbs' => [
|
||||
'class' => VerbFilter::className(),
|
||||
'actions' => [
|
||||
'delete' => ['post'],
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists all InventoryItem models.
|
||||
* @return mixed
|
||||
*/
|
||||
public function actionIndex($id)
|
||||
{
|
||||
$inventory = Inventory::findOne($id);
|
||||
|
||||
if ( !isset($inventory)){
|
||||
throw new NotFoundHttpException("Leltár nem található");
|
||||
}
|
||||
|
||||
$searchModel = new InventoryItemSearch(['inventory' => $inventory]);
|
||||
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
|
||||
|
||||
$productOptions = Product::buildProductAndInventoryGroupList();
|
||||
|
||||
if ($searchModel->output == 'xls') {
|
||||
$this->downloadIndexXls($dataProvider);
|
||||
}else{
|
||||
Url::remember(Url::current(),"inventory-item-index");
|
||||
}
|
||||
|
||||
|
||||
return $this->render('index', [
|
||||
'model' => $inventory,
|
||||
'searchModel' => $searchModel,
|
||||
'dataProvider' => $dataProvider,
|
||||
'productOptions' =>$productOptions
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
protected function downloadIndexXls($dataProvider){
|
||||
|
||||
|
||||
$defs = [['item_created_at', 'Létrehozva'],
|
||||
['item_name', 'Termék/Termék csoport'],
|
||||
['user_username', 'Felhasználó'],
|
||||
['item_count_prev', 'Előző leltár (db)'],
|
||||
['item_count_sold', 'Eladott mennyiség (db)'],
|
||||
['item_count_in', 'Beszerzett mennyiség (db)'],
|
||||
['item_count', 'Leltározott mennyiség (db)'],
|
||||
['item_difference', 'Különbség (db)'],
|
||||
['item_count_system', 'Rendszer szerinti mennyiség (db)'],
|
||||
];
|
||||
$cols = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P'];
|
||||
|
||||
$models = $dataProvider->getModels ();
|
||||
$objPHPExcel = new \PHPExcel ();
|
||||
|
||||
$sheet = $objPHPExcel->setActiveSheetIndex ( 0 );
|
||||
/**
|
||||
* Termék azonosító Termék neve Termék szám Termék vonalkód Termék raktáron Termék eladva
|
||||
*/
|
||||
$row = 1;
|
||||
$col = 0;
|
||||
foreach ( $defs as $def ) {
|
||||
$sheet->setCellValue ( $cols [$col] . $row, $def [1] );
|
||||
$col ++;
|
||||
}
|
||||
|
||||
foreach ( $models as $model ) {
|
||||
$row ++;
|
||||
$col = 0;
|
||||
foreach ( $defs as $def ) {
|
||||
$sheet->setCellValue ( $cols [$col] . $row, $model[$def [0]] );
|
||||
$col ++;
|
||||
}
|
||||
}
|
||||
|
||||
$styleArray = array (
|
||||
'font' => array (
|
||||
'bold' => true
|
||||
)
|
||||
);
|
||||
// 'color' => array('rgb' => 'FF0000'),
|
||||
// 'size' => 15,
|
||||
// 'name' => 'Verdana'
|
||||
|
||||
|
||||
|
||||
foreach ( range ( 'A', 'I' ) as $columnID ) {
|
||||
$sheet->getColumnDimension ( $columnID )->setAutoSize ( true );
|
||||
$sheet->getStyle ( $columnID . '1' )->applyFromArray ( $styleArray );
|
||||
}
|
||||
|
||||
// Redirect output to a client’s web browser (Excel5)
|
||||
header ( 'Content-Type: application/vnd.ms-excel' );
|
||||
header ( 'Content-Disposition: attachment;filename="leltar.xls"' );
|
||||
header ( 'Cache-Control: max-age=0' );
|
||||
// If you're serving to IE 9, then the following may be needed
|
||||
header ( 'Cache-Control: max-age=1' );
|
||||
// If you're serving to IE over SSL, then the following may be needed
|
||||
header ( 'Expires: Mon, 26 Jul 1997 05:00:00 GMT' ); // Date in the past
|
||||
header ( 'Last-Modified: ' . gmdate ( 'D, d M Y H:i:s' ) . ' GMT' ); // always modified
|
||||
header ( 'Cache-Control: cache, must-revalidate' ); // HTTP/1.1
|
||||
header ( 'Pragma: public' ); // HTTP/1.0
|
||||
$objWriter = \PHPExcel_IOFactory::createWriter ( $objPHPExcel, 'Excel5' );
|
||||
$objWriter->save ( 'php://output' );
|
||||
exit ();
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays a single InventoryItem model.
|
||||
* @param integer $id
|
||||
* @return mixed
|
||||
*/
|
||||
public function actionView($id)
|
||||
{
|
||||
return $this->render('view', [
|
||||
'model' => $this->findModel($id),
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new InventoryItem model.
|
||||
* If creation is successful, the browser will be redirected to the 'view' page.
|
||||
* @return mixed
|
||||
*/
|
||||
public function actionCreate($id)
|
||||
{
|
||||
$model = new InventoryItemForm([
|
||||
'id_inventory' => $id
|
||||
]);
|
||||
|
||||
$model->read();
|
||||
|
||||
if ($model->load(Yii::$app->request->post()) && $model->save()) {
|
||||
return $this->redirect(['inventory-item/index', 'id' => $model->inventory->id_inventory]);
|
||||
} else {
|
||||
return $this->render('create', [
|
||||
'model' => $model,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates an existing InventoryItem model.
|
||||
* If update is successful, the browser will be redirected to the 'view' page.
|
||||
* @param integer $id
|
||||
* @return mixed
|
||||
*/
|
||||
public function actionUpdate($id)
|
||||
{
|
||||
$model = $this->findModel($id);
|
||||
$inventory = Inventory::findOne($model->id_inventory);
|
||||
|
||||
if ($model->load(Yii::$app->request->post()) && $model->save()) {
|
||||
|
||||
$prev = Url::previous("inventory-item-index");
|
||||
if ( isset($prev)){
|
||||
return $this->redirect($prev);
|
||||
}else{
|
||||
return $this->redirect([ 'index', 'id' => $inventory->id_inventory ]);
|
||||
}
|
||||
|
||||
} else {
|
||||
return $this->render('update', [
|
||||
'model' => $model,
|
||||
'inventory' => $inventory,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes an existing InventoryItem model.
|
||||
* If deletion is successful, the browser will be redirected to the 'index' page.
|
||||
* @param integer $id
|
||||
* @return mixed
|
||||
*/
|
||||
public function actionDelete($id)
|
||||
{
|
||||
$item = $this->findModel($id);
|
||||
$id_inventory = $item->id_inventory;
|
||||
$item->delete();
|
||||
|
||||
return $this->redirect(['index', 'id' => $id_inventory]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds the InventoryItem model based on its primary key value.
|
||||
* If the model is not found, a 404 HTTP exception will be thrown.
|
||||
* @param integer $id
|
||||
* @return InventoryItem the loaded model
|
||||
* @throws NotFoundHttpException if the model cannot be found
|
||||
*/
|
||||
protected function findModel($id)
|
||||
{
|
||||
if (($model = InventoryItem::findOne($id)) !== null) {
|
||||
return $model;
|
||||
} else {
|
||||
throw new NotFoundHttpException('The requested page does not exist.');
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -94,8 +94,11 @@ class SiteController extends Controller
|
||||
|
||||
$geoip = Helper::getGeoIp();
|
||||
|
||||
$message = "";
|
||||
$user = User::findOne(\Yii::$app->user->id);
|
||||
if ( isset($geoip)){
|
||||
$message = "Bejelentkezés: " .$user->username. " Ip cím:". $geoip->ip . " Város: " . $geoip->city;
|
||||
}
|
||||
|
||||
Log::log([
|
||||
'type' =>Log::$TYPE_LOGIN,
|
||||
|
||||
135
frontend/models/InventoryItemSearch.php
Normal file
135
frontend/models/InventoryItemSearch.php
Normal file
@ -0,0 +1,135 @@
|
||||
<?php
|
||||
|
||||
namespace frontend\models;
|
||||
|
||||
use Yii;
|
||||
use yii\base\Model;
|
||||
use yii\data\ActiveDataProvider;
|
||||
use common\models\InventoryItem;
|
||||
use yii\db\Query;
|
||||
use yii\db\Expression;
|
||||
use common\models\User;
|
||||
use common\models\Product;
|
||||
use common\models\InventoryGroup;
|
||||
use common\components\Helper;
|
||||
use common\models\Inventory;
|
||||
|
||||
/**
|
||||
* InventoryItemSearch represents the model behind the search form about `common\models\InventoryItem`.
|
||||
*/
|
||||
class InventoryItemSearch extends InventoryItem
|
||||
{
|
||||
public $inventory;
|
||||
public $output;
|
||||
public $item_name;
|
||||
public $item_type;
|
||||
public $item_id;
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
[['id_inventory_item', 'id_inventory', 'count_in', 'count_sold', 'count', 'type', 'id_product', 'id_inventory_group', 'id_user'], 'integer'],
|
||||
['output', 'string'],
|
||||
['item_name', 'string'],
|
||||
['item_type', 'string'],
|
||||
['item_id', 'integer'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function scenarios()
|
||||
{
|
||||
// bypass scenarios() implementation in the parent class
|
||||
return Model::scenarios();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates data provider instance with search query applied
|
||||
*
|
||||
* @param array $params
|
||||
*
|
||||
* @return ActiveDataProvider
|
||||
*/
|
||||
public function search($params)
|
||||
{
|
||||
$query = new Query();
|
||||
|
||||
$query->select([
|
||||
'inventory_item.id_inventory_item as item_id_inventory_item',
|
||||
'inventory_item.created_at as item_created_at',
|
||||
new Expression('case when inventory_item.id_product is null then inventory_group.name else product.name end as item_name'),
|
||||
'user.username as user_username',
|
||||
'coalesce(inventory_item.count_prev ,0)as item_count_prev',
|
||||
'coalesce(inventory_item.count_in,0) as item_count_in',
|
||||
'coalesce(inventory_item.count_sold,0) as item_count_sold',
|
||||
'coalesce(inventory_item.count,0) as item_count',
|
||||
'coalesce(inventory_item.count_system,0) as item_count_system',
|
||||
'inventory.created_at as inventory_created_at',
|
||||
'inventory_prev.id_inventory as inventory_prev_id_inventory',
|
||||
'inventory_prev.name as inventory_prev_name',
|
||||
new Expression('(coalesce(inventory_item.count,0) - ( coalesce(inventory_item.count_prev,0) + coalesce(inventory_item.count_in,0) - coalesce(inventory_item.count_sold,0) )) as item_difference'),
|
||||
]);
|
||||
|
||||
$query->from(InventoryItem::tableName());
|
||||
|
||||
|
||||
$query->innerJoin(User::tableName(), "user.id = inventory_item.id_user");
|
||||
$query->leftJoin(Product::tableName(), "product.id_product = inventory_item.id_product");
|
||||
$query->leftJoin(InventoryGroup::tableName(), "inventory_group.id_inventory_group = inventory_item.id_inventory_group");
|
||||
$query->leftJoin(Inventory::tableName(), "inventory.id_inventory = inventory_item.id_inventory");
|
||||
|
||||
$query->leftJoin( "inventory_item as item_prev", "item_prev.id_inventory_item = inventory_item.id_inventory_item_prev" );
|
||||
$query->leftJoin( "inventory as inventory_prev", "inventory_prev.id_inventory = item_prev.id_inventory" );
|
||||
|
||||
$query->andWhere( ['inventory_item.id_inventory' => $this->inventory->id_inventory] );
|
||||
|
||||
$this->load($params);
|
||||
|
||||
if (!$this->validate()) {
|
||||
// uncomment the following line if you do not want to return any records when validation fails
|
||||
// $query->where('0=1');
|
||||
return $dataProvider;
|
||||
}
|
||||
|
||||
$dataProvider = new ActiveDataProvider(
|
||||
['query' => $query ,
|
||||
'pagination' => ( empty($this->output) ? [] : false ),
|
||||
'sort' => [
|
||||
'defaultOrder' => ['item_name' => SORT_ASC],
|
||||
'attributes' => Helper::mkYiiSortItems([
|
||||
['item_created_at', 'item_created_at'],
|
||||
['item_name', 'item_name'],
|
||||
['user_username', 'user_username'],
|
||||
['item_count_prev', 'item_count_prev'],
|
||||
['item_count_sold', 'item_count_sold'],
|
||||
['item_count_in', 'item_count_in'],
|
||||
['item_count', 'item_count'],
|
||||
['item_count', 'item_count'],
|
||||
['item_difference', 'item_difference'],
|
||||
['item_count_system', 'item_count_system'],
|
||||
['inventory.id_inventory', 'inventory_id_inventory'],
|
||||
['inventory.name', 'inventory_name'],
|
||||
['inventory_prev_name', 'inventory_prev_name'],
|
||||
])
|
||||
,
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
if ( !empty($this->item_type) && is_numeric($this->item_id) ){
|
||||
if ( $this->item_type == 'product'){
|
||||
$query->andFilterWhere(['product.id_product' => $this->item_id]);
|
||||
}else if ( $this->item_type == 'group' ){
|
||||
$query->andFilterWhere(['inventory_group.id_inventory_group' => $this->item_id]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $dataProvider;
|
||||
}
|
||||
}
|
||||
70
frontend/models/InventorySearch.php
Normal file
70
frontend/models/InventorySearch.php
Normal file
@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
namespace frontend\models;
|
||||
|
||||
use Yii;
|
||||
use yii\base\Model;
|
||||
use yii\data\ActiveDataProvider;
|
||||
use common\models\Inventory;
|
||||
|
||||
/**
|
||||
* InventorySearch represents the model behind the search form about `common\models\Inventory`.
|
||||
*/
|
||||
class InventorySearch extends Inventory
|
||||
{
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
[['id_inventory', 'id_user'], 'integer'],
|
||||
[['created_at', 'updated_at'], 'safe'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function scenarios()
|
||||
{
|
||||
// bypass scenarios() implementation in the parent class
|
||||
return Model::scenarios();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates data provider instance with search query applied
|
||||
*
|
||||
* @param array $params
|
||||
*
|
||||
* @return ActiveDataProvider
|
||||
*/
|
||||
public function search($params)
|
||||
{
|
||||
$query = Inventory::find();
|
||||
|
||||
$dataProvider = new ActiveDataProvider([
|
||||
'query' => $query,
|
||||
'sort' =>[
|
||||
'defaultOrder' => [ 'created_at' => SORT_DESC ]
|
||||
]
|
||||
]);
|
||||
|
||||
$this->load($params);
|
||||
|
||||
if (!$this->validate()) {
|
||||
// uncomment the following line if you do not want to return any records when validation fails
|
||||
// $query->where('0=1');
|
||||
return $dataProvider;
|
||||
}
|
||||
|
||||
$query->andFilterWhere([
|
||||
'id_inventory' => $this->id_inventory,
|
||||
'id_user' => $this->id_user,
|
||||
'created_at' => $this->created_at,
|
||||
'updated_at' => $this->updated_at,
|
||||
]);
|
||||
|
||||
return $dataProvider;
|
||||
}
|
||||
}
|
||||
@ -192,7 +192,9 @@ class ProductSaleForm extends Model
|
||||
$customer = null;
|
||||
$paid_at;
|
||||
$status = Transfer::STATUS_PAID;
|
||||
if ( $this->isAppendToUserCart() ){
|
||||
if ( !Transfer::canMarkPaidByReception($this->payment_method)){
|
||||
$status = Transfer::STATUS_NOT_PAID;
|
||||
}else if ( $this->isAppendToUserCart() ){
|
||||
$status = Transfer::STATUS_NOT_PAID;
|
||||
}else if ( $this->isAppendToCustomerCart() ){
|
||||
$status = Transfer::STATUS_NOT_PAID;
|
||||
@ -237,12 +239,14 @@ class ProductSaleForm extends Model
|
||||
|
||||
public function appendToUserCart(){
|
||||
if ( $this->isAppendToUserCart() ){
|
||||
if ( Transfer::canBeAddedToCart($this->payment_method)){
|
||||
$item = new UserSoldItem();
|
||||
$item->id_transfer = $this->transfer->id_transfer;
|
||||
$item->id_user = Yii::$app->user->id;
|
||||
$item->save(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
public function isAppendToCustomerCart(){
|
||||
$result = false;
|
||||
if ( isset( $this->cart ) && $this->cart == 'customer' ){
|
||||
@ -253,10 +257,12 @@ class ProductSaleForm extends Model
|
||||
|
||||
public function appendToCustomerCart(){
|
||||
if ( $this->isAppendToCustomerCart() && isset($this->customer) ){
|
||||
if ( Transfer::canBeAddedToCart($this->payment_method)){
|
||||
$item = new ShoppingCart();
|
||||
$item->id_customer = $this->customer->id_customer;
|
||||
$item->id_transfer = $this->transfer->id_transfer;
|
||||
$item->save(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -217,7 +217,10 @@ class TicketCreate extends Ticket{
|
||||
$transfer->id_account = $this->_account->id_account;
|
||||
|
||||
$status = Transfer::STATUS_PAID;
|
||||
if ( $this->isAppendToUserCart() ){
|
||||
|
||||
if ( !Transfer::canMarkPaidByReception( $this->payment_method ) ){
|
||||
$status = Transfer::STATUS_NOT_PAID;
|
||||
}else if ( $this->isAppendToUserCart() ){
|
||||
$status = Transfer::STATUS_NOT_PAID;
|
||||
}else if ( $this->isAppendToCustomerCart() ){
|
||||
$status = Transfer::STATUS_NOT_PAID;
|
||||
@ -284,6 +287,7 @@ class TicketCreate extends Ticket{
|
||||
}
|
||||
|
||||
public function appendToCustomerCart(){
|
||||
if ( Transfer::canBeAddedToCart($this->payment_method)){
|
||||
if ( $this->isAppendToCustomerCart() && isset($this->customer) ){
|
||||
$item = new ShoppingCart();
|
||||
$item->id_customer = $this->customer->id_customer;
|
||||
@ -295,6 +299,7 @@ class TicketCreate extends Ticket{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@ -4,6 +4,8 @@ use common\components\total\TotalDetailedMoneyMovementWidget;
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
<p>Bérletek típus szerint</p>
|
||||
<?php echo TotalMediumTicketsWidget::widget(['dailyListing' => $details]);?>
|
||||
<p>Termékek kategória szerint</p>
|
||||
|
||||
@ -3,7 +3,14 @@ use common\components\accountstate\AccountStateWidget;
|
||||
use common\components\total\TotalDifferenceWidget;
|
||||
?>
|
||||
|
||||
|
||||
<style>
|
||||
.table td{
|
||||
padding: 2px;
|
||||
}
|
||||
.table th{
|
||||
padding: 2px;
|
||||
}
|
||||
</style>
|
||||
<div class="account-state-view ">
|
||||
|
||||
<table class="table-top">
|
||||
|
||||
@ -45,11 +45,14 @@ $this->params['breadcrumbs'][] = $this->title;
|
||||
|
||||
|
||||
['class' => 'yii\grid\ActionColumn',
|
||||
'template' => '{ticket} {ticket_history} {keys} {contract}',
|
||||
'template' => '{ticket} {product} {ticket_history} {keys} {contract}',
|
||||
'buttons' => [
|
||||
'ticket' => function ($url, $model, $key) {
|
||||
return Html::a('Új bérlet', $url, ['class'=> 'btn btn-xs btn-success' ]) ;
|
||||
},
|
||||
'product' => function ($url, $model, $key) {
|
||||
return Html::a('Új termék', $url, ['class'=> 'btn btn-xs btn-success' ]) ;
|
||||
},
|
||||
'ticket_history' => function ($url, $model, $key) {
|
||||
return Html::a('Befizetések', $url, ['class'=> 'btn btn-xs btn-success' ]) ;
|
||||
},
|
||||
@ -64,6 +67,8 @@ $this->params['breadcrumbs'][] = $this->title;
|
||||
$url = "";
|
||||
if ( 'ticket' == $action ){
|
||||
$url = Url::to(['ticket/create','number' => $model['card_number']]);
|
||||
}else if ( 'product' == $action ){
|
||||
$url = Url::to(['product/sale','number' => $model['card_number']]);
|
||||
}else if ( 'ticket_history' == $action ){
|
||||
$url = Url::to(['ticket/index','number' => $model['card_number']]);
|
||||
}else if ( 'keys' == $action ){
|
||||
|
||||
25
frontend/views/inventory-item/_form.php
Normal file
25
frontend/views/inventory-item/_form.php
Normal file
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model common\models\InventoryItem */
|
||||
/* @var $form yii\widgets\ActiveForm */
|
||||
?>
|
||||
|
||||
<div class="inventory-item-form">
|
||||
|
||||
<?php $form = ActiveForm::begin(); ?>
|
||||
|
||||
<?= $form->field($model, 'type')->hiddenInput()->label(false) ?>
|
||||
<?= $form->field($model, 'count')->textInput() ?>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton( Yii::t('common/inventory-item', 'Mentés') , ['class' => 'btn btn-success' ]) ?>
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
||||
</div>
|
||||
34
frontend/views/inventory-item/_search.php
Normal file
34
frontend/views/inventory-item/_search.php
Normal file
@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\models\InventoryItemSearch */
|
||||
/* @var $form yii\widgets\ActiveForm */
|
||||
?>
|
||||
|
||||
<div class="inventory-item-search">
|
||||
|
||||
<?php $form = ActiveForm::begin([
|
||||
'action' => ['index','id' => $model->inventory->id_inventory],
|
||||
'method' => 'get',
|
||||
]); ?>
|
||||
|
||||
<?= $form->field($model, 'item_type')->hiddenInput()->label(false) ?>
|
||||
<?= $form->field($model, 'item_id')->hiddenInput()->label(false) ?>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<?= $form->field($model, 'item_name')->label("Termék/Termék csoport neve") ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton(Yii::t('common/inventory-item', 'Keresés'), ['class' => 'btn btn-primary']) ?>
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
||||
</div>
|
||||
33
frontend/views/inventory-item/create.php
Normal file
33
frontend/views/inventory-item/create.php
Normal file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use backend\assets\InventoryItemCreateAsset;
|
||||
use yii\helpers\Url;
|
||||
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model common\models\InventoryItem */
|
||||
|
||||
$this->title = Yii::t('common/inventory-item', 'Új leltár elem');
|
||||
$this->params['breadcrumbs'][] = ['label' => 'Leltár' , 'url' => ['inventory/view', 'id' => $model->inventory->id_inventory]];
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
|
||||
InventoryItemCreateAsset::register($this);
|
||||
|
||||
|
||||
$options = [];
|
||||
$options['products'] = $model->productOptions;
|
||||
$options['url_product_find'] = Url::toRoute(['product/find']);
|
||||
|
||||
$this->registerJs('inventoryItemCreate.init( '. json_encode($options) .' );');
|
||||
|
||||
?>
|
||||
<div class="inventory-item-create">
|
||||
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
|
||||
<?= $this->render('_form', [
|
||||
'model' => $model,
|
||||
]) ?>
|
||||
|
||||
</div>
|
||||
146
frontend/views/inventory-item/index.php
Normal file
146
frontend/views/inventory-item/index.php
Normal file
@ -0,0 +1,146 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\grid\GridView;
|
||||
use yii\widgets\DetailView;
|
||||
use yii\helpers\Url;
|
||||
use backend\assets\InventoryItemIndexAsset;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $searchModel backend\models\InventoryItemSearch */
|
||||
/* @var $dataProvider yii\data\ActiveDataProvider */
|
||||
|
||||
$this->title = Yii::t('common/inventory-item', 'Leltár részletei');
|
||||
|
||||
$this->params['breadcrumbs'][] = ['label' => 'Leltár lista' , 'url' => ['inventory/index']];;
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
|
||||
|
||||
InventoryItemIndexAsset::register($this);
|
||||
|
||||
$options = [];
|
||||
$options['products'] = $productOptions;
|
||||
|
||||
$this->registerJs('inventoryItemIndex.init( '. json_encode($options) .' );');
|
||||
|
||||
?>
|
||||
<style>
|
||||
.table thead th{
|
||||
white-space: normal;
|
||||
}
|
||||
</style>
|
||||
<div class="inventory-item-index">
|
||||
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
|
||||
<?= DetailView::widget([
|
||||
'model' => $model,
|
||||
'attributes' => [
|
||||
'id_inventory',
|
||||
'name',
|
||||
['attribute'=>'id_user',
|
||||
'value'=>$model->userName
|
||||
],
|
||||
['attribute'=>'id_account',
|
||||
'value'=>$model->accountName
|
||||
],
|
||||
'created_at:datetime',
|
||||
],
|
||||
]) ?>
|
||||
|
||||
<?php echo $this->render('_search', ['model' => $searchModel]); ?>
|
||||
|
||||
|
||||
|
||||
<p>
|
||||
Magyarázat:
|
||||
<ul>
|
||||
<li>
|
||||
Előző leltár (db): az előző leltárban összeszámolt mennyiség. Ha ez a termék első leltározása akkor 0.
|
||||
</li>
|
||||
<li>
|
||||
Beszerzett mennyiség: Az előző leltár óta történt beszerzett mennyiségek összege
|
||||
</li>
|
||||
<li>
|
||||
Eladott mennyiség: Az előző leltár óta eladott darabszám összege
|
||||
</li>
|
||||
<li>
|
||||
Leltározott mennyiség: A felhasználó által összeszámolt és leltár létrehozásakor beírt mennyiség
|
||||
</li>
|
||||
<li>
|
||||
Rendszer szerinti mennyiség: a rendszer által számolt és aktuális látott mennyiség
|
||||
</li>
|
||||
<li>
|
||||
Különbség: = "Leltározott mennyiség - ( "Előző leltár" + "Beszerzett mennyiség" - "Eladott mennyiség" )
|
||||
</li>
|
||||
</ul>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<?php echo Html::a("XLS letöltése", Url::current(['InventoryItemSearch[output]' =>'xls']),['class' =>'btn btn-primary'])?>
|
||||
</p>
|
||||
|
||||
<?php
|
||||
echo GridView::widget( [
|
||||
'dataProvider' => $dataProvider,
|
||||
'columns' =>[
|
||||
[
|
||||
'attribute' => 'item_name',
|
||||
'label' => 'Név',
|
||||
|
||||
],
|
||||
[
|
||||
'attribute' => 'item_count_system',
|
||||
'label' => 'Rendszer szerinti mennyiség (db)',
|
||||
|
||||
],
|
||||
|
||||
|
||||
[
|
||||
'attribute' => 'item_count',
|
||||
'label' => 'Leltározott mennyiség (db)',
|
||||
|
||||
],
|
||||
[
|
||||
'attribute' => 'item_count_prev',
|
||||
'label' => 'Előzö leltár (db)'
|
||||
|
||||
],
|
||||
[
|
||||
'attribute' => 'item_count_in',
|
||||
'label' => 'Beszerzett mennyiség (db)'
|
||||
|
||||
],
|
||||
[
|
||||
'attribute' => 'item_count_sold',
|
||||
'label' => 'Eladott mennyiség (db)',
|
||||
|
||||
],
|
||||
|
||||
|
||||
[
|
||||
'attribute' => 'item_difference',
|
||||
'label' => 'Különbség (db)',
|
||||
|
||||
],
|
||||
['class' => 'yii\grid\ActionColumn',
|
||||
'template' => '{update}',
|
||||
'urlCreator' => function ($action, $model, $key, $index){
|
||||
return Url::to(['inventory-item/update', 'id' => $model['item_id_inventory_item' ] ]) ;
|
||||
},
|
||||
'buttons' =>[
|
||||
'update' =>function ($url, $model, $key) {
|
||||
return Html::a('Módosítás', $url,['class' => 'btn btn-xs btn-success',
|
||||
'data' => [
|
||||
],
|
||||
]) ;
|
||||
}
|
||||
]
|
||||
|
||||
]
|
||||
]
|
||||
|
||||
]);
|
||||
?>
|
||||
|
||||
</div>
|
||||
81
frontend/views/inventory-item/update.php
Normal file
81
frontend/views/inventory-item/update.php
Normal file
@ -0,0 +1,81 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\DetailView;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model common\models\InventoryItem */
|
||||
|
||||
$this->title = Yii::t('common/inventory-item', 'Leltár termék');
|
||||
$this->params['breadcrumbs'][] = ['label' => 'Leltár lista', 'url' => ['inventory/index']];
|
||||
$this->params['breadcrumbs'][] = ['label' => 'Leltár', 'url' => ['inventory-item/index', 'id' => $model->id_inventory ]];
|
||||
$this->params['breadcrumbs'][] = Yii::t('common/inventory-item', 'Update');
|
||||
?>
|
||||
<div class="inventory-item-update">
|
||||
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
|
||||
<h2>Leltár</h2>
|
||||
<?= DetailView::widget([
|
||||
'model' => $inventory,
|
||||
'attributes' => [
|
||||
'id_inventory',
|
||||
'name',
|
||||
['attribute'=>'id_user',
|
||||
'value'=>$inventory->userName
|
||||
],
|
||||
['attribute'=>'id_account',
|
||||
'value'=>$inventory->accountName
|
||||
],
|
||||
'created_at:datetime',
|
||||
],
|
||||
]) ?>
|
||||
|
||||
<h2>Termék</h2>
|
||||
<?= DetailView::widget([
|
||||
'model' => $model,
|
||||
'attributes' => [
|
||||
[
|
||||
|
||||
'value' => $model->name,
|
||||
'label' =>"Név"
|
||||
],
|
||||
[
|
||||
'value' => $model->count_system,
|
||||
'label' => 'Rendszer szerinti mennyiség (db)',
|
||||
],
|
||||
[
|
||||
'value' => $model->count,
|
||||
'label' => 'Leltározott mennyiség (db)',
|
||||
],
|
||||
[
|
||||
'value' => $model->count_prev,
|
||||
'label' => 'Előző leltár (db)',
|
||||
],
|
||||
[
|
||||
'value' => $model->count_in,
|
||||
'label' => 'Beszerzett mennyiség (db)',
|
||||
],
|
||||
[
|
||||
'value' => $model->count_sold,
|
||||
'label' => 'Eladott mennyiség (db)',
|
||||
],
|
||||
[
|
||||
'value' => $model->getDifference(),
|
||||
'label' => 'Különbség',
|
||||
],
|
||||
[
|
||||
'value' => '',
|
||||
'label' => '',
|
||||
],
|
||||
|
||||
|
||||
|
||||
],
|
||||
]) ?>
|
||||
|
||||
<?= $this->render('_form', [
|
||||
'model' => $model,
|
||||
]) ?>
|
||||
|
||||
</div>
|
||||
45
frontend/views/inventory-item/view.php
Normal file
45
frontend/views/inventory-item/view.php
Normal file
@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\DetailView;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model common\models\InventoryItem */
|
||||
|
||||
$this->title = $model->id_inventory_item;
|
||||
$this->params['breadcrumbs'][] = ['label' => Yii::t('common/inventory-item', 'Inventory Items'), 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="inventory-item-view">
|
||||
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
|
||||
<p>
|
||||
<?= Html::a(Yii::t('common/inventory-item', 'Update'), ['update', 'id' => $model->id_inventory_item], ['class' => 'btn btn-primary']) ?>
|
||||
<?= Html::a(Yii::t('common/inventory-item', 'Delete'), ['delete', 'id' => $model->id_inventory_item], [
|
||||
'class' => 'btn btn-danger',
|
||||
'data' => [
|
||||
'confirm' => Yii::t('common/inventory-item', 'Are you sure you want to delete this item?'),
|
||||
'method' => 'post',
|
||||
],
|
||||
]) ?>
|
||||
</p>
|
||||
|
||||
<?= DetailView::widget([
|
||||
'model' => $model,
|
||||
'attributes' => [
|
||||
'id_inventory_item',
|
||||
'id_inventory',
|
||||
'count_in',
|
||||
'count_sold',
|
||||
'count',
|
||||
'type',
|
||||
'id_product',
|
||||
'id_inventory_group',
|
||||
'id_user',
|
||||
'created_at',
|
||||
'updated_at',
|
||||
],
|
||||
]) ?>
|
||||
|
||||
</div>
|
||||
32
frontend/views/inventory/_form.php
Normal file
32
frontend/views/inventory/_form.php
Normal file
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
use common\models\Account;
|
||||
use common\components\Helper;
|
||||
use frontend\components\HtmlHelper;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model common\models\Inventory */
|
||||
/* @var $form yii\widgets\ActiveForm */
|
||||
?>
|
||||
|
||||
<?php
|
||||
|
||||
$accounts = ['' =>'Mind'] + HtmlHelper::mkAccountOptions( Account::readAccounts() );
|
||||
?>
|
||||
|
||||
<div class="inventory-form">
|
||||
|
||||
<?php $form = ActiveForm::begin(); ?>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<?php echo $form->field($model, "id_account")->dropDownList($accounts)?>
|
||||
<?php echo $form->field($model, "name")->textInput()?>
|
||||
<?= Html::submitButton($model->isNewRecord ? Yii::t('common/inventory', 'Létrehoz') : Yii::t('common/inventory', 'Módosít'), [ 'name'=>'Inventory[submit]' ,'class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
||||
</div>
|
||||
33
frontend/views/inventory/_search.php
Normal file
33
frontend/views/inventory/_search.php
Normal file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\models\InventorySearch */
|
||||
/* @var $form yii\widgets\ActiveForm */
|
||||
?>
|
||||
|
||||
<div class="inventory-search">
|
||||
|
||||
<?php $form = ActiveForm::begin([
|
||||
'action' => ['index'],
|
||||
'method' => 'get',
|
||||
]); ?>
|
||||
|
||||
<?= $form->field($model, 'id_inventory') ?>
|
||||
|
||||
<?= $form->field($model, 'id_user') ?>
|
||||
|
||||
<?= $form->field($model, 'created_at') ?>
|
||||
|
||||
<?= $form->field($model, 'updated_at') ?>
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton(Yii::t('common/inventory', 'Search'), ['class' => 'btn btn-primary']) ?>
|
||||
<?= Html::resetButton(Yii::t('common/inventory', 'Reset'), ['class' => 'btn btn-default']) ?>
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
||||
</div>
|
||||
21
frontend/views/inventory/create.php
Normal file
21
frontend/views/inventory/create.php
Normal file
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model common\models\Inventory */
|
||||
|
||||
$this->title = Yii::t('common/inventory', 'Új leltár');
|
||||
$this->params['breadcrumbs'][] = ['label' => Yii::t('common/inventory', 'Leltár lista'), 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="inventory-create">
|
||||
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
|
||||
<?= $this->render('_form', [
|
||||
'model' => $model,
|
||||
]) ?>
|
||||
|
||||
</div>
|
||||
50
frontend/views/inventory/index.php
Normal file
50
frontend/views/inventory/index.php
Normal file
@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\grid\GridView;
|
||||
use yii\helpers\Url;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $searchModel backend\models\InventorySearch */
|
||||
/* @var $dataProvider yii\data\ActiveDataProvider */
|
||||
|
||||
$this->title = Yii::t('common/inventory', 'Leltár lista');
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="inventory-index">
|
||||
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
<?php // echo $this->render('_search', ['model' => $searchModel]); ?>
|
||||
|
||||
<p>
|
||||
<?= Html::a(Yii::t('common/inventory', 'Új leltár'), ['create'], ['class' => 'btn btn-success']) ?>
|
||||
</p>
|
||||
|
||||
<?= GridView::widget([
|
||||
'dataProvider' => $dataProvider,
|
||||
'columns' => [
|
||||
|
||||
'id_inventory',
|
||||
'name',
|
||||
[ 'attribute' => 'id_user', "value" =>"userName" ],
|
||||
'created_at:datetime',
|
||||
|
||||
['class' => 'yii\grid\ActionColumn',
|
||||
'template' => '{view}',
|
||||
'urlCreator' => function( $action, $model, $key, $index ){
|
||||
if ( $action == 'view' ){
|
||||
return Url::to(['inventory-item/index' , 'id'=> $model->id_inventory]);
|
||||
}
|
||||
},
|
||||
'buttons' =>[
|
||||
'view' =>function ($url, $model, $key) {
|
||||
return Html::a('Részletek', $url,['class' => 'btn btn-xs btn-primary',
|
||||
]) ;
|
||||
}
|
||||
]
|
||||
|
||||
],
|
||||
],
|
||||
]); ?>
|
||||
|
||||
</div>
|
||||
23
frontend/views/inventory/update.php
Normal file
23
frontend/views/inventory/update.php
Normal file
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model common\models\Inventory */
|
||||
|
||||
$this->title = Yii::t('common/inventory', 'Update {modelClass}: ', [
|
||||
'modelClass' => 'Inventory',
|
||||
]) . ' ' . $model->id_inventory;
|
||||
$this->params['breadcrumbs'][] = ['label' => Yii::t('common/inventory', 'Inventories'), 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = ['label' => $model->id_inventory, 'url' => ['view', 'id' => $model->id_inventory]];
|
||||
$this->params['breadcrumbs'][] = Yii::t('common/inventory', 'Update');
|
||||
?>
|
||||
<div class="inventory-update">
|
||||
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
|
||||
<?= $this->render('_form', [
|
||||
'model' => $model,
|
||||
]) ?>
|
||||
|
||||
</div>
|
||||
89
frontend/views/inventory/view.php
Normal file
89
frontend/views/inventory/view.php
Normal file
@ -0,0 +1,89 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\DetailView;
|
||||
use yii\grid\GridView;
|
||||
use yii\base\Widget;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model common\models\Inventory */
|
||||
|
||||
$this->title = $model->id_inventory;
|
||||
$this->params['breadcrumbs'][] = ['label' => Yii::t('common/inventory', 'Leltár lista'), 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = "Leltár";
|
||||
?>
|
||||
<div class="inventory-view">
|
||||
|
||||
<h1><?= Html::encode("Leltár") ?></h1>
|
||||
|
||||
|
||||
<?= DetailView::widget([
|
||||
'model' => $model,
|
||||
'attributes' => [
|
||||
'id_inventory',
|
||||
'name',
|
||||
['attribute'=>'id_user',
|
||||
'value'=>$model->userName
|
||||
],
|
||||
'created_at:datetime',
|
||||
],
|
||||
]) ?>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<p>
|
||||
<?= Html::a(Yii::t('common/inventory', 'Új termék'), ['inventory-item/create','id' =>$model->id_inventory], ['class' => 'btn btn-success']) ?>
|
||||
</p>
|
||||
|
||||
<?php
|
||||
|
||||
echo GridView::widget( [
|
||||
'dataProvider' => $dataProvider,
|
||||
'columns' =>[
|
||||
[
|
||||
'attribute' => 'item_created_at',
|
||||
'label' => 'Létrehozva',
|
||||
'format' => 'datetime'
|
||||
],
|
||||
[
|
||||
'attribute' => 'item_name',
|
||||
'label' => 'Név',
|
||||
|
||||
],
|
||||
[
|
||||
'attribute' => 'user_username',
|
||||
'label' => 'Felhasználó',
|
||||
|
||||
],
|
||||
[
|
||||
'attribute' => 'item_count_prev',
|
||||
'label' => 'Előzö leltár (db)'
|
||||
|
||||
],
|
||||
[
|
||||
'attribute' => 'item_count_in',
|
||||
'label' => 'Beszerzett mennyiség (db)'
|
||||
|
||||
],
|
||||
[
|
||||
'attribute' => 'item_count_sold',
|
||||
'label' => 'Eladott mennyiség (db)',
|
||||
|
||||
],
|
||||
[
|
||||
'attribute' => 'item_count',
|
||||
'label' => 'Leltározott mennyiség (db)',
|
||||
|
||||
],
|
||||
[
|
||||
'attribute' => 'item_difference',
|
||||
'label' => 'Különbség (db)',
|
||||
|
||||
],
|
||||
]
|
||||
|
||||
]);
|
||||
?>
|
||||
|
||||
@ -98,7 +98,7 @@ $discountOptions = mkOptions( ArrayHelper::map($discounts, 'id_discount', 'name'
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class='col-md-12'>
|
||||
<?php echo $form->field($model,'payment_method')->dropDownList(Transfer::paymentMethods()) ?>
|
||||
<?php echo $form->field($model,'payment_method')->dropDownList(Transfer::paymentMethodsForProduct()) ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
|
||||
58
frontend/web/js/inventory.item.index.js
Normal file
58
frontend/web/js/inventory.item.index.js
Normal file
@ -0,0 +1,58 @@
|
||||
|
||||
|
||||
var inventoryItemIndex = {
|
||||
|
||||
defaults : {
|
||||
products: [],
|
||||
selector_type : '#inventoryitemsearch-item_type',
|
||||
selector_name : '#inventoryitemsearch-item_name',
|
||||
selector_id : '#inventoryitemsearch-item_id',
|
||||
},
|
||||
product: null,
|
||||
init: function(o){
|
||||
this.defaults = $.extend( this.defaults, o );
|
||||
this.initAutocomplete();
|
||||
|
||||
},
|
||||
|
||||
initAutocomplete : function (){
|
||||
var self = this;
|
||||
|
||||
var $input = $(self.defaults.selector_name);
|
||||
$input.typeahead({source : self.defaults.products,
|
||||
autoSelect: true,
|
||||
items: 20,
|
||||
minLength: 3,
|
||||
});
|
||||
$input.change(function() {
|
||||
var current = $input.typeahead("getActive");
|
||||
$("#filter_text").val('');
|
||||
if (current) {
|
||||
// Some item from your model is active!
|
||||
if (current.name == $input.val()) {
|
||||
self.product = current;
|
||||
} else {
|
||||
self.product = null;
|
||||
}
|
||||
} else {
|
||||
self.product = null;
|
||||
}
|
||||
self.productChange();
|
||||
});
|
||||
},
|
||||
productChange: function( ){
|
||||
this.clearProductData();
|
||||
this.setProductData();
|
||||
},
|
||||
clearProductData: function(){
|
||||
$(this.defaults.selector_type).val('');
|
||||
$(this.defaults.selector_id).val('');
|
||||
},
|
||||
setProductData: function(){
|
||||
if ( this.product ){
|
||||
$(this.defaults.selector_type).val( this.product.type);
|
||||
$(this.defaults.selector_id ).val( this.product.id);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user