From 9add3ce4d1855fb2b1892b67f6a766ec20a74bed Mon Sep 17 00:00:00 2001
From: Jean-Paul Smets <jp@nexedi.com>
Date: Fri, 23 Jan 2004 16:08:20 +0000
Subject: [PATCH] improved

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@297 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/Coramy/skins/coramy_trade/Container_fastInput.py  | 2 +-
 .../skins/coramy_trade/Container_fastInputForm.form       | 2 +-
 product/Coramy/skins/coramy_trade/Order_heavyControl.py   | 7 +++++++
 .../skins/coramy_trade/condition_vente_sql_search.zsql    | 8 ++++++++
 4 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/product/Coramy/skins/coramy_trade/Container_fastInput.py b/product/Coramy/skins/coramy_trade/Container_fastInput.py
index 11572ade1b..22cfc1d965 100755
--- a/product/Coramy/skins/coramy_trade/Container_fastInput.py
+++ b/product/Coramy/skins/coramy_trade/Container_fastInput.py
@@ -49,7 +49,7 @@ for colis_nb in range(quantity) :
   container.flushActivity(invoke=1)
 
   # print container label
-  container.Container_printMetoLabel()
+  container.Container_printLabel()
 
   # now build container_lines
   for key in desired_lines.keys() :
diff --git a/product/Coramy/skins/coramy_trade/Container_fastInputForm.form b/product/Coramy/skins/coramy_trade/Container_fastInputForm.form
index 5f554d1a28..f3accf75af 100755
--- a/product/Coramy/skins/coramy_trade/Container_fastInputForm.form
+++ b/product/Coramy/skins/coramy_trade/Container_fastInputForm.form
@@ -145,7 +145,7 @@
           <hidden type="int">0</hidden>
           <lines type="int">100</lines>
           <list_action>folder_contents</list_action>
-          <list_method type="method">Delivery_zGetCellList</list_method>
+          <list_method type="method">Delivery_zGetNeededCellList</list_method>
           <meta_types type="list">[]</meta_types>
           <portal_types type="list">[]</portal_types>
           <report_root_list type="list">[]</report_root_list>
diff --git a/product/Coramy/skins/coramy_trade/Order_heavyControl.py b/product/Coramy/skins/coramy_trade/Order_heavyControl.py
index d70386a4c1..54ed798e82 100755
--- a/product/Coramy/skins/coramy_trade/Order_heavyControl.py
+++ b/product/Coramy/skins/coramy_trade/Order_heavyControl.py
@@ -17,6 +17,13 @@ movement_list = []
 # first make light control
 error_message = order.Order_lightControl()
 
+# Check each movement
+for m in context.getMovementList():
+  if m.getPrice() in (None, '') :
+    error_message += 'Prix manquant: produit %s ou variante %s' % (m.getResource(), m.getVariationText())
+  if m.getQuantity() in (None, '') :
+    error_message += 'Quantité manquante: produit %s ou variante %s' % (m.getResource(), m.getVariationText())
+
 # then check every simulation_movement in relation with the order :
 if order.getPortalType() == 'Purchase Order' :
   filter_dict = {'portal_type': 'Purchase Order Line'}
diff --git a/product/Coramy/skins/coramy_trade/condition_vente_sql_search.zsql b/product/Coramy/skins/coramy_trade/condition_vente_sql_search.zsql
index 9aac9b85c5..6a39f0ad00 100755
--- a/product/Coramy/skins/coramy_trade/condition_vente_sql_search.zsql
+++ b/product/Coramy/skins/coramy_trade/condition_vente_sql_search.zsql
@@ -25,6 +25,11 @@ FROM catalog AS condition
 <dtml-if expr="group_uid<>''">
 , category as cat4
 </dtml-if>
+<dtml-if expr="destination_uid==''">
+LEFT JOIN category as cat2
+ON (cat2.uid=condition.uid
+AND cat2.base_category_uid = <dtml-var "portal_categories.destination.uid">)
+</dtml-if>
 WHERE condition.portal_type="Condition Vente"
 
 <dtml-if expr="source_section_uid<>''">
@@ -38,6 +43,9 @@ AND condition.uid = cat2.uid
 AND cat2.category_uid = "<dtml-var destination_uid>"
 AND cat2.base_category_uid = <dtml-var "portal_categories.destination.uid">
 </dtml-if>
+<dtml-if expr="destination_uid==''">
+AND cat2.uid IS NULL
+</dtml-if>
 
 <dtml-if expr="group_uid<>''">
 AND condition.uid = cat4.uid
-- 
2.30.9