Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update some fixes #8

Open
wants to merge 2 commits into
base: multi-company
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions zatca2024/zatca2024/createxml.py
Original file line number Diff line number Diff line change
Expand Up @@ -629,8 +629,8 @@ def xml_structuring(invoice,sales_invoice_doc):
file.write(pretty_xml_string)
# Attach the getting xml for each invoice
try:
if frappe.db.exists("File",{ "attached_to_name": sales_invoice_doc.name, "attached_to_doctype": sales_invoice_doc.doctype }):
frappe.db.delete("File",{ "attached_to_name":sales_invoice_doc.name, "attached_to_doctype": sales_invoice_doc.doctype })
if frappe.db.exists("File",{"file_name": "E-invoice-" + sales_invoice_doc.name + ".xml" }):
frappe.db.delete("File",{"file_name": "E-invoice-" + sales_invoice_doc.name + ".xml" })
except Exception as e:
frappe.throw(frappe.get_traceback())

Expand All @@ -652,4 +652,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) )
frappe.throw("Error occured in XML structuring and attach. Please contact your system administrator"+ str(e) )
4 changes: 3 additions & 1 deletion zatca2024/zatca2024/zatcasdkcode.py
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,7 @@ def attach_QR_Image_For_Reporting(qr_code_value,sales_invoice_doc):

})
file.save(ignore_permissions=True)
frappe.db.set_value("Sales Invoice",sales_invoice_doc.name,'ksa_einv_qr',file.file_url)
except Exception as e:
frappe.throw("Error in qr image attach for reporting api " + str(e))

Expand Down Expand Up @@ -753,6 +754,7 @@ def attach_QR_Image_For_Clearance(xml_cleared,sales_invoice_doc):

})
file.save(ignore_permissions=True)
frappe.db.set_value("Sales Invoice",sales_invoice_doc.name,'ksa_einv_qr',file.file_url)
except Exception as e:
frappe.throw("error in qrcode from cleared xml: " + str(e) )

Expand Down Expand Up @@ -955,4 +957,4 @@ def zatca_Background_on_submit(doc, method=None):
# # queue="short",
# # timeout=200,
# # invoice_number=invoice_number)
# # frappe.msgprint("queued")
# # frappe.msgprint("queued")