From: marina Date: Fri, 18 Apr 2025 11:33:16 +0000 (+0300) Subject: ERP-359 Создать логику расчета на месяц - сумма продаж вида для автопм X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=4bcc0c77d578ae40633100ffebcb9d579372110a;p=erp24_rep%2Fyii-erp24%2F.git ERP-359 Создать логику расчета на месяц - сумма продаж вида для автопм --- diff --git a/erp24/views/auto-plannogramma/calculating.php b/erp24/views/auto-plannogramma/calculating.php new file mode 100644 index 00000000..4139963b --- /dev/null +++ b/erp24/views/auto-plannogramma/calculating.php @@ -0,0 +1,108 @@ + + +
+ 'get']); ?> +
+
+ field(new \yii\base\DynamicModel(['category' => $filters['category'] ?? '']), 'category')->widget(Select2::class, [ + 'data' => ArrayHelper::map( + Products1cNomenclature::find()->select('category')->distinct()->asArray()->all(), + 'category', + 'category' + ), + 'options' => ['placeholder' => 'Категория', 'name' => 'category'], + 'pluginOptions' => ['allowClear' => true], + ])->label('Категория') ?> +
+
+ field(new \yii\base\DynamicModel(['subcategory' => $filters['subcategory'] ?? '']), 'subcategory')->widget(Select2::class, [ + 'data' => ArrayHelper::map( + Products1cNomenclature::find()->select('subcategory')->distinct()->asArray()->all(), + 'subcategory', + 'subcategory' + ), + 'options' => ['placeholder' => 'Подкатегория', 'name' => 'subcategory'], + 'pluginOptions' => ['allowClear' => true], + ])->label('Подкатегория') ?> +
+
+ field(new \yii\base\DynamicModel(['product_name' => $filters['product_name'] ?? '']), 'product_name')->widget(Select2::class, [ + 'data' => ArrayHelper::map( + Products1cNomenclature::find()->select('name')->distinct()->asArray()->all(), + 'name', + 'name' + ), + 'options' => ['placeholder' => 'Название товара', 'name' => 'product_name'], + 'pluginOptions' => ['allowClear' => true], + ])->label('Товар') ?> +
+
+ field(new \yii\base\DynamicModel(['store_id' => $filters['store_id'] ?? '']), 'store_id')->widget(Select2::class, [ + 'data' => ArrayHelper::map( + CityStore::findAll(['visible' => CityStore::IS_VISIBLE]), + 'id', + 'name' + ), + 'options' => ['placeholder' => 'Магазин', 'name' => 'store_id'], + 'pluginOptions' => ['allowClear' => true], + ])->label('Магазин') ?> +
+
+ field(new \yii\base\DynamicModel(['plan_date' => $filters['plan_date'] ?? '']), 'plan_date')->widget(DatePicker::class, [ + 'pluginOptions' => [ + 'autoclose' => true, + 'format' => 'dd-mm-yyyy', + ], + 'options' => [ + 'class' => 'form-control', + 'placeholder' => 'Плановая дата', + 'name' => 'plan_date', + ], + ])->label('Плановая дата') ?> +
+
+ field(new \yii\base\DynamicModel(['type' => $filters['type'] ?? '']), 'type')->widget(Select2::class, [ + 'data' => [ + 'writeOffs' => 'Списания', + 'sales' => 'Продажи' + ], + 'options' => ['placeholder' => 'Тип', 'name' => 'type'], + 'pluginOptions' => ['allowClear' => true], + ])->label('По дефолту продажи!') ?> +
+
+ 'btn btn-primary']) ?> +
+
+ 'btn btn-default']) ?> +
+
+ + +
+ + $dataProvider, + 'columns' => [ + 'category', + 'subcategory', + 'product_name', + 'store_id', + [ + 'attribute' => 'goal', + 'label' => 'План закупок (RUB)', + ], + ], +]); ?> diff --git a/erp24/views/auto-plannogramma/control.php b/erp24/views/auto-plannogramma/control.php new file mode 100644 index 00000000..67e46474 --- /dev/null +++ b/erp24/views/auto-plannogramma/control.php @@ -0,0 +1,118 @@ +
+ 'get']); ?> +
+
+ 'category', + 'value' => $filters['category'] ?? '', + 'data' => ArrayHelper::map( + Products1cNomenclature::find()->select('category')->distinct()->orderBy('category')->asArray()->all(), + 'category', + 'category' + ), + 'options' => ['placeholder' => 'Категория'], + 'pluginOptions' => ['allowClear' => true], + ]) ?> +
+ +
+ 'subcategory', + 'value' => $filters['subcategory'] ?? '', + 'data' => ArrayHelper::map( + Products1cNomenclature::find()->select('subcategory')->distinct()->orderBy('subcategory')->asArray()->all(), + 'subcategory', + 'subcategory' + ), + 'options' => ['placeholder' => 'Подкатегория'], + 'pluginOptions' => ['allowClear' => true], + ]) ?> +
+
+ 'product_name', + 'value' => $filters['product_name'] ?? '', + 'data' => ArrayHelper::map( + Products1cNomenclature::find()->select('name')->distinct()->orderBy('name')->asArray()->all(), + 'name', + 'name' + ), + 'options' => ['placeholder' => 'Товар'], + 'pluginOptions' => ['allowClear' => true], + ]) ?> +
+ + +
+ 'city_name', + 'value' => $filters['city_name'] ?? '', + 'data' => ArrayHelper::map( + CityStore::find()->select(['name'])->distinct()->orderBy('name')->asArray()->all(), + 'name', + 'name' + ), + 'options' => ['placeholder' => 'Магазин'], + 'pluginOptions' => ['allowClear' => true], + ]) ?> +
+ +
+ 'plan_date', + 'value' => $filters['plan_date'] ?? '', + 'pluginOptions' => [ + 'autoclose' => true, + 'format' => 'dd-mm-yyyy', + ], + 'options' => [ + 'class' => 'form-control', + 'placeholder' => 'Плановая дата', + ], + ]) ?> +
+ +
+ 'type', + 'value' => $filters['type'] ?? '', + 'data' => [ + 'writeOffs' => 'Списания', + 'sales' => 'Продажи' + ], + 'options' => ['placeholder' => 'Тип'], + 'pluginOptions' => ['allowClear' => true], + ]) ?> +
+ + +
+ 'btn btn-primary']) ?> +
+
+ 'btn btn-default']) ?> +
+
+ +
+ + $dataProvider, + 'columns' => [ + 'category', + 'subcategory', + ['attribute' => 'product_name', 'label' => 'Товар'], + ['attribute' => 'city_name', 'label' => 'Магазин'], + ['attribute' => 'count', 'label' => 'Кол-во'], + ['attribute' => 'sum', 'label' => 'Сумма'], + ], +]) ?> diff --git a/erp24/views/auto-plannogramma/index.php b/erp24/views/auto-plannogramma/index.php new file mode 100644 index 00000000..7201c532 --- /dev/null +++ b/erp24/views/auto-plannogramma/index.php @@ -0,0 +1,336 @@ + + +

