diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index 2b055f2368f..d51ec804614 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -2118,12 +2118,12 @@ else // Create bill and Classify billed if ($conf->facture->enabled && $object->statut > 0 && ! $object->billed) { - if ($user->rights->facture->creer) + if ($user->rights->facture->creer && empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) { print ''.$langs->trans("CreateBill").''; } - if ($user->rights->commande->creer && $object->statut > 2) + if ($user->rights->commande->creer && $object->statut > 2 && empty($conf->global->WORKFLOW_DISABLE_CLASSIFY_BILLED_FROM_ORDER)) { print ''.$langs->trans("ClassifyBilled").''; } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 03588f22f2c..abf670e58ce 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2069,9 +2069,9 @@ function info_admin($text,$infoonimgalt=0) * Toutefois, il faut essayer de ne l'appeler qu'au sein de pages php, les classes devant * renvoyer leur erreur par l'intermediaire de leur propriete "error". * - * @param DoliDB $db Database handler + * @param DoliDB $db Database handler * @param string $error String or array of errors strings to show - * @return void + * @return void * @see dol_htmloutput_errors */ function dol_print_error($db='',$error='') diff --git a/htdocs/expedition/fiche.php b/htdocs/expedition/fiche.php index fe66e772f3d..b07a02e1dc0 100644 --- a/htdocs/expedition/fiche.php +++ b/htdocs/expedition/fiche.php @@ -122,8 +122,9 @@ if ($action == 'add') { $ent = "entl".$i; $idl = "idl".$i; - $entrepot_id = GETPOST($ent,'int')?GETPOST($ent,'int'):GETPOST('entrepot_id','int'); - + $entrepot_id = is_numeric(GETPOST($ent,'int'))?GETPOST($ent,'int'):GETPOST('entrepot_id','int'); + if ($entrepot_id < 0) $entrepot_id=''; + $ret=$object->addline($entrepot_id,GETPOST($idl,'int'),GETPOST($qty,'int')); if ($ret < 0) { @@ -779,21 +780,19 @@ if ($action == 'create') print ''; if ($line->product_type == 0 || ! empty($conf->global->STOCK_SUPPORTS_SERVICES)) { - // Show warehous - if (GETPOST('entrepot_id','int')) + // Show warehouse combo list + $ent = "entl".$indiceAsked; + $idl = "idl".$indiceAsked; + $tmpentrepot_id = is_numeric(GETPOST($ent,'int'))?GETPOST($ent,'int'):GETPOST('entrepot_id','int'); + print $formproduct->selectWarehouses($tmpentrepot_id,'entl'.$indiceAsked,'',1,0,$line->fk_product); + if ($tmpentrepot_id && $tmpentrepot_id == GETPOST('entrepot_id','int')) { - print $formproduct->selectWarehouses(GETPOST('entrepot_id','int'),'entl'.$indiceAsked,'',1,0,$line->fk_product); //print $stock.' '.$quantityToBeDelivered; - //if ($stock >= 0 && $stock < $quantityToBeDelivered) if ($stock < $quantityToBeDelivered) { - print ' '.img_warning($langs->trans("StockTooLow")); + print ' '.img_warning($langs->trans("StockTooLow")); // Stock too low for entrepot_id but we may have change warehouse } } - else - { - print $formproduct->selectWarehouses('','entl'.$indiceAsked,'',1,0,$line->fk_product); - } } else { diff --git a/htdocs/product/class/html.formproduct.class.php b/htdocs/product/class/html.formproduct.class.php index 337db1219a7..aec1d5f65ea 100644 --- a/htdocs/product/class/html.formproduct.class.php +++ b/htdocs/product/class/html.formproduct.class.php @@ -120,7 +120,7 @@ class FormProduct $this->loadWarehouses($fk_product); $out='