Monday, September 10, 2007

Transfer Orders - "Receive Remain" show weird value after multiple shipments and received (2)

Just debugged and found it was caused by following code under InventPickingListJournalRegistrate class - updatePickingListJournal method.

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:
  1. 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.

1 comment:

Dynamics AX associate said...

It is great that you have narrowed the issue to Picking List Registration.

Base on my interpretation of the code segment, that piece is trying to detect over delivery and updates the relevant tables to anticipate it. I personally do not think this has to do with over delivery control. The strange part here is the figures that are evaluated to identify over delivery has nothing to do with Picking List Registration.

I suspect the intention was to compare quantity pending shipment against Receive Remain. Pending shipment here is defined as updated picking list that has not been shipped. Due to the inability to differentiate shipped Picking List, the Shipped Quantity is used against the total updated Picking List to get pending shipment picking list amount.

Base on the above assumption, the quantity in all updated Picking List has to be calculated first. Assuming that the figure is assigned to QtyPickingListPosted, the code would look like the following.

if (inventTransferLine.QtyRemainReceive
    < abs(inventTransferLine.QtyShipped -
    QtyPickingListPosted)) {
  ...

I would be grateful if you could give this a try. I believe you are in a better position to test this out.