Commit e7dde761 authored by Vincent Pelletier's avatar Vincent Pelletier

Update ZSQLMethods to use new catalog layout (new primary keys).


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@19527 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 969dfe55
...@@ -277,20 +277,16 @@ WHERE\n ...@@ -277,20 +277,16 @@ WHERE\n
\n \n
<dtml-var "\'\\0\'">\n <dtml-var "\'\\0\'">\n
\n \n
<dtml-let row_list="[]">\n <dtml-let row_list="[]" uid_dict="{}">\n
<dtml-in prefix="loop" expr="_.range(_.len(uid))">\n <dtml-in prefix="loop" expr="_.range(_.len(uid))">\n
<dtml-if "isMovement[loop_item]">\n <dtml-if "not isInventoryMovement[loop_item] and isMovement[loop_item] and isAccountable[loop_item] and getResourceUid[loop_item]">\n
<dtml-if "not isInventoryMovement[loop_item]">\n
<dtml-if "isAccountable[loop_item]">\n
<dtml-if "getResourceUid[loop_item]">\n
<dtml-if "getBaobabDestinationUid[loop_item]">\n <dtml-if "getBaobabDestinationUid[loop_item]">\n
<dtml-call expr="row_list.append([uid[loop_item], getBaobabDestinationUid[loop_item], getBaobabDestinationSectionUid[loop_item], getBaobabDestinationPaymentUid[loop_item], getExplanationUid[loop_item], getBaobabSourceSectionUid[loop_item], getBaobabSourceUid[loop_item], getResourceUid[loop_item], getInventoriatedQuantity[loop_item], getStopDate[loop_item], getDestinationInventoriatedTotalAssetPrice[loop_item], getPortalType[loop_item], getSimulationState[loop_item], getBaobabDestinationVariationText[loop_item],getSubVariationText[loop_item]])">\n <dtml-call expr="uid_dict.update({uid[loop_item]: uid_dict.get(uid[loop_item], -1) + 1})">\n
<dtml-call expr="row_list.append([uid[loop_item], uid_dict[uid[loop_item]], getBaobabDestinationUid[loop_item], getBaobabDestinationSectionUid[loop_item], getBaobabDestinationPaymentUid[loop_item], getExplanationUid[loop_item], getBaobabSourceSectionUid[loop_item], getBaobabSourceUid[loop_item], getResourceUid[loop_item], getInventoriatedQuantity[loop_item], getStopDate[loop_item], getDestinationInventoriatedTotalAssetPrice[loop_item], getPortalType[loop_item], getSimulationState[loop_item], getBaobabDestinationVariationText[loop_item],getSubVariationText[loop_item]])">\n
</dtml-if>\n </dtml-if>\n
<dtml-if "getBaobabSourceUid[loop_item]">\n <dtml-if "getBaobabSourceUid[loop_item]">\n
<dtml-call expr="row_list.append([uid[loop_item], getBaobabSourceUid[loop_item], getBaobabSourceSectionUid[loop_item], getBaobabSourcePaymentUid[loop_item], getExplanationUid[loop_item], getBaobabDestinationSectionUid[loop_item], getBaobabDestinationUid[loop_item], getResourceUid[loop_item], -(getInventoriatedQuantity[loop_item] or 0), getStartDate[loop_item], getSourceInventoriatedTotalAssetPrice[loop_item], getPortalType[loop_item], getSimulationState[loop_item], getBaobabSourceVariationText[loop_item],getSubVariationText[loop_item]])">\n <dtml-call expr="uid_dict.update({uid[loop_item]: uid_dict.get(uid[loop_item], -1) + 1})">\n
</dtml-if>\n <dtml-call expr="row_list.append([uid[loop_item], uid_dict[uid[loop_item]], getBaobabSourceUid[loop_item], getBaobabSourceSectionUid[loop_item], getBaobabSourcePaymentUid[loop_item], getExplanationUid[loop_item], getBaobabDestinationSectionUid[loop_item], getBaobabDestinationUid[loop_item], getResourceUid[loop_item], -(getInventoriatedQuantity[loop_item] or 0), getStartDate[loop_item], getSourceInventoriatedTotalAssetPrice[loop_item], getPortalType[loop_item], getSimulationState[loop_item], getBaobabSourceVariationText[loop_item],getSubVariationText[loop_item]])">\n
</dtml-if>\n
</dtml-if>\n
</dtml-if>\n </dtml-if>\n
</dtml-if>\n </dtml-if>\n
</dtml-in> \n </dtml-in> \n
...@@ -302,20 +298,21 @@ VALUES\n ...@@ -302,20 +298,21 @@ VALUES\n
<dtml-in prefix="row" expr="row_list">\n <dtml-in prefix="row" expr="row_list">\n
(\n (\n
<dtml-sqlvar expr="row_item[0]" type="int">,\n <dtml-sqlvar expr="row_item[0]" type="int">,\n
<dtml-sqlvar expr="row_item[1]" type="int">, \n <dtml-sqlvar expr="row_item[1]" type="int">,\n
<dtml-sqlvar expr="row_item[2]" type="int" optional>, \n <dtml-sqlvar expr="row_item[2]" type="int">, \n
<dtml-sqlvar expr="row_item[3]" type="int" optional>,\n <dtml-sqlvar expr="row_item[3]" type="int" optional>, \n
<dtml-sqlvar expr="row_item[4]" type="int" optional>,\n <dtml-sqlvar expr="row_item[4]" type="int" optional>,\n
<dtml-sqlvar expr="row_item[5]" type="int" optional>,\n <dtml-sqlvar expr="row_item[5]" type="int" optional>,\n
<dtml-sqlvar expr="row_item[6]" type="int" optional>,\n <dtml-sqlvar expr="row_item[6]" type="int" optional>,\n
<dtml-sqlvar expr="row_item[7]" type="int">, \n <dtml-sqlvar expr="row_item[7]" type="int" optional>,\n
<dtml-sqlvar expr="row_item[8]" type="float" optional>,\n <dtml-sqlvar expr="row_item[8]" type="int">, \n
<dtml-sqlvar expr="row_item[9]" type="datetime" optional>,\n <dtml-sqlvar expr="row_item[9]" type="float" optional>,\n
<dtml-sqlvar expr="row_item[10]" type="float" optional>,\n <dtml-sqlvar expr="row_item[10]" type="datetime" optional>,\n
<dtml-sqlvar expr="row_item[11]" type="string" optional>,\n <dtml-sqlvar expr="row_item[11]" type="float" optional>,\n
<dtml-sqlvar expr="row_item[12]" type="string" optional>,\n <dtml-sqlvar expr="row_item[12]" type="string" optional>,\n
<dtml-sqlvar expr="row_item[13]" type="string" optional>,\n <dtml-sqlvar expr="row_item[13]" type="string" optional>,\n
<dtml-sqlvar expr="row_item[14]" type="string" optional>\n <dtml-sqlvar expr="row_item[14]" type="string" optional>,\n
<dtml-sqlvar expr="row_item[15]" 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
...@@ -371,20 +368,16 @@ WHERE\n ...@@ -371,20 +368,16 @@ WHERE\n
\n \n
<dtml-var "\'\\0\'">\n <dtml-var "\'\\0\'">\n
\n \n
<dtml-let row_list="[]">\n <dtml-let row_list="[]" uid_dict="{}">\n
<dtml-in prefix="loop" expr="_.range(_.len(uid))">\n <dtml-in prefix="loop" expr="_.range(_.len(uid))">\n
<dtml-if "isMovement[loop_item]">\n <dtml-if "not isInventoryMovement[loop_item] and isMovement[loop_item] and isAccountable[loop_item] and getResourceUid[loop_item]">\n
<dtml-if "not isInventoryMovement[loop_item]">\n
<dtml-if "isAccountable[loop_item]">\n
<dtml-if "getResourceUid[loop_item]">\n
<dtml-if "getBaobabDestinationUid[loop_item]">\n <dtml-if "getBaobabDestinationUid[loop_item]">\n
<dtml-call expr="row_list.append([uid[loop_item], getBaobabDestinationUid[loop_item], getBaobabDestinationSectionUid[loop_item], getBaobabDestinationPaymentUid[loop_item], getExplanationUid[loop_item], getBaobabSourceSectionUid[loop_item], getBaobabSourceUid[loop_item], getResourceUid[loop_item], getInventoriatedQuantity[loop_item], getStopDate[loop_item], getDestinationInventoriatedTotalAssetPrice[loop_item], getPortalType[loop_item], getSimulationState[loop_item], getBaobabDestinationVariationText[loop_item],getSubVariationText[loop_item]])">\n <dtml-call expr="uid_dict.update({uid[loop_item]: uid_dict.get(uid[loop_item], -1) + 1})">\n
<dtml-call expr="row_list.append([uid[loop_item], uid_dict[uid[loop_item]], getBaobabDestinationUid[loop_item], getBaobabDestinationSectionUid[loop_item], getBaobabDestinationPaymentUid[loop_item], getExplanationUid[loop_item], getBaobabSourceSectionUid[loop_item], getBaobabSourceUid[loop_item], getResourceUid[loop_item], getInventoriatedQuantity[loop_item], getStopDate[loop_item], getDestinationInventoriatedTotalAssetPrice[loop_item], getPortalType[loop_item], getSimulationState[loop_item], getBaobabDestinationVariationText[loop_item],getSubVariationText[loop_item]])">\n
</dtml-if>\n </dtml-if>\n
<dtml-if "getBaobabSourceUid[loop_item]">\n <dtml-if "getBaobabSourceUid[loop_item]">\n
<dtml-call expr="row_list.append([uid[loop_item], getBaobabSourceUid[loop_item], getBaobabSourceSectionUid[loop_item], getBaobabSourcePaymentUid[loop_item], getExplanationUid[loop_item], getBaobabDestinationSectionUid[loop_item], getBaobabDestinationUid[loop_item], getResourceUid[loop_item], -(getInventoriatedQuantity[loop_item] or 0), getStartDate[loop_item], getSourceInventoriatedTotalAssetPrice[loop_item], getPortalType[loop_item], getSimulationState[loop_item], getBaobabSourceVariationText[loop_item],getSubVariationText[loop_item]])">\n <dtml-call expr="uid_dict.update({uid[loop_item]: uid_dict.get(uid[loop_item], -1) + 1})">\n
</dtml-if>\n <dtml-call expr="row_list.append([uid[loop_item], uid_dict[uid[loop_item]], getBaobabSourceUid[loop_item], getBaobabSourceSectionUid[loop_item], getBaobabSourcePaymentUid[loop_item], getExplanationUid[loop_item], getBaobabDestinationSectionUid[loop_item], getBaobabDestinationUid[loop_item], getResourceUid[loop_item], -(getInventoriatedQuantity[loop_item] or 0), getStartDate[loop_item], getSourceInventoriatedTotalAssetPrice[loop_item], getPortalType[loop_item], getSimulationState[loop_item], getBaobabSourceVariationText[loop_item],getSubVariationText[loop_item]])">\n
</dtml-if>\n
</dtml-if>\n
</dtml-if>\n </dtml-if>\n
</dtml-if>\n </dtml-if>\n
</dtml-in> \n </dtml-in> \n
...@@ -396,20 +389,21 @@ VALUES\n ...@@ -396,20 +389,21 @@ VALUES\n
<dtml-in prefix="row" expr="row_list">\n <dtml-in prefix="row" expr="row_list">\n
(\n (\n
<dtml-sqlvar expr="row_item[0]" type="int">,\n <dtml-sqlvar expr="row_item[0]" type="int">,\n
<dtml-sqlvar expr="row_item[1]" type="int">, \n <dtml-sqlvar expr="row_item[1]" type="int">,\n
<dtml-sqlvar expr="row_item[2]" type="int" optional>, \n <dtml-sqlvar expr="row_item[2]" type="int">, \n
<dtml-sqlvar expr="row_item[3]" type="int" optional>,\n <dtml-sqlvar expr="row_item[3]" type="int" optional>, \n
<dtml-sqlvar expr="row_item[4]" type="int" optional>,\n <dtml-sqlvar expr="row_item[4]" type="int" optional>,\n
<dtml-sqlvar expr="row_item[5]" type="int" optional>,\n <dtml-sqlvar expr="row_item[5]" type="int" optional>,\n
<dtml-sqlvar expr="row_item[6]" type="int" optional>,\n <dtml-sqlvar expr="row_item[6]" type="int" optional>,\n
<dtml-sqlvar expr="row_item[7]" type="int">, \n <dtml-sqlvar expr="row_item[7]" type="int" optional>,\n
<dtml-sqlvar expr="row_item[8]" type="float" optional>,\n <dtml-sqlvar expr="row_item[8]" type="int">, \n
<dtml-sqlvar expr="row_item[9]" type="datetime" optional>,\n <dtml-sqlvar expr="row_item[9]" type="float" optional>,\n
<dtml-sqlvar expr="row_item[10]" type="float" optional>,\n <dtml-sqlvar expr="row_item[10]" type="datetime" optional>,\n
<dtml-sqlvar expr="row_item[11]" type="string" optional>,\n <dtml-sqlvar expr="row_item[11]" type="float" optional>,\n
<dtml-sqlvar expr="row_item[12]" type="string" optional>,\n <dtml-sqlvar expr="row_item[12]" type="string" optional>,\n
<dtml-sqlvar expr="row_item[13]" type="string" optional>,\n <dtml-sqlvar expr="row_item[13]" type="string" optional>,\n
<dtml-sqlvar expr="row_item[14]" type="string" optional>\n <dtml-sqlvar expr="row_item[14]" type="string" optional>,\n
<dtml-sqlvar expr="row_item[15]" 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
......
...@@ -99,7 +99,7 @@ ...@@ -99,7 +99,7 @@
`category_uid` BIGINT UNSIGNED default \'0\',\n `category_uid` BIGINT UNSIGNED default \'0\',\n
`base_category_uid` BIGINT UNSIGNED default \'0\',\n `base_category_uid` BIGINT UNSIGNED default \'0\',\n
`category_strict_membership` tinyint(1) default \'0\',\n `category_strict_membership` tinyint(1) default \'0\',\n
KEY `uid` (`uid`),\n PRIMARY KEY (`uid`, `category_uid`, `base_category_uid`, `category_strict_membership`),\n
KEY `Membership` (`category_uid`,`base_category_uid`)\n KEY `Membership` (`category_uid`,`base_category_uid`)\n
) TYPE = InnoDB;</string> </value> ) TYPE = InnoDB;</string> </value>
</item> </item>
...@@ -142,7 +142,7 @@ ...@@ -142,7 +142,7 @@
`category_uid` BIGINT UNSIGNED default \'0\',\n `category_uid` BIGINT UNSIGNED default \'0\',\n
`base_category_uid` BIGINT UNSIGNED default \'0\',\n `base_category_uid` BIGINT UNSIGNED default \'0\',\n
`category_strict_membership` tinyint(1) default \'0\',\n `category_strict_membership` tinyint(1) default \'0\',\n
KEY `uid` (`uid`),\n PRIMARY KEY (`uid`, `category_uid`, `base_category_uid`, `category_strict_membership`),\n
KEY `Membership` (`category_uid`,`base_category_uid`)\n KEY `Membership` (`category_uid`,`base_category_uid`)\n
) TYPE = InnoDB;</string> </value> ) TYPE = InnoDB;</string> </value>
</item> </item>
......
...@@ -107,7 +107,7 @@ CREATE TABLE `item` (\n ...@@ -107,7 +107,7 @@ CREATE TABLE `item` (\n
`aggregate_uid` BIGINT UNSIGNED default \'0\',\n `aggregate_uid` BIGINT UNSIGNED default \'0\',\n
`variation_text` VARCHAR(255),\n `variation_text` VARCHAR(255),\n
`simulation_state` VARCHAR(255) default \'\',\n `simulation_state` VARCHAR(255) default \'\',\n
KEY `uid` (`uid`),\n PRIMARY KEY (`uid`, `aggregate_uid`),\n
KEY `section_uid` (`section_uid`),\n KEY `section_uid` (`section_uid`),\n
KEY `resource_uid` (`resource_uid`),\n KEY `resource_uid` (`resource_uid`),\n
KEY `variation_text` (`variation_text`),\n KEY `variation_text` (`variation_text`),\n
...@@ -164,7 +164,7 @@ CREATE TABLE `item` (\n ...@@ -164,7 +164,7 @@ CREATE TABLE `item` (\n
`aggregate_uid` BIGINT UNSIGNED default \'0\',\n `aggregate_uid` BIGINT UNSIGNED default \'0\',\n
`variation_text` VARCHAR(255),\n `variation_text` VARCHAR(255),\n
`simulation_state` VARCHAR(255) default \'\',\n `simulation_state` VARCHAR(255) default \'\',\n
KEY `uid` (`uid`),\n PRIMARY KEY (`uid`, `aggregate_uid`),\n
KEY `section_uid` (`section_uid`),\n KEY `section_uid` (`section_uid`),\n
KEY `resource_uid` (`resource_uid`),\n KEY `resource_uid` (`resource_uid`),\n
KEY `variation_text` (`variation_text`),\n KEY `variation_text` (`variation_text`),\n
......
...@@ -94,6 +94,7 @@ ...@@ -94,6 +94,7 @@
#\n #\n
CREATE TABLE `stock` (\n CREATE TABLE `stock` (\n
`uid` BIGINT UNSIGNED NOT NULL,\n `uid` BIGINT UNSIGNED NOT NULL,\n
`order_id` TINYINT UNSIGNED NOT NULL,\n
`node_uid` BIGINT UNSIGNED,\n `node_uid` BIGINT UNSIGNED,\n
`section_uid` BIGINT UNSIGNED,\n `section_uid` BIGINT UNSIGNED,\n
`payment_uid` BIGINT UNSIGNED,\n `payment_uid` BIGINT UNSIGNED,\n
...@@ -108,7 +109,7 @@ CREATE TABLE `stock` (\n ...@@ -108,7 +109,7 @@ CREATE TABLE `stock` (\n
`simulation_state` varchar(255) default \'\',\n `simulation_state` varchar(255) default \'\',\n
`variation_text` VARCHAR(255),\n `variation_text` VARCHAR(255),\n
`sub_variation_text` VARCHAR(255),\n `sub_variation_text` VARCHAR(255),\n
KEY `uid` (`uid`),\n PRIMARY KEY (`uid`, `order_id`),\n
KEY `quantity` (`quantity`),\n KEY `quantity` (`quantity`),\n
KEY `section_uid` (`section_uid`),\n KEY `section_uid` (`section_uid`),\n
KEY `node_uid` (`node_uid`),\n KEY `node_uid` (`node_uid`),\n
...@@ -165,6 +166,7 @@ CREATE TABLE `stock` (\n ...@@ -165,6 +166,7 @@ CREATE TABLE `stock` (\n
#\n #\n
CREATE TABLE `stock` (\n CREATE TABLE `stock` (\n
`uid` BIGINT UNSIGNED NOT NULL,\n `uid` BIGINT UNSIGNED NOT NULL,\n
`order_id` TINYINT UNSIGNED NOT NULL,\n
`node_uid` BIGINT UNSIGNED,\n `node_uid` BIGINT UNSIGNED,\n
`section_uid` BIGINT UNSIGNED,\n `section_uid` BIGINT UNSIGNED,\n
`payment_uid` BIGINT UNSIGNED,\n `payment_uid` BIGINT UNSIGNED,\n
...@@ -179,7 +181,7 @@ CREATE TABLE `stock` (\n ...@@ -179,7 +181,7 @@ CREATE TABLE `stock` (\n
`simulation_state` varchar(255) default \'\',\n `simulation_state` varchar(255) default \'\',\n
`variation_text` VARCHAR(255),\n `variation_text` VARCHAR(255),\n
`sub_variation_text` VARCHAR(255),\n `sub_variation_text` VARCHAR(255),\n
KEY `uid` (`uid`),\n PRIMARY KEY (`uid`, `order_id`),\n
KEY `quantity` (`quantity`),\n KEY `quantity` (`quantity`),\n
KEY `section_uid` (`section_uid`),\n KEY `section_uid` (`section_uid`),\n
KEY `node_uid` (`node_uid`),\n KEY `node_uid` (`node_uid`),\n
......
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