*
* 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
@@ -256,8 +257,8 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON aa.rowid = erd
$sql .= " WHERE er.date_debut >= '".$db->idate($search_date_start)."'";
$sql .= " AND er.date_debut <= '".$db->idate($search_date_end)."'";
// Define begin binding date
-if (getDolGlobalString('ACCOUNTING_DATE_START_BINDING')) {
- $sql .= " AND er.date_debut >= '".$db->idate(getDolGlobalString('ACCOUNTING_DATE_START_BINDING'))."'";
+if (getDolGlobalInt('ACCOUNTING_DATE_START_BINDING')) {
+ $sql .= " AND er.date_debut >= '".$db->idate(getDolGlobalInt('ACCOUNTING_DATE_START_BINDING'))."'";
}
$sql .= " AND er.fk_statut IN (".ExpenseReport::STATUS_APPROVED.", ".ExpenseReport::STATUS_CLOSED.")";
$sql .= " AND er.entity IN (".getEntity('expensereport', 0).")"; // We don't share object for accountancy
@@ -304,10 +305,10 @@ if ($resql) {
$cursoryear = ($cursormonth < getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1)) ? $y + 1 : $y;
$tmp = dol_getdate(dol_get_last_day($cursoryear, $cursormonth, 'gmt'), false, 'gmt');
- print '| ';
- print price($row[2*$i - 2]);
+ print ' | ';
+ print price($row[2 * $i - 2]);
// Add link to make binding
- if (!empty(price2num($row[2*$i - 2])) || !empty($row[2*$i - 1])) {
+ if (!empty(price2num($row[2 * $i - 2])) || !empty($row[2 * $i - 1])) {
print '';
print img_picto($langs->trans("ValidateHistory").' ('.$langs->trans('Month'.str_pad((string) $cursormonth, 2, '0', STR_PAD_LEFT)).' '.$cursoryear.')', 'link', 'class="marginleft2"');
print '';
@@ -366,8 +367,8 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON aa.rowid = erd
$sql .= " WHERE er.date_debut >= '".$db->idate($search_date_start)."'";
$sql .= " AND er.date_debut <= '".$db->idate($search_date_end)."'";
// Define begin binding date
-if (getDolGlobalString('ACCOUNTING_DATE_START_BINDING')) {
- $sql .= " AND er.date_debut >= '".$db->idate(getDolGlobalString('ACCOUNTING_DATE_START_BINDING'))."'";
+if (getDolGlobalInt('ACCOUNTING_DATE_START_BINDING')) {
+ $sql .= " AND er.date_debut >= '".$db->idate(getDolGlobalInt('ACCOUNTING_DATE_START_BINDING'))."'";
}
$sql .= " AND er.fk_statut IN (".ExpenseReport::STATUS_APPROVED.", ".ExpenseReport::STATUS_CLOSED.")";
$sql .= " AND er.entity IN (".getEntity('expensereport', 0).")"; // We don't share object for accountancy
@@ -449,8 +450,8 @@ if (getDolGlobalString('SHOW_TOTAL_OF_PREVIOUS_LISTS_IN_LIN_PAGE')) { // This pa
$sql .= " WHERE er.date_debut >= '".$db->idate($search_date_start)."'";
$sql .= " AND er.date_debut <= '".$db->idate($search_date_end)."'";
// Define begin binding date
- if (getDolGlobalString('ACCOUNTING_DATE_START_BINDING')) {
- $sql .= " AND er.date_debut >= '".$db->idate(getDolGlobalString('ACCOUNTING_DATE_START_BINDING'))."'";
+ if (getDolGlobalInt('ACCOUNTING_DATE_START_BINDING')) {
+ $sql .= " AND er.date_debut >= '".$db->idate(getDolGlobalInt('ACCOUNTING_DATE_START_BINDING'))."'";
}
$sql .= " AND er.fk_statut IN (".ExpenseReport::STATUS_APPROVED.", ".ExpenseReport::STATUS_CLOSED.")";
$sql .= " AND er.entity IN (".getEntity('expensereport', 0).")"; // We don't share object for accountancy
diff --git a/htdocs/accountancy/expensereport/list.php b/htdocs/accountancy/expensereport/list.php
index dbb3f37d445..9ddf89ea347 100644
--- a/htdocs/accountancy/expensereport/list.php
+++ b/htdocs/accountancy/expensereport/list.php
@@ -6,6 +6,7 @@
* Copyright (C) 2014 Juanjo Menent
* Copyright (C) 2016 Laurent Destailleur
* Copyright (C) 2024 Frédéric France
+ * Copyright (C) 2025 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
@@ -77,8 +78,8 @@ $search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_s
$search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear);
// Define begin binding date
-if (empty($search_date_start) && getDolGlobalString('ACCOUNTING_DATE_START_BINDING')) {
- $search_date_start = $db->idate(getDolGlobalString('ACCOUNTING_DATE_START_BINDING'));
+if (empty($search_date_start) && getDolGlobalInt('ACCOUNTING_DATE_START_BINDING')) {
+ $search_date_start = $db->idate(getDolGlobalInt('ACCOUNTING_DATE_START_BINDING'));
}
// Load variable for pagination
@@ -187,7 +188,7 @@ if ($massaction == 'ventil' && $user->hasRight('accounting', 'bind', 'write')) {
foreach ($mesCasesCochees as $maLigneCochee) {
$maLigneCourante = explode("_", $maLigneCochee);
$monId = $maLigneCourante[0];
- $monCompte = GETPOST('codeventil'.$monId);
+ $monCompte = GETPOSTINT('codeventil'.$monId);
if ($monCompte <= 0) {
$msg .= ' '.$langs->trans("Lineofinvoice").' '.$monId.' - '.$langs->trans("NoAccountSelected").' ';
@@ -393,7 +394,7 @@ if ($result) {
print '';
// @phan-suppress-next-line PhanPluginSuspiciousParamOrder
- print_barre_liste($langs->trans("ExpenseReportLines").' '.$langs->trans("DescVentilTodoExpenseReport").'', $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num_lines, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit, 0, 0, 1);
+ print_barre_liste($langs->trans("ExpenseReportLines").' '.$langs->trans("DescVentilTodoExpenseReport").'', $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, (string) $massactionbutton, $num_lines, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit, 0, 0, 1);
if (!empty($msg)) {
print $msg.' ';
diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php
index 54b6c227ed4..3019406540b 100644
--- a/htdocs/accountancy/journal/bankjournal.php
+++ b/htdocs/accountancy/journal/bankjournal.php
@@ -12,7 +12,7 @@
* Copyright (C) 2018 Ferran Marcet
* Copyright (C) 2018-2024 Eric Seigne
* Copyright (C) 2021 Gauthier VERDOL
- * Copyright (C) 2024 MDW
+ * Copyright (C) 2024-2025 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
@@ -140,8 +140,8 @@ if (empty($date_endmonth)) {
}
if (!GETPOSTISSET('date_startmonth') && (empty($date_start) || empty($date_end))) { // We define date_start and date_end, only if we did not submit the form
- $date_start = dol_get_first_day($pastmonthyear, $pastmonth, false);
- $date_end = dol_get_last_day($pastmonthyear, $pastmonth, false);
+ $date_start = dol_get_first_day((int) $pastmonthyear, (int) $pastmonth, false);
+ $date_end = dol_get_last_day((int) $pastmonthyear, (int) $pastmonth, false);
}
$sql = "SELECT b.rowid, b.dateo as do, b.datev as dv, b.amount, b.amount_main_currency, b.label, b.rappro, b.num_releve, b.num_chq, b.fk_type, b.fk_account,";
@@ -503,7 +503,7 @@ if ($result) {
$tabtp[$obj->rowid][$tmpcharge->type_accountancy_code] = isset($tabtp[$obj->rowid][$tmpcharge->type_accountancy_code]) ? $tabtp[$obj->rowid][$tmpcharge->type_accountancy_code] + $amounttouse : $amounttouse;
}
- $tabpay[$obj->rowid]["soclib"] = $chargestatic->getNomUrl(1, 30);
+ $tabpay[$obj->rowid]["soclib"] = $chargestatic->getNomUrl(1, '30');
$tabpay[$obj->rowid]["paymentscid"] = $chargestatic->id;
} elseif ($links[$key]['type'] == 'payment_donation') {
$paymentdonstatic->id = $links[$key]['url_id'];
@@ -557,7 +557,7 @@ if ($result) {
if (empty($obj->typeop_user)) { // Add test to avoid adding amount twice if a link already exists also on user.
$accountancy_code_user_general = (!empty($obj->accountancy_code_user_general)) ? $obj->accountancy_code_user_general : $account_employee;
- $compta_user = $userstatic->accountancy_code;
+ $compta_user = $userstatic->accountancy_code;
if ($compta_user) {
$tabtp[$obj->rowid][$compta_user] += $amounttouse;
$tabuser[$obj->rowid] = array(
@@ -1057,20 +1057,20 @@ if ($action == 'exportcsv' && $user->hasRight('accounting', 'bind', 'write')) {
print '"'.$key.'"'.$sep;
print '"'.$date.'"'.$sep;
print '"'.$val["type_payment"].'"'.$sep;
- if ($tabtype[$key] == 'payment_supplier') {
- $account_ledger = (!empty($obj->accountancy_code_supplier_general)) ? $obj->accountancy_code_supplier_general : $account_supplier;
- print '"'.length_accountg($account_ledger).'"'.$sep;
- } elseif ($tabtype[$key] == 'payment') {
- $account_ledger = (!empty($obj->accountancy_code_customer_general)) ? $obj->accountancy_code_customer_general : $account_customer;
- print '"'.length_accountg($account_ledger).'"'.$sep;
- } elseif ($tabtype[$key] == 'payment_expensereport') {
- print '"'.length_accountg(getDolGlobalString('ACCOUNTING_ACCOUNT_EXPENSEREPORT')).'"'.$sep;
- } elseif ($tabtype[$key] == 'payment_salary') {
- $account_ledger = (!empty($obj->accountancy_code_user_general)) ? $obj->accountancy_code_user_general : $account_employee;
- print '"'.length_accountg($account_ledger).'"'.$sep;
- } else {
- print '"'.length_accountg(html_entity_decode($k)).'"'.$sep;
- }
+ if ($tabtype[$key] == 'payment_supplier') {
+ $account_ledger = (!empty($obj->accountancy_code_supplier_general)) ? $obj->accountancy_code_supplier_general : $account_supplier;
+ print '"'.length_accountg($account_ledger).'"'.$sep;
+ } elseif ($tabtype[$key] == 'payment') {
+ $account_ledger = (!empty($obj->accountancy_code_customer_general)) ? $obj->accountancy_code_customer_general : $account_customer;
+ print '"'.length_accountg($account_ledger).'"'.$sep;
+ } elseif ($tabtype[$key] == 'payment_expensereport') {
+ print '"'.length_accountg(getDolGlobalString('ACCOUNTING_ACCOUNT_EXPENSEREPORT')).'"'.$sep;
+ } elseif ($tabtype[$key] == 'payment_salary') {
+ $account_ledger = (!empty($obj->accountancy_code_user_general)) ? $obj->accountancy_code_user_general : $account_employee;
+ print '"'.length_accountg($account_ledger).'"'.$sep;
+ } else {
+ print '"'.length_accountg(html_entity_decode($k)).'"'.$sep;
+ }
print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
print '"'.$reflabel.'"'.$sep;
print '"'.($mt < 0 ? price(-$mt) : '').'"'.$sep;
@@ -1347,16 +1347,16 @@ if (empty($action) || $action == 'view') {
$account_ledger = $k;
// Try to force general ledger account depending on type
if ($tabtype[$key] == 'payment') {
- $account_ledger = (!empty($obj->accountancy_code_customer_general)) ? $obj->accountancy_code_customer_general : $account_customer;
+ $account_ledger = (!empty($obj->accountancy_code_customer_general)) ? $obj->accountancy_code_customer_general : $account_customer;
}
if ($tabtype[$key] == 'payment_supplier') {
- $account_ledger = (!empty($obj->accountancy_code_supplier_general)) ? $obj->accountancy_code_supplier_general : $account_supplier;
+ $account_ledger = (!empty($obj->accountancy_code_supplier_general)) ? $obj->accountancy_code_supplier_general : $account_supplier;
}
if ($tabtype[$key] == 'payment_expensereport') {
$account_ledger = getDolGlobalString('ACCOUNTING_ACCOUNT_EXPENSEREPORT');
}
if ($tabtype[$key] == 'payment_salary') {
- $account_ledger = (!empty($obj->accountancy_code_user_general)) ? $obj->accountancy_code_user_general : $account_employee;
+ $account_ledger = (!empty($obj->accountancy_code_user_general)) ? $obj->accountancy_code_user_general : $account_employee;
}
if ($tabtype[$key] == 'payment_vat') {
$account_ledger = getDolGlobalString('ACCOUNTING_VAT_PAY_ACCOUNT');
diff --git a/htdocs/accountancy/journal/expensereportsjournal.php b/htdocs/accountancy/journal/expensereportsjournal.php
index 4091399cd42..396b296de0e 100644
--- a/htdocs/accountancy/journal/expensereportsjournal.php
+++ b/htdocs/accountancy/journal/expensereportsjournal.php
@@ -8,7 +8,7 @@
* Copyright (C) 2013-2016 Florian Henry
* Copyright (C) 2018-2025 Frédéric France
* Copyright (C) 2018 Eric Seigne
- * Copyright (C) 2024 MDW
+ * Copyright (C) 2024-2025 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
@@ -127,8 +127,8 @@ if (empty($date_endmonth)) {
}
if (!GETPOSTISSET('date_startmonth') && (empty($date_start) || empty($date_end))) { // We define date_start and date_end, only if we did not submit the form
- $date_start = dol_get_first_day($pastmonthyear, $pastmonth, false);
- $date_end = dol_get_last_day($pastmonthyear, $pastmonth, false);
+ $date_start = dol_get_first_day((int) $pastmonthyear, (int) $pastmonth, false);
+ $date_end = dol_get_last_day((int) $pastmonthyear, (int) $pastmonth, false);
}
$sql = "SELECT er.rowid, er.ref, er.date_debut as de, er.date_fin as df,";
@@ -153,8 +153,8 @@ if ($date_start && $date_end) {
$sql .= " AND er.date_debut >= '".$db->idate($date_start)."' AND er.date_debut <= '".$db->idate($date_end)."'";
}
// Define begin binding date
-if (getDolGlobalString('ACCOUNTING_DATE_START_BINDING')) {
- $sql .= " AND er.date_debut >= '".$db->idate(getDolGlobalString('ACCOUNTING_DATE_START_BINDING'))."'";
+if (getDolGlobalInt('ACCOUNTING_DATE_START_BINDING')) {
+ $sql .= " AND er.date_debut >= '".$db->idate(getDolGlobalInt('ACCOUNTING_DATE_START_BINDING'))."'";
}
// Already in bookkeeping or not
if ($in_bookkeeping == 'already') {
diff --git a/htdocs/accountancy/journal/purchasesjournal.php b/htdocs/accountancy/journal/purchasesjournal.php
index 2382d0ead5f..c4c2fc50995 100644
--- a/htdocs/accountancy/journal/purchasesjournal.php
+++ b/htdocs/accountancy/journal/purchasesjournal.php
@@ -8,7 +8,7 @@
* Copyright (C) 2013-2016 Florian Henry
* Copyright (C) 2018-2025 Frédéric France
* Copyright (C) 2018 Eric Seigne
- * Copyright (C) 2024 MDW
+ * Copyright (C) 2024-2025 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
@@ -134,8 +134,8 @@ if (empty($date_endmonth)) {
}
if (!GETPOSTISSET('date_startmonth') && (empty($date_start) || empty($date_end))) { // We define date_start and date_end, only if we did not submit the form
- $date_start = dol_get_first_day($pastmonthyear, $pastmonth, false);
- $date_end = dol_get_last_day($pastmonthyear, $pastmonth, false);
+ $date_start = dol_get_first_day((int) $pastmonthyear, (int) $pastmonth, false);
+ $date_end = dol_get_last_day((int) $pastmonthyear, (int) $pastmonth, false);
}
$sql = "SELECT f.rowid, f.ref as ref, f.type, f.datef as df, f.libelle as label, f.ref_supplier, f.date_lim_reglement as dlr, f.close_code, f.vat_reverse_charge,";
@@ -190,8 +190,8 @@ if ($date_start && $date_end) {
$sql .= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'";
}
// Define begin binding date
-if (getDolGlobalString('ACCOUNTING_DATE_START_BINDING')) {
- $sql .= " AND f.datef >= '".$db->idate(getDolGlobalString('ACCOUNTING_DATE_START_BINDING'))."'";
+if (getDolGlobalInt('ACCOUNTING_DATE_START_BINDING')) {
+ $sql .= " AND f.datef >= '".$db->idate(getDolGlobalInt('ACCOUNTING_DATE_START_BINDING'))."'";
}
// Already in bookkeeping or not
if ($in_bookkeeping == 'already') {
diff --git a/htdocs/accountancy/journal/sellsjournal.php b/htdocs/accountancy/journal/sellsjournal.php
index 19e8bc098f8..1e11a5cb503 100644
--- a/htdocs/accountancy/journal/sellsjournal.php
+++ b/htdocs/accountancy/journal/sellsjournal.php
@@ -9,7 +9,7 @@
* Copyright (C) 2013-2016 Olivier Geffroy
* Copyright (C) 2014 Raphaël Doursenaud
* Copyright (C) 2018-2025 Frédéric France
- * Copyright (C) 2024 MDW
+ * Copyright (C) 2024-2025 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
@@ -135,8 +135,8 @@ if (getDolGlobalString('ACCOUNTANCY_JOURNAL_USE_CURRENT_MONTH')) {
}
if (!GETPOSTISSET('date_startmonth') && (empty($date_start) || empty($date_end))) { // We define date_start and date_end, only if we did not submit the form
- $date_start = dol_get_first_day($pastmonthyear, $pastmonth, false);
- $date_end = dol_get_last_day($pastmonthyear, $pastmonth, false);
+ $date_start = dol_get_first_day((int) $pastmonthyear, (int) $pastmonth, false);
+ $date_end = dol_get_last_day((int) $pastmonthyear, (int) $pastmonth, false);
}
$sql = "SELECT f.rowid, f.ref, f.type, f.situation_cycle_ref, f.datef as df, f.ref_client, f.date_lim_reglement as dlr, f.close_code, f.retained_warranty, f.revenuestamp,";
@@ -189,8 +189,8 @@ if ($date_start && $date_end) {
$sql .= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'";
}
// Define begin binding date
-if (getDolGlobalString('ACCOUNTING_DATE_START_BINDING')) {
- $sql .= " AND f.datef >= '".$db->idate(getDolGlobalString('ACCOUNTING_DATE_START_BINDING'))."'";
+if (getDolGlobalInt('ACCOUNTING_DATE_START_BINDING')) {
+ $sql .= " AND f.datef >= '".$db->idate(getDolGlobalInt('ACCOUNTING_DATE_START_BINDING'))."'";
}
// Already in bookkeeping or not
if ($in_bookkeeping == 'already') {
diff --git a/htdocs/accountancy/journal/variousjournal.php b/htdocs/accountancy/journal/variousjournal.php
index 872bfce5d72..cebf7f41a07 100644
--- a/htdocs/accountancy/journal/variousjournal.php
+++ b/htdocs/accountancy/journal/variousjournal.php
@@ -1,6 +1,6 @@
- * Copyright (C) 2024 MDW
+ * Copyright (C) 2024-2025 MDW
* Copyright (C) 2024 Frédéric France
*
* This program is free software; you can redistribute it and/or modify
@@ -91,8 +91,8 @@ if (empty($date_endmonth)) {
}
if (!GETPOSTISSET('date_startmonth') && (empty($date_start) || empty($date_end))) { // We define date_start and date_end, only if we did not submit the form
- $date_start = dol_get_first_day($pastmonthyear, $pastmonth, false);
- $date_end = dol_get_last_day($pastmonthyear, $pastmonth, false);
+ $date_start = dol_get_first_day((int) $pastmonthyear, (int) $pastmonth, false);
+ $date_end = dol_get_last_day((int) $pastmonthyear, (int) $pastmonth, false);
}
$data_type = 'view';
diff --git a/htdocs/accountancy/supplier/index.php b/htdocs/accountancy/supplier/index.php
index 814ec1ab979..4b485491fb7 100644
--- a/htdocs/accountancy/supplier/index.php
+++ b/htdocs/accountancy/supplier/index.php
@@ -4,6 +4,7 @@
* Copyright (C) 2013-2022 Alexandre Spangaro
* Copyright (C) 2014 Juanjo Menent
* Copyright (C) 2024 Frédéric France
+ * Copyright (C) 2025 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
@@ -162,8 +163,8 @@ if ($action == 'validatehistory' && $user->hasRight('accounting', 'bind', 'write
$sql .= " WHERE f.fk_statut > 0 AND l.fk_code_ventilation <= 0";
$sql .= " AND l.product_type <= 2";
$sql .= " AND f.entity IN (".getEntity('facture_fourn', 0).")"; // We don't share object for accountancy
- if (getDolGlobalString('ACCOUNTING_DATE_START_BINDING')) {
- $sql .= " AND f.datef >= '".$db->idate(getDolGlobalString('ACCOUNTING_DATE_START_BINDING'))."'";
+ if (getDolGlobalInt('ACCOUNTING_DATE_START_BINDING')) {
+ $sql .= " AND f.datef >= '".$db->idate(getDolGlobalInt('ACCOUNTING_DATE_START_BINDING'))."'";
}
if ($validatemonth && $validateyear) {
$sql .= dolSqlDateFilter('f.datef', 0, $validatemonth, $validateyear);
@@ -364,8 +365,8 @@ $sql .= " LEFT JOIN ".$db->prefix()."accounting_account as aa ON aa.rowid = ffd
$sql .= " WHERE ff.datef >= '".$db->idate($search_date_start)."'";
$sql .= " AND ff.datef <= '".$db->idate($search_date_end)."'";
// Define begin binding date
-if (getDolGlobalString('ACCOUNTING_DATE_START_BINDING')) {
- $sql .= " AND ff.datef >= '".$db->idate(getDolGlobalString('ACCOUNTING_DATE_START_BINDING'))."'";
+if (getDolGlobalInt('ACCOUNTING_DATE_START_BINDING')) {
+ $sql .= " AND ff.datef >= '".$db->idate(getDolGlobalInt('ACCOUNTING_DATE_START_BINDING'))."'";
}
$sql .= " AND ff.fk_statut > 0";
$sql .= " AND ffd.product_type <= 2";
@@ -417,10 +418,10 @@ if ($resql) {
$cursoryear = ($cursormonth < getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1)) ? $y + 1 : $y;
$tmp = dol_getdate(dol_get_last_day($cursoryear, $cursormonth, 'gmt'), false, 'gmt');
- print '';
- print price($row[2*$i - 2]);
+ print ' | ';
+ print price($row[2 * $i - 2]);
// Add link to make binding
- if (!empty(price2num($row[2*$i - 2])) || !empty($row[2*$i - 1])) {
+ if (!empty(price2num($row[2 * $i - 2])) || !empty($row[2 * $i - 1])) {
print '';
print img_picto($langs->trans("ValidateHistory").' ('.$langs->trans('Month'.str_pad((string) $cursormonth, 2, '0', STR_PAD_LEFT)).' '.$cursoryear.')', 'link', 'class="marginleft2"');
print '';
@@ -495,8 +496,8 @@ $sql .= " LEFT JOIN ".$db->prefix()."accounting_account as aa ON aa.rowid = ffd
$sql .= " WHERE ff.datef >= '".$db->idate($search_date_start)."'";
$sql .= " AND ff.datef <= '".$db->idate($search_date_end)."'";
// Define begin binding date
-if (getDolGlobalString('ACCOUNTING_DATE_START_BINDING')) {
- $sql .= " AND ff.datef >= '".$db->idate(getDolGlobalString('ACCOUNTING_DATE_START_BINDING'))."'";
+if (getDolGlobalInt('ACCOUNTING_DATE_START_BINDING')) {
+ $sql .= " AND ff.datef >= '".$db->idate(getDolGlobalInt('ACCOUNTING_DATE_START_BINDING'))."'";
}
$sql .= " AND ff.entity IN (".getEntity('facture_fourn', 0).")"; // We don't share object for accountancy
$sql .= " AND ff.fk_statut > 0";
@@ -588,8 +589,8 @@ if (getDolGlobalString('SHOW_TOTAL_OF_PREVIOUS_LISTS_IN_LIN_PAGE')) { // This pa
$sql .= " WHERE ff.datef >= '".$db->idate($search_date_start)."'";
$sql .= " AND ff.datef <= '".$db->idate($search_date_end)."'";
// Define begin binding date
- if (getDolGlobalString('ACCOUNTING_DATE_START_BINDING')) {
- $sql .= " AND ff.datef >= '".$db->idate(getDolGlobalString('ACCOUNTING_DATE_START_BINDING'))."'";
+ if (getDolGlobalInt('ACCOUNTING_DATE_START_BINDING')) {
+ $sql .= " AND ff.datef >= '".$db->idate(getDolGlobalInt('ACCOUNTING_DATE_START_BINDING'))."'";
}
$sql .= " AND ff.entity IN (".getEntity('facture_fourn', 0).")"; // We don't share object for accountancy
$sql .= " AND ff.fk_statut > 0";
diff --git a/htdocs/accountancy/supplier/list.php b/htdocs/accountancy/supplier/list.php
index 788484b45ed..e584f7286d2 100644
--- a/htdocs/accountancy/supplier/list.php
+++ b/htdocs/accountancy/supplier/list.php
@@ -7,7 +7,7 @@
* Copyright (C) 2014 Juanjo Menent s
* Copyright (C) 2016 Laurent Destailleur
* Copyright (C) 2024 Frédéric France
- * Copyright (C) 2024 MDW
+ * Copyright (C) 2024-2025 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
@@ -129,8 +129,8 @@ if (!$user->hasRight('accounting', 'bind', 'write')) {
}
// Define begin binding date
-if (empty($search_date_start) && getDolGlobalString('ACCOUNTING_DATE_START_BINDING')) {
- $search_date_start = $db->idate(getDolGlobalString('ACCOUNTING_DATE_START_BINDING'));
+if (empty($search_date_start) && getDolGlobalInt('ACCOUNTING_DATE_START_BINDING')) {
+ $search_date_start = $db->idate(getDolGlobalInt('ACCOUNTING_DATE_START_BINDING'));
}
@@ -199,7 +199,7 @@ if ($massaction == 'ventil' && $user->hasRight('accounting', 'bind', 'write')) {
foreach ($mesCasesCochees as $maLigneCochee) {
$maLigneCourante = explode("_", $maLigneCochee);
$monId = $maLigneCourante[0];
- $monCompte = GETPOST('codeventil'.$monId);
+ $monCompte = GETPOSTINT('codeventil'.$monId);
if ($monCompte <= 0) {
$msg .= ' '.$langs->trans("Lineofinvoice").' '.$monId.' - '.$langs->trans("NoAccountSelected").' ';
@@ -487,7 +487,7 @@ if ($result) {
print '';
// @phan-suppress-next-line PhanPluginSuspiciousParamOrder
- print_barre_liste($langs->trans("InvoiceLines").' '.$langs->trans("DescVentilTodoCustomer").'', $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num_lines, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit, 0, 0, 1);
+ print_barre_liste($langs->trans("InvoiceLines").' '.$langs->trans("DescVentilTodoCustomer").'', $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, (string) $massactionbutton, $num_lines, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit, 0, 0, 1);
if ($massaction == 'set_default_account') {
$formquestion = array();
@@ -784,7 +784,7 @@ if ($result) {
// Suggested accounting account
print '';
- print $formaccounting->select_account(($default_account > 0 && $confirm === 'yes' && in_array($objp->rowid."_".$i, $toselect)) ? $default_account : $suggestedid, 'codeventil'.$facturefourn_static_det->id, 1, array(), 0, 0, 'codeventil maxwidth150 maxwidthonsmartphone', 'cachewithshowemptyone');
+ print $formaccounting->select_account(($default_account > 0 && $confirm === 'yes' && in_array($objp->rowid."_".$i, $toselect)) ? (string) $default_account : (string) $suggestedid, 'codeventil'.$facturefourn_static_det->id, 1, array(), 0, 0, 'codeventil maxwidth150 maxwidthonsmartphone', 'cachewithshowemptyone');
print ' | ';
// Column with checkbox
diff --git a/htdocs/adherents/admin/member.php b/htdocs/adherents/admin/member.php
index 788094b1934..1e0d3659821 100644
--- a/htdocs/adherents/admin/member.php
+++ b/htdocs/adherents/admin/member.php
@@ -604,7 +604,7 @@ if (isModEnabled('invoice')) {
print '';
$selected = getDolGlobalString('ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS');
print img_picto('', 'product', 'class="pictofixedwidth"');
- $form->select_produits($selected, 'ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', '', 0, 0, 1, 2, '', 0, [], 0, 1, 0, 'minwidth100 maxwidth500 widthcentpercentminusx');
+ $form->select_produits((int) $selected, 'ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', '', 0, 0, 1, 2, '', 0, [], 0, 1, 0, 'minwidth100 maxwidth500 widthcentpercentminusx');
print ' | ';
}
print "\n";
diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php
index 9a20a733ce1..3a71bde4cb0 100644
--- a/htdocs/adherents/class/adherent.class.php
+++ b/htdocs/adherents/class/adherent.class.php
@@ -672,7 +672,7 @@ class Adherent extends CommonObject
// Check parameters
if (getDolGlobalString('ADHERENT_MAIL_REQUIRED') && !isValidEmail((string) $this->email)) {
$langs->load("errors");
- $this->error = $langs->trans("ErrorBadEMail", $this->email);
+ $this->error = $langs->trans("ErrorBadEMail", (string) $this->email);
return -1;
}
if (!$this->datec) {
diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php
index 846a05b04e3..22a1a8bc307 100644
--- a/htdocs/adherents/class/adherent_type.class.php
+++ b/htdocs/adherents/class/adherent_type.class.php
@@ -494,12 +494,12 @@ class AdherentType extends CommonObject
$sql .= "statut = ".((int) $this->status).",";
$sql .= "libelle = '".$this->db->escape($this->label)."',";
$sql .= "morphy = '".$this->db->escape($this->morphy)."',";
- $sql .= "subscription = '".$this->db->escape($this->subscription)."',";
+ $sql .= "subscription = '".$this->db->escape((string) $this->subscription)."',";
$sql .= "amount = ".((empty($this->amount) && $this->amount == '') ? "null" : ((float) $this->amount)).",";
$sql .= "caneditamount = ".((int) $this->caneditamount).",";
$sql .= "duration = '".$this->db->escape($this->duration_value.$this->duration_unit)."',";
$sql .= "note = '".$this->db->escape($this->note_public)."',";
- $sql .= "vote = ".(int) $this->db->escape($this->vote).",";
+ $sql .= "vote = ".(int) $this->db->escape((string) $this->vote).",";
$sql .= "mail_valid = '".$this->db->escape($this->mail_valid)."'";
$sql .= " WHERE rowid =".((int) $this->id);
diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php
index 8b0aaf08db2..8b419ef384b 100644
--- a/htdocs/adherents/list.php
+++ b/htdocs/adherents/list.php
@@ -206,8 +206,8 @@ foreach ($object->fields as $key => $val) {
$visible = (int) dol_eval((string) $val['visible'], 1);
$arrayfields[$tableprefix.'.'.$key] = array(
'label' => $val['label'],
- 'checked' => (($visible < 0) ? 0 : 1),
- 'enabled' => (int) (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)),
+ 'checked' => (($visible < 0) ? '0' : '1'),
+ 'enabled' => (string) (int) (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)),
'position' => (int) $val['position'],
'help' => isset($val['help']) ? $val['help'] : ''
);
@@ -221,7 +221,6 @@ $object->fields = dol_sort_array($object->fields, 'position');
//$arrayfields['anotherfield'] = array('type'=>'integer', 'label'=>'AnotherField', 'checked'=>1, 'enabled'=>1, 'position'=>90, 'csslist'=>'right');
$arrayfields = dol_sort_array($arrayfields, 'position');
-'@phan-var-force array,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan
// Security check
$result = restrictedArea($user, 'adherent');
@@ -640,7 +639,7 @@ $arrayofselected = is_array($toselect) ? $toselect : array();
if ($search_type > 0) {
$membertype = new AdherentType($db);
- $result = $membertype->fetch($search_type);
+ $result = $membertype->fetch((int) $search_type);
$title .= " (".$membertype->label.")";
}
@@ -1348,7 +1347,7 @@ while ($i < $imaxinloop) {
}
// Company
if (!empty($arrayfields['d.company']['checked'])) {
- print '';
+ print ' | ';
print $companynametoshow;
print " | \n";
}
diff --git a/htdocs/adherents/stats/geo.php b/htdocs/adherents/stats/geo.php
index e64831600ce..99aea16bd6b 100644
--- a/htdocs/adherents/stats/geo.php
+++ b/htdocs/adherents/stats/geo.php
@@ -1,6 +1,6 @@
- * Copyright (C) 2024 MDW
+ * Copyright (C) 2024-2025 MDW
* Copyright (C) 2024 Alexandre Spangaro
* Copyright (C) 2024-2025 Frédéric France
*
@@ -234,7 +234,7 @@ if ($mode) {
$head = member_stats_prepare_head($memberstatic);
-print dol_get_fiche_head($head, $tab, '', -1, '');
+print dol_get_fiche_head($head, (string) $tab, '', -1, '');
// Print title
diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php
index c2fdc4f40d9..40a3b6c9df1 100644
--- a/htdocs/adherents/subscription.php
+++ b/htdocs/adherents/subscription.php
@@ -670,7 +670,7 @@ if ($action != 'editlogin' && $user->hasRight('adherent', 'creer')) {
print '';
print ' | ';
if ($action == 'editlogin') {
- $form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id, $object->user_id, 'userid', array());
+ $form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id, (string) $object->user_id, 'userid', array());
} else {
if ($object->user_id) {
$linkeduser = new User($db);
@@ -1070,7 +1070,7 @@ if (($action == 'addsubscription' || $action == 'create_thirdparty') && $user->h
}
if (getDolGlobalString('ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS') && (isModEnabled('product') || isModEnabled('service'))) {
$prodtmp = new Product($db);
- $result = $prodtmp->fetch(getDolGlobalString('ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS'));
+ $result = $prodtmp->fetch(getDolGlobalInt('ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS'));
if ($result < 0) {
setEventMessage($prodtmp->error, 'errors');
}
@@ -1100,7 +1100,7 @@ if (($action == 'addsubscription' || $action == 'create_thirdparty') && $user->h
}
if (getDolGlobalString('ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS') && (isModEnabled('product') || isModEnabled('service'))) {
$prodtmp = new Product($db);
- $result = $prodtmp->fetch(getDolGlobalString('ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS'));
+ $result = $prodtmp->fetch(getDolGlobalInt('ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS'));
if ($result < 0) {
setEventMessage($prodtmp->error, 'errors');
}
diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php
index 0ed42f226b8..2fea8182f51 100644
--- a/htdocs/adherents/type.php
+++ b/htdocs/adherents/type.php
@@ -8,7 +8,7 @@
* Copyright (C) 2019-2022 Thibault Foucart
* Copyright (C) 2020 Josep Lluís Amador
* Copyright (C) 2021 Waël Almoman
- * Copyright (C) 2024 MDW
+ * Copyright (C) 2024-2025 MDW
* Copyright (C) 2024-2025 Frédéric France
*
* This program is free software; you can redistribute it and/or modify
@@ -225,7 +225,7 @@ if ($action == 'add' && $user->hasRight('adherent', 'configurer')) {
if ($action == 'update' && $user->hasRight('adherent', 'configurer')) {
$object->fetch($rowid);
- $object->oldcopy = dol_clone($object, 2);
+ $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty
$object->label = trim($label);
$object->morphy = trim($morphy);
@@ -505,7 +505,7 @@ if (!$rowid && $action != 'create' && $action != 'edit') {
$colspan = 1;
foreach ($arrayfields as $key => $val) {
//if (!empty($val['checked'])) {
- $colspan++;
+ $colspan++;
//}
}
print '| '.$langs->trans("NoRecordFound").' | ';
@@ -654,7 +654,7 @@ if ($rowid > 0) {
print '| '.$langs->trans("Duration").' | ';
print $object->duration_value > 0 ? $object->duration_value : '';
print ' ';
- print (!empty($object->duration_unit) && isset($durationarray[$object->duration_unit]) ? $langs->trans($durationarray[$object->duration_unit]) : '');
+ print(!empty($object->duration_unit) && isset($durationarray[$object->duration_unit]) ? $langs->trans($durationarray[$object->duration_unit]) : '');
print ' | ';
// Description
@@ -812,7 +812,7 @@ if ($rowid > 0) {
if ($type > 0) {
$membertype = new AdherentType($db);
- $result = $membertype->fetch($type);
+ $result = $membertype->fetch((int) $type);
$titre .= " (".$membertype->label.")";
}
@@ -1076,7 +1076,7 @@ if ($rowid > 0) {
print '| '.$langs->trans("Amount").' | ';
print '';
print ' | ';
diff --git a/htdocs/adherents/vcard.php b/htdocs/adherents/vcard.php
index 96f5481c35c..98c61b08db9 100644
--- a/htdocs/adherents/vcard.php
+++ b/htdocs/adherents/vcard.php
@@ -4,7 +4,7 @@
* Copyright (C) 2005-2012 Regis Houssin
* Copyright (C) 2020 Tobias Sekan
* Copyright (C) 2020-2024 Frédéric France
- * Copyright (C) 2024 MDW
+ * Copyright (C) 2024-2025 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
@@ -96,7 +96,7 @@ $v = new vCard();
$v->setProdId('Dolibarr '.DOL_VERSION);
$v->setUid('DOLIBARR-ADHERENTID-'.$object->id);
-$v->setName($object->lastname, $object->firstname, "", $object->civility, "");
+$v->setName($object->lastname, $object->firstname, "", (string) $object->civility, "");
$v->setFormattedName($object->getFullName($langs, 1));
$v->setPhoneNumber($object->phone_pro, "TYPE=WORK;VOICE");
| |