From 715aeb91d9131ff00a0318786d5c508917a18ca5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 20 Jan 2026 23:16:24 +0100 Subject: [PATCH] Fix CI --- .../core/class/commondocgenerator.class.php | 94 +++++++++---------- htdocs/core/lib/functions.lib.php | 1 - .../accountancy/doc/pdf_balance.modules.php | 2 +- .../doc/pdf_bookkeeping.modules.php | 2 +- .../accountancy/doc/pdf_ledger.modules.php | 2 +- .../asset/doc/pdf_standard_asset.modules.php | 4 +- 6 files changed, 52 insertions(+), 53 deletions(-) diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index 7a2e72da877..ce25089e5b6 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -390,23 +390,23 @@ abstract class CommonDocGenerator } $array_member = array( - 'mymember_lastname' => $member->lastname, - 'mymember_firstname' => $member->firstname, + 'mymember_lastname' => (string) $member->lastname, + 'mymember_firstname' => (string) $member->firstname, 'mymember_fullname' => $member->getFullName($outputlangs, 1), - 'mymember_login' => $member->login, - 'mymember_address' => $member->address, - 'mymember_zip' => $member->zip, - 'mymember_town' => $member->town, - 'mymember_country_code' => $member->country_code, - 'mymember_country' => $member->country, - 'mymember_state_code' => $member->state_code, - 'mymember_state' => $member->state, - 'mymember_phone_perso' => $member->phone_perso, - 'mymember_phone_pro' => $member->phone, - 'mymember_phone_mobile' => $member->phone_mobile, - 'mymember_email' => $member->email, + 'mymember_login' => (string) $member->login, + 'mymember_address' => (string) $member->address, + 'mymember_zip' => (string) $member->zip, + 'mymember_town' => (string) $member->town, + 'mymember_country_code' => (string) $member->country_code, + 'mymember_country' => (string) $member->country, + 'mymember_state_code' => (string) $member->state_code, + 'mymember_state' => (string) $member->state, + 'mymember_phone_perso' => (string) $member->phone_perso, + 'mymember_phone_pro' => (string) $member->phone, + 'mymember_phone_mobile' => (string) $member->phone_mobile, + 'mymember_email' => (string) $member->email, 'mymember_logo' => $logotouse, - 'mymember_gender' => $member->gender, + 'mymember_gender' => (string) $member->gender, 'mymember_birth_locale' => dol_print_date($member->birth, 'day', 'tzuser', $outputlangs), 'mymember_birth' => dol_print_date($member->birth, 'day', 'tzuser'), ); @@ -504,39 +504,39 @@ abstract class CommonDocGenerator } $array_thirdparty = array( - 'company_name' => $object->name, - 'company_name_alias' => $object->name_alias, - 'company_email' => $object->email, - 'company_phone' => $object->phone, - 'company_fax' => $object->fax, - 'company_address' => $object->address, - 'company_zip' => $object->zip, - 'company_town' => $object->town, - 'company_country' => $object->country, - 'company_country_code' => $object->country_code, - 'company_state' => $object->state, - 'company_state_code' => $object->state_code, - 'company_web' => $object->url, - 'company_barcode' => $object->barcode, - 'company_vatnumber' => $object->tva_intra, - 'company_customercode' => $object->code_client, - 'company_suppliercode' => $object->code_fournisseur, - 'company_customeraccountancycode' => $object->code_compta_client, - 'company_supplieraccountancycode' => $object->code_compta_fournisseur, - 'company_juridicalstatus' => $object->forme_juridique, - 'company_outstanding_limit' => $object->outstanding_limit, - 'company_capital' => $object->capital, + 'company_name' => (string) $object->name, + 'company_name_alias' => (string) $object->name_alias, + 'company_email' => (string) $object->email, + 'company_phone' => (string) $object->phone, + 'company_fax' => (string) $object->fax, + 'company_address' => (string) $object->address, + 'company_zip' => (string) $object->zip, + 'company_town' => (string) $object->town, + 'company_country' => (string) $object->country, + 'company_country_code' => (string) $object->country_code, + 'company_state' => (string) $object->state, + 'company_state_code' => (string) $object->state_code, + 'company_web' => (string) $object->url, + 'company_barcode' => (string) $object->barcode, + 'company_vatnumber' => (string) $object->tva_intra, + 'company_customercode' => (string) $object->code_client, + 'company_suppliercode' => (string) $object->code_fournisseur, + 'company_customeraccountancycode' => (string) $object->code_compta_client, + 'company_supplieraccountancycode' => (string) $object->code_compta_fournisseur, + 'company_juridicalstatus' => (string) $object->forme_juridique, + 'company_outstanding_limit' => (string) $object->outstanding_limit, + 'company_capital' => (string) $object->capital, 'company_capital_formated' => price($object->capital, 0, '', 1, -1), - 'company_idprof1' => $object->idprof1, - 'company_idprof2' => $object->idprof2, - 'company_idprof3' => $object->idprof3, - 'company_idprof4' => $object->idprof4, - 'company_idprof5' => $object->idprof5, - 'company_idprof6' => $object->idprof6, - 'company_note_public' => $object->note_public, - 'company_note_private' => $object->note_private, - 'company_default_bank_iban' => (is_object($object->bank_account) ? $object->bank_account->iban : ''), - 'company_default_bank_bic' => (is_object($object->bank_account) ? $object->bank_account->bic : '') + 'company_idprof1' => (string) $object->idprof1, + 'company_idprof2' => (string) $object->idprof2, + 'company_idprof3' => (string) $object->idprof3, + 'company_idprof4' => (string) $object->idprof4, + 'company_idprof5' => (string) $object->idprof5, + 'company_idprof6' => (string) $object->idprof6, + 'company_note_public' => (string) $object->note_public, + 'company_note_private' => (string) $object->note_private, + 'company_default_bank_iban' => (is_object($object->bank_account) ? (string) $object->bank_account->iban : ''), + 'company_default_bank_bic' => (is_object($object->bank_account) ? (string) $object->bank_account->bic : '') ); // Retrieve extrafields diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 8e8b2330a85..907f7d7cb28 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -7592,7 +7592,6 @@ function vatrate($rate, $addpercent = false, $info_bits = 0, $usestarfornpr = 0, * @param ''|'MU'|'MT'|'MS'|'CU'|'CT'|int<-2,max> $forcerounding MAXIMUM number of decimal to forcerounding decimal: -1=no change, -2=keep non zero part, 'MU' or 'MT' or a numeric to round to MU or MT or to a given number of decimal * @param string $currency_code To add currency symbol (''=add nothing, 'auto'=Use default currency, 'XXX'=add currency symbols for XXX currency) * @return string String with formatted amount - * * @see price2num() Revert function of price */ function price($amount, $form = 0, $outlangs = '', $trunc = 1, $rounding = -1, $forcerounding = -1, $currency_code = '') diff --git a/htdocs/core/modules/accountancy/doc/pdf_balance.modules.php b/htdocs/core/modules/accountancy/doc/pdf_balance.modules.php index 79405e3723f..5273e4fcdf4 100644 --- a/htdocs/core/modules/accountancy/doc/pdf_balance.modules.php +++ b/htdocs/core/modules/accountancy/doc/pdf_balance.modules.php @@ -668,7 +668,7 @@ class pdf_balance extends ModelePdfAccountancy // Name of soc $pdf->SetXY($this->marge_gauche + 2, $posy + 2); - $text = $this->emetteur->name; + $text = (string) $this->emetteur->name; $pdf->MultiCell($w / 3, 4, $outputlangs->convToOutputCharset($text), 0, $ltrdirection); $nexY = max($pdf->GetY(), $nexY); diff --git a/htdocs/core/modules/accountancy/doc/pdf_bookkeeping.modules.php b/htdocs/core/modules/accountancy/doc/pdf_bookkeeping.modules.php index 5a285036363..1b90dd3f4ce 100644 --- a/htdocs/core/modules/accountancy/doc/pdf_bookkeeping.modules.php +++ b/htdocs/core/modules/accountancy/doc/pdf_bookkeeping.modules.php @@ -653,7 +653,7 @@ class pdf_bookkeeping extends ModelePdfAccountancy // Name of soc $pdf->SetXY($this->marge_gauche + 2, $posy + 2); - $text = $this->emetteur->name; + $text = (string) $this->emetteur->name; $pdf->MultiCell($w / 3, 4, $outputlangs->convToOutputCharset($text), 0, $ltrdirection); $nexY = max($pdf->GetY(), $nexY); diff --git a/htdocs/core/modules/accountancy/doc/pdf_ledger.modules.php b/htdocs/core/modules/accountancy/doc/pdf_ledger.modules.php index d5891c02835..ad2f6384568 100644 --- a/htdocs/core/modules/accountancy/doc/pdf_ledger.modules.php +++ b/htdocs/core/modules/accountancy/doc/pdf_ledger.modules.php @@ -707,7 +707,7 @@ class pdf_ledger extends ModelePdfAccountancy // Name of soc $pdf->SetXY($this->marge_gauche + 2, $posy + 2); - $text = $this->emetteur->name; + $text = (string) $this->emetteur->name; $pdf->MultiCell($w / 3, 4, $outputlangs->convToOutputCharset($text), 0, $ltrdirection); $nexY = max($pdf->GetY(), $nexY); diff --git a/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php b/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php index 282a8a762ae..5c7b994d230 100644 --- a/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php +++ b/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php @@ -542,7 +542,7 @@ class pdf_standard_asset extends ModelePDFAsset $sign = 1; - // Collecte des totaux par valeur de tva dans $this->tva["taux"]=total_tva + // Collect total by value of vat rate into $this->tva["taux"]=total_tva $prev_progress = $object->lines[$i]->get_prev_progress($object->id); if ($prev_progress > 0 && !empty($object->lines[$i]->situation_percent)) { // Compute progress from previous situation if (isModEnabled("multicurrency") && $object->multicurrency_tx != 1) { @@ -852,7 +852,7 @@ class pdf_standard_asset extends ModelePDFAsset $pdf->MultiCell($w, 3, $outputlangs->transnoentities("ErrorGoToGlobalSetup"), 0, 'L'); } } else { - $text = $this->emetteur->name; + $text = (string) $this->emetteur->name; $pdf->MultiCell($w, 4, $outputlangs->convToOutputCharset($text), 0, 'L'); } }