mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-29 18:04:46 +00:00
fix: fetch customer related data in making payment entry from customer
This commit is contained in:
@@ -8,6 +8,7 @@ frappe.ui.form.on("Customer", {
|
|||||||
Quotation: "Quotation",
|
Quotation: "Quotation",
|
||||||
"Sales Order": "Sales Order",
|
"Sales Order": "Sales Order",
|
||||||
"Pricing Rule": "Pricing Rule",
|
"Pricing Rule": "Pricing Rule",
|
||||||
|
"Payment Entry": "Payment Entry",
|
||||||
};
|
};
|
||||||
frm.make_methods = {
|
frm.make_methods = {
|
||||||
Quotation: () =>
|
Quotation: () =>
|
||||||
@@ -26,6 +27,11 @@ frappe.ui.form.on("Customer", {
|
|||||||
method: "erpnext.selling.doctype.customer.customer.make_opportunity",
|
method: "erpnext.selling.doctype.customer.customer.make_opportunity",
|
||||||
frm: frm,
|
frm: frm,
|
||||||
}),
|
}),
|
||||||
|
"Payment Entry": () =>
|
||||||
|
frappe.model.open_mapped_doc({
|
||||||
|
method: "erpnext.selling.doctype.customer.customer.make_payment_entry",
|
||||||
|
frm: cur_frm,
|
||||||
|
}),
|
||||||
"Pricing Rule": () => erpnext.utils.make_pricing_rule(frm.doc.doctype, frm.doc.name),
|
"Pricing Rule": () => erpnext.utils.make_pricing_rule(frm.doc.doctype, frm.doc.name),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -438,6 +438,33 @@ def make_opportunity(source_name, target_doc=None):
|
|||||||
return target_doc
|
return target_doc
|
||||||
|
|
||||||
|
|
||||||
|
@frappe.whitelist()
|
||||||
|
def make_payment_entry(source_name, target_doc=None):
|
||||||
|
print(source_name, target_doc)
|
||||||
|
|
||||||
|
def set_missing_values(source, target):
|
||||||
|
_set_missing_values(source, target)
|
||||||
|
|
||||||
|
target_doc = get_mapped_doc(
|
||||||
|
"Customer",
|
||||||
|
source_name,
|
||||||
|
{
|
||||||
|
"Customer": {
|
||||||
|
"doctype": "Payment Entry",
|
||||||
|
"field_map": {
|
||||||
|
"name": "party",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
target_doc,
|
||||||
|
set_missing_values,
|
||||||
|
)
|
||||||
|
target_doc.party_type = "Customer"
|
||||||
|
target_doc.party_name = target_doc.party
|
||||||
|
|
||||||
|
return target_doc
|
||||||
|
|
||||||
|
|
||||||
def _set_missing_values(source, target):
|
def _set_missing_values(source, target):
|
||||||
address = frappe.get_all(
|
address = frappe.get_all(
|
||||||
"Dynamic Link",
|
"Dynamic Link",
|
||||||
|
|||||||
Reference in New Issue
Block a user