Commit 4f0931e7 authored by Jérome Perrin's avatar Jérome Perrin

Add 'payment_request' in inventory API

To migrate, run:
alter table stock add column payment_request_uid bigint unsigned after funding_uid, add index payment_request_uid (payment_request_uid);
alter table inventory_stock add column payment_request_uid bigint unsigned after funding_uid;
parent 3e0f972b
...@@ -572,13 +572,15 @@ class SimulationTool(BaseTool): ...@@ -572,13 +572,15 @@ class SimulationTool(BaseTool):
# instances # instances
resource=None, node=None, payment=None, resource=None, node=None, payment=None,
section=None, mirror_section=None, item=None, section=None, mirror_section=None, item=None,
function=None, project=None, funding=None, transformed_resource=None, function=None, project=None, funding=None, payment_request=None,
transformed_resource=None,
# used for tracking # used for tracking
input=0, output=0, input=0, output=0,
# categories # categories
resource_category=None, node_category=None, payment_category=None, resource_category=None, node_category=None, payment_category=None,
section_category=None, mirror_section_category=None, section_category=None, mirror_section_category=None,
function_category=None, project_category=None, funding_category=None, function_category=None, project_category=None, funding_category=None,
payment_request_category=None,
# categories with strict membership # categories with strict membership
resource_category_strict_membership=None, resource_category_strict_membership=None,
node_category_strict_membership=None, node_category_strict_membership=None,
...@@ -588,6 +590,7 @@ class SimulationTool(BaseTool): ...@@ -588,6 +590,7 @@ class SimulationTool(BaseTool):
function_category_strict_membership=None, function_category_strict_membership=None,
project_category_strict_membership=None, project_category_strict_membership=None,
funding_category_strict_membership=None, funding_category_strict_membership=None,
payment_request_category_strict_membership=None,
# simulation_state # simulation_state
strict_simulation_state=0, strict_simulation_state=0,
simulation_state=None, transit_simulation_state = None, omit_transit=0, simulation_state=None, transit_simulation_state = None, omit_transit=0,
...@@ -600,7 +603,7 @@ class SimulationTool(BaseTool): ...@@ -600,7 +603,7 @@ class SimulationTool(BaseTool):
# uids # uids
resource_uid=None, node_uid=None, section_uid=None, payment_uid=None, resource_uid=None, node_uid=None, section_uid=None, payment_uid=None,
mirror_node_uid=None, mirror_section_uid=None, function_uid=None, mirror_node_uid=None, mirror_section_uid=None, function_uid=None,
project_uid=None, funding_uid=None, project_uid=None, funding_uid=None, payment_request_uid=None,
# omit input and output # omit input and output
omit_input=0, omit_input=0,
omit_output=0, omit_output=0,
...@@ -632,6 +635,9 @@ class SimulationTool(BaseTool): ...@@ -632,6 +635,9 @@ class SimulationTool(BaseTool):
group_by_funding=0, group_by_funding=0,
group_by_funding_category=0, group_by_funding_category=0,
group_by_funding_category_strict_membership=0, group_by_funding_category_strict_membership=0,
group_by_payment_request=0,
group_by_payment_request_category=0,
group_by_payment_request_category_strict_membership=0,
group_by_function=0, group_by_function=0,
group_by_function_category=0, group_by_function_category=0,
group_by_function_category_strict_membership=0, group_by_function_category_strict_membership=0,
...@@ -696,6 +702,7 @@ class SimulationTool(BaseTool): ...@@ -696,6 +702,7 @@ class SimulationTool(BaseTool):
column_value_dict.set('payment_uid', payment_uid) column_value_dict.set('payment_uid', payment_uid)
column_value_dict.set('project_uid', project_uid) column_value_dict.set('project_uid', project_uid)
column_value_dict.set('funding_uid', funding_uid) column_value_dict.set('funding_uid', funding_uid)
column_value_dict.set('payment_request_uid', payment_request_uid)
column_value_dict.set('function_uid', function_uid) column_value_dict.set('function_uid', function_uid)
if column_value_dict.set('section_uid', section_uid): if column_value_dict.set('section_uid', section_uid):
sql_kw['section_filtered'] = 1 sql_kw['section_filtered'] = 1
...@@ -708,6 +715,7 @@ class SimulationTool(BaseTool): ...@@ -708,6 +715,7 @@ class SimulationTool(BaseTool):
column_value_dict.setUIDList('payment_uid', payment) column_value_dict.setUIDList('payment_uid', payment)
column_value_dict.setUIDList('project_uid', project) column_value_dict.setUIDList('project_uid', project)
column_value_dict.setUIDList('funding_uid', funding) column_value_dict.setUIDList('funding_uid', funding)
column_value_dict.setUIDList('payment_request_uid', payment_request)
column_value_dict.setUIDList('function_uid', function) column_value_dict.setUIDList('function_uid', function)
sql_kw['transformed_uid'] = self._generatePropertyUidList(transformed_resource) sql_kw['transformed_uid'] = self._generatePropertyUidList(transformed_resource)
...@@ -727,6 +735,7 @@ class SimulationTool(BaseTool): ...@@ -727,6 +735,7 @@ class SimulationTool(BaseTool):
related_key_dict.setUIDList('node_category_uid', node_category) related_key_dict.setUIDList('node_category_uid', node_category)
related_key_dict.setUIDList('project_category_uid', project_category) related_key_dict.setUIDList('project_category_uid', project_category)
related_key_dict.setUIDList('funding_category_uid', funding_category) related_key_dict.setUIDList('funding_category_uid', funding_category)
related_key_dict.setUIDList('payment_request_category_uid', payment_request_category)
related_key_dict.setUIDList('function_category_uid', function_category) related_key_dict.setUIDList('function_category_uid', function_category)
related_key_dict.setUIDList('payment_category_uid', payment_category) related_key_dict.setUIDList('payment_category_uid', payment_category)
if related_key_dict.setUIDList('section_category_uid', if related_key_dict.setUIDList('section_category_uid',
...@@ -743,6 +752,8 @@ class SimulationTool(BaseTool): ...@@ -743,6 +752,8 @@ class SimulationTool(BaseTool):
project_category_strict_membership) project_category_strict_membership)
related_key_dict.setUIDList('funding_category_strict_membership_uid', related_key_dict.setUIDList('funding_category_strict_membership_uid',
funding_category_strict_membership) funding_category_strict_membership)
related_key_dict.setUIDList('payment_request_category_strict_membership_uid',
payment_request_category_strict_membership)
related_key_dict.setUIDList('function_category_strict_membership_uid', related_key_dict.setUIDList('function_category_strict_membership_uid',
function_category_strict_membership) function_category_strict_membership)
related_key_dict.setUIDList('payment_category_strict_membership_uid', related_key_dict.setUIDList('payment_category_strict_membership_uid',
...@@ -847,6 +858,8 @@ class SimulationTool(BaseTool): ...@@ -847,6 +858,8 @@ class SimulationTool(BaseTool):
column_group_by_expression_list.append('project_uid') column_group_by_expression_list.append('project_uid')
if group_by_funding: if group_by_funding:
column_group_by_expression_list.append('funding_uid') column_group_by_expression_list.append('funding_uid')
if group_by_payment_request:
column_group_by_expression_list.append('payment_request_uid')
if group_by_function: if group_by_function:
column_group_by_expression_list.append('function_uid') column_group_by_expression_list.append('function_uid')
if group_by_date: if group_by_date:
...@@ -918,6 +931,14 @@ class SimulationTool(BaseTool): ...@@ -918,6 +931,14 @@ class SimulationTool(BaseTool):
'funding_category_strict_membership_uid') 'funding_category_strict_membership_uid')
related_key_select_expression_list.append( related_key_select_expression_list.append(
'funding_category_strict_membership_uid') 'funding_category_strict_membership_uid')
if group_by_payment_category:
related_key_group_by_expression_list.append('payment_request_category_uid')
related_key_select_expression_list.append('payment_request_category_uid')
if group_by_payment_request_category_strict_membership:
related_key_group_by_expression_list.append(
'payment_request_category_strict_membership_uid')
related_key_select_expression_list.append(
'payment_request_category_strict_membership_uid')
if related_key_group_by_expression_list: if related_key_group_by_expression_list:
new_kw['related_key_group_by'] = related_key_group_by_expression_list new_kw['related_key_group_by'] = related_key_group_by_expression_list
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Base Category" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_folders_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Copy_or_Move_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Delete_objects_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_count</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_mt_index</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>_tree</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>acquisition_append_value</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>acquisition_base_category</string> </key>
<value>
<tuple>
<string>order</string>
<string>parent</string>
</tuple>
</value>
</item>
<item>
<key> <string>acquisition_copy_value</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>acquisition_mask_value</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>acquisition_object_id</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>acquisition_portal_type</string> </key>
<value> <string>python: list( portal.getPortalAcquisitionMovementTypeList() + portal.getPortalItemTypeList() + portal.getPortalDeliveryTypeList() + portal.getPortalOrderTypeList() + portal.getPortalInvoiceTypeList() + portal.getPortalOpenOrderTypeList())</string> </value>
</item>
<item>
<key> <string>acquisition_sync_value</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>source_function</string>
<string>source_project</string>
<string>destination_payment_request</string>
</tuple>
</value>
</item>
<item>
<key> <string>category_type</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>criterion_property</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>fallback_base_category</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>destination_payment_request</string> </value>
</item>
<item>
<key> <string>id_generator</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id_group</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>membership_criterion_base_category</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>membership_criterion_category</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>multimembership_criterion_base_category</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Base Category</string> </value>
</item>
<item>
<key> <string>read_permission</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>rid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>sid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>test_method_id</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Destination Payment Request</string> </value>
</item>
<item>
<key> <string>write_permission</string> </key>
<value>
<none/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Length" module="BTrees.Length"/>
</pickle>
<pickle> <int>0</int> </pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Base Category" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_folders_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Copy_or_Move_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Delete_objects_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_count</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_mt_index</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>_tree</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>acquisition_append_value</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>acquisition_base_category</string> </key>
<value>
<tuple>
<string>order</string>
<string>parent</string>
</tuple>
</value>
</item>
<item>
<key> <string>acquisition_copy_value</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>acquisition_mask_value</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>acquisition_object_id</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>acquisition_portal_type</string> </key>
<value> <string>python: list( portal.getPortalAcquisitionMovementTypeList() + portal.getPortalItemTypeList() + portal.getPortalDeliveryTypeList() + portal.getPortalOrderTypeList() + portal.getPortalInvoiceTypeList() + portal.getPortalOpenOrderTypeList())</string> </value>
</item>
<item>
<key> <string>acquisition_sync_value</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>source_function</string>
<string>source_project</string>
<string>source_payment_request</string>
</tuple>
</value>
</item>
<item>
<key> <string>category_type</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>criterion_property</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>fallback_base_category</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>source_payment_request</string> </value>
</item>
<item>
<key> <string>id_generator</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id_group</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>membership_criterion_base_category</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>membership_criterion_category</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>multimembership_criterion_base_category</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Base Category</string> </value>
</item>
<item>
<key> <string>read_permission</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>rid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>sid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>test_method_id</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Source Payment Request</string> </value>
</item>
<item>
<key> <string>write_permission</string> </key>
<value>
<none/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Length" module="BTrees.Length"/>
</pickle>
<pickle> <int>0</int> </pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
</ZopeData>
...@@ -136,6 +136,7 @@ SELECT\n ...@@ -136,6 +136,7 @@ SELECT\n
<dtml-var stock_table_id>.function_uid as function_uid,\n <dtml-var stock_table_id>.function_uid as function_uid,\n
<dtml-var stock_table_id>.project_uid as project_uid,\n <dtml-var stock_table_id>.project_uid as project_uid,\n
<dtml-var stock_table_id>.funding_uid as funding_uid,\n <dtml-var stock_table_id>.funding_uid as funding_uid,\n
<dtml-var stock_table_id>.payment_request_uid as payment_request_uid,\n
catalog.path as path\n catalog.path as path\n
</dtml-if>\n </dtml-if>\n
<dtml-if statistic>\n <dtml-if statistic>\n
......
...@@ -508,6 +508,7 @@ SELECT\n ...@@ -508,6 +508,7 @@ SELECT\n
stock.function_uid AS function_uid,\n stock.function_uid AS function_uid,\n
stock.project_uid AS project_uid,\n stock.project_uid AS project_uid,\n
stock.funding_uid AS funding_uid,\n stock.funding_uid AS funding_uid,\n
stock.payment_request_uid AS payment_request_uid,\n
node.uid AS node_uid,\n node.uid AS node_uid,\n
node.title AS node_title,\n node.title AS node_title,\n
node.relative_url AS node_relative_url,\n node.relative_url AS node_relative_url,\n
......
41066 41067
\ No newline at end of file \ No newline at end of file
...@@ -13,6 +13,7 @@ destination_function ...@@ -13,6 +13,7 @@ destination_function
destination_funding destination_funding
destination_payment destination_payment
destination_payment_region destination_payment_region
destination_payment_request
destination_project destination_project
destination_section destination_section
destination_trade destination_trade
...@@ -34,6 +35,7 @@ source_function ...@@ -34,6 +35,7 @@ source_function
source_funding source_funding
source_payment source_payment
source_payment_region source_payment_region
source_payment_request
source_project source_project
source_section source_section
source_trade source_trade
......
...@@ -24,6 +24,8 @@ getSourceProjectUid\r\n ...@@ -24,6 +24,8 @@ getSourceProjectUid\r\n
getDestinationProjectUid\r\n getDestinationProjectUid\r\n
getSourceFundingUid\r\n getSourceFundingUid\r\n
getDestinationFundingUid\r\n getDestinationFundingUid\r\n
getSourcePaymentRequestUid\r\n
getDestinationPaymentRequestUid\r\n
getSimulationState\r\n getSimulationState\r\n
getSourceInventoriatedTotalAssetPrice\r\n getSourceInventoriatedTotalAssetPrice\r\n
getDestinationInventoriatedTotalAssetPrice\r\n getDestinationInventoriatedTotalAssetPrice\r\n
...@@ -69,6 +71,7 @@ WHERE\n ...@@ -69,6 +71,7 @@ WHERE\n
getDestinationFunctionUid[loop_item],\n getDestinationFunctionUid[loop_item],\n
getDestinationProjectUid[loop_item], \n getDestinationProjectUid[loop_item], \n
getDestinationFundingUid[loop_item], \n getDestinationFundingUid[loop_item], \n
getDestinationPaymentRequestUid[loop_item], \n
getSourceSectionUid[loop_item], \n getSourceSectionUid[loop_item], \n
getSourceUid[loop_item], \n getSourceUid[loop_item], \n
getResourceUid[loop_item],\n getResourceUid[loop_item],\n
...@@ -92,6 +95,7 @@ WHERE\n ...@@ -92,6 +95,7 @@ WHERE\n
getSourceFunctionUid[loop_item],\n getSourceFunctionUid[loop_item],\n
getSourceProjectUid[loop_item], \n getSourceProjectUid[loop_item], \n
getSourceFundingUid[loop_item], \n getSourceFundingUid[loop_item], \n
getSourcePaymentRequestUid[loop_item], \n
getDestinationSectionUid[loop_item], \n getDestinationSectionUid[loop_item], \n
getDestinationUid[loop_item], \n getDestinationUid[loop_item], \n
getResourceUid[loop_item],\n getResourceUid[loop_item],\n
...@@ -123,15 +127,16 @@ VALUES\n ...@@ -123,15 +127,16 @@ VALUES\n
<dtml-sqlvar expr="row_item[7]" type="int" optional>,\n <dtml-sqlvar expr="row_item[7]" type="int" optional>,\n
<dtml-sqlvar expr="row_item[8]" type="int" optional>,\n <dtml-sqlvar expr="row_item[8]" type="int" optional>,\n
<dtml-sqlvar expr="row_item[9]" type="int" optional>,\n <dtml-sqlvar expr="row_item[9]" type="int" optional>,\n
<dtml-sqlvar expr="row_item[10]" type="int">, \n <dtml-sqlvar expr="row_item[10]" type="int" optional>,\n
<dtml-sqlvar expr="row_item[11]" type="float" optional>,\n <dtml-sqlvar expr="row_item[11]" type="int">, \n
<dtml-sqlvar expr="row_item[12]" type="datetime" optional>,\n <dtml-sqlvar expr="row_item[12]" type="float" optional>,\n
<dtml-sqlvar expr="row_item[13]" type="datetime" optional>,\n <dtml-sqlvar expr="row_item[13]" type="datetime" optional>,\n
<dtml-sqlvar expr="row_item[14]" type="float" optional>,\n <dtml-sqlvar expr="row_item[14]" type="datetime" optional>,\n
<dtml-sqlvar expr="row_item[15]" type="string" optional>,\n <dtml-sqlvar expr="row_item[15]" type="float" optional>,\n
<dtml-sqlvar expr="row_item[16]" type="string" optional>,\n <dtml-sqlvar expr="row_item[16]" type="string" optional>,\n
<dtml-sqlvar expr="row_item[17]" type="string" optional>,\n <dtml-sqlvar expr="row_item[17]" type="string" optional>,\n
<dtml-sqlvar expr="row_item[18]" type="string" optional>\n <dtml-sqlvar expr="row_item[18]" type="string" optional>,\n
<dtml-sqlvar expr="row_item[19]" type="string" optional>\n
)\n )\n
<dtml-if sequence-end><dtml-else>,</dtml-if>\n <dtml-if sequence-end><dtml-else>,</dtml-if>\n
</dtml-in>\n </dtml-in>\n
......
...@@ -32,6 +32,8 @@ getSourceProjectUid\r\n ...@@ -32,6 +32,8 @@ getSourceProjectUid\r\n
getDestinationProjectUid\r\n getDestinationProjectUid\r\n
getSourceFundingUid\r\n getSourceFundingUid\r\n
getDestinationFundingUid\r\n getDestinationFundingUid\r\n
getSourcePaymentRequestUid\r\n
getDestinationPaymentRequestUid\r\n
getSimulationState\r\n getSimulationState\r\n
getSourceInventoriatedTotalAssetPrice\r\n getSourceInventoriatedTotalAssetPrice\r\n
getDestinationInventoriatedTotalAssetPrice\r\n getDestinationInventoriatedTotalAssetPrice\r\n
...@@ -104,6 +106,7 @@ WHERE\n ...@@ -104,6 +106,7 @@ WHERE\n
getDestinationFunctionUid[loop_item],\n getDestinationFunctionUid[loop_item],\n
getDestinationProjectUid[loop_item], \n getDestinationProjectUid[loop_item], \n
getDestinationFundingUid[loop_item], \n getDestinationFundingUid[loop_item], \n
getDestinationPaymentRequestUid[loop_item], \n
getSourceSectionUid[loop_item], \n getSourceSectionUid[loop_item], \n
getSourceUid[loop_item], \n getSourceUid[loop_item], \n
getResourceUid[loop_item],\n getResourceUid[loop_item],\n
...@@ -128,6 +131,7 @@ WHERE\n ...@@ -128,6 +131,7 @@ WHERE\n
getSourceFunctionUid[loop_item],\n getSourceFunctionUid[loop_item],\n
getSourceProjectUid[loop_item], \n getSourceProjectUid[loop_item], \n
getSourceFundingUid[loop_item], \n getSourceFundingUid[loop_item], \n
getSourcePaymentRequestUid[loop_item], \n
getDestinationSectionUid[loop_item], \n getDestinationSectionUid[loop_item], \n
getDestinationUid[loop_item], \n getDestinationUid[loop_item], \n
getResourceUid[loop_item],\n getResourceUid[loop_item],\n
...@@ -160,16 +164,17 @@ VALUES\n ...@@ -160,16 +164,17 @@ VALUES\n
<dtml-sqlvar expr="row_item[7]" type="int" optional>,\n <dtml-sqlvar expr="row_item[7]" type="int" optional>,\n
<dtml-sqlvar expr="row_item[8]" type="int" optional>,\n <dtml-sqlvar expr="row_item[8]" type="int" optional>,\n
<dtml-sqlvar expr="row_item[9]" type="int" optional>,\n <dtml-sqlvar expr="row_item[9]" type="int" optional>,\n
<dtml-sqlvar expr="row_item[10]" type="int">, \n <dtml-sqlvar expr="row_item[10]" type="int" optional>,\n
<dtml-sqlvar expr="row_item[11]" type="float" optional>,\n <dtml-sqlvar expr="row_item[11]" type="int">, \n
<dtml-sqlvar expr="row_item[12]" type="int">, \n <dtml-sqlvar expr="row_item[12]" type="float" optional>,\n
<dtml-sqlvar expr="row_item[13]" type="datetime" optional>,\n <dtml-sqlvar expr="row_item[13]" type="int">, \n
<dtml-sqlvar expr="row_item[14]" type="datetime" optional>,\n <dtml-sqlvar expr="row_item[14]" type="datetime" optional>,\n
<dtml-sqlvar expr="row_item[15]" type="float" optional>,\n <dtml-sqlvar expr="row_item[15]" type="datetime" optional>,\n
<dtml-sqlvar expr="row_item[16]" type="string" optional>,\n <dtml-sqlvar expr="row_item[16]" type="float" optional>,\n
<dtml-sqlvar expr="row_item[17]" type="string" optional>,\n <dtml-sqlvar expr="row_item[17]" type="string" optional>,\n
<dtml-sqlvar expr="row_item[18]" type="string" optional>,\n <dtml-sqlvar expr="row_item[18]" type="string" optional>,\n
<dtml-sqlvar expr="row_item[19]" type="string" optional>\n <dtml-sqlvar expr="row_item[19]" type="string" optional>,\n
<dtml-sqlvar expr="row_item[20]" type="string" optional>\n
)\n )\n
<dtml-if sequence-end><dtml-else>,</dtml-if>\n <dtml-if sequence-end><dtml-else>,</dtml-if>\n
</dtml-in>\n </dtml-in>\n
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
`function_uid` BIGINT UNSIGNED,\n `function_uid` BIGINT UNSIGNED,\n
`project_uid` BIGINT UNSIGNED,\n `project_uid` BIGINT UNSIGNED,\n
`funding_uid` BIGINT UNSIGNED,\n `funding_uid` BIGINT UNSIGNED,\n
`payment_request_uid` BIGINT UNSIGNED,\n
`mirror_section_uid` BIGINT UNSIGNED,\n `mirror_section_uid` BIGINT UNSIGNED,\n
`mirror_node_uid` BIGINT UNSIGNED,\n `mirror_node_uid` BIGINT UNSIGNED,\n
`resource_uid` BIGINT UNSIGNED,\n `resource_uid` BIGINT UNSIGNED,\n
......
...@@ -65,6 +65,7 @@ CREATE TABLE `stock` (\n ...@@ -65,6 +65,7 @@ CREATE TABLE `stock` (\n
`function_uid` BIGINT UNSIGNED,\n `function_uid` BIGINT UNSIGNED,\n
`project_uid` BIGINT UNSIGNED,\n `project_uid` BIGINT UNSIGNED,\n
`funding_uid` BIGINT UNSIGNED,\n `funding_uid` BIGINT UNSIGNED,\n
`payment_request_uid` BIGINT UNSIGNED,\n
`mirror_section_uid` BIGINT UNSIGNED,\n `mirror_section_uid` BIGINT UNSIGNED,\n
`mirror_node_uid` BIGINT UNSIGNED,\n `mirror_node_uid` BIGINT UNSIGNED,\n
`resource_uid` BIGINT UNSIGNED,\n `resource_uid` BIGINT UNSIGNED,\n
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="SQL" module="Products.ZSQLMethods.SQL"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>allow_simple_one_argument_traversal</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>arguments_src</string> </key>
<value> <string>table_0</string> </value>
</item>
<item>
<key> <string>cache_time_</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>class_file_</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>class_name_</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>connection_hook</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>connection_id</string> </key>
<value> <string>erp5_sql_connection</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>z_related_payment_request_uid_from_stock</string> </value>
</item>
<item>
<key> <string>max_cache_</string> </key>
<value> <int>100</int> </value>
</item>
<item>
<key> <string>max_rows_</string> </key>
<value> <int>1000</int> </value>
</item>
<item>
<key> <string>src</string> </key>
<value> <string encoding="cdata"><![CDATA[
<dtml-var table_0>.uid = stock.payment_request_uid
]]></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="SQL" module="Products.ZSQLMethods.SQL"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>allow_simple_one_argument_traversal</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>arguments_src</string> </key>
<value> <string>table_0</string> </value>
</item>
<item>
<key> <string>cache_time_</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>class_file_</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>class_name_</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>connection_hook</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>connection_id</string> </key>
<value> <string>erp5_sql_connection</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>z_related_strict_membership_payment_request_uid_from_stock</string> </value>
</item>
<item>
<key> <string>max_cache_</string> </key>
<value> <int>100</int> </value>
</item>
<item>
<key> <string>max_rows_</string> </key>
<value> <int>1000</int> </value>
</item>
<item>
<key> <string>src</string> </key>
<value> <string encoding="cdata"><![CDATA[
<dtml-var table_0>.uid = stock.payment_request_uid AND\n
<dtml-var table_0>.category_strict_membership = 1\n
]]></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -44,6 +44,8 @@ ...@@ -44,6 +44,8 @@
<key>stock_node_category_uid | category/category_uid/z_related_node_uid_from_stock</key> <key>stock_node_category_uid | category/category_uid/z_related_node_uid_from_stock</key>
<key>stock_payment_category_strict_membership_uid | category/category_uid/z_related_strict_membership_payment_uid_from_stock</key> <key>stock_payment_category_strict_membership_uid | category/category_uid/z_related_strict_membership_payment_uid_from_stock</key>
<key>stock_payment_category_uid | category/category_uid/z_related_payment_uid_from_stock</key> <key>stock_payment_category_uid | category/category_uid/z_related_payment_uid_from_stock</key>
<key>stock_payment_request_category_strict_membership_uid | category/category_uid/z_related_strict_membership_payment_request_uid_from_stock</key>
<key>stock_payment_request_category_uid | category/category_uid/z_related_payment_request_uid_from_stock</key>
<key>stock_project_category_strict_membership_uid | category/category_uid/z_related_strict_membership_project_uid_from_stock</key> <key>stock_project_category_strict_membership_uid | category/category_uid/z_related_strict_membership_project_uid_from_stock</key>
<key>stock_project_category_uid | category/category_uid/z_related_project_uid_from_stock</key> <key>stock_project_category_uid | category/category_uid/z_related_project_uid_from_stock</key>
<key>stock_resource_category_strict_membership_uid | category/category_uid/z_related_strict_membership_resource_uid_from_stock</key> <key>stock_resource_category_strict_membership_uid | category/category_uid/z_related_strict_membership_resource_uid_from_stock</key>
......
238 239
\ No newline at end of file \ No newline at end of file
...@@ -91,6 +91,7 @@ erp5_mysql_innodb/z_related_career_skill ...@@ -91,6 +91,7 @@ erp5_mysql_innodb/z_related_career_skill
erp5_mysql_innodb/z_related_children erp5_mysql_innodb/z_related_children
erp5_mysql_innodb/z_related_explanation erp5_mysql_innodb/z_related_explanation
erp5_mysql_innodb/z_related_function_uid_from_stock erp5_mysql_innodb/z_related_function_uid_from_stock
erp5_mysql_innodb/z_related_funding_uid_from_stock
erp5_mysql_innodb/z_related_grand_grand_grand_grand_grand_parent erp5_mysql_innodb/z_related_grand_grand_grand_grand_grand_parent
erp5_mysql_innodb/z_related_grand_grand_grand_grand_parent_specialise erp5_mysql_innodb/z_related_grand_grand_grand_grand_parent_specialise
erp5_mysql_innodb/z_related_grand_grand_grand_parent_delivery erp5_mysql_innodb/z_related_grand_grand_grand_parent_delivery
...@@ -103,6 +104,7 @@ erp5_mysql_innodb/z_related_node_uid_from_stock ...@@ -103,6 +104,7 @@ erp5_mysql_innodb/z_related_node_uid_from_stock
erp5_mysql_innodb/z_related_parent erp5_mysql_innodb/z_related_parent
erp5_mysql_innodb/z_related_parent_specialise erp5_mysql_innodb/z_related_parent_specialise
erp5_mysql_innodb/z_related_parent_strict_group erp5_mysql_innodb/z_related_parent_strict_group
erp5_mysql_innodb/z_related_payment_request_uid_from_stock
erp5_mysql_innodb/z_related_payment_uid_from_stock erp5_mysql_innodb/z_related_payment_uid_from_stock
erp5_mysql_innodb/z_related_predicate erp5_mysql_innodb/z_related_predicate
erp5_mysql_innodb/z_related_predicate_category erp5_mysql_innodb/z_related_predicate_category
...@@ -114,8 +116,10 @@ erp5_mysql_innodb/z_related_resource_uid_from_stock ...@@ -114,8 +116,10 @@ erp5_mysql_innodb/z_related_resource_uid_from_stock
erp5_mysql_innodb/z_related_section_uid_from_item erp5_mysql_innodb/z_related_section_uid_from_item
erp5_mysql_innodb/z_related_section_uid_from_stock erp5_mysql_innodb/z_related_section_uid_from_stock
erp5_mysql_innodb/z_related_strict_membership_function_uid_from_stock erp5_mysql_innodb/z_related_strict_membership_function_uid_from_stock
erp5_mysql_innodb/z_related_strict_membership_funding_uid_from_stock
erp5_mysql_innodb/z_related_strict_membership_mirror_section_uid_from_stock erp5_mysql_innodb/z_related_strict_membership_mirror_section_uid_from_stock
erp5_mysql_innodb/z_related_strict_membership_node_uid_from_stock erp5_mysql_innodb/z_related_strict_membership_node_uid_from_stock
erp5_mysql_innodb/z_related_strict_membership_payment_request_uid_from_stock
erp5_mysql_innodb/z_related_strict_membership_payment_uid_from_stock erp5_mysql_innodb/z_related_strict_membership_payment_uid_from_stock
erp5_mysql_innodb/z_related_strict_membership_project_uid_from_stock erp5_mysql_innodb/z_related_strict_membership_project_uid_from_stock
erp5_mysql_innodb/z_related_strict_membership_resource_uid_from_stock erp5_mysql_innodb/z_related_strict_membership_resource_uid_from_stock
...@@ -143,5 +147,3 @@ erp5_mysql_innodb/z_show_tables ...@@ -143,5 +147,3 @@ erp5_mysql_innodb/z_show_tables
erp5_mysql_innodb/z_uncatalog_delivery erp5_mysql_innodb/z_uncatalog_delivery
erp5_mysql_innodb/z_uncatalog_object erp5_mysql_innodb/z_uncatalog_object
erp5_mysql_innodb/z_unique_values erp5_mysql_innodb/z_unique_values
\ No newline at end of file
erp5_mysql_innodb/z_related_funding_uid_from_stock
erp5_mysql_innodb/z_related_strict_membership_funding_uid_from_stock
\ No newline at end of file
...@@ -63,3 +63,5 @@ children_reference | catalog/reference/z_related_children ...@@ -63,3 +63,5 @@ children_reference | catalog/reference/z_related_children
related_resource_from_use_category_uid | category,category/category_uid/z_related_resource_from_use related_resource_from_use_category_uid | category,category/category_uid/z_related_resource_from_use
stock_funding_category_strict_membership_uid | category/category_uid/z_related_strict_membership_funding_uid_from_stock stock_funding_category_strict_membership_uid | category/category_uid/z_related_strict_membership_funding_uid_from_stock
stock_funding_category_uid | category/category_uid/z_related_funding_uid_from_stock stock_funding_category_uid | category/category_uid/z_related_funding_uid_from_stock
stock_payment_request_category_strict_membership_uid | category/category_uid/z_related_strict_membership_payment_request_uid_from_stock
stock_payment_request_category_uid | category/category_uid/z_related_payment_request_uid_from_stock
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Category Property" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>destination_payment_request_category</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Category Property</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Category Property" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>source_payment_request_category</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Category Property</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
57 58
\ No newline at end of file \ No newline at end of file
...@@ -439,6 +439,39 @@ class TestInventory(InventoryAPITestCase): ...@@ -439,6 +439,39 @@ class TestInventory(InventoryAPITestCase):
self.assertInventoryEquals(100, self.assertInventoryEquals(100,
funding_category_strict_membership='function/function1/function2') funding_category_strict_membership='function/function1/function2')
def test_PaymentRequest(self):
"""Tests inventory on payment_request"""
self._makeMovement(quantity=30, destination_payment_request='function/function1')
self._makeMovement(quantity=-70, source_payment_request='function/function1')
self.assertInventoryEquals(100, payment_request='function/function1')
self.assertInventoryEquals(0, payment_request='function/function1/function2')
def test_PaymentRequestUid(self):
"""Tests inventory on payment_request uid"""
function = self.portal.portal_categories.function
self._makeMovement(quantity=100, destination_payment_request='function/function1')
self.assertInventoryEquals(100, payment_request_uid=function.function1.getUid())
self.assertInventoryEquals(0,
payment_request_uid=function.function1.function2.getUid())
def test_PaymentRequestCategory(self):
"""Tests inventory on payment_request category"""
self._makeMovement(quantity=100,
destination_payment_request='function/function1/function2')
self.assertInventoryEquals(100, payment_request_category='function/function1')
self.assertInventoryEquals(100, payment_request='function/function1/function2')
def test_PaymentRequestCategoryStrictMembership(self):
"""Tests inventory on payment_request category strict membership"""
self._makeMovement(quantity=100,
destination_payment_request='function/function1/function2')
self.assertInventoryEquals(0,
payment_request_category_strict_membership='function/function1')
self.assertInventoryEquals(100,
payment_request_category_strict_membership='function/function1/function2')
def test_Project(self): def test_Project(self):
"""Tests inventory on project""" """Tests inventory on project"""
self._makeMovement(quantity=100, destination_project_value=self.project) self._makeMovement(quantity=100, destination_project_value=self.project)
...@@ -871,6 +904,25 @@ class TestInventoryList(InventoryAPITestCase): ...@@ -871,6 +904,25 @@ class TestInventoryList(InventoryAPITestCase):
self.assertEquals([r for r in inventory_list if r.funding_uid == self.assertEquals([r for r in inventory_list if r.funding_uid ==
funding2.getUid()][0].inventory, 3) funding2.getUid()][0].inventory, 3)
def test_GroupByPaymentRequest(self):
getInventoryList = self.getSimulationTool().getInventoryList
payment_request1 = self.portal.portal_categories.restrictedTraverse(
'function/function1')
payment_request2 = self.portal.portal_categories.restrictedTraverse(
'function/function1/function2')
self._makeMovement(quantity=2,
destination_payment_request_value=payment_request1,)
self._makeMovement(quantity=3,
destination_payment_request_value=payment_request2,)
inventory_list = getInventoryList(node_uid=self.node.getUid(),
group_by_payment_request=1)
self.assertEquals(2, len(inventory_list))
self.assertEquals([r for r in inventory_list if r.payment_request_uid ==
payment_request1.getUid()][0].inventory, 2)
self.assertEquals([r for r in inventory_list if r.payment_request_uid ==
payment_request2.getUid()][0].inventory, 3)
def test_GroupByProject(self): def test_GroupByProject(self):
getInventoryList = self.getSimulationTool().getInventoryList getInventoryList = self.getSimulationTool().getInventoryList
self._makeMovement(quantity=2, self._makeMovement(quantity=2,
......
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