diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 7362f30e5a8..f9fd3a716f5 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -232,6 +232,7 @@ if (empty($reshook)) { $datecommande = dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')); $datelivraison = dol_mktime(12, 0, 0, GETPOST('liv_month'), GETPOST('liv_day'), GETPOST('liv_year')); + $selectedLines = GETPOST('toselect'); if ($datecommande == '') { setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentities('Date')), null, 'errors'); @@ -338,6 +339,8 @@ if (empty($reshook)) for($i = 0; $i < $num; $i ++) { + if(!in_array($lines[$i]->id, $selectedLines)) continue; // Skip unselected lines + $label = (! empty($lines[$i]->label) ? $lines[$i]->label : ''); $desc = (! empty($lines[$i]->desc) ? $lines[$i]->desc : ''); $product_type = (! empty($lines[$i]->product_type) ? $lines[$i]->product_type : 0); @@ -1870,8 +1873,6 @@ if ($action == 'create' && $user->rights->commande->creer) print ''; print ''; - print ''; - // Show origin lines if (! empty($origin) && ! empty($originid) && is_object($objectsrc)) { $title = $langs->trans('ProductsAndServices'); @@ -1883,6 +1884,8 @@ if ($action == 'create' && $user->rights->commande->creer) print ''; } + + print ''; } else { // Mode view $now = dol_now(); diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 0a300476fb5..f3832ff2782 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -4145,7 +4145,7 @@ abstract class CommonObject */ public function printOriginLinesList($restrictlist = '') { - global $langs, $hookmanager, $conf; + global $langs, $hookmanager, $conf, $form; print '