From 23b6910c1aa5490cdd36ba6e16b62b6ff10f4d71 Mon Sep 17 00:00:00 2001 From: Henning <leutz@pcsg.de> Date: Sat, 22 Feb 2025 12:04:07 +0100 Subject: [PATCH] refactor: ignore phpstan warnings in calc.php Updated calcArticleList method in Calc.php to ignore PHPStan warnings using the `@phpstan-ignore-line` and `@phpstan-ignore-next-line` directives. Also, added a TODO comment regarding net calculations. --- src/QUI/ERP/Accounting/Calc.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/QUI/ERP/Accounting/Calc.php b/src/QUI/ERP/Accounting/Calc.php index 81831cc..4a3dc60 100644 --- a/src/QUI/ERP/Accounting/Calc.php +++ b/src/QUI/ERP/Accounting/Calc.php @@ -414,11 +414,11 @@ public function calcArticleList(ArticleList $List, callable | bool $callback = f } // delete 0 % vat, 0% vat is allowed to calculate more easily - if (isset($vatText[0])) { + if (isset($vatText[0])) { // @phpstan-ignore-line unset($vatText[0]); } - if (isset($vatArray[0])) { + if (isset($vatArray[0])) { // @phpstan-ignore-line unset($vatArray[0]); } @@ -475,6 +475,9 @@ public function calcArticleList(ArticleList $List, callable | bool $callback = f // counterbalance - gegenrechnung // works only for one vat entry + + // @todo: check -> wegen is netto, müsste eigentlich nach dem if + // @phpstan-ignore-next-line if (count($vatArray) === 1 && $isNetto) { $vat = key($vatArray); $netto = $bruttoSum / ((float)$vat / 100 + 1); -- GitLab