Hello all,
"Purch. Invoice Header" table contains field "Amount Incl. VAT". It has a flowfield type and shows the sum of "Amount Incl. VAT" in lines. At the present moment I have a Purchase Invoice with "Amount Incl. VAT" equal to 99.99. My client wants it to be rounded to 100.
Field "Amount Incl. VAT" has AutoFormatType property set to 1. As help says when system calculates this field it cals AutoFormatTranslate function in 1 cdu.
This function returns format property in the following manner:
<Precision,%1><Standard format,0>
Precision is taken either from Currency table or GLSetup table, field "Amount Decimal Places".
One way to make "Amount Incl. VAT" field equal to 100 is to change "Amount Decimal Places" for a given currency to 0:0. It works. But it affects the whole system and it works not precisely as I want. I want system to ROUND value, not just use less decimals.
I understand that I can erase AutoFormatType property and use "DecimalPlaces" value (0:0) for this field, but this way again system won't ROUND decimal + this new setting will apply all currencies, not the one I use. Also I doubt if it is okay to change this property, won't I face some problems in future?
Is there any clear way to ROUND flowfield value?
Thanks!
Answers
Rishi
My customer needs it because he imports payments for invoices from external system and this payment contains rounded number. User posts the payment (for example 100) and when he applies payment with invoice (99.99), 0.01 cent remains unaplied. This is not so critical, but still the client does not want such small differencies to occur.
Rishi
Have you checked whether "Invoice Rounding" is checked or not in "Purchases & Payables Setup" ??
Rishi
I thought may be this is so because I use an old version of Navision, so I checked it in NAV5, Cronus database. The same thing appear - "Inv. Rounding Precision (LCY)" in General Ledger Setup does not affect "Amount Incl. VAT" flowfield in Purchase Invoice Header.
In fact I don't really unrderstand how this setup should affect decimals of this flowfield, help says very promptly that AutoFormatTranslate function is being called and this function does not look at "Inv. Rounding Precision (LCY)" field. Rishi1109, may be some additional code is written in your verision of Navision? Could you please check this in Cronus, when you have time? It would be really appreciated!
In any case, thank you for your help, I didn't know about such setup as "Invoice Rounding", will be usable in future, thanks!
Can you please check the InvoiceRounding function in codeunit 90 (viz. Purch.-Post) and compare it with some newer version ???
Rishi
Have a look at the "VAT Difference" field and maybe also at the "VAT Calculation Type" field on sales and purchase lines.
I am sorry the my late reply, but laster is better than never!
Thank you very much for your answers, I learnt some new stuff from your replies!