1
0
mirror of synced 2024-11-25 06:46:08 +03:00

Блокировка резервирования в отгруженном заказе

This commit is contained in:
Smiley48 2023-01-23 14:27:15 +03:00 committed by GitHub
parent 3267e72b7c
commit 656c076195
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 44 additions and 3 deletions

View File

@ -1,3 +1,6 @@
## 2023-01-20 v.6.1.14
- Исправление ошибки изменения отгрузки при её завершении
## 2023-01-10 v.6.1.13 ## 2023-01-10 v.6.1.13
- Изменение метода обновления полей программы лояльности в административной панели - Изменение метода обновления полей программы лояльности в административной панели

View File

@ -1734,7 +1734,7 @@ class RetailCrmHistory
$basket = $order->getBasket(); $basket = $order->getBasket();
foreach ($shipmentCollection as $shipment) { foreach ($shipmentCollection as $shipment) {
if (!$shipment->isSystem()) { if (!$shipment->isSystem() && !$shipment->isShipped()) {
$reserved = false; $reserved = false;
if ($shipment->needReservation()) { if ($shipment->needReservation()) {

View File

@ -1,6 +1,6 @@
<?php <?php
$arModuleVersion = [ $arModuleVersion = [
'VERSION' => '6.1.13', 'VERSION' => '6.1.14',
'VERSION_DATE' => '2023-01-10 17:00:00' 'VERSION_DATE' => '2023-01-20 17:00:00'
]; ];

View File

@ -1,5 +1,6 @@
<?php <?php
use Bitrix\Sale\Order;
/** /**
* Class RetailCrmHistory_v5Test * Class RetailCrmHistory_v5Test
*/ */
@ -50,6 +51,43 @@ class RetailCrmHistory_v5Test extends \BitrixTestCase
} }
} }
public function testShipmentItemReset(): void
{
$shipmentCollection = $this->createMock(\Bitrix\Sale\ShipmentCollection::class);
$shipmentCollection->method('resetCollection')
->willReturn(true);
$shipmentCollection->method('tryUnreserve')
->willReturn(true);
$shipmentCollection->method('tryReserve')
->willReturn(true);
$shipment = $this->createMock(\Bitrix\Sale\Shipment::class);
$shipment->method('getShipmentItemCollection')
->willReturn($shipmentCollection);
$shipment->method('needReservation')
->willReturn(true);
$shipment->method('isShipped')
->willReturn(true);
$shipment->method('isSystem')
->willReturn(false);
$shipmentCollection->method('getIterator')
->willReturn(new \ArrayObject([$shipment]));
$order = $this->createMock(\Bitrix\Sale\Order::class);
$order->method('getShipmentCollection')
->willReturn($shipmentCollection);
$order->method('getBasket')
->willReturn(true);
$this->assertEquals(null, RetailCrmHistory::shipmentItemReset($order));
$shipment->method('isShipped')
->willReturn(false);
$this->assertEquals(null, RetailCrmHistory::shipmentItemReset($order));
}
private function getCustomers(): array private function getCustomers(): array
{ {
return [ return [