changeset 8cc45dbfda06 in modules/account_es:default
details: 
https://hg.tryton.org/modules/account_es?cmd=changeset&node=8cc45dbfda06
description:
        Add invoice with small amount in surcharge tax scenario

        issue10617
        review373141002
diffstat:

 tests/scenario_reporting_surcharge_tax.rst |  14 +++++++++++---
 tests/vat_book.csv                         |   1 +
 2 files changed, 12 insertions(+), 3 deletions(-)

diffs (44 lines):

diff -r 420be127ae66 -r 8cc45dbfda06 tests/scenario_reporting_surcharge_tax.rst
--- a/tests/scenario_reporting_surcharge_tax.rst        Mon Aug 09 12:53:54 
2021 +0200
+++ b/tests/scenario_reporting_surcharge_tax.rst        Mon Aug 09 13:17:11 
2021 +0200
@@ -95,6 +95,14 @@
     >>> 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 @@
     ...     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 -r 420be127ae66 -r 8cc45dbfda06 tests/vat_book.csv
--- a/tests/vat_book.csv        Mon Aug 09 12:53:54 2021 +0200
+++ b/tests/vat_book.csv        Mon Aug 09 13:17:11 2021 +0200
@@ -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;;;;;;

Reply via email to