add transaction/summary, fix transaction/index, add reception product typeahead

This commit is contained in:
2015-12-29 22:22:11 +01:00
parent 3b2f19b909
commit 6eb0e69b1b
20 changed files with 535 additions and 8 deletions

View 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',
];
}

View File

@@ -28,4 +28,5 @@ return [
'Update' => 'Módosítás',
'Update {modelClass}: ' => '{modelClass} módosítás: ',
'pieces' => 'db',
'Transfers Summary' => 'Bevétel'
];

View File

@@ -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;
}