foreach ($productData['values'] as &$value) {
$storeId = $value['store_id'];
$value['title'] = [];
+
if (isset($forecast[$storeId][$productId])) {
$forecastData = $forecast[$storeId][$productId];
+ $quantity = $value['quantity'];
+
foreach ($forecastData as $type => $groups) {
- foreach ($groups as $group => $amount) {
- $value['title'][$type][$group] = $amount;
+ if (isset($groups['share'])) {
+ $calculated = round($quantity * $groups['share'], 2);
+ $value['title'][$type] = $calculated;
}
}
}
->select('store_id')
->where(['category' => 3, 'active' => 1, 'value_int' => $filters['territorial_manager']])
->column();
- $query->andWhere(['in', 'a.store_id', $territorialManagerStoreIds ?: [-1]]);
+ $query->andWhere(['in', 'p.store_id', $territorialManagerStoreIds ?: [-1]]);
}
if (!empty($filters['bush_chef_florist'])) {
->select('store_id')
->where(['category' => 2, 'active' => 1, 'value_int' => $filters['bush_chef_florist']])
->column();
- $query->andWhere(['in', 'a.store_id', $bushChefFloristStoreIds ?: [-1]]);
+ $query->andWhere(['in', 'p.store_id', $bushChefFloristStoreIds ?: [-1]]);
}
+
return array_values($query->column());
}
<?= Html::label("КШФ:", null, ['class' => 'label-kshf']) ?><br>
<div class="buttons d-flex justify-content-end">
- <?= Html::a('Auto', '#', ['class' => 'btn btn-success ms-1 btn-auto']) ?>
+ <?= Html::a('Auto', Url::to(['auto-plannogramma/week-sales-species-excel']), ['class' => 'btn btn-success ms-1 btn-auto']) ?>
<?= Html::a('Corrected', '#', ['class' => 'btn btn-success ms-1 btn-corrected']) ?>
</div>
</th>