diff --git a/htdocs/comm/fiche.php b/htdocs/comm/fiche.php index bd3b96977c1..bfb9fa4cc62 100644 --- a/htdocs/comm/fiche.php +++ b/htdocs/comm/fiche.php @@ -504,7 +504,7 @@ if ($id > 0) $sql2.= " AND ((c.fk_statut IN (1,2)) OR (c.fk_statut = 3 AND c.facture = 0))"; $resql2=$db->query($sql2); - $num2 = $db->num_rows($resql2); + $orders2invoice = $db->num_rows($resql2); $db->free($resql2); print ''; @@ -512,8 +512,8 @@ if ($id > 0) print ''; print ''; print ''; } @@ -777,12 +777,17 @@ if ($id > 0) if ($user->rights->facture->creer) { $langs->load("bills"); + + if($orders2invoice > 0) print ''.$langs->trans("CreateInvoiceForThisCustomer").''; + else print ''.$langs->trans("CreateInvoiceForThisCustomer").''; + if ($object->client != 0) print ''.$langs->trans("AddBill").''; else print ''.$langs->trans("AddBill").''; + } else { - print ''.$langs->trans("AddBill").''; + print ''.$langs->trans("AddBill").''; } } } diff --git a/htdocs/commande/liste.php b/htdocs/commande/liste.php index 1a8afa7fef5..6ea36d8719c 100644 --- a/htdocs/commande/liste.php +++ b/htdocs/commande/liste.php @@ -328,7 +328,20 @@ if ($resql) print ''; print ''; diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index c23ca4caaed..a8d028e84dd 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -953,8 +953,6 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after) $langs->load("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); - // 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/ca_ES/orders.lang b/htdocs/langs/ca_ES/orders.lang index ef2f9e43efa..15fd9b6c9a1 100644 --- a/htdocs/langs/ca_ES/orders.lang +++ b/htdocs/langs/ca_ES/orders.lang @@ -141,8 +141,10 @@ OrderSource6=Revistes QtyOrdered=Qt. demanda AddDeliveryCostLine=Afegir una línia de despeses de ports indicant el pes de la comanda SetDemandReason=Indicar origen de la comanda -CreateInvoiceForThisCustomer=Crear una factura a partir de diverses comandes d'aquest client +CreateInvoiceForThisCustomer=Facturar comandes +NoOrdersToInvoice=Sense comandes facturables CloseProcessedOrdersAutomatically=Classificar automàticament com "Processades" les comandes seleccionades. +MenuOrdersToBill2=Comandes facturables # Document models PDFEinsteinDescription=Model de comanda complet (logo...) diff --git a/htdocs/langs/en_US/orders.lang b/htdocs/langs/en_US/orders.lang index 9a626731e8c..2796759a8f0 100644 --- a/htdocs/langs/en_US/orders.lang +++ b/htdocs/langs/en_US/orders.lang @@ -155,5 +155,7 @@ OrderByEMail=EMail OrderByWWW=Online OrderByPhone=Phone -CreateInvoiceForThisCustomer=Create an invoice for several orders of this customer -CloseProcessedOrdersAutomatically=Classify "Processed" all selected orders. \ No newline at end of file +CreateInvoiceForThisCustomer=Bill orders +NoOrdersToInvoice=No orders billable +CloseProcessedOrdersAutomatically=Classify "Processed" all selected orders. +MenuOrdersToBill2=Billables orders \ No newline at end of file diff --git a/htdocs/langs/es_ES/orders.lang b/htdocs/langs/es_ES/orders.lang index 06a662847c6..13710c240b7 100644 --- a/htdocs/langs/es_ES/orders.lang +++ b/htdocs/langs/es_ES/orders.lang @@ -141,8 +141,10 @@ OrderSource6=Revistas QtyOrdered=Cant. pedida AddDeliveryCostLine=Añadir una línea de gastos de portes indicando el peso del pedido SetDemandReason=Indicar origen del pedido -CreateInvoiceForThisCustomer=Crear una factura a partir de varios pedidos de este cliente +CreateInvoiceForThisCustomer=Facturar pedidos +NoOrdersToInvoice=Sin pedidos facturables CloseProcessedOrdersAutomatically=Clasificar automáticamente como "Procesados" los pedidos seleccionados. +MenuOrdersToBill2=Pedidos facturables # Document models PDFEinsteinDescription=Modelo de pedido completo (logo...) diff --git a/htdocs/langs/fr_FR/orders.lang b/htdocs/langs/fr_FR/orders.lang index 04dc0184800..b70d6005daa 100644 --- a/htdocs/langs/fr_FR/orders.lang +++ b/htdocs/langs/fr_FR/orders.lang @@ -156,5 +156,7 @@ 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 +CreateInvoiceForThisCustomer=Facturer commandes +NoOrdersToInvoice=Pas de commandes facturables +CloseProcessedOrdersAutomatically=Classer automatiquement à "Traitées" les commandes sélectionnées. +MenuOrdersToBill2=Commandes facturables \ No newline at end of file
'; print ''; - if($num2 > 0) print ''; - else print ''; + //if($num2 > 0) print ''; + //else print ''; print '
'.$langs->trans("LastOrders",($num<=$MAXLIST?"":$MAXLIST)).''.$langs->trans("AllOrders").' ('.$num.')'.img_picto($langs->trans("Statistics"),'stats').''.img_picto($langs->trans("CreateInvoiceForThisCustomer"),'object_bill').''.img_picto($langs->trans("NoOrdersToInvoice"),'object_bill').''.img_picto($langs->trans("CreateInvoiceForThisCustomer"),'object_bill').''.img_picto($langs->trans("NoOrdersToInvoice"),'object_bill').'
'; print $companystatic->getNomUrl(1,'customer'); print ' '; - print img_picto($langs->trans("CreateInvoiceForThisCustomer").' : '.$companystatic->nom,'object_bill').''; + + // If module invoices enabled and user with invoice creation permissions + if (! empty($conf->facture->enabled)) + { + if ($user->rights->facture->creer) + { + + if (($objp->fk_statut > 0 && $objp->fk_statut < 3) || ($objp->fk_statut == 3 && $objp->facturee == 0)) + { + + print img_picto($langs->trans("CreateInvoiceForThisCustomer").' : '.$companystatic->nom,'object_bill').''; + } + } + } print ''.$objp->ref_client.'