diff --git a/backend/components/AdminMenuStructure.php b/backend/components/AdminMenuStructure.php index 20e37cc..d4cf24a 100644 --- a/backend/components/AdminMenuStructure.php +++ b/backend/components/AdminMenuStructure.php @@ -58,7 +58,7 @@ class AdminMenuStructure{ $items[] = ['label' => 'Kedvezmények', 'url' => ['/discount/index'] ]; $items[] = ['label' => 'Termék kategóriák', 'url' => ['/product-category/index'] ]; $items[] = ['label' => 'Bérlet típusok', 'url' => ['/ticket-type/index'] ]; - $items[] = ['label' => 'Kulcsok', 'url' =>['/key/index']]; +// $items[] = ['label' => 'Kulcsok', 'url' =>['/key/index']]; // $items[] = ['label' => 'Pénznem', 'url' => ['/currency/index'] ]; $this->menuItems[] = ['label' => 'Törszadatok', 'url' =>$this->emptyUrl, 'items' => $items diff --git a/backend/config/main.php b/backend/config/main.php index 70d7514..af688c7 100644 --- a/backend/config/main.php +++ b/backend/config/main.php @@ -17,7 +17,6 @@ return [ 'request' => [ 'csrfParam' => '_backendCSRF', 'csrfCookie' => [ - 'httpOnly' => true, 'path' => '/backend/web', ], ], @@ -26,8 +25,7 @@ return [ 'enableAutoLogin' => true, 'identityCookie' => [ 'name' => '_backendUser', // unique for backend - 'path'=>'/backend/web', // correct path for the backend app. - 'httpOnly' => true, +// 'path' => '/backend/web', ] ], 'session' => [ diff --git a/backend/models/ProductSearch.php b/backend/models/ProductSearch.php index 44319eb..f49d2f6 100644 --- a/backend/models/ProductSearch.php +++ b/backend/models/ProductSearch.php @@ -20,7 +20,7 @@ class ProductSearch extends Product { return [ [[ 'id_product_category', 'id_account', 'status'], 'integer'], - [['product_number', 'barcode' ], 'safe'], + [['product_number', 'barcode' ,'name'], 'safe'], ]; } @@ -68,7 +68,8 @@ class ProductSearch extends Product ]); $query->andFilterWhere(['like', 'product_number', $this->product_number]) - ->andFilterWhere(['like', 'barcode', $this->barcode]); + ->andFilterWhere(['like', 'barcode', $this->barcode]) + ->andFilterWhere(['like', 'name', $this->name]); return $dataProvider; } diff --git a/backend/views/product/_search.php b/backend/views/product/_search.php index 5186a56..51364ad 100644 --- a/backend/views/product/_search.php +++ b/backend/views/product/_search.php @@ -19,11 +19,11 @@ function mkOptions($options){ return $o; } -$statusOptions = mkOptions( Product::statuses() ); +$statusOptions = ['' => "Mind"] + ( Product::statuses() ); -$productCategories = mkOptions( ArrayHelper::map( ProductCategory::read(null) ,'id_product_category','name') ); +$productCategories = ['' => "Mind"] + ArrayHelper::map( ProductCategory::read(null) ,'id_product_category','name') ; -$accounts = mkOptions( ArrayHelper::map( Account::read(null) ,'id_account','name')); +$accounts = ['' => "Mind"] + ( ArrayHelper::map( Account::read(null) ,'id_account','name')); ?>
- field($model, 'product_number') ?> + field($model, 'name') ?>
field($model, 'barcode') ?>
+ field($model, 'product_number') ?>
diff --git a/common/config/params.php b/common/config/params.php index 359c9f8..c134840 100644 --- a/common/config/params.php +++ b/common/config/params.php @@ -3,5 +3,5 @@ return [ 'adminEmail' => 'rocho02@gmail.com', 'supportEmail' => 'rocho02@gmail.com', 'user.passwordResetTokenExpire' => 3600, - 'version' => 'v0.0.5' + 'version' => 'v0.0.6' ]; diff --git a/frontend/models/ProductSaleForm.php b/frontend/models/ProductSaleForm.php index 4516c38..800f4e0 100644 --- a/frontend/models/ProductSaleForm.php +++ b/frontend/models/ProductSaleForm.php @@ -87,7 +87,7 @@ class ProductSaleForm extends Model [['comment'], 'string' ,'max' => 255], [['cart'], 'string' ,'max' => 20], [['id_product' ], 'validateProduct'], - [['count' ], 'validateCount'], +// [['count' ], 'validateCount'], [['id_currency' ], 'validateCurrency'], [['id_account' ], 'validateAccount'], [['id_discount' ], 'validateDiscount'], diff --git a/frontend/web/js/accountstate.js b/frontend/web/js/accountstate.js index 6ed70ee..e973eae 100644 --- a/frontend/web/js/accountstate.js +++ b/frontend/web/js/accountstate.js @@ -28,7 +28,7 @@ function AccountState(o){ $.extend(app.defaults, o ); notes = $(app.defaults.notes); moneyInput = $(app.defaults.selector_money); - notes.change(run); + notes.change(runNote); moneyInput.change(run); if ( app.defaults.open ){ ddAccount = $(app.defaults.selector_dd_account); @@ -40,8 +40,17 @@ function AccountState(o){ - function run(){ + function runNote(){ + run("note"); + } + + function run(what ){ calcTotal(); + if ( what == 'note' ){ + setMoneyAsTotal(); + }else{ + readMoney(); + } calcDiff(); calcAccount(); calcLastDiff(); @@ -51,6 +60,7 @@ function AccountState(o){ updateLastMoney(); updateLastDiff(); updatePrevState(); + } function calcAccount(){ @@ -68,12 +78,21 @@ function AccountState(o){ app.diff = Math.abs(app.last_money - app.money ); } - function calcDiff(){ + + function setMoneyAsTotal(){ + app.money = app.total; + } + + function readMoney(){ app.money = 0; app.money = +moneyInput.val(); if ( isNaN(money)){ app.money = 0; } + } + + function calcDiff(){ + app.diff = Math.abs(app.total - app.money ); } @@ -103,6 +122,7 @@ function AccountState(o){ var money; money = accounting.formatNumber(app.money, 0, " "); // 9 876 543.210 $('.money').html(money); + $('#accountstate-money').val(money); } function updateLastMoney(){