mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-24 23:49:19 +00:00
Merge branch 'nabinhait-mc3' into develop
This commit is contained in:
@@ -39,16 +39,12 @@ cur_frm.cscript.make_dashboard = function(doc) {
|
|||||||
},
|
},
|
||||||
callback: function(r) {
|
callback: function(r) {
|
||||||
if (in_list(user_roles, "Accounts User") || in_list(user_roles, "Accounts Manager")) {
|
if (in_list(user_roles, "Accounts User") || in_list(user_roles, "Accounts Manager")) {
|
||||||
if(r.message["company_currency"].length == 1) {
|
cur_frm.dashboard.set_headline(
|
||||||
cur_frm.dashboard.set_headline(
|
__("Total Billing This Year: ") + "<b>"
|
||||||
__("Total Billing This Year: ") + "<b>"
|
+ format_currency(r.message.billing_this_year, cur_frm.doc.party_account_currency)
|
||||||
+ format_currency(r.message.billing_this_year, r.message.company_currency[0])
|
+ '</b> / <span class="text-muted">' + __("Total Unpaid") + ": <b>"
|
||||||
+ '</b> / <span class="text-muted">' + __("Total Unpaid") + ": <b>"
|
+ format_currency(r.message.total_unpaid, cur_frm.doc.party_account_currency)
|
||||||
+ format_currency(r.message.total_unpaid, r.message.company_currency[0])
|
+ '</b></span>');
|
||||||
+ '</b></span>');
|
|
||||||
} else {
|
|
||||||
cur_frm.dashboard.set_headline("");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
cur_frm.dashboard.set_badge_count(r.message);
|
cur_frm.dashboard.set_badge_count(r.message);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -178,7 +178,7 @@
|
|||||||
"ignore_user_permissions": 1,
|
"ignore_user_permissions": 1,
|
||||||
"in_filter": 0,
|
"in_filter": 0,
|
||||||
"in_list_view": 0,
|
"in_list_view": 0,
|
||||||
"label": "Default Currency",
|
"label": "Billing Currency",
|
||||||
"no_copy": 1,
|
"no_copy": 1,
|
||||||
"options": "Currency",
|
"options": "Currency",
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
@@ -534,7 +534,7 @@
|
|||||||
"is_submittable": 0,
|
"is_submittable": 0,
|
||||||
"issingle": 0,
|
"issingle": 0,
|
||||||
"istable": 0,
|
"istable": 0,
|
||||||
"modified": "2015-09-11 15:51:26",
|
"modified": "2015-09-17 14:05:24.793609",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Buying",
|
"module": "Buying",
|
||||||
"name": "Supplier",
|
"name": "Supplier",
|
||||||
|
|||||||
@@ -93,9 +93,11 @@ def get_dashboard_info(supplier):
|
|||||||
out[doctype] = frappe.db.get_value(doctype,
|
out[doctype] = frappe.db.get_value(doctype,
|
||||||
{"supplier": supplier, "docstatus": ["!=", 2] }, "count(*)")
|
{"supplier": supplier, "docstatus": ["!=", 2] }, "count(*)")
|
||||||
|
|
||||||
billing_this_year = frappe.db.sql("""select sum(base_grand_total)
|
billing_this_year = frappe.db.sql("""
|
||||||
from `tabPurchase Invoice`
|
select sum(ifnull(credit_in_account_currency, 0)) - sum(ifnull(debit_in_account_currency, 0))
|
||||||
where supplier=%s and docstatus = 1 and fiscal_year = %s""",
|
from `tabGL Entry`
|
||||||
|
where voucher_type='Purchase Invoice' and party_type = 'Supplier'
|
||||||
|
and party=%s and fiscal_year = %s""",
|
||||||
(supplier, frappe.db.get_default("fiscal_year")))
|
(supplier, frappe.db.get_default("fiscal_year")))
|
||||||
|
|
||||||
total_unpaid = frappe.db.sql("""select sum(outstanding_amount)
|
total_unpaid = frappe.db.sql("""select sum(outstanding_amount)
|
||||||
|
|||||||
@@ -64,16 +64,12 @@ cur_frm.cscript.setup_dashboard = function(doc) {
|
|||||||
},
|
},
|
||||||
callback: function(r) {
|
callback: function(r) {
|
||||||
if (in_list(user_roles, "Accounts User") || in_list(user_roles, "Accounts Manager")) {
|
if (in_list(user_roles, "Accounts User") || in_list(user_roles, "Accounts Manager")) {
|
||||||
if(r.message["company_currency"].length == 1) {
|
cur_frm.dashboard.set_headline(
|
||||||
cur_frm.dashboard.set_headline(
|
__("Total Billing This Year: ") + "<b>"
|
||||||
__("Total Billing This Year: ") + "<b>"
|
+ format_currency(r.message.billing_this_year, cur_frm.doc.party_account_currency)
|
||||||
+ format_currency(r.message.billing_this_year, r.message["company_currency"][0])
|
+ '</b> / <span class="text-muted">' + __("Unpaid") + ": <b>"
|
||||||
+ '</b> / <span class="text-muted">' + __("Unpaid") + ": <b>"
|
+ format_currency(r.message.total_unpaid, cur_frm.doc.party_account_currency)
|
||||||
+ format_currency(r.message.total_unpaid, r.message["company_currency"][0])
|
+ '</b></span>');
|
||||||
+ '</b></span>');
|
|
||||||
} else {
|
|
||||||
cur_frm.dashboard.set_headline("");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
cur_frm.dashboard.set_badge_count(r.message);
|
cur_frm.dashboard.set_badge_count(r.message);
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -128,9 +128,11 @@ def get_dashboard_info(customer):
|
|||||||
out[doctype] = frappe.db.get_value(doctype,
|
out[doctype] = frappe.db.get_value(doctype,
|
||||||
{"customer": customer, "docstatus": ["!=", 2] }, "count(*)")
|
{"customer": customer, "docstatus": ["!=", 2] }, "count(*)")
|
||||||
|
|
||||||
billing_this_year = frappe.db.sql("""select sum(base_grand_total)
|
billing_this_year = frappe.db.sql("""
|
||||||
from `tabSales Invoice`
|
select sum(ifnull(debit_in_account_currency, 0)) - sum(ifnull(credit_in_account_currency, 0))
|
||||||
where customer=%s and docstatus = 1 and fiscal_year = %s""",
|
from `tabGL Entry`
|
||||||
|
where voucher_type='Sales Invoice' and party_type = 'Customer'
|
||||||
|
and party=%s and fiscal_year = %s""",
|
||||||
(customer, frappe.db.get_default("fiscal_year")))
|
(customer, frappe.db.get_default("fiscal_year")))
|
||||||
|
|
||||||
total_unpaid = frappe.db.sql("""select sum(outstanding_amount)
|
total_unpaid = frappe.db.sql("""select sum(outstanding_amount)
|
||||||
@@ -139,7 +141,6 @@ def get_dashboard_info(customer):
|
|||||||
|
|
||||||
out["billing_this_year"] = billing_this_year[0][0] if billing_this_year else 0
|
out["billing_this_year"] = billing_this_year[0][0] if billing_this_year else 0
|
||||||
out["total_unpaid"] = total_unpaid[0][0] if total_unpaid else 0
|
out["total_unpaid"] = total_unpaid[0][0] if total_unpaid else 0
|
||||||
out["company_currency"] = frappe.db.sql_list("select distinct default_currency from tabCompany")
|
|
||||||
|
|
||||||
return out
|
return out
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user