Account_report:Modified views and legends,minor modifs
bzr revid: jvo@tinyerp.com-20071107143326-mhvle0cyq5ng4xzt
This commit is contained in:
@@ -1079,7 +1079,6 @@ class account_tax_code(osv.osv):
|
||||
if not len(period_id):
|
||||
return dict.fromkeys(ids, 0.0)
|
||||
period_id = period_id[0]
|
||||
|
||||
return self._sum(cr, uid, ids, name, args, context,
|
||||
where=' and line.period_id='+str(period_id))
|
||||
|
||||
|
||||
@@ -57,16 +57,14 @@ class account_report(osv.osv):
|
||||
obj_period=self.pool.get('account.period')
|
||||
|
||||
def _calc_context(key,obj):
|
||||
print "for @@@@@@@@@@@@",obj
|
||||
if key==0:
|
||||
print "ddddddddd",obj.find(cr,uid)
|
||||
return obj.find(cr,uid)
|
||||
else:
|
||||
obj_key=obj.browse(cr,uid,obj.find(cr,uid))
|
||||
print "obj_key",obj_key
|
||||
if isinstance(obj_key,list):
|
||||
obj_key=obj_key[0]
|
||||
key_ids=obj.search(cr,uid,[('date_stop','<',obj_key.date_start)])
|
||||
if len(key_ids)<abs(key):
|
||||
print len(key_ids),abs(key)
|
||||
return False
|
||||
return key_ids[key]
|
||||
|
||||
@@ -78,6 +76,7 @@ class account_report(osv.osv):
|
||||
acc = self.pool.get('account.account')
|
||||
acc_id = acc.search(cr, uid, [('code','in',code)])
|
||||
return reduce(lambda y,x=0: x.credit+y, acc.browse(cr, uid, acc_id, context),0)
|
||||
|
||||
def _calc_debit(code,year=0):
|
||||
context['fiscalyear']=False
|
||||
context['fiscalyear']=_calc_context(year,obj_fy)
|
||||
@@ -86,6 +85,7 @@ class account_report(osv.osv):
|
||||
acc = self.pool.get('account.account')
|
||||
acc_id = acc.search(cr, uid, [('code','in',code)])
|
||||
return reduce(lambda y,x=0: x.debit+y, acc.browse(cr, uid, acc_id, context),0)
|
||||
|
||||
def _calc_balance(code,year=0):
|
||||
context['fiscalyear']=False
|
||||
context['fiscalyear']=_calc_context(year,obj_fy)
|
||||
@@ -94,15 +94,18 @@ class account_report(osv.osv):
|
||||
acc = self.pool.get('account.account')
|
||||
acc_id = acc.search(cr, uid, [('code','in',code)])
|
||||
return reduce(lambda y,x=0: x.balance+y, acc.browse(cr, uid, acc_id, context),0)
|
||||
|
||||
def _calc_report(*code):
|
||||
acc = self.pool.get('account.report.report')
|
||||
acc_id = acc.search(cr, uid, [('code','in',code)])
|
||||
return reduce(lambda y,x=0: x.amount+y, acc.browse(cr, uid, acc_id, context),0)
|
||||
|
||||
def _calc_tax_code(code,period=0):
|
||||
context['period_id']=False
|
||||
context['period_id']=_calc_context(period,obj_period)
|
||||
if not context['period_id']:
|
||||
return 0.00
|
||||
context['period_id']=context['period_id'][0]
|
||||
acc = self.pool.get('account.tax.code')
|
||||
acc_id = acc.search(cr, uid, [('code','in',code)])
|
||||
return reduce(lambda y,x=0: x.sum_period+y, acc.browse(cr, uid, acc_id, context),0)
|
||||
|
||||
@@ -27,29 +27,37 @@
|
||||
<field name="disp_graph"/>
|
||||
<!-- <field colspan="4" name="expression_status"/>-->
|
||||
<separator colspan="4" string="Legend of operators"/>
|
||||
<label align="1.0" string="Account debit:"/>
|
||||
<label align="0.0" string="debit('ACCOUNT_CODE')"/>
|
||||
<label align="1.0" string="Account credit:"/>
|
||||
<label align="0.0" string="credit('ACCOUNT_CODE')"/>
|
||||
<label align="1.0" string="Account balance:"/>
|
||||
<label align="0.0" string="balance('ACCOUNT_CODE')"/>
|
||||
<label align="1.0" string="Report amount:"/>
|
||||
<label align="1.0" string="Account Debit:"/>
|
||||
<label align="0.0" string="debit(['ACCOUNT_CODE',],fiscalyear)"/>
|
||||
<label align="1.0" string="Account Credit:"/>
|
||||
<label align="0.0" string="credit(['ACCOUNT_CODE',],fiscalyear)"/>
|
||||
<label align="1.0" string="Account Balance:"/>
|
||||
<label align="0.0" string="balance(['ACCOUNT_CODE',],fiscalyear)"/>
|
||||
<label align="1.0" string="Account Tax Code:"/>
|
||||
<label align="0.0" string="tax_code(['ACCOUNT_TAX_CODE',],period)"/>
|
||||
<label align="1.0" string="Report Amount:"/>
|
||||
<label align="0.0" string="report('REPORT_CODE')"/>
|
||||
<newline/>
|
||||
<label align="1.0" string="Operators:"/>
|
||||
<label align="0.0" string="+ - * / ( )"/>
|
||||
<label colspan="4" string="Example: (balance('6','45') - credit('7')) / report('RPT1')"/>
|
||||
<label colspan="4" string="Example: (balance(['6','45'],-1) - credit(['7'])) / report('RPT1')"/>
|
||||
<label colspan="4" string="Note: The second arguement 'fiscalyear' and 'period' are optional arguements.If the value is -1,previous fiscalyear or period is considered."/>
|
||||
<separator colspan="4" string="Return value for status"/>
|
||||
<group col="2" colspan="2">
|
||||
<label align="1.0" string="< Badness Indicator Limit:"/>
|
||||
<label align="0.0" string="Very bad"/>
|
||||
<newline/>
|
||||
<label align="1.0" string="= Badness Indicator Limit:"/>
|
||||
<label align="0.0" string="Bad"/>
|
||||
<newline/>
|
||||
<!--<label align="1.0" string="0:"/>
|
||||
<label align="0.0" string="Normal"/>-->
|
||||
<label align="1.0" string="= Goodness Indicator Limit:"/>
|
||||
<label align="0.0" string="Good"/>
|
||||
<newline/>
|
||||
<label align="1.0" string="> Goodness Indicator Limit:"/>
|
||||
<label align="0.0" string="Very Good"/>
|
||||
<newline/>
|
||||
</group>
|
||||
<group col="2" colspan="2">
|
||||
</group>
|
||||
|
||||
Reference in New Issue
Block a user