From 74359d67d717b3296a9d592126213072d522c8be Mon Sep 17 00:00:00 2001 From: Nicolas Domenech <52404047+nicolas-eoxia@users.noreply.github.com> Date: Fri, 7 Jun 2024 16:23:56 +0200 Subject: [PATCH 1/6] Fix missing hook getNomUrl in ticket (#29881) --- htdocs/ticket/class/ticket.class.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 039082c3583..4e027b29d80 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -1535,7 +1535,7 @@ class Ticket extends CommonObject */ public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = -1) { - global $conf, $langs; + global $action, $conf, $hookmanager, $langs; if (!empty($conf->dol_no_mouse_hover)) { $notooltip = 1; // Force disable tooltips @@ -1598,6 +1598,15 @@ class Ticket extends CommonObject $result .= $linkend; //if ($withpicto != 2) $result.=(($addlabel && $this->label) ? $sep . dol_trunc($this->label, ($addlabel > 1 ? $addlabel : 0)) : ''); + $hookmanager->initHooks(array('ticketdao')); + $parameters = array('id' => $this->id, 'getnomurl' => &$result); + $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks + if ($reshook > 0) { + $result = $hookmanager->resPrint; + } else { + $result .= $hookmanager->resPrint; + } + return $result; } From a362532f0bb74ca21d3a4532af2d312845706805 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sat, 8 Jun 2024 01:28:05 +0200 Subject: [PATCH 2/6] FIX Missing expense report picto in menu (#29908) --- htdocs/core/menus/standard/eldy.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index e3ecaaf63e2..37721325ab6 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -2379,7 +2379,7 @@ function get_left_menu_hrm($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu = // Expense report if (isModEnabled('expensereport')) { $langs->loadLangs(array("trips", "bills")); - $newmenu->add("/expensereport/index.php?leftmenu=expensereport&mainmenu=hrm", $langs->trans("TripsAndExpenses"), 0, $user->hasRight('expensereport', 'lire'), '', $mainmenu, 'expensereport', 0, '', '', '', img_picto('', 'trip', 'class="paddingright pictofixedwidth"')); + $newmenu->add("/expensereport/index.php?leftmenu=expensereport&mainmenu=hrm", $langs->trans("TripsAndExpenses"), 0, $user->hasRight('expensereport', 'lire'), '', $mainmenu, 'expensereport', 0, '', '', '', img_picto('', 'expensereport', 'class="paddingright pictofixedwidth"')); $newmenu->add("/expensereport/card.php?action=create&leftmenu=expensereport&mainmenu=hrm", $langs->trans("New"), 1, $user->hasRight('expensereport', 'creer')); $newmenu->add("/expensereport/list.php?leftmenu=expensereport&mainmenu=hrm", $langs->trans("List"), 1, $user->hasRight('expensereport', 'lire')); if ($usemenuhider || empty($leftmenu) || $leftmenu == "expensereport") { From 19f68b0b6764ea77fa2cc393db84cc6c452a4df9 Mon Sep 17 00:00:00 2001 From: Vincent Maury Date: Sat, 8 Jun 2024 02:48:59 +0200 Subject: [PATCH 3/6] Add clean conditions to show "create purchase order" button in sale order card (#29906) * Add clean conditions to show "create purchase order" button in sale order card * Add clean conditions to show "create purchase order" button in sale order card * Add clean conditions to show "create purchase order" button in sale order card --- htdocs/commande/card.php | 7 ++++--- htdocs/core/class/commonorder.class.php | 22 ++++++++++++++++++++++ 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 2975115fb92..77ba69204bf 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -2949,11 +2949,12 @@ if ($action == 'create' && $usercancreate) { } $arrayforbutaction = array(); - // Create a purchase order - $arrayforbutaction[] = array('lang'=>'orders', 'enabled'=>(isModEnabled("supplier_order") && $object->statut > Commande::STATUS_DRAFT && $object->getNbOfServicesLines() > 0), 'perm'=>$usercancreatepurchaseorder, 'label'=>'AddPurchaseOrder', 'url'=>'/fourn/commande/card.php?action=create&origin='.$object->element.'&originid='.$object->id); + if (getDolGlobalInt('COMMANDE_DISABLE_ADD_PURCHASE_ORDER') == 0) { + $arrayforbutaction[] = array('lang'=>'orders', 'enabled'=>(isModEnabled("supplier_order") && $object->statut > Commande::STATUS_DRAFT && $object->getNbLinesProductOrServiceOnBuy(getDolGlobalInt('COMMANDE_ADD_PURCHASE_ORDER_IGNORE_FREE_PRODUCTS')) > 0), 'perm'=>$usercancreatepurchaseorder, 'label'=>'AddPurchaseOrder', 'url'=>'/fourn/commande/card.php?action=create&origin='.$object->element.'&originid='.$object->id); + } /*if (isModEnabled("supplier_order") && $object->statut > Commande::STATUS_DRAFT && $object->getNbOfServicesLines() > 0) { - if ($usercancreatepurchaseorder) { + if ($usercancreatepurchaseorder) { isModEnabled("supplier_order") && $object->statut > Commande::STATUS_DRAFT && $object->getNbOfServicesLines() > 0 print dolGetButtonAction('', $langs->trans('AddPurchaseOrder'), 'default', DOL_URL_ROOT.'/fourn/commande/card.php?action=create&origin='.$object->element.'&originid='.$object->id, ''); } }*/ diff --git a/htdocs/core/class/commonorder.class.php b/htdocs/core/class/commonorder.class.php index dc5de2b9863..b436cc21203 100644 --- a/htdocs/core/class/commonorder.class.php +++ b/htdocs/core/class/commonorder.class.php @@ -71,6 +71,28 @@ abstract class CommonOrder extends CommonObject return $return; } + /** return nb of fines of order where products or services that can be buyed + * + * @param boolean $ignoreFree Ignore free lines + * @return int number of products or services on buy in a command + */ + public function getNbLinesProductOrServiceOnBuy($ignoreFree = false) + { + require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; + $product = new Product($this->db); + $return = 0; + foreach ($this->lines as $line) { + if (empty($line->fk_product) && !$ignoreFree) { + $return ++; + } elseif ((int) $line->fk_product > 0) { + if ($product->fetch($line->fk_product) > 0) { + if ($product->status_buy) $return ++; + } + } + } + return $return; + } + /** * @var string code */ From 554df11558164fb9105ccd947f051ccde84d0c48 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sat, 8 Jun 2024 12:02:55 +0200 Subject: [PATCH 4/6] FIX Missing expense report picto in list (#29917) * FIX Missing expense report picto in menu * FIX Missing expense report picto in list --- htdocs/expensereport/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/expensereport/list.php b/htdocs/expensereport/list.php index 0d371731c90..fdd8f6dea86 100644 --- a/htdocs/expensereport/list.php +++ b/htdocs/expensereport/list.php @@ -524,7 +524,7 @@ if ($resql) { $newcardbutton .= dolGetButtonTitleSeparator(); $newcardbutton .= dolGetButtonTitle($langs->trans('NewTrip'), '', 'fa fa-plus-circle', $url, '', $user->hasRight('expensereport', 'creer')); - print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'trip', 0, $newcardbutton, '', $limit, 0, 0, 1); + print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'expensereport', 0, $newcardbutton, '', $limit, 0, 0, 1); } $topicmail = "SendExpenseReport"; From 1baec9ab27de81787d85df662e880a37b7b8838b Mon Sep 17 00:00:00 2001 From: sonikf <93765174+sonikf@users.noreply.github.com> Date: Sun, 9 Jun 2024 04:19:11 +0300 Subject: [PATCH 5/6] Update tva for Greece (#29849) * Update tva for Greece * Update tva for Greece * Update tva for Greece * Update tva for Greece --- htdocs/install/mysql/data/llx_c_tva.sql | 2 +- htdocs/install/mysql/migration/18.0.0-19.0.0.sql | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/install/mysql/data/llx_c_tva.sql b/htdocs/install/mysql/data/llx_c_tva.sql index 1ce92de287f..8d37e6e94d6 100644 --- a/htdocs/install/mysql/data/llx_c_tva.sql +++ b/htdocs/install/mysql/data/llx_c_tva.sql @@ -146,7 +146,7 @@ insert into llx_c_tva(rowid,fk_pays,taux,localtax1,localtax1_type,localtax2,loca insert into llx_c_tva(rowid,fk_pays,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1022, 102, 24, 0, '0', 0, '0', 0, 'Κανονικός Φ.Π.Α.', 1); insert into llx_c_tva(rowid,fk_pays,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1023, 102, 13, 0, '0', 0, '0', 0, 'Μειωμένος Φ.Π.Α.', 1); insert into llx_c_tva(rowid,fk_pays,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1024, 102, 6, 0, '0', 0, '0', 0, 'Υπερμειωμένος Φ.Π.Α.', 1); -insert into llx_c_tva(rowid,fk_pays,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1025, 102, 16, 0, '0', 0, '0', 0, 'Νήσων κανονικός Φ.Π.Α.', 1); +insert into llx_c_tva(rowid,fk_pays,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1025, 102, 3, 0, '0', 0, '0', 0, 'Νήσων υπερμειωμένος Φ.Π.Α.', 1); insert into llx_c_tva(rowid,fk_pays,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1026, 102, 9, 0, '0', 0, '0', 0, 'Νήσων μειωμένος Φ.Π.Α.', 1); insert into llx_c_tva(rowid,fk_pays,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1027, 102, 4, 0, '0', 0, '0', 0, 'Νήσων υπερμειωμένος Φ.Π.Α.', 1); insert into llx_c_tva(rowid,fk_pays,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1028, 102, 17, 0, '0', 0, '0', 0, 'Νήσων υπερμειωμένος Φ.Π.Α.', 1); diff --git a/htdocs/install/mysql/migration/18.0.0-19.0.0.sql b/htdocs/install/mysql/migration/18.0.0-19.0.0.sql index d35c9ad49f4..75a150fc262 100644 --- a/htdocs/install/mysql/migration/18.0.0-19.0.0.sql +++ b/htdocs/install/mysql/migration/18.0.0-19.0.0.sql @@ -218,3 +218,5 @@ ALTER TABLE llx_bom_bomline ADD COLUMN tms timestamp DEFAULT CURRENT_TIMESTAMP O UPDATE llx_c_type_contact SET element = 'stocktransfer' WHERE element = 'StockTransfer'; UPDATE llx_c_units SET scale = 1 WHERE code = 'S'; + +UPDATE llx_c_tva SET taux = 3, note = 'Νήσων υπερμειωμένος Φ.Π.Α.' WHERE fk_pays = 102 AND taux = 16; From 3c06fe163ea946b17aab904223aab9a5a6468a67 Mon Sep 17 00:00:00 2001 From: Lucas Marcouiller <45882981+Hystepik@users.noreply.github.com> Date: Sun, 9 Jun 2024 03:20:06 +0200 Subject: [PATCH 6/6] Fix #29843 warning division by zero (#29848) Co-authored-by: Hystepik --- htdocs/compta/stats/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/stats/index.php b/htdocs/compta/stats/index.php index 835d8a999fe..f547ca12ba7 100644 --- a/htdocs/compta/stats/index.php +++ b/htdocs/compta/stats/index.php @@ -461,7 +461,7 @@ for ($mois = 1 + $nb_mois_decalage; $mois <= 12 + $nb_mois_decalage; $mois++) { //var_dump($annee.' '.$year_end.' '.$mois.' '.$month_end); if ($annee < $year_end || ($annee == $year_end && $mois <= $month_end)) { if ($annee_decalage > $minyear && $case <= $casenow) { - if (!empty($cum[$caseprev]) && !empty($cum[$case])) { + if (!empty($cum[$caseprev]) && !empty($cum[$case]) && $cum[$caseprev] != 0) { $percent = (round(($cum[$case] - $cum[$caseprev]) / $cum[$caseprev], 4) * 100); //print "X $cum[$case] - $cum[$caseprev] - $cum[$caseprev] - $percent X"; print($percent >= 0 ? "+$percent" : "$percent").'%';