From 9c3a52d1ea32aa4e8e61f3ce45d35c603414b075 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charl=C3=A8ne=20Benke?= <1179011+defrance@users.noreply.github.com> Date: Fri, 29 Dec 2023 11:12:13 +0100 Subject: [PATCH 01/10] FIX : php 8.1 suppress strftime --- htdocs/compta/bank/annuel.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/bank/annuel.php b/htdocs/compta/bank/annuel.php index ef64c1746f1..c6513038854 100644 --- a/htdocs/compta/bank/annuel.php +++ b/htdocs/compta/bank/annuel.php @@ -2,7 +2,7 @@ /* Copyright (C) 2005 Rodolphe Quiedeville * Copyright (C) 2004-2017 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2013 Charles-Fr BENKE + * Copyright (C) 2013-2023 Charlene BENKE * * 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 @@ -51,7 +51,8 @@ if ($user->socid) { $result = restrictedArea($user, 'banque', $fieldvalue, 'bank_account&bank_account', '', '', $fieldtype); $year_start = GETPOST('year_start'); -$year_current = strftime("%Y", time()); +//$year_current = strftime("%Y", time()); +$year_current = dol_print_date(time(), "%Y"); if (!$year_start) { $year_start = $year_current - 2; $year_end = $year_current; From 77be41720d88523248b97137687ccae6dc0f517d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charl=C3=A8ne=20Benke?= <1179011+defrance@users.noreply.github.com> Date: Fri, 29 Dec 2023 11:13:26 +0100 Subject: [PATCH 02/10] Update graph.php --- htdocs/compta/bank/graph.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/bank/graph.php b/htdocs/compta/bank/graph.php index 490107e4893..065fc11fecc 100644 --- a/htdocs/compta/bank/graph.php +++ b/htdocs/compta/bank/graph.php @@ -188,7 +188,8 @@ if ($result < 0) { $subtotal = 0; $day = dol_mktime(12, 0, 0, $month, 1, $year); - $textdate = strftime("%Y%m%d", $day); + //$textdate = strftime("%Y%m%d", $day); + $textdate = dol_print_date($day, "%Y%m%d"); $xyear = substr($textdate, 0, 4); $xday = substr($textdate, 6, 2); $xmonth = substr($textdate, 4, 2); From 2dfb2cc7c498380bbc854689d47fc85e11f34b96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charl=C3=A8ne=20Benke?= <1179011+defrance@users.noreply.github.com> Date: Fri, 29 Dec 2023 11:16:19 +0100 Subject: [PATCH 03/10] Update graph.php --- htdocs/compta/bank/graph.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/htdocs/compta/bank/graph.php b/htdocs/compta/bank/graph.php index 065fc11fecc..c7be41eed61 100644 --- a/htdocs/compta/bank/graph.php +++ b/htdocs/compta/bank/graph.php @@ -208,7 +208,8 @@ if ($result < 0) { $labels[$i] = $xday; $day += 86400; - $textdate = strftime("%Y%m%d", $day); + //$textdate = strftime("%Y%m%d", $day); + $textdate = dol_print_date($day, "%Y%m%d"); $xyear = substr($textdate, 0, 4); $xday = substr($textdate, 6, 2); $xmonth = substr($textdate, 4, 2); @@ -333,7 +334,8 @@ if ($result < 0) { $subtotal = 0; $now = time(); $day = dol_mktime(12, 0, 0, 1, 1, $year); - $textdate = strftime("%Y%m%d", $day); + //$textdate = strftime("%Y%m%d", $day); + $textdate = dol_print_date($day, "%Y%m%d"); $xyear = substr($textdate, 0, 4); $xday = substr($textdate, 6, 2); @@ -353,7 +355,8 @@ if ($result < 0) { }*/ $labels[$i] = dol_print_date($day, "%Y%m"); $day += 86400; - $textdate = strftime("%Y%m%d", $day); + //$textdate = strftime("%Y%m%d", $day); + $textdate = dol_print_date($day, "%Y%m%d"); $xyear = substr($textdate, 0, 4); $xday = substr($textdate, 6, 2); $i++; @@ -450,7 +453,8 @@ if ($result < 0) { $subtotal = 0; $day = $min; - $textdate = strftime("%Y%m%d", $day); + //$textdate = strftime("%Y%m%d", $day); + $textdate = dol_print_date($day, "%Y%m%d"); //print "x".$textdate; $i = 0; while ($day <= ($max + 86400)) { // On va au dela du dernier jour @@ -470,7 +474,8 @@ if ($result < 0) { $labels[$i] = substr($textdate, 0, 6); $day += 86400; - $textdate = strftime("%Y%m%d", $day); + //$textdate = strftime("%Y%m%d", $day); + $textdate = dol_print_date($day, "%Y%m%d"); $i++; } From 3a168767cd5ff3638956a191685569433fa66861 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charl=C3=A8ne=20Benke?= <1179011+defrance@users.noreply.github.com> Date: Fri, 29 Dec 2023 11:17:34 +0100 Subject: [PATCH 04/10] Update purchasesjournal.php --- htdocs/compta/journal/purchasesjournal.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/journal/purchasesjournal.php b/htdocs/compta/journal/purchasesjournal.php index 49925556725..09e52081228 100644 --- a/htdocs/compta/journal/purchasesjournal.php +++ b/htdocs/compta/journal/purchasesjournal.php @@ -75,7 +75,8 @@ llxHeader('', $langs->trans("PurchasesJournal"), '', '', 0, 0, '', '', $morequer $form = new Form($db); $year_current = dol_print_date(dol_now('gmt'), "%Y", 'gmt'); -$pastmonth = strftime("%m", dol_now()) - 1; +//$pastmonth = strftime("%m", dol_now()) - 1; +$pastmonth = dol_print_date(dol_now(), "%m") - 1; $pastmonthyear = $year_current; if ($pastmonth == 0) { $pastmonth = 12; From 6707f355560b545866bb1fa57d468044c4410ac7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charl=C3=A8ne=20Benke?= <1179011+defrance@users.noreply.github.com> Date: Fri, 29 Dec 2023 11:18:27 +0100 Subject: [PATCH 05/10] Update sellsjournal.php --- htdocs/compta/journal/sellsjournal.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/journal/sellsjournal.php b/htdocs/compta/journal/sellsjournal.php index 6f76ebfcedb..0ecdf3b2f0c 100644 --- a/htdocs/compta/journal/sellsjournal.php +++ b/htdocs/compta/journal/sellsjournal.php @@ -79,7 +79,8 @@ llxHeader('', $langs->trans("SellsJournal"), '', '', 0, 0, '', '', $morequery); $year_current = dol_print_date(dol_now('gmt'), "%Y", 'gmt'); -$pastmonth = strftime("%m", dol_now()) - 1; +//$pastmonth = strftime("%m", dol_now()) - 1; +$pastmonth = dol_print_date(dol_now(), "%m") - 1; $pastmonthyear = $year_current; if ($pastmonth == 0) { $pastmonth = 12; From e953da37116e11543e6c74b530655de417e9ee1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charl=C3=A8ne=20Benke?= <1179011+defrance@users.noreply.github.com> Date: Fri, 29 Dec 2023 11:21:05 +0100 Subject: [PATCH 06/10] Update index.php --- htdocs/compta/resultat/index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php index 059084dec0e..a2ff6a8eafa 100644 --- a/htdocs/compta/resultat/index.php +++ b/htdocs/compta/resultat/index.php @@ -1044,8 +1044,8 @@ for ($mois = 1 + $nb_mois_decalage; $mois <= 12 + $nb_mois_decalage; $mois++) { if ($mois > 12) { $annee_decalage = $annee + 1; } - $case = strftime("%Y-%m", dol_mktime(12, 0, 0, $mois_modulo, 1, $annee_decalage)); - + //$case = strftime("%Y-%m", dol_mktime(12, 0, 0, $mois_modulo, 1, $annee_decalage)); + $case = dol_print_date( dol_mktime(12, 0, 0, $mois_modulo, 1, $annee_decalage), "%Y-%m") ; print ''; if ($modecompta == 'CREANCES-DETTES' || $modecompta == 'BOOKKEEPING') { if (isset($decaiss[$case]) && $decaiss[$case] != 0) { From c4d1aaa09e1985cce0f8b18d4cc669b4741b7187 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charl=C3=A8ne=20Benke?= <1179011+defrance@users.noreply.github.com> Date: Fri, 29 Dec 2023 11:22:46 +0100 Subject: [PATCH 07/10] Update index.php --- htdocs/compta/stats/index.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/stats/index.php b/htdocs/compta/stats/index.php index 7b5b23f726f..835d8a999fe 100644 --- a/htdocs/compta/stats/index.php +++ b/htdocs/compta/stats/index.php @@ -377,7 +377,8 @@ $now_show_delta = 0; $minyear = substr($minyearmonth, 0, 4); $maxyear = substr($maxyearmonth, 0, 4); $nowyear = dol_print_date(dol_now('gmt'), "%Y", 'gmt'); -$nowyearmonth = strftime("%Y-%m", dol_now()); +$nowyearmonth = dol_print_date(dol_now(), "%Y%m"); +//$nowyearmonth = strftime("%Y-%m", dol_now()); $maxyearmonth = max($maxyearmonth, $nowyearmonth); $now = dol_now(); $casenow = dol_print_date($now, "%Y-%m"); From f4329d2eb1dd3a6ebc1a444088c9bf8a1ce2b50a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charl=C3=A8ne=20Benke?= <1179011+defrance@users.noreply.github.com> Date: Fri, 29 Dec 2023 11:24:03 +0100 Subject: [PATCH 08/10] Update supplier_turnover.php --- htdocs/compta/stats/supplier_turnover.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/stats/supplier_turnover.php b/htdocs/compta/stats/supplier_turnover.php index 245967dcd8b..3a78dc0c6a4 100644 --- a/htdocs/compta/stats/supplier_turnover.php +++ b/htdocs/compta/stats/supplier_turnover.php @@ -328,7 +328,8 @@ $now_show_delta = 0; $minyear = substr($minyearmonth, 0, 4); $maxyear = substr($maxyearmonth, 0, 4); $nowyear = dol_print_date(dol_now('gmt'), "%Y", 'gmt'); -$nowyearmonth = strftime("%Y-%m", dol_now()); +//$nowyearmonth = strftime("%Y-%m", dol_now()); +$nowyearmonth = dol_print_date(dol_now(), "%Y-%m"); $maxyearmonth = max($maxyearmonth, $nowyearmonth); $now = dol_now(); $casenow = dol_print_date($now, "%Y-%m"); From 9ec73724185c90fa7867363a985f3427735e4bad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charl=C3=A8ne=20Benke?= <1179011+defrance@users.noreply.github.com> Date: Fri, 29 Dec 2023 11:48:43 +0100 Subject: [PATCH 09/10] Update index.php --- htdocs/compta/resultat/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php index a2ff6a8eafa..adbaf56ad61 100644 --- a/htdocs/compta/resultat/index.php +++ b/htdocs/compta/resultat/index.php @@ -1045,7 +1045,7 @@ for ($mois = 1 + $nb_mois_decalage; $mois <= 12 + $nb_mois_decalage; $mois++) { $annee_decalage = $annee + 1; } //$case = strftime("%Y-%m", dol_mktime(12, 0, 0, $mois_modulo, 1, $annee_decalage)); - $case = dol_print_date( dol_mktime(12, 0, 0, $mois_modulo, 1, $annee_decalage), "%Y-%m") ; + $case = dol_print_date( dol_mktime(12, 0, 0, $mois_modulo, 1, $annee_decalage), "%Y-%m"); print ''; if ($modecompta == 'CREANCES-DETTES' || $modecompta == 'BOOKKEEPING') { if (isset($decaiss[$case]) && $decaiss[$case] != 0) { From 0d7bbcb996a0f9050b8c80e98497b51f65be5973 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charl=C3=A8ne=20Benke?= <1179011+defrance@users.noreply.github.com> Date: Fri, 29 Dec 2023 11:50:51 +0100 Subject: [PATCH 10/10] Update index.php --- htdocs/compta/resultat/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php index adbaf56ad61..5f70269512d 100644 --- a/htdocs/compta/resultat/index.php +++ b/htdocs/compta/resultat/index.php @@ -1045,7 +1045,7 @@ for ($mois = 1 + $nb_mois_decalage; $mois <= 12 + $nb_mois_decalage; $mois++) { $annee_decalage = $annee + 1; } //$case = strftime("%Y-%m", dol_mktime(12, 0, 0, $mois_modulo, 1, $annee_decalage)); - $case = dol_print_date( dol_mktime(12, 0, 0, $mois_modulo, 1, $annee_decalage), "%Y-%m"); + $case = dol_print_date(dol_mktime(12, 0, 0, $mois_modulo, 1, $annee_decalage), "%Y-%m"); print ''; if ($modecompta == 'CREANCES-DETTES' || $modecompta == 'BOOKKEEPING') { if (isset($decaiss[$case]) && $decaiss[$case] != 0) {