On invoices i need to show the total amount in words as well

Asked by Akshay Jain

On invoices i need to show the total amount in words as well. How can i convert amount in numbers to amount in words? And this conversion i need to make according to India usage; for eg:- 123456789 should be converted to "TWELVE CRORE THIRTY FOUR LAKH FIFTY SIX THOUSAND SEVEN HUNDRED and EIGHTY NINE"

Question information

Language:
English Edit question
Status:
Answered
For:
Odoo Addons (MOVED TO GITHUB) Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:

This question was reopened

Revision history for this message
Vinay Rana (OpenERP) (vra-openerp) said :
#1

Hello,

This type of report is already exist in tiny, you can the related Indian accounting profile which is exist in extra addons:
profile_acount_india module: open the __terp__.py file and all related module regarding indian accounting
The following are the related module:
Name of the related modules of addons:=>account_voucher.
Name of the related extra-addons modules:=> account_voucher_report, account_voucher_workflow, account_voucher_payment, account_reports_india, account_invoice_india, l10n_chart_in.

The invoice report is exist in account_invoice_india module. you can check convert method in report py file, which converts the digits into word by using tools.amount_to_text method which is defined in server side,

Hope this will help you.

Thanks.

Revision history for this message
Akshay Jain (akshay-jain-7983) said :
#2

Thanks vra (openerp), that solved my question.

Revision history for this message
msshahanshah (msshahanshah) said :
#3

Hi I am a noob as far as openerp is concerned..
Could you guys be a bit more specific as to where I can check the convert method in report.py file ?
and what is this method you are talking about ? too.amount_to_test ??
Any help will be greatly appreciated.

Thanks in advance !
Mustafa

Revision history for this message
Akshay Jain (akshay-jain-7983) said :
#4

from tools import amount_to_text_en
 def convert(self,amount, cur):
  amt_en = amount_to_text_en.amount_to_text(amount,'en',cur);
  return amt_en

Revision history for this message
Akshay Jain (akshay-jain-7983) said :
#5

Hey vra,

For 5.0.7 the account_invoice_india module does not convert invoice to words correctly.
123456789 SHOULD be converted to "TWELVE CRORE THIRTY FOUR LAKH FIFTY SIX THOUSAND SEVEN HUNDRED and EIGHTY NINE" whereas it currently does is "ONE HUNDRED AND TWENTY THREE MILLION, FOUR HUNDRED AND FIFTY SIX THOUSAND SEVEN HUNDRED AND EIGHTY NINE". In India we DO NOT use MILLION, BILLION, TRILLION, etc BUT instead LAKH, CRORE, etc are used.

I would consider it a bug and if you want I can open a bug report and attach the patch that I coded for India specific conversion.

Revision history for this message
Vinay Rana (OpenERP) (vra-openerp) said :
#6

Hello Akshay Jain,

If you want to change for India, you can do this code (by inheriting the related class and method) in related Indian accounting module 'account_base' and which is related to stable extra addons so you can commit the changes there.

Thanks.

Can you help with this problem?

Provide an answer of your own, or ask Akshay Jain for more information if necessary.

To post a message you must log in.