1
0
mirror of synced 2024-11-22 05:16:09 +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
- Изменение метода обновления полей программы лояльности в административной панели

View File

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

View File

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

View File

@ -1,5 +1,6 @@
<?php
use Bitrix\Sale\Order;
/**
* 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
{
return [