From 5a76385d917730c0aa0487bd49410d5c9844a33a Mon Sep 17 00:00:00 2001 From: melina Date: Fri, 6 May 2022 11:34:05 +0200 Subject: [PATCH] add hook for cart display --- htdocs/takepos/invoice.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 3a55d82b8ad..3c0fb834f67 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -1292,6 +1292,13 @@ if (getDolGlobalString('TAKEPOS_BAR_RESTAURANT')) { print $langs->trans("Products"); } print ''; + +// 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 ''.$langs->trans('ReductionShort').''; print ''.$langs->trans('Qty').''; @@ -1445,6 +1452,13 @@ if ($placeid > 0) { } } $htmlsupplements[$line->fk_parent_line] .= ''; + + // 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] .= ''.vatrate($line->remise_percent, true).''; $htmlsupplements[$line->fk_parent_line] .= ''.$line->qty.''; @@ -1525,6 +1539,13 @@ if ($placeid > 0) { $htmlforlines .= '
'.get_date_range($line->date_start, $line->date_end).'
'; } $htmlforlines .= ''; + + // 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 .= ''.vatrate($line->remise_percent, true).''; $htmlforlines .= ''; if (!empty($conf->stock->enabled) && !empty($user->rights->stock->mouvement->lire)) {