Skip to content

Commit 3b002f0

Browse files
committed
[FIX] l10n_ar: 5614/2024: Tax Breakdown on B2C (0.0 taxes)
When doing a Invoice B to exempts customer we have a problem: the RG Leyend new table is not showed, This because if the VAT Content and other taxes were 0. After checking with ARCA Online PDF report, and some feedback with customers we found out that the Leyend it is always shown and the VAT content line is always shown, even if VAT taxes are 0.0. Only need to hide the other taxes line if this one is 0.0 We also add a new key to the dictionary that prepare the tax detail values to properly identify the group of taxes. If not we will need to depend on the translations of the name to check which group it is. Update unit test to follow this new approach and also add a unit case where vat tax 0.0 and not other taxes are added. opw-4814730 closes odoo#214866 Signed-off-by: Antoine Dupuis (andu) <[email protected]>
1 parent 0caa44c commit 3b002f0

File tree

2 files changed

+38
-3
lines changed

2 files changed

+38
-3
lines changed

addons/l10n_ar/models/account_move.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,6 @@ def grouping_function(base_line, tax_data):
403403
if (
404404
grouping_key
405405
and not grouping_key['skip']
406-
and not self.currency_id.is_zero(values['tax_amount_currency'])
407406
):
408407
results.append({
409408
'name': grouping_key['name'],

addons/l10n_ar/tests/test_manual.py

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ def test_18_invoice_b_tax_breakdown_1(self):
255255
def test_19_invoice_b_tax_breakdown_2(self):
256256
""" Display only Other Taxes (VAT taxes are 0) """
257257
invoice = self._create_invoice_from_dict({
258-
'ref': 'test_invoice_21: inal Consumer Invoice B with 0 tax and internal tax',
258+
'ref': 'test_invoice_21: Final Consumer Invoice B with 0 tax and internal tax',
259259
"move_type": 'out_invoice',
260260
"partner_id": self.partner_cf,
261261
"company_id": self.company_ri,
@@ -270,8 +270,14 @@ def test_19_invoice_b_tax_breakdown_2(self):
270270
{
271271
'tax_amount_currency': 300.00,
272272
'formatted_tax_amount_currency': '300.00',
273-
'name': 'Other National Ind. Taxes $',
273+
'name': 'Other National Ind. Taxes $'
274274
},
275+
{
276+
'formatted_tax_amount_currency': '0.00',
277+
'name': 'VAT Content $',
278+
'tax_amount_currency': 0.0
279+
}
280+
275281
])
276282
self._assert_tax_totals_summary(invoice._l10n_ar_get_invoice_totals_for_report(), {
277283
'same_tax_base': True,
@@ -282,6 +288,36 @@ def test_19_invoice_b_tax_breakdown_2(self):
282288
'subtotals': [],
283289
})
284290

291+
def test_20_invoice_b_tax_breakdown_3(self):
292+
""" Display only Other Taxes (VAT taxes are 0 and non other taxes) """
293+
invoice = self._create_invoice_from_dict({
294+
'ref': 'test_invoice_22: Final Consumer Invoice B with only 0 tax',
295+
"move_type": 'out_invoice',
296+
"partner_id": self.partner_cf,
297+
"company_id": self.company_ri,
298+
"invoice_date": "2021-03-20",
299+
"invoice_line_ids": [
300+
{'product_id': self.product_iva_105_perc, 'price_unit': 10000.0, 'quantity': 1,
301+
'tax_ids': [(6, 0, [self.tax_no_gravado.id])]},
302+
],
303+
})
304+
results = invoice._l10n_ar_get_invoice_custom_tax_summary_for_report()
305+
self.assertEqual(results, [
306+
{
307+
'tax_amount_currency': 0.0,
308+
'formatted_tax_amount_currency': '0.00',
309+
'name': 'VAT Content $'
310+
},
311+
])
312+
self._assert_tax_totals_summary(invoice._l10n_ar_get_invoice_totals_for_report(), {
313+
'same_tax_base': True,
314+
'currency_id': self.currency.id,
315+
'base_amount_currency': 10000.0,
316+
'tax_amount_currency': 0.0,
317+
'total_amount_currency': 10000.0,
318+
'subtotals': [],
319+
})
320+
285321
def test_l10n_ar_prices_and_taxes(self):
286322
invoice = self.env['account.move'].create({
287323
"move_type": 'out_invoice',

0 commit comments

Comments
 (0)