I wasn't sure of the cause so I stepped into the code causing this error which is in CU 1001, Job Post line, function PostInvoiceContractLineQuantity has been changed (initial a Job Task: Job No.= OT100, Job Task No.= 998) in Sales Line Document Type='Credit Memo',Document No.='VAB+000016',Line No.='10000'.
Factor := 1; IF SalesLine."Document Type" = SalesLine."Document Type"::"Credit Memo" THEN Factor := -1;but then a little further down there is a check
IF SalesLine.Quantity <> Factor * JobPlanningLine.Quantity THEN SalesLine.FIELDERROR(Quantity,Txt);The Sales line in question has a quantity of 1 as does the JobPlanningLine - however the logic of the code means that a credit note with a line assigned to a job task will *always* fail - am I missing something here?
Comments
The sales line is passed to CU 80::PostJobContractLine which then calls CU 1001::PostPlanningLine but a no point does the quantity get inversed by a 'factor' of -1 before posting the planning line.
In my case the quantity of 1 in the Credit Memo is posted as 1 in the planning line. This is then checked in CU 1001::PostInvoiceContractLine but using the following logic is this a bug? I can't believe billing and issuing credit notes against a project is so unusual that I've found a bug. There have got to be loads of people out there doing the same.
Ian
I did find a KB with a similar problem: 941514 - "A planning line for a job that has a purchase credit memo posted contains an positive quantity incorrectly in the "Job Planning List" dialog box in Microsoft Dynamics NAV 5.0" - While my problem afects sales credit memos, the problem seems to be almost identical and I suspect I'm going to have to make up a patch.
This is occuring on a credit memo with no associated invoice, the (one) line in the credit memo is for a G/L account and not an item.
I should also have mentioned that this is NAv 5.0 spanish version.
Ian