Skip to content

Instantly share code, notes, and snippets.

@luckydevilru
Created August 19, 2021 07:58
Show Gist options
  • Select an option

  • Save luckydevilru/92d85529e40d9275de69606f8aa13a97 to your computer and use it in GitHub Desktop.

Select an option

Save luckydevilru/92d85529e40d9275de69606f8aa13a97 to your computer and use it in GitHub Desktop.
Завершить отгрузку bitrix24 order sale shipment
<?php
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true){
require($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_before.php");
}
$order = \Bitrix\Sale\Order::load($order_id);
$collection = $order->getShipmentCollection();
$shipment = $collection->getItemById($shipmentID);
$statusId = $shipment->getField('ALLOW_DELIVERY');
$r = $shipment->setFields([
'ALLOW_DELIVERY' => 'Y',
'DEDUCTED' => 'Y',
'STATUS_ID' => 'DF'
]);
$order->save();
writeLog( $r->isSuccess(),'delivery done' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment