From 98ba156c25b807bef7787db9a910ae655774824c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 9 Dec 2024 16:07:03 +0100 Subject: [PATCH 1/5] fix phpstan --- build/phpstan/phpstan-baseline.neon | 6 ------ htdocs/comm/recap-client.php | 5 +++-- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/build/phpstan/phpstan-baseline.neon b/build/phpstan/phpstan-baseline.neon index 0863ab2d843..b5270503279 100644 --- a/build/phpstan/phpstan-baseline.neon +++ b/build/phpstan/phpstan-baseline.neon @@ -4638,12 +4638,6 @@ parameters: count: 1 path: ../../htdocs/comm/propal/tpl/linkedobjectblock.tpl.php - - - message: '#^Variable \$id might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/comm/recap-client.php - - message: '#^If condition is always false\.$#' identifier: if.alwaysFalse diff --git a/htdocs/comm/recap-client.php b/htdocs/comm/recap-client.php index 550baca1931..f50a69286ed 100644 --- a/htdocs/comm/recap-client.php +++ b/htdocs/comm/recap-client.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2010 Laurent Destailleur +/* Copyright (C) 2001-2004 Rodolphe Quiedeville + * Copyright (C) 2004-2010 Laurent Destailleur * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -44,6 +44,7 @@ if (isModEnabled('invoice')) { // Security check $socid = GETPOSTINT("socid"); +$id = 0; if ($user->socid > 0) { $action = ''; $id = $user->socid; From 6295abe93796b158abe56b44ee51bd9af54ce98a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 9 Dec 2024 16:07:42 +0100 Subject: [PATCH 2/5] fix phpstan --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 30ccca5b0e9..dc0bfbdf63c 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -20,7 +20,7 @@ jobs: steps: - name: Log run: | - echo "Run action by ${{ github.actor }}" + echo "Run action by ${{ github.actor }}" echo "github.token=${{ github.token }}" echo "secrets.GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}" echo "GITHUB_EVENT_PATH=$GITHUB_EVENT_PATH" From b10dc8e141637c1f5613bda7555b23da279ef274 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 9 Dec 2024 16:34:26 +0100 Subject: [PATCH 3/5] fix --- htdocs/multicurrency/class/multicurrency.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/multicurrency/class/multicurrency.class.php b/htdocs/multicurrency/class/multicurrency.class.php index e749b7c0647..8f4af567800 100644 --- a/htdocs/multicurrency/class/multicurrency.class.php +++ b/htdocs/multicurrency/class/multicurrency.class.php @@ -592,7 +592,7 @@ class MultiCurrency extends CommonObject * * @param int $fk_facture id of facture * @param string $table facture or facture_fourn - * @return array|bool Rate and code of currency or false if error + * @return array{invoice_multicurrency_tx: float,invoice_multicurrency_code: string}|bool Rate and code of currency or false if error */ public static function getInvoiceRate($fk_facture, $table = 'facture') { From 34f2546120098f2b42b89327f6fd44aec0f7ade1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 9 Dec 2024 16:43:50 +0100 Subject: [PATCH 4/5] fix --- htdocs/compta/paiement/class/paiement.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php index 8aafb996656..cbe1c9b4111 100644 --- a/htdocs/compta/paiement/class/paiement.class.php +++ b/htdocs/compta/paiement/class/paiement.class.php @@ -334,7 +334,7 @@ class Paiement extends CommonObject if (empty($value)) { continue; } - + $value_converted = false; $tmparray = MultiCurrency::getInvoiceRate($key, 'facture'); $invoice_multicurrency_tx = $tmparray['invoice_multicurrency_tx']; $invoice_multicurrency_code = $tmparray['invoice_multicurrency_code']; From 5d88c2251e580600563a1033614c78a55a6ae349 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 9 Dec 2024 21:29:15 +0100 Subject: [PATCH 5/5] Debug v21 --- htdocs/core/tpl/objectline_create.tpl.php | 4 ++-- htdocs/fourn/facture/card.php | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index 8b58ba7879b..be49279b2ef 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -206,7 +206,7 @@ if ($nolinesbefore) { // Free line $labelforempty = 1; - print ''; + print ''; // Show radio for the non predefined product if ($forceall >= 0 && (isModEnabled("product") || isModEnabled("service"))) { print ''; } // Predefined product/service diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 1a4ec0045d0..d306837e053 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -3595,7 +3595,7 @@ if ($action == 'create') { print ''; - // List of payments + // List of payments already done $totalpaid = 0; @@ -3649,8 +3649,8 @@ if ($action == 'create') { print ''; print ''; print ''; - print ''; - print ''; + print ''; + print ''; if (isModEnabled("bank")) { print ''; }
'.($object->type == FactureFournisseur::TYPE_CREDIT_NOTE ? $langs->trans("PaymentsBack") : $langs->trans('Payments')).''.$langs->trans('Date').''.$langs->trans('Type').''.$langs->trans('Date').''.$langs->trans('Type').''.$langs->trans('BankAccount').'