[IMP]
Balance de Cuatro Columnas: -- Cuando se pide el balance solo para periodos especiales, entonces el balance proporcionaria una vista similar a: Cuenta SaldInic. Debito Credito Balance 1 Activo 0.00 200.00 150.00 50.00 11 Banco 0.00 150.00 0.00 150.00 12 CxP 0.00 50.00 0.00 50.00 13 Ant.Client. 0.00 0.00 150.00 -150.00 Observandose que la columna de los saldos iniciales esta establecida en cero. -- Cuando se pide un balance sin periodos especiales o mezclado con periodos especiales el resultado es que se tendra una columna de SaldosIniciales. Saldo de Cuentas con Movimientos, Se mostrara la cuenta siempre y cuando, la cuenta por el debito, por el credito o su saldo final sea distinto de cero.6.0
commit
0095878492
|
@ -122,6 +122,14 @@ class account_balance(report_sxw.rml_parse):
|
||||||
return {'periods':periods_str, 'date':dates_str}
|
return {'periods':periods_str, 'date':dates_str}
|
||||||
|
|
||||||
|
|
||||||
|
def special_period(self, periods):
|
||||||
|
period_obj = self.pool.get('account.period')
|
||||||
|
period_brw = period_obj.browse(self.cr, self.uid, periods)
|
||||||
|
period_counter = [True for i in period_brw if not i.special]
|
||||||
|
if not period_counter:
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
def lines(self, form, ids={}, done=None, level=0):
|
def lines(self, form, ids={}, done=None, level=0):
|
||||||
"""
|
"""
|
||||||
Returns all the data needed for the report lines
|
Returns all the data needed for the report lines
|
||||||
|
@ -192,10 +200,20 @@ class account_balance(report_sxw.rml_parse):
|
||||||
ctx = self.context.copy()
|
ctx = self.context.copy()
|
||||||
ctx['filter'] = form.get('filter','all')
|
ctx['filter'] = form.get('filter','all')
|
||||||
ctx['fiscalyear'] = fiscalyear.id
|
ctx['fiscalyear'] = fiscalyear.id
|
||||||
ctx['periods'] = period_obj.search(self.cr, self.uid, [('fiscalyear_id','=',fiscalyear.id),('special','=',False)])
|
#~ ctx['periods'] = period_obj.search(self.cr, self.uid, [('fiscalyear_id','=',fiscalyear.id),('special','=',False)])
|
||||||
|
|
||||||
|
if ctx['filter'] not in ['bydate','none']:
|
||||||
|
special = self.special_period(form['periods'])
|
||||||
|
else:
|
||||||
|
special = False
|
||||||
|
|
||||||
if form['filter'] in ['byperiod', 'all']:
|
if form['filter'] in ['byperiod', 'all']:
|
||||||
|
if special:
|
||||||
|
ctx['periods'] = period_obj.search(self.cr, self.uid, [('id','in',form['periods'] or ctx['periods'])])
|
||||||
|
else:
|
||||||
ctx['periods'] = period_obj.search(self.cr, self.uid, [('id','in',form['periods'] or ctx['periods']),('special','=',False)])
|
ctx['periods'] = period_obj.search(self.cr, self.uid, [('id','in',form['periods'] or ctx['periods']),('special','=',False)])
|
||||||
if form['filter'] in ['bydate', 'all']:
|
|
||||||
|
if form['filter'] in ['bydate','all','none']:
|
||||||
ctx['date_from'] = form['date_from']
|
ctx['date_from'] = form['date_from']
|
||||||
ctx['date_to'] = form['date_to']
|
ctx['date_to'] = form['date_to']
|
||||||
|
|
||||||
|
@ -251,8 +269,10 @@ class account_balance(report_sxw.rml_parse):
|
||||||
|
|
||||||
period_balanceinit = {}
|
period_balanceinit = {}
|
||||||
for acc in account_obj.browse(self.cr, self.uid, [x[0] for x in account_ids], ctx):
|
for acc in account_obj.browse(self.cr, self.uid, [x[0] for x in account_ids], ctx):
|
||||||
|
if special:
|
||||||
|
period_balanceinit[acc['id']] = 0.0
|
||||||
|
else:
|
||||||
period_balanceinit[acc['id']] = acc.balance
|
period_balanceinit[acc['id']] = acc.balance
|
||||||
|
|
||||||
#
|
#
|
||||||
# Generate the report lines (checking each account)
|
# Generate the report lines (checking each account)
|
||||||
#
|
#
|
||||||
|
@ -302,7 +322,7 @@ class account_balance(report_sxw.rml_parse):
|
||||||
|
|
||||||
if form['display_account'] == 'con_movimiento' and account['parent_id']:
|
if form['display_account'] == 'con_movimiento' and account['parent_id']:
|
||||||
# Include accounts with movements
|
# Include accounts with movements
|
||||||
if abs(res['balance']) >= 0.5 * 10**-int(2):
|
if abs(res['debit']) >= 0.5 * 10**-int(2) or abs(res['credit']) >= 0.5 * 10**-int(2):
|
||||||
result_acc.append(res)
|
result_acc.append(res)
|
||||||
elif form['display_account'] == 'con_balance' and account['parent_id']:
|
elif form['display_account'] == 'con_balance' and account['parent_id']:
|
||||||
# Include accounts with balance
|
# Include accounts with balance
|
||||||
|
|
Loading…
Reference in New Issue