From 120a90fdfc1774f8c8ed3dc19c478203b55c61c0 Mon Sep 17 00:00:00 2001 From: Tiago-Salles Date: Thu, 17 Oct 2024 09:50:16 +0000 Subject: [PATCH] feat: send ITMDES field to sage processor --- apps/billing/mocks.py | 2 +- apps/billing/services/processor_service.py | 1 + apps/billing/tests/test_utils.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/billing/mocks.py b/apps/billing/mocks.py index 8a5bd61..9f01fac 100644 --- a/apps/billing/mocks.py +++ b/apps/billing/mocks.py @@ -365,7 +365,7 @@ def xml_success_response_mock(data): {data["transaction_item_data"]['ITMREF']} - Genérico NAU - Formação Cientifca e Tec. + {data["transaction_item_data"]['ITMDES1']} {data["transaction_item_data"]['ITMDES1']} diff --git a/apps/billing/services/processor_service.py b/apps/billing/services/processor_service.py index 3c6b52c..5820fc8 100644 --- a/apps/billing/services/processor_service.py +++ b/apps/billing/services/processor_service.py @@ -72,6 +72,7 @@ def __generate_items_as_xml(self, items: list[TransactionItem]) -> str: {items_as_xml} N0001 + {item.description} {item.description} {item.quantity} UN diff --git a/apps/billing/tests/test_utils.py b/apps/billing/tests/test_utils.py index 0467207..d03347f 100644 --- a/apps/billing/tests/test_utils.py +++ b/apps/billing/tests/test_utils.py @@ -35,7 +35,7 @@ def insert_in_dict(item: dict): else: client_data[item["@NAME"]] = item["#text"] - if item["@NAME"] in ["ITMREF", "ITMDES1", "QTY", "STU", "GROPRI", "DISCRGVAL1", "VACITM1"]: + if item["@NAME"] in ["ITMREF", "ITMDES", "ITMDES1", "QTY", "STU", "GROPRI", "DISCRGVAL1", "VACITM1"]: transaction_item_data[item["@NAME"]] = item["#text"]