VAT Rounding Problem

ClaudioPereiraClaudioPereira Member Posts: 38
Hello everyone,

I've implemented a new Document Type (Hire Order) in a navision 3.70 customer, that document is exactly like a sales order being the only diference that it calculates the amount in run-time (already inside codeunit 80)

It calculates (changes) the amount very early in the code so the VAT and all other calculations are done by the standard code.

However there is a difference in how it calculates the VAT: in a scenario where sales rounds 1 line up and another line down - making the overall total correct, my document is rounding both lines up and therefore calculating the wrong total VAT for the document.

Anyone knows where is the code where navision calculates the VAT?
Also any ideas on what's missing?

Thanks in advance
Claudio

Comments

  • David_CoxDavid_Cox Member Posts: 509
    Sales Release Codeunit 414

    This is where the VAT is calculated, you may have to investigate the VAT Line calls in here.
    Analyst Developer with over 17 years Navision, Contract Status - Busy
    Mobile: +44(0)7854 842801
    Email: david.cox@adeptris.com
    Twitter: https://twitter.com/Adeptris
    Website: http://www.adeptris.com
  • ClaudioPereiraClaudioPereira Member Posts: 38
    Hi, Thanks for the help,

    I've tried running this codeunit after changing the amount on the lines but now i'm having consistency errors.

    I've tried to comment the consistency function in CU 12, and what it's doing it's not posting one of the lines, but the total amount is still the same. that seems to only happen for certain amounts though ](*,)
  • girish.joshigirish.joshi Member Posts: 407
    Do NOT comment out the consistency check in Navision. It will basically render all the accounting useless.

    Check how VAT is handled in the Release Sales Document -- that's the only way.
  • David_CoxDavid_Cox Member Posts: 509
    Hello everyone,

    I've implemented a new Document Type (Hire Order) in a navision 3.70 customer, that document is exactly like a sales order being the only diference that it calculates the amount in run-time (already inside codeunit 80)

    It calculates (changes) the amount very early in the code so the VAT and all other calculations are done by the standard code.
    Claudio

    "Inconsistency errors can make you database, unrecoverable from a backup, if you have a problem fix it don't work around it"


    ?? diference that it calculates the amount in run-time ?? How Why ??

    !! You must release the document to calculate VAT properly !!

    I had a look at the code and I cannot see how an extra "Document Type", on the Header and Lines, can cause a problem, calculating VAT with the standard release functions,
    However Adding a new document type has an Impact system wide, not a path anyone would take lightly.

    how do you deal with the New Document type in codeunit 80 ??
    Posting what Document type to the G/L, Item, Value, VAT Ledgers etc?

    I would check the RoundingLineInserted functions in CodeUnit 80

    Create 2 Documents, first a Standard Order the second your new type, same item data, then release both documents, check the lines finance values are the same, if not then check why.

    Post the order Ship and Invoice!
    If this post ok and yours don't then the problem is in CU80, might be RoundingLineInserted functions, or a document type problem.

    If your New Document emulates an Order then everywhere the document type is order you need to add your type.

    Good lock! [-o<
    Analyst Developer with over 17 years Navision, Contract Status - Busy
    Mobile: +44(0)7854 842801
    Email: david.cox@adeptris.com
    Twitter: https://twitter.com/Adeptris
    Website: http://www.adeptris.com
  • ClaudioPereiraClaudioPereira Member Posts: 38
    David Cox wrote:
    Hello everyone,

    I've implemented a new Document Type (Hire Order) in a navision 3.70 customer, that document is exactly like a sales order being the only diference that it calculates the amount in run-time (already inside codeunit 80)

    It calculates (changes) the amount very early in the code so the VAT and all other calculations are done by the standard code.
    Claudio

    "Inconsistency errors can make you database, unrecoverable from a backup, if you have a problem fix it don't work around it"


    ?? diference that it calculates the amount in run-time ?? How Why ??

    !! You must release the document to calculate VAT properly !!

    I had a look at the code and I cannot see how an extra "Document Type", on the Header and Lines, can cause a problem, calculating VAT with the standard release functions,
    However Adding a new document type has an Impact system wide, not a path anyone would take lightly.

    how do you deal with the New Document type in codeunit 80 ??
    Posting what Document type to the G/L, Item, Value, VAT Ledgers etc?

    I would check the RoundingLineInserted functions in CodeUnit 80

    Create 2 Documents, first a Standard Order the second your new type, same item data, then release both documents, check the lines finance values are the same, if not then check why.

    Post the order Ship and Invoice!
    If this post ok and yours don't then the problem is in CU80, might be RoundingLineInserted functions, or a document type problem.

    If your New Document emulates an Order then everywhere the document type is order you need to add your type.

    Good lock! [-o<

    Hello,

    Thanks for your help, after a bit of research i was able to get everything working just.

    I had to calculate the amount in run-time because it's a rental system i'm implementing, and at the time of posting the user only know how much is the weekly rate, the system then calculates the invoice amount considering the time interval, the rate, which days are working days, etc.
    that is also why i had to add the new document, because as a rental, the order has to stay in the system until the item is returned, and generate a new invoice for the same item every month that it's out on rent. That is not the behavior of the normal sales order that they also use.

    Again, thanks a lot for your help,

    Best regards,
    Claudio
  • David_CoxDavid_Cox Member Posts: 509
    Glad we could help out \:D/

    I would have modified the blanket orders to resove your weekly hire scenario, and created Invoices instead of orders from the blanket order, and the link would already be there with the blanket order number!

    But thats the beauty of Navision ask one question and get twenty different soloutions! :shock:
    Analyst Developer with over 17 years Navision, Contract Status - Busy
    Mobile: +44(0)7854 842801
    Email: david.cox@adeptris.com
    Twitter: https://twitter.com/Adeptris
    Website: http://www.adeptris.com
Sign In or Register to comment.