diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index af87ef4f6ee..9a527ec1b2b 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -2517,7 +2517,8 @@ elseif (! empty($object->id)) print ''; //print ''; print '\n"; print "'; - print ''; - print ''; @@ -685,9 +685,9 @@ if ($id > 0 || ! empty($ref)) { // Warehouse print ''; } // date - print ''; + print ''; print "\n"; diff --git a/htdocs/fourn/js/lib_dispatch.js b/htdocs/fourn/js/lib_dispatch.js index 2b39c18cbb2..c92a4a6688c 100644 --- a/htdocs/fourn/js/lib_dispatch.js +++ b/htdocs/fourn/js/lib_dispatch.js @@ -32,10 +32,10 @@ function addDispatchLine(index, type, mode) { mode = mode || 'qtymissing' - console.log("Split line type="+type+" index="+index+" mode="+mode); - var $row = $("tr[name='"+type+'_0_'+index+"']").clone(true), // clone first batch line to jQuery object + console.log("fourn/js/lib_dispatch.js Split line type="+type+" index="+index+" mode="+mode); + var $row = $("tr[name='"+type+'_0_'+index+"']").clone(true), // clone first batch line to jQuery object nbrTrs = $("tr[name^='"+type+"_'][name$='_"+index+"']").length, // position of line for batch - qtyOrdered = parseFloat($("#qty_ordered_0_"+index).val()), // Qty ordered is same for all rows + qtyOrdered = parseFloat($("#qty_ordered_0_"+index).val()), // Qty ordered is same for all rows qty = parseFloat($("#qty_"+(nbrTrs - 1)+"_"+index).val()), qtyDispatched; @@ -62,8 +62,11 @@ function addDispatchLine(index, type, mode) $row.attr('name',type+'_'+nbrTrs+'_'+index); //insert new row before last row $("tr[name^='"+type+"_'][name$='_"+index+"']:last").after($row); + //remove cloned select2 with duplicate id. - $("#s2id_entrepot_"+nbrTrs+'_'+index).detach(); + $("#s2id_entrepot_"+nbrTrs+'_'+index).detach(); // old way to find duplicated select2 component + $(".csswarehouse_"+nbrTrs+"_"+index+":first-child").parents("span.selection").parents(".select2").detach(); + /* Suffix of lines are: _ trs.length _ index */ $("#qty_"+nbrTrs+"_"+index).focus(); $("#qty_dispatched_0_"+index).val(qtyDispatched);
'.$langs->trans("Receive").'
'.$langs->trans("DeliveryDate").''; - print $form->select_date('','',1,1,'',"commande",1,1,1); + $datepreselected = dol_now(); + print $form->select_date($datepreselected,'',1,1,'',"commande",1,1,1); print "
".$langs->trans("Delivery")."\n"; diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index c55183921f2..5951972dfd8 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -626,11 +626,11 @@ if ($id > 0 || ! empty($ref)) { print ''; print ''; print ''; + print ''; $dlcdatesuffix = dol_mktime(0, 0, 0, GETPOST('dlc' . $suffix . 'month'), GETPOST('dlc' . $suffix . 'day'), GETPOST('dlc' . $suffix . 'year')); $form->select_date($dlcdatesuffix, 'dlc' . $suffix, '', '', 1, ""); print ''; + print ''; $dluodatesuffix = dol_mktime(0, 0, 0, GETPOST('dluo' . $suffix . 'month'), GETPOST('dluo' . $suffix . 'day'), GETPOST('dluo' . $suffix . 'year')); $form->select_date($dluodatesuffix, 'dluo' . $suffix, '', '', 1, ""); print ''; if (count($listwarehouses) > 1) { - print $formproduct->selectWarehouses(GETPOST("entrepot" . $suffix)?GETPOST("entrepot" . $suffix):($objp->fk_default_warehouse?$objp->fk_default_warehouse:''), "entrepot" . $suffix, '', 1, 0, $objp->fk_product, '', 1); + print $formproduct->selectWarehouses(GETPOST("entrepot" . $suffix)?GETPOST("entrepot" . $suffix):($objp->fk_default_warehouse?$objp->fk_default_warehouse:''), "entrepot" . $suffix, '', 1, 0, $objp->fk_product, '', 1, 0, null, 'csswarehouse'.$suffix); } elseif (count($listwarehouses) == 1) { - print $formproduct->selectWarehouses(GETPOST("entrepot" . $suffix)?GETPOST("entrepot" . $suffix):($objp->fk_default_warehouse?$objp->fk_default_warehouse:''), "entrepot" . $suffix, '', 0, 0, $objp->fk_product, '', 1); + print $formproduct->selectWarehouses(GETPOST("entrepot" . $suffix)?GETPOST("entrepot" . $suffix):($objp->fk_default_warehouse?$objp->fk_default_warehouse:''), "entrepot" . $suffix, '', 0, 0, $objp->fk_product, '', 1, 0, null, 'csswarehouse'.$suffix); } else { $langs->load("errors"); print $langs->trans("ErrorNoWarehouseDefined"); @@ -852,7 +852,7 @@ if ($id > 0 || ! empty($ref)) { print '' . dol_print_date($objp->datec) . '' . dol_print_date($objp->datec, "dayhour") . '