add transaction/summary, fix transaction/index, add reception product typeahead
This commit is contained in:
27
common/assets/TypeAheadAsset.php
Normal file
27
common/assets/TypeAheadAsset.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* @link http://www.yiiframework.com/
|
||||
* @copyright Copyright (c) 2008 Yii Software LLC
|
||||
* @license http://www.yiiframework.com/license/
|
||||
*/
|
||||
|
||||
namespace common\assets;
|
||||
|
||||
use yii\web\AssetBundle;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Qiang Xue <qiang.xue@gmail.com>
|
||||
* @since 2.0
|
||||
*/
|
||||
class TypeAheadAsset extends AssetBundle
|
||||
{
|
||||
public $sourcePath = '@vendor/bassjobsen/bootstrap-3-typeahead';
|
||||
public $js = [
|
||||
'bootstrap3-typeahead.min.js',
|
||||
];
|
||||
public $depends = [
|
||||
// 'yii\bootstrap\BootstrapAsset',
|
||||
// 'yii\bootstrap\BootstrapPluginAsset',
|
||||
];
|
||||
}
|
||||
@@ -28,4 +28,5 @@ return [
|
||||
'Update' => 'Módosítás',
|
||||
'Update {modelClass}: ' => '{modelClass} módosítás: ',
|
||||
'pieces' => 'db',
|
||||
'Transfers Summary' => 'Bevétel'
|
||||
];
|
||||
|
||||
@@ -168,6 +168,20 @@ class Product extends \common\models\BaseFitnessActiveRecord {
|
||||
]);
|
||||
}
|
||||
|
||||
public static function modelToMapIdName($product,$default = null){
|
||||
|
||||
if ( $product == null ){
|
||||
return $default;
|
||||
}
|
||||
|
||||
return ArrayHelper::toArray($product, [
|
||||
'common\models\Product' => [
|
||||
'id_product',
|
||||
'name',
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
||||
public static function sellProduct($product,$count){
|
||||
$product->stock = $product->stock - $count;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user