diff --git a/dev/build/phpstan/phpstan-baseline.neon b/dev/build/phpstan/phpstan-baseline.neon index a7729ec1878..b34cfc57794 100644 --- a/dev/build/phpstan/phpstan-baseline.neon +++ b/dev/build/phpstan/phpstan-baseline.neon @@ -7356,24 +7356,6 @@ parameters: count: 1 path: ../../../htdocs/core/modules/import/import_csv.modules.php - - - message: '#^Property ModeleImports\:\:\$errors \(array\\) does not accept array\\|string\>\.$#' - identifier: assign.propertyType - count: 3 - path: ../../../htdocs/core/modules/import/import_csv.modules.php - - - - message: '#^Property ModeleImports\:\:\$errors \(array\\) does not accept array\\|string\>\.$#' - identifier: assign.propertyType - count: 3 - path: ../../../htdocs/core/modules/import/import_csv.modules.php - - - - message: '#^Property ModeleImports\:\:\$warnings \(array\\) does not accept array\\|string\>\.$#' - identifier: assign.propertyType - count: 1 - path: ../../../htdocs/core/modules/import/import_csv.modules.php - - message: '#^Variable \$key might not be defined\.$#' identifier: variable.undefined @@ -7422,24 +7404,6 @@ parameters: count: 1 path: ../../../htdocs/core/modules/import/import_xlsx.modules.php - - - message: '#^Property ModeleImports\:\:\$errors \(array\\) does not accept array\\|string\>\.$#' - identifier: assign.propertyType - count: 3 - path: ../../../htdocs/core/modules/import/import_xlsx.modules.php - - - - message: '#^Property ModeleImports\:\:\$errors \(array\\) does not accept array\\|string\>\.$#' - identifier: assign.propertyType - count: 3 - path: ../../../htdocs/core/modules/import/import_xlsx.modules.php - - - - message: '#^Property ModeleImports\:\:\$warnings \(array\\) does not accept array\\|string\>\.$#' - identifier: assign.propertyType - count: 1 - path: ../../../htdocs/core/modules/import/import_xlsx.modules.php - - message: '#^Variable \$where might not be defined\.$#' identifier: variable.undefined diff --git a/htdocs/core/boxes/box_members_last_subscriptions.php b/htdocs/core/boxes/box_members_last_subscriptions.php index 25c40cee881..77cd63e5ea0 100644 --- a/htdocs/core/boxes/box_members_last_subscriptions.php +++ b/htdocs/core/boxes/box_members_last_subscriptions.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2017 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2015-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 @@ -140,7 +140,7 @@ class box_members_last_subscriptions extends ModeleBoxes 'asis' => 1, ); - $daterange = get_date_range($this->db->jdate($obj->date_start), $this->db->jdate($obj->date_end), '', null, 0); + $daterange = get_date_range($this->db->jdate($obj->date_start), $this->db->jdate($obj->date_end), '', $langs, 0); $this->info_box_contents[$line][] = array( 'td' => 'class="tdoverflowmax150 maxwidth150onsmartphone" title="'.dol_escape_htmltag($daterange).'"', 'text' => ''.$daterange.'', diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 23e46a5376a..a3b0e6c7aca 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -9385,8 +9385,10 @@ function dol_htmlwithnojs($stringtoencode, $nouseofiframesandbox = 0, $check = ' * @return string Translated string for the key */ function ($m) { - return '__BRACKETSTART' . $m[1] . 'BRACKETEND__'; }, - $out); + return '__BRACKETSTART' . $m[1] . 'BRACKETEND__'; + }, + $out + ); $dom->loadHTML($out, LIBXML_HTML_NODEFDTD | LIBXML_ERR_NONE | LIBXML_HTML_NOIMPLIED | LIBXML_NONET | LIBXML_NOWARNING | LIBXML_NOERROR | LIBXML_NOXMLDECL); @@ -9402,8 +9404,10 @@ function dol_htmlwithnojs($stringtoencode, $nouseofiframesandbox = 0, $check = ' * @return string Translated string for the key */ function ($m) { - return '__[' . $m[1] . ']__'; }, - $out); + return '__[' . $m[1] . ']__'; + }, + $out + ); // Remove the trick added to solve pb with text in utf8 and text without parent tag //$out = preg_replace('/^'.preg_quote('', '/').'/', '', $out); @@ -10973,8 +10977,8 @@ function print_date_range($date_start, $date_end, $format = '', $outputlangs = n * @param int $date_start Start date * @param int $date_end End date * @param string $format Output date format ('day', 'dayhour', ...) - * @param Translate $outputlangs Output language - * @param integer $withparenthesis 1=Add space and parenthesis, 0=no parenthesis, 2=Add parenthesis + * @param ?Translate $outputlangs Output language + * @param int<0,2> $withparenthesis 1=Add space and parenthesis, 0=no parenthesis, 2=Add parenthesis * @return string String */ function get_date_range($date_start, $date_end, $format = '', $outputlangs = null, $withparenthesis = 1) diff --git a/htdocs/core/menus/standard/auguria_menu.php b/htdocs/core/menus/standard/auguria_menu.php index 8812052ba66..2775ebdcdfd 100644 --- a/htdocs/core/menus/standard/auguria_menu.php +++ b/htdocs/core/menus/standard/auguria_menu.php @@ -2,7 +2,7 @@ /* Copyright (C) 2007 Patrick Raguin * Copyright (C) 2009 Regis Houssin * Copyright (C) 2008-2013 Laurent Destailleur - * 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 @@ -244,12 +244,12 @@ class MenuManager // Start a new ul level 1 $level = 1; - print str_pad('', $level).''."\n"; // end ul level 1 + print str_repeat(' ', $level - 1).''."\n"; // end ul level 1 } elseif ($val['enabled'] == 2) { print '
  • '; diff --git a/htdocs/core/menus/standard/eldy_menu.php b/htdocs/core/menus/standard/eldy_menu.php index 983b43e6169..00bba6c0239 100644 --- a/htdocs/core/menus/standard/eldy_menu.php +++ b/htdocs/core/menus/standard/eldy_menu.php @@ -1,7 +1,7 @@ * Copyright (C) 2007-2009 Regis Houssin - * 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 @@ -246,12 +246,12 @@ class MenuManager // Start a new ul level 1 $level = 1; - print str_pad('', $level).''."\n"; // end ul level 1 + print str_repeat(' ', $level - 1).'
  • '."\n"; // end ul level 1 } elseif ($val['enabled'] == 2) { print '
  • '; diff --git a/htdocs/core/modules/mailings/partnership.modules.php b/htdocs/core/modules/mailings/partnership.modules.php index 9f74591539f..a712196e391 100644 --- a/htdocs/core/modules/mailings/partnership.modules.php +++ b/htdocs/core/modules/mailings/partnership.modules.php @@ -258,7 +258,7 @@ class mailing_partnership extends MailingTargets if ($resql) { $num = $this->db->num_rows($resql); - if (!isModenabled("partnership")) { + if (!isModEnabled("partnership")) { $num = 0; // Force empty list if module is not enabled } diff --git a/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php b/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php index 054dcd09eb6..c813f3392cb 100644 --- a/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php +++ b/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php @@ -54,11 +54,6 @@ class mailing_thirdparties_services_expired extends MailingTargets */ public $picto = 'company'; - /** - * @var array - */ - //public $arrayofproducts = array(); - /** * Constructor @@ -214,12 +209,14 @@ class mailing_thirdparties_services_expired extends MailingTargets // Example: return parent::getNbOfRecipients("SELECT count(*) as nb from dolibarr_table"); // Example: return 500; $sql = "SELECT count(*) as nb"; - $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as c"; - $sql .= ", ".MAIN_DB_PREFIX."contratdet as cd, ".MAIN_DB_PREFIX."product as p"; + $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as c,"; + $sql .= " ".MAIN_DB_PREFIX."contratdet as cd, ".MAIN_DB_PREFIX."product as p"; $sql .= " WHERE s.entity IN (".getEntity('societe').")"; $sql .= " AND s.rowid = c.fk_soc AND cd.fk_contrat = c.rowid AND s.email != ''"; - $sql .= " AND cd.statut= 4 AND cd.fk_product=p.rowid"; - $sql .= " AND p.ref IN (".$this->db->sanitize("'".implode("','", $this->arrayofproducts)."'", 1).")"; + $sql .= " AND cd.statut= 4 AND cd.fk_product = p.rowid"; + if (!getDolGlobalString('CONTRACT_SUPPORT_PRODUCTS')) { + $sql .= " AND p.fk_product_type = 1"; // By default, only services + } $sql .= " AND cd.date_fin_validite < '".$this->db->idate($now)."'"; if (empty($this->evenunsubscribe)) { $sql .= " AND NOT EXISTS (SELECT rowid FROM ".MAIN_DB_PREFIX."mailing_unsubscribe as mu WHERE mu.email = s.email and mu.entity = ".((int) $conf->entity).")"; diff --git a/htdocs/core/tpl/objectline_title.tpl.php b/htdocs/core/tpl/objectline_title.tpl.php index fff2656659b..c97a08012e7 100644 --- a/htdocs/core/tpl/objectline_title.tpl.php +++ b/htdocs/core/tpl/objectline_title.tpl.php @@ -104,7 +104,10 @@ if (in_array($object->element, array('propal', 'commande', 'facture', 'supplier_ //print ''; if (GETPOST('mode', 'aZ09') == 'vatforalllines') { print '
    '; - print $form->load_tva('vatforalllines', '', $mysoc, $object->thirdparty, 0, 0, '', false, 1); + $societe_vendeuse = strpos($object->element, 'supplier') === false ? $mysoc : $object->thirdparty; + $societe_acheteuse = strpos($object->element, 'supplier') === false ? $object->thirdparty : $mysoc; + $vat_mode = strpos($object->element, 'supplier') === false ? 1 : 2; + print $form->load_tva('vatforalllines', '', $societe_vendeuse, $societe_acheteuse, 0, 0, '', false, 1, $vat_mode); print ''; print '
    '; } diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index 44dd126b498..228bf211b96 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -2356,11 +2356,11 @@ class ExpenseReport extends CommonObject * deleteline * * @param int $rowid Row id - * @param User|string $fuser User + * @param ?User $fuser User * @param int<0,1> $notrigger 1=No trigger * @return int<-1,1> Return integer <0 if KO, >0 if OK */ - public function deleteLine($rowid, $fuser = '', $notrigger = 0) + public function deleteLine($rowid, $fuser = null, $notrigger = 0) { $error = 0; diff --git a/htdocs/langs/de_DE/accountancy.lang b/htdocs/langs/de_DE/accountancy.lang index b9ea42dab2e..8b6333c7186 100644 --- a/htdocs/langs/de_DE/accountancy.lang +++ b/htdocs/langs/de_DE/accountancy.lang @@ -186,7 +186,7 @@ ACCOUNTING_RESULT_LOSS=Ergebnisabrechnungskonto (Verlust) ACCOUNTING_CLOSURE_DEFAULT_JOURNAL=Journal für Abschlussbuchungen ACCOUNTING_CLOSURE_ACCOUNTING_GROUPS_USED_FOR_BALANCE_SHEET_ACCOUNT=Kontengruppen, die zur Berechnung der Bilanz verwendet werden ACCOUNTING_CLOSURE_ACCOUNTING_GROUPS_USED_FOR_BALANCE_SHEET_ACCOUNTHelp=Legen Sie hier die Liste der Kontengruppen (definiert im Kontenplan) fest, die verwendet werden müssen, um alle Konten zur Berechnung der Bilanz zu finden. Trennen Sie die einzelnen Werte durch Kommas.
    Beispiel: CAPIT,IMMOSTOCK,FINAN,THIRDPARTY -ACCOUNTING_CLOSURE_ACCOUNTING_GROUPS_USED_FOR_INCOME_STATEMENT=Kontenruppen, die zur Berechnung der Gewinn- und Verlustrechnung verwendet werden +ACCOUNTING_CLOSURE_ACCOUNTING_GROUPS_USED_FOR_INCOME_STATEMENT=Kontengruppen, die zur Berechnung der Gewinn- und Verlustrechnung verwendet werden ACCOUNTING_CLOSURE_ACCOUNTING_GROUPS_USED_FOR_INCOME_STATEMENTHelp=Legen Sie hier die Liste der Kontengruppen (definiert im Kontenplan) fest, die verwendet werden müssen, um alle Konten zu finden um die Gewinn- und Verlustrechnung zu berechnen. Trennen Sie die einzelnen Werte durch Kommas.
    Beispiel: ERLÖSE,AUFWENDUNGEN ACCOUNTING_ACCOUNT_TRANSFER_CASH=Konto (aus dem Kontenplan), das als Verrechnungskonto/Transferkonto für Banküberweisungen verwendet werden soll TransitionalAccount=Überweisungskonto