+
+
+
+
+
+
+
+ 'year-filter', + 'data' => array_combine(range(date('Y') - 5, date('Y') + 5), range(date('Y') - 5, date('Y') + 5)), + 'options' => ['placeholder' => 'Год', 'id' => 'year'], + 'pluginOptions' => ['allowClear' => true], + ]) ?> +
+
+ 'city-filter', + 'data' => ArrayHelper::map(StoreCityList::findAll(['type' => StoreCityList::TYPE_CITY]), 'id', 'name'), + 'options' => ['placeholder' => 'Город', 'id' => 'city'], + 'pluginOptions' => ['allowClear' => true], + ]) ?> +
+
+ 'store-type-filter', + 'data' => ArrayHelper::map(StoreType::find()->orderBy('sequence_number')->all(), 'id', 'name'), + 'options' => ['placeholder' => 'Тип магазина', 'id' => 'store-type', 'style' => 'width: 110%;'], + 'pluginOptions' => ['allowClear' => true], + ]) ?> +
+
+ 'territorial-manager-filter', + 'data' => ArrayHelper::map( + array_merge( + Admin::findAll(['group_id' => AdminGroup::GROUP_BUSH_DIRECTOR]), + Admin::findAll(['id' => StoreDynamic::find()->andWhere(['category' => 3, 'active' => 1])->select('value_int')->column()]) + ), + 'id', + 'name', + ), + 'options' => ['placeholder' => 'Тер. управляющий', 'id' => 'territorial-manger'], + 'pluginOptions' => ['allowClear' => true], + ]) ?> +
+
+ 'polnogramma-type-filter', + 'data' => ['min' => 'min', 'max' => 'max'], + 'options' => ['placeholder' => 'Тип п-ма', 'id' => 'polnogramma-type'], + 'pluginOptions' => ['allowClear' => true], + ]) ?> +
+
+ 'btn btn-apply btn-primary', 'style' => 'width:100%']); ?> +
+
+
+
+ 'week-filter', + 'data' => ['1' => '1', '2' => '2'], + 'options' => ['placeholder' => 'Неделя', 'id' => 'week'], + 'pluginOptions' => ['allowClear' => true], + ]) ?> +
+
+ 'region-filter', + 'data' => ArrayHelper::map(StoreCityList::findAll(['type' => StoreCityList::TYPE_REGION]), 'id', 'name'), + 'options' => ['placeholder' => 'Регион', 'id' => 'region'], + 'pluginOptions' => ['allowClear' => true], + ]) ?> +
+
+
+
+ 'bush_chef_florist', + 'value' => null, + 'data' => ArrayHelper::map(Admin::findAll(['group_id' => AdminGroup::GROUP_BUSH_CHEF_FLORIST]), 'id', 'name'), + 'options' => [ + 'placeholder' => 'Кустовой шеф-флорист', + 'class' => 'form-select', + 'id' => 'bush_chef_florist', + ], + 'pluginOptions' => [ + 'allowClear' => true, + ], + ]); ?> +
+
+
+
+
+
+
+ +
+
+ 'district-filter', + 'data' => ArrayHelper::map(StoreCityList::findAll(['type' => StoreCityList::TYPE_DISTRICT]), 'id', 'name'), + 'options' => ['placeholder' => 'Район', 'id' => 'district'], + 'pluginOptions' => ['allowClear' => true], + ]) ?> +
+
+
+
+
+ 'btn btn-success btn-save', 'style' => 'width:100%']); ?> +
+
+
+
+
+ +
+
+
+
+ + + + + + + + + + + + $subcategories): ?> + + + + + $products): ?> + + + + + + + + + + + + + + + + +
+
+
+
+
+
+
+
+
+
+
+ 'btn btn-success ms-1']) ?> + 'btn btn-success ms-1']) ?> +
+
+ 'writing-mode: sideways-lr; text-align: center; white-space: nowrap; + font-weight: bold; transform-origin: left bottom; padding-right: 7%;' + ]) ?> +
+ + ▲ + +
+ + ▶ + +
+ + + + +
+ 'btn btn-primary input', + 'data-bs-toggle' => 'tooltip', + 'data-bs-placement' => 'top', + 'title' => $tooltipText, + ]) ?> + +
+
+
+
+ + + \ No newline at end of file diff --git a/erp24/views/auto-planogramma/calculating.php b/erp24/views/auto-planogramma/calculating.php deleted file mode 100644 index 4139963b..00000000 --- a/erp24/views/auto-planogramma/calculating.php +++ /dev/null @@ -1,108 +0,0 @@ - - -
- 'get']); ?> -
-
- field(new \yii\base\DynamicModel(['category' => $filters['category'] ?? '']), 'category')->widget(Select2::class, [ - 'data' => ArrayHelper::map( - Products1cNomenclature::find()->select('category')->distinct()->asArray()->all(), - 'category', - 'category' - ), - 'options' => ['placeholder' => 'Категория', 'name' => 'category'], - 'pluginOptions' => ['allowClear' => true], - ])->label('Категория') ?> -
-
- field(new \yii\base\DynamicModel(['subcategory' => $filters['subcategory'] ?? '']), 'subcategory')->widget(Select2::class, [ - 'data' => ArrayHelper::map( - Products1cNomenclature::find()->select('subcategory')->distinct()->asArray()->all(), - 'subcategory', - 'subcategory' - ), - 'options' => ['placeholder' => 'Подкатегория', 'name' => 'subcategory'], - 'pluginOptions' => ['allowClear' => true], - ])->label('Подкатегория') ?> -
-
- field(new \yii\base\DynamicModel(['product_name' => $filters['product_name'] ?? '']), 'product_name')->widget(Select2::class, [ - 'data' => ArrayHelper::map( - Products1cNomenclature::find()->select('name')->distinct()->asArray()->all(), - 'name', - 'name' - ), - 'options' => ['placeholder' => 'Название товара', 'name' => 'product_name'], - 'pluginOptions' => ['allowClear' => true], - ])->label('Товар') ?> -
-
- field(new \yii\base\DynamicModel(['store_id' => $filters['store_id'] ?? '']), 'store_id')->widget(Select2::class, [ - 'data' => ArrayHelper::map( - CityStore::findAll(['visible' => CityStore::IS_VISIBLE]), - 'id', - 'name' - ), - 'options' => ['placeholder' => 'Магазин', 'name' => 'store_id'], - 'pluginOptions' => ['allowClear' => true], - ])->label('Магазин') ?> -
-
- field(new \yii\base\DynamicModel(['plan_date' => $filters['plan_date'] ?? '']), 'plan_date')->widget(DatePicker::class, [ - 'pluginOptions' => [ - 'autoclose' => true, - 'format' => 'dd-mm-yyyy', - ], - 'options' => [ - 'class' => 'form-control', - 'placeholder' => 'Плановая дата', - 'name' => 'plan_date', - ], - ])->label('Плановая дата') ?> -
-
- field(new \yii\base\DynamicModel(['type' => $filters['type'] ?? '']), 'type')->widget(Select2::class, [ - 'data' => [ - 'writeOffs' => 'Списания', - 'sales' => 'Продажи' - ], - 'options' => ['placeholder' => 'Тип', 'name' => 'type'], - 'pluginOptions' => ['allowClear' => true], - ])->label('По дефолту продажи!') ?> -
-
- 'btn btn-primary']) ?> -
-
- 'btn btn-default']) ?> -
-
- - -
- - $dataProvider, - 'columns' => [ - 'category', - 'subcategory', - 'product_name', - 'store_id', - [ - 'attribute' => 'goal', - 'label' => 'План закупок (RUB)', - ], - ], -]); ?> diff --git a/erp24/views/auto-planogramma/control.php b/erp24/views/auto-planogramma/control.php deleted file mode 100644 index 67e46474..00000000 --- a/erp24/views/auto-planogramma/control.php +++ /dev/null @@ -1,118 +0,0 @@ -
- 'get']); ?> -
-
- 'category', - 'value' => $filters['category'] ?? '', - 'data' => ArrayHelper::map( - Products1cNomenclature::find()->select('category')->distinct()->orderBy('category')->asArray()->all(), - 'category', - 'category' - ), - 'options' => ['placeholder' => 'Категория'], - 'pluginOptions' => ['allowClear' => true], - ]) ?> -
- -
- 'subcategory', - 'value' => $filters['subcategory'] ?? '', - 'data' => ArrayHelper::map( - Products1cNomenclature::find()->select('subcategory')->distinct()->orderBy('subcategory')->asArray()->all(), - 'subcategory', - 'subcategory' - ), - 'options' => ['placeholder' => 'Подкатегория'], - 'pluginOptions' => ['allowClear' => true], - ]) ?> -
-
- 'product_name', - 'value' => $filters['product_name'] ?? '', - 'data' => ArrayHelper::map( - Products1cNomenclature::find()->select('name')->distinct()->orderBy('name')->asArray()->all(), - 'name', - 'name' - ), - 'options' => ['placeholder' => 'Товар'], - 'pluginOptions' => ['allowClear' => true], - ]) ?> -
- - -
- 'city_name', - 'value' => $filters['city_name'] ?? '', - 'data' => ArrayHelper::map( - CityStore::find()->select(['name'])->distinct()->orderBy('name')->asArray()->all(), - 'name', - 'name' - ), - 'options' => ['placeholder' => 'Магазин'], - 'pluginOptions' => ['allowClear' => true], - ]) ?> -
- -
- 'plan_date', - 'value' => $filters['plan_date'] ?? '', - 'pluginOptions' => [ - 'autoclose' => true, - 'format' => 'dd-mm-yyyy', - ], - 'options' => [ - 'class' => 'form-control', - 'placeholder' => 'Плановая дата', - ], - ]) ?> -
- -
- 'type', - 'value' => $filters['type'] ?? '', - 'data' => [ - 'writeOffs' => 'Списания', - 'sales' => 'Продажи' - ], - 'options' => ['placeholder' => 'Тип'], - 'pluginOptions' => ['allowClear' => true], - ]) ?> -
- - -
- 'btn btn-primary']) ?> -
-
- 'btn btn-default']) ?> -
-
- -
- - $dataProvider, - 'columns' => [ - 'category', - 'subcategory', - ['attribute' => 'product_name', 'label' => 'Товар'], - ['attribute' => 'city_name', 'label' => 'Магазин'], - ['attribute' => 'count', 'label' => 'Кол-во'], - ['attribute' => 'sum', 'label' => 'Сумма'], - ], -]) ?> diff --git a/erp24/views/auto-planogramma/index.php b/erp24/views/auto-planogramma/index.php deleted file mode 100644 index 7201c532..00000000 --- a/erp24/views/auto-planogramma/index.php +++ /dev/null @@ -1,336 +0,0 @@ - - -

