Merge pull request #24439 from grandoc/new_branch_05_04_2023
update code for a better php8 compliance
This commit is contained in:
commit
1c1a7bfa12
@ -1236,8 +1236,8 @@ abstract class CommonDocGenerator
|
||||
// save curent cell padding
|
||||
$curentCellPaddinds = $pdf->getCellPaddings();
|
||||
// set cell padding with column content definition
|
||||
$pdf->setCellPaddings($colDef['content']['padding'][3], $colDef['content']['padding'][0], $colDef['content']['padding'][1], $colDef['content']['padding'][2]);
|
||||
$pdf->writeHTMLCell($colDef['width'], 2, $colDef['xStartPos'], $curY, $columnText, 0, 1, 0, true, $colDef['content']['align']);
|
||||
$pdf->setCellPaddings(isset($colDef['content']['padding'][3]) ? $colDef['content']['padding'][3] : 0, isset($colDef['content']['padding'][0]) ? $colDef['content']['padding'][0] : 0, isset($colDef['content']['padding'][1]) ? $colDef['content']['padding'][1] : 0, isset($colDef['content']['padding'][2]) ? $colDef['content']['padding'][2] : 0);
|
||||
$pdf->writeHTMLCell($colDef['width'], 2, isset($colDef['xStartPos']) ? $colDef['xStartPos'] : 0, $curY, $columnText, 0, 1, 0, true, $colDef['content']['align']);
|
||||
|
||||
// restore cell padding
|
||||
$pdf->setCellPaddings($curentCellPaddinds['L'], $curentCellPaddinds['T'], $curentCellPaddinds['R'], $curentCellPaddinds['B']);
|
||||
|
||||
@ -1197,10 +1197,10 @@ class pdf_crabe extends ModelePDFFactures
|
||||
if ($object->type != 2) {
|
||||
// Check a payment mode is defined
|
||||
if (empty($object->mode_reglement_code)
|
||||
&& empty($conf->global->FACTURE_CHQ_NUMBER)
|
||||
&& !getDolGlobalInt('FACTURE_CHQ_NUMBER')
|
||||
&& !getDolGlobalInt('FACTURE_RIB_NUMBER')) {
|
||||
$this->error = $outputlangs->transnoentities("ErrorNoPaiementModeConfigured");
|
||||
} elseif (($object->mode_reglement_code == 'CHQ' && empty($conf->global->FACTURE_CHQ_NUMBER) && empty($object->fk_account) && empty($object->fk_bank))
|
||||
} elseif (($object->mode_reglement_code == 'CHQ' && !getDolGlobalInt('FACTURE_CHQ_NUMBER') && empty($object->fk_account) && empty($object->fk_bank))
|
||||
|| ($object->mode_reglement_code == 'VIR' && !getDolGlobalInt('FACTURE_RIB_NUMBER') && empty($object->fk_account) && empty($object->fk_bank))) {
|
||||
// Avoid having any valid PDF with setup that is not complete
|
||||
$outputlangs->load("errors");
|
||||
@ -1286,12 +1286,12 @@ class pdf_crabe extends ModelePDFFactures
|
||||
// Show payment mode CHQ
|
||||
if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'CHQ') {
|
||||
// If payment mode unregulated or payment mode forced to CHQ
|
||||
if (!empty($conf->global->FACTURE_CHQ_NUMBER)) {
|
||||
if (getDolGlobalInt('FACTURE_CHQ_NUMBER')) {
|
||||
$diffsizetitle = (empty($conf->global->PDF_DIFFSIZE_TITLE) ? 3 : $conf->global->PDF_DIFFSIZE_TITLE);
|
||||
|
||||
if ($conf->global->FACTURE_CHQ_NUMBER > 0) {
|
||||
$account = new Account($this->db);
|
||||
$account->fetch($conf->global->FACTURE_CHQ_NUMBER);
|
||||
$account->fetch(getDolGlobalInt('FACTURE_CHQ_NUMBER'));
|
||||
|
||||
$pdf->SetXY($this->marge_gauche, $posy);
|
||||
$pdf->SetFont('', 'B', $default_font_size - $diffsizetitle);
|
||||
|
||||
@ -1289,10 +1289,10 @@ class pdf_sponge extends ModelePDFFactures
|
||||
if ($object->type != 2) {
|
||||
// Check a payment mode is defined
|
||||
if (empty($object->mode_reglement_code)
|
||||
&& empty($conf->global->FACTURE_CHQ_NUMBER)
|
||||
&& !getDolGlobalInt('FACTURE_CHQ_NUMBER')
|
||||
&& !getDolGlobalInt('FACTURE_RIB_NUMBER')) {
|
||||
$this->error = $outputlangs->transnoentities("ErrorNoPaiementModeConfigured");
|
||||
} elseif (($object->mode_reglement_code == 'CHQ' && empty($conf->global->FACTURE_CHQ_NUMBER) && empty($object->fk_account) && empty($object->fk_bank))
|
||||
} elseif (($object->mode_reglement_code == 'CHQ' && !getDolGlobalInt('FACTURE_CHQ_NUMBER') && empty($object->fk_account) && empty($object->fk_bank))
|
||||
|| ($object->mode_reglement_code == 'VIR' && !getDolGlobalInt('FACTURE_RIB_NUMBER') && empty($object->fk_account) && empty($object->fk_bank))) {
|
||||
// Avoid having any valid PDF with setup that is not complete
|
||||
$outputlangs->load("errors");
|
||||
@ -1381,12 +1381,12 @@ class pdf_sponge extends ModelePDFFactures
|
||||
// Show payment mode CHQ
|
||||
if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'CHQ') {
|
||||
// If payment mode unregulated or payment mode forced to CHQ
|
||||
if (!empty($conf->global->FACTURE_CHQ_NUMBER)) {
|
||||
if (getDolGlobalInt('FACTURE_CHQ_NUMBER')) {
|
||||
$diffsizetitle = (empty($conf->global->PDF_DIFFSIZE_TITLE) ? 3 : $conf->global->PDF_DIFFSIZE_TITLE);
|
||||
|
||||
if ($conf->global->FACTURE_CHQ_NUMBER > 0) {
|
||||
$account = new Account($this->db);
|
||||
$account->fetch($conf->global->FACTURE_CHQ_NUMBER);
|
||||
$account->fetch(getDolGlobalInt('FACTURE_CHQ_NUMBER'));
|
||||
|
||||
$pdf->SetXY($this->marge_gauche, $posy);
|
||||
$pdf->SetFont('', 'B', $default_font_size - $diffsizetitle);
|
||||
|
||||
@ -1032,12 +1032,12 @@ class pdf_azur extends ModelePDFPropales
|
||||
// Show payment mode CHQ
|
||||
if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'CHQ') {
|
||||
// Si mode reglement non force ou si force a CHQ
|
||||
if (!empty($conf->global->FACTURE_CHQ_NUMBER)) {
|
||||
if (getDolGlobalInt('FACTURE_CHQ_NUMBER')) {
|
||||
$diffsizetitle = (empty($conf->global->PDF_DIFFSIZE_TITLE) ? 3 : $conf->global->PDF_DIFFSIZE_TITLE);
|
||||
|
||||
if ($conf->global->FACTURE_CHQ_NUMBER > 0) {
|
||||
$account = new Account($this->db);
|
||||
$account->fetch($conf->global->FACTURE_CHQ_NUMBER);
|
||||
$account->fetch(getDolGlobalInt('FACTURE_CHQ_NUMBER'));
|
||||
|
||||
$pdf->SetXY($this->marge_gauche, $posy);
|
||||
$pdf->SetFont('', 'B', $default_font_size - $diffsizetitle);
|
||||
|
||||
@ -1143,12 +1143,12 @@ class pdf_cyan extends ModelePDFPropales
|
||||
// Show payment mode CHQ
|
||||
if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'CHQ') {
|
||||
// Si mode reglement non force ou si force a CHQ
|
||||
if (!empty($conf->global->FACTURE_CHQ_NUMBER)) {
|
||||
if (getDolGlobalInt('FACTURE_CHQ_NUMBER')) {
|
||||
$diffsizetitle = (empty($conf->global->PDF_DIFFSIZE_TITLE) ? 3 : $conf->global->PDF_DIFFSIZE_TITLE);
|
||||
|
||||
if ($conf->global->FACTURE_CHQ_NUMBER > 0) {
|
||||
$account = new Account($this->db);
|
||||
$account->fetch($conf->global->FACTURE_CHQ_NUMBER);
|
||||
$account->fetch(getDolGlobalInt('FACTURE_CHQ_NUMBER'));
|
||||
|
||||
$pdf->SetXY($this->marge_gauche, $posy);
|
||||
$pdf->SetFont('', 'B', $default_font_size - $diffsizetitle);
|
||||
@ -1162,7 +1162,7 @@ class pdf_cyan extends ModelePDFPropales
|
||||
$posy = $pdf->GetY() + 2;
|
||||
}
|
||||
}
|
||||
if ($conf->global->FACTURE_CHQ_NUMBER == -1) {
|
||||
if (getDolGlobalInt('FACTURE_CHQ_NUMBER') == -1) {
|
||||
$pdf->SetXY($this->marge_gauche, $posy);
|
||||
$pdf->SetFont('', 'B', $default_font_size - $diffsizetitle);
|
||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo', $this->emetteur->name), 0, 'L', 0);
|
||||
|
||||
@ -943,10 +943,10 @@ class pdf_eagle_proforma extends ModelePDFCommandes
|
||||
// Show payment mode CHQ
|
||||
if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'CHQ') {
|
||||
// Si mode reglement non force ou si force a CHQ
|
||||
if (!empty($conf->global->FACTURE_CHQ_NUMBER)) {
|
||||
if (getDolGlobalInt('FACTURE_CHQ_NUMBER')) {
|
||||
if ($conf->global->FACTURE_CHQ_NUMBER > 0) {
|
||||
$account = new Account($this->db);
|
||||
$account->fetch($conf->global->FACTURE_CHQ_NUMBER);
|
||||
$account->fetch(getDolGlobalInt('FACTURE_CHQ_NUMBER'));
|
||||
|
||||
$pdf->SetXY($this->marge_gauche, $posy);
|
||||
$pdf->SetFont('', 'B', $default_font_size - 3);
|
||||
@ -960,7 +960,7 @@ class pdf_eagle_proforma extends ModelePDFCommandes
|
||||
$posy = $pdf->GetY() + 2;
|
||||
}
|
||||
}
|
||||
if ($conf->global->FACTURE_CHQ_NUMBER == -1) {
|
||||
if (getDolGlobalInt('FACTURE_CHQ_NUMBER') == -1) {
|
||||
$pdf->SetXY($this->marge_gauche, $posy);
|
||||
$pdf->SetFont('', 'B', $default_font_size - 3);
|
||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo', $this->emetteur->name), 0, 'L', 0);
|
||||
|
||||
@ -841,12 +841,12 @@ class pdf_aurore extends ModelePDFSupplierProposal
|
||||
// Show payment mode CHQ
|
||||
if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'CHQ') {
|
||||
// Si mode reglement non force ou si force a CHQ
|
||||
if (!empty($conf->global->FACTURE_CHQ_NUMBER)) {
|
||||
if (getDolGlobalInt('FACTURE_CHQ_NUMBER')) {
|
||||
$diffsizetitle = (empty($conf->global->PDF_DIFFSIZE_TITLE) ? 3 : $conf->global->PDF_DIFFSIZE_TITLE);
|
||||
|
||||
if ($conf->global->FACTURE_CHQ_NUMBER > 0) {
|
||||
$account = new Account($this->db);
|
||||
$account->fetch($conf->global->FACTURE_CHQ_NUMBER);
|
||||
$account->fetch(getDolGlobalInt('FACTURE_CHQ_NUMBER'));
|
||||
|
||||
$pdf->SetXY($this->marge_gauche, $posy);
|
||||
$pdf->SetFont('', 'B', $default_font_size - $diffsizetitle);
|
||||
@ -860,7 +860,7 @@ class pdf_aurore extends ModelePDFSupplierProposal
|
||||
$posy = $pdf->GetY() + 2;
|
||||
}
|
||||
}
|
||||
if ($conf->global->FACTURE_CHQ_NUMBER == -1) {
|
||||
if (getDolGlobalInt('FACTURE_CHQ_NUMBER') == -1) {
|
||||
$pdf->SetXY($this->marge_gauche, $posy);
|
||||
$pdf->SetFont('', 'B', $default_font_size - $diffsizetitle);
|
||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo', $this->emetteur->name), 0, 'L', 0);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user