feat: add custom buttons for invoice and email
This commit is contained in:
parent
8e0314e7f6
commit
3a67a78ece
@ -8,6 +8,22 @@ frappe.ui.form.on('Membership', {
|
||||
})
|
||||
},
|
||||
|
||||
refresh: function(frm) {
|
||||
!frm.doc.invoice && frm.add_custom_button("Generate Invoice", () => {
|
||||
frm.call("generate_invoice", {
|
||||
save: true
|
||||
}).then(() => {
|
||||
frm.reload_doc();
|
||||
});
|
||||
});
|
||||
|
||||
frm.add_custom_button("Send Acknowledgement", () => {
|
||||
frm.call("send_acknowlement").then(() => {
|
||||
frm.reload_doc();
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
onload: function(frm) {
|
||||
frm.add_fetch('membership_type', 'amount', 'amount');
|
||||
}
|
||||
|
@ -67,7 +67,6 @@ class Membership(Document):
|
||||
member = frappe.get_doc("Member", self.member)
|
||||
plan = frappe.get_doc("Membership Type", self.membership_type)
|
||||
settings = frappe.get_doc("Membership Settings")
|
||||
attachments = []
|
||||
|
||||
if not member.customer:
|
||||
frappe.throw(_("No customer linked to member {}", [member.name]))
|
||||
|
Loading…
Reference in New Issue
Block a user