Commit 89f86f4c authored by Vincent Pelletier's avatar Vincent Pelletier

erp5_mysql_innodb: Improve coding style.

Remove trailing whitespaces.
Make it easier to extend the list of indexed columns without causing
unnecessary diffs (sadly, SQL being SQL, those lines will still cause
extra diffs).
parent bdf46eae
......@@ -8,7 +8,7 @@ REPLACE INTO
VALUES
<dtml-in prefix="loop" expr="_.range(_.len(uid))">
(
<dtml-sqlvar expr="uid[loop_item]" type="int">,
<dtml-sqlvar expr="uid[loop_item]" type="int">,
<dtml-sqlvar expr="security_uid[loop_item]" type="int">,
<dtml-sqlvar expr="getOwnerInfo[loop_item]['id']" type="string">,
<dtml-sqlvar expr="(getViewPermissionOwner[loop_item] is not None) and getViewPermissionOwner[loop_item] or ''" type="string" optional>,
......
......@@ -13,61 +13,63 @@ WHERE
<dtml-if "getDestinationUid[loop_item]">
<dtml-call expr="uid_dict.update({uid[loop_item]: uid_dict.get(uid[loop_item], -1) + 1})">
<dtml-call expr="row_list.append([
uid[loop_item],
uid[loop_item],
uid_dict[uid[loop_item]],
getExplanationUid[loop_item],
getDestinationUid[loop_item],
getDestinationSectionUid[loop_item],
getDestinationPaymentUid[loop_item],
getDestinationFunctionUid[loop_item],
getDestinationProjectUid[loop_item],
getDestinationFundingUid[loop_item],
getDestinationProjectUid[loop_item],
getDestinationFundingUid[loop_item],
getLedgerUid[loop_item],
getDestinationPaymentRequestUid[loop_item],
getSourceSectionUid[loop_item],
getSourceUid[loop_item],
getDestinationPaymentRequestUid[loop_item],
getSourceSectionUid[loop_item],
getSourceUid[loop_item],
getResourceUid[loop_item],
movement_item_quantity,
isCancellationAmount[loop_item],
isAccountable[loop_item],
movement_item.getStopDate(),
movement_item.getStartDate(),
getDestinationInventoriatedTotalAssetPrice[loop_item],
getPortalType[loop_item],
getSimulationState[loop_item],
getDestinationInventoriatedTotalAssetPrice[loop_item],
getPortalType[loop_item],
getSimulationState[loop_item],
getVariationText[loop_item],
getSubVariationText[loop_item]])">
getSubVariationText[loop_item],
])">
</dtml-if>
<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="row_list.append([
uid[loop_item],
uid[loop_item],
uid_dict[uid[loop_item]],
getExplanationUid[loop_item],
getSourceUid[loop_item],
getSourceSectionUid[loop_item],
getSourcePaymentUid[loop_item],
getSourceFunctionUid[loop_item],
getSourceProjectUid[loop_item],
getSourceFundingUid[loop_item],
getSourceProjectUid[loop_item],
getSourceFundingUid[loop_item],
getLedgerUid[loop_item],
getSourcePaymentRequestUid[loop_item],
getDestinationSectionUid[loop_item],
getDestinationUid[loop_item],
getSourcePaymentRequestUid[loop_item],
getDestinationSectionUid[loop_item],
getDestinationUid[loop_item],
getResourceUid[loop_item],
-movement_item_quantity,
isCancellationAmount[loop_item],
isAccountable[loop_item],
movement_item.getStartDate(),
movement_item.getStopDate(),
getSourceInventoriatedTotalAssetPrice[loop_item],
getPortalType[loop_item],
getSimulationState[loop_item],
getSourceInventoriatedTotalAssetPrice[loop_item],
getPortalType[loop_item],
getSimulationState[loop_item],
getVariationText[loop_item],
getSubVariationText[loop_item]])">
getSubVariationText[loop_item],
])">
</dtml-if>
</dtml-let>
</dtml-in>
</dtml-in>
</dtml-if>
</dtml-in>
......@@ -107,8 +109,8 @@ VALUES
<dtml-sqlvar expr="row_item[1]" type="int">,
<dtml-sqlvar expr="row_item[2]" type="int" optional>,
<dtml-sqlvar expr="row_item[3]" type="int">,
<dtml-sqlvar expr="row_item[4]" type="int" optional>,
<dtml-sqlvar expr="row_item[5]" type="int" optional>,
<dtml-sqlvar expr="row_item[4]" type="int" optional>,
<dtml-sqlvar expr="row_item[5]" type="int" optional>,
<dtml-sqlvar expr="row_item[6]" type="int" optional>,
<dtml-sqlvar expr="row_item[7]" type="int" optional>,
<dtml-sqlvar expr="row_item[8]" type="int" optional>,
......
......@@ -3,7 +3,7 @@
<dtml-if "not(isInventoryMovement[loop_item]) and isMovement[loop_item] and getResourceUid[loop_item]">
<dtml-if "getDestinationUid[loop_item]">
<dtml-call expr="row_list.append([
uid[loop_item],
uid[loop_item],
order_id[loop_item],
getExplanationUid[loop_item],
getDestinationUid[loop_item],
......@@ -20,17 +20,18 @@
getInventoriatedQuantity[loop_item],
isCancellationAmount[loop_item],
isAccountable[loop_item],
getStopDate[loop_item],
getStartDate[loop_item],
getDestinationInventoriatedTotalAssetPrice[loop_item],
getPortalType[loop_item],
getSimulationState[loop_item],
getStopDate[loop_item],
getStartDate[loop_item],
getDestinationInventoriatedTotalAssetPrice[loop_item],
getPortalType[loop_item],
getSimulationState[loop_item],
getVariationText[loop_item],
getSubVariationText[loop_item]])">
getSubVariationText[loop_item],
])">
</dtml-if>
<dtml-if "getSourceUid[loop_item]">
<dtml-call expr="row_list.append([
uid[loop_item],
uid[loop_item],
mirror_order_id[loop_item],
getExplanationUid[loop_item],
getSourceUid[loop_item],
......@@ -44,19 +45,20 @@
getDestinationSectionUid[loop_item],
getDestinationUid[loop_item],
getResourceUid[loop_item],
-(getInventoriatedQuantity[loop_item] or 0),
-(getInventoriatedQuantity[loop_item] or 0),
isCancellationAmount[loop_item],
isAccountable[loop_item],
getStartDate[loop_item],
getStartDate[loop_item],
getStopDate[loop_item],
getSourceInventoriatedTotalAssetPrice[loop_item],
getPortalType[loop_item],
getSimulationState[loop_item],
getSourceInventoriatedTotalAssetPrice[loop_item],
getPortalType[loop_item],
getSimulationState[loop_item],
getVariationText[loop_item],
getSubVariationText[loop_item]])">
getSubVariationText[loop_item],
])">
</dtml-if>
</dtml-if>
</dtml-in>
</dtml-in>
<dtml-if "row_list">
INSERT INTO
stock
......@@ -67,8 +69,8 @@ VALUES
<dtml-sqlvar expr="row_item[1]" type="int">,
<dtml-sqlvar expr="row_item[2]" type="int" optional>,
<dtml-sqlvar expr="row_item[3]" type="int">,
<dtml-sqlvar expr="row_item[4]" type="int" optional>,
<dtml-sqlvar expr="row_item[5]" type="int" optional>,
<dtml-sqlvar expr="row_item[4]" type="int" optional>,
<dtml-sqlvar expr="row_item[5]" type="int" optional>,
<dtml-sqlvar expr="row_item[6]" type="int" optional>,
<dtml-sqlvar expr="row_item[7]" type="int" optional>,
<dtml-sqlvar expr="row_item[8]" type="int" optional>,
......
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