Sales Invoice to Non-Profit Member

Hi all,

I have a case where a non-profit has members, who each has to pay a yearly fee. They would like to issue “Sales Invoices” for this. However, the Sales Invoice requires a “Customer”. Is there a simpler way than duplicating each member into a customer?

Thanks!

1 Like

Using this script as a custom script on “Member” at least auto-creates a customer from a member:

frappe.ui.form.on("Member", {
  refresh: function(frm) {
    frm.add_custom_button(__("Create Customer"), function() {
      frappe.call({
        method: 'frappe.client.insert',
        args: {
          doc: {
            'doctype': 'Customer',
            'customer_name': frm.doc.member_name,
            'customer_type': "Individual",
            'customer_group': "Mitglieder",
            'territory': "Schweiz"
          } 
        },
        callback: function (response) {
          frappe.show_alert(__("Customer created"));
        }
      });
    });
  }
});

Maybe this is useful to someone…

1 Like

Hi, thanks for this.

The script is created on the server side or on the client side?

Martín