StockChangeListFactoryService

Implements \Shopware\Plugins\ViisonPickwareERP\Components\StockLedger\StockChangeList\StockChangeListFactory, \Enlight_Hook

package

Default

Methods

__construct

__construct(\Shopware\Components\Model\ModelManager $entityManager) 

Arguments

$entityManager

\Shopware\Components\Model\ModelManager

Given a quantity and an ordered list of bin location mappings, creates a list of changes that pick quantity units of stock by successively reducing all passed mappings to zero in the order they are given.

createPickingStockChangesFromBinLocationMappings(integer $quantity, array $binLocationMappings, \Shopware\CustomModels\ViisonPickwareERP\Warehouse\BinLocation $fallbackBinLocation) : array<mixed,\Shopware\Plugins\ViisonPickwareERP\Components\StockLedger\StockChangeList\BinLocationStockChange>
inheritdoc

Arguments

$quantity

integer

how many items of stock to pick

$binLocationMappings

array

the mappings to pick from in order of precedence

Response

array<mixed,\Shopware\Plugins\ViisonPickwareERP\Components\StockLedger\StockChangeList\BinLocationStockChange>

Creates and returns a stock change list that changes exactly one bin location.

createSingleBinLocationStockChangeList(\Shopware\CustomModels\ViisonPickwareERP\Warehouse\BinLocation $binLocation, integer $stockChange) : \Shopware\Plugins\ViisonPickwareERP\Components\StockLedger\StockChangeList\PositiveStockChangeList|\Shopware\Plugins\ViisonPickwareERP\Components\StockLedger\StockChangeList\NegativeStockChangeList

Creates and returns either a positive change list containing a single bin location stock change for the 'stocking' bin location in case the given $changeAmount is positive. If it is negative, the 'picking' bin locations are used to create a negative change list.

createStockChangeList(\Shopware\CustomModels\ViisonPickwareERP\Warehouse\Warehouse $warehouse, \Shopware\Models\Article\Detail $articleDetail, integer $changeAmount) : \Shopware\Plugins\ViisonPickwareERP\Components\StockLedger\StockChangeList\PositiveStockChangeList|\Shopware\Plugins\ViisonPickwareERP\Components\StockLedger\StockChangeList\NegativeStockChangeList