Hi Guys,
I can't post Purch Invoice which line has job no. and item tracking code.
the scenario like this:
1. I made a purchase order for item with tracking line contain serial no & lot no.
2. This Item I purchase I allocate to a specific Job and Job Task line no.
3. I post receive only this purchase order.
4. then I use purchase invoice by executing get receipt line (combine shipment).
5. when trying to post then error comes.
it always telling the quantity in purchase receipt greater than expected.
6. from my investigation, after post receive this purch. line with job no. and tracking code,
NAV replace it's item tracking quantity to invoice with -1 instead of retaining qty. 1.
(NAV use negative adjmt. for consumption to job).
7. this problem never happen when post purch. line without job.
Anyone can help with some idea to overcome this???
...BHT
Regards,
BHT
0
Comments
The suggestion as below:
Existing code:
ItemLedgEntry.SETRANGE("Job No.",ItemJnlLine."Job No.");
ItemLedgEntry.SETRANGE("Job Task No.",ItemJnlLine."Job Task No.");
ItemLedgEntry.SETRANGE("Item No.",ItemJnlLine."Item No.");
IF ItemLedgEntry.FINDFIRST THEN BEGIN
REPEAT
IF ItemLedgEntry."Entry No." = ItemJnlLine."Item Shpt. Entry No." THEN BEGIN
ItemLedgEntry.NEXT;
ItemJnlLine."Item Shpt. Entry No." := ItemLedgEntry."Entry No.";
EXIT;
END;
UNTIL ItemLedgEntry.NEXT = 0;
END;
Replacement code
WITH ItemLedgEntry DO BEGIN
SETRANGE("Job No.",ItemJnlLine."Job No.");
SETRANGE("Job Task No.",ItemJnlLine."Job Task No.");
SETRANGE("Item No.",ItemJnlLine."Item No.");
SETFILTER("Item Tracking",'<>%1',"Item Tracking"::None);
IF FINDFIRST THEN BEGIN
SETRANGE("Entry Type",ItemJnlLine."Entry Type"::"Negative Adjmt.");
SETRANGE("Serial No.",ItemJnlLine."Serial No.");
SETRANGE("Lot No.",ItemJnlLine."Lot No.");
IF FINDFIRST THEN
ItemJnlLine."Item Shpt. Entry No." := "Entry No.";
EXIT;
END;
SETRANGE("Item Tracking");
IF FINDSET THEN
REPEAT
IF "Entry No." = ItemJnlLine."Item Shpt. Entry No." THEN BEGIN
NEXT;
ItemJnlLine."Item Shpt. Entry No." := "Entry No.";
EXIT;
END;
UNTIL NEXT = 0;
END;
But unfortunately doesn't change anything... ](*,)
BHT
BHT