Hello,
Our client has a purchase order where field "Job No." on all purchase lines have been assigned to a job. When the purchase lines were received, the system created an item ledger entry where "Entry Type" is "Negative Adjmt." in addition to the "normal" entry where "Entry Type" is "Purchase". Basically the items received were consumed immediately when the purchase order was received, which is what NAV does when a purchase line is assigned to a job.
This is OK and our client is aware of this, but our client has a problem when invoicing the purchase lines. NAV doesn't seem to be a big fan of line discount on purchase lines assigned to a job. The system does not allow it and returns the error "Discount Amount must be 0 in Item Journal Line...". The error code is in codeunit 21. If "Entry Type" is either "Positive Adjmt." or "Negative Adjmt." the code calls the TESTFIELD function on field "Discount Amount" to ensure that it is zero.
Does anybody know the reason behind this? Why won't the system allow discount amount on item journal lines with entry type positive/negative adjustment (shouldn't line amount be all that matters? :-k ) and is it safe to remove the code that returns the error? I have tried to remove the code in a test environement and the purchase order is then successfully posted, but I'm worried if this change might cause future headaches.
Cheers, and thanks for any input on this!
[EDIT]
This is NAV 5.0 SP1 (Norwegian Version)
[/EDIT]
0
Answers
I suppose could one build in an exception (like AND Job No. is not empty), but there is this additional problem Discount Amount = (Line Discount Amount + Inv. Discount Amount) * currency factor + rounding ... so one can't just chuck the Discount Amount into the Line Discount Amount of the Job Journal Line, you probably need to find a strategy f.e. not allow Invoice Discounts when it is a Job etc. etc.
That's the way to do it Nagi! BRAVO!