Created
August 19, 2021 07:58
-
-
Save luckydevilru/92d85529e40d9275de69606f8aa13a97 to your computer and use it in GitHub Desktop.
Завершить отгрузку bitrix24 order sale shipment
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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