It seem like used to handle over-delivery but I'm wonder how to get the calculation method.
//handle potential overdelivery for transfer orders
if (inventPickingListJournalLine.InventPickRequesterType ==
InventPickRequesterType::Transfer)
{
inventTransferLine = inventMovement.buffer();
if (inventTransferLine)
{
if (inventTransferLine.QtyRemainReceive < abs(inventTransferLine.QtyShipped - inventTransferLine.QtyRemainShip))
{
inventTransferLine.QtyRemainReceive = abs(inventTransferLine.QtyShipped - inventTransferLine.QtyRemainShip);
inventTransferLine.updateEstimatedReceipt();
}
}
}
For me, over-delivery should be:
Over-delivery quantity = total received quantity - total transfer quantity
//handle potential overdelivery for transfer orders
if (inventPickingListJournalLine.InventPickRequesterType ==
InventPickRequesterType::Transfer)
{
inventTransferLine = inventMovement.buffer();
if (inventTransferLine)
{
if (inventTransferLine.QtyTransfer < abs(inventTransferLine.QtyShipped + inventTransferLine.QtyRemainShip))
{
inventTransferLine.QtyRemainReceive = abs(inventTransferLine.QtyShipped + inventTransferLine.QtyRemainShip - inventTransferLine.QtyReceived);
inventTransferLine.updateEstimatedReceipt();
}
}
}
Note:
- I have tried to use the over-delivery function and configured TO Line\Setup tab. It seems like not working. Probably someone can enlighten to me how to activate the function.