From ca39809658f116d974b76436761e38060c68f731 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Jul 2024 20:46:29 +0200 Subject: [PATCH 01/14] 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 9ca0c188fa2e0..1ddfd22832811 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -215,6 +215,7 @@ // 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 @@ ); // 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 @@ $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 02/14] =?UTF-8?q?fix:=20hidden=20option=20MAIN=5FKEEP=5FRE?= =?UTF-8?q?F=5FCUSTOMER=5FON=5FCLONING=20always=20win=20on=20pr=E2=80=A6?= =?UTF-8?q?=20(#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 6daca0f1c993e..699ade8172a53 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -1415,7 +1415,9 @@ public function createFromClone(User $user, $socid = 0, $forceentity = null, $up } // 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 05cfd3dc529989771b0274dc784e4cf4872f4481 Mon Sep 17 00:00:00 2001 From: ksar <35605507+ksar-ksar@users.noreply.github.com> Date: Wed, 10 Jul 2024 23:36:53 +0200 Subject: [PATCH 03/14] FIX #30274 : Add the include before executing dolibarr_set_const (#30320) --- htdocs/main.inc.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index b7e0c93ffcd5c..a5a353ff7192a 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1582,6 +1582,7 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr } // Refresh value of MAIN_IHM_PARAMS_REV before forging the parameter line. if (GETPOST('dol_resetcache')) { + include_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; dolibarr_set_const($db, "MAIN_IHM_PARAMS_REV", ((int) $conf->global->MAIN_IHM_PARAMS_REV) + 1, 'chaine', 0, '', $conf->entity); } 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 04/14] 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 bd8ccd0790188..76b4333010bf9 100644 --- a/htdocs/public/project/new.php +++ b/htdocs/public/project/new.php @@ -211,7 +211,7 @@ function llxFooterVierge() 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 05/14] 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 297013ed8ac1e..a7481c0be4beb 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 @@ protected function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs $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 11635c6511bcb..2b10608ab9319 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 @@ protected function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs $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); From eca8735e2216e8378cf1cbea5991946c409de0a1 Mon Sep 17 00:00:00 2001 From: MaximilienR-easya <122890855+MaximilienR-easya@users.noreply.github.com> Date: Sat, 13 Jul 2024 18:13:32 +0200 Subject: [PATCH 06/14] =?UTF-8?q?Fix=20les=20lien=20de=20t=C3=A9l=C3=A9cha?= =?UTF-8?q?rgement=20de=20facture=20fournisseur=20sur=20la=20page=20vue=20?= =?UTF-8?q?d'ensemble=20des=20projets=20(#30349)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/projet/element.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 537215896a1bc..d86076b2633e8 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -1207,8 +1207,8 @@ $filedir = $conf->fournisseur->commande->multidir_output[$element->entity].'/'.dol_sanitizeFileName($element->ref); } elseif ($element_doc === 'invoice_supplier') { $element_doc = 'facture_fournisseur'; - $filename = get_exdir($element->id, 2, 0, 0, $element, 'product').dol_sanitizeFileName($element->ref); - $filedir = $conf->fournisseur->facture->multidir_output[$element->entity].'/'.get_exdir($element->id, 2, 0, 0, $element, 'invoice_supplier').dol_sanitizeFileName($element->ref); + $filename = get_exdir($element->id, 2, 0, 0, $element, 'invoice_supplier').dol_sanitizeFileName($element->ref); + $filedir = $conf->fournisseur->facture->multidir_output[$element->entity].'/'.$filename; } print '
'.$formfile->getDocumentsLink($element_doc, $filename, $filedir).'
'; From 9487a4f91850078be88e85fa87cc44578cd23327 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 15 Jul 2024 00:43:30 +0200 Subject: [PATCH 07/14] FIX transfer in accountancy for expense reports. --- htdocs/accountancy/journal/bankjournal.php | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index 6b091db2cb85c..63726a7dd9ae4 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -212,10 +212,10 @@ $tabtype = array(); $tabmoreinfo = array(); - // Loop on each line into llx_bank table. For each line, we should get: - // one line tabpay = line into bank - // one line for bank record = tabbq - // one line for thirdparty record = tabtp + // Loop on each line into the table llx_bank. For each line, we should set: + // one line for bank record => tabbq + // one line for payment => tabpay + // one line for thirdparty or user record => tabtp $i = 0; while ($i < $num) { $obj = $db->fetch_object($result); @@ -307,15 +307,25 @@ // get_url may return -1 which is not traversable if (is_array($links) && count($links) > 0) { $is_sc = false; + $is_expensereport = false; foreach ($links as $v) { if ($v['type'] == 'sc') { $is_sc = true; break; } + if ($v['type'] == 'payment_expensereport') { + $is_expensereport = true; + break; + } } + // Now loop on each link of record in bank (code similar to bankentries_list.php) foreach ($links as $key => $val) { - if ($links[$key]['type'] == 'user' && !$is_sc) continue; + if ($links[$key]['type'] == 'user' && !$is_sc && !$is_expensereport) { + // We must avoid as much as possible this "continue". If we want to jump to next loop, it means we don't want to process + // the case the link is user (often because managed by hard coded code into another link), and we must avoid this. + continue; + } if (in_array($links[$key]['type'], array('sc', 'payment_sc', 'payment', 'payment_supplier', 'payment_vat', 'payment_expensereport', 'banktransfert', 'payment_donation', 'member', 'payment_loan', 'payment_salary', 'payment_various'))) { // So we excluded 'company' and 'user' here. We want only payment lines From 75d40e6b7281c8caf5490c4f4b70f2c9afe6f6b7 Mon Sep 17 00:00:00 2001 From: MaximilienR-easya <122890855+MaximilienR-easya@users.noreply.github.com> Date: Mon, 15 Jul 2024 21:07:09 +0200 Subject: [PATCH 08/14] Fix d'une erreur qui survient quand on ne selection aucun entrepot lors d'une recherche avec l'option alerte stock. on fini avec deux conditions d'entrepot qui se contredisent et qui font comme si tous les produits n'avaient aucun stocks (#30382) --- htdocs/product/stock/replenish.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index 17be55a86330d..603fb2764a9bd 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -366,7 +366,7 @@ $sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'product_stock as s ON p.rowid = s.fk_product'; $sql .= ' AND s.fk_entrepot IN (' . $db->sanitize($list_warehouse) . ')'; -$list_warehouse_selected = ($fk_entrepot < 0 || empty($fk_entrepot)) ? '0' : $fk_entrepot; +$list_warehouse_selected = ($fk_entrepot < 0 || empty($fk_entrepot)) ? $list_warehouse : $fk_entrepot; $sql .= ' AND s.fk_entrepot IN (' . $db->sanitize($list_warehouse_selected) . ')'; From 8d6d17c18dcde67a6a9b8c8fddd1afb58a3aa04f Mon Sep 17 00:00:00 2001 From: Sylvain Legrand Date: Tue, 16 Jul 2024 12:39:06 +0200 Subject: [PATCH 09/14] fix missing value on fetch (#30390) info_bits value is missing when fetching rows --- htdocs/fourn/class/fournisseur.commande.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 2c9436f7bd740..a25e8dec9a12c 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -532,7 +532,7 @@ public function fetch_lines($only_product = 0) $sql = "SELECT l.rowid, l.fk_commande, l.ref as ref_supplier, l.fk_product, l.product_type, l.label, l.description, l.qty,"; $sql .= " l.vat_src_code, l.tva_tx, l.remise_percent, l.subprice,"; $sql .= " l.localtax1_tx, l. localtax2_tx, l.localtax1_type, l. localtax2_type, l.total_localtax1, l.total_localtax2,"; - $sql .= " l.total_ht, l.total_tva, l.total_ttc, l.special_code, l.fk_parent_line, l.rang,"; + $sql .= " l.total_ht, l.total_tva, l.total_ttc, l.info_bits, l.special_code, l.fk_parent_line, l.rang,"; $sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.description as product_desc, p.tobatch as product_tobatch, p.barcode as product_barcode,"; $sql .= " l.fk_unit,"; $sql .= " l.date_start, l.date_end,"; @@ -633,6 +633,7 @@ public function fetch_lines($only_product = 0) $line->multicurrency_total_tva = $objp->multicurrency_total_tva; $line->multicurrency_total_ttc = $objp->multicurrency_total_ttc; + $line->info_bits = $objp->info_bits; $line->special_code = $objp->special_code; $line->fk_parent_line = $objp->fk_parent_line; From 50646e70a0a1600317e8384f5c0a1da1658cde8d Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Wed, 17 Jul 2024 19:42:12 +0200 Subject: [PATCH 10/14] FIX Accountancy - Generate entries of expense report with localtax (#30411) * FIX User List - Function is show in wrong column when module HRM enabled * FIX Accountancy - Generate entries of expense report with localtax. $cpttva don't exist --- .../journal/expensereportsjournal.php | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/htdocs/accountancy/journal/expensereportsjournal.php b/htdocs/accountancy/journal/expensereportsjournal.php index 20bc41e7752e2..9b69c83711351 100644 --- a/htdocs/accountancy/journal/expensereportsjournal.php +++ b/htdocs/accountancy/journal/expensereportsjournal.php @@ -1,13 +1,13 @@ - * Copyright (C) 2007-2010 Jean Heimburger - * Copyright (C) 2011 Juanjo Menent - * Copyright (C) 2012 Regis Houssin - * Copyright (C) 2013-2023 Alexandre Spangaro - * Copyright (C) 2013-2016 Olivier Geffroy - * Copyright (C) 2013-2016 Florian Henry - * Copyright (C) 2018 Frédéric France - * Copyright (C) 2018 Eric Seigne +/* Copyright (C) 2007-2010 Laurent Destailleur + * Copyright (C) 2007-2010 Jean Heimburger + * Copyright (C) 2011 Juanjo Menent + * Copyright (C) 2012 Regis Houssin + * Copyright (C) 2013-2024 Alexandre Spangaro + * Copyright (C) 2013-2016 Olivier Geffroy + * Copyright (C) 2013-2016 Florian Henry + * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018 Eric Seigne * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -155,8 +155,8 @@ $vatdata = getTaxesFromId($obj->tva_tx.($obj->vat_src_code ? ' ('.$obj->vat_src_code.')' : ''), $mysoc, $mysoc, 0); $compta_tva = (!empty($vatdata['accountancy_code_buy']) ? $vatdata['accountancy_code_buy'] : $account_vat); - $compta_localtax1 = (!empty($vatdata['accountancy_code_buy']) ? $vatdata['accountancy_code_buy'] : $cpttva); - $compta_localtax2 = (!empty($vatdata['accountancy_code_buy']) ? $vatdata['accountancy_code_buy'] : $cpttva); + $compta_localtax1 = (!empty($vatdata['accountancy_code_buy']) ? $vatdata['accountancy_code_buy'] : $account_vat); + $compta_localtax2 = (!empty($vatdata['accountancy_code_buy']) ? $vatdata['accountancy_code_buy'] : $account_vat); // Define array to display all VAT rates that use this accounting account $compta_tva if (price2num($obj->tva_tx) || !empty($obj->vat_src_code)) { From 4479b1e66286885eb38021f674e7b10814231dff Mon Sep 17 00:00:00 2001 From: Florian Charlaix Date: Wed, 17 Jul 2024 19:43:18 +0200 Subject: [PATCH 11/14] FIX Conflict with autoload (#30399) Co-authored-by: Laurent Destailleur --- .../framework/Luracast/Restler/AutoLoader.php | 53 ++++++++++++++----- 1 file changed, 41 insertions(+), 12 deletions(-) diff --git a/htdocs/includes/restler/framework/Luracast/Restler/AutoLoader.php b/htdocs/includes/restler/framework/Luracast/Restler/AutoLoader.php index a5a1fd98750e0..0f5b2c4e9f733 100644 --- a/htdocs/includes/restler/framework/Luracast/Restler/AutoLoader.php +++ b/htdocs/includes/restler/framework/Luracast/Restler/AutoLoader.php @@ -268,8 +268,8 @@ private function loadLastResort($className, $loader = null) return $this->loadThisLoader($className, $loader); } foreach ($loaders as $loader) - if (false !== $file = $this->loadThisLoader($className, $loader)) - return $file; + if (false !== $file = $this->loadThisLoader($className, $loader)) + return $file; return false; } @@ -285,23 +285,52 @@ private function loadLastResort($className, $loader = null) */ private function loadThisLoader($className, $loader) { + if (is_array($loader) + && is_callable($loader)) { + $b = new $loader[0]; + //avoid PHP Fatal error: Uncaught Error: Access to undeclared static property: Composer\\Autoload\\ClassLoader::$loader + //in case of multiple autoloader systems + if (property_exists($b, $loader[1])) { + if (false !== $file = $b::$loader[1]($className) + && $this->exists($className, $b::$loader[1])) { + return $file; + } + } + } elseif (is_callable($loader) + && false !== $file = $loader($className) + && $this->exists($className, $loader)) { + return $file; + } + return false; + + /* other code tested to reduce autoload conflict + $s = ''; if (is_array($loader) && is_callable($loader)) { + // @CHANGE DOL avoid autoload conflict + if (!preg_match('/LuraCast/', get_class($loader[0]))) { + return false; + } $b = new $loader[0]; - //avoid PHP Fatal error: Uncaught Error: Access to undeclared static property: Composer\\Autoload\\ClassLoader::$loader + // @CHANGE DOL avoid PHP Fatal error: Uncaught Error: Access to undeclared static property: Composer\\Autoload\\ClassLoader::$loader //in case of multiple autoloader systems if (property_exists($b, $loader[1])) { if (false !== $file = $b::$loader[1]($className) - && $this->exists($className, $b::$loader[1])) { - return $file; - } + && $this->exists($className, $b::$loader[1])) { + return $file; + } + } + } elseif (is_callable($loader, false, $s)) { + // @CHANGE DOL avoid PHP infinite loop (detected when xdebug is on) + if ($s == 'Luracast\Restler\AutoLoader::__invoke') { + return false; + } + if (false !== ($file = $loader($className)) && $this->exists($className, $loader)) { + return $file; } - } elseif (is_callable($loader) - && false !== $file = $loader($className) - && $this->exists($className, $loader)) { - return $file; } return false; + */ } /** @@ -417,7 +446,7 @@ public function __invoke($className) if (false !== $includeReference = $this->discover($className)) return $includeReference; - static::thereCanBeOnlyOne(); + //static::thereCanBeOnlyOne(); if (false !== $includeReference = $this->loadAliases($className)) return $includeReference; @@ -426,7 +455,7 @@ public function __invoke($className) return $includeReference; if (false !== $includeReference = $this->loadLastResort($className)) - return $includeReference; + return $includeReference; static::seen($className, true); return null; From f8da6187896cf6fd76530bb08e6bce026ef1ae92 Mon Sep 17 00:00:00 2001 From: Pichi1966 <57623859+josett225@users.noreply.github.com> Date: Wed, 17 Jul 2024 20:07:40 +0200 Subject: [PATCH 12/14] FIX : issue to get the right files exported in Quadratrus export.php (#30004) * FIX : issue to get the right files exported in Quadratrus export.php The export of files does not work correctly when using Accounting option export Quadratus with file export. The files are not attached to the zip until we uncommment the 3 lines of this PR. * Update export.php --- htdocs/accountancy/bookkeeping/export.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/export.php b/htdocs/accountancy/bookkeeping/export.php index 7f95698caa5ed..e7c97b475b9d6 100644 --- a/htdocs/accountancy/bookkeeping/export.php +++ b/htdocs/accountancy/bookkeeping/export.php @@ -1190,7 +1190,6 @@ require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; $objectstatic = new Facture($db); $objectstatic->fetch($line->fk_doc); - //$modulepart = 'facture'; $filename = dol_sanitizeFileName($line->doc_ref); $filedir = $conf->facture->dir_output.'/'.dol_sanitizeFileName($line->doc_ref); @@ -1202,11 +1201,10 @@ require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; $objectstatic = new FactureFournisseur($db); $objectstatic->fetch($line->fk_doc); - //$modulepart = 'invoice_supplier'; $filename = dol_sanitizeFileName($line->doc_ref); - $filedir = $conf->fournisseur->facture->dir_output.'/'.get_exdir($line->fk_doc, 2, 0, 0, $objectstatic, $modulepart).dol_sanitizeFileName($line->doc_ref); - $subdir = get_exdir($objectstatic->id, 2, 0, 0, $objectstatic, $modulepart).dol_sanitizeFileName($line->doc_ref); + $filedir = $conf->fournisseur->facture->dir_output.'/'.get_exdir($line->fk_doc, 2, 0, 0, $objectstatic, $objectstatic->element).dol_sanitizeFileName($line->doc_ref); + $subdir = get_exdir($objectstatic->id, 2, 0, 0, $objectstatic, $objectstatic->element).dol_sanitizeFileName($line->doc_ref); $documentlink = $formfile->getDocumentsLink($objectstatic->element, $subdir, $filedir); } elseif ($line->doc_type == 'expense_report') { $langs->loadLangs(array('trips')); @@ -1214,7 +1212,6 @@ require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; $objectstatic = new ExpenseReport($db); $objectstatic->fetch($line->fk_doc); - //$modulepart = 'expensereport'; $filename = dol_sanitizeFileName($line->doc_ref); $filedir = $conf->expensereport->dir_output.'/'.dol_sanitizeFileName($line->doc_ref); From 89b558a1b1696f4b66d90a5fa79ebf2644150b89 Mon Sep 17 00:00:00 2001 From: Sylvain Legrand Date: Tue, 23 Jul 2024 19:36:09 +0200 Subject: [PATCH 13/14] Fixes loss of rich text wrapping for translated category descriptions (#30433) If multi-language is enabled, saving translations of category descriptions loses the rich text wrapping (wysiwyg) --- htdocs/categories/traduction.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/categories/traduction.php b/htdocs/categories/traduction.php index 9791cdeb5be44..09c61378c7848 100644 --- a/htdocs/categories/traduction.php +++ b/htdocs/categories/traduction.php @@ -131,7 +131,7 @@ foreach ($object->multilangs as $key => $value) { // recording of new values in the object $libelle = GETPOST('libelle-'.$key, 'alpha'); - $desc = GETPOST('desc-'.$key); + $desc = GETPOST('desc-'.$key, 'restricthtml'); if (empty($libelle)) { $error++; From 1495c9d3ceafd62ac9750df00dbe8c0915922183 Mon Sep 17 00:00:00 2001 From: atm-lucas <121817516+atm-lucasmantegari@users.noreply.github.com> Date: Wed, 24 Jul 2024 18:13:22 +0200 Subject: [PATCH 14/14] Add element on childTables (#30445) --- htdocs/product/class/product.class.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index e754148f6d5ed..6532aea871685 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -70,7 +70,10 @@ class Product extends CommonObject 'facturedet' => array('name' => 'Invoice', 'parent' => 'facture', 'parentkey' => 'fk_facture'), 'contratdet' => array('name' => 'Contract', 'parent' => 'contrat', 'parentkey' => 'fk_contrat'), 'facture_fourn_det' => array('name' => 'SupplierInvoice', 'parent' => 'facture_fourn', 'parentkey' => 'fk_facture_fourn'), - 'commande_fournisseurdet' => array('name' => 'SupplierOrder', 'parent' => 'commande_fournisseur', 'parentkey' => 'fk_commande') + 'commande_fournisseurdet' => array('name' => 'SupplierOrder', 'parent' => 'commande_fournisseur', 'parentkey' => 'fk_commande'), + 'mrp_production' => array('name' => 'Mo', 'parent' => 'mrp_mo', 'parentkey' => 'fk_mo' ), + 'bom_bom' => array('name' => 'BOM'), + 'bom_bomline' => array('name' => 'BOMLine', 'parent' => 'bom_bom', 'parentkey' => 'fk_bom'), ); /**