From: Alexander Smirnov Date: Wed, 22 Jan 2025 11:05:54 +0000 (+0300) Subject: [ERP-283] планы взяты из /sales-write-offs-plan X-Git-Tag: 1.7~29^2~8 X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=6e09efd1d2049acd13c5196718cf91b004398470;p=erp24_rep%2Fyii-erp24%2F.git [ERP-283] планы взяты из /sales-write-offs-plan --- diff --git a/erp24/controllers/CategoryPlanController.php b/erp24/controllers/CategoryPlanController.php index 80fdfaaf..69f8de5a 100644 --- a/erp24/controllers/CategoryPlanController.php +++ b/erp24/controllers/CategoryPlanController.php @@ -9,6 +9,7 @@ use yii\web\Controller; use yii_app\records\CityStore; use yii_app\records\ExportImportTable; use yii_app\records\Sales; +use yii_app\records\SalesWriteOffsPlan; use yii_app\records\WriteOffs; use yii_app\records\WriteOffsErp; @@ -116,6 +117,8 @@ class CategoryPlanController extends Controller { $types = array_keys($types); ///////////////////////////////////////////////////////////////////////////////////// + $salesWriteOffsPlan = SalesWriteOffsPlan::find()->where(['year' => $model->year, 'month' => $model->month, 'store_id' => $model->store_id])->one(); + $years = []; for ($i = 3; $i >= 0; $i--) { $year = date("Y") - $i; @@ -124,6 +127,6 @@ class CategoryPlanController extends Controller { $stores = ArrayHelper::map(CityStore::find()->andWhere(['visible' => '1'])->all(), 'id', 'name'); return $this->render('index', compact('model', 'years', 'stores', 'table', 'tableOnline', - 'tableWriteOffs', 'types')); + 'tableWriteOffs', 'types', 'salesWriteOffsPlan')); } } diff --git a/erp24/views/category-plan/index.php b/erp24/views/category-plan/index.php index 3df10e13..a86f2dff 100644 --- a/erp24/views/category-plan/index.php +++ b/erp24/views/category-plan/index.php @@ -5,7 +5,7 @@ use yii\widgets\ActiveForm; use kartik\select2\Select2; use yii_app\helpers\HtmlHelper; - +use yii_app\records\SalesWriteOffsPlan; /* @var $model DynamicModel */ /* @var $years array */ @@ -14,6 +14,7 @@ use yii_app\helpers\HtmlHelper; /* @var $tableOnline array */ /* @var $types array */ /* @var $tableWriteOffs array */ +/* @var $salesWriteOffsPlan SalesWriteOffsPlan */ $this->registerJsFile('/js/category-plan/index.js', ['position' => \yii\web\View::POS_END]); @@ -61,26 +62,33 @@ $this->registerJsFile('/js/category-plan/index.js', ['position' => \yii\web\View store_id)): ?>
+ offline_sales_plan; + $online_sale = $salesWriteOffsPlan->online_sales_shop_plan; + $write_offs = $salesWriteOffsPlan->write_offs_plan; + ?> - - - - + + + + + + store_id][$type] ?? 0; ?> - + store_id][$type] ?? 0; ?> - + - - + - +
КатегорииПлан продажСписания
ОффлайнИнтернет-МагазинМаркетплейсСписания
1 100 000800 0000300 000
%Сумма%Cумма%Cумма%Cумма
КатегорииПлан продажСписания
ОффлайнИнтернет-МагазинСписания
%Сумма%Cумма%Cумма
%% %% %%