From 703b7602caf4a4ec68690feb0c97b99cf25a4ca6 Mon Sep 17 00:00:00 2001 From: sahalMoidu Date: Mon, 6 May 2024 10:16:38 +0400 Subject: [PATCH 1/2] item_name instead of item_code in create XML --- zatca2024/zatca2024/createxml.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zatca2024/zatca2024/createxml.py b/zatca2024/zatca2024/createxml.py index dd5ff58..adc2013 100644 --- a/zatca2024/zatca2024/createxml.py +++ b/zatca2024/zatca2024/createxml.py @@ -589,7 +589,7 @@ def item_data(invoice,sales_invoice_doc): cbc_RoundingAmount.text=str(abs(round(single_item.base_net_amount + (item_tax_percentage * single_item.base_net_amount / 100),2))) cac_Item = ET.SubElement(cac_InvoiceLine, "cac:Item") cbc_Name = ET.SubElement(cac_Item, "cbc:Name") - cbc_Name.text = single_item.item_code + cbc_Name.text = single_item.item_name cac_ClassifiedTaxCategory = ET.SubElement(cac_Item, "cac:ClassifiedTaxCategory") cbc_ID_11 = ET.SubElement(cac_ClassifiedTaxCategory, "cbc:ID") if sales_invoice_doc.custom_zatca_tax_category == "Standard": @@ -651,4 +651,4 @@ def xml_structuring(invoice,sales_invoice_doc): except Exception as e: frappe.throw(frappe.get_traceback()) except Exception as e: - frappe.throw("Error occured in XML structuring and attach. Please contact your system administrator"+ str(e) ) \ No newline at end of file + frappe.throw("Error occured in XML structuring and attach. Please contact your system administrator"+ str(e) ) From 2ad6e629c3ca9ba60819691dc8c2e963c72e6ba1 Mon Sep 17 00:00:00 2001 From: sahalMoidu Date: Mon, 6 May 2024 10:30:08 +0400 Subject: [PATCH 2/2] fix: PEP8 formating --- zatca2024/zatca2024/createxml.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zatca2024/zatca2024/createxml.py b/zatca2024/zatca2024/createxml.py index adc2013..60a81a0 100644 --- a/zatca2024/zatca2024/createxml.py +++ b/zatca2024/zatca2024/createxml.py @@ -651,4 +651,7 @@ def xml_structuring(invoice,sales_invoice_doc): except Exception as e: frappe.throw(frappe.get_traceback()) except Exception as e: - frappe.throw("Error occured in XML structuring and attach. Please contact your system administrator"+ str(e) ) + frappe.throw( + "Error occured in XML structuring and attach. Please contact your system administrator" + + str(e) + )