forked from Wavyzz/dolibarr
NEW: Hook after total Table on PDF (#28092)
Co-authored-by: Noé <noe@scopen.fr>
This commit is contained in:
@@ -1320,6 +1320,14 @@ class pdf_eratosthene extends ModelePDFCommandes
|
||||
$pdf->SetTextColor(0, 0, 0);
|
||||
}
|
||||
|
||||
$parameters = array('pdf' => &$pdf, 'object' => &$object, 'outputlangs' => $outputlangs, 'index' => &$index);
|
||||
|
||||
$reshook = $hookmanager->executeHooks('afterPDFTotalTable', $parameters, $this); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) {
|
||||
$this->error = $hookmanager->error;
|
||||
$this->errors = $hookmanager->errors;
|
||||
}
|
||||
|
||||
$index++;
|
||||
return ($tab2_top + ($tab2_hl * $index));
|
||||
}
|
||||
|
||||
@@ -1946,6 +1946,14 @@ class pdf_sponge extends ModelePDFFactures
|
||||
$pdf->SetTextColor(0, 0, 0);
|
||||
}
|
||||
|
||||
$parameters = array('pdf' => &$pdf, 'object' => &$object, 'outputlangs' => $outputlangs, 'index' => &$index);
|
||||
|
||||
$reshook = $hookmanager->executeHooks('afterPDFTotalTable', $parameters, $this); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) {
|
||||
$this->error = $hookmanager->error;
|
||||
$this->errors = $hookmanager->errors;
|
||||
}
|
||||
|
||||
$index++;
|
||||
return ($tab2_top + ($tab2_hl * $index));
|
||||
}
|
||||
|
||||
@@ -1417,6 +1417,14 @@ class pdf_cyan extends ModelePDFPropales
|
||||
$pdf->SetTextColor(0, 0, 0);
|
||||
}
|
||||
|
||||
$parameters = array('pdf' => &$pdf, 'object' => &$object, 'outputlangs' => $outputlangs, 'index' => &$index);
|
||||
|
||||
$reshook = $hookmanager->executeHooks('afterPDFTotalTable', $parameters, $this); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) {
|
||||
$this->error = $hookmanager->error;
|
||||
$this->errors = $hookmanager->errors;
|
||||
}
|
||||
|
||||
$index++;
|
||||
return ($tab2_top + ($tab2_hl * $index));
|
||||
}
|
||||
|
||||
@@ -616,7 +616,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
||||
protected function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf, $mysoc;
|
||||
global $conf, $mysoc, $hookmanager;
|
||||
|
||||
$sign = 1;
|
||||
if ($object->type == 2 && getDolGlobalString('INVOICE_POSITIVE_CREDIT_NOTE')) {
|
||||
@@ -815,6 +815,14 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
||||
$pdf->SetTextColor(0, 0, 0);
|
||||
}
|
||||
|
||||
$parameters = array('pdf' => &$pdf, 'object' => &$object, 'outputlangs' => $outputlangs, 'index' => &$index);
|
||||
|
||||
$reshook = $hookmanager->executeHooks('afterPDFTotalTable', $parameters, $this); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) {
|
||||
$this->error = $hookmanager->error;
|
||||
$this->errors = $hookmanager->errors;
|
||||
}
|
||||
|
||||
$index++;
|
||||
return ($tab2_top + ($tab2_hl * $index));
|
||||
}
|
||||
|
||||
@@ -916,7 +916,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
||||
protected function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf, $mysoc;
|
||||
global $conf, $mysoc, $hookmanager;
|
||||
|
||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||
|
||||
@@ -1102,6 +1102,14 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
||||
$pdf->SetTextColor(0, 0, 0);
|
||||
}
|
||||
|
||||
$parameters = array('pdf' => &$pdf, 'object' => &$object, 'outputlangs' => $outputlangs, 'index' => &$index);
|
||||
|
||||
$reshook = $hookmanager->executeHooks('afterPDFTotalTable', $parameters, $this); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) {
|
||||
$this->error = $hookmanager->error;
|
||||
$this->errors = $hookmanager->errors;
|
||||
}
|
||||
|
||||
$index++;
|
||||
return ($tab2_top + ($tab2_hl * $index));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user