Commit 4e2a1aa7 authored by Yoshinori Okuji's avatar Yoshinori Okuji

Renamed from Account_getTotalSourceDebit.py to AccountModule_getTotalSourceDebit.py.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@1578 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 62babc65
## Script (Python) "Account_getTotalSourceDebit" ## Script (Python) "AccountModule_getTotalSourceDebit"
##bind container=container ##bind container=container
##bind context=context ##bind context=context
##bind namespace= ##bind namespace=
##bind script=script ##bind script=script
##bind subpath=traverse_subpath ##bind subpath=traverse_subpath
##parameters=self ##parameters=brain=None, selection=None, **kw
##title= ##title=
## ##
currency = None params = selection.getParams()
if currency in (None, 'None'): url = params.get('accounting_transaction_line_currency')
currency = context.currency.EUR if url:
currency = context.restrictedTraverse(url)
else:
currency = None
kwd = {}
if params.get('from_date'):
kwd['from_date'] = params['from_date']
if params.get('to_date'):
kwd['to_date'] = params['to_date']
if currency is not None:
kwd['resource_uid'] = [currency.getUid()]
kwd['simulation_state'] = params.get('transaction_simulation_state', ('delivered', 'stopped'))
kwd['section_category'] = params.get('transaction_section_category', 'group/nexedi')
total = 0.0 total = 0.0
try: try:
inventory = context.Resource_zGetInventory(node_uid=context.getUid(), omit_input=1, omit_simulation=1, inventory = context.Resource_zGetInventory(node_uid=context.getUid(), omit_input=1, omit_simulation=1,
resource_uid=(currency.getUid(),), **kwd) # XXX Choice of omit_input is very good.
simulation_state=('draft', 'planned', 'confirmed', 'stopped', 'delivered'))
total = - inventory[0].inventory or 0.0 total = - inventory[0].inventory or 0.0
except: except:
pass pass
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment