diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 5df73f49f5c..cd7ea1af73c 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -7496,7 +7496,7 @@ abstract class CommonObject if ($display_type == 'card') { $out .= ''; - if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER) && $action == 'view') { + if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER) && ($action == 'view' || $action == 'editline')) { $out .= ''; } $out .= 'transnoentitiesnoconv("QtyToShip").'/'.$langs->transnoentitiesnoconv("Warehouse")), null, 'errors'); + $labelfieldmissing = $langs->transnoentitiesnoconv("QtyToShip"); + if (!empty($conf->stock->enabled)) { + $labelfieldmissing .= '/'.$langs->transnoentitiesnoconv("Warehouse"); + } + setEventMessages($langs->trans("ErrorFieldRequired", $labelfieldmissing), null, 'errors'); $error++; } @@ -796,6 +800,10 @@ $help_url = 'EN:Module_Shipments|FR:Module_Expéditions|ES:Módulo_Expedic llxHeader('', $langs->trans('Shipment'), 'Expedition', $help_url); +if (empty($action)) { + $action = 'view'; +} + $form = new Form($db); $formfile = new FormFile($db); $formproduct = new FormProduct($db); @@ -1007,9 +1015,9 @@ if ($action == 'create') { $numAsked = count($object->lines); - print ''; + print 'return false; });'."\n"; + print 'jQuery("#autoreset").click(function() { console.log("Reset values to 0"); jQuery(".qtyl").val(0);'."\n"; + print 'return false; });'."\n"; + print '});'."\n"; + print ''."\n"; print '
'; @@ -1182,7 +1191,7 @@ if ($action == 'create') { $deliverableQty = GETPOST('qtyl'.$indiceAsked, 'int'); } print ''; - print ''; + print ''; } else { print $langs->trans("NA"); } @@ -2199,7 +2208,7 @@ if ($action == 'create') { if ($action == 'editline' && $lines[$i]->id == $line_id) { // edit mode - print ''; + print '
'; if (is_array($lines[$i]->detail_batch) && count($lines[$i]->detail_batch) > 0) { print ''; $line = new ExpeditionLigne($db); @@ -2389,10 +2398,11 @@ if ($action == 'create') { $line = $lines[$i]; $line->fetch_optionals(); + // TODO Show all in same line by setting $display_type = 'line' if ($action == 'editline' && $line->id == $line_id) { - print $lines[$i]->showOptionals($extrafields, 'edit', array('colspan'=>$colspan), $indiceAsked); + print $lines[$i]->showOptionals($extrafields, 'edit', array('colspan'=>$colspan), $indiceAsked, '', 0, 'card'); } else { - print $lines[$i]->showOptionals($extrafields, 'view', array('colspan'=>$colspan), $indiceAsked); + print $lines[$i]->showOptionals($extrafields, 'view', array('colspan'=>$colspan), $indiceAsked, '', 0, 'card'); } } }