// stock : bug fix on supplier orders states change

This commit is contained in:
dSevere
2011-11-09 18:02:26 +00:00
parent 7cf3d8fdc1
commit fb2fe9b387
+2 -2
View File
@@ -151,10 +151,10 @@ class SupplierOrderStateCore extends ObjectModel
//check first if the order is editable
if ($is_editable)
$query->where('s.editable = 1 OR s.delivery_note = 1');
$query->where('s.editable = 1 OR s.delivery_note = 1 OR s.enclosed = 1');
//check if the delivery note is available or if the state correspond to a pending receipt state
else if ($is_delivery_note || $is_pending_receipt)
$query->where('s.delivery_note = 0 AND s.editable = 0');
$query->where('(s.delivery_note = 0 AND s.editable = 0) OR s.enclosed = 1');
//check if the state correspond to a receipt state
else if ($is_receipt_state)
$query->where('s.receipt_state = 1 OR s.enclosed = 1');