mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-31 18:59:08 +00:00
fix: do not show generate irn for invalid supply type
This commit is contained in:
committed by
Deepesh Garg
parent
df09c76148
commit
48527c48d2
@@ -2,7 +2,11 @@ erpnext.setup_einvoice_actions = (doctype) => {
|
|||||||
frappe.ui.form.on(doctype, {
|
frappe.ui.form.on(doctype, {
|
||||||
refresh(frm) {
|
refresh(frm) {
|
||||||
const einvoicing_enabled = frappe.db.get_value("E Invoice Settings", "E Invoice Settings", "enable");
|
const einvoicing_enabled = frappe.db.get_value("E Invoice Settings", "E Invoice Settings", "enable");
|
||||||
if (!einvoicing_enabled) return;
|
const supply_type = frm.doc.gst_category;
|
||||||
|
if (!einvoicing_enabled
|
||||||
|
|| !['Registered Regular', 'SEZ', 'Overseas', 'Deemed Export'].includes(supply_type)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (frm.doc.docstatus == 0 && !frm.doc.irn && !frm.doc.__unsaved) {
|
if (frm.doc.docstatus == 0 && !frm.doc.irn && !frm.doc.__unsaved) {
|
||||||
frm.add_custom_button(
|
frm.add_custom_button(
|
||||||
|
|||||||
Reference in New Issue
Block a user