Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
shipmentstore.php
1<?php
3
4use Bitrix\Catalog\EO_StoreBatchDocumentElement_Collection;
5use Bitrix\Catalog\EO_StoreBatch;
11
12Loader::includeModule('sale');
13
19final class ShipmentStore extends Base
20{
21 private ShipmentItemStore $shipmentItemStore;
22 public function __construct(BatchManager $batchManager, ShipmentItemStore $shipmentItemStore)
23 {
24 parent::__construct($batchManager, $shipmentItemStore->getStoreId());
25
26 $this->shipmentItemStore = $shipmentItemStore;
27 }
28
29 protected function addRegistryItem(EO_StoreBatch $batchItem, float $amount): Result
30 {
32 'SHIPMENT_ITEM_STORE_ID' => $this->shipmentItemStore->getId(),
33 'AMOUNT' => -$amount,
34 'PRODUCT_BATCH_ID' => $batchItem->getId(),
35 'BATCH_PRICE' => $batchItem->getPurchasingPrice(),
36 'BATCH_CURRENCY' => $batchItem->getPurchasingCurrency(),
37 ]);
38 }
39
40 protected function getRegistryItems(): EO_StoreBatchDocumentElement_Collection
41 {
43 'filter' => ['=SHIPMENT_ITEM_STORE_ID' => $this->shipmentItemStore->getId()],
44 ])
45 ->fetchCollection()
46 ;
47 }
48}
addRegistryItem(EO_StoreBatch $batchItem, float $amount)
__construct(BatchManager $batchManager, ShipmentItemStore $shipmentItemStore)
static getList(array $parameters=array())