fix: KSA Invoice print format for multicurrency invoices (#28495)

This commit is contained in:
mergify[bot]
2021-11-22 18:25:37 +05:30
committed by GitHub
parent 145bcbaa6d
commit 761bd8c97b
3 changed files with 13 additions and 5 deletions

View File

@@ -316,7 +316,8 @@ doc_events = {
'validate': ["erpnext.erpnext_integrations.taxjar_integration.set_sales_tax"]
},
"Company": {
"on_trash": "erpnext.regional.india.utils.delete_gst_settings_for_company"
"on_trash": ["erpnext.regional.india.utils.delete_gst_settings_for_company",
"erpnext.regional.saudi_arabia.utils.delete_vat_settings_for_company"]
},
"Integration Request": {
"validate": "erpnext.accounts.doctype.payment_request.payment_request.validate_payment"

File diff suppressed because one or more lines are too long

View File

@@ -82,4 +82,11 @@ def delete_qr_code_file(doc, method):
'file_url': doc.get('qr_code')
})
if len(file_doc):
frappe.delete_doc('File', file_doc[0].name)
frappe.delete_doc('File', file_doc[0].name)
def delete_vat_settings_for_company(doc, method):
if doc.country != 'Saudi Arabia':
return
settings_doc = frappe.get_doc('KSA VAT Setting', {'company': doc.name})
settings_doc.delete()