diff --git a/htdocs/core/lib/bank.lib.php b/htdocs/core/lib/bank.lib.php index 736b200bea3..4e8d9969c3c 100644 --- a/htdocs/core/lib/bank.lib.php +++ b/htdocs/core/lib/bank.lib.php @@ -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(); } diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index 153773a6519..182f15b5aa5 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -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; diff --git a/htdocs/margin/agentMargins.php b/htdocs/margin/agentMargins.php index e68576edd81..c209fb1f957 100644 --- a/htdocs/margin/agentMargins.php +++ b/htdocs/margin/agentMargins.php @@ -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) : '';