fix: e-invoicing option visible even if settings disabled (#25021)

This commit is contained in:
Saqib 2021-03-26 16:40:51 +05:30 committed by GitHub
parent 2a39b74ad2
commit f66aab6d98
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,7 +1,8 @@
erpnext.setup_einvoice_actions = (doctype) => {
frappe.ui.form.on(doctype, {
refresh(frm) {
const einvoicing_enabled = frappe.db.get_value("E Invoice Settings", "E Invoice Settings", "enable");
async refresh(frm) {
const { message } = await frappe.db.get_value("E Invoice Settings", "E Invoice Settings", "enable");
const einvoicing_enabled = cint(message.enable);
const supply_type = frm.doc.gst_category;
const valid_supply_type = ['Registered Regular', 'SEZ', 'Overseas', 'Deemed Export'].includes(supply_type);
const company_transaction = frm.doc.billing_address_gstin == frm.doc.company_gstin;