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
## Script (Python) "Account_getTotalSourceCredit"
## Script (Python) "AccountModule_getTotalSourceCredit"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=self
##parameters=brain=None, selection=None, **kw
##title=
##
currency = None
params = selection.getParams()
if currency in (None, 'None'):
currency = context.currency.EUR
url = params.get('accounting_transaction_line_currency')
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
try:
inventory = context.Resource_zGetInventory(node_uid=context.getUid(), omit_output=1, omit_simulation=1,
resource_uid=(currency.getUid(),),
simulation_state=('draft', 'planned', 'confirmed', 'stopped', 'delivered'))
**kwd)
total = inventory[0].inventory or 0.0
except:
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