Блокировка резервирования в отгруженном заказе
This commit is contained in:
parent
3267e72b7c
commit
656c076195
@ -1,3 +1,6 @@
|
||||
## 2023-01-20 v.6.1.14
|
||||
- Исправление ошибки изменения отгрузки при её завершении
|
||||
|
||||
## 2023-01-10 v.6.1.13
|
||||
- Изменение метода обновления полей программы лояльности в административной панели
|
||||
|
||||
|
@ -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()) {
|
||||
|
@ -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'
|
||||
];
|
||||
|
@ -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 [
|
||||
|
Loading…
Reference in New Issue
Block a user