Commit c187bfe0 authored by Alexandre Boeglin's avatar Alexandre Boeglin

Jean-Paul extended the stock table.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@2714 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent aa0db4fe
...@@ -15,8 +15,15 @@ getDestinationUid ...@@ -15,8 +15,15 @@ getDestinationUid
getSourceSectionUid getSourceSectionUid
getDestinationSectionUid getDestinationSectionUid
isMovement isMovement
getSourceTotalAssetPrice getSourcePaymentUid
getDestinationTotalAssetPrice</params> getDestinationPaymentUid
getSimulationState
getPrice
getStartDate
getStopDate
isAccountable
getPortalType
getVariationText</params>
<dtml-if isMovement> <dtml-if isMovement>
<dtml-if getResourceUid> <dtml-if getResourceUid>
<dtml-if getDestinationUid> <dtml-if getDestinationUid>
...@@ -27,10 +34,16 @@ VALUES ...@@ -27,10 +34,16 @@ VALUES
<dtml-sqlvar uid type="int">, <dtml-sqlvar uid type="int">,
<dtml-sqlvar getDestinationUid type="int">, <dtml-sqlvar getDestinationUid type="int">,
<dtml-if getDestinationSectionUid><dtml-sqlvar getDestinationSectionUid type="int"><dtml-else>NULL</dtml-if>, <dtml-if getDestinationSectionUid><dtml-sqlvar getDestinationSectionUid type="int"><dtml-else>NULL</dtml-if>,
<dtml-if getDestinationPaymentUid><dtml-sqlvar getDestinationPaymentUid type="int"><dtml-else>NULL</dtml-if>,
<dtml-if getSourceSectionUid><dtml-sqlvar getSourceSectionUid type="int"><dtml-else>NULL</dtml-if>, <dtml-if getSourceSectionUid><dtml-sqlvar getSourceSectionUid type="int"><dtml-else>NULL</dtml-if>,
<dtml-sqlvar getResourceUid type="int">, <dtml-sqlvar getResourceUid type="int">,
<dtml-if getInventoriatedQuantity><dtml-sqlvar "-getInventoriatedQuantity" type="float"><dtml-else>NULL</dtml-if>, <dtml-if getInventoriatedQuantity><dtml-sqlvar "-getInventoriatedQuantity" type="float"><dtml-else>NULL</dtml-if>,
<dtml-if getDestinationTotalAssetPrice><dtml-sqlvar getDestinationTotalAssetPrice type="float"><dtml-else>NULL</dtml-if> <dtml-if getStopDate><dtml-sqlvar getStopDate type="string"><dtml-else>NULL</dtml-if>,
<dtml-if getPrice><dtml-sqlvar getPrice type="float"><dtml-else>NULL</dtml-if>,
<dtml-if isAccountable><dtml-sqlvar isAccountable type="int"><dtml-else>NULL</dtml-if>,
<dtml-if getPortalType><dtml-sqlvar getPortalType type="string"><dtml-else>NULL</dtml-if>,
<dtml-if getSimulationState><dtml-sqlvar getSimulationState type="string"><dtml-else>NULL</dtml-if>,
<dtml-if "getVariationText is not None"><dtml-sqlvar getVariationText type="string"><dtml-else>NULL</dtml-if>
) )
<dtml-if getSourceUid> <dtml-if getSourceUid>
, ,
...@@ -38,10 +51,16 @@ VALUES ...@@ -38,10 +51,16 @@ VALUES
<dtml-sqlvar uid type="int">, <dtml-sqlvar uid type="int">,
<dtml-sqlvar getSourceUid type="int">, <dtml-sqlvar getSourceUid type="int">,
<dtml-if getSourceSectionUid><dtml-sqlvar getSourceSectionUid type="int"><dtml-else>NULL</dtml-if>, <dtml-if getSourceSectionUid><dtml-sqlvar getSourceSectionUid type="int"><dtml-else>NULL</dtml-if>,
<dtml-if getSourcePaymentUid><dtml-sqlvar getSourcePaymentUid type="int"><dtml-else>NULL</dtml-if>,
<dtml-if getDestinationSectionUid><dtml-sqlvar getDestinationSectionUid type="int"><dtml-else>NULL</dtml-if>, <dtml-if getDestinationSectionUid><dtml-sqlvar getDestinationSectionUid type="int"><dtml-else>NULL</dtml-if>,
<dtml-sqlvar getResourceUid type="int">, <dtml-sqlvar getResourceUid type="int">,
<dtml-if getInventoriatedQuantity><dtml-sqlvar "getInventoriatedQuantity" type="float"><dtml-else>NULL</dtml-if>, <dtml-if getInventoriatedQuantity><dtml-sqlvar "getInventoriatedQuantity" type="float"><dtml-else>NULL</dtml-if>,
<dtml-if getSourceTotalAssetPrice><dtml-sqlvar getSourceTotalAssetPrice type="float"><dtml-else>NULL</dtml-if> <dtml-if getStartDate><dtml-sqlvar getStartDate type="string"><dtml-else>NULL</dtml-if>,
<dtml-if getPrice><dtml-sqlvar getPrice type="float"><dtml-else>NULL</dtml-if>,
<dtml-if isAccountable><dtml-sqlvar isAccountable type="int"><dtml-else>NULL</dtml-if>,
<dtml-if getPortalType><dtml-sqlvar getPortalType type="string"><dtml-else>NULL</dtml-if>,
<dtml-if getSimulationState><dtml-sqlvar getSimulationState type="string"><dtml-else>NULL</dtml-if>,
<dtml-if "getVariationText is not None"><dtml-sqlvar getVariationText type="string"><dtml-else>NULL</dtml-if>
) )
</dtml-if> </dtml-if>
<dtml-else> <dtml-else>
...@@ -53,10 +72,16 @@ VALUES ...@@ -53,10 +72,16 @@ VALUES
<dtml-sqlvar uid type="int">, <dtml-sqlvar uid type="int">,
<dtml-sqlvar getSourceUid type="int">, <dtml-sqlvar getSourceUid type="int">,
<dtml-if getSourceSectionUid><dtml-sqlvar getSourceSectionUid type="int"><dtml-else>NULL</dtml-if>, <dtml-if getSourceSectionUid><dtml-sqlvar getSourceSectionUid type="int"><dtml-else>NULL</dtml-if>,
<dtml-if getSourcePaymentUid><dtml-sqlvar getSourcePaymentUid type="int"><dtml-else>NULL</dtml-if>,
<dtml-if getDestinationSectionUid><dtml-sqlvar getDestinationSectionUid type="int"><dtml-else>NULL</dtml-if>, <dtml-if getDestinationSectionUid><dtml-sqlvar getDestinationSectionUid type="int"><dtml-else>NULL</dtml-if>,
<dtml-sqlvar getResourceUid type="int">, <dtml-sqlvar getResourceUid type="int">,
<dtml-if getInventoriatedQuantity><dtml-sqlvar "getInventoriatedQuantity" type="float"><dtml-else>NULL</dtml-if>, <dtml-if getInventoriatedQuantity><dtml-sqlvar "getInventoriatedQuantity" type="float"><dtml-else>NULL</dtml-if>,
<dtml-if getSourceTotalAssetPrice><dtml-sqlvar getSourceTotalAssetPrice type="float"><dtml-else>NULL</dtml-if> <dtml-if getStartDate><dtml-sqlvar getStartDate type="string"><dtml-else>NULL</dtml-if>,
<dtml-if getPrice><dtml-sqlvar getPrice type="float"><dtml-else>NULL</dtml-if>,
<dtml-if isAccountable><dtml-sqlvar isAccountable type="int"><dtml-else>NULL</dtml-if>,
<dtml-if getPortalType><dtml-sqlvar getPortalType type="string"><dtml-else>NULL</dtml-if>,
<dtml-if getSimulationState><dtml-sqlvar getSimulationState type="string"><dtml-else>NULL</dtml-if>,
<dtml-if "getVariationText is not None"><dtml-sqlvar getVariationText type="string"><dtml-else>NULL</dtml-if>
) )
</dtml-if> </dtml-if>
</dtml-if> </dtml-if>
......
...@@ -15,17 +15,24 @@ getDestinationUid ...@@ -15,17 +15,24 @@ getDestinationUid
getSourceSectionUid getSourceSectionUid
getDestinationSectionUid getDestinationSectionUid
isMovement isMovement
getSourceTotalAssetPrice getSourcePaymentUid
getDestinationTotalAssetPrice</params> getDestinationPaymentUid
getSimulationState
getPrice
getStartDate
getStopDate
isAccountable
getPortalType
getVariationText</params>
<dtml-let row_list="[]"> <dtml-let row_list="[]">
<dtml-in prefix="loop" expr="_.range(_.len(uid))"> <dtml-in prefix="loop" expr="_.range(_.len(uid))">
<dtml-if "isMovement[loop_item]"> <dtml-if "isMovement[loop_item]">
<dtml-if "getResourceUid[loop_item]"> <dtml-if "getResourceUid[loop_item]">
<dtml-if "getDestinationUid[loop_item]"> <dtml-if "getDestinationUid[loop_item]">
<dtml-call expr="row_list.append([uid[loop_item], getDestinationUid[loop_item], getDestinationSectionUid[loop_item], getSourceSectionUid[loop_item], getResourceUid[loop_item], -getInventoriatedQuantity[loop_item], getDestinationTotalAssetPrice[loop_item]])"> <dtml-call expr="row_list.append([uid[loop_item], getDestinationUid[loop_item], getDestinationSectionUid[loop_item], getDestinationPaymentUid[loop_item], getSourceSectionUid[loop_item], getResourceUid[loop_item], -getInventoriatedQuantity[loop_item], getStopDate[loop_item], getPrice[loop_item], isAccountable[loop_item], getPortalType[loop_item], getSimulationState[loop_item], getVariationText[loop_item]])">
</dtml-if> </dtml-if>
<dtml-if "getSourceUid[loop_item]"> <dtml-if "getSourceUid[loop_item]">
<dtml-call expr="row_list.append([uid[loop_item], getSourceUid[loop_item], getSourceSectionUid[loop_item], getDestinationSectionUid[loop_item], getResourceUid[loop_item], getInventoriatedQuantity[loop_item], getSourceTotalAssetPrice[loop_item]])"> <dtml-call expr="row_list.append([uid[loop_item], getSourceUid[loop_item], getSourceSectionUid[loop_item], getSourcePaymentUidList[loop_item], getDestinationSectionUid[loop_item], getResourceUid[loop_item], getInventoriatedQuantity[loop_item], getStartDate[loop_item], getPrice[loop_item], isAccountable[loop_item], getPortalType[loop_item], getSimulationState[loop_item], getVariationText[loop_item]])">
</dtml-if> </dtml-if>
</dtml-if> </dtml-if>
</dtml-if> </dtml-if>
...@@ -41,9 +48,15 @@ VALUES ...@@ -41,9 +48,15 @@ VALUES
<dtml-sqlvar expr="row_item[1]" type="int">, <dtml-sqlvar expr="row_item[1]" type="int">,
<dtml-sqlvar expr="row_item[2]" type="int" optional>, <dtml-sqlvar expr="row_item[2]" type="int" optional>,
<dtml-sqlvar expr="row_item[3]" type="int" optional>, <dtml-sqlvar expr="row_item[3]" type="int" optional>,
<dtml-sqlvar expr="row_item[4]" type="int">, <dtml-sqlvar expr="row_item[4]" type="int" optional>,
<dtml-sqlvar expr="row_item[5]" type="float" optional>, <dtml-sqlvar expr="row_item[5]" type="int">,
<dtml-sqlvar expr="row_item[6]" type="float" optional> <dtml-sqlvar expr="row_item[6]" type="float" optional>,
<dtml-sqlvar expr="row_item[7]" type="string" optional>
<dtml-sqlvar expr="row_item[8]" type="float" optional>
<dtml-sqlvar expr="row_item[9]" type="int" optional>
<dtml-sqlvar expr="row_item[10]" type="string" optional>
<dtml-sqlvar expr="row_item[11]" type="string" optional>
<dtml-sqlvar expr="row_item[12]" type="string" optional>
) )
<dtml-if sequence-end><dtml-else>,</dtml-if> <dtml-if sequence-end><dtml-else>,</dtml-if>
</dtml-in> </dtml-in>
......
...@@ -16,16 +16,24 @@ CREATE TABLE `stock` ( ...@@ -16,16 +16,24 @@ CREATE TABLE `stock` (
`uid` int(11) NOT NULL default '0', `uid` int(11) NOT NULL default '0',
`node_uid` int(11), `node_uid` int(11),
`section_uid` int(11), `section_uid` int(11),
`payment_uid` int(11),
`mirror_section_uid` int(11), `mirror_section_uid` int(11),
`resource_uid` int(11), `resource_uid` int(11),
`quantity` real , `quantity` real ,
`total_asset_price` real , `date` datetime,
`price` real ,
`is_accountable` bool,
`portal_type` VARCHAR(30),
`simulation_state` varchar(30) default '',
`variation_text` VARCHAR(100),
KEY `uid` (`uid`), KEY `uid` (`uid`),
KEY `quantity` (`quantity`), KEY `quantity` (`quantity`),
KEY `section_uid` (`section_uid`), KEY `section_uid` (`section_uid`),
KEY `mirror_section_uid` (`mirror_section_uid`), KEY `mirror_section_uid` (`mirror_section_uid`),
KEY `node_uid` (`node_uid`), KEY `node_uid` (`node_uid`),
KEY `payment_uid` (`payment_uid`),
KEY `resource_uid` (`resource_uid`), KEY `resource_uid` (`resource_uid`),
KEY `simulation_state` (`simulation_state`),
KEY `resource_node_uid` (`resource_uid`, `node_uid`), KEY `resource_node_uid` (`resource_uid`, `node_uid`),
KEY `resource_section_node_uid` (`resource_uid`, `section_uid`, `node_uid`) KEY `resource_section_node_uid` (`resource_uid`, `section_uid`, `node_uid`, `simulation_state`)
) TYPE = InnoDB; ) TYPE = InnoDB;
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