Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
shipmentstore.php
1
<?php
2
namespace
Bitrix\Catalog\Product\Store\DistributionStrategy
;
3
4
use Bitrix\Catalog\EO_StoreBatchDocumentElement_Collection;
5
use Bitrix\Catalog\EO_StoreBatch;
6
use
Bitrix\Catalog\Product\Store\BatchManager
;
7
use
Bitrix\Catalog\StoreBatchDocumentElementTable
;
8
use
Bitrix\Main\Loader
;
9
use
Bitrix\Main\Result
;
10
use
Bitrix\Sale\ShipmentItemStore
;
11
12
Loader::includeModule(
'sale'
);
13
19
final
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
{
31
return
StoreBatchDocumentElementTable::add
([
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
{
42
return
StoreBatchDocumentElementTable::getList
([
43
'filter'
=> [
'=SHIPMENT_ITEM_STORE_ID'
=> $this->shipmentItemStore->getId()],
44
])
45
->fetchCollection()
46
;
47
}
48
}
Bitrix\Catalog\Product\Store\BatchManager
Definition
batchmanager.php:19
Bitrix\Catalog\Product\Store\DistributionStrategy\Base
Definition
base.php:21
Bitrix\Catalog\Product\Store\DistributionStrategy\Base\$batchManager
BatchManager $batchManager
Definition
base.php:23
Bitrix\Catalog\Product\Store\DistributionStrategy\ShipmentStore
Definition
shipmentstore.php:20
Bitrix\Catalog\Product\Store\DistributionStrategy\ShipmentStore\addRegistryItem
addRegistryItem(EO_StoreBatch $batchItem, float $amount)
Definition
shipmentstore.php:29
Bitrix\Catalog\Product\Store\DistributionStrategy\ShipmentStore\getRegistryItems
getRegistryItems()
Definition
shipmentstore.php:40
Bitrix\Catalog\Product\Store\DistributionStrategy\ShipmentStore\__construct
__construct(BatchManager $batchManager, ShipmentItemStore $shipmentItemStore)
Definition
shipmentstore.php:22
Bitrix\Catalog\StoreBatchDocumentElementTable
Definition
storebatchdocumentelementtable.php:28
Bitrix\Main\Loader
Definition
loader.php:12
Bitrix\Main\ORM\Data\DataManager\getList
static getList(array $parameters=array())
Definition
datamanager.php:441
Bitrix\Main\ORM\Data\DataManager\add
static add(array $data)
Definition
datamanager.php:874
Bitrix\Main\ORM\Data\Result
Definition
result.php:16
Bitrix\Main\Result
Definition
result.php:14
Bitrix\Sale\ShipmentItemStore
Definition
shipmentitemstore.php:16
Bitrix\Sale\ShipmentItemStore\getStoreId
getStoreId()
Definition
shipmentitemstore.php:414
Bitrix\Catalog\Product\Store\DistributionStrategy
Definition
base.php:2
modules
catalog
lib
product
store
distributionstrategy
shipmentstore.php
Создано системой
1.10.0