fixes for debit_or_credit in account tree grid report

This commit is contained in:
Nabin Hait
2014-03-05 11:30:28 +05:30
parent 53822ae9d0
commit 2b57ecbd6c
2 changed files with 7 additions and 7 deletions

View File

@@ -152,7 +152,7 @@ erpnext.AccountTreeGrid = frappe.views.TreeGridReport.extend({
// balance of previous fiscal_year should
// not be part of opening of pl account balance
} else {
if(account.debit_or_credit=='Debit') {
if(in_list(["Asset", "Expense"], account.root_type)) {
account.opening_debit += (v.debit - v.credit);
} else {
account.opening_credit += (v.credit - v.debit);
@@ -164,7 +164,7 @@ erpnext.AccountTreeGrid = frappe.views.TreeGridReport.extend({
account.credit += v.credit;
}
// closing
if(account.debit_or_credit=='Debit') {
if(in_list(["Asset", "Expense"], account.root_type)) {
account.closing_debit = account.opening_debit + account.debit - account.credit;
} else {
account.closing_credit = account.opening_credit - account.debit + account.credit;