diff --git a/account_financial_report/i18n/es.po b/account_financial_report/i18n/es.po
index 81212bc3..c41b7c92 100644
--- a/account_financial_report/i18n/es.po
+++ b/account_financial_report/i18n/es.po
@@ -685,3 +685,11 @@ msgstr "12 Meses | YTD"
msgid "Total"
msgstr "Total"
+#. module: account_financial_report
+#: code:addons/account_financial_report/report/parser.py:82
+#, python-format
+msgid "\n"
+"VAT OF COMPANY NOT AVAILABLE"
+msgstr "\n"
+"VAT DE LA COMPAÑIA NO DISPONIBLE"
+
diff --git a/account_financial_report/report/balance_full.rml b/account_financial_report/report/balance_full.rml
index ff072615..4c100d9d 100644
--- a/account_financial_report/report/balance_full.rml
+++ b/account_financial_report/report/balance_full.rml
@@ -16,7 +16,7 @@
|
[[ (company.name and company.name or 'NOMBRE DE COMPANIA NO DISPONIBLE')]]
- [[ company.partner_id.vat and ('- %s-%s-%s'%(company.partner_id.vat[2:3],company.partner_id.vat[3:11],company.partner_id.vat[11:12])) or '' ]]
+ [[ get_vat_by_country(data['form']) ]]
|
diff --git a/account_financial_report/report/balance_full_13_cols.rml b/account_financial_report/report/balance_full_13_cols.rml
index 6a68b3e2..36b475da 100644
--- a/account_financial_report/report/balance_full_13_cols.rml
+++ b/account_financial_report/report/balance_full_13_cols.rml
@@ -17,7 +17,7 @@
|
[[ (company.name and company.name or 'NOMBRE DE COMPANIA NO DISPONIBLE')]]
- [[ company.partner_id.vat and ('- %s-%s-%s'%(company.partner_id.vat[2:3],company.partner_id.vat[3:11],company.partner_id.vat[11:12])) or '' ]]
+ [[ get_vat_by_country(data['form']) ]]
|
diff --git a/account_financial_report/report/balance_full_2_cols.rml b/account_financial_report/report/balance_full_2_cols.rml
index 86f8c54f..c8e07653 100644
--- a/account_financial_report/report/balance_full_2_cols.rml
+++ b/account_financial_report/report/balance_full_2_cols.rml
@@ -16,7 +16,7 @@
|
[[ (company.name and company.name or 'NOMBRE DE COMPANIA NO DISPONIBLE')]]
- [[ company.partner_id.vat and ('- %s-%s-%s'%(company.partner_id.vat[2:3],company.partner_id.vat[3:11],company.partner_id.vat[11:12])) or '' ]]
+ [[ get_vat_by_country(data['form']) ]]
|
diff --git a/account_financial_report/report/balance_full_4_cols.rml b/account_financial_report/report/balance_full_4_cols.rml
index 779b64ac..efd7219c 100644
--- a/account_financial_report/report/balance_full_4_cols.rml
+++ b/account_financial_report/report/balance_full_4_cols.rml
@@ -17,7 +17,7 @@
|
[[ (company.name and company.name or 'NOMBRE DE COMPANIA NO DISPONIBLE')]]
- [[ company.partner_id.vat and ('- %s-%s-%s'%(company.partner_id.vat[2:3],company.partner_id.vat[3:11],company.partner_id.vat[11:12])) or '' ]]
+ [[ get_vat_by_country(data['form']) ]]
|
diff --git a/account_financial_report/report/balance_full_4_cols_analytic_ledger.rml b/account_financial_report/report/balance_full_4_cols_analytic_ledger.rml
index 8852974f..478fe619 100644
--- a/account_financial_report/report/balance_full_4_cols_analytic_ledger.rml
+++ b/account_financial_report/report/balance_full_4_cols_analytic_ledger.rml
@@ -17,7 +17,7 @@
|
[[ (company.name and company.name or 'NOMBRE DE COMPANIA NO DISPONIBLE')]]
- [[ company.partner_id.vat and ('- %s-%s-%s'%(company.partner_id.vat[2:3],company.partner_id.vat[3:11],company.partner_id.vat[11:12])) or '' ]]
+ [[ get_vat_by_country(data['form']) ]]
|
@@ -34,7 +34,7 @@
- Pag.:
+ Pag.: -
diff --git a/account_financial_report/report/balance_full_5_cols.rml b/account_financial_report/report/balance_full_5_cols.rml
index f29f7bdc..5a5342a5 100644
--- a/account_financial_report/report/balance_full_5_cols.rml
+++ b/account_financial_report/report/balance_full_5_cols.rml
@@ -17,7 +17,7 @@
|
[[ (company.name and company.name or 'NOMBRE DE COMPANIA NO DISPONIBLE')]]
- [[ company.partner_id.vat and ('- %s-%s-%s'%(company.partner_id.vat[2:3],company.partner_id.vat[3:11],company.partner_id.vat[11:12])) or '' ]]
+ [[ get_vat_by_country(data['form']) ]]
|
diff --git a/account_financial_report/report/balance_full_qtr_cols.rml b/account_financial_report/report/balance_full_qtr_cols.rml
index d2f8d01c..c806f0d8 100644
--- a/account_financial_report/report/balance_full_qtr_cols.rml
+++ b/account_financial_report/report/balance_full_qtr_cols.rml
@@ -17,7 +17,7 @@
|
[[ (company.name and company.name or 'NOMBRE DE COMPANIA NO DISPONIBLE')]]
- [[ company.partner_id.vat and ('- %s-%s-%s'%(company.partner_id.vat[2:3],company.partner_id.vat[3:11],company.partner_id.vat[11:12])) or '' ]]
+ [[ get_vat_by_country(data['form']) ]]
|
diff --git a/account_financial_report/report/parser.py b/account_financial_report/report/parser.py
index 9963074a..9ea487f2 100644
--- a/account_financial_report/report/parser.py
+++ b/account_financial_report/report/parser.py
@@ -59,8 +59,27 @@ class account_balance(report_sxw.rml_parse):
'get_informe_text': self.get_informe_text,
'get_month': self.get_month,
'exchange_name': self.exchange_name,
+ 'get_vat_by_country': self.get_vat_by_country,
})
self.context = context
+
+
+ def get_vat_by_country(self, form):
+ """
+ Return the vat of the partner by country
+ """
+ rc_obj = self.pool.get('res.company')
+ country_code=rc_obj.browse(self.cr, self.uid, form['company_id'][0]).partner_id.country_id.code or ''
+ string_vat= rc_obj.browse(self.cr, self.uid, form['company_id'][0]).partner_id.vat or ''
+ if string_vat:
+ if country_code=='MX':
+ return '%s' % (string_vat[2:])
+ elif country_code=='VE':
+ return '- %s-%s-%s'%(string_vat[2:3],string_vat[3:11],string_vat[11:12])
+ else:
+ return string_vat
+ else:
+ return _('\nVAT OF COMPANY NOT AVAILABLE')
def get_fiscalyear_text(self, form):
"""
@@ -250,6 +269,7 @@ class account_balance(report_sxw.rml_parse):
ids2.append([aa_brw.id, True, True, aa_brw])
return ids2
+
#############################################################################
# CONTEXT FOR ENDIND BALANCE #
#######################################################################