Merge pull request #9326 from atm-quentin/7.0_new_dispatch

FIX hook on dispatch order fourn
This commit is contained in:
Laurent Destailleur 2018-08-29 21:11:42 +02:00 committed by GitHub
commit 617adc73c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -511,25 +511,24 @@ if ($id > 0 || ! empty($ref)) {
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td>' . $langs->trans("Description") . '</td>'; print '<td>' . $langs->trans("Description") . '</td>';
if (!empty($conf->productbatch->enabled))
{
print '<td class="dispatch_batch_number_title">'.$langs->trans("batch_number").'</td>';
print '<td class="dispatch_dluo_title">'.$langs->trans("EatByDate").'</td>';
print '<td class="dispatch_dlc_title">'.$langs->trans("SellByDate").'</td>';
}
else
{
print '<td></td>'; print '<td></td>';
print '<td></td>'; print '<td></td>';
print '<td></td>'; print '<td></td>';
}
print '<td align="right">' . $langs->trans("QtyOrdered") . '</td>'; print '<td align="right">' . $langs->trans("QtyOrdered") . '</td>';
print '<td align="right">' . $langs->trans("QtyDispatchedShort") . '</td>'; print '<td align="right">' . $langs->trans("QtyDispatchedShort") . '</td>';
print '<td align="right">' . $langs->trans("QtyToDispatchShort") . '</td>'; print '<td align="right">' . $langs->trans("QtyToDispatchShort") . '</td>';
print '<td width="32"></td>'; print '<td width="32"></td>';
print '<td align="right">' . $langs->trans("Warehouse") . '</td>'; print '<td align="right">' . $langs->trans("Warehouse") . '</td>';
print "</tr>\n"; print "</tr>\n";
if (! empty($conf->productbatch->enabled)) {
print '<tr class="liste_titre">';
print '<td></td>';
print '<td>' . $langs->trans("batch_number") . '</td>';
print '<td>' . $langs->trans("EatByDate") . '</td>';
print '<td>' . $langs->trans("SellByDate") . '</td>';
print '<td colspan="5">&nbsp;</td>';
print "</tr>\n";
}
} }
$nbfreeproduct = 0; // Nb of lins of free products/services $nbfreeproduct = 0; // Nb of lins of free products/services
@ -568,16 +567,21 @@ if ($id > 0 || ! empty($ref)) {
if (! empty($conf->productbatch->enabled)) { if (! empty($conf->productbatch->enabled)) {
if ($objp->tobatch) { if ($objp->tobatch) {
print '<td colspan="4">'; print '<td>';
print $linktoprod; print $linktoprod;
print "</td>"; print "</td>";
print '<td class="dispatch_batch_number"></td>';
print '<td class="dispatch_dluo"></td>';
print '<td class="dispatch_dlc"></td>';
} else { } else {
print '<td>'; print '<td>';
print $linktoprod; print $linktoprod;
print "</td>"; print "</td>";
print '<td colspan="3">'; print '<td class="dispatch_batch_number">';
print $langs->trans("ProductDoesNotUseBatchSerial"); print $langs->trans("ProductDoesNotUseBatchSerial");
print '</td>'; print '</td>';
print '<td class="dispatch_dluo"></td>';
print '<td class="dispatch_dlc"></td>';
} }
} else { } else {
print '<td colspan="4">'; print '<td colspan="4">';
@ -636,6 +640,7 @@ if ($id > 0 || ! empty($ref)) {
print '</td>'; print '</td>';
print '<td colspan="2">&nbsp</td>'; // Qty ordered + qty already dispatached print '<td colspan="2">&nbsp</td>'; // Qty ordered + qty already dispatached
} else { } else {
$type = 'dispatch'; $type = 'dispatch';
print '<td align="right">'; print '<td align="right">';
print '</td>'; // Qty to dispatch print '</td>'; // Qty to dispatch
@ -713,6 +718,11 @@ if ($id > 0 || ! empty($ref)) {
$checkboxlabel = $langs->trans("CloseReceivedSupplierOrdersAutomatically", $langs->transnoentitiesnoconv('StatusOrderReceivedAll')); $checkboxlabel = $langs->trans("CloseReceivedSupplierOrdersAutomatically", $langs->transnoentitiesnoconv('StatusOrderReceivedAll'));
print '<br><div class="center">'; print '<br><div class="center">';
$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 $langs->trans("Comment").' : ';
print '<input type="text" class="minwidth400" maxlength="128" name="comment" value="'; print '<input type="text" class="minwidth400" maxlength="128" name="comment" value="';
print $_POST["comment"] ? GETPOST("comment") : $langs->trans("DispatchSupplierOrder", $object->ref); print $_POST["comment"] ? GETPOST("comment") : $langs->trans("DispatchSupplierOrder", $object->ref);
@ -725,6 +735,7 @@ if ($id > 0 || ! empty($ref)) {
if (count($listwarehouses) <= 0) if (count($listwarehouses) <= 0)
print ' disabled'; print ' disabled';
print '>'; print '>';
}
print '</div>'; print '</div>';
} }
@ -764,14 +775,14 @@ if ($id > 0 || ! empty($ref)) {
print load_fiche_titre($langs->trans("ReceivingForSameOrder")); print load_fiche_titre($langs->trans("ReceivingForSameOrder"));
print '<div class="div-table-responsive">'; print '<div class="div-table-responsive">';
print '<table class="noborder" width="100%">'; print '<table id="dispatch_received_products" class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td>' . $langs->trans("Product") . '</td>'; print '<td>' . $langs->trans("Product") . '</td>';
if (! empty($conf->productbatch->enabled)) { if (! empty($conf->productbatch->enabled)) {
print '<td>' . $langs->trans("batch_number") . '</td>'; print '<td class="dispatch_batch_number_title">' . $langs->trans("batch_number") . '</td>';
print '<td>' . $langs->trans("EatByDate") . '</td>'; print '<td class="dispatch_dluo_title">' . $langs->trans("EatByDate") . '</td>';
print '<td>' . $langs->trans("SellByDate") . '</td>'; print '<td class="dispatch_dlc_title">' . $langs->trans("SellByDate") . '</td>';
} }
print '<td align="right">' . $langs->trans("QtyDispatched") . '</td>'; print '<td align="right">' . $langs->trans("QtyDispatched") . '</td>';
print '<td></td>'; print '<td></td>';
@ -794,9 +805,9 @@ if ($id > 0 || ! empty($ref)) {
print "</td>\n"; print "</td>\n";
if (! empty($conf->productbatch->enabled)) { if (! empty($conf->productbatch->enabled)) {
print '<td>' . $objp->batch . '</td>'; print '<td class="dispatch_batch_number">' . $objp->batch . '</td>';
print '<td>' . dol_print_date($db->jdate($objp->eatby), 'day') . '</td>'; print '<td class="dispatch_dluo">' . dol_print_date($db->jdate($objp->eatby), 'day') . '</td>';
print '<td>' . dol_print_date($db->jdate($objp->sellby), 'day') . '</td>'; print '<td class="dispatch_dlc">' . dol_print_date($db->jdate($objp->sellby), 'day') . '</td>';
} }
// Qty // Qty