diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index 967d16ab04e..cbe0f4b2732 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -9,8 +9,7 @@ concurrency: cancel-in-progress: true env: - CACHE_KEY_PART: ${{ github.event_name == 'pull_request' && format('{0}-{1}', -github.base_ref, github.head_ref) || github.ref_name }} + CACHE_KEY_PART: ${{ github.event_name == 'pull_request' && format('{0}-{1}', github.base_ref, github.head_ref) || github.ref_name }} GITHUB_JSON: ${{ toJSON(github) }} # Helps in debugging Github Action # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: @@ -57,7 +56,8 @@ jobs: # Run PHPStan - name: Run PHPStan id: phpstan - run: phpstan -vvv analyse --error-format=checkstyle --memory-limit 4G -a build/phpstan/bootstrap_action.php -c phpstan.neon | tee _stan.xml | cs2pr --graceful-warnings + run: | + phpstan -vvv analyse --error-format=checkstyle --memory-limit 7G -a build/phpstan/bootstrap_action.php | tee _stan.xml | cs2pr --graceful-warnings # continue-on-error: true # Save cache diff --git a/.gitignore b/.gitignore index efe6c66dfc0..2964b1ead0f 100644 --- a/.gitignore +++ b/.gitignore @@ -66,8 +66,21 @@ doc/install.lock /composer.json /composer.lock -# to execute pre-commit -local.sh +# Local script, executed during pre-commit +/local.sh + +# Local phpstan configuration +/phpstan.neon +/phpstan-baseline.neon + +# Logs +/*.log + +# Vim swap files +*.sw? + +# Generated by PHPUNIT.BAT +/INI_PHPUNIT # ignore cache builds /build/phpstan/phpstan @@ -75,3 +88,4 @@ local.sh phpstan_custom.neon /.php-cs-fixer.cache /.php_cs.cache +/.cache diff --git a/htdocs/accountancy/admin/productaccount.php b/htdocs/accountancy/admin/productaccount.php index fa0db20a05f..fdd471b2fac 100644 --- a/htdocs/accountancy/admin/productaccount.php +++ b/htdocs/accountancy/admin/productaccount.php @@ -5,6 +5,7 @@ * Copyright (C) 2014 Juanjo Menent * Copyright (C) 2015 Ari Elbaz (elarifr) * Copyright (C) 2021 Gauthier VERDOL + * 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 @@ -206,7 +207,7 @@ if ($action == 'update') { $sql_exists .= " WHERE fk_product = " . ((int) $productid) . " AND entity = " . ((int) $conf->entity); $resql_exists = $db->query($sql_exists); if (!$resql_exists) { - $msg .= '
'.$langs->trans("ErrorDB").' : '.$langs->trans("Product").' '.$productid.' '.$langs->trans("NotVentilatedinAccount").' : id='.$accounting_account_id.'
'.$resql_exists.'
'; + $msg .= '
'.$langs->trans("ErrorDB").' : '.$langs->trans("Product").' '.$productid.' '.$langs->trans("NotVentilatedinAccount").' : id='.$accounting_account_id.'
'.json_encode($resql_exists).'
'; $ko++; } else { $nb_exists = $db->num_rows($resql_exists); diff --git a/htdocs/accountancy/bookkeeping/export.php b/htdocs/accountancy/bookkeeping/export.php index 97163ce1c16..610b6d4384a 100644 --- a/htdocs/accountancy/bookkeeping/export.php +++ b/htdocs/accountancy/bookkeeping/export.php @@ -528,7 +528,7 @@ $sqlwhere = array(); if (count($filter) > 0) { foreach ($filter as $key => $value) { if ($key == 't.doc_date') { - $sqlwhere[] = $db->sanitize($key).' = \''.$db->idate($value).'\''; + $sqlwhere[] = $db->sanitize($key)." = '".$db->idate($value)."'"; } elseif ($key == 't.doc_date>=') { $sqlwhere[] = "t.doc_date >= '".$db->idate($value)."'"; } elseif ($key == 't.doc_date<=') { @@ -556,17 +556,17 @@ if (count($filter) > 0) { } elseif ($key == 't.tms<=') { $sqlwhere[] = "t.tms <= '".$db->idate($value)."'"; } elseif ($key == 't.date_creation>=') { - $sqlwhere[] = 't.date_creation >= \''.$db->idate($value).'\''; + $sqlwhere[] = "t.date_creation >= '".$db->idate($value)."'"; } elseif ($key == 't.date_creation<=') { - $sqlwhere[] = 't.date_creation <= \''.$db->idate($value).'\''; + $sqlwhere[] = "t.date_creation <= '".$db->idate($value)."'"; } elseif ($key == 't.date_export>=') { - $sqlwhere[] = 't.date_export >= \''.$db->idate($value).'\''; + $sqlwhere[] = "t.date_export >= '".$db->idate($value)."'"; } elseif ($key == 't.date_export<=') { - $sqlwhere[] = 't.date_export <= \''.$db->idate($value).'\''; + $sqlwhere[] = "t.date_export <= '".$db->idate($value)."'"; } elseif ($key == 't.date_validated>=') { - $sqlwhere[] = 't;date_validate >= \''.$db->idate($value).'\''; + $sqlwhere[] = "t;date_validate >= '".$db->idate($value)."'"; } elseif ($key == 't.date_validated<=') { - $sqlwhere[] = 't;date_validate <= \''.$db->idate($value).'\''; + $sqlwhere[] = "t;date_validate <= '".$db->idate($value)."'"; } elseif ($key == 't.credit' || $key == 't.debit') { $sqlwhere[] = natural_search($key, $value, 1, 1); } elseif ($key == 't.reconciled_option') { diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index 07f864cd5ef..6e84cc8e01d 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -620,7 +620,7 @@ $sqlwhere = array(); if (count($filter) > 0) { foreach ($filter as $key => $value) { if ($key == 't.doc_date') { - $sqlwhere[] = $db->sanitize($key).' = \''.$db->idate($value).'\''; + $sqlwhere[] = $db->sanitize($key)." = '".$db->idate($value)."'"; } elseif ($key == 't.doc_date>=') { $sqlwhere[] = "t.doc_date >= '".$db->idate($value)."'"; } elseif ($key == 't.doc_date<=') { @@ -648,17 +648,17 @@ if (count($filter) > 0) { } elseif ($key == 't.tms<=') { $sqlwhere[] = "t.tms <= '".$db->idate($value)."'"; } elseif ($key == 't.date_creation>=') { - $sqlwhere[] = 't.date_creation >= \''.$db->idate($value).'\''; + $sqlwhere[] = "t.date_creation >= '".$db->idate($value)."'"; } elseif ($key == 't.date_creation<=') { - $sqlwhere[] = 't.date_creation <= \''.$db->idate($value).'\''; + $sqlwhere[] = "t.date_creation <= '".$db->idate($value)."'"; } elseif ($key == 't.date_export>=') { - $sqlwhere[] = 't.date_export >= \''.$db->idate($value).'\''; + $sqlwhere[] = "t.date_export >= '".$db->idate($value)."'"; } elseif ($key == 't.date_export<=') { - $sqlwhere[] = 't.date_export <= \''.$db->idate($value).'\''; + $sqlwhere[] = "t.date_export <= '".$db->idate($value)."'"; } elseif ($key == 't.date_validated>=') { - $sqlwhere[] = 't;date_validate >= \''.$db->idate($value).'\''; + $sqlwhere[] = "t;date_validate >= '".$db->idate($value)."'"; } elseif ($key == 't.date_validated<=') { - $sqlwhere[] = 't;date_validate <= \''.$db->idate($value).'\''; + $sqlwhere[] = "t;date_validate <= '".$db->idate($value)."'"; } elseif ($key == 't.credit' || $key == 't.debit') { $sqlwhere[] = natural_search($key, $value, 1, 1); } elseif ($key == 't.reconciled_option') { diff --git a/htdocs/admin/invoice.php b/htdocs/admin/invoice.php index fe290ea6f80..26678685f53 100644 --- a/htdocs/admin/invoice.php +++ b/htdocs/admin/invoice.php @@ -150,8 +150,7 @@ if ($action == 'updateMask') { $ret = addDocumentModel($value, $type, $label, $scandir); } } elseif ($action == 'setmod') { - // TODO Verifier si module numerotation choisi peut etre active - // par appel method canBeActivated + // TODO Check if numbering module chosen can ba activated by calling method canBeActivated() dolibarr_set_const($db, "FACTURE_ADDON", $value, 'chaine', 0, '', $conf->entity); } elseif ($action == 'setribchq') { @@ -629,10 +628,10 @@ if (getDolGlobalString('INVOICE_USE_DEFAULT_DOCUMENT')) { // Hidden conf print "\n"; $listtype = array( - Facture::TYPE_STANDARD => $langs->trans("InvoiceStandard"), - Facture::TYPE_REPLACEMENT => $langs->trans("InvoiceReplacement"), - Facture::TYPE_CREDIT_NOTE => $langs->trans("InvoiceAvoir"), - Facture::TYPE_DEPOSIT => $langs->trans("InvoiceDeposit"), + Facture::TYPE_STANDARD=>$langs->trans("InvoiceStandard"), + Facture::TYPE_REPLACEMENT=>$langs->trans("InvoiceReplacement"), + Facture::TYPE_CREDIT_NOTE=>$langs->trans("InvoiceAvoir"), + Facture::TYPE_DEPOSIT=>$langs->trans("InvoiceDeposit"), ); if (getDolGlobalInt('INVOICE_USE_SITUATION')) { $listtype[Facture::TYPE_SITUATION] = $langs->trans("InvoiceSituation"); diff --git a/htdocs/admin/system/security.php b/htdocs/admin/system/security.php index 9a0138ba6cf..0d98c3161e7 100644 --- a/htdocs/admin/system/security.php +++ b/htdocs/admin/system/security.php @@ -341,12 +341,13 @@ if (!getDolGlobalString('SECURITY_DISABLE_TEST_ON_OBFUSCATED_CONF')) { } print '$dolibarr_main_stream_to_disable: '; +// $arrayofstreamtodisable is defined into filefunc.inc.php if (empty($dolibarr_main_stream_to_disable)) { print ''.$langs->trans("Undefined").' = '.implode(', ', $arrayofstreamtodisable).''; } else { print implode(', ', $dolibarr_main_stream_to_disable); } -print ' -> PHP streams allowed = '; +print ' -> Current PHP streams allowed = '; $arrayofstreams = stream_get_wrappers(); if (!empty($arrayofstreams)) { sort($arrayofstreams); diff --git a/htdocs/admin/system/xdebug.php b/htdocs/admin/system/xdebug.php index 719b81859c3..9e0b05a24a3 100644 --- a/htdocs/admin/system/xdebug.php +++ b/htdocs/admin/system/xdebug.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 @@ -90,7 +91,12 @@ if (function_exists('socket_create')) { //$client = socket_accept($sock); $client = socket_connect($socket, $address, $port); if ($client) { - print "Connection established: ".$client." - address=".$address." port=".$port."
\n"; + if (is_bool($client)) { + $client_str = 'true'; + } else { + $client_str = (string) $client; + } + print "Connection established: ".$client_str." - address=".$address." port=".$port."
\n"; print "There is a Remote debug server at this address.
\n"; print "
\n"; print "To be sure this debugger accepts input from your PHP server and xdebug, be sure to have\n"; diff --git a/htdocs/blockedlog/class/blockedlog.class.php b/htdocs/blockedlog/class/blockedlog.class.php index 451720bbd59..2166a0eb8cd 100644 --- a/htdocs/blockedlog/class/blockedlog.class.php +++ b/htdocs/blockedlog/class/blockedlog.class.php @@ -2,6 +2,7 @@ /* Copyright (C) 2017 ATM Consulting * Copyright (C) 2017-2020 Laurent Destailleur * Copyright (C) 2022 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 @@ -1014,7 +1015,7 @@ class BlockedLog unset($keyforsignature); return array('checkresult' => $res, 'calculatedsignature' => $signature, 'previoushash' => $previoushash); } else { // Consume much memory ($keyforsignature is a large var) - return array('checkresult' => $res, 'calculatedsignature' => $signature, 'previoushash' => $previoushash, 'keyforsignature'=>$keyforsignature); + return array('checkresult' => $res, 'calculatedsignature' => $signature, 'previoushash' => $previoushash, 'keyforsignature' => $keyforsignature); } } else { unset($keyforsignature); @@ -1227,7 +1228,7 @@ class BlockedLog dol_print_error($this->db); } - dol_syslog("Module Blockedlog alreadyUsed with ignoresystem=".$ignoresystem." is ".$result); + dol_syslog("Module Blockedlog alreadyUsed with ignoresystem=".$ignoresystem." is ".json_encode($result)); return $result; } diff --git a/htdocs/bookmarks/card.php b/htdocs/bookmarks/card.php index 3e474c85762..57177cd410c 100644 --- a/htdocs/bookmarks/card.php +++ b/htdocs/bookmarks/card.php @@ -228,6 +228,7 @@ if ($id > 0 && !preg_match('/^add/i', $action)) { print '
'; print ''; + // Title print ''; + // URL print '
'; if ($action == 'edit') { print ''; @@ -247,6 +248,7 @@ if ($id > 0 && !preg_match('/^add/i', $action)) { } print '
'; if ($action == 'edit') { print ''; @@ -255,7 +257,7 @@ if ($id > 0 && !preg_match('/^add/i', $action)) { if ($action == 'edit') { print ''; } - print ''; + print ''; if ($action == 'edit') { print 'url).'">'; } else { diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index a73b24e9d28..62b813d8eb1 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -6,6 +6,7 @@ * Copyright (C) 2015 Marcos García * Copyright (C) 2018 Nicolas ZABOURI * Copyright (C) 2018-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 @@ -2728,7 +2729,7 @@ class ActionComm extends CommonObject return 0; } else { $this->db->commit(); // We commit also on error, to have the error message recorded. - $this->error = 'Nb of emails sent : '.$nbMailSend.', '.(!empty($errorsMsg)) ? implode(', ', $errorsMsg) : $error; + $this->error = 'Nb of emails sent : '.$nbMailSend.', '.(!empty($errorsMsg) ? implode(', ', $errorsMsg) : $error); dol_syslog(__METHOD__." end - ".$this->error, LOG_INFO); diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index 0618b4c94dc..f44f53071bd 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -532,7 +532,7 @@ if (empty($reshook)) { setEventMessages($langs->trans("MailSuccessfulySent", $mailfile->getValidAddress($object->email_from, 2), $mailfile->getValidAddress($object->sendto, 2)), null, 'mesgs'); $action = ''; } else { - setEventMessages($langs->trans("ResultKo").'
'.$mailfile->error.' '.$result, null, 'errors'); + setEventMessages($langs->trans("ResultKo").'
'.$mailfile->error.' '.json_encode($result), null, 'errors'); $action = 'test'; } } diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 89a8fe99d84..f621e9c430c 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -12,7 +12,7 @@ * Copyright (C) 2013 Jean-Francois FERRY * Copyright (C) 2013-2014 Florian Henry * Copyright (C) 2013 Cédric Salvador - * Copyright (C) 2014-2019 Ferran Marcet + * Copyright (C) 2014-2024 Ferran Marcet * Copyright (C) 2015-2016 Marcos García * Copyright (C) 2018-2023 Frédéric France * Copyright (C) 2022 Gauthier VERDOL @@ -1662,7 +1662,7 @@ if (empty($reshook)) { null, 0, '', - 1 + (!empty($conf->global->MAIN_DEPOSIT_MULTI_TVA)?0:1) ); } diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 352e23c0431..e0e994959a7 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -5915,7 +5915,7 @@ class Facture extends CommonInvoice return 0; } else { - $this->error = 'Nb of emails sent : '.$nbMailSend.', '.(!empty($errorsMsg)) ? implode(', ', $errorsMsg) : $error; + $this->error = 'Nb of emails sent : '.$nbMailSend.', '.(!empty($errorsMsg) ? implode(', ', $errorsMsg) : $error); dol_syslog(__METHOD__." end - ".$this->error, LOG_INFO); diff --git a/htdocs/contrat/index.php b/htdocs/contrat/index.php index 28f6c49a9fb..9f7089afc5f 100644 --- a/htdocs/contrat/index.php +++ b/htdocs/contrat/index.php @@ -4,6 +4,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2019 Nicolas ZABOURI + * 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,9 +155,9 @@ if ($resql) { while ($i < $num) { $obj = $db->fetch_object($resql); if ($obj) { - $nb[$obj->status.true] = $obj->nb; + $nb[$obj->status.((string) true)] = $obj->nb; if ($obj->status != 5) { - $vals[$obj->status.true] = $obj->nb; + $vals[$obj->status.((string) true)] = $obj->nb; $totalinprocess += $obj->nb; } $total += $obj->nb; @@ -175,26 +176,28 @@ include DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php'; print '
'; print ''; print ''."\n"; -$listofstatus = array(0, 4, 4, 5); $bool = false; +$listofstatus = array(0, 4, 4, 5); +$bool = false; foreach ($listofstatus as $status) { - $dataseries[] = array($staticcontratligne->LibStatut($status, 1, ($bool ? 1 : 0)), (isset($nb[$status.$bool]) ? (int) $nb[$status.$bool] : 0)); + $bool_str = (string) $bool; + $dataseries[] = array($staticcontratligne->LibStatut($status, 1, ($bool ? 1 : 0)), (isset($nb[$status.$bool_str]) ? (int) $nb[$status.$bool_str] : 0)); if ($status == ContratLigne::STATUS_INITIAL) { - $colorseries[$status.$bool] = '-'.$badgeStatus0; + $colorseries[$status.$bool_str] = '-'.$badgeStatus0; } if ($status == ContratLigne::STATUS_OPEN && !$bool) { - $colorseries[$status.$bool] = $badgeStatus4; + $colorseries[$status.$bool_str] = $badgeStatus4; } if ($status == ContratLigne::STATUS_OPEN && $bool) { - $colorseries[$status.$bool] = $badgeStatus1; + $colorseries[$status.$bool_str] = $badgeStatus1; } if ($status == ContratLigne::STATUS_CLOSED) { - $colorseries[$status.$bool] = $badgeStatus6; + $colorseries[$status.$bool_str] = $badgeStatus6; } if (empty($conf->use_javascript_ajax)) { print ''; print ''; - print ''; + print ''; print "\n"; } if ($status == 4 && !$bool) { @@ -219,12 +222,14 @@ if (!empty($conf->use_javascript_ajax)) { print ''; } -$listofstatus = array(0, 4, 4, 5); $bool = false; +$listofstatus = array(0, 4, 4, 5); +$bool = false; foreach ($listofstatus as $status) { + $bool_str = (string) $bool; if (empty($conf->use_javascript_ajax)) { print ''; print ''; - print ''; + print ''; if ($status == 4 && !$bool) { $bool = true; } else { diff --git a/htdocs/core/boxes/modules_boxes.php b/htdocs/core/boxes/modules_boxes.php index 9be28e8bfc0..3ada87e0a10 100644 --- a/htdocs/core/boxes/modules_boxes.php +++ b/htdocs/core/boxes/modules_boxes.php @@ -3,6 +3,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2014 Raphaël Doursenaud * Copyright (C) 2015 Frederic 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 @@ -194,7 +195,7 @@ class ModeleBoxes // Can't be abstract as it is instantiated to build "empty" bo * Standard method to show a box (usage by boxes not mandatory, a box can still use its own showBox function) * * @param array $head Array with properties of box title - * @param array $contents Array with properties of box lines + * @param array> $contents Array with properties of box lines * @param int $nooutput No print, only return string * @return string */ diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 32b758792c6..7148f2c4c32 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -7392,7 +7392,7 @@ abstract class CommonObject $isDependList = 1; } $tmpselect .= (!empty($parent) ? ' parent="'.$parent.'"' : ''); - $tmpselect .= '>'.$valb.''; + $tmpselect .= '>'.$langs->trans($valb).''; } $out .= ' '; + if (empty($disabled) && getDolGlobalString('STOCK_ALLOW_NEGATIVE_TRANSFER')) { + print ''; + } } else { print $langs->trans("NA"); } diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index b63a17aa5a3..dc1f44735d7 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -1934,7 +1934,7 @@ class FactureFournisseur extends CommonInvoice // Set new ref and define current statut if (!$error) { - $this->ref = $num; + $this->ref = $this->newref; $this->statut = self::STATUS_VALIDATED; //$this->date_validation=$now; this is stored into log table } diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index f2397aa763c..a809866be18 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -414,10 +414,10 @@ class ProductFournisseur extends Product $fk_multicurrency = MultiCurrency::getIdFromCode($this->db, $multicurrency_code); } - $buyprice = price2num($buyprice, 'MU'); - $charges = price2num($charges, 'MU'); - $qty = price2num($qty, 'MS'); - $unitBuyPrice = price2num($buyprice / $qty, 'MU'); + $buyprice = (float) price2num($buyprice, 'MU'); + $charges = (float) price2num($charges, 'MU'); + $qty = (float) price2num($qty, 'MS'); + $unitBuyPrice = (float) price2num($buyprice / $qty, 'MU'); // We can have a purchase ref that need to buy 100 min for a given price and with a packaging of 50. //$packaging = price2num(((empty($this->packaging) || $this->packaging < $qty) ? $qty : $this->packaging), 'MS'); @@ -446,10 +446,6 @@ class ProductFournisseur extends Product $localtax2 = 0; // If = '' then = 0 } - // Check parameters - if ($buyprice != '' && !is_numeric($buyprice)) { - } - $this->db->begin(); if ($this->product_fourn_price_id > 0) { @@ -478,6 +474,7 @@ class ProductFournisseur extends Product } $sql = "UPDATE ".MAIN_DB_PREFIX."product_fournisseur_price"; $sql .= " SET fk_user = ".((int) $user->id)." ,"; + $sql .= " datec = '".$this->db->idate($now)."' ,"; // Note: Even if this is an update, we update the creation date as the log of each change is tracked into product_fournisseur_log. $sql .= " ref_fourn = '".$this->db->escape($ref_fourn)."',"; $sql .= " desc_fourn = '".$this->db->escape($desc_fourn)."',"; $sql .= " price = ".((float) $buyprice).","; diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index b1f42a5cbd5..064dca1f9cf 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2717,7 +2717,11 @@ if ($action == 'create') { print ''; print ''; } diff --git a/htdocs/fourn/paiement/list.php b/htdocs/fourn/paiement/list.php index 466f7beaedd..79383d68e7f 100644 --- a/htdocs/fourn/paiement/list.php +++ b/htdocs/fourn/paiement/list.php @@ -48,6 +48,7 @@ $action = GETPOST('action', 'alpha'); $massaction = GETPOST('massaction', 'alpha'); $optioncss = GETPOST('optioncss', 'alpha'); $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'vendorpaymentlist'; +$mode = GETPOST('mode', 'aZ'); $socid = GETPOSTINT('socid'); diff --git a/htdocs/takepos/css/pos.css.php b/htdocs/takepos/css/pos.css.php index 0a9ba406ad8..28b73a5a2e0 100644 --- a/htdocs/takepos/css/pos.css.php +++ b/htdocs/takepos/css/pos.css.php @@ -383,7 +383,7 @@ div.paymentbordline margin: 0 auto; width: 100%; height: 55%; - overflow: hidden; + overflow-x: hidden; } .div1{ diff --git a/phpstan.neon b/phpstan.neon.dist similarity index 86% rename from phpstan.neon rename to phpstan.neon.dist index 8951e8ddaa2..78867274e30 100644 --- a/phpstan.neon +++ b/phpstan.neon.dist @@ -1,11 +1,13 @@ parameters: tmpDir: ./.github/tmp parallel: - jobSize: 8 + # Commented some of the settings, reminding the defaults: + # should adapt better to target machines + # jobSize: 8 # default is 20 processTimeout: 600.0 - maximumNumberOfProcesses: 20 - minimumNumberOfJobsPerProcess: 2 - buffer: 134217728 # 128 MB + # maximumNumberOfProcesses: 20 # default is 32 + # minimumNumberOfJobsPerProcess: 2 # default is 2 + # buffer: 134217728 # 128 MB # Not documented customRulesetUsed: true level: 2 fileExtensions: @@ -13,13 +15,6 @@ parameters: paths: - htdocs - scripts - stubFiles: - # - dev/tools/phan/stubs/GeoIP2.php - # - dev/tools/phan/stubs/geoip_inc.php - - dev/tools/phan/stubs/module_numberwords.php - - dev/tools/phan/stubs/restler.php - - dev/tools/phan/stubs/stripe.php - - dev/tools/phan/stubs/swiss-qr-bill.php excludePaths: analyseAndScan: - htdocs/custom/*
'.$langs->trans("Statistics").' - '.$langs->trans("Services").'
'.$staticcontratligne->LibStatut($status, 0, ($bool ? 1 : 0)).''.($nb[$status.$bool] ? $nb[$status.$bool] : 0).' '.$staticcontratligne->LibStatut($status, 3, ($bool ? 1 : 0)).''.($nb[$status.$bool_str] ? $nb[$status.$bool_str] : 0).' '.$staticcontratligne->LibStatut($status, 3, ($bool ? 1 : 0)).'
'.$staticcontratligne->LibStatut($status, 0, ($bool ? 1 : 0)).''.($nb[$status.$bool] ? $nb[$status.$bool] : 0).' '.$staticcontratligne->LibStatut($status, 3, ($bool ? 1 : 0)).''.($nb[$status.$bool_str] ? $nb[$status.$bool_str] : 0).' '.$staticcontratligne->LibStatut($status, 3, ($bool ? 1 : 0)).''.$form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0).''; print img_picto('', 'currency', 'class="pictofixedwidth"'); - print $form->selectMultiCurrency((GETPOSTISSET('multicurrency_code') ? GETPOST('multicurrency_code', 'alpha') : $currency_code), 'multicurrency_code'); + $used_currency_code = $currency_code; + if (!GETPOST('changecompany')) { + $used_currency_code = GETPOSTISSET('multicurrency_code') ? GETPOST('multicurrency_code', 'alpha') : $currency_code; + } + print $form->selectMultiCurrency($used_currency_code, 'multicurrency_code'); print '