-
Notifications
You must be signed in to change notification settings - Fork 26
Open
Description
We get below error while submitting invoice with Item Tax Template
myinvois/myinvois_erpgulf/myinvois_erpgulf/createxml.py
Lines 851 to 873 in 4f67df3
cac_TaxCategory = ET.SubElement(cac_TaxSubtotal, "cac:TaxCategory") | |
raw_item_id_code = sales_invoice_doc.custom_zatca_tax_category | |
cat_id_val = ET.SubElement(cac_TaxCategory, "cbc:ID") | |
# cat_id_val.text = str(sales_invoice_doc.custom_zatca_tax_category) | |
cat_id_val.text = raw_item_id_code.split(":")[0].strip() | |
# <cbc:Percent>0.00</cbc:Percent><cbc:TaxExemptionReason>NA</cbc:TaxExemptionReason> | |
prct = ET.SubElement(cac_TaxCategory, "cbc:Percent") | |
prct.text = str(sales_invoice_doc.taxes[0].rate) | |
exemption = ET.SubElement(cac_TaxCategory, "cbc:TaxExemptionReason") | |
if (sales_invoice_doc.custom_zatca_tax_category) == "E": | |
exemption.text = sales_invoice_doc.custom_exemption_code | |
else: | |
exemption.text = "NA" | |
cac_TaxScheme = ET.SubElement(cac_TaxCategory, "cac:TaxScheme") | |
taxscheme_id = ET.SubElement( | |
cac_TaxScheme, "cbc:ID", schemeAgencyID="6", schemeID="UN/ECE 5153" | |
) | |
taxscheme_id.text = "OTH" | |
return invoice | |
except Exception as e: | |
frappe.throw(_(f"Error tax total: {str(e)}")) | |
return None |
Metadata
Metadata
Assignees
Labels
No labels