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 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_input=1, omit_simulation=1,
resource_uid=(currency.getUid(),),
simulation_state=('draft', 'planned', 'confirmed', 'stopped', 'delivered'))
**kwd) # XXX Choice of omit_input is very good.
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