There is an issue with the reserve line button reserving the full qty when the user changes units on the Reservation Form of a Sales Order. It reserves an odd amount and not the full qty that is available to reserve. Does anyone know a fix or solution for this?
This is the current code for when the reserve line button is clicked
void clicked()
{
PdsCW_InventOnhandReserve cwInventOnhandReserve;
PdsBatchDispCheck_Reserve pdsDispCheck;
CustAccount custId;
Common common = element.args().record();
;
super();
if ( #PdsShelfEnabled)
{
switch (common.TableId)
{
case tablenum(SalesLine) :
custId = common.(fieldnum(SalesLine,CustAccount));
break;
case tablenum(SalesParmLine) :
custId = common.(fieldnum(SalesParmLine,CustAccount));
break;
default :
custId = '';
}
if (!inventBatch::PdsCheckExpiryDate(inventDim.inventBatchId,
inventTrans.ItemId,
checkDate,
true,
custId,
overrideFEFO))
{
throw error("@PRO2139");
}
}
if (#PdsEnabled)
{
pdsDispCheck = PdsBatchDispCheck_Reserve::construct();
if (!pdsDispCheck.validateTransCheck(inventTrans,element.args().record()))
{
throw error("@PRO2139");
}
}
if (pdsIsCWItem(inventTransMovement.ItemId))
{
cwInventOnhandReserve = inventOnhandReserve;
cwInventOnhandReserve.pdsCWUpdateReserveLine(inventSum,
inventTransMovement_ds.pdsCWMovementOnOrder(inventTransMovement),
inventDim,inventTransMovement);
}
else
{
inventOnhandReserve.updateReserveLine(inventSum, inventTransMovement_ds.movementOnOrder(inventTransMovement));
}
element.refreshMovement();
reserveNow.setFocus();
}