Commit 17946f80 authored by Jérome Perrin's avatar Jérome Perrin

make it possible to specify a timeframe for budget consumptions

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@43311 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 6a867578
...@@ -61,6 +61,8 @@ ...@@ -61,6 +61,8 @@
from pprint import pformat\n from pprint import pformat\n
portal = context.getPortalObject()\n portal = context.getPortalObject()\n
request= portal.REQUEST\n request= portal.REQUEST\n
from_date = request.get(\'from_date\')\n
at_date = request.get(\'at_date\')\n
\n \n
# this report can be called on a budget ...\n # this report can be called on a budget ...\n
if context.getPortalType() == \'Budget\':\n if context.getPortalType() == \'Budget\':\n
...@@ -74,8 +76,6 @@ else:\n ...@@ -74,8 +76,6 @@ else:\n
# ... or on the budget module, and in this case, all budgets are used\n # ... or on the budget module, and in this case, all budgets are used\n
defined_group = request[\'section_category\']\n defined_group = request[\'section_category\']\n
strict_section_membership = request.get(\'section_category_strict\', False)\n strict_section_membership = request.get(\'section_category_strict\', False)\n
from_date = request.get(\'from_date\')\n
at_date = request.get(\'at_date\')\n
validation_state = request.get(\'validation_state\', [])\n validation_state = request.get(\'validation_state\', [])\n
\n \n
budget_list = portal.portal_catalog.searchResults(\n budget_list = portal.portal_catalog.searchResults(\n
...@@ -163,8 +163,21 @@ for budget in budget_list:\n ...@@ -163,8 +163,21 @@ for budget in budget_list:\n
\n \n
level_1_line_list = []\n level_1_line_list = []\n
\n \n
if at_date and from_date:\n
consumed_budget_dict = budget_line.getConsumedBudgetDict(\n
from_date=from_date, at_date=at_date)\n
engaged_budget_dict = budget_line.getEngagedBudgetDict(\n
from_date=from_date, at_date=at_date)\n
elif at_date:\n
consumed_budget_dict = budget_line.getConsumedBudgetDict(at_date=at_date)\n
engaged_budget_dict = budget_line.getEngagedBudgetDict(at_date=at_date)\n
elif from_date:\n
consumed_budget_dict = budget_line.getConsumedBudgetDict(from_date=from_date)\n
engaged_budget_dict = budget_line.getEngagedBudgetDict(from_date=from_date)\n
else:\n
consumed_budget_dict = budget_line.getConsumedBudgetDict()\n consumed_budget_dict = budget_line.getConsumedBudgetDict()\n
engaged_budget_dict = budget_line.getEngagedBudgetDict()\n engaged_budget_dict = budget_line.getEngagedBudgetDict()\n
\n
budget_line_cell_range = budget_line.BudgetLine_asCellRange()\n budget_line_cell_range = budget_line.BudgetLine_asCellRange()\n
budget_line_as_cell_range_matrixbox =\\\n budget_line_as_cell_range_matrixbox =\\\n
budget_line.BudgetLine_asCellRange(matrixbox=1)\n budget_line.BudgetLine_asCellRange(matrixbox=1)\n
......
...@@ -93,6 +93,8 @@ ...@@ -93,6 +93,8 @@
<key> <string>left</string> </key> <key> <string>left</string> </key>
<value> <value>
<list> <list>
<string>your_from_date</string>
<string>your_at_date</string>
<string>your_format</string> <string>your_format</string>
<string>your_deferred_style</string> <string>your_deferred_style</string>
</list> </list>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>your_at_date</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>your_at_date</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewDialogFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>your_from_date</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>your_from_date</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewDialogFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
346 347
\ No newline at end of file \ No newline at end of file
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