$channelData = $forecast[$storeId][$channel] ?? [];
$titleData = [];
- // Add share-based value if it exists
if (isset($channelData['share']) && is_numeric($channelData['share'])) {
$titleData = [round($quantity * $channelData['share'], 2)];
}
-
- // Add product-specific details if available
+
if (isset($productData['product_id']) && isset($forecast[$storeId][$productData['product_id']][$channel])) {
$details = $forecast[$storeId][$productData['product_id']][$channel];
$total = array_sum($details);
'pagination' => ['pageSize' => 100],
]);
- // Обработка даты на год и месяц
if (!empty($filters['year']) && !empty($filters['month'])) {
$filters['plan_date'] = $filters['year'] . '-' . str_pad($filters['month'], 2, '0', STR_PAD_LEFT) . '-01';