-
-
-
-
-
-
-
- 'year-filter', - 'data' => array_combine(range(date('Y') - 5, date('Y') + 5), range(date('Y') - 5, date('Y') + 5)), - 'options' => ['placeholder' => 'Год', 'id' => 'year'], - 'pluginOptions' => ['allowClear' => true], - ]) ?> -
-
- 'city-filter', - 'data' => ArrayHelper::map(StoreCityList::findAll(['type' => StoreCityList::TYPE_CITY]), 'id', 'name'), - 'options' => ['placeholder' => 'Город', 'id' => 'city'], - 'pluginOptions' => ['allowClear' => true], - ]) ?> -
-
- 'store-type-filter', - 'data' => ArrayHelper::map(StoreType::find()->orderBy('sequence_number')->all(), 'id', 'name'), - 'options' => ['placeholder' => 'Тип магазина', 'id' => 'store-type', 'style' => 'width: 110%;'], - 'pluginOptions' => ['allowClear' => true], - ]) ?> -
-
- 'territorial-manager-filter', - 'data' => ArrayHelper::map( - array_merge( - Admin::findAll(['group_id' => AdminGroup::GROUP_BUSH_DIRECTOR]), - Admin::findAll(['id' => StoreDynamic::find()->andWhere(['category' => 3, 'active' => 1])->select('value_int')->column()]) - ), - 'id', - 'name', - ), - 'options' => ['placeholder' => 'Тер. управляющий', 'id' => 'territorial-manger'], - 'pluginOptions' => ['allowClear' => true], - ]) ?> -
-
- 'polnogramma-type-filter', - 'data' => ['min' => 'min', 'max' => 'max'], - 'options' => ['placeholder' => 'Тип п-ма', 'id' => 'polnogramma-type'], - 'pluginOptions' => ['allowClear' => true], - ]) ?> -
-
- 'btn btn-apply btn-primary', 'style' => 'width:100%']); ?> -
-
-
-
- 'week-filter', - 'data' => ['1' => '1', '2' => '2'], - 'options' => ['placeholder' => 'Неделя', 'id' => 'week'], - 'pluginOptions' => ['allowClear' => true], - ]) ?> -
-
- 'region-filter', - 'data' => ArrayHelper::map(StoreCityList::findAll(['type' => StoreCityList::TYPE_REGION]), 'id', 'name'), - 'options' => ['placeholder' => 'Регион', 'id' => 'region'], - 'pluginOptions' => ['allowClear' => true], - ]) ?> -
-
-
-
- 'bush_chef_florist', - 'value' => null, - 'data' => ArrayHelper::map(Admin::findAll(['group_id' => AdminGroup::GROUP_BUSH_CHEF_FLORIST]), 'id', 'name'), - 'options' => [ - 'placeholder' => 'Кустовой шеф-флорист', - 'class' => 'form-select', - 'id' => 'bush_chef_florist', - ], - 'pluginOptions' => [ - 'allowClear' => true, - ], - ]); ?> -
-
-
-
-
-
-
- -
-
- 'district-filter', - 'data' => ArrayHelper::map(StoreCityList::findAll(['type' => StoreCityList::TYPE_DISTRICT]), 'id', 'name'), - 'options' => ['placeholder' => 'Район', 'id' => 'district'], - 'pluginOptions' => ['allowClear' => true], - ]) ?> -
-
-
-
-
- 'btn btn-success btn-save', 'style' => 'width:100%']); ?> -
-
-
-
-
- -
-
-
-
- - - - - - - - - - - - $subcategories): ?> - - - - - $products): ?> - - - - - - - - - - - - - - - - -
-
-
-
-
-
-
-
-
-
-
- 'btn btn-success ms-1']) ?> - 'btn btn-success ms-1']) ?> -
-
- 'writing-mode: sideways-lr; text-align: center; white-space: nowrap; - font-weight: bold; transform-origin: left bottom; padding-right: 7%;' - ]) ?> -
- - ▲ - -
- - ▶ - -
- - - - -
- 'btn btn-primary input', - 'data-bs-toggle' => 'tooltip', - 'data-bs-placement' => 'top', - 'title' => $tooltipText, - ]) ?> - -
-
-
-
- - - \ No newline at end of file