From 2b4d7f4fde8a2e99c2b5c0d53060e5265f506c92 Mon Sep 17 00:00:00 2001 From: Sergi Almacellas Abellana Date: Mon, 9 Aug 2021 13:17:11 +0200 Subject: [PATCH] Add invoice with small amount in surcharge tax scenario issue10617 review373141002 --- tests/scenario_reporting_surcharge_tax.rst | 14 +++++++++++--- tests/vat_book.csv | 1 + 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/tests/scenario_reporting_surcharge_tax.rst b/tests/scenario_reporting_surcharge_tax.rst index 68902d3de8..6073c6e81d 100644 --- a/tests/scenario_reporting_surcharge_tax.rst +++ b/tests/scenario_reporting_surcharge_tax.rst @@ -95,6 +95,14 @@ Create invoices:: >>> invoice.click('post') >>> invoice.total_amount Decimal('63.10') + >>> invoice, = invoice.duplicate() + >>> invoice.invoice_date = fiscalyear.start_date + >>> line, = invoice.lines + >>> line.quantity = 1 + >>> line.unit_price = Decimal('0.03') + >>> invoice.click('post') + >>> invoice.total_amount + Decimal('0.04') Generate VAT Book:: @@ -109,15 +117,15 @@ Generate VAT Book:: ... report = Report('account.reporting.aeat.vat_book') ... extension, content, _, name = report.execute(records) >>> len(records) - 2 - >>> tax_record, = [r for r in records if not r.surcharge_tax] + 3 + >>> tax_record = [r for r in records if not r.surcharge_tax][0] >>> tax_record.party == party True >>> tax_record.base_amount == Decimal('100.00') True >>> tax_record.tax_amount == Decimal('21.00') True - >>> surcharge_tax_record, = [r for r in records if r.surcharge_tax] + >>> surcharge_tax_record = [r for r in records if r.surcharge_tax][0] >>> surcharge_tax_record.party == surcharge_party True >>> surcharge_tax_record.base_amount == Decimal('50.00') diff --git a/tests/vat_book.csv b/tests/vat_book.csv index f602da8d05..be65089ad8 100644 --- a/tests/vat_book.csv +++ b/tests/vat_book.csv @@ -1,2 +1,3 @@ 2020;1T;E;;F1;;;01/01/2020;;;1;;00000000T;;Party;;121,00;100,00;21,00;21,00;;;;;;;; 2020;1T;E;;F1;;;01/01/2020;;;2;;00000001R;;Surcharge Party;;63,10;50,00;21,00;10,50;5,20;2,60;;;;;; +2020;1T;E;;F1;;;01/01/2020;;;3;;00000001R;;Surcharge Party;;0,04;0,03;21,00;0,01;5,20;0,00;;;;;;