Revert "trial bal: added filter to select what to show(group/ledger/both) and optionto show/hide zero balance"

This reverts commit 9bffdc95da.
This commit is contained in:
nabinhait
2011-06-22 14:29:25 +05:30
parent 60ee199e74
commit a18bef59ae
4 changed files with 40 additions and 50 deletions

View File

@@ -1,3 +1,4 @@
# Columns
#----------
cl = [['Account','Data', '200px'],['Debit/Credit', 'Data', '100px'], ['Group/Ledger', 'Data', '100px'], ['Is PL Account', 'Data', '100px'], ['Opening','Data', '100px'],['Debit', 'Data', '100px'],['Credit', 'Data', '100px'],['Closing', 'Data', '100px']]
@@ -41,7 +42,7 @@ total_debit, total_credit = 0,0
glc = get_obj('GL Control')
# Main logic
# ----------
# ----------------
for r in res:
# Fetch account details
acc = r[col_idx['Account']].strip()
@@ -50,11 +51,11 @@ for r in res:
r.append(acc_det[0][4])
r.append(acc_det[0][1])
#if shows group and ledger both but without group balance
if filter_values.get('show_group_ledger') == 'Both But Without Group Balance' and acc_det[0][4] == 'Group':
# if group, check user input
if acc_det[0][4] == 'Group' and filter_values.get('show_group_balance') == 'No':
for i in range(4):
r.append('')
continue
continue
# opening balance
if from_date_year:
@@ -69,7 +70,7 @@ for r in res:
if from_date_year == to_date_year:
debit = flt(debit_on_todate) - flt(debit_on_fromdate)
credit = flt(credit_on_todate) - flt(credit_on_fromdate)
else: # if from date is start date of the year
else: # may be wrong
debit = flt(debit_on_todate)
credit = flt(credit_on_todate)
@@ -88,18 +89,20 @@ for r in res:
r.append(flt(closing))
# Remove accounts if closing bal = debit = credit = 0
# -----------------------------------------------------
out =[]
for r in res:
# Remove accounts if opening bal = debit = credit = closing bal = 0
# ------------------------------------------------------------------
if filter_values.get('show_zero_balance') != 'No':
if r[col_idx['Opening']] or r[col_idx['Debit']] or r[col_idx['Credit']] or r[col_idx['Closing']]:
out.append(r)
elif r[col_idx['Opening']] or r[col_idx['Debit']] or r[col_idx['Credit']] or r[col_idx['Closing']] or (r[col_idx['Group/Ledger']] == 'Group' and filter_values.get('show_group_ledger') == 'Both But Without Group Balance'):
if r[col_idx['Group/Ledger']] == 'Group' and filter_values.get('show_group_balance') == 'No':
out.append(r)
# Total Debit / Credit
# --------------------------
if filter_values.get('show_group_ledger') in ['Only Ledgers', 'Both But Without Group Balance']:
if filter_values.get('show_group_balance') == 'No':
t_row = ['' for i in range(len(colnames))]
t_row[col_idx['Account']] = 'Total'
t_row[col_idx['Debit']] = total_debit