From 7249e3a4d184d01d8a02a4c013fe49aa7e1637bb Mon Sep 17 00:00:00 2001 From: lvessiller-opendsi Date: Thu, 6 Jun 2024 15:33:35 +0200 Subject: [PATCH] FIX init total amounts in margin module (#29854) --- htdocs/margin/agentMargins.php | 4 +++- htdocs/margin/customerMargins.php | 3 +++ htdocs/margin/productMargins.php | 3 +++ htdocs/margin/tabs/productMargins.php | 4 ++-- htdocs/margin/tabs/thirdpartyMargins.php | 3 +++ 5 files changed, 14 insertions(+), 3 deletions(-) diff --git a/htdocs/margin/agentMargins.php b/htdocs/margin/agentMargins.php index f369f1889c2..e0687a59811 100644 --- a/htdocs/margin/agentMargins.php +++ b/htdocs/margin/agentMargins.php @@ -226,7 +226,9 @@ if (!empty($enddateyear)) { $param .= "&enddateyear=".urlencode($enddateyear); } - +$totalMargin = 0; +$marginRate = ''; +$markRate = ''; dol_syslog('margin::agentMargins.php', LOG_DEBUG); $result = $db->query($sql); if ($result) { diff --git a/htdocs/margin/customerMargins.php b/htdocs/margin/customerMargins.php index 93850b8ec10..9009b9f8800 100644 --- a/htdocs/margin/customerMargins.php +++ b/htdocs/margin/customerMargins.php @@ -297,6 +297,9 @@ if (is_array($listofcateg)) { } } +$totalMargin = 0; +$marginRate = ''; +$markRate = ''; dol_syslog('margin::customerMargins.php', LOG_DEBUG); $result = $db->query($sql); if ($result) { diff --git a/htdocs/margin/productMargins.php b/htdocs/margin/productMargins.php index 32cb3c9292d..bd8ab227559 100644 --- a/htdocs/margin/productMargins.php +++ b/htdocs/margin/productMargins.php @@ -247,6 +247,9 @@ if (is_array($listofcateg)) { } } +$totalMargin = 0; +$marginRate = ''; +$markRate = ''; dol_syslog('margin::productMargins.php', LOG_DEBUG); $result = $db->query($sql); if ($result) { diff --git a/htdocs/margin/tabs/productMargins.php b/htdocs/margin/tabs/productMargins.php index 1bda53b5c5d..e01252d2add 100644 --- a/htdocs/margin/tabs/productMargins.php +++ b/htdocs/margin/tabs/productMargins.php @@ -75,8 +75,8 @@ $invoicestatic = new Facture($db); $form = new Form($db); $totalMargin = 0; -$marginRate = 0; -$markRate = 0; +$marginRate = ''; +$markRate = ''; if ($id > 0 || !empty($ref)) { $result = $object->fetch($id, $ref); diff --git a/htdocs/margin/tabs/thirdpartyMargins.php b/htdocs/margin/tabs/thirdpartyMargins.php index 3202dcb93ce..dfb080126d0 100644 --- a/htdocs/margin/tabs/thirdpartyMargins.php +++ b/htdocs/margin/tabs/thirdpartyMargins.php @@ -93,6 +93,9 @@ if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/', $help_url = 'EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; llxHeader('', $title, $help_url); +$totalMargin = 0; +$marginRate = ''; +$markRate = ''; if ($socid > 0) { $object = new Societe($db); $object->fetch($socid);