1
0
mirror of synced 2025-02-18 07:53:15 +03:00

restore shipment before deleting

This commit is contained in:
Sergey Chazov 2022-02-03 17:04:06 +04:00
parent c40c83aad0
commit baf8f3e84c

View File

@ -1623,7 +1623,9 @@ class RetailCrmHistory
$shipmentColl = $order->getShipmentCollection();
if ($delivery) {
if (!$update) {
//В коллекции всегда есть одна скрытая системная доставка, к которой относятся нераспределенные товары
//Поэтому, если есть только системная доставка, то нужно создать новую
if (!$update || $shipmentColl->count() === 1) {
$shipment = $shipmentColl->createItem($delivery);
$shipment->setFields([
'BASE_PRICE_DELIVERY' => $orderCrm['delivery']['cost'],