[regional] ability to send gst reminders to all parties

This commit is contained in:
Rushabh Mehta
2017-06-27 17:31:41 +05:30
parent 51520f9de6
commit 00ae424cac
22 changed files with 432 additions and 71 deletions

View File

@@ -0,0 +1,25 @@
erpnext.setup_gst_reminder_button = (doctype) => {
frappe.ui.form.on(doctype, {
refresh: (frm) => {
if(!frm.is_new()) {
var missing = false;
frm.doc.__onload.addr_list && frm.doc.__onload.addr_list.forEach((d) => {
if(!d.gstin) missing = true;
});
if (!missing) return;
frm.add_custom_button('Send GST Update Reminder', () => {
return new Promise((resolve) => {
return frappe.call({
method: 'erpnext.regional.doctype.gst_settings.gst_settings.send_gstin_reminder',
args: {
party_type: frm.doc.doctype,
party: frm.doc.name,
}
}).always(() => { resolve(); });
});
});
}
}
})
};

View File

@@ -64,7 +64,7 @@ def add_custom_roles_for_reports():
)).insert()
def add_permissions():
for doctype in ('GST HSN Code',):
for doctype in ('GST HSN Code', 'GST Settings'):
add_permission(doctype, 'Accounts Manager', 0)
add_permission(doctype, 'All', 0)