diff --git a/dev/tools/phan/config.php b/dev/tools/phan/config.php index 2290d297499..5cb5b5b2f07 100644 --- a/dev/tools/phan/config.php +++ b/dev/tools/phan/config.php @@ -495,7 +495,7 @@ return [ 'PhanTypeInvalidLeftOperandOfBitwiseOp', // 'PhanTypeMismatchDimAssignment', // 'PhanPluginDescriptionlessCommentOnProtectedMethod', - 'PhanPluginPrintfIncompatibleArgumentTypeWeak', + // 'PhanPluginPrintfIncompatibleArgumentTypeWeak', 'PhanUndeclaredVariableAssignOp', 'PhanTypeExpectedObjectOrClassName', 'PhanEmptyFQSENInClasslike', diff --git a/htdocs/compta/bank/annuel.php b/htdocs/compta/bank/annuel.php index 5978fcc75b8..ff8260fce9d 100644 --- a/htdocs/compta/bank/annuel.php +++ b/htdocs/compta/bank/annuel.php @@ -3,6 +3,7 @@ * Copyright (C) 2004-2017 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2013-2023 Charlene BENKE + * Copyright (C) 2024 MDW * * 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 @@ -205,7 +206,7 @@ for ($mois = 1; $mois < 13; $mois++) { print "".dol_print_date(dol_mktime(1, 1, 1, $mois, 1, 2000), "%B").""; for ($annee = $year_start; $annee <= $year_end; $annee++) { - $case = sprintf("%04s-%02s", $annee, $mois); + $case = sprintf("%04d-%02d", $annee, $mois); print ' '; if (isset($decaiss[$case]) && $decaiss[$case] > 0) { diff --git a/htdocs/compta/resultat/result.php b/htdocs/compta/resultat/result.php index 21fa04cc931..daa017a0130 100644 --- a/htdocs/compta/resultat/result.php +++ b/htdocs/compta/resultat/result.php @@ -3,6 +3,7 @@ * Copyright (C) 2016-2022 Alexandre Spangaro * Copyright (C) 2018-2020 Laurent Destailleur * Copyright (C) 2018 Frédéric France + * Copyright (C) 2024 MDW * * 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 @@ -260,12 +261,12 @@ print ''.$langs->trans("PreviousPeriod").''; print ''.$langs->trans("SelectedPeriod").''; foreach ($months as $k => $v) { if (($k + 1) >= $date_startmonth && $k < $date_endmonth) { - print ''.$langs->trans('MonthShort'.sprintf("%02s", ($k + 1))).''; + print ''.$langs->trans('MonthShort'.sprintf("%02d", ($k + 1))).''; } } foreach ($months as $k => $v) { if (($k + 1) < $date_startmonth) { - print ''.$langs->trans('MonthShort'.sprintf("%02s", ($k + 1))).''; + print ''.$langs->trans('MonthShort'.sprintf("%02d", ($k + 1))).''; } } print ''; diff --git a/htdocs/core/modules/asset/mod_asset_standard.php b/htdocs/core/modules/asset/mod_asset_standard.php index bc0705840d3..d09748f158c 100644 --- a/htdocs/core/modules/asset/mod_asset_standard.php +++ b/htdocs/core/modules/asset/mod_asset_standard.php @@ -2,6 +2,8 @@ /* Copyright (C) 2005-2010 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2022-2024 Frédéric France + * Copyright (C) 2022 Frédéric France + * Copyright (C) 2024 MDW * * 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 @@ -156,7 +158,7 @@ class mod_asset_standard extends ModeleNumRefAsset if ($max >= (pow(10, 4) - 1)) { $num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is } else { - $num = sprintf("%04s", $max + 1); + $num = sprintf("%04d", $max + 1); } dol_syslog("mod_asset_standard::getNextValue return ".$this->prefix.$yymm."-".$num); diff --git a/htdocs/core/modules/bom/mod_bom_standard.php b/htdocs/core/modules/bom/mod_bom_standard.php index 1e4c22fb754..69656164461 100644 --- a/htdocs/core/modules/bom/mod_bom_standard.php +++ b/htdocs/core/modules/bom/mod_bom_standard.php @@ -2,6 +2,7 @@ /* Copyright (C) 2005-2010 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * 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 @@ -148,7 +149,7 @@ class mod_bom_standard extends ModeleNumRefBoms if ($max >= (pow(10, 4) - 1)) { $num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is } else { - $num = sprintf("%04s", $max + 1); + $num = sprintf("%04d", $max + 1); } dol_syslog("mod_bom_standard::getNextValue return ".$this->prefix.$yymm."-".$num); diff --git a/htdocs/core/modules/cheque/mod_chequereceipt_mint.php b/htdocs/core/modules/cheque/mod_chequereceipt_mint.php index 8cf6c383e65..3f760794750 100644 --- a/htdocs/core/modules/cheque/mod_chequereceipt_mint.php +++ b/htdocs/core/modules/cheque/mod_chequereceipt_mint.php @@ -1,6 +1,7 @@ * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * 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 @@ -145,7 +146,7 @@ class mod_chequereceipt_mint extends ModeleNumRefChequeReceipts if ($max >= (pow(10, 4) - 1)) { $num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is } else { - $num = sprintf("%04s", $max + 1); + $num = sprintf("%04d", $max + 1); } dol_syslog(__METHOD__." return ".$this->prefix.$yymm."-".$num); diff --git a/htdocs/core/modules/commande/mod_commande_marbre.php b/htdocs/core/modules/commande/mod_commande_marbre.php index 4bd0c9a9c33..71ccfb8915e 100644 --- a/htdocs/core/modules/commande/mod_commande_marbre.php +++ b/htdocs/core/modules/commande/mod_commande_marbre.php @@ -2,6 +2,7 @@ /* Copyright (C) 2005-2010 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * 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 @@ -160,7 +161,7 @@ class mod_commande_marbre extends ModeleNumRefCommandes if ($max >= (pow(10, 4) - 1)) { $num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is } else { - $num = sprintf("%04s", $max + 1); + $num = sprintf("%04d", $max + 1); } dol_syslog("mod_commande_marbre::getNextValue return ".$this->prefix.$yymm."-".$num); diff --git a/htdocs/core/modules/contract/mod_contract_serpis.php b/htdocs/core/modules/contract/mod_contract_serpis.php index 4c7979728e4..e0ffb17003c 100644 --- a/htdocs/core/modules/contract/mod_contract_serpis.php +++ b/htdocs/core/modules/contract/mod_contract_serpis.php @@ -1,6 +1,7 @@ * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * 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 @@ -29,7 +30,6 @@ require_once DOL_DOCUMENT_ROOT.'/core/modules/contract/modules_contract.php'; */ class mod_contract_serpis extends ModelNumRefContracts { - // variables inherited from ModelNumRefContracts class public $name = 'Serpis'; public $version = 'dolibarr'; @@ -145,7 +145,7 @@ class mod_contract_serpis extends ModelNumRefContracts if ($max >= (pow(10, 4) - 1)) { $num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is } else { - $num = sprintf("%04s", $max + 1); + $num = sprintf("%04d", $max + 1); } dol_syslog("mod_contract_serpis::getNextValue return ".$this->prefix.$yymm."-".$num); diff --git a/htdocs/core/modules/delivery/mod_delivery_jade.php b/htdocs/core/modules/delivery/mod_delivery_jade.php index df68b875e72..8cc8ec7f234 100644 --- a/htdocs/core/modules/delivery/mod_delivery_jade.php +++ b/htdocs/core/modules/delivery/mod_delivery_jade.php @@ -3,6 +3,7 @@ * Copyright (C) 2004-2008 Laurent Destailleur * Copyright (C) 2005-2010 Regis Houssin * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * 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 @@ -163,7 +164,7 @@ class mod_delivery_jade extends ModeleNumRefDeliveryOrder if ($max >= (pow(10, 4) - 1)) { $num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is } else { - $num = sprintf("%04s", $max + 1); + $num = sprintf("%04d", $max + 1); } dol_syslog("mod_delivery_jade::getNextValue return ".$this->prefix.$yymm."-".$num); diff --git a/htdocs/core/modules/expedition/mod_expedition_safor.php b/htdocs/core/modules/expedition/mod_expedition_safor.php index af10ae43e45..a96b405e694 100644 --- a/htdocs/core/modules/expedition/mod_expedition_safor.php +++ b/htdocs/core/modules/expedition/mod_expedition_safor.php @@ -1,6 +1,7 @@ * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * 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 @@ -151,7 +152,7 @@ class mod_expedition_safor extends ModelNumRefExpedition if ($max >= (pow(10, 4) - 1)) { $num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is } else { - $num = sprintf("%04s", $max + 1); + $num = sprintf("%04d", $max + 1); } dol_syslog("mod_expedition_safor::getNextValue return ".$this->prefix.$yymm."-".$num); diff --git a/htdocs/core/modules/expensereport/mod_expensereport_jade.php b/htdocs/core/modules/expensereport/mod_expensereport_jade.php index e88aa5f6bf9..afbd1664e96 100644 --- a/htdocs/core/modules/expensereport/mod_expensereport_jade.php +++ b/htdocs/core/modules/expensereport/mod_expensereport_jade.php @@ -1,6 +1,7 @@ * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * 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 @@ -208,7 +209,7 @@ class mod_expensereport_jade extends ModeleNumRefExpenseReport if ($max >= (pow(10, 4) - 1)) { $num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is } else { - $num = sprintf("%04s", $max + 1); + $num = sprintf("%04d", $max + 1); } dol_syslog("mod_expensereport_jade::getNextValue return ".$this->prefix.$yymm."-".$num); diff --git a/htdocs/core/modules/facture/mod_facture_mars.php b/htdocs/core/modules/facture/mod_facture_mars.php index 2993ed9f37e..651181c8cfb 100644 --- a/htdocs/core/modules/facture/mod_facture_mars.php +++ b/htdocs/core/modules/facture/mod_facture_mars.php @@ -3,6 +3,7 @@ * Copyright (C) 2005-2018 Regis Houssin * Copyright (C) 2013 Juanjo Menent * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * 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 @@ -200,7 +201,7 @@ class mod_facture_mars extends ModeleNumRefFactures if ($max >= (pow(10, 4) - 1)) { $num = $max; // If counter > 9999, we do not format on 4 chars, we take number as it is } else { - $num = sprintf("%04s", $max); + $num = sprintf("%04d", $max); } $ref = ''; @@ -229,7 +230,7 @@ class mod_facture_mars extends ModeleNumRefFactures if ($max >= (pow(10, 4) - 1)) { $num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is } else { - $num = sprintf("%04s", $max + 1); + $num = sprintf("%04d", $max + 1); } dol_syslog(get_class($this)."::getNextValue return ".$prefix.$yymm."-".$num); diff --git a/htdocs/core/modules/facture/mod_facture_terre.php b/htdocs/core/modules/facture/mod_facture_terre.php index f29607e5cd1..eef74993761 100644 --- a/htdocs/core/modules/facture/mod_facture_terre.php +++ b/htdocs/core/modules/facture/mod_facture_terre.php @@ -2,6 +2,7 @@ /* Copyright (C) 2005-2008 Laurent Destailleur * Copyright (C) 2005-2015 Regis Houssin * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * 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 @@ -240,7 +241,7 @@ class mod_facture_terre extends ModeleNumRefFactures if ($max >= (pow(10, 4) - 1)) { $num = $max; // If counter > 9999, we do not format on 4 chars, we take number as it is } else { - $num = sprintf("%04s", $max); + $num = sprintf("%04d", $max); } $ref = ''; @@ -268,7 +269,7 @@ class mod_facture_terre extends ModeleNumRefFactures if ($max >= (pow(10, 4) - 1)) { $num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is } else { - $num = sprintf("%04s", $max + 1); + $num = sprintf("%04d", $max + 1); } dol_syslog(get_class($this)."::getNextValue return ".$prefix.$yymm."-".$num); diff --git a/htdocs/core/modules/fichinter/mod_pacific.php b/htdocs/core/modules/fichinter/mod_pacific.php index 0f780ee2bb6..f721029b132 100644 --- a/htdocs/core/modules/fichinter/mod_pacific.php +++ b/htdocs/core/modules/fichinter/mod_pacific.php @@ -3,6 +3,7 @@ * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2013 Juanjo Menent * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * 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 @@ -156,7 +157,7 @@ class mod_pacific extends ModeleNumRefFicheinter if ($max >= (pow(10, 4) - 1)) { $num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is } else { - $num = sprintf("%04s", $max + 1); + $num = sprintf("%04d", $max + 1); } return $this->prefix.$yymm."-".$num; diff --git a/htdocs/core/modules/holiday/mod_holiday_madonna.php b/htdocs/core/modules/holiday/mod_holiday_madonna.php index 06e63f42af8..c084f48e46d 100644 --- a/htdocs/core/modules/holiday/mod_holiday_madonna.php +++ b/htdocs/core/modules/holiday/mod_holiday_madonna.php @@ -2,6 +2,7 @@ /* Copyright (C) 2011 Juanjo Menent * Copyright (C) 2018-2023 Charlene Benke * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * 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 @@ -30,7 +31,6 @@ require_once DOL_DOCUMENT_ROOT.'/core/modules/holiday/modules_holiday.php'; */ class mod_holiday_madonna extends ModelNumRefHolidays { - // variables inherited from ModelNumRefHolidays class public $name = 'Madonna'; public $version = 'dolibarr'; @@ -146,7 +146,7 @@ class mod_holiday_madonna extends ModelNumRefHolidays if ($max >= (pow(10, 4) - 1)) { $num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is } else { - $num = sprintf("%04s", $max + 1); + $num = sprintf("%04d", $max + 1); } dol_syslog("mod_holiday_madonna::getNextValue return ".$this->prefix.$yymm."-".$num); diff --git a/htdocs/core/modules/hrm/mod_evaluation_standard.php b/htdocs/core/modules/hrm/mod_evaluation_standard.php index eb69f3c0953..98fd02255c7 100644 --- a/htdocs/core/modules/hrm/mod_evaluation_standard.php +++ b/htdocs/core/modules/hrm/mod_evaluation_standard.php @@ -2,6 +2,7 @@ /* Copyright (C) 2005-2010 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * 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 @@ -156,7 +157,7 @@ class mod_evaluation_standard extends ModeleNumRefEvaluation if ($max >= (pow(10, 4) - 1)) { $num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is } else { - $num = sprintf("%04s", $max + 1); + $num = sprintf("%04d", $max + 1); } dol_syslog("mod_evaluation_standard::getNextValue return ".$this->prefix.$yymm."-".$num); diff --git a/htdocs/core/modules/member/mod_member_advanced.php b/htdocs/core/modules/member/mod_member_advanced.php index 0547350208e..2e1de7e6b1e 100644 --- a/htdocs/core/modules/member/mod_member_advanced.php +++ b/htdocs/core/modules/member/mod_member_advanced.php @@ -1,6 +1,7 @@ * Copyright (C) 2022-2024 Frédéric France + * Copyright (C) 2024 MDW * * 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 @@ -31,7 +32,6 @@ require_once DOL_DOCUMENT_ROOT.'/core/modules/member/modules_member.class.php'; */ class mod_member_advanced extends ModeleNumRefMembers { - // variables inherited from ModeleNumRefMembers class public $name = 'Advanced'; public $version = 'dolibarr'; @@ -150,7 +150,7 @@ class mod_member_advanced extends ModeleNumRefMembers if ($max >= (pow(10, 4) - 1)) { $num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is } else { - $num = sprintf("%04s", $max + 1); + $num = sprintf("%04d", $max + 1); } dol_syslog("mod_member_advanced::getNextValue return ".$this->prefix.$yymm."-".$num, LOG_INFO); diff --git a/htdocs/core/modules/mrp/mod_mo_standard.php b/htdocs/core/modules/mrp/mod_mo_standard.php index 333491281cc..b835a07614f 100644 --- a/htdocs/core/modules/mrp/mod_mo_standard.php +++ b/htdocs/core/modules/mrp/mod_mo_standard.php @@ -2,6 +2,7 @@ /* Copyright (C) 2005-2010 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * 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 @@ -148,7 +149,7 @@ class mod_mo_standard extends ModeleNumRefMos if ($max >= (pow(10, 4) - 1)) { $num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is } else { - $num = sprintf("%04s", $max + 1); + $num = sprintf("%04d", $max + 1); } dol_syslog("mod_mo_standard::getNextValue return ".$this->prefix.$yymm."-".$num); diff --git a/htdocs/core/modules/payment/mod_payment_cicada.php b/htdocs/core/modules/payment/mod_payment_cicada.php index 6c90fec350a..5991cc2be93 100644 --- a/htdocs/core/modules/payment/mod_payment_cicada.php +++ b/htdocs/core/modules/payment/mod_payment_cicada.php @@ -1,5 +1,6 @@ + * Copyright (C) 2024 MDW * * 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 @@ -154,7 +155,7 @@ class mod_payment_cicada extends ModeleNumRefPayments if ($max >= (pow(10, 4) - 1)) { $num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is } else { - $num = sprintf("%04s", $max + 1); + $num = sprintf("%04d", $max + 1); } dol_syslog(__METHOD__." return ".$this->prefix.$yymm."-".$num); diff --git a/htdocs/core/modules/product_batch/mod_lot_standard.php b/htdocs/core/modules/product_batch/mod_lot_standard.php index d3feb2e88c1..b09f6bc3ff5 100644 --- a/htdocs/core/modules/product_batch/mod_lot_standard.php +++ b/htdocs/core/modules/product_batch/mod_lot_standard.php @@ -3,6 +3,7 @@ * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2021 Christophe Battarel * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * 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 @@ -150,7 +151,7 @@ class mod_lot_standard extends ModeleNumRefBatch if ($max >= (pow(10, 4) - 1)) { $num = $max + 1; } else { // If counter > 9999, we do not format on 4 chars, we take number as it is - $num = sprintf("%04s", $max + 1); + $num = sprintf("%04d", $max + 1); } dol_syslog("mod_lot_standard::getNextValue return ".$this->prefix.$yymm."-".$num); diff --git a/htdocs/core/modules/product_batch/mod_sn_standard.php b/htdocs/core/modules/product_batch/mod_sn_standard.php index ae4d4efa965..6f5f673562e 100644 --- a/htdocs/core/modules/product_batch/mod_sn_standard.php +++ b/htdocs/core/modules/product_batch/mod_sn_standard.php @@ -3,6 +3,7 @@ * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2021 Christophe Battarel * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * 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 @@ -150,7 +151,7 @@ class mod_sn_standard extends ModeleNumRefBatch if ($max >= (pow(10, 4) - 1)) { $num = $max + 1; } else { // If counter > 9999, we do not format on 4 chars, we take number as it is - $num = sprintf("%04s", $max + 1); + $num = sprintf("%04d", $max + 1); } dol_syslog("mod_sn_standard::getNextValue return ".$this->prefix.$yymm."-".$num); diff --git a/htdocs/core/modules/project/mod_project_simple.php b/htdocs/core/modules/project/mod_project_simple.php index 1ef51d36c95..a411154425c 100644 --- a/htdocs/core/modules/project/mod_project_simple.php +++ b/htdocs/core/modules/project/mod_project_simple.php @@ -2,6 +2,7 @@ /* Copyright (C) 2010-2012 Regis Houssin * Copyright (C) 2010 Laurent Destailleur * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * 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 @@ -159,7 +160,7 @@ class mod_project_simple extends ModeleNumRefProjects if ($max >= (pow(10, 4) - 1)) { $num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is } else { - $num = sprintf("%04s", $max + 1); + $num = sprintf("%04d", $max + 1); } dol_syslog("mod_project_simple::getNextValue return ".$this->prefix.$yymm."-".$num); diff --git a/htdocs/core/modules/project/task/mod_task_simple.php b/htdocs/core/modules/project/task/mod_task_simple.php index e75fd1b5e8a..b523fefad8c 100644 --- a/htdocs/core/modules/project/task/mod_task_simple.php +++ b/htdocs/core/modules/project/task/mod_task_simple.php @@ -2,6 +2,7 @@ /* Copyright (C) 2010-2012 Regis Houssin * Copyright (C) 2010 Laurent Destailleur * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * 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 @@ -156,7 +157,7 @@ class mod_task_simple extends ModeleNumRefTask if ($max >= (pow(10, 4) - 1)) { $num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is } else { - $num = sprintf("%04s", $max + 1); + $num = sprintf("%04d", $max + 1); } dol_syslog("mod_task_simple::getNextValue return ".$this->prefix.$yymm."-".$num); diff --git a/htdocs/core/modules/propale/mod_propale_marbre.php b/htdocs/core/modules/propale/mod_propale_marbre.php index 0da17182404..b601a7b1217 100644 --- a/htdocs/core/modules/propale/mod_propale_marbre.php +++ b/htdocs/core/modules/propale/mod_propale_marbre.php @@ -2,6 +2,7 @@ /* Copyright (C) 2005-2008 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * 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 @@ -157,7 +158,7 @@ class mod_propale_marbre extends ModeleNumRefPropales if ($max >= (pow(10, 4) - 1)) { $num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is } else { - $num = sprintf("%04s", $max + 1); + $num = sprintf("%04d", $max + 1); } dol_syslog(get_class($this)."::getNextValue return ".$this->prefix.$yymm."-".$num); diff --git a/htdocs/core/modules/reception/mod_reception_beryl.php b/htdocs/core/modules/reception/mod_reception_beryl.php index 1482d96f935..10b12439776 100644 --- a/htdocs/core/modules/reception/mod_reception_beryl.php +++ b/htdocs/core/modules/reception/mod_reception_beryl.php @@ -1,6 +1,7 @@ * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * 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 @@ -131,7 +132,7 @@ class mod_reception_beryl extends ModelNumRefReception if ($max >= (pow(10, 4) - 1)) { $num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is } else { - $num = sprintf("%04s", $max + 1); + $num = sprintf("%04d", $max + 1); } dol_syslog("mod_reception_beryl::getNextValue return ".$this->prefix.$yymm."-".$num); diff --git a/htdocs/core/modules/societe/mod_codeclient_monkey.php b/htdocs/core/modules/societe/mod_codeclient_monkey.php index e46b5dc3f7a..9ddae66f284 100644 --- a/htdocs/core/modules/societe/mod_codeclient_monkey.php +++ b/htdocs/core/modules/societe/mod_codeclient_monkey.php @@ -137,7 +137,7 @@ class mod_codeclient_monkey extends ModeleThirdPartyCode if ($max >= (pow(10, 5) - 1)) { $num = $max + 1; // If counter > 99999, we do not format on 5 chars, we take number as it is } else { - $num = sprintf("%05s", $max + 1); + $num = sprintf("%05d", $max + 1); } dol_syslog(get_class($this)."::getNextValue return ".$prefix.$yymm."-".$num); diff --git a/htdocs/core/modules/stocktransfer/mod_stocktransfer_standard.php b/htdocs/core/modules/stocktransfer/mod_stocktransfer_standard.php index a270b7d8842..57e7f238fc2 100644 --- a/htdocs/core/modules/stocktransfer/mod_stocktransfer_standard.php +++ b/htdocs/core/modules/stocktransfer/mod_stocktransfer_standard.php @@ -3,6 +3,7 @@ * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2021 Gauthier VERDOL * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * 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 @@ -157,7 +158,7 @@ class mod_stocktransfer_standard extends ModeleNumRefStockTransfer if ($max >= (pow(10, 4) - 1)) { $num = $max + 1; } else { // If counter > 9999, we do not format on 4 chars, we take number as it is - $num = sprintf("%04s", $max + 1); + $num = sprintf("%04d", $max + 1); } dol_syslog("mod_stocktransfer_standard::getNextValue return ".$this->prefix.$yymm."-".$num); diff --git a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_cactus.php b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_cactus.php index 9a197b31aad..68b728b839c 100644 --- a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_cactus.php +++ b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_cactus.php @@ -4,6 +4,7 @@ * Copyright (C) 2013-2018 Philippe Grand * Copyright (C) 2016 Alexandre Spangaro * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * 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 @@ -214,7 +215,7 @@ class mod_facture_fournisseur_cactus extends ModeleNumRefSuppliersInvoices if ($max >= (pow(10, 4) - 1)) { $num = $max; // If counter > 9999, we do not format on 4 chars, we take number as it is } else { - $num = sprintf("%04s", $max); + $num = sprintf("%04d", $max); } $ref = ''; @@ -242,7 +243,7 @@ class mod_facture_fournisseur_cactus extends ModeleNumRefSuppliersInvoices if ($max >= (pow(10, 4) - 1)) { $num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is } else { - $num = sprintf("%04s", $max + 1); + $num = sprintf("%04d", $max + 1); } dol_syslog(get_class($this)."::getNextValue return ".$prefix.$yymm."-".$num); diff --git a/htdocs/core/modules/supplier_order/mod_commande_fournisseur_muguet.php b/htdocs/core/modules/supplier_order/mod_commande_fournisseur_muguet.php index ff0ac8142aa..3601f2cb1fc 100644 --- a/htdocs/core/modules/supplier_order/mod_commande_fournisseur_muguet.php +++ b/htdocs/core/modules/supplier_order/mod_commande_fournisseur_muguet.php @@ -167,7 +167,7 @@ class mod_commande_fournisseur_muguet extends ModeleNumRefSuppliersOrders if ($max >= (pow(10, 4) - 1)) { $num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is } else { - $num = sprintf("%04s", $max + 1); + $num = sprintf("%04d", $max + 1); } return $this->prefix.$yymm."-".$num; diff --git a/htdocs/core/modules/supplier_payment/mod_supplier_payment_bronan.php b/htdocs/core/modules/supplier_payment/mod_supplier_payment_bronan.php index dba6eefb6b4..30f323ecc81 100644 --- a/htdocs/core/modules/supplier_payment/mod_supplier_payment_bronan.php +++ b/htdocs/core/modules/supplier_payment/mod_supplier_payment_bronan.php @@ -1,6 +1,7 @@ * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * 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,7 +156,7 @@ class mod_supplier_payment_bronan extends ModeleNumRefSupplierPayments if ($max >= (pow(10, 4) - 1)) { $num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is } else { - $num = sprintf("%04s", $max + 1); + $num = sprintf("%04d", $max + 1); } dol_syslog(__METHOD__." return ".$this->prefix.$yymm."-".$num); diff --git a/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_marbre.php b/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_marbre.php index b71d9581a53..ad61e3a55b2 100644 --- a/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_marbre.php +++ b/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_marbre.php @@ -2,6 +2,7 @@ /* Copyright (C) 2005-2008 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * 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 @@ -157,7 +158,7 @@ class mod_supplier_proposal_marbre extends ModeleNumRefSupplierProposal if ($max >= (pow(10, 4) - 1)) { $num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is } else { - $num = sprintf("%04s", $max + 1); + $num = sprintf("%04d", $max + 1); } dol_syslog(get_class($this)."::getNextValue return ".$this->prefix.$yymm."-".$num); diff --git a/htdocs/core/modules/takepos/mod_takepos_ref_simple.php b/htdocs/core/modules/takepos/mod_takepos_ref_simple.php index 1629d0e779d..7ac31b4929e 100644 --- a/htdocs/core/modules/takepos/mod_takepos_ref_simple.php +++ b/htdocs/core/modules/takepos/mod_takepos_ref_simple.php @@ -4,6 +4,7 @@ * Copyright (C) 2013 Juanjo Menent * Copyright (C) 2020 Open-DSI * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * 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 @@ -166,7 +167,7 @@ class mod_takepos_ref_simple extends ModeleNumRefTakepos if ($max >= (pow(10, 4) - 1)) { $num = $max; // If counter > 9999, we do not format on 4 chars, we take number as it is } else { - $num = sprintf("%04s", $max); + $num = sprintf("%04d", $max); } $ref = ''; @@ -194,7 +195,7 @@ class mod_takepos_ref_simple extends ModeleNumRefTakepos if ($max >= (pow(10, 4) - 1)) { $num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is } else { - $num = sprintf("%04s", $max + 1); + $num = sprintf("%04d", $max + 1); } dol_syslog(get_class($this)."::getNextValue return ".$this->prefix.$pos_source.'-'.$yymm.'-'.$num); diff --git a/htdocs/core/modules/ticket/mod_ticket_simple.php b/htdocs/core/modules/ticket/mod_ticket_simple.php index 3d0c057870d..8c476eb91a7 100644 --- a/htdocs/core/modules/ticket/mod_ticket_simple.php +++ b/htdocs/core/modules/ticket/mod_ticket_simple.php @@ -2,6 +2,7 @@ /* Copyright (C) 2010-2012 Regis Houssin * Copyright (C) 2010 Laurent Destailleur * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * 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 @@ -156,7 +157,7 @@ class mod_ticket_simple extends ModeleNumRefTicket $num = $max + 1; } else { // If counter > 9999, we do not format on 4 chars, we take number as it is - $num = sprintf("%04s", $max + 1); + $num = sprintf("%04d", $max + 1); } dol_syslog("mod_ticket_simple::getNextValue return ".$this->prefix.$yymm."-".$num); diff --git a/htdocs/core/modules/workstation/mod_workstation_standard.php b/htdocs/core/modules/workstation/mod_workstation_standard.php index d5d6c40e459..c68952f36a6 100644 --- a/htdocs/core/modules/workstation/mod_workstation_standard.php +++ b/htdocs/core/modules/workstation/mod_workstation_standard.php @@ -3,6 +3,7 @@ * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2020 Gauthier VERDOL * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * 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 @@ -146,7 +147,7 @@ class mod_workstation_standard extends ModeleNumRefWorkstation if ($max >= (pow(10, 4) - 1)) { $num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is } else { - $num = sprintf("%04s", $max + 1); + $num = sprintf("%04d", $max + 1); } dol_syslog("mod_workstation_standard::getNextValue return ".$this->prefix."-".$num); diff --git a/htdocs/knowledgemanagement/core/modules/knowledgemanagement/mod_knowledgerecord_standard.php b/htdocs/knowledgemanagement/core/modules/knowledgemanagement/mod_knowledgerecord_standard.php index 3d509d7d25c..c4652df83b1 100644 --- a/htdocs/knowledgemanagement/core/modules/knowledgemanagement/mod_knowledgerecord_standard.php +++ b/htdocs/knowledgemanagement/core/modules/knowledgemanagement/mod_knowledgerecord_standard.php @@ -1,6 +1,7 @@ * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2024 MDW * * 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 @@ -154,7 +155,7 @@ class mod_knowledgerecord_standard extends ModeleNumRefKnowledgeRecord if ($max >= (pow(10, 4) - 1)) { $num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is } else { - $num = sprintf("%04s", $max + 1); + $num = sprintf("%04d", $max + 1); } dol_syslog("mod_knowledgerecord_standard::getNextValue return ".$this->prefix.$yymm."-".$num); diff --git a/htdocs/partnership/core/modules/partnership/mod_partnership_standard.php b/htdocs/partnership/core/modules/partnership/mod_partnership_standard.php index 92c39356a7f..9dd883cd2fb 100644 --- a/htdocs/partnership/core/modules/partnership/mod_partnership_standard.php +++ b/htdocs/partnership/core/modules/partnership/mod_partnership_standard.php @@ -1,6 +1,7 @@ * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2024 MDW * * 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 @@ -154,7 +155,7 @@ class mod_partnership_standard extends ModeleNumRefPartnership if ($max >= (pow(10, 4) - 1)) { $num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is } else { - $num = sprintf("%04s", $max + 1); + $num = sprintf("%04d", $max + 1); } dol_syslog("mod_partnership_standard::getNextValue return ".$this->prefix.$yymm."-".$num); diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 1fe8ae87fa5..7d387457b23 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -14,6 +14,7 @@ * Copyright (C) 2020-2021 Open-DSI * Copyright (C) 2022 Charlene Benke * Copyright (C) 2020-2023 Alexandre Spangaro + * Copyright (C) 2024 MDW * * 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 @@ -296,7 +297,7 @@ if (getDolGlobalString('PRODUIT_MULTIPRICES')) { } else { $labelp = $langs->transnoentitiesnoconv("SellingPrice")." ".$i; } - $arrayfields['p.sellprice'.$i] = array('label' => $labelp, 'checked' => ($i == 1 ? 1 : 0), 'enabled' => getDolGlobalString('PRODUIT_MULTIPRICES'), 'position' => (float) ('40.'.sprintf('%03s', $i))); + $arrayfields['p.sellprice'.$i] = array('label' => $labelp, 'checked' => ($i == 1 ? 1 : 0), 'enabled' => getDolGlobalString('PRODUIT_MULTIPRICES'), 'position' => (float) ('40.'.sprintf('%03d', $i))); $arraypricelevel[$i] = array($i); } } diff --git a/htdocs/recruitment/core/modules/recruitment/mod_recruitmentcandidature_standard.php b/htdocs/recruitment/core/modules/recruitment/mod_recruitmentcandidature_standard.php index 6a7b4d8c510..cb46d8323df 100644 --- a/htdocs/recruitment/core/modules/recruitment/mod_recruitmentcandidature_standard.php +++ b/htdocs/recruitment/core/modules/recruitment/mod_recruitmentcandidature_standard.php @@ -2,6 +2,7 @@ /* Copyright (C) 2005-2010 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * 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,7 +156,7 @@ class mod_recruitmentcandidature_standard extends ModeleNumRefRecruitmentCandida if ($max >= (pow(10, 4) - 1)) { $num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is } else { - $num = sprintf("%04s", $max + 1); + $num = sprintf("%04d", $max + 1); } dol_syslog("mod_recruitmentcandidature_standard::getNextValue return ".$this->prefix.$yymm."-".$num); diff --git a/htdocs/recruitment/core/modules/recruitment/mod_recruitmentjobposition_standard.php b/htdocs/recruitment/core/modules/recruitment/mod_recruitmentjobposition_standard.php index 50c2ab775e7..e95cfbb2ee8 100644 --- a/htdocs/recruitment/core/modules/recruitment/mod_recruitmentjobposition_standard.php +++ b/htdocs/recruitment/core/modules/recruitment/mod_recruitmentjobposition_standard.php @@ -2,6 +2,7 @@ /* Copyright (C) 2005-2010 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * 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,7 +156,7 @@ class mod_recruitmentjobposition_standard extends ModeleNumRefRecruitmentJobPosi if ($max >= (pow(10, 4) - 1)) { $num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is } else { - $num = sprintf("%04s", $max + 1); + $num = sprintf("%04d", $max + 1); } dol_syslog("mod_recruitmentjobposition_standard::getNextValue return ".$this->prefix.$yymm."-".$num);