'product_id' => $productId,
'store_id' => $store->id,
'is_archive' => false,
+ 'auto_forecast' => true,
'capacity_type' => 1,
- 'details' => json_encode($details, JSON_UNESCAPED_UNICODE),
+ 'details' => json_encode($details, JSON_UNESCAPED_UNICODE), // TODO двойное кодирование
'calculate' => $quantity,
'modify' => ceil($total),
'total' => ceil($total)
$salesShares[$storeId]['marketplace'] = round($market / $total, 4);
}
}
-
foreach ($weeklyForecasts as $item) {
+ $groupsArr = explode('_', (string)$item['matrix_group']);
+ $baseGroup = $groupsArr[0];
$storeItem = (int)$item['store_id'];
$guid = (string)$item['product_guid'];
- $group = (string)$item['matrix_group'];
+ $group = $baseGroup;
$type = (string)$item['type'];
$forecastValue = (float)$item['week_forecast'];
if (isset($salesShares[$storeItem]) && isset($salesShares[$storeItem][$type])) {