From: Alexander Smirnov Date: Mon, 20 May 2024 14:54:59 +0000 (+0300) Subject: fix part 007 X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=1a476d529cb77a77c000f1f62189ab223181c3cf;p=yii-erp24%2F.git fix part 007 --- diff --git a/erp24/modul/shipment/fields/auto_purchase_formula.php b/erp24/modul/shipment/fields/auto_purchase_formula.php index 0cc2355..5db8cc1 100644 --- a/erp24/modul/shipment/fields/auto_purchase_formula.php +++ b/erp24/modul/shipment/fields/auto_purchase_formula.php @@ -42,10 +42,10 @@ foreach($products ?? [] as $product_id => $name) { foreach($orderStoresArrayRelation as $storeId) { - $sale_7day = $FiledsDataArray["sales_cnt"][$product_id][$storeId]; - $quantity = $FiledsDataArray["quantity"][$product_id][$storeId]; - $quantity_fact =$FiledsDataArray["quantity_fact"][$product_id][$storeId]; - $entrance_cnt_7days =$FiledsDataArray["entrance_cnt_7days"][$product_id][$storeId]; + $sale_7day = $FiledsDataArray["sales_cnt"][$product_id][$storeId] ?? 0; + $quantity = $FiledsDataArray["quantity"][$product_id][$storeId] ?? 0; + $quantity_fact =$FiledsDataArray["quantity_fact"][$product_id][$storeId] ?? 0; + $entrance_cnt_7days =$FiledsDataArray["entrance_cnt_7days"][$product_id][$storeId] ?? 0; // считаем запас на 2 дня $sale_2day=ceil(2*($sale_7day/7));