From 0a958e98ec7646f7071d5997dad5dbfb422683b2 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com> Date: Tue, 4 Feb 2025 16:16:02 +0100 Subject: [PATCH 1/8] NEW: takepos cash control: add vat taxless total --- htdocs/compta/cashcontrol/report.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/cashcontrol/report.php b/htdocs/compta/cashcontrol/report.php index d4d1d6d758f..4b9d33c32af 100644 --- a/htdocs/compta/cashcontrol/report.php +++ b/htdocs/compta/cashcontrol/report.php @@ -226,6 +226,7 @@ if ($resql) { $totalqty = 0; $totalvat = 0; $totalvatperrate = array(); + $totalhtperrate = array(); $totallocaltax1 = 0; $totallocaltax2 = 0; $cachebankaccount = array(); @@ -257,8 +258,10 @@ if ($resql) { if ($line->tva_tx) { if (empty($totalvatperrate[$line->tva_tx])) { $totalvatperrate[$line->tva_tx] = 0; + $totalhtperrate[$line->tva_tx] = 0; } $totalvatperrate[$line->tva_tx] += $line->total_tva; + $totalhtperrate[$line->tva_tx] += $line->total_ht; } $totallocaltax1 += $line->total_localtax1; $totallocaltax2 += $line->total_localtax2; @@ -448,9 +451,9 @@ if ($resql) { } if (!empty($totalvatperrate) && is_array($totalvatperrate)) { - print '

'.$langs->trans("VATRate").'
'; + print '

'.$langs->trans("TotalHT").'
'.$langs->trans("TotalVAT").'
'; foreach ($totalvatperrate as $keyrate => $valuerate) { - print '
'.$langs->trans("VATRate").' '.vatrate($keyrate, true).' :
'.price($valuerate).'
'; + print '
'.$langs->trans("VATRate").' '.vatrate($keyrate, true).' :
'.price($totalhtperrate[$keyrate] ?? 0).'
'.price($valuerate).'
'; } } From ae7e3dcf2d1721c3082cddceb856489127381137 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 7 Feb 2025 09:54:02 +0100 Subject: [PATCH 2/8] NEW: add const to not include default CSS in top_htmlhead with DISABLE_CSS_DEFAULT_THEME --- htdocs/main.inc.php | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 1bfd7b4361e..d25d87140b9 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -2036,22 +2036,24 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr print ''."\n"; } - print ''."\n"; - // Output style sheets (optioncss='print' or ''). Note: $conf->css looks like '/theme/eldy/style.css.php' - $themepath = dol_buildpath($conf->css, 1); - $themesubdir = ''; - if (!empty($conf->modules_parts['theme'])) { // This slow down - foreach ($conf->modules_parts['theme'] as $reldir) { - if (file_exists(dol_buildpath($reldir.$conf->css, 0))) { - $themepath = dol_buildpath($reldir.$conf->css, 1); - $themesubdir = $reldir; - break; + if (!defined('DISABLE_CSS_DEFAULT_THEME')) { + print ''."\n"; + // Output style sheets (optioncss='print' or ''). Note: $conf->css looks like '/theme/eldy/style.css.php' + $themepath = dol_buildpath($conf->css, 1); + $themesubdir = ''; + if (!empty($conf->modules_parts['theme'])) { // This slow down + foreach ($conf->modules_parts['theme'] as $reldir) { + if (file_exists(dol_buildpath($reldir.$conf->css, 0))) { + $themepath = dol_buildpath($reldir.$conf->css, 1); + $themesubdir = $reldir; + break; + } } } + + print '' . "\n"; } - //print 'themepath='.$themepath.' themeparam='.$themeparam;exit; - print ''."\n"; if (getDolGlobalString('MAIN_FIX_FLASH_ON_CHROME')) { print ''."\n".''."\n"; } From 91abc644dd1d165681ba89b88d1706be25b83a7e Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 7 Feb 2025 10:04:34 +0100 Subject: [PATCH 3/8] NEW: add const to not include JQuery UI in top_htmlhead DISABLE_JQUERY_UI --- htdocs/main.inc.php | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 1bfd7b4361e..9004839fa99 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -2012,14 +2012,16 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr if (!defined('DISABLE_JQUERY') && !$disablejs && $conf->use_javascript_ajax) { print ''."\n"; - $jquerytheme = 'base'; - if (getDolGlobalString('MAIN_USE_JQUERY_THEME')) { - $jquerytheme = getDolGlobalString('MAIN_USE_JQUERY_THEME'); - } - if (constant('JS_JQUERY_UI')) { - print ''."\n"; // Forced JQuery - } else { - print ''."\n"; // JQuery + if (!defined('DISABLE_JQUERY_UI')) { + $jquerytheme = 'base'; + if (getDolGlobalString('MAIN_USE_JQUERY_THEME')) { + $jquerytheme = getDolGlobalString('MAIN_USE_JQUERY_THEME'); + } + if (constant('JS_JQUERY_UI')) { + print '' . "\n"; // Forced JQuery + } else { + print '' . "\n"; // JQuery + } } if (!defined('DISABLE_JQUERY_JNOTIFY')) { print ''."\n"; // JNotify @@ -2118,10 +2120,12 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr } else { print ''."\n"; } - if (defined('JS_JQUERY_UI') && constant('JS_JQUERY_UI')) { - print ''."\n"; - } else { - print ''."\n"; + if (!defined('DISABLE_JQUERY_UI')) { + if (defined('JS_JQUERY_UI') && constant('JS_JQUERY_UI')) { + print '' . "\n"; + } else { + print '' . "\n"; + } } // jQuery jnotify if (!getDolGlobalString('MAIN_DISABLE_JQUERY_JNOTIFY') && !defined('DISABLE_JQUERY_JNOTIFY')) { From 15dec468cb555e43e3454d431b7c23b87e89d093 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 7 Feb 2025 10:05:06 +0100 Subject: [PATCH 4/8] NEW: add const to not include JQuery UI in top_htmlhead DISABLE_JQUERY_UI --- htdocs/main.inc.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 9004839fa99..3ddad620a92 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -2120,6 +2120,8 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr } else { print ''."\n"; } + + if (!defined('DISABLE_JQUERY_UI')) { if (defined('JS_JQUERY_UI') && constant('JS_JQUERY_UI')) { print '' . "\n"; From 867215e2eae009af0b4e5f11b84f01363fed2104 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 7 Feb 2025 10:05:17 +0100 Subject: [PATCH 5/8] NEW: add const to not include JQuery UI in top_htmlhead DISABLE_JQUERY_UI --- htdocs/main.inc.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 3ddad620a92..9004839fa99 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -2120,8 +2120,6 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr } else { print ''."\n"; } - - if (!defined('DISABLE_JQUERY_UI')) { if (defined('JS_JQUERY_UI') && constant('JS_JQUERY_UI')) { print '' . "\n"; From a8811551092404b7ea028c21001033173884af5d Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 7 Feb 2025 10:10:45 +0100 Subject: [PATCH 6/8] NEW: add const to not include default CSS in top_htmlhead with DISABLE_CSS_DEFAULT_THEME --- htdocs/main.inc.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index d25d87140b9..9b126b49724 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -2036,21 +2036,21 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr print ''."\n"; } - if (!defined('DISABLE_CSS_DEFAULT_THEME')) { - print ''."\n"; - // Output style sheets (optioncss='print' or ''). Note: $conf->css looks like '/theme/eldy/style.css.php' - $themepath = dol_buildpath($conf->css, 1); - $themesubdir = ''; - if (!empty($conf->modules_parts['theme'])) { // This slow down - foreach ($conf->modules_parts['theme'] as $reldir) { - if (file_exists(dol_buildpath($reldir.$conf->css, 0))) { - $themepath = dol_buildpath($reldir.$conf->css, 1); - $themesubdir = $reldir; - break; - } + // Output style sheets (optioncss='print' or ''). Note: $conf->css looks like '/theme/eldy/style.css.php' + $themepath = dol_buildpath($conf->css, 1); + $themesubdir = ''; + if (!empty($conf->modules_parts['theme'])) { // This slow down + foreach ($conf->modules_parts['theme'] as $reldir) { + if (file_exists(dol_buildpath($reldir.$conf->css, 0))) { + $themepath = dol_buildpath($reldir.$conf->css, 1); + $themesubdir = $reldir; + break; } } + } + if (!defined('DISABLE_CSS_DEFAULT_THEME')) { + print ''."\n"; print '' . "\n"; } From 712a2b544a3b4e058934736d21aa1872df2400fb Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Fri, 7 Feb 2025 10:46:13 +0100 Subject: [PATCH 7/8] Fix false positive --- htdocs/core/class/commondocgenerator.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index ba37cce06b2..ba2c7d0ae94 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -927,6 +927,7 @@ abstract class CommonDocGenerator foreach ($date_specs as $date_spec) { $propertyname = $date_spec[1]; if (property_exists($line, $propertyname)) { + // @phan-suppress-next-line PhanUndeclaredProperty $resarray[$date_spec[0]] = dol_print_date($line->$propertyname, $date_spec[2], $date_spec[3], $date_spec[4]); } } From 28724db69e1e64e294b3dc871561e5c1b19b1669 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Fri, 7 Feb 2025 10:52:23 +0100 Subject: [PATCH 8/8] Try to fix phpstan false positive --- htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php b/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php index f8a99d51d40..006d797f5b6 100644 --- a/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php +++ b/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php @@ -405,6 +405,7 @@ class doc_generic_bom_odt extends ModelePDFBom if ($foundtagforlines) { $linenumber = 0; foreach ($object->lines as $line) { + /** @var BOMLine $line */ $linenumber++; if ($line->fk_product > 0) {