Reserve without changing dimension.
Reserve for specific dimension.
dtProdBOMReserve(Args _args)
{
prodJournalBOM prodJournalBOM;
InventUpd_Reservation reservation;
;
select * from prodJournalBOM
where prodJournalBOM.RecId == 5637695365;
movement = InventMovement::construct(prodJournalBOM);
reserveQuantity = prodJournalBOM.BOMConsump - abs(movement.transIdSum().reserved());
if(reserveQuantity)
{
reservation = InventUpd_Reservation::newMovement(movement,-reserveQuantity,true);
reservation.updateNow();
}
info('Reserved.');
}
Reserve for specific dimension.
static void dtProdBOMReserveWithDim(Args _args)
{
prodJournalBOM prodJournalBOM;;
InventDim InventDim;
InventUpd_Reservation reservation;
;
select * from prodJournalBOM
where prodJournalBOM.RecId == 5637695365;
//Update dimension
inventDim = prodJournalBOM.inventDim();
inventDim.wMSLocationId = '12420301';
movement = InventMovement::construct(prodJournalBOM);
reserveQuantity = prodJournalBOM.BOMConsump - abs(movement.transIdSum().reserved());
if(reserveQuantity)
{
reservation = InventUpd_Reservation::newInventDim(movement,inventDim, -reserveQuantity,false);
reservation.updateNow();
}
info('Reserved.');
}
No comments:
Post a Comment