Commit 681ee1fc authored by Jean-Paul Smets's avatar Jean-Paul Smets

I have extended the API in the comments and added comments related to...

I have extended the API in the comments and added comments related to precision support and to cumulative values in history lists

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@9987 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 71a2a19d
......@@ -485,6 +485,7 @@ class SimulationTool (BaseTool):
section - only take rows in stock table which section_uid is
equivalent to section
mirror_section - only take rows in stock table which mirror_section_uid is
mirror_section
resource_category - only take rows in stock table which
......@@ -493,14 +494,28 @@ class SimulationTool (BaseTool):
node_category - only take rows in stock table which node_uid is
member of section_category
payment_category - only take rows in stock table which payment_uid is
member of section_category
payment_category - only take rows in stock table which payment_uid
is in section_category
section_category - only take rows in stock table which section_uid is
member of section_category
mirror_section_category - only take rows in stock table which
mirror_section_uid is member of
mirror_section_category
node_filter - only take rows in stock table which node_uid
matches node_filter
payment_filter - only take rows in stock table which payment_uid
matches payment_filter
section_filter - only take rows in stock table which section_uid
matches section_filter
mirror_section_filter - only take rows in stock table which mirror_section_uid
matches mirror_section_filter
variation_text - only take rows in stock table with specified
variation_text.
This needs to be extended with some kind of
......@@ -562,6 +577,15 @@ class SimulationTool (BaseTool):
"""
sql_kw = self._generateSQLKeywordDict(**kw)
# JPS: this is a hint for implementation of xxx_filter arguments
# node_uid_count = portal_catalog.countResults(**node_filter)
# if node_uid_count not too big:
# node_uid_list = cache(portal_catalog(**node_filter))
# pass this list to ZSQL method
# else:
# build a table in MySQL
# and join that table with the stock table
result = self.Resource_zGetInventory(
src__=src__, ignore_variation=ignore_variation,
standardise=standardise, omit_simulation=omit_simulation,
......@@ -769,6 +793,11 @@ class SimulationTool (BaseTool):
Same thing as getInventory but returns an asset
price rather than an inventory.
TODO:
- Make sure getInventoryAssetPrice API can
support precision defition (ie. calculate the
sum of rounded values)
"""
sql_kw = self._generateSQLKeywordDict(**kw)
result = self.Resource_zGetInventory(
......@@ -831,6 +860,10 @@ class SimulationTool (BaseTool):
Returns a time based serie of inventory values
for a single or a group of resource, node, section, etc. This is useful
to list the evolution with time of inventory values (quantity, asset price).
TODO:
- make sure getInventoryHistoryList can return
cumulative values calculated by SQL (JPS)
"""
sql_kw = self._generateSQLKeywordDict(**kw)
return self.Resource_getInventoryHistoryList(
......
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