Commit 62babc65 authored by Yoshinori Okuji's avatar Yoshinori Okuji

Renamed from Account_getTotalSourceCredit.py to AccountModule_getTotalSourceCredit.py.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@1577 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a6b99b7f
No related merge requests found
## Script (Python) "Account_getTotalSourceCredit" ## Script (Python) "AccountModule_getTotalSourceCredit"
##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_output=1, omit_simulation=1, inventory = context.Resource_zGetInventory(node_uid=context.getUid(), omit_output=1, omit_simulation=1,
resource_uid=(currency.getUid(),), **kwd)
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