Fase produccion: alinear plantilla fiscal con campos de impuestos
Actualiza invoice.fodt para usar itbis_invoiced_line y tip_invoiced tras la normalizacion de campos. Agrega prueba de regresion para evitar referencias al campo heredado itbis_line.
This commit is contained in:
+6
-6
@@ -1750,7 +1750,7 @@
|
||||
<text:p text:style-name="P49"><text:placeholder text:placeholder-type="text"><format_currency(line.amount, invoice.party.lang, invoice.currency)></text:placeholder></text:p>
|
||||
</table:table-cell>
|
||||
<table:table-cell table:style-name="Table1.E5" office:value-type="string">
|
||||
<text:p text:style-name="P50"><text:placeholder text:placeholder-type="text"><format_currency(line.itbis_line, invoice.party.lang, invoice.currency)></text:placeholder></text:p>
|
||||
<text:p text:style-name="P50"><text:placeholder text:placeholder-type="text"><format_currency(line.itbis_invoiced_line, invoice.party.lang, invoice.currency)></text:placeholder></text:p>
|
||||
</table:table-cell>
|
||||
</table:table-row>
|
||||
<table:table-row>
|
||||
@@ -2046,7 +2046,7 @@
|
||||
</table:table-row>
|
||||
<table:table-row table:style-name="Table4.2">
|
||||
<table:table-cell table:style-name="Table4.A2" table:number-columns-spanned="2" office:value-type="string">
|
||||
<text:p text:style-name="P45"><text:placeholder text:placeholder-type="text"><if test="invoice.tip > 0"></text:placeholder></text:p>
|
||||
<text:p text:style-name="P45"><text:placeholder text:placeholder-type="text"><if test="invoice.tip_invoiced > 0"></text:placeholder></text:p>
|
||||
</table:table-cell>
|
||||
<table:covered-table-cell/>
|
||||
</table:table-row>
|
||||
@@ -2055,7 +2055,7 @@
|
||||
<text:p text:style-name="P73">Propina:</text:p>
|
||||
</table:table-cell>
|
||||
<table:table-cell table:style-name="Table4.B12" office:value-type="string">
|
||||
<text:p text:style-name="P71"><text:placeholder text:placeholder-type="text"><format_currency(invoice.tip, invoice.party.lang, invoice.currency)></text:placeholder></text:p>
|
||||
<text:p text:style-name="P71"><text:placeholder text:placeholder-type="text"><format_currency(invoice.tip_invoiced, invoice.party.lang, invoice.currency)></text:placeholder></text:p>
|
||||
</table:table-cell>
|
||||
</table:table-row>
|
||||
<table:table-row table:style-name="Table4.1">
|
||||
@@ -2539,7 +2539,7 @@
|
||||
<text:p text:style-name="P49"><text:placeholder text:placeholder-type="text"><format_currency(line.amount, invoice.party.lang, invoice.currency)></text:placeholder></text:p>
|
||||
</table:table-cell>
|
||||
<table:table-cell table:style-name="Table5.E5" office:value-type="string">
|
||||
<text:p text:style-name="P50"><text:placeholder text:placeholder-type="text"><format_currency(line.itbis_line, invoice.party.lang, invoice.currency)></text:placeholder></text:p>
|
||||
<text:p text:style-name="P50"><text:placeholder text:placeholder-type="text"><format_currency(line.itbis_invoiced_line, invoice.party.lang, invoice.currency)></text:placeholder></text:p>
|
||||
</table:table-cell>
|
||||
</table:table-row>
|
||||
<table:table-row>
|
||||
@@ -2835,7 +2835,7 @@
|
||||
</table:table-row>
|
||||
<table:table-row table:style-name="Table13.2">
|
||||
<table:table-cell table:style-name="Table13.A2" table:number-columns-spanned="2" office:value-type="string">
|
||||
<text:p text:style-name="P45"><text:placeholder text:placeholder-type="text"><if test="invoice.tip > 0"></text:placeholder></text:p>
|
||||
<text:p text:style-name="P45"><text:placeholder text:placeholder-type="text"><if test="invoice.tip_invoiced > 0"></text:placeholder></text:p>
|
||||
</table:table-cell>
|
||||
<table:covered-table-cell/>
|
||||
</table:table-row>
|
||||
@@ -2844,7 +2844,7 @@
|
||||
<text:p text:style-name="P73">Propina:</text:p>
|
||||
</table:table-cell>
|
||||
<table:table-cell table:style-name="Table13.B12" office:value-type="string">
|
||||
<text:p text:style-name="P71"><text:placeholder text:placeholder-type="text"><format_currency(invoice.cdt_invoiced, invoice.party.lang, invoice.currency)></text:placeholder></text:p>
|
||||
<text:p text:style-name="P71"><text:placeholder text:placeholder-type="text"><format_currency(invoice.tip_invoiced, invoice.party.lang, invoice.currency)></text:placeholder></text:p>
|
||||
</table:table-cell>
|
||||
</table:table-row>
|
||||
<table:table-row table:style-name="Table13.1">
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import datetime
|
||||
from decimal import Decimal
|
||||
from pathlib import Path
|
||||
from types import SimpleNamespace
|
||||
import unittest
|
||||
|
||||
@@ -221,6 +222,15 @@ del ModuleTestCase
|
||||
|
||||
class NcfManagerUnitTestCase(unittest.TestCase):
|
||||
|
||||
def test_invoice_report_uses_current_tax_field_names(self):
|
||||
path = Path(__file__).parents[1] / 'invoice.fodt'
|
||||
template = path.read_text(encoding='utf-8')
|
||||
|
||||
self.assertNotIn('line.itbis_line', template)
|
||||
self.assertEqual(template.count('line.itbis_invoiced_line'), 2)
|
||||
self.assertEqual(template.count('if test="invoice.tip_invoiced'), 2)
|
||||
self.assertEqual(template.count('format_currency(invoice.tip_invoiced'), 2)
|
||||
|
||||
def test_sequence_defaults_match_ncf_type(self):
|
||||
sequence = SimpleNamespace(
|
||||
sequence_type=SimpleNamespace(name='Factura de Crédito Fiscal'))
|
||||
|
||||
Reference in New Issue
Block a user