<dtml-comment>
title:
connection_id:MySQL
max_rows:100000
max_cache:100
cache_time:0
class_name:ZSQLBrain
class_file:zsqlbrain.py
</dtml-comment>
<params></params>
SELECT DISTINCT catalog.id, catalog.relative_url, catalog.path
FROM catalog, catalog as tissu, catalog as delivery, category, movement
WHERE catalog.uid=category.uid
AND tissu.uid = category.category_uid
AND tissu.portal_type = "Piece Tissu"
AND category.base_category_uid = <dtml-var "portal_categories.aggregate.uid">
AND movement.uid = catalog.uid
AND delivery.uid = movement.delivery_uid
AND ( delivery.portal_type = "xProduction Packing List"
OR delivery.portal_type = "xPurchase Packing List"
OR delivery.portal_type = "Inventory MP"
OR delivery.portal_type = "xMovement MP" )
AND delivery.relative_url like "inventaire_mp/10%"