diff --git a/htdocs/commande/orderstoinvoice.php b/htdocs/commande/orderstoinvoice.php index bffc4530fff..60ce5d3b11b 100755 --- a/htdocs/commande/orderstoinvoice.php +++ b/htdocs/commande/orderstoinvoice.php @@ -129,6 +129,7 @@ if (($action == 'create' || $action == 'add') && empty($mesgs)) $lineid = GETPOST('lineid','int'); $userid = GETPOST('userid','int'); $search_ref = GETPOST('sf_ref')?GETPOST('sf_ref'):GETPOST('search_ref'); + $closeOrders = GETPOST('autocloseorders') != '' ? true : false; // Security check $fieldid = GETPOST('ref','alpha')?'facnumber':'rowid'; @@ -215,8 +216,10 @@ if (($action == 'create' || $action == 'add') && empty($mesgs)) $result=$srcobject->fetch($orders_id[$ii]); if ($result > 0) { - $srcobject->classer_facturee(); - $srcobject->setStatut(3); + if($closeOrders) { + $srcobject->classer_facturee(); + $srcobject->setStatut(3); + } $lines = $srcobject->lines; if (empty($lines) && method_exists($srcobject,'fetch_lines')) $lines = $srcobject->fetch_lines(); $fk_parent_line=0; @@ -383,6 +386,7 @@ if ($action == 'create') print ''; print ''; print ''; + print ''; print ''; // Ref print ''; @@ -402,6 +406,7 @@ if ($action == 'create') print $desc; print ''."\n"; print '
'.$langs->trans('Ref').''.$langs->trans('Draft').'
'; + // Date invoice print ''.$langs->trans('Date').''; $html->select_date(0,'','','','',"add",1,1); @@ -444,7 +449,7 @@ if ($action == 'create') $result=$srcobject->fetch($sel); if ($result > 0) { - $commandes.= $srcobject->ref." "; + $commandes.= $srcobject->ref.", "; } } print $commandes; @@ -462,8 +467,6 @@ if ($action == 'create') } print ''; - print ''; - while ($i < $n) { @@ -472,10 +475,12 @@ if ($action == 'create') $i++; } - print "\n"; // Button "Create Draft" - print '
'; + print '
'; print "\n"; + + print ''; + print "\n"; } @@ -667,7 +672,9 @@ if (($action != 'create' && $action != 'add') || ! empty($mesgs)) print ''; print '
'; print ''.$langs->trans("GoBack").''; - print ''; + print ''; + print '

'.$langs->trans("CloseProcessedOrdersAutomatically"); + print ''; print ''; $db->free($resql); } diff --git a/htdocs/langs/en_US/orders.lang b/htdocs/langs/en_US/orders.lang index cc63582c5ab..3aadefcf239 100644 --- a/htdocs/langs/en_US/orders.lang +++ b/htdocs/langs/en_US/orders.lang @@ -150,4 +150,7 @@ OrderByMail=Mail OrderByFax=Fax OrderByEMail=EMail OrderByWWW=Online -OrderByPhone=Phone \ No newline at end of file +OrderByPhone=Phone + +CreateInvoiceForThisCustomer=Create an invoice for several orders of this customer +CloseProcessedOrdersAutomatically=Classify "Processed" all selected orders. \ No newline at end of file diff --git a/htdocs/langs/fr_FR/orders.lang b/htdocs/langs/fr_FR/orders.lang index 329afb01a8d..d8c72f32201 100644 --- a/htdocs/langs/fr_FR/orders.lang +++ b/htdocs/langs/fr_FR/orders.lang @@ -152,3 +152,6 @@ OrderByFax=Fax OrderByEMail=EMail OrderByWWW=En ligne OrderByPhone=Téléphone + +CreateInvoiceForThisCustomer=Créer une facture à partir de plusieurs commande de ce client +CloseProcessedOrdersAutomatically=Classer automatiquement à "Traitées" les commandes sélectionnées. \ No newline at end of file