From c12164463279f8dd259e9e0e055674c576d7d9cc Mon Sep 17 00:00:00 2001 From: Ivo Branco Date: Thu, 11 Jul 2024 12:40:49 +0100 Subject: [PATCH] fix: incorrect VAT ID sent to SageX3 --- apps/billing/services/processor_service.py | 2 +- apps/billing/tests/test_sagex3_processor_data.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/billing/services/processor_service.py b/apps/billing/services/processor_service.py index 1cfccf5..bb57ff0 100644 --- a/apps/billing/services/processor_service.py +++ b/apps/billing/services/processor_service.py @@ -140,7 +140,7 @@ def __generate_data(self) -> str: {country_code} {postal_code} {city} - {vat_identification_number} + {vat_identification_country}{vat_identification_number} {email} {transaction_type} diff --git a/apps/billing/tests/test_sagex3_processor_data.py b/apps/billing/tests/test_sagex3_processor_data.py index e7b9fa4..eb127af 100644 --- a/apps/billing/tests/test_sagex3_processor_data.py +++ b/apps/billing/tests/test_sagex3_processor_data.py @@ -164,9 +164,9 @@ def test_data_processor_vat_identification_number_corporate(self): Test the SageX3Processor for country code field. """ object_xml_root: ET.Element = self.__class__._get_xml_element_from_transaction( - TransactionFactory(vat_identification_number=503904040) + TransactionFactory(vat_identification_country="ES", vat_identification_number="A123456789") ) - self.assertEqual(object_xml_root.findtext(".//*/FLD[@NAME='YBPIEECNUM']"), "503904040") + self.assertEqual(object_xml_root.findtext(".//*/FLD[@NAME='YBPIEECNUM']"), "ESA123456789") def test_data_processor_email(self): """