From 76cb9f60c7b74e31f059db19dc2f3574a6b3b139 Mon Sep 17 00:00:00 2001 From: atm-quentin Date: Wed, 29 Aug 2018 14:12:17 +0200 Subject: [PATCH 1/3] NEW hook on dispatch order fourn --- htdocs/fourn/commande/dispatch.php | 79 +++++++++++++++++------------- 1 file changed, 46 insertions(+), 33 deletions(-) diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index 04c039cfbb1..e53ef59304f 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -62,6 +62,10 @@ if (empty($conf->stock->enabled)) { accessforbidden(); } + +$hookmanager->initHooks(array('dispatch')); + + // Recuperation de l'id de projet $projectid = 0; if ($_GET["projectid"]) @@ -502,9 +506,12 @@ if ($id > 0 || ! empty($ref)) { print ''; print '' . $langs->trans("Description") . ''; - print ''; - print ''; - print ''; + if (!empty($conf->productbatch->enabled)) + { + print ''.$langs->trans("batch_number").''; + print ''.$langs->trans("EatByDate").''; + print ''.$langs->trans("SellByDate").''; + } print '' . $langs->trans("QtyOrdered") . ''; print '' . $langs->trans("QtyDispatchedShort") . ''; print '' . $langs->trans("QtyToDispatchShort") . ''; @@ -512,15 +519,9 @@ if ($id > 0 || ! empty($ref)) { print '' . $langs->trans("Warehouse") . ''; print "\n"; - if (! empty($conf->productbatch->enabled)) { - print ''; - print ''; - print '' . $langs->trans("batch_number") . ''; - print '' . $langs->trans("EatByDate") . ''; - print '' . $langs->trans("SellByDate") . ''; - print ' '; - print "\n"; - } + + + } $nbfreeproduct = 0; // Nb of lins of free products/services @@ -559,16 +560,21 @@ if ($id > 0 || ! empty($ref)) { if (! empty($conf->productbatch->enabled)) { if ($objp->tobatch) { - print ''; + print ''; print $linktoprod; print ""; + print ''; + print ''; + print ''; } else { print ''; print $linktoprod; print ""; - print ''; + print ''; print $langs->trans("ProductDoesNotUseBatchSerial"); print ''; + print ''; + print ''; } } else { print ''; @@ -614,7 +620,7 @@ if ($id > 0 || ! empty($ref)) { print ''; - print ''; + print ''; print ''; print ''; print ''; @@ -627,6 +633,7 @@ if ($id > 0 || ! empty($ref)) { print ''; print ' '; // Qty ordered + qty already dispatached } else { + $type = 'dispatch'; print ''; print ''; // Qty to dispatch @@ -701,21 +708,27 @@ if ($id > 0 || ! empty($ref)) { if ($nbproduct) { - $checkboxlabel=$langs->trans("CloseReceivedSupplierOrdersAutomatically", $langs->transnoentitiesnoconv($object->statuts[5])); + $checkboxlabel = $langs->trans("CloseReceivedSupplierOrdersAutomatically", $langs->transnoentitiesnoconv($object->statuts[5])); print '
'; - print $langs->trans("Comment") . ' : '; - print 'trans("DispatchSupplierOrder", $object->ref); - // print ' / '.$object->ref_supplier; // Not yet available - print '" class="flat">
'; + $parameters = array(); + $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been + // modified by hook + if (empty($reshook)) + { + print $langs->trans("Comment").' : '; + print 'trans("DispatchSupplierOrder", $object->ref); + // print ' / '.$object->ref_supplier; // Not yet available + print '" class="flat">
'; - print ' '.$checkboxlabel; + print ' '.$checkboxlabel; - print '
'; + print '
'; + } print '
'; } @@ -755,14 +768,14 @@ if ($id > 0 || ! empty($ref)) { print load_fiche_titre($langs->trans("ReceivingForSameOrder")); print '
'; - print ''; + print '
'; print ''; print ''; if (! empty($conf->productbatch->enabled)) { - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; } print ''; print ''; @@ -784,9 +797,9 @@ if ($id > 0 || ! empty($ref)) { print "\n"; if (! empty($conf->productbatch->enabled)) { - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; } // Qty From 88044a3d75088b4907cbc41ae7bc8f8cf2880eda Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 29 Aug 2018 20:42:19 +0200 Subject: [PATCH 2/3] Update dispatch.php --- htdocs/fourn/commande/dispatch.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index e53ef59304f..1f6f86d57ae 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -620,7 +620,7 @@ if ($id > 0 || ! empty($ref)) { print ''; - print ''; print ''; print ''; } + else + { + print ''; + print ''; + print ''; + } print ''; print ''; print ''; print ''; print ''; print "\n"; - - - - } $nbfreeproduct = 0; // Nb of lins of free products/services
' . $langs->trans("Product") . '' . $langs->trans("batch_number") . '' . $langs->trans("EatByDate") . '' . $langs->trans("SellByDate") . '' . $langs->trans("batch_number") . '' . $langs->trans("EatByDate") . '' . $langs->trans("SellByDate") . '' . $langs->trans("QtyDispatched") . '' . $objp->batch . '' . dol_print_date($db->jdate($objp->eatby), 'day') . '' . dol_print_date($db->jdate($objp->sellby), 'day') . '' . $objp->batch . '' . dol_print_date($db->jdate($objp->eatby), 'day') . '' . dol_print_date($db->jdate($objp->sellby), 'day') . ''; + print ''; print ''; print ''; From 7211aff01681b774a815f0690bca09324814ae78 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 29 Aug 2018 21:11:28 +0200 Subject: [PATCH 3/3] Update dispatch.php --- htdocs/fourn/commande/dispatch.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index 15e42ac089b..761cce030f7 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -517,16 +517,18 @@ if ($id > 0 || ! empty($ref)) { print ''.$langs->trans("EatByDate").''.$langs->trans("SellByDate").'' . $langs->trans("QtyOrdered") . '' . $langs->trans("QtyDispatchedShort") . '' . $langs->trans("QtyToDispatchShort") . '' . $langs->trans("Warehouse") . '