Commit fc7873a6 authored by Jean-Paul Smets's avatar Jean-Paul Smets

Added comments on current limitations

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@33263 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent b4616d44
...@@ -170,7 +170,25 @@ class AmountGeneratorMixin: ...@@ -170,7 +170,25 @@ class AmountGeneratorMixin:
# Case 1: the cell defines a final amount of resource # Case 1: the cell defines a final amount of resource
if amount_generator_cell.getResource() and\ if amount_generator_cell.getResource() and\
getattr(amount_generator_cell, 'getBaseApplication', None) is not None: getattr(amount_generator_cell, 'getBaseApplication', None) is not None:
# We must aggregate per resource, variation # Define a key in order to aggregate amounts
# in transformations where variation and quantity
# are defined in different cells
#
# Transformed Resource (Transformation)
# key = anything (only one cell selected)
# current key = (acquired resource, acquired variation)
#
# Assorted Resource (Transformation)
# key = (assorted resource, assorted resource variation)
# usually resource and quantity provided together
#
# Payroll
#
# key = (payroll resource, payroll resource variation)
#
# Tax
#
# key = (tax resource, tax resource variation)
key = (amount_generator_cell.getResource(), amount_generator_cell.getVariationText()) # Variation UID, Hash ? key = (amount_generator_cell.getResource(), amount_generator_cell.getVariationText()) # Variation UID, Hash ?
resource_amount_aggregate.setdefault(key, {}) resource_amount_aggregate.setdefault(key, {})
# Then collect the mapped properties (resource, quantity, net_converted_quantity, base_contribution_list, base_application, etc.) # Then collect the mapped properties (resource, quantity, net_converted_quantity, base_contribution_list, base_application, etc.)
...@@ -185,8 +203,22 @@ class AmountGeneratorMixin: ...@@ -185,8 +203,22 @@ class AmountGeneratorMixin:
resource_amount_aggregate[key]['id'] = amount_generator_cell.getRelativeUrl().replace('/', '_') resource_amount_aggregate[key]['id'] = amount_generator_cell.getRelativeUrl().replace('/', '_')
# Case 2: the cell defines a temporary calculation line # Case 2: the cell defines a temporary calculation line
elif getattr(amount_generator_cell, 'getBaseContributionList', None) is not None: elif getattr(amount_generator_cell, 'getBaseContributionList', None) is not None:
# We must aggregate per base_application # Define a key in order to aggregate amounts in cells
# Therefore, base_application MUST be defined # base_application MUST be defined
#
# Single line case: key = base_application
#
# Payroll
#
# key = base_application
# it is not possible to use cells to add amounts
# in intermediate calculation but only to
# select one amount
#
# key = (base_application, XXX) would be required
#
# Use of a method to generate keys is probably better.
# than hardcoding it here
key = amount_generator_cell.getBaseApplication() key = amount_generator_cell.getBaseApplication()
value_amount_aggregate.setdefault(key, {}) value_amount_aggregate.setdefault(key, {})
# Then collect the mapped properties # Then collect the mapped properties
......
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