diff --git a/ChangeLog b/ChangeLog index c7d0cd19192..191cc035520 100644 --- a/ChangeLog +++ b/ChangeLog @@ -49,9 +49,9 @@ For users: - New: Add a selection module for emailing to enter a recipient from gui. - New: Allow to search thirds and products from barcodes directly from the permanent mini search left box. - New: Allow to search product from barcodes directly from invoices, proposals... through AJAX. +- New: Can make one invoice for several orders. New experimental modules: - New: Add margin and commissions management module. -- New: Add holiday module. - Fix: [ bug #499 ]: Supplier order input method not translated - Fix: No images into product description lines as PDF generation does diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index ee3f627f073..4415fb05229 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -2529,10 +2529,10 @@ class Commande extends CommonOrder * Return clicable link of object (with eventually picto) * * @param int $withpicto Add picto into link - * @param int $option Where point the link + * @param int $option Where point the link (0=> main card, 1,2 => shipment) * @param int $max Max length to show * @param int $short Use short labels - * @return string String with URL + * @return string String with URL */ function getNomUrl($withpicto=0,$option=0,$max=0,$short=0) { diff --git a/htdocs/commande/liste.php b/htdocs/commande/liste.php index b3ea2328866..1a8afa7fef5 100644 --- a/htdocs/commande/liste.php +++ b/htdocs/commande/liste.php @@ -126,7 +126,7 @@ if ($sall) } if ($viewstatut <> '') { - if ($viewstatut < 4 && $viewstatut > -2) + if ($viewstatut < 4 && $viewstatut > -3) { $sql.= ' AND c.fk_statut ='.$viewstatut; // brouillon, validee, en cours, annulee if ($viewstatut == 3) @@ -143,6 +143,11 @@ if ($viewstatut <> '') //$sql.= ' AND c.fk_statut IN (1,2,3) AND c.facture = 0'; $sql.= " AND ((c.fk_statut IN (1,2)) OR (c.fk_statut = 3 AND c.facture = 0))"; // If status is 2 and facture=1, it must be selected } + if ($viewstatut == -3) // To bill + { + $sql.= ' AND c.fk_statut in (1,2,3)'; + $sql.= ' AND c.facture = 0'; // invoice not created + } } if ($ordermonth > 0) { @@ -215,6 +220,8 @@ if ($resql) $title.=' - '.$langs->trans('StatusOrderCanceledShort'); if ($viewstatut == -2) $title.=' - '.$langs->trans('StatusOrderToProcessShort'); + if ($viewstatut == -3) + $title.=' - '.$langs->trans('StatusOrderValidated').', '.$langs->trans("StatusOrderSent").', '.$langs->trans('StatusOrderToBill'); $param='&socid='.$socid.'&viewstatut='.$viewstatut; if ($ordermonth) $param.='&ordermonth='.$ordermonth; @@ -233,6 +240,7 @@ if ($resql) // Lignes des champs de filtre print '
'; + print ''; print ''; @@ -297,7 +305,7 @@ if ($resql) print '
'; print ''; print '
'; - print $generic_commande->getNomUrl(1,$objp->fk_statut); + print $generic_commande->getNomUrl(1,($viewstatut != 2?0:$objp->fk_statut)); print ''; diff --git a/htdocs/commande/orderstoinvoice.php b/htdocs/commande/orderstoinvoice.php index 512da366ea8..d75b785b6f5 100755 --- a/htdocs/commande/orderstoinvoice.php +++ b/htdocs/commande/orderstoinvoice.php @@ -152,7 +152,7 @@ if (($action == 'create' || $action == 'add') && empty($mesgs)) $datefacture = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']); if (empty($datefacture)) { - $datefacture = dol_mktime(12, 0, 0, date("m"), date("d"), date("Y")); + $datefacture = dol_mktime(date("h"), date("M"), 0, date("m"), date("d"), date("Y")); } if (! $error) { @@ -388,16 +388,21 @@ if ($action == 'create') print ''; print ''; print ''; + // Ref print ''; - // Tiers + + // Third party print ''; print ''."\n"; + + // Type print '
'.$langs->trans('Ref').''.$langs->trans('Draft').'
'.$langs->trans('Customer').''; print $soc->getNomUrl(1); print ''; print '
'.$langs->trans('Type').''; print ''."\n"; + // Standard invoice print ''; // Private note @@ -540,12 +545,8 @@ if (($action != 'create' && $action != 'add') || ! empty($mesgs)) { $soc = new Societe($db); $soc->fetch($socid); - $title = $langs->trans('ListOfOrders'); - } - else - { - $title = $langs->trans('ListOfOrders'); } + $title = $langs->trans('ListOfOrders'); $title.=' - '.$langs->trans('StatusOrderValidated').', '.$langs->trans("StatusOrderSent").', '.$langs->trans('StatusOrderToBill'); $num = $db->num_rows($resql); print_fiche_titre($title); @@ -667,13 +668,13 @@ if (($action != 'create' && $action != 'add') || ! empty($mesgs)) /* * Boutons actions */ + print '

'.$langs->trans("CloseProcessedOrdersAutomatically"); print '
'; print ''; print ''; print '
'; - print ''.$langs->trans("GoBack").''; - print ''; - print '

'.$langs->trans("CloseProcessedOrdersAutomatically"); + //print ''.$langs->trans("GoBack").''; + print ''; print '
'; print ''; $db->free($resql); diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 0f4b477264d..c23ca4caaed 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -951,10 +951,10 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after) if (! empty($conf->commande->enabled)) { $langs->load("orders"); - if (! empty($conf->facture->enabled)) $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=3", $langs->trans("MenuOrdersToBill"), 0, $user->rights->commande->lire, '', $mainmenu, 'orders'); + if (! empty($conf->facture->enabled)) $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=-3", $langs->trans("MenuOrdersToBill2"), 0, $user->rights->commande->lire, '', $mainmenu, 'orders'); // if ($leftmenu=="orders") $newmenu->add("/commande/", $langs->trans("StatusOrderToBill"), 1, $user->rights->commande->lire); - - if ($leftmenu=="orders") $newmenu->add("/commande/customer.php", $langs->trans("GenerateBill"), 1, $user->rights->commande->lire); + // Does this link is required now we have link into "Orders to bill" list ? + //if ($leftmenu=="orders") $newmenu->add("/commande/customer.php", $langs->trans("GenerateBill"), 1, $user->rights->commande->lire); } // Donations diff --git a/htdocs/langs/en_US/orders.lang b/htdocs/langs/en_US/orders.lang index 3aadefcf239..9a626731e8c 100644 --- a/htdocs/langs/en_US/orders.lang +++ b/htdocs/langs/en_US/orders.lang @@ -33,6 +33,7 @@ StatusOrderSent=Shipment in process StatusOrderOnProcessShort=Reception StatusOrderProcessedShort=Processed StatusOrderToBillShort=Delivered +StatusOrderToBill2Short=To bill StatusOrderApprovedShort=Approved StatusOrderRefusedShort=Refused StatusOrderToProcessShort=To process @@ -44,6 +45,7 @@ StatusOrderValidated=Validated StatusOrderOnProcess=Waiting to receive StatusOrderProcessed=Processed StatusOrderToBill=Delivered +StatusOrderToBill2=To bill StatusOrderApproved=Approved StatusOrderRefused=Refused StatusOrderReceivedPartially=Partially received @@ -52,6 +54,7 @@ ShippingExist=A shipment exists DraftOrWaitingApproved=Draft or approved not yet ordered DraftOrWaitingShipped=Draft or validated not yet shipped MenuOrdersToBill=Orders delivered +MenuOrdersToBill2=Orders to bill SearchOrder=Search order Sending=Sending Sendings=Sendings diff --git a/htdocs/langs/fr_FR/orders.lang b/htdocs/langs/fr_FR/orders.lang index d8c72f32201..04dc0184800 100644 --- a/htdocs/langs/fr_FR/orders.lang +++ b/htdocs/langs/fr_FR/orders.lang @@ -33,6 +33,7 @@ StatusOrderSentShort=Envoi en cours StatusOrderSent=Envoi en cours StatusOrderProcessedShort=Traitée StatusOrderToBillShort=Délivrée +StatusOrderToBill2Short=A facturer StatusOrderApprovedShort=Approuvée StatusOrderRefusedShort=Refusée StatusOrderToProcessShort=A traiter @@ -44,6 +45,7 @@ StatusOrderValidated=Validée StatusOrderOnProcess=Attente réception StatusOrderProcessed=Traitée StatusOrderToBill=Délivrée +StatusOrderToBill2=A facturer StatusOrderApproved=Approuvée StatusOrderRefused=Refusée StatusOrderReceivedPartially=Reçu partiellement @@ -53,6 +55,7 @@ DraftOrWaitingApproved=Brouillon ou approuvée pas encore commandée DraftOrWaitingShipped=Brouillon ou validée pas encore expédiée SearchOrder=Rechercher une commande MenuOrdersToBill=Commandes délivrées +MenuOrdersToBill2=Commandes à facturer Sending=Expédition Sendings=Expéditions ShipProduct=Expédier produit
'; print ''; @@ -443,16 +448,16 @@ if ($action == 'create') dol_include_once('/commande/class/commande.class.php'); $srcobject = new Commande($db); - $commandes = $langs->trans("Orders").": "; + $listoforders = ''; foreach ($selected as $sel) { $result=$srcobject->fetch($sel); if ($result > 0) { - $commandes.= $srcobject->ref.", "; + $listoforders .= ($listoforders?', ':'').$srcobject->ref; } } - print $commandes; + print $langs->trans("Orders").": ".$listoforders; print '