15.03.2011, 16:36 | #1 |
Участник
|
Сбор суммы по партионным остаткам
Доброго времени суток.
Добрые люди, подскажите плиз, как (по каким полям) собрать сумму по остаткам? Метод который собирает количественные остатки: X++: static InventQty Get_InventDateSum(ItemId _itemId, InventLocationId _inventLocationId, InventBatchId _inventBatchId, DateStatus endDate ) { InventTrans _inventTrans; InventDim _inventDim; // находим количество пришедшее за период select sum(Qty) from _inventTrans group by ItemId where _inventTrans.ItemId == _itemId && _inventTrans.DatePhysical <= endDate && _inventTrans.StatusIssue != StatusIssue::OnOrder && _inventTrans.StatusIssue != StatusIssue::Picked && _inventTrans.StatusIssue != StatusIssue::ReservOrdered && _inventTrans.StatusIssue != StatusIssue::ReservPhysical && _inventTrans.StatusIssue != StatusIssue::QuotationIssue && _inventTrans.StatusReceipt != StatusReceipt::Registered && _inventTrans.StatusReceipt != StatusReceipt::Arrived && _inventTrans.StatusReceipt != StatusReceipt::QuotationReceipt && _inventTrans.StatusReceipt != StatusReceipt::Ordered join _inventDim where _inventTrans.InventDimId == _inventDim.inventDimId && _inventDim.inventBatchId == _inventBatchId && _inventDim.InventLocationId == _inventLocationId; return _inventTrans.Qty; } |
|