mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-02 19:59:12 +00:00
show balance if permitted to view gl entry (#12385)
This commit is contained in:
@@ -79,15 +79,17 @@ frappe.treeview_settings["Account"] = {
|
|||||||
|
|
||||||
},
|
},
|
||||||
onrender: function(node) {
|
onrender: function(node) {
|
||||||
var dr_or_cr = node.data.balance < 0 ? "Cr" : "Dr";
|
if(frappe.boot.user.can_read.indexOf("GL Entry") !== -1){
|
||||||
if (node.data && node.data.balance!==undefined) {
|
var dr_or_cr = node.data.balance < 0 ? "Cr" : "Dr";
|
||||||
$('<span class="balance-area pull-right text-muted small">'
|
if (node.data && node.data.balance!==undefined) {
|
||||||
+ (node.data.balance_in_account_currency ?
|
$('<span class="balance-area pull-right text-muted small">'
|
||||||
(format_currency(Math.abs(node.data.balance_in_account_currency),
|
+ (node.data.balance_in_account_currency ?
|
||||||
node.data.account_currency) + " / ") : "")
|
(format_currency(Math.abs(node.data.balance_in_account_currency),
|
||||||
+ format_currency(Math.abs(node.data.balance), node.data.company_currency)
|
node.data.account_currency) + " / ") : "")
|
||||||
+ " " + dr_or_cr
|
+ format_currency(Math.abs(node.data.balance), node.data.company_currency)
|
||||||
+ '</span>').insertBefore(node.$ul);
|
+ " " + dr_or_cr
|
||||||
|
+ '</span>').insertBefore(node.$ul);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
toolbar: [
|
toolbar: [
|
||||||
|
|||||||
Reference in New Issue
Block a user