Merge pull request #24582 from MaximilienR-easya/v17_php8_compatibility

PHP8 compatibility
This commit is contained in:
Laurent Destailleur 2023-04-26 10:53:39 +02:00 committed by GitHub
commit 55ace3e601
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 2 deletions

View File

@ -318,7 +318,7 @@ function getIbanHumanReadable(Account $account)
{
if ($account->getCountryCode() == 'FR') {
require_once DOL_DOCUMENT_ROOT.'/includes/php-iban/oophp-iban.php';
$ibantoprint = preg_replace('/[^a-zA-Z0-9]/', '', $account->iban);
$ibantoprint = preg_replace('/[^a-zA-Z0-9]/', '', empty($account->iban)?'':$account->iban);
$iban = new PHP_IBAN\IBAN($ibantoprint);
return $iban->HumanFormat();
}

View File

@ -414,7 +414,7 @@ if ($outputalsopricetotalwithtax) {
if ($this->statut == 0 && !empty($object_rights->creer) && $action != 'selectlines') {
$situationinvoicelinewithparent = 0;
if ($line->fk_prev_id != null && in_array($object->element, array('facture', 'facturedet'))) {
if (isset($line->fk_prev_id) && in_array($object->element, array('facture', 'facturedet'))) {
if ($object->type == $object::TYPE_SITUATION) { // The constant TYPE_SITUATION exists only for object invoice
// Set constant to disallow editing during a situation cycle
$situationinvoicelinewithparent = 1;

View File

@ -347,6 +347,12 @@ if ($result) {
}
// Show total margin
if (!isset($cumul_achat)) {
$cumul_achat = 0;
}
if (!isset($cumul_vente)) {
$cumul_vente = 0;
}
$totalMargin = $cumul_vente - $cumul_achat;
$marginRate = ($cumul_achat != 0) ? (100 * $totalMargin / $cumul_achat) : '';