From ca39809658f116d974b76436761e38060c68f731 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Jul 2024 20:46:29 +0200 Subject: [PATCH 1/4] Fix #30256 --- htdocs/accountancy/journal/bankjournal.php | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index 9ca0c188fa2..1ddfd228328 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -215,6 +215,7 @@ if ($result) { // one line tabpay = line into bank // one line for bank record = tabbq // one line for thirdparty record = tabtp + // Note: tabcompany is used to store the subledger account $i = 0; while ($i < $num) { $obj = $db->fetch_object($result); @@ -262,7 +263,8 @@ if ($result) { ); // Set accountancy code for user - // $obj->accountancy_code is the accountancy_code of table u=user but it is defined only if a link with type 'user' exists) + // $obj->accountancy_code is the accountancy_code of table u=user (but it is defined only if + // a link with type 'user' exists and user as a subledger account) $compta_user = (!empty($obj->accountancy_code) ? $obj->accountancy_code : ''); $tabuser[$obj->rowid] = array( @@ -359,13 +361,25 @@ if ($result) { $userstatic->lastname = $tabuser[$obj->rowid]['lastname']; $userstatic->statut = $tabuser[$obj->rowid]['status']; $userstatic->accountancy_code = $tabuser[$obj->rowid]['accountancy_code']; + // For a payment of social contribution, we have a link sc + user. + // but we already fill the $tabpay[$obj->rowid]["soclib"] in the line 'sc'. + // If we fill it here to, we must concat if ($userstatic->id > 0) { - $tabpay[$obj->rowid]["soclib"] = $userstatic->getNomUrl(1, 'accountancy', 0); + if ($is_sc) { + $tabpay[$obj->rowid]["soclib"] .= ' '.$userstatic->getNomUrl(1, 'accountancy', 0); + } else { + $tabpay[$obj->rowid]["soclib"] = $userstatic->getNomUrl(1, 'accountancy', 0); + } } else { $tabpay[$obj->rowid]["soclib"] = '???'; // Should not happen, but happens with old data when id of user was not saved on expense report payment. } + if ($compta_user) { - $tabtp[$obj->rowid][$compta_user] += $amounttouse; + if ($is_sc) { + //$tabcompany[$obj->rowid][$compta_user] += $amounttouse; + } else { + $tabtp[$obj->rowid][$compta_user] += $amounttouse; + } } } elseif ($links[$key]['type'] == 'sc') { $chargestatic->id = $links[$key]['url_id']; From 32aaab75b57e3d976e93452b1c532e4e29d0a1ff Mon Sep 17 00:00:00 2001 From: HENRY Florian Date: Wed, 10 Jul 2024 18:53:57 +0200 Subject: [PATCH 2/4] =?UTF-8?q?fix:=20hidden=20option=20MAIN=5FKEEP=5FREF?= =?UTF-8?q?=5FCUSTOMER=5FON=5FCLONING=20always=20win=20on=20pr=E2=80=A6=20?= =?UTF-8?q?(#30340)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: hidden option MAIN_KEEP_REF_CUSTOMER_ON_CLONING always win on propal clone even if it's for enother customer * Update propal.class.php --------- Co-authored-by: Laurent Destailleur --- htdocs/comm/propal/class/propal.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 6daca0f1c99..699ade8172a 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -1415,7 +1415,9 @@ class Propal extends CommonObject } // reset ref_client - $object->ref_client = ''; + if (!getDolGlobalString('MAIN_KEEP_REF_CUSTOMER_ON_CLONING')) { + $object->ref_client = ''; + } // TODO Change product price if multi-prices } else { From 2335ea3067ba3ea8996731639369b26d9e000fb9 Mon Sep 17 00:00:00 2001 From: iouston <4319513+iouston@users.noreply.github.com> Date: Thu, 11 Jul 2024 10:26:46 +0200 Subject: [PATCH 3/4] FIX public project form return an error if SOCIETE_EMAIL_UNIQUE (#29942) * FIX Bug - public project form return an error if SOCIETE_EMAIL_UNIQUE if SOCIETE_EMAIL_UNIQUE is 1, this form returns an error because the third party already exists. * after comment from eldy --- htdocs/public/project/new.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/public/project/new.php b/htdocs/public/project/new.php index bd8ccd07901..76b4333010b 100644 --- a/htdocs/public/project/new.php +++ b/htdocs/public/project/new.php @@ -211,7 +211,7 @@ if (empty($reshook) && $action == 'add') { if (!$error) { // Search thirdparty and set it if found to the new created project - $result = $thirdparty->fetch(0, '', '', '', '', '', '', '', '', '', $object->email); + $result = $thirdparty->fetch(0, '', '', '', '', '', '', '', '', '', GETPOST('email')); if ($result > 0) { $proj->socid = $thirdparty->id; } else { From 09fdb887bbdc3759b52682ccfa8158c4ab493679 Mon Sep 17 00:00:00 2001 From: lvessiller-opendsi Date: Sat, 13 Jul 2024 17:18:05 +0200 Subject: [PATCH 4/4] FIX expedition PDF models using units labels (#30358) --- .../core/modules/expedition/doc/pdf_espadon.modules.php | 8 ++++---- htdocs/core/modules/expedition/doc/pdf_rouget.modules.php | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php index 297013ed8ac..a7481c0be4b 100644 --- a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php @@ -847,11 +847,11 @@ class pdf_espadon extends ModelePdfExpedition $object->volume_units = $object->size_units * 3; } - if ($totalWeight != '') { - $totalWeighttoshow = showDimensionInBestUnit($totalWeight, 0, "weight", $outputlangs); + if (!empty($totalWeight)) { + $totalWeighttoshow = showDimensionInBestUnit($totalWeight, 0, "weight", $outputlangs, -1, 'no', 1); } - if ($totalVolume != '') { - $totalVolumetoshow = showDimensionInBestUnit($totalVolume, 0, "volume", $outputlangs); + if (!empty($totalVolume)) { + $totalVolumetoshow = showDimensionInBestUnit($totalVolume, 0, "volume", $outputlangs, -1, 'no', 1); } if ($object->trueWeight) { $totalWeighttoshow = showDimensionInBestUnit($object->trueWeight, $object->weight_units, "weight", $outputlangs); diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php index 11635c6511b..2b10608ab93 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -734,11 +734,11 @@ class pdf_rouget extends ModelePdfExpedition $object->volume_units = $object->size_units * 3; } - if ($totalWeight != '') { - $totalWeighttoshow = showDimensionInBestUnit($totalWeight, 0, "weight", $outputlangs); + if (!empty($totalWeight)) { + $totalWeighttoshow = showDimensionInBestUnit($totalWeight, 0, "weight", $outputlangs, -1, 'no', 1); } - if ($totalVolume != '') { - $totalVolumetoshow = showDimensionInBestUnit($totalVolume, 0, "volume", $outputlangs); + if (!empty($totalVolume)) { + $totalVolumetoshow = showDimensionInBestUnit($totalVolume, 0, "volume", $outputlangs, -1, 'no', 1); } if (!empty($object->trueWeight)) { $totalWeighttoshow = showDimensionInBestUnit($object->trueWeight, $object->weight_units, "weight", $outputlangs);