Commit 419a820c authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_accounting: Dont rely on grouping_date for outstanding amount

  We do want to ignore payments that occur after the at_date.

  We want to know if at a certain date, there still unpayed documents older them that date, if the document is payed after, (and grouped) we unconsider it.
parent c4872a03
from Products.ZSQLCatalog.SQLCatalog import SimpleQuery, ComplexQuery
portal = context.getPortalObject() portal = context.getPortalObject()
params = {"node_category_strict_membership": ['account_type/asset/receivable', params = {"node_category_strict_membership": ['account_type/asset/receivable',
'account_type/liability/payable']} 'account_type/liability/payable']}
if at_date: if at_date:
params['at_date'] = at_date params['at_date'] = at_date
params['grouping_query'] = ComplexQuery(
SimpleQuery(grouping_reference=None), params['grouping_reference'] = None
SimpleQuery(grouping_date=at_date, comparison_operator=">"),
logical_operator="OR")
else:
params['grouping_reference'] = None
if resource_uid is not None: if resource_uid is not None:
params["resource_uid"] = resource_uid params["resource_uid"] = resource_uid
......
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