Commit 79fe763c authored by Jérome Perrin's avatar Jérome Perrin

Revert "Revert "catalog/stock: avoid duplicate calls to...

Revert "Revert "catalog/stock: avoid duplicate calls to getInventoriatedQuantity and use better naming for variables""

This reverts commit 1356fe35.
parent c93a52e6
...@@ -10,7 +10,8 @@ WHERE ...@@ -10,7 +10,8 @@ WHERE
<dtml-let row_list="[]" uid_dict="{}"> <dtml-let row_list="[]" uid_dict="{}">
<dtml-in prefix="loop" expr="_.range(_.len(uid))"> <dtml-in prefix="loop" expr="_.range(_.len(uid))">
<dtml-if "not(isInventoryMovement[loop_item]) and isMovement[loop_item] and getResourceUid[loop_item]"> <dtml-if "not(isInventoryMovement[loop_item]) and isMovement[loop_item] and getResourceUid[loop_item]">
<dtml-in prefix="mov" expr="asMovementList[loop_item]" no_push_item> <dtml-in prefix="movement" expr="asMovementList[loop_item]" no_push_item>
<dtml-let movement_item_quantity="movement_item.getInventoriatedQuantity() or 0">
<dtml-if "getDestinationUid[loop_item]"> <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="uid_dict.update({uid[loop_item]: uid_dict.get(uid[loop_item], -1) + 1})">
<dtml-call expr="row_list.append([ <dtml-call expr="row_list.append([
...@@ -27,11 +28,11 @@ WHERE ...@@ -27,11 +28,11 @@ WHERE
getSourceSectionUid[loop_item], getSourceSectionUid[loop_item],
getSourceUid[loop_item], getSourceUid[loop_item],
getResourceUid[loop_item], getResourceUid[loop_item],
(mov_item.getInventoriatedQuantity() or 0), movement_item_quantity,
isCancellationAmount[loop_item], isCancellationAmount[loop_item],
isAccountable[loop_item], isAccountable[loop_item],
mov_item.getStopDate(), movement_item.getStopDate(),
mov_item.getStartDate(), movement_item.getStartDate(),
getDestinationInventoriatedTotalAssetPrice[loop_item], getDestinationInventoriatedTotalAssetPrice[loop_item],
getPortalType[loop_item], getPortalType[loop_item],
getSimulationState[loop_item], getSimulationState[loop_item],
...@@ -54,17 +55,18 @@ WHERE ...@@ -54,17 +55,18 @@ WHERE
getDestinationSectionUid[loop_item], getDestinationSectionUid[loop_item],
getDestinationUid[loop_item], getDestinationUid[loop_item],
getResourceUid[loop_item], getResourceUid[loop_item],
-(mov_item.getInventoriatedQuantity() or 0), -movement_item_quantity,
isCancellationAmount[loop_item], isCancellationAmount[loop_item],
isAccountable[loop_item], isAccountable[loop_item],
mov_item.getStartDate(), movement_item.getStartDate(),
mov_item.getStopDate(), movement_item.getStopDate(),
getSourceInventoriatedTotalAssetPrice[loop_item], getSourceInventoriatedTotalAssetPrice[loop_item],
getPortalType[loop_item], getPortalType[loop_item],
getSimulationState[loop_item], getSimulationState[loop_item],
getVariationText[loop_item], getVariationText[loop_item],
getSubVariationText[loop_item]])"> getSubVariationText[loop_item]])">
</dtml-if> </dtml-if>
</dtml-let>
</dtml-in> </dtml-in>
</dtml-if> </dtml-if>
</dtml-in> </dtml-in>
......
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