Skip to content
Browse files

Merge branch 'master' of github.com:webnotes/erpnext

  • Loading branch information...
2 parents bbe2403 + cca0b4a commit d7972e361ba46d86422de5fac47c86ddf305f687 @anandpdoshi anandpdoshi committed Oct 5, 2012
View
17 accounts/doctype/mis_control/mis_control.py
@@ -192,15 +192,12 @@ def get_statement(self, arg):
arg = eval(arg)
pl = ''
- self.define_periods(arg['year'], arg['period']) # declares 1.period_list i.e. (['Jan','Feb','Mar'...] or ['Q1','Q2'...] or ['FY2009-2010']) based on period
- # 2.period_start_date dict {'Jan':'01-01-2009'...}
- # 3.period_start_date dict {'Jan':'31-01-2009'...}
+ self.define_periods(arg['year'], arg['period'])
self.return_data.append([4,'']+self.period_list)
if arg['statement'] == 'Balance Sheet': pl = 'No'
if arg['statement'] == 'Profit & Loss': pl = 'Yes'
-
self.get_children('',0,pl,arg['company'], arg['year'])
#self.balance_pl_statement(acct, arg['statement'])
@@ -218,7 +215,7 @@ def get_children(self, parent_account, level, pl, company, fy):
if cl:
for c in cl:
self.ac_details[c[1]] = [c[2], c[3], c[4]]
- bal_list = self.get_period_balance(c[1])
+ bal_list = self.get_period_balance(c[1], pl)
if level==0: # top level - put balances as totals
self.return_data.append([level, c[0]] + ['' for b in bal_list])
totals = bal_list
@@ -297,9 +294,13 @@ def define_periods(self, year, period):
self.period_start_date[pn] = fd
self.period_end_date[pn] = get_last_day(fd)
- def get_period_balance(self, acc):
- ret = []
+ def get_period_balance(self, acc, pl):
+ ret, i = [], 0
for p in self.period_list:
period_end_date = self.period_end_date[p].strftime('%Y-%m-%d')
- ret.append(get_balance_on(acc, period_end_date))
+ bal = get_balance_on(acc, period_end_date)
+ if pl=='Yes':
+ bal = bal - sum(ret)
+
+ ret.append(bal)
return ret
View
2 accounts/page/financial_analytics/financial_analytics.js
@@ -127,7 +127,7 @@ erpnext.FinancialAnalytics = erpnext.AccountTreeGrid.extend({
if(me.pl_or_bs=='Balance Sheet') {
$.each(me.data, function(i, ac) {
if((ac.rgt - ac.lft)==1 && ac.is_pl_account!='Yes') {
- var opening = flt(ac.opening);
+ var opening = 0;
//if(opening) throw opening;
$.each(me.columns, function(i, col) {
if(col.formatter==me.currency_formatter) {
View
2 patches/october_2012/update_account_property.py
@@ -2,7 +2,7 @@ def execute():
import webnotes
from webnotes.utils.nestedset import rebuild_tree
rebuild_tree('Account', 'parent_account')
-
+
roots = webnotes.conn.sql("""
select lft, rgt, debit_or_credit, is_pl_account, company from `tabAccount`
where ifnull(parent_account, '') = ''

0 comments on commit d7972e3

Please sign in to comment.
Something went wrong with that request. Please try again.