// stock : update supplier orders interface + change state bug fix

This commit is contained in:
dSevere
2011-11-08 17:55:17 +00:00
parent 8a8c83d930
commit 43e1e225d7
8 changed files with 94 additions and 59 deletions
+4 -7
View File
@@ -151,16 +151,13 @@ class SupplierOrderStateCore extends ObjectModel
//check first if the order is editable
if ($is_editable)
$query->where('s.editable = 0');
//check if the delivery note is available
else if ($is_delivery_note)
$query->where('s.editable = 1 OR s.delivery_note = 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');
//check if the state correspond to a pending receipt state
else if ($is_pending_receipt)
$query->where('s.receipt_state = 1 OR (s.receipt_state = 0 AND s.pending_receipt = 0) AND s.delivery_note = 0 AND s.editable = 0');
//check if the state correspond to a receipt state
else if ($is_receipt_state)
$query->where('s.receipt_state = 1 OR (s.receipt_state = 0 AND s.pending_receipt = 0 AND s.delivery_note = 0 AND s.editable = 0)');
$query->where('s.receipt_state = 1 OR s.enclosed = 1');
}
return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($query);