From 1c1f22dd450e29a8a29afb3608f3c3421370836b Mon Sep 17 00:00:00 2001 From: Marco Colombo Date: Fri, 20 Nov 2020 15:40:11 +0100 Subject: [PATCH] [ADD] aggiunto test per importi 0.0000000 (propedeutico all'uso di xmlschema) --- .../tests/data/IT05979361218_016.xml | 98 +++++++++++++++++++ .../tests/test_import_fatturapa_xml.py | 12 +++ 2 files changed, 110 insertions(+) create mode 100644 l10n_it_fatturapa_in/tests/data/IT05979361218_016.xml diff --git a/l10n_it_fatturapa_in/tests/data/IT05979361218_016.xml b/l10n_it_fatturapa_in/tests/data/IT05979361218_016.xml new file mode 100644 index 000000000000..aad2d919e601 --- /dev/null +++ b/l10n_it_fatturapa_in/tests/data/IT05979361218_016.xml @@ -0,0 +1,98 @@ + + + + + + IT + 05979361218 + + 006 + FPA12 + UFPQ1O + + + + + IT + 05979361218 + + + SOCIETA' ALPHA BETA SRL + + RF02 + + + VIALE ROMA 543B + 07100 + SASSARI + SS + IT + + + + + 80213330584 + + AMMINISTRAZIONE BETA + + + + VIA TORINO 38-B + 00145 + ROMA + RM + IT + + + + + + + TD01 + EUR + 2019-05-11 + 852S1 + 18.07 + Rif ordine 908 + + + + + 1 + USB4 + 1.00 + Pz. + 18.07 + 18.07 + 0.00 + N4 + + + 2 + USB + 1.00 + Pz. + 16.60 + + SC + 100.00 + + 0.0000000 + 0.00 + N4 + + + 0.00 + N4 + -0.00 + 18.07 + 0.00 + I + Esenzione Art.8 comma 1 DPR 633/72 + + + + diff --git a/l10n_it_fatturapa_in/tests/test_import_fatturapa_xml.py b/l10n_it_fatturapa_in/tests/test_import_fatturapa_xml.py index 42202e313bc1..af9d75b607bc 100644 --- a/l10n_it_fatturapa_in/tests/test_import_fatturapa_xml.py +++ b/l10n_it_fatturapa_in/tests/test_import_fatturapa_xml.py @@ -664,6 +664,18 @@ def test_44_xml_import(self): invoice = self.invoice_model.browse(invoice_id) self.assertTrue(len(invoice.invoice_line_ids) == 3) + def test_45_xml_many_zeros(self): + res = self.run_wizard('test42', 'IT05979361218_016.xml') + invoice_id = res.get('domain')[0][2][0] + invoice = self.invoice_model.browse(invoice_id) + self.assertEqual(invoice.amount_total, 18.07) + self.assertEqual(invoice.invoice_line_ids[0].price_unit, 18.07) + self.assertEqual(invoice.invoice_line_ids[0].quantity, 1.0) + self.assertEqual(invoice.invoice_line_ids[0].price_subtotal, 18.07) + self.assertEqual(invoice.invoice_line_ids[1].price_unit, 16.60) + self.assertEqual(invoice.invoice_line_ids[1].quantity, 1.0) + self.assertEqual(invoice.invoice_line_ids[1].price_subtotal, 0.0) + def test_01_xml_link(self): """ E-invoice lines are created.