Commit 5afb0020 authored by Jérome Perrin's avatar Jérome Perrin

bank_reconciliation: add bank reconciliation columns in stock table

Instead of using the related keys that can be slow, use a column
directly in stock table.
parent 15c16be5
<key_list>
<key>aggregate_bank_reconciliation_date | category,catalog,delivery/stop_date/z_related_aggregate_bank_reconciliation</key>
<key>aggregate_bank_reconciliation_uid | category,catalog/uid/z_related_aggregate_bank_reconciliation</key>
</key_list>
\ No newline at end of file
aggregate_bank_reconciliation_uid | category,catalog/uid/z_related_aggregate_bank_reconciliation
aggregate_bank_reconciliation_date | category,catalog,delivery/stop_date/z_related_aggregate_bank_reconciliation
\ No newline at end of file
<key_list> <key_list>
<key>aggregate_bank_reconciliation_date</key>
<key>alarm.alarm_date</key> <key>alarm.alarm_date</key>
<key>alarm_date</key> <key>alarm_date</key>
<key>catalog.creation_date</key> <key>catalog.creation_date</key>
...@@ -24,6 +25,7 @@ ...@@ -24,6 +25,7 @@
<key>start_date</key> <key>start_date</key>
<key>start_date_range_max</key> <key>start_date_range_max</key>
<key>start_date_range_min</key> <key>start_date_range_min</key>
<key>stock.aggregate_bank_reconciliation_date</key>
<key>stock.date</key> <key>stock.date</key>
<key>stock.mirror_date</key> <key>stock.mirror_date</key>
<key>stop_date</key> <key>stop_date</key>
......
...@@ -36,7 +36,10 @@ WHERE ...@@ -36,7 +36,10 @@ WHERE
getPortalType[loop_item], getPortalType[loop_item],
getSimulationState[loop_item], getSimulationState[loop_item],
getVariationText[loop_item], getVariationText[loop_item],
getSubVariationText[loop_item]])"> getSubVariationText[loop_item],
Movement_getDestinationAggregateBankReconciliationUid[loop_item],
Movement_getDestinationAggregateBankReconciliationDate[loop_item],
])">
</dtml-if> </dtml-if>
<dtml-if "getSourceUid[loop_item]"> <dtml-if "getSourceUid[loop_item]">
<dtml-call expr="uid_dict.update({uid[loop_item]: uid_dict.get(uid[loop_item], -1) + 1})"> <dtml-call expr="uid_dict.update({uid[loop_item]: uid_dict.get(uid[loop_item], -1) + 1})">
...@@ -64,7 +67,10 @@ WHERE ...@@ -64,7 +67,10 @@ WHERE
getPortalType[loop_item], getPortalType[loop_item],
getSimulationState[loop_item], getSimulationState[loop_item],
getVariationText[loop_item], getVariationText[loop_item],
getSubVariationText[loop_item]])"> getSubVariationText[loop_item],
Movement_getSourceAggregateBankReconciliationUid[loop_item],
Movement_getSourceAggregateBankReconciliationDate[loop_item],
])">
</dtml-if> </dtml-if>
</dtml-let> </dtml-let>
</dtml-in> </dtml-in>
...@@ -98,7 +104,9 @@ INSERT INTO ...@@ -98,7 +104,9 @@ INSERT INTO
`portal_type`, `portal_type`,
`simulation_state`, `simulation_state`,
`variation_text`, `variation_text`,
`sub_variation_text` `sub_variation_text`,
`aggregate_bank_reconciliation_uid`,
`aggregate_bank_reconciliation_date`
) )
VALUES VALUES
<dtml-in prefix="row" expr="row_list"> <dtml-in prefix="row" expr="row_list">
...@@ -126,7 +134,9 @@ VALUES ...@@ -126,7 +134,9 @@ VALUES
<dtml-sqlvar expr="row_item[20]" type="string" optional>, <dtml-sqlvar expr="row_item[20]" type="string" optional>,
<dtml-sqlvar expr="row_item[21]" type="string" optional>, <dtml-sqlvar expr="row_item[21]" type="string" optional>,
<dtml-sqlvar expr="row_item[22]" type="string" optional>, <dtml-sqlvar expr="row_item[22]" type="string" optional>,
<dtml-sqlvar expr="row_item[23]" type="string" optional> <dtml-sqlvar expr="row_item[23]" type="string" optional>,
<dtml-sqlvar expr="row_item[24]" type="int" optional>,
<dtml-sqlvar expr="row_item[25]" type="datetime" optional>
) )
<dtml-if sequence-end><dtml-else>,</dtml-if> <dtml-if sequence-end><dtml-else>,</dtml-if>
</dtml-in> </dtml-in>
......
...@@ -17,6 +17,10 @@ ...@@ -17,6 +17,10 @@
<value> <string>uid\r\n <value> <string>uid\r\n
getExplanationUid\r\n getExplanationUid\r\n
getResourceUid\r\n getResourceUid\r\n
Movement_getSourceAggregateBankReconciliationUid\r\n
Movement_getSourceAggregateBankReconciliationDate\r\n
Movement_getDestinationAggregateBankReconciliationUid\r\n
Movement_getDestinationAggregateBankReconciliationDate\r\n
getInventoriatedQuantity\r\n getInventoriatedQuantity\r\n
getSourceUid\r\n getSourceUid\r\n
getDestinationUid\r\n getDestinationUid\r\n
......
...@@ -17,6 +17,8 @@ CREATE TABLE `stock` ( ...@@ -17,6 +17,8 @@ CREATE TABLE `stock` (
`mirror_section_uid` BIGINT UNSIGNED, `mirror_section_uid` BIGINT UNSIGNED,
`mirror_node_uid` BIGINT UNSIGNED, `mirror_node_uid` BIGINT UNSIGNED,
`resource_uid` BIGINT UNSIGNED, `resource_uid` BIGINT UNSIGNED,
`aggregate_bank_reconciliation_uid` BIGINT UNSIGNED,
`aggregate_bank_reconciliation_date` datetime,
`quantity` real, `quantity` real,
`is_cancellation` BOOLEAN, `is_cancellation` BOOLEAN,
`is_accountable` BOOLEAN, `is_accountable` BOOLEAN,
......
...@@ -23,6 +23,8 @@ start_date_range_max ...@@ -23,6 +23,8 @@ start_date_range_max
start_date_range_min start_date_range_min
stock.date stock.date
stock.mirror_date stock.mirror_date
aggregate_bank_reconciliation_date
stock.aggregate_bank_reconciliation_date
stop_date stop_date
stop_date_range_max stop_date_range_max
stop_date_range_min stop_date_range_min
......
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