Merge pull request #20794 from altairis-melina/invoicehooks

NEW: TakePos - add hooks for cart display
This commit is contained in:
Laurent Destailleur 2022-05-08 19:08:30 +02:00 committed by GitHub
commit 56c943d4a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1292,6 +1292,13 @@ if (getDolGlobalString('TAKEPOS_BAR_RESTAURANT')) {
print $langs->trans("Products");
}
print '</td>';
// complete header by hook
$parameters=array();
$reshook=$hookmanager->executeHooks('completeTakePosInvoiceHeader', $parameters, $invoice, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
print $hookmanager->resPrint;
if (empty($_SESSION["basiclayout"]) || $_SESSION["basiclayout"] != 1) {
print '<td class="linecolqty right">'.$langs->trans('ReductionShort').'</td>';
print '<td class="linecolqty right">'.$langs->trans('Qty').'</td>';
@ -1445,6 +1452,13 @@ if ($placeid > 0) {
}
}
$htmlsupplements[$line->fk_parent_line] .= '</td>';
// complete line by hook
$parameters=array('line' => $line);
$reshook=$hookmanager->executeHooks('completeTakePosInvoiceParentLine', $parameters, $invoice, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
$htmlsupplements[$line->fk_parent_line] .= $hookmanager->resPrint;
if (empty($_SESSION["basiclayout"]) || $_SESSION["basiclayout"] != 1) {
$htmlsupplements[$line->fk_parent_line] .= '<td class="right">'.vatrate($line->remise_percent, true).'</td>';
$htmlsupplements[$line->fk_parent_line] .= '<td class="right">'.$line->qty.'</td>';
@ -1525,6 +1539,13 @@ if ($placeid > 0) {
$htmlforlines .= '<br><div class="clearboth nowraponall">'.get_date_range($line->date_start, $line->date_end).'</div>';
}
$htmlforlines .= '</td>';
// complete line by hook
$parameters=array('line' => $line);
$reshook=$hookmanager->executeHooks('completeTakePosInvoiceLine', $parameters, $invoice, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
$htmlforlines .= $hookmanager->resPrint;
$htmlforlines .= '<td class="right">'.vatrate($line->remise_percent, true).'</td>';
$htmlforlines .= '<td class="right">';
if (!empty($conf->stock->enabled) && !empty($user->rights->stock->mouvement->lire)) {