];
$forecast = $service->calculateFullForecastForWeek($forecastParams);
- $writeOffsForecast = $service->getWeeklyProductsWriteoffsForecast($month, $year, $store->id);
+ $writeOffsForecast = $service->getWeeklyProductsWriteoffsForecast($month, $year, $forecast, $store->id);
$salesForecast = $service->getWeeklyBouquetProductsSalesForecast($month, $year, $store->id);
$this->stdout("Рассчитана автопланограмма для магазина {$store->name}\n", BaseConsole::FG_GREEN);
$model = Autoplannogramma::findOne($item['id']);
if ($model !== null) {
$model->modify = $item['value'];
+ $model->total = $item['value'];
$model->auto_forecast = false;
}
} else {
$model->month = $item['month'] ?? null;
$model->week = $item['week'] ?? null;
$model->modify = $item['value'];
+ $model->total = 0;
$model->calculate = 0;
$model->auto_forecast = false;
}
return $weeksProductForecast;
}*/
- public function getWeeklyBouquetProductsForecast($month, $year, $storeId = null, $weekNumber = null)
+ public function getWeeklyBouquetProductsSalesForecast($month, $year, $storeId = null, $weekNumber = null)
{
$matrixGroups = ArrayHelper::map(
MatrixBouquetForecast::find()->select(['group'])->distinct()->asArray()->all(),