NAV 2009 R2 Job module, disable usage requirement

alvi99alvi99 Member Posts: 71
Hi All,

If you worked with the Job Module you probably know this message:

"You should consume Item in Job before you post sales Invoice/Sales Credit Memo"

This error message is shown if you try to post a sales invoice / credit memo generated from the Job Module with Items, but did not post usage first.

When creating a Sales Credit Memo, due to a wrongly posted Sales Invoice, and create a new Sales Invoice, the process is quite circum: you first need to create negative journal lines for the Sales Credit Memo and positive journal lines for the new corrected Sales invoice. Setting Line Type to Contract you can have NAV create new contract lines. After that you create a Sales Credit Memo and a new Sales Invoice and post them. In NAV 2015 this process has changed and it is not necessary to consume an item before posting invoices / credit memos.

My question regarding NAV 2009:

If I out-comment this code in Codeunit 1001 Job Post-Line:

IF JobPlanningLine.Type = JobPlanningLine.Type::Item THEN
CheckItemQuantity(JobPlanningLine,SalesHeader,SalesLine);

the consume check is not performed and I can manually create a new contract line, create a sales credit memo and post it without first posting consumption.

See attached images for result with and without the code change.

Can anybody tell me if this code change would have any bad consequences?

Thanks

Comments

  • apertierraapertierra Member Posts: 61
    Well.. your main issue is that you open now the chance to wrongly try invoicing without the usage. If you are going to allow skipping the check, instead of just commenting out do something as follows:
    1) On the user setup create a new boolean field to setup the users that are allowed to skip the check (so a manager can be required to allow this to be done).
    2) in the code add something in this format (so you can at least get a warning so they can't prevent unwanted actions):
     --- before ---
        if (not testperformed) then
           error('You should... blah blah blah');
     --- after ----
       vbooleanvarPopError := TRUE;
       if (not testperformed) then
          BEGIN
             IF (user_allowed_to_bypass(USERID)) THEN
               BEGIN 
                  IF (CONFIRM('Message warning he is going to bypass the error. continue or  not.',FALSE)) THEN
                      vbooleanvarPopError := FALSE;
               END;
               IF (VBooleanVarPopError) THEN
                    error('you should... blah blah blah');
          END;
    
  • alvi99alvi99 Member Posts: 71
    Hi apertierra,

    Thanks for your reply. I dont think you answered my question? :-)

    Br,
    Alvi
Sign In or Register to comment.