update code for a better php8 compliance

This commit is contained in:
Philippe GRAND 2023-04-05 11:23:53 +02:00
parent afda5c0416
commit ee04c5a0fc

View File

@ -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);