diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php
index 2a0675806dc..b43a702c2f2 100644
--- a/htdocs/commande/card.php
+++ b/htdocs/commande/card.php
@@ -113,7 +113,7 @@ $permissionnote = $usercancreate; // Used by the include of actions_setnotes.inc
$permissiondellink = $usercancreate; // Used by the include of actions_dellink.inc.php
$permissiontoadd = $usercancreate; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
-if (!empty($conf->expedition->enabled) && $conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER = 1) {
+if (!empty($conf->expedition->enabled) && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER)) {
if (empty($object->warehouse_id) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE)) $object->warehouse_id = $conf->global->MAIN_DEFAULT_WAREHOUSE;
if (empty($object->warehouse_id) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE_USER)) $object->warehouse_id = $user->fk_warehouse;
}
@@ -1506,9 +1506,10 @@ if ($action == 'create' && $usercancreate)
if (!empty($origin) && !empty($originid)) {
// Parse element/subelement (ex: project_task)
$element = $subelement = $origin;
+ $regs = array();
if (preg_match('/^([^_]+)_([^_]+)/i', $origin, $regs)) {
- $element = $regs [1];
- $subelement = $regs [2];
+ $element = $regs[1];
+ $subelement = $regs[2];
}
if ($element == 'project') {
diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php
index 9ebc0b166dc..c39a5a05a13 100644
--- a/htdocs/commande/class/commande.class.php
+++ b/htdocs/commande/class/commande.class.php
@@ -3697,7 +3697,7 @@ class Commande extends CommonOrder
$label = '';
if ($user->rights->commande->lire) {
- $label = ''.$langs->trans("ShowOrder").'';
+ $label = ''.$langs->trans("Order").'';
$label .= '
'.$langs->trans('Ref').': '.$this->ref;
$label .= '
'.$langs->trans('RefCustomer').': '.($this->ref_customer ? $this->ref_customer : $this->ref_client);
if (!empty($this->total_ht)) {
@@ -3709,6 +3709,9 @@ class Commande extends CommonOrder
if (!empty($this->total_ttc)) {
$label .= '
'.$langs->trans('AmountTTC').': '.price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency);
}
+ if (isset($this->statut)) {
+ $label .= '
'.$langs->trans("Status").": ".$this->getLibStatut(5);
+ }
}
$linkclose = '';
@@ -3716,7 +3719,7 @@ class Commande extends CommonOrder
{
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
{
- $label = $langs->trans("ShowOrder");
+ $label = $langs->trans("Order");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
}
$linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php
index 43f45b10612..dda9bee327f 100644
--- a/htdocs/commande/list.php
+++ b/htdocs/commande/list.php
@@ -348,7 +348,7 @@ if ($search_user > 0) $sql .= " AND ec.fk_c_type_contact
if ($search_total_ht != '') $sql .= natural_search('c.total_ht', $search_total_ht, 1);
if ($search_total_vat != '') $sql .= natural_search('c.tva', $search_total_vat, 1);
if ($search_total_ttc != '') $sql .= natural_search('c.total_ttc', $search_total_ttc, 1);
-if ($search_warehouse != '') $sql .= natural_search('c.fk_warehouse', $search_warehouse, 1);
+if ($search_warehouse != '' && $search_warehouse != '-1') $sql .= natural_search('c.fk_warehouse', $search_warehouse, 1);
if ($search_multicurrency_code != '') $sql .= ' AND c.multicurrency_code = "'.$db->escape($search_multicurrency_code).'"';
if ($search_multicurrency_tx != '') $sql .= natural_search('c.multicurrency_tx', $search_multicurrency_tx, 1);
if ($search_multicurrency_montant_ht != '') $sql .= natural_search('c.multicurrency_total_ht', $search_multicurrency_montant_ht, 1);
@@ -603,7 +603,7 @@ if ($resql)
$moreforfilter .= $formother->select_categories('customer', $search_categ_cus, 'search_categ_cus', 1);
$moreforfilter .= '';
}
- if (!empty($conf->expedition->enabled) && $conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER = 1) {
+ if (!empty($conf->expedition->enabled) && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER)) {
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
$formproduct = new FormProduct($db);
$moreforfilter .= '