mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-25 16:04:46 +00:00
[fix] dashboard for customer, supplier
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
// License: GNU General Public License v3. See license.txt
|
||||
|
||||
frappe.provide("erpnext.utils");
|
||||
frappe.provide('erpnext.party');
|
||||
erpnext.utils.get_party_details = function(frm, method, args, callback) {
|
||||
if(!method) {
|
||||
method = "erpnext.accounts.party.get_party_details";
|
||||
@@ -69,7 +70,7 @@ erpnext.utils.get_address_display = function(frm, address_field, display_field,
|
||||
if(r.message) {
|
||||
frm.set_value(display_field, r.message)
|
||||
}
|
||||
|
||||
|
||||
if(frappe.meta.get_docfield(frm.doc.doctype, "taxes") && !is_your_company_address) {
|
||||
if(!erpnext.utils.validate_mandatory(frm, "Customer/Supplier",
|
||||
frm.doc.customer || frm.doc.supplier, address_field)) return;
|
||||
@@ -99,7 +100,7 @@ erpnext.utils.get_address_display = function(frm, address_field, display_field,
|
||||
} else {
|
||||
frm.set_value(display_field, null);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
erpnext.utils.get_contact_details = function(frm) {
|
||||
@@ -139,3 +140,30 @@ erpnext.utils.get_shipping_address = function(frm){
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
erpnext.party.setup_dashboard = function(frm) {
|
||||
frm.dashboard.reset(frm.doc);
|
||||
if(frm.doc.__islocal)
|
||||
return;
|
||||
|
||||
$.each(frm.doc.__onload.transactions, function(i, doctype) {
|
||||
frm.dashboard.add_doctype_badge(doctype, frm.doc.doctype.toLowerCase());
|
||||
})
|
||||
|
||||
return frappe.call({
|
||||
type: "GET",
|
||||
method: "erpnext.accounts.party_status.get_transaction_info",
|
||||
args: {
|
||||
party_type: frm.doc.doctype,
|
||||
party_name: frm.doc.name
|
||||
},
|
||||
callback: function(r) {
|
||||
$.each(r.message.transaction_count, function(i, d) {
|
||||
if(d.count) {
|
||||
frm.dashboard.set_badge_count(d.name, d.count)
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user