Fix amount in words for FR
Description
Environment
Attachments
- 16 Oct 2017, 08:25 AM
- 09 Sep 2017, 03:37 PM
Activity
Nicolas Micoud October 16, 2017 at 10:25 AM
Carlos Ruiz October 16, 2017 at 9:53 AM
Thanks Nicolas,
My suggestion is to make it more generic, useful for internal print formats (not just jasper) and for any language/currency.
For that I see we would need to implement a way to read the currency from the document being printed.
It goes through something like:
Add columns C_Currency.PrintName and C_Currency_Trl.PrintName
Add a new interface AmtInWordsWithCurrency with methods:
getAmtInWordsWithCurrency(String amount, int c_currency_id);
getAmtInWordsWithCurrency(String amount, int c_currency_id, String caseFormatting)Change AmtInWords_FR to implement the new interface
Invite maintainers of other languages to implement the same on corresponding languages
Until there you have the generic implementation, but then it comes what I don't see clearly, maybe better to brainstorm it in forums.
How to make it useful for document print formats?
I see we would require to change LayoutEngine.
The actual approach is very simple, in a view you create a column with name AmtInWords containing the number you want formatted.
So, to enable usage of this new possibility, maybe we can add a new column AmtInWordsWithCurrency to the views C_Order_Header_v, C_PaySelection_Check_v, C_PaySelection_Remittance_v, C_Invoice_Header_v, C_Dunning_Line_v
That's the first idea that comes to my mind, but maybe there is a better one.
Nicolas Micoud October 16, 2017 at 8:26 AM
Hi @Carlos Ruiz,
Please find an updated patch where the currency "name" can be passed through a new parameter or read from C_Currency.Description.
I also added new options for lettercase.
Thanks,
Nicolas
Carlos Ruiz October 13, 2017 at 1:56 PM
Hi @Nicolas Micoud, similar to my answer on https://idempiere.atlassian.net/browse/IDEMPIERE-3471#icft=IDEMPIERE-3471
It seems wrong to add hardcoded currency to AmtInWords, this must be achieved in a more generic way where the AmtInWords can receive maybe the currency and extract the name from C_Currency.Description (or a new PrintName column).
I see in wikipedia many countries that speak french and just a few use Euro.
https://blogs.transparent.com/french/currencies-in-french-speaking-countries/
I would suggest better to open a ticket (or use this one) to implement some generic way to pass currency to AmtInWords in any language.
Nicolas Micoud September 9, 2017 at 3:37 PM
Hi,
I've started to play with this class.
The patch contains fix and new methods so developers can add 'euro' (lowercase/uppercase).
Regards,
Nicolas
Xref: https://groups.google.com/forum/?nomobile=true#!topic/idempiere/mTPxLDfX554