Commit ac5ed2ff authored by Jean-Paul Smets's avatar Jean-Paul Smets

improved by JPS


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@296 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 75751936
...@@ -10,10 +10,12 @@ class_file:zsqlbrain.py ...@@ -10,10 +10,12 @@ class_file:zsqlbrain.py
<params>uid <params>uid
sort_on</params> sort_on</params>
SELECT SELECT
container_cell.uid, container_cell.Id, container_cell.path, container_cell.Description, movement.variation_text container_cell.uid, container_cell.Id, container_cell.path, container_cell.Description, movement.variation_text, movement.delivery_uid
FROM FROM
catalog AS container_cell, catalog AS container_line, movement catalog AS container_cell, catalog AS container_line, movement
WHERE WHERE
movement.delivery_uid = <dtml-sqlvar getDeliveryUid type="int">
AND
(( ((
container_cell.parent_uid = container_line.uid container_cell.parent_uid = container_line.uid
AND AND
......
...@@ -13,6 +13,8 @@ SELECT ...@@ -13,6 +13,8 @@ SELECT
FROM FROM
catalog AS container_cell, catalog AS container_line, movement catalog AS container_cell, catalog AS container_line, movement
WHERE WHERE
movement.delivery_uid = <dtml-sqlvar getDeliveryUid type="int">
AND
(( ((
container_cell.parent_uid = container_line.uid container_cell.parent_uid = container_line.uid
AND AND
......
...@@ -13,34 +13,15 @@ variation_text</params> ...@@ -13,34 +13,15 @@ variation_text</params>
SELECT SELECT
SUM(movement.target_quantity) AS target_quantity SUM(movement.target_quantity) AS target_quantity
FROM FROM
catalog AS container_cell, catalog AS container_line, catalog AS container, movement catalog AS container_cell, movement
WHERE WHERE
(( movement.delivery_uid = <dtml-sqlvar delivery_uid type="int">
container_cell.parent_uid = container_line.uid
AND
container_line.parent_uid = container.uid
AND
container.parent_uid = <dtml-sqlvar delivery_uid type="int">
AND
movement.uid = container_cell.uid
AND
container_cell.portal_type = "Container Cell"
)
OR
(
container_line.parent_uid = container.uid
AND
container.parent_uid = <dtml-sqlvar delivery_uid type="int">
AND
container_line.uid = container_cell.uid
AND
movement.uid = container_cell.uid
AND AND
movement.has_cell_content = 0 movement.has_cell_content = 0
AND AND
container_line.portal_type = "Container Line" container_cell.uid = movement.uid
)) AND
AND container_cell.portal_type <> "Container" (container_cell.portal_type = "Container Cell" OR container_cell.portal_type = "Container Line")
<dtml-if resource_uid> <dtml-if resource_uid>
AND movement.resource_uid = <dtml-sqlvar resource_uid type="int"> AND movement.resource_uid = <dtml-sqlvar resource_uid type="int">
</dtml-if> </dtml-if>
......
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