Credit note->job task lines: 'Quantity has been changed'

imurphyimurphy Member Posts: 308
While trying to register a Credit Note with a single line with a job number assigned I'm getting this error:
Quantity 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'.
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 PostInvoiceContractLine

The first lines of this function are
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?

I've been digging through the kbs but haven't noticed anything related to this problem. Cronus Sp1 has exactly the same code.

Anyone understand the logic ?

Ian

Comments

  • imurphyimurphy Member Posts: 308
    I should also add that the planning line which is causing the problem is created in CU 80, funcion PostJobContractLine.

    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
    SalesLine.Quantity <> Factor * JobPlanningLine.Quantity
    
    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
  • imurphyimurphy Member Posts: 308
    Well, noone seems to have picked up on my posting so it looks as if I'm exploring new territory here.

    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
Sign In or Register to comment.