Merge pull request #24582 from MaximilienR-easya/v17_php8_compatibility
PHP8 compatibility
This commit is contained in:
commit
55ace3e601
@ -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();
|
||||
}
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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) : '';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user