From 4fbeb22983d5ed4905695425e279189dbcf4f744 Mon Sep 17 00:00:00 2001 From: Henning <leutz@pcsg.de> Date: Mon, 10 Feb 2025 14:33:55 +0100 Subject: [PATCH 1/7] fix(phpstan): added exception handling for missing html2pdf module in OutputTemplate In OutputTemplate.php, a check has been added to ensure the existence of the 'QUI\\HtmlToPdf\\Document' class before using it. If the class does not exist, an error message is logged, and an exception is thrown indicating that the html2pdf module is missing. This fix is aimed at avoiding potential errors that may occur due to the absence of the required module. --- src/QUI/ERP/Output/OutputTemplate.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/QUI/ERP/Output/OutputTemplate.php b/src/QUI/ERP/Output/OutputTemplate.php index 8e7fc31..2d9e5d0 100644 --- a/src/QUI/ERP/Output/OutputTemplate.php +++ b/src/QUI/ERP/Output/OutputTemplate.php @@ -168,6 +168,14 @@ public function getHTML(bool $preview = false): string */ public function getPDFDocument(): QUI\HtmlToPdf\Document { + if (!class_exists('QUI\HtmlToPdf\Document')) { + QUI\System\Log::addError('Missing html2pdf module. Please install the html2pdf module.'); + + throw new QUI\Exception( + 'An error has occurred. Please try again or contact support if the issue persists.' + ); + } + $Locale = $this->OutputProvider::getLocale($this->entityId); QUI::getLocale()->setTemporaryCurrent($Locale->getCurrent()); -- GitLab From 1d048c816876dc09bf0c98cd7274281879a4e1d6 Mon Sep 17 00:00:00 2001 From: Henning <leutz@pcsg.de> Date: Wed, 19 Feb 2025 11:12:51 +0100 Subject: [PATCH 2/7] fix: update payment status constants in calc.php Changed the constants 'TYPE_INVOICE_REVERSAL' and 'TYPE_INVOICE_CANCEL' to 'PAYMENT_STATUS_ERROR' and 'PAYMENT_STATUS_CANCELED' respectively. This will ensure that the payment status are correctly identified and processed. --- src/QUI/ERP/Accounting/Calc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/QUI/ERP/Accounting/Calc.php b/src/QUI/ERP/Accounting/Calc.php index 8a3f3ea..ddf4349 100644 --- a/src/QUI/ERP/Accounting/Calc.php +++ b/src/QUI/ERP/Accounting/Calc.php @@ -1015,8 +1015,8 @@ public static function calculatePayments($ToCalculate): array ) { // Leave everything as it is because a subscription plan order can never be set to "paid" } elseif ( - $ToCalculate->getAttribute('paid_status') === QUI\ERP\Constants::TYPE_INVOICE_REVERSAL - || $ToCalculate->getAttribute('paid_status') === QUI\ERP\Constants::TYPE_INVOICE_CANCEL + $ToCalculate->getAttribute('paid_status') === QUI\ERP\Constants::PAYMENT_STATUS_ERROR + || $ToCalculate->getAttribute('paid_status') === QUI\ERP\Constants::PAYMENT_STATUS_CANCELED || $ToCalculate->getAttribute('paid_status') === QUI\ERP\Constants::PAYMENT_STATUS_DEBIT ) { // Leave everything as it is -- GitLab From dba1b6d60cc959b0b7332ce5e1e03ae7673b1bf7 Mon Sep 17 00:00:00 2001 From: Henning <leutz@pcsg.de> Date: Sat, 22 Feb 2025 11:26:52 +0100 Subject: [PATCH 3/7] fix(phpstan): php8.4 null deprecated Related: quiqqer/erp#103 --- .phive/phars.xml | 2 +- phpstan-baseline.neon | 351 ------------------ src/QUI/ERP/Accounting/Article.php | 28 +- src/QUI/ERP/Accounting/ArticleListUnique.php | 18 +- src/QUI/ERP/Accounting/Calc.php | 23 +- src/QUI/ERP/Accounting/CalculationValue.php | 15 +- .../ERP/Accounting/CalculationVatValue.php | 8 +- src/QUI/ERP/Address.php | 2 +- src/QUI/ERP/Api/NumberRangeInterface.php | 2 +- src/QUI/ERP/Dashboard/ErpDashboard.php | 2 +- src/QUI/ERP/Defaults.php | 8 +- src/QUI/ERP/ErpCopyInterface.php | 4 +- src/QUI/ERP/ErpEntityInterface.php | 6 +- src/QUI/ERP/Money/Price.php | 14 +- src/QUI/ERP/Output/Output.php | 40 +- .../ERP/Output/OutputProviderInterface.php | 18 +- src/QUI/ERP/Output/OutputTemplate.php | 18 +- .../OutputTemplateProviderInterface.php | 17 +- src/QUI/ERP/User.php | 31 +- src/QUI/ERP/Utils/Sites.php | 6 +- src/QUI/ERP/Utils/User.php | 4 +- 21 files changed, 139 insertions(+), 478 deletions(-) diff --git a/.phive/phars.xml b/.phive/phars.xml index 5bfa092..cccdab5 100644 --- a/.phive/phars.xml +++ b/.phive/phars.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <phive xmlns="https://phar.io/phive"> - <phar name="phpstan" version="1.11.8" installed="1.11.8" location="./tools/phpstan" copy="false"/> + <phar name="phpstan" version="1.*" installed="1.12.13" location="./tools/phpstan" copy="false"/> <phar name="phpunit" version="^10.5.20" installed="10.5.20" location="./tools/phpunit" copy="false"/> <phar name="phpcs" version="^3.10.1" installed="3.10.1" location="./tools/phpcs" copy="false"/> <phar name="phpcbf" version="^3.10.1" installed="3.10.1" location="./tools/phpcbf" copy="false"/> diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 03a5e5e..e69de29 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -1,351 +0,0 @@ -parameters: - ignoreErrors: - - - message: "#^Else branch is unreachable because previous condition is always true\\.$#" - count: 1 - path: ajax/calcBruttoPrice.php - - - - message: "#^Elseif branch is unreachable because previous condition is always true\\.$#" - count: 1 - path: ajax/calcBruttoPrice.php - - - - message: "#^Instanceof between \\*NEVER\\* and QUI\\\\ERP\\\\Tax\\\\TaxEntry will always evaluate to false\\.$#" - count: 1 - path: ajax/calcBruttoPrice.php - - - - message: "#^Binary operation \"\\*\" between string and \\(float\\|int\\) results in an error\\.$#" - count: 1 - path: ajax/calcNettoPrice.php - - - - message: "#^Else branch is unreachable because previous condition is always true\\.$#" - count: 1 - path: ajax/calcNettoPrice.php - - - - message: "#^Elseif branch is unreachable because previous condition is always true\\.$#" - count: 1 - path: ajax/calcNettoPrice.php - - - - message: "#^Instanceof between \\*NEVER\\* and QUI\\\\ERP\\\\Tax\\\\TaxEntry will always evaluate to false\\.$#" - count: 1 - path: ajax/calcNettoPrice.php - - - - message: "#^Parameter \\#1 \\$string of function substr expects string, float given\\.$#" - count: 1 - path: ajax/calcNettoPrice.php - - - - message: "#^Parameter \\#2 \\$string of function explode expects string, float given\\.$#" - count: 1 - path: ajax/calcNettoPrice.php - - - - message: "#^Method QUI\\\\ERP\\\\ErpEntityInterface\\:\\:getCustomerFiles\\(\\) invoked with 1 parameter, 0 required\\.$#" - count: 1 - path: ajax/customerFiles/getFiles.php - - - - message: "#^Parameter \\#9 \\$attachedMediaFiles of static method QUI\\\\ERP\\\\Output\\\\Output\\:\\:sendPdfViaMail\\(\\) expects array\\<QUI\\\\Projects\\\\Media\\\\File\\|QUI\\\\Projects\\\\Media\\\\Image\\>, array\\<int\\<0, max\\>, QUI\\\\Interfaces\\\\Projects\\\\Media\\\\File\\> given\\.$#" - count: 1 - path: ajax/output/sendMail.php - - - - message: "#^Method QUI\\\\ERP\\\\Accounting\\\\ArticleList\\:\\:getOrder\\(\\) has invalid return type QUI\\\\ERP\\\\Order\\\\AbstractOrder\\.$#" - count: 2 - path: src/QUI/ERP/Accounting/ArticleList.php - - - - message: "#^Parameter \\$Order of method QUI\\\\ERP\\\\Accounting\\\\ArticleList\\:\\:setOrder\\(\\) has invalid type QUI\\\\ERP\\\\Order\\\\AbstractOrder\\.$#" - count: 2 - path: src/QUI/ERP/Accounting/ArticleList.php - - - - message: "#^Property QUI\\\\ERP\\\\Accounting\\\\ArticleList\\:\\:\\$Order has unknown class QUI\\\\ERP\\\\Order\\\\AbstractOrder as its type\\.$#" - count: 2 - path: src/QUI/ERP/Accounting/ArticleList.php - - - - message: "#^Call to method getAttribute\\(\\) on an unknown class QUI\\\\ERP\\\\Order\\\\AbstractOrder\\.$#" - count: 1 - path: src/QUI/ERP/Accounting/Calc.php - - - - message: "#^Call to method getDeliveryAddress\\(\\) on an unknown class QUI\\\\ERP\\\\Order\\\\AbstractOrder\\.$#" - count: 1 - path: src/QUI/ERP/Accounting/Calc.php - - - - message: "#^Call to static method getInstance\\(\\) on an unknown class QUI\\\\ERP\\\\Accounting\\\\Invoice\\\\Handler\\.$#" - count: 1 - path: src/QUI/ERP/Accounting/Calc.php - - - - message: "#^Call to static method getInstance\\(\\) on an unknown class QUI\\\\ERP\\\\Accounting\\\\Payments\\\\Transactions\\\\Handler\\.$#" - count: 1 - path: src/QUI/ERP/Accounting/Calc.php - - - - message: "#^Class QUI\\\\ERP\\\\Order\\\\AbstractOrder not found\\.$#" - count: 1 - path: src/QUI/ERP/Accounting/Calc.php - - - - message: "#^Offset 0 on array\\<string, mixed\\> in isset\\(\\) does not exist\\.$#" - count: 1 - path: src/QUI/ERP/Accounting/Calc.php - - - - message: "#^Offset 0 on array\\<string, string\\> in isset\\(\\) does not exist\\.$#" - count: 1 - path: src/QUI/ERP/Accounting/Calc.php - - - - message: "#^Parameter \\$Invoice of method QUI\\\\ERP\\\\Accounting\\\\Calc\\:\\:calculateInvoicePayments\\(\\) has invalid type QUI\\\\ERP\\\\Accounting\\\\Invoice\\\\Invoice\\.$#" - count: 2 - path: src/QUI/ERP/Accounting/Calc.php - - - - message: "#^Parameter \\$Transaction of method QUI\\\\ERP\\\\ErpTransactionsInterface\\:\\:addTransaction\\(\\) has invalid type QUI\\\\ERP\\\\Accounting\\\\Payments\\\\Transactions\\\\Transaction\\.$#" - count: 1 - path: src/QUI/ERP/ErpTransactionsInterface.php - - - - message: "#^Parameter \\$Transaction of method QUI\\\\ERP\\\\ErpTransactionsInterface\\:\\:linkTransaction\\(\\) has invalid type QUI\\\\ERP\\\\Accounting\\\\Payments\\\\Transactions\\\\Transaction\\.$#" - count: 1 - path: src/QUI/ERP/ErpTransactionsInterface.php - - - - message: "#^Parameter \\#1 \\$code of method QUI\\\\Interfaces\\\\Users\\\\User\\:\\:activate\\(\\) expects string, false given\\.$#" - count: 1 - path: src/QUI/ERP/Manufacturers.php - - - - message: "#^Strict comparison using \\=\\=\\= between mixed and '' will always evaluate to false\\.$#" - count: 2 - path: src/QUI/ERP/Manufacturers.php - - - - message: "#^Call to method createPDF\\(\\) on an unknown class QUI\\\\HtmlToPdf\\\\Document\\.$#" - count: 1 - path: src/QUI/ERP/Output/Output.php - - - - message: "#^Method QUI\\\\ERP\\\\Output\\\\Output\\:\\:getDocumentPdf\\(\\) has invalid return type QUI\\\\HtmlToPdf\\\\Document\\.$#" - count: 2 - path: src/QUI/ERP/Output/Output.php - - - - message: "#^Call to method setContentHTML\\(\\) on an unknown class QUI\\\\HtmlToPdf\\\\Document\\.$#" - count: 1 - path: src/QUI/ERP/Output/OutputTemplate.php - - - - message: "#^Call to method setFooterHTML\\(\\) on an unknown class QUI\\\\HtmlToPdf\\\\Document\\.$#" - count: 1 - path: src/QUI/ERP/Output/OutputTemplate.php - - - - message: "#^Call to method setHeaderHTML\\(\\) on an unknown class QUI\\\\HtmlToPdf\\\\Document\\.$#" - count: 1 - path: src/QUI/ERP/Output/OutputTemplate.php - - - - message: "#^Instantiated class QUI\\\\HtmlToPdf\\\\Document not found\\.$#" - count: 1 - path: src/QUI/ERP/Output/OutputTemplate.php - - - - message: "#^Method QUI\\\\ERP\\\\Output\\\\OutputTemplate\\:\\:getPDFDocument\\(\\) has invalid return type QUI\\\\HtmlToPdf\\\\Document\\.$#" - count: 2 - path: src/QUI/ERP/Output/OutputTemplate.php - - - - message: "#^Call to method getAmountFormatted\\(\\) on an unknown class QUI\\\\ERP\\\\Accounting\\\\Payments\\\\Transactions\\\\Transaction\\.$#" - count: 1 - path: src/QUI/ERP/Process.php - - - - message: "#^Call to method getAttribute\\(\\) on an unknown class QUI\\\\ERP\\\\Accounting\\\\Invoice\\\\Invoice\\.$#" - count: 1 - path: src/QUI/ERP/Process.php - - - - message: "#^Call to method getAttribute\\(\\) on an unknown class QUI\\\\ERP\\\\Accounting\\\\Invoice\\\\InvoiceTemporary\\.$#" - count: 1 - path: src/QUI/ERP/Process.php - - - - message: "#^Call to method getAttribute\\(\\) on an unknown class QUI\\\\ERP\\\\Accounting\\\\Offers\\\\Offer\\.$#" - count: 1 - path: src/QUI/ERP/Process.php - - - - message: "#^Call to method getDate\\(\\) on an unknown class QUI\\\\ERP\\\\Accounting\\\\Payments\\\\Transactions\\\\Transaction\\.$#" - count: 1 - path: src/QUI/ERP/Process.php - - - - message: "#^Call to method getHash\\(\\) on an unknown class QUI\\\\ERP\\\\Accounting\\\\Offers\\\\Offer\\.$#" - count: 3 - path: src/QUI/ERP/Process.php - - - - message: "#^Call to method getHash\\(\\) on an unknown class QUI\\\\ERP\\\\Accounting\\\\Payments\\\\Transactions\\\\Transaction\\.$#" - count: 2 - path: src/QUI/ERP/Process.php - - - - message: "#^Call to method getHistory\\(\\) on an unknown class QUI\\\\ERP\\\\Accounting\\\\Invoice\\\\Invoice\\.$#" - count: 1 - path: src/QUI/ERP/Process.php - - - - message: "#^Call to method getHistory\\(\\) on an unknown class QUI\\\\ERP\\\\Accounting\\\\Invoice\\\\InvoiceTemporary\\.$#" - count: 1 - path: src/QUI/ERP/Process.php - - - - message: "#^Call to method getHistory\\(\\) on an unknown class QUI\\\\ERP\\\\Accounting\\\\Offers\\\\Offer\\.$#" - count: 1 - path: src/QUI/ERP/Process.php - - - - message: "#^Call to method getPrefixedNumber\\(\\) on an unknown class QUI\\\\ERP\\\\Accounting\\\\Invoice\\\\Invoice\\.$#" - count: 1 - path: src/QUI/ERP/Process.php - - - - message: "#^Call to method getPrefixedNumber\\(\\) on an unknown class QUI\\\\ERP\\\\Accounting\\\\Invoice\\\\InvoiceTemporary\\.$#" - count: 1 - path: src/QUI/ERP/Process.php - - - - message: "#^Call to method getUUID\\(\\) on an unknown class QUI\\\\ERP\\\\Accounting\\\\Invoice\\\\Invoice\\.$#" - count: 2 - path: src/QUI/ERP/Process.php - - - - message: "#^Call to method getUUID\\(\\) on an unknown class QUI\\\\ERP\\\\Accounting\\\\Invoice\\\\InvoiceTemporary\\.$#" - count: 2 - path: src/QUI/ERP/Process.php - - - - message: "#^Call to static method getInstance\\(\\) on an unknown class QUI\\\\ERP\\\\Accounting\\\\Invoice\\\\Handler\\.$#" - count: 1 - path: src/QUI/ERP/Process.php - - - - message: "#^Call to static method getInstance\\(\\) on an unknown class QUI\\\\ERP\\\\Accounting\\\\Offers\\\\Handler\\.$#" - count: 3 - path: src/QUI/ERP/Process.php - - - - message: "#^Call to static method getInstance\\(\\) on an unknown class QUI\\\\ERP\\\\Accounting\\\\Payments\\\\Transactions\\\\Handler\\.$#" - count: 1 - path: src/QUI/ERP/Process.php - - - - message: "#^Call to static method getInstance\\(\\) on an unknown class QUI\\\\ERP\\\\Order\\\\Handler\\.$#" - count: 2 - path: src/QUI/ERP/Process.php - - - - message: "#^Call to static method getSalesOrder\\(\\) on an unknown class QUI\\\\ERP\\\\SalesOrders\\\\Handler\\.$#" - count: 2 - path: src/QUI/ERP/Process.php - - - - message: "#^Call to static method getTableSalesOrders\\(\\) on an unknown class QUI\\\\ERP\\\\SalesOrders\\\\Handler\\.$#" - count: 1 - path: src/QUI/ERP/Process.php - - - - message: "#^Class QUI\\\\ERP\\\\Accounting\\\\Invoice\\\\Invoice not found\\.$#" - count: 1 - path: src/QUI/ERP/Process.php - - - - message: "#^Class QUI\\\\ERP\\\\Accounting\\\\Invoice\\\\InvoiceTemporary not found\\.$#" - count: 1 - path: src/QUI/ERP/Process.php - - - - message: "#^Method QUI\\\\ERP\\\\Process\\:\\:getInvoices\\(\\) has invalid return type QUI\\\\ERP\\\\Accounting\\\\Invoice\\\\Invoice\\.$#" - count: 1 - path: src/QUI/ERP/Process.php - - - - message: "#^Method QUI\\\\ERP\\\\Process\\:\\:getInvoices\\(\\) has invalid return type QUI\\\\ERP\\\\Accounting\\\\Invoice\\\\InvoiceTemporary\\.$#" - count: 1 - path: src/QUI/ERP/Process.php - - - - message: "#^Method QUI\\\\ERP\\\\Process\\:\\:getOffers\\(\\) has invalid return type QUI\\\\ERP\\\\Accounting\\\\Offers\\\\Offer\\.$#" - count: 1 - path: src/QUI/ERP/Process.php - - - - message: "#^Method QUI\\\\ERP\\\\Process\\:\\:getOrder\\(\\) has invalid return type QUI\\\\ERP\\\\Order\\\\Order\\.$#" - count: 2 - path: src/QUI/ERP/Process.php - - - - message: "#^Method QUI\\\\ERP\\\\Process\\:\\:getOrder\\(\\) has invalid return type QUI\\\\ERP\\\\Order\\\\OrderInProcess\\.$#" - count: 2 - path: src/QUI/ERP/Process.php - - - - message: "#^Method QUI\\\\ERP\\\\Process\\:\\:getTransactions\\(\\) has invalid return type QUI\\\\ERP\\\\Accounting\\\\Payments\\\\Transactions\\\\Transaction\\.$#" - count: 1 - path: src/QUI/ERP/Process.php - - - - message: "#^Call to static method getInstance\\(\\) on an unknown class QUI\\\\ERP\\\\Accounting\\\\Invoice\\\\Handler\\.$#" - count: 1 - path: src/QUI/ERP/Processes.php - - - - message: "#^Call to static method getInstance\\(\\) on an unknown class QUI\\\\ERP\\\\Accounting\\\\Offers\\\\Handler\\.$#" - count: 1 - path: src/QUI/ERP/Processes.php - - - - message: "#^Call to static method getInstance\\(\\) on an unknown class QUI\\\\ERP\\\\Order\\\\Handler\\.$#" - count: 1 - path: src/QUI/ERP/Processes.php - - - - message: "#^Call to static method getTableSalesOrders\\(\\) on an unknown class QUI\\\\ERP\\\\SalesOrders\\\\Handler\\.$#" - count: 1 - path: src/QUI/ERP/Processes.php - - - - message: "#^Call to static method table\\(\\) on an unknown class QUI\\\\ERP\\\\Accounting\\\\Payments\\\\Transactions\\\\Factory\\.$#" - count: 1 - path: src/QUI/ERP/Processes.php - - - - message: "#^Dead catch \\- Exception is never thrown in the try block\\.$#" - count: 2 - path: src/QUI/ERP/Processes.php - - - - message: "#^Call to static method getInstance\\(\\) on an unknown class QUI\\\\ERP\\\\Accounting\\\\Payments\\\\Transactions\\\\Handler\\.$#" - count: 1 - path: src/QUI/ERP/Utils/Process.php - - - - message: "#^Call to static method getInstance\\(\\) on an unknown class QUI\\\\ERP\\\\Order\\\\Handler\\.$#" - count: 1 - path: src/QUI/ERP/Utils/Process.php - - - - message: "#^Call to static method getInvoiceByString\\(\\) on an unknown class QUI\\\\ERP\\\\Accounting\\\\Invoice\\\\Utils\\\\Invoice\\.$#" - count: 1 - path: src/QUI/ERP/Utils/Process.php diff --git a/src/QUI/ERP/Accounting/Article.php b/src/QUI/ERP/Accounting/Article.php index 457140c..6410d40 100644 --- a/src/QUI/ERP/Accounting/Article.php +++ b/src/QUI/ERP/Accounting/Article.php @@ -63,35 +63,35 @@ class Article implements ArticleInterface /** * @var float|int */ - protected float|int $price; + protected float | int $price; /** * @var float|int */ - protected float|int $basisPrice; + protected float | int $basisPrice; /** * @var float|int|null */ - protected float|int|null $nettoPriceNotRounded = null; + protected float | int | null $nettoPriceNotRounded = null; /** * @var float|int */ - protected float|int $sum; + protected float | int $sum; /** * The calculated netto sum with quantity and discount * @var float|int */ - protected float|int $nettoSum = 0; + protected float | int $nettoSum = 0; /** * Sum from the article, without discount and with quantity * * @var float|int */ - protected float|int $nettoSubSum = 0; + protected float | int $nettoSubSum = 0; /** * The article netto price, without discount, without quantity @@ -99,7 +99,7 @@ class Article implements ArticleInterface * * @var float|int */ - protected float|int $nettoPrice = 0; + protected float | int $nettoPrice = 0; /** * The article netto price, without discount, without quantity @@ -107,7 +107,7 @@ class Article implements ArticleInterface * * @var float|int */ - protected float|int $nettoBasisPrice = 0; + protected float | int $nettoBasisPrice = 0; /** * @var array @@ -285,7 +285,7 @@ public function getProductSetParentUuid(): ?string * * @return int|string */ - public function getArticleNo(): int|string + public function getArticleNo(): int | string { if (isset($this->attributes['articleNo'])) { return $this->attributes['articleNo']; @@ -439,7 +439,7 @@ public function getSum(): Price * * @return float|int */ - public function getVat(): float|int + public function getVat(): float | int { if (isset($this->attributes['vat']) && $this->attributes['vat'] !== '') { return (float)$this->attributes['vat']; @@ -532,7 +532,7 @@ public function setCurrency(QUI\ERP\Currency\Currency $Currency): void * * @return float|int|bool */ - public function getQuantity(): float|int|bool + public function getQuantity(): float | int | bool { if (isset($this->attributes['quantity'])) { return $this->attributes['quantity']; @@ -547,7 +547,7 @@ public function getQuantity(): float|int|bool * @param null|QUI\Locale $Locale * @return string */ - public function getQuantityUnit(QUI\Locale $Locale = null): string + public function getQuantityUnit(null | QUI\Locale $Locale = null): string { if ($Locale === null) { $Locale = QUI::getLocale(); @@ -607,7 +607,7 @@ public function displayPrice(): bool * * @todo überdenken, ganzer artikel ist eigentlich nicht änderbar */ - public function setDiscount(float|int $discount, int $discountType = Calc::CALCULATION_COMPLEMENT): void + public function setDiscount(float | int $discount, int $discountType = Calc::CALCULATION_COMPLEMENT): void { switch ($discountType) { case Calc::CALCULATION_PERCENTAGE: @@ -649,7 +649,7 @@ public function hasDiscount(): bool * @param null|Calc|QUI\ERP\User $Instance * @return self */ - public function calc(Calc|QUI\ERP\User $Instance = null): Article + public function calc(null | Calc | QUI\ERP\User $Instance = null): Article { if ($this->calculated) { return $this; diff --git a/src/QUI/ERP/Accounting/ArticleListUnique.php b/src/QUI/ERP/Accounting/ArticleListUnique.php index 853c445..d72f449 100644 --- a/src/QUI/ERP/Accounting/ArticleListUnique.php +++ b/src/QUI/ERP/Accounting/ArticleListUnique.php @@ -86,7 +86,7 @@ class ArticleListUnique implements IteratorAggregate * @param ?QUI\Interfaces\Users\User $User * @throws QUI\ERP\Exception|QUI\Exception */ - public function __construct(array $attributes = [], QUI\Interfaces\Users\User $User = null) + public function __construct(array $attributes = [], null | QUI\Interfaces\Users\User $User = null) { $this->Locale = QUI::getLocale(); @@ -271,7 +271,7 @@ public function setLocale(QUI\Locale $Locale): void * * @throws QUI\Exception */ - public static function unserialize(array|string $data): ArticleListUnique + public static function unserialize(array | string $data): ArticleListUnique { if (is_string($data)) { $data = json_decode($data, true); @@ -391,8 +391,8 @@ public function setExchangeRate(float $rate): void * @throws Exception */ public function toHTML( - bool|string $template = false, - bool|string $articleTemplate = false, + bool | string $template = false, + bool | string $articleTemplate = false, ?QUI\Interfaces\Template\EngineInterface $Engine = null ): string { if ($Engine === null) { @@ -556,8 +556,8 @@ public function toMailHTML(): string * @throws Exception */ public function toHTMLWithCSS( - bool|string $template = false, - bool|string $articleTemplate = false, + bool | string $template = false, + bool | string $articleTemplate = false, ?QUI\Interfaces\Template\EngineInterface $Engine = null ): string { $style = '<style>'; @@ -577,8 +577,8 @@ public function toHTMLWithCSS( * @throws Exception */ public function render( - bool|string $template = false, - bool|string $articleTemplate = false + bool | string $template = false, + bool | string $articleTemplate = false ): string { return $this->toHTMLWithCSS($template, $articleTemplate); } @@ -620,7 +620,7 @@ public function getPriceFactors(): ErpFactorList * * @return ArrayIterator|Traversable */ - public function getIterator(): Traversable|ArrayIterator + public function getIterator(): Traversable | ArrayIterator { return new ArrayIterator($this->articles); } diff --git a/src/QUI/ERP/Accounting/Calc.php b/src/QUI/ERP/Accounting/Calc.php index ddf4349..81831cc 100644 --- a/src/QUI/ERP/Accounting/Calc.php +++ b/src/QUI/ERP/Accounting/Calc.php @@ -126,7 +126,7 @@ public function __construct(?UserInterface $User = null) * @param UserInterface|null $User - optional * @return Calc */ - public static function getInstance(UserInterface $User = null): Calc + public static function getInstance(null | UserInterface $User = null): Calc { if (!$User && QUI::isBackend()) { $User = QUI::getUsers()->getSystemUser(); @@ -200,7 +200,7 @@ public function getCurrency(): ?QUI\ERP\Currency\Currency * @param callable|boolean $callback - optional, callback function for the data array * @return ArticleList */ - public function calcArticleList(ArticleList $List, callable|bool $callback = false): ArticleList + public function calcArticleList(ArticleList $List, callable | bool $callback = false): ArticleList { // calc data if (!is_callable($callback)) { @@ -687,25 +687,28 @@ public function calcArticlePrice(Article $Article, $callback = false) * @param string|int|float $value * @return float */ - public function round($value): float + public function round(string | int | float $value): float { $decimalSeparator = $this->getUser()->getLocale()->getDecimalSeparator(); $groupingSeparator = $this->getUser()->getLocale()->getGroupingSeparator(); $precision = QUI\ERP\Defaults::getPrecision(); + if (is_int($value) || is_float($value)) { + return round($value, $precision); + } + if (strpos($value, $decimalSeparator) && $decimalSeparator != '.') { $value = str_replace($groupingSeparator, '', $value); } $value = str_replace(',', '.', $value); $value = floatval($value); - $value = round($value, $precision); - return $value; + return round($value, $precision); } /** - * Return the tax message for an user + * Return the tax message for a user * * @return string */ @@ -731,9 +734,9 @@ public function getVatTextByUser(): string * @return string */ public static function getVatText( - float|int $vat, + float | int $vat, UserInterface $User, - QUI\Locale $Locale = null + null | QUI\Locale $Locale = null ): string { if ($Locale === null) { $Locale = QUI::getLocale(); @@ -1071,13 +1074,13 @@ public static function isAllowedForCalculation(mixed $ToCalculate): bool * @param QUI\ERP\Currency\Currency|null $Currency * @return array */ - public static function calculateTotal(array $invoiceList, QUI\ERP\Currency\Currency $Currency = null): array + public static function calculateTotal(array $invoiceList, null | QUI\ERP\Currency\Currency $Currency = null): array { if ($Currency === null) { try { $currency = json_decode($invoiceList[0]['currency_data'], true); $Currency = QUI\ERP\Currency\Handler::getCurrency($currency['code']); - } catch (QUI\Exception $Exception) { + } catch (QUI\Exception) { $Currency = QUI\ERP\Defaults::getCurrency(); } } diff --git a/src/QUI/ERP/Accounting/CalculationValue.php b/src/QUI/ERP/Accounting/CalculationValue.php index 80017eb..1d7c769 100644 --- a/src/QUI/ERP/Accounting/CalculationValue.php +++ b/src/QUI/ERP/Accounting/CalculationValue.php @@ -21,9 +21,9 @@ class CalculationValue { protected QUI\ERP\Currency\Currency $Currency; - protected int|float $number = 0; + protected int | float $number = 0; - protected int|float $precision = 8; + protected int | float $precision = 8; /** * CalculationValue constructor. @@ -32,8 +32,11 @@ class CalculationValue * @param QUI\ERP\Currency\Currency|null $Currency * @param bool|int $precision - The optional number of decimal digits to round to. */ - public function __construct($number, QUI\ERP\Currency\Currency $Currency = null, bool|int $precision = false) - { + public function __construct( + $number, + null | QUI\ERP\Currency\Currency $Currency = null, + bool | int $precision = false + ) { if (!is_numeric($number)) { return; } @@ -60,7 +63,7 @@ public function __construct($number, QUI\ERP\Currency\Currency $Currency = null, /** * @return float|int */ - public function value(): float|int + public function value(): float | int { return $this->number; } @@ -90,7 +93,7 @@ public function precision(bool $precision = false): CalculationValue * @param null|QUI\Locale $Locale - optional, Locale object for the formatting * @return string */ - public function formatted(QUI\Locale $Locale = null): string + public function formatted(null | QUI\Locale $Locale = null): string { return $this->Currency->format($this->number, $Locale); } diff --git a/src/QUI/ERP/Accounting/CalculationVatValue.php b/src/QUI/ERP/Accounting/CalculationVatValue.php index cc05581..33d9cf2 100644 --- a/src/QUI/ERP/Accounting/CalculationVatValue.php +++ b/src/QUI/ERP/Accounting/CalculationVatValue.php @@ -38,11 +38,11 @@ class CalculationVatValue extends CalculationValue * @param bool|int $precision - The optional number of decimal digits to round to. */ public function __construct( - int|float $number, + int | float $number, string $text, - float|int $vat, - QUI\ERP\Currency\Currency $Currency = null, - bool|int $precision = false + float | int $vat, + null | QUI\ERP\Currency\Currency $Currency = null, + bool | int $precision = false ) { parent::__construct($number, $Currency, $precision); diff --git a/src/QUI/ERP/Address.php b/src/QUI/ERP/Address.php index b36b408..0ab03dd 100644 --- a/src/QUI/ERP/Address.php +++ b/src/QUI/ERP/Address.php @@ -26,7 +26,7 @@ class Address extends QUI\Users\Address * @param array|null $data * @param QUIUserInterface|null $User */ - public function __construct(?array $data = [], QUI\Interfaces\Users\User $User = null) + public function __construct(?array $data = [], null | QUI\Interfaces\Users\User $User = null) { if ($User) { $this->User = $User; diff --git a/src/QUI/ERP/Api/NumberRangeInterface.php b/src/QUI/ERP/Api/NumberRangeInterface.php index d4b7274..2f06f27 100644 --- a/src/QUI/ERP/Api/NumberRangeInterface.php +++ b/src/QUI/ERP/Api/NumberRangeInterface.php @@ -21,7 +21,7 @@ interface NumberRangeInterface * @param null|QUI\Locale $Locale * @return string */ - public function getTitle(QUI\Locale $Locale = null): string; + public function getTitle(null | QUI\Locale $Locale = null): string; /** * Return the current start of the range diff --git a/src/QUI/ERP/Dashboard/ErpDashboard.php b/src/QUI/ERP/Dashboard/ErpDashboard.php index 8a1438e..99bf293 100644 --- a/src/QUI/ERP/Dashboard/ErpDashboard.php +++ b/src/QUI/ERP/Dashboard/ErpDashboard.php @@ -17,7 +17,7 @@ class ErpDashboard implements DashboardInterface * @param Locale|null $Locale * @return string */ - public function getTitle(QUI\Locale $Locale = null): string + public function getTitle(null | QUI\Locale $Locale = null): string { if ($Locale === null) { $Locale = QUI::getLocale(); diff --git a/src/QUI/ERP/Defaults.php b/src/QUI/ERP/Defaults.php index de420bb..59ac400 100644 --- a/src/QUI/ERP/Defaults.php +++ b/src/QUI/ERP/Defaults.php @@ -38,7 +38,7 @@ class Defaults * @param string $key * @return array|bool|string */ - public static function conf(string $section, string $key): bool|array|string + public static function conf(string $section, string $key): bool | array | string { try { $Package = QUI::getPackage('quiqqer/erp'); @@ -110,7 +110,7 @@ public static function getCurrency(): Currency\Currency * @param QUI\Interfaces\Users\User|null $User * @return Currency\Currency|null */ - public static function getUserCurrency(QUI\Interfaces\Users\User $User = null): ?Currency\Currency + public static function getUserCurrency(null | QUI\Interfaces\Users\User $User = null): ?Currency\Currency { if (self::$userRelatedCurrency !== null) { if (self::$userRelatedCurrency) { @@ -191,7 +191,7 @@ public static function getPrecision(): int * @param bool|string $lang - language of the wanted timestamp * @return int|null|string */ - public static function getTimestampFormat(bool|string $lang = false): int|string|null + public static function getTimestampFormat(bool | string $lang = false): int | string | null { if ($lang === false) { $lang = QUI::getLocale()->getCurrent(); @@ -227,7 +227,7 @@ public static function getTimestampFormat(bool|string $lang = false): int|string * @param bool|string $lang * @return string */ - public static function getDateFormat(bool|string $lang = false): string + public static function getDateFormat(bool | string $lang = false): string { if ($lang === false) { $lang = QUI::getLocale()->getCurrent(); diff --git a/src/QUI/ERP/ErpCopyInterface.php b/src/QUI/ERP/ErpCopyInterface.php index 8ae4c23..35d2b86 100644 --- a/src/QUI/ERP/ErpCopyInterface.php +++ b/src/QUI/ERP/ErpCopyInterface.php @@ -20,7 +20,7 @@ interface ErpCopyInterface * @return ErpEntityInterface */ public function copy( - User $PermissionUser = null, - bool|string $globalProcessId = false + null | User $PermissionUser = null, + bool | string $globalProcessId = false ): ErpEntityInterface; } diff --git a/src/QUI/ERP/ErpEntityInterface.php b/src/QUI/ERP/ErpEntityInterface.php index 66378db..492d749 100644 --- a/src/QUI/ERP/ErpEntityInterface.php +++ b/src/QUI/ERP/ErpEntityInterface.php @@ -70,7 +70,7 @@ public function getCurrency(): QUI\ERP\Currency\Currency; * * @return ArticleList|ArticleListUnique */ - public function getArticles(): ArticleList|ArticleListUnique; + public function getArticles(): ArticleList | ArticleListUnique; /** * Get the price calculation object of the erp entity @@ -91,7 +91,7 @@ public function getDeliveryAddress(): ?ErpAddress; * * @param array|User $User */ - public function setCustomer(array|QUI\Interfaces\Users\User $User); + public function setCustomer(array | QUI\Interfaces\Users\User $User); /** * Returns the erp entity as an array @@ -110,7 +110,7 @@ public function toArray(): array; */ public function reversal( string $reason = '', - QUI\Interfaces\Users\User $PermissionUser = null + null | QUI\Interfaces\Users\User $PermissionUser = null ): ?ErpEntityInterface; public function addCustomerFile(string $fileHash, array $options = []): void; diff --git a/src/QUI/ERP/Money/Price.php b/src/QUI/ERP/Money/Price.php index b9f4e7d..05079e4 100644 --- a/src/QUI/ERP/Money/Price.php +++ b/src/QUI/ERP/Money/Price.php @@ -31,7 +31,7 @@ class Price * Netto Price * @var float|int */ - protected float|int $price; + protected float | int $price; /** * Price currency @@ -64,9 +64,9 @@ class Price * @param User|null $User - optional, if no user, session user are used */ public function __construct( - float|int|null $price, + float | int | null $price, QUI\ERP\Currency\Currency $Currency, - QUI\Interfaces\Users\User $User = null + null | QUI\Interfaces\Users\User $User = null ) { if (!$price) { $price = 0; @@ -102,7 +102,7 @@ public function toArray(): array * * @return float|int|null */ - public function getPrice(): float|int|null + public function getPrice(): float | int | null { return $this->validatePrice($this->price); } @@ -112,7 +112,7 @@ public function getPrice(): float|int|null * * @return float|int|null */ - public function value(): float|int|null + public function value(): float | int | null { return $this->getPrice(); } @@ -122,7 +122,7 @@ public function value(): float|int|null * * @return float|int|null */ - public function getValue(): float|int|null + public function getValue(): float | int | null { return $this->getPrice(); } @@ -198,7 +198,7 @@ public function getCurrency(): QUI\ERP\Currency\Currency * @param QUI\Locale|null $Locale - based locale, in which the price is * @return float|int|null */ - public static function validatePrice(mixed $value, QUI\Locale $Locale = null): float|int|null + public static function validatePrice(mixed $value, null | QUI\Locale $Locale = null): float | int | null { if (is_float($value) || is_int($value)) { return round($value, QUI\ERP\Defaults::getPrecision()); diff --git a/src/QUI/ERP/Output/Output.php b/src/QUI/ERP/Output/Output.php index 76cf712..cd0619b 100644 --- a/src/QUI/ERP/Output/Output.php +++ b/src/QUI/ERP/Output/Output.php @@ -32,7 +32,7 @@ class Output * @param string $package * @return OutputProviderInterface|false - OutputProvider class (static) or false if none found */ - public static function getOutputProviderByPackage(string $package): bool|OutputProviderInterface + public static function getOutputProviderByPackage(string $package): bool | OutputProviderInterface { foreach (self::getAllOutputProviders() as $outputProvider) { if ($outputProvider['package'] === $package) { @@ -49,7 +49,7 @@ public static function getOutputProviderByPackage(string $package): bool|OutputP * @param string $entityType * @return string|false - OutputProvider class (static) or false if none found */ - public static function getOutputProviderByEntityType(string $entityType): bool|string + public static function getOutputProviderByEntityType(string $entityType): bool | string { foreach (self::getAllOutputProviders() as $outputProvider) { $class = $outputProvider['class']; @@ -77,11 +77,11 @@ public static function getOutputProviderByEntityType(string $entityType): bool|s * @throws QUI\Exception */ public static function getDocumentHtml( - int|string $entityId, + int | string $entityId, string $entityType, - OutputProviderInterface $OutputProvider = null, - OutputTemplateProviderInterface $TemplateProvider = null, - string $template = null, + null | OutputProviderInterface $OutputProvider = null, + null | OutputTemplateProviderInterface $TemplateProvider = null, + null | string $template = null, bool $preview = false ): string { if (empty($OutputProvider)) { @@ -125,11 +125,11 @@ public static function getDocumentHtml( * @throws QUI\Exception */ public static function getDocumentPdf( - int|string $entityId, + int | string $entityId, string $entityType, - OutputProviderInterface $OutputProvider = null, - OutputTemplateProviderInterface $TemplateProvider = null, - string $template = null + null | OutputProviderInterface $OutputProvider = null, + null | OutputTemplateProviderInterface $TemplateProvider = null, + null | string $template = null ): QUI\HtmlToPdf\Document { if (empty($OutputProvider)) { $OutputProvider = self::getOutputProviderByEntityType($entityType); @@ -158,7 +158,7 @@ public static function getDocumentPdf( * * @return string */ - public static function getDocumentPdfDownloadUrl(int|string $entityId, string $entityType): string + public static function getDocumentPdfDownloadUrl(int | string $entityId, string $entityType): string { $url = URL_OPT_DIR . 'quiqqer/erp/bin/output/frontend/download.php?'; $url .= http_build_query([ @@ -187,14 +187,14 @@ public static function getDocumentPdfDownloadUrl(int|string $entityId, string $e * @throws QUI\Exception|\PHPMailer\PHPMailer\Exception */ public static function sendPdfViaMail( - int|string $entityId, + int | string $entityId, string $entityType, - OutputProviderInterface $OutputProvider = null, - OutputTemplateProviderInterface $TemplateProvider = null, - string $template = null, - string $recipientEmail = null, - string $mailSubject = null, - string $mailContent = null, + null | OutputProviderInterface $OutputProvider = null, + null | OutputTemplateProviderInterface $TemplateProvider = null, + null | string $template = null, + null | string $recipientEmail = null, + null | string $mailSubject = null, + null | string $mailContent = null, array $attachedMediaFiles = [] ): void { if (empty($OutputProvider)) { @@ -310,7 +310,7 @@ public static function getOutputTemplateProviderByPackage(string $package): ?Out * @param string|null $entityType (optional) - Restrict to templates of $entityType [default: fetch templates for all entity types] * @return array */ - public static function getTemplates(string $entityType = null): array + public static function getTemplates(null | string $entityType = null): array { $templates = []; $outputProviders = []; @@ -419,7 +419,7 @@ public static function getDefaultOutputTemplateForEntityType(string $entityType) * @param string $entityType * @return string|false */ - public static function getDefaultOutputTemplateProviderForEntityType(string $entityType): string|bool + public static function getDefaultOutputTemplateProviderForEntityType(string $entityType): string | bool { $defaultEntityTypeTemplate = self::getDefaultOutputTemplateForEntityType($entityType); diff --git a/src/QUI/ERP/Output/OutputProviderInterface.php b/src/QUI/ERP/Output/OutputProviderInterface.php index 8e2a9f4..1737d2b 100644 --- a/src/QUI/ERP/Output/OutputProviderInterface.php +++ b/src/QUI/ERP/Output/OutputProviderInterface.php @@ -28,7 +28,7 @@ public static function getEntityType(): string; * @param Locale|null $Locale $Locale (optional) - If omitted use \QUI::getLocale() * @return mixed */ - public static function getEntityTypeTitle(Locale $Locale = null): mixed; + public static function getEntityTypeTitle(null | Locale $Locale = null): mixed; /** * Get the entity the output is created for @@ -36,7 +36,7 @@ public static function getEntityTypeTitle(Locale $Locale = null): mixed; * @param int|string $entityId * @return mixed */ - public static function getEntity(int|string $entityId): mixed; + public static function getEntity(int | string $entityId): mixed; /** * Get download filename (without file extension) @@ -44,7 +44,7 @@ public static function getEntity(int|string $entityId): mixed; * @param int|string $entityId * @return string */ - public static function getDownloadFileName(int|string $entityId): string; + public static function getDownloadFileName(int | string $entityId): string; /** * Get output Locale by entity @@ -52,7 +52,7 @@ public static function getDownloadFileName(int|string $entityId): string; * @param int|string $entityId * @return Locale */ - public static function getLocale(int|string $entityId): Locale; + public static function getLocale(int | string $entityId): Locale; /** * Fill the OutputTemplate with appropriate entity data @@ -60,7 +60,7 @@ public static function getLocale(int|string $entityId): Locale; * @param int|string $entityId * @return array */ - public static function getTemplateData(int|string $entityId): array; + public static function getTemplateData(int | string $entityId): array; /** * Checks if $User has permission to download the document of $entityId @@ -69,7 +69,7 @@ public static function getTemplateData(int|string $entityId): array; * @param User $User * @return bool */ - public static function hasDownloadPermission(int|string $entityId, User $User): bool; + public static function hasDownloadPermission(int | string $entityId, User $User): bool; /** * Get e-mail address of the document recipient @@ -77,7 +77,7 @@ public static function hasDownloadPermission(int|string $entityId, User $User): * @param int|string $entityId * @return string|false - E-Mail address or false if no e-mail address available */ - public static function getEmailAddress(int|string $entityId): bool|string; + public static function getEmailAddress(int | string $entityId): bool | string; /** * Get e-mail subject when document is sent via mail @@ -85,7 +85,7 @@ public static function getEmailAddress(int|string $entityId): bool|string; * @param int|string $entityId * @return string */ - public static function getMailSubject(int|string $entityId): string; + public static function getMailSubject(int | string $entityId): string; /** * Get e-mail body when document is sent via mail @@ -93,5 +93,5 @@ public static function getMailSubject(int|string $entityId): string; * @param int|string $entityId * @return string */ - public static function getMailBody(int|string $entityId): string; + public static function getMailBody(int | string $entityId): string; } diff --git a/src/QUI/ERP/Output/OutputTemplate.php b/src/QUI/ERP/Output/OutputTemplate.php index 2d9e5d0..6299f9e 100644 --- a/src/QUI/ERP/Output/OutputTemplate.php +++ b/src/QUI/ERP/Output/OutputTemplate.php @@ -17,17 +17,17 @@ class OutputTemplate /** * @var string|OutputTemplateProviderInterface */ - protected string|OutputTemplateProviderInterface $TemplateProvider; + protected string | OutputTemplateProviderInterface $TemplateProvider; /** * @var string|OutputProviderInterface */ - protected string|OutputProviderInterface $OutputProvider; + protected string | OutputProviderInterface $OutputProvider; /** * @var string|null */ - protected string|null $template; + protected string | null $template; /** * @var QUI\Interfaces\Template\EngineInterface @@ -42,7 +42,7 @@ class OutputTemplate /** * @var string|int */ - protected string|int $entityId; + protected string | int $entityId; /** * The entity the output is created for @@ -66,11 +66,11 @@ class OutputTemplate * @param string|null $template (optional) - Template identifier (from template provider) */ public function __construct( - OutputTemplateProviderInterface|string $TemplateProvider, - OutputProviderInterface|string $OutputProvider, - int|string $entityId, + OutputTemplateProviderInterface | string $TemplateProvider, + OutputProviderInterface | string $OutputProvider, + int | string $entityId, string $entityType, - string $template = null + null | string $template = null ) { $this->Engine = QUI::getTemplateManager()->getEngine(); $this->TemplateProvider = $TemplateProvider; @@ -224,7 +224,7 @@ public function getEngine(): QUI\Interfaces\Template\EngineInterface /** * @return OutputTemplateProviderInterface|string */ - public function getTemplateProvider(): OutputTemplateProviderInterface|string + public function getTemplateProvider(): OutputTemplateProviderInterface | string { if (is_string($this->TemplateProvider)) { return $this->TemplateProvider; diff --git a/src/QUI/ERP/Output/OutputTemplateProviderInterface.php b/src/QUI/ERP/Output/OutputTemplateProviderInterface.php index cbafd9c..012ee4d 100644 --- a/src/QUI/ERP/Output/OutputTemplateProviderInterface.php +++ b/src/QUI/ERP/Output/OutputTemplateProviderInterface.php @@ -34,7 +34,10 @@ public static function getTemplates(string $entityType): array; * @param Locale|null $Locale $Locale (optional) - If omitted use \QUI::getLocale() * @return string */ - public static function getTemplateTitle(int|string $templateId, Locale $Locale = null): string; + public static function getTemplateTitle( + int | string $templateId, + null | Locale $Locale = null + ): string; /** * Get HTML for document header area @@ -46,11 +49,11 @@ public static function getTemplateTitle(int|string $templateId, Locale $Locale = * @return string|false */ public static function getHeaderHtml( - int|string $templateId, + int | string $templateId, string $entityType, EngineInterface $Engine, mixed $Entity - ): bool|string; + ): bool | string; /** * Get HTML for document body area @@ -62,11 +65,11 @@ public static function getHeaderHtml( * @return string|false */ public static function getBodyHtml( - int|string $templateId, + int | string $templateId, string $entityType, EngineInterface $Engine, mixed $Entity - ): bool|string; + ): bool | string; /** * Get HTML for document footer area @@ -78,9 +81,9 @@ public static function getBodyHtml( * @return string|false */ public static function getFooterHtml( - int|string $templateId, + int | string $templateId, string $entityType, EngineInterface $Engine, mixed $Entity - ): bool|string; + ): bool | string; } diff --git a/src/QUI/ERP/User.php b/src/QUI/ERP/User.php index ae6476a..64d5d75 100644 --- a/src/QUI/ERP/User.php +++ b/src/QUI/ERP/User.php @@ -292,7 +292,7 @@ public static function convertUserDataToErpUser(array $user): User /** * @deprecated use getUUID() */ - public function getId(): int|false + public function getId(): int | false { return $this->id; } @@ -433,7 +433,7 @@ public function getStatus(): int * @param int|string $id - only for the interface, has no effect * @return Address */ - public function getAddress(int|string $id = 0): QUI\Users\Address + public function getAddress(int | string $id = 0): QUI\Users\Address { return new Address($this->address, $this); } @@ -514,7 +514,7 @@ public function isSU(): bool return false; } - public function isInGroup(int|string $groupId): bool + public function isInGroup(int | string $groupId): bool { return false; } @@ -541,7 +541,7 @@ public function deactivate(?UserInterface $PermissionUser = null): bool return true; } - public function disable(UserInterface|null $PermissionUser = null): bool + public function disable(UserInterface | null $PermissionUser = null): bool { return true; } @@ -561,7 +561,7 @@ public function delete(?UserInterface $PermissionUser = null): bool /** * This user has nowhere permissions */ - public function getPermission(string $right, bool|array|string|callable $ruleset = false): bool + public function getPermission(string $right, bool | array | string | callable $ruleset = false): bool { return false; } @@ -571,7 +571,7 @@ public function getStandardAddress(): Address return $this->getAddress(); } - public function addAddress(array $params = [], QUI\Interfaces\Users\User $ParentUser = null): ?Address + public function addAddress(array $params = [], null | QUI\Interfaces\Users\User $ParentUser = null): ?Address { return null; } @@ -579,7 +579,7 @@ public function addAddress(array $params = [], QUI\Interfaces\Users\User $Parent /** * Does nothing */ - public function setGroups(array|string $groups) + public function setGroups(array | string $groups) { } @@ -632,12 +632,15 @@ public function getAvatar(): ?QUI\Projects\Media\Image /** * Does nothing */ - public function setPassword(string $new, ?UserInterface $PermissionUser = null) + public function setPassword(string $new, null | UserInterface $PermissionUser = null) { } - public function changePassword(string $newPassword, string $oldPassword, UserInterface $ParentUser = null): void - { + public function changePassword( + string $newPassword, + string $oldPassword, + null | UserInterface $ParentUser = null + ): void { } /** @@ -672,14 +675,14 @@ public function setCompanyStatus(bool $status) /** * Does nothing */ - public function addToGroup(int|string $groupId) + public function addToGroup(int | string $groupId) { } /** * Does nothing */ - public function removeGroup(Group|int|string $Group) + public function removeGroup(Group | int | string $Group) { } @@ -743,7 +746,7 @@ public function getAuthenticator(string $authenticator): AuthenticatorInterface ); } - public function enableAuthenticator(string $authenticator, UserInterface $ParentUser = null): void + public function enableAuthenticator(string $authenticator, null | UserInterface $ParentUser = null): void { throw new QUI\Users\Exception( ['quiqqer/core', 'exception.authenticator.not.found'], @@ -751,7 +754,7 @@ public function enableAuthenticator(string $authenticator, UserInterface $Parent ); } - public function disableAuthenticator(string $authenticator, UserInterface $ParentUser = null): void + public function disableAuthenticator(string $authenticator, null | UserInterface $ParentUser = null): void { throw new QUI\Users\Exception( ['quiqqer/core', 'exception.authenticator.not.found'], diff --git a/src/QUI/ERP/Utils/Sites.php b/src/QUI/ERP/Utils/Sites.php index 3bb74e5..fe9f652 100644 --- a/src/QUI/ERP/Utils/Sites.php +++ b/src/QUI/ERP/Utils/Sites.php @@ -15,7 +15,7 @@ class Sites * @param QUI\Locale|null $Locale - in which language the page should be * @return QUI\Projects\Site|null */ - public static function getTermsAndConditions(QUI\Locale $Locale = null): ?QUI\Projects\Site + public static function getTermsAndConditions(null | QUI\Locale $Locale = null): ?QUI\Projects\Site { if ($Locale === null) { $Locale = QUI::getLocale(); @@ -43,7 +43,7 @@ public static function getTermsAndConditions(QUI\Locale $Locale = null): ?QUI\Pr * @param QUI\Locale|null $Locale - in which language the page should be * @return QUI\Projects\Site|null */ - public static function getRevocation(QUI\Locale $Locale = null): ?QUI\Projects\Site + public static function getRevocation(null | QUI\Locale $Locale = null): ?QUI\Projects\Site { if ($Locale === null) { $Locale = QUI::getLocale(); @@ -71,7 +71,7 @@ public static function getRevocation(QUI\Locale $Locale = null): ?QUI\Projects\S * @param QUI\Locale|null $Locale - in which language the page should be * @return QUI\Projects\Site|null */ - public static function getPrivacyPolicy(QUI\Locale $Locale = null): ?QUI\Projects\Site + public static function getPrivacyPolicy(null | QUI\Locale $Locale = null): ?QUI\Projects\Site { if ($Locale === null) { $Locale = QUI::getLocale(); diff --git a/src/QUI/ERP/Utils/User.php b/src/QUI/ERP/Utils/User.php index 28db19f..28262f2 100644 --- a/src/QUI/ERP/Utils/User.php +++ b/src/QUI/ERP/Utils/User.php @@ -227,7 +227,7 @@ public static function isNettoUser(UserInterface $User): bool * @return bool|QUI\ERP\Areas\Area * @throws QUI\Exception */ - public static function getUserArea(UserInterface $User): bool|QUI\ERP\Areas\Area + public static function getUserArea(UserInterface $User): bool | QUI\ERP\Areas\Area { $CurrentAddress = $User->getAttribute('CurrentAddress'); @@ -276,7 +276,7 @@ public static function getUserArea(UserInterface $User): bool|QUI\ERP\Areas\Area * @throws Exception * @throws QUI\Permissions\Exception */ - public static function getUserERPAddress(UserInterface $User): null|Address|array + public static function getUserERPAddress(UserInterface $User): null | Address | array { if (!QUI::getUsers()->isUser($User)) { throw new QUI\Exception([ -- GitLab From 511794c34236920430ce93fb529e85f43d69b124 Mon Sep 17 00:00:00 2001 From: Henning <leutz@pcsg.de> Date: Sat, 22 Feb 2025 11:41:57 +0100 Subject: [PATCH 4/7] fix(phpstan): price calculation, logging, and file handling improvements In this commit, several enhancements are made in the ajax price calculation PHP files including more verbose error logging and minor refactoring of the calculation itself. Instead of adding an error message in QUI, we now add detailed error handling using QUI\System\Log. Additionally, we have improved file handling in `ajax/output/sendMail.php` by ensuring the file is an instance of `QUI\Projects\Media\File` or `QUI\Projects\Media\Image` before attaching it. Lastly, we added an option for parsing in method getCustomerFiles of the ErpEntityInterface. This commit will make the scripts more efficient and robust against errors. --- ajax/calcBruttoPrice.php | 19 ++++++++++++------- ajax/calcNettoPrice.php | 25 ++++++++++--------------- ajax/customerFiles/getFiles.php | 1 + ajax/output/sendMail.php | 6 +++++- src/QUI/ERP/ErpEntityInterface.php | 2 +- 5 files changed, 29 insertions(+), 24 deletions(-) diff --git a/ajax/calcBruttoPrice.php b/ajax/calcBruttoPrice.php index 53f9528..28acb89 100644 --- a/ajax/calcBruttoPrice.php +++ b/ajax/calcBruttoPrice.php @@ -7,6 +7,7 @@ use QUI\ERP\Tax\TaxEntry; use QUI\ERP\Tax\TaxType; use QUI\ERP\Tax\Utils as TaxUtils; +use QUI\System\Log; /** * Calculate the netto price @@ -20,18 +21,22 @@ QUI::$Ajax->registerFunction( 'package_quiqqer_erp_ajax_calcBruttoPrice', function ($price, $formatted, $vat) { - $price = QUI\ERP\Money\Price::validatePrice($price); + $price = QUI\ERP\Money\Price::validatePrice($price); $Currency = QUI\ERP\Defaults::getCurrency(); if (empty($vat)) { - $Area = QUI\ERP\Defaults::getArea(); - $TaxType = TaxUtils::getTaxTypeByArea($Area); + $Area = QUI\ERP\Defaults::getArea(); - if ($TaxType instanceof TaxType) { + try { + $TaxType = TaxUtils::getTaxTypeByArea($Area); $TaxEntry = TaxUtils::getTaxEntry($TaxType, $Area); - } elseif ($TaxType instanceof TaxEntry) { - $TaxEntry = $TaxType; - } else { + } catch (QUI\Exception $e) { + Log::addError($e->getMessage(), [ + 'ajax' => 'package_quiqqer_erp_ajax_calcBruttoPrice', + 'price' => $price, + 'vat' => $vat + ]); + if (isset($formatted) && $formatted) { return $Currency->format($price); } diff --git a/ajax/calcNettoPrice.php b/ajax/calcNettoPrice.php index bd21e21..5b19cf7 100644 --- a/ajax/calcNettoPrice.php +++ b/ajax/calcNettoPrice.php @@ -7,6 +7,7 @@ use QUI\ERP\Tax\TaxEntry; use QUI\ERP\Tax\TaxType; use QUI\ERP\Tax\Utils as TaxUtils; +use QUI\System\Log; /** * Calculate the netto price @@ -35,21 +36,15 @@ function ($price, $formatted, $vat) { try { $TaxType = TaxUtils::getTaxTypeByArea($Area); + $TaxEntry = TaxUtils::getTaxEntry($TaxType, $Area); } catch (QUI\Exception $Exception) { - QUI::getMessagesHandler()->addError($Exception->getMessage()); - - if (isset($formatted) && $formatted) { - return QUI\ERP\Defaults::getCurrency()->format($price); - } + Log::addError($Exception->getMessage(), [ + 'price' => $price, + 'formatted' => $formatted, + 'vat' => $vat, + 'ajax' => 'package_quiqqer_erp_ajax_calcNettoPrice' + ]); - return $price; - } - - if ($TaxType instanceof TaxType) { - $TaxEntry = TaxUtils::getTaxEntry($TaxType, $Area); - } elseif ($TaxType instanceof TaxEntry) { - $TaxEntry = $TaxType; - } else { if (isset($formatted) && $formatted) { return QUI\ERP\Defaults::getCurrency()->format($price); } @@ -68,7 +63,7 @@ function ($price, $formatted, $vat) { $precision = QUI\ERP\Defaults::getPrecision(); $bruttoInput = round($price, $precision); - $decimalParts = explode('.', $bruttoInput); + $decimalParts = explode('.', (string)$bruttoInput); $inputPrecision = isset($decimalParts[1]) ? strlen($decimalParts[1]) : 0; $brutto = round($netto, $precision) * $vat; @@ -80,7 +75,7 @@ function ($price, $formatted, $vat) { if ($brutto != $bruttoInput) { for ($i = 0; $i < 10; $i++) { - $nettoCheck = substr($netto, 0, -$precision); + $nettoCheck = (float)substr((string)$netto, 0, -$precision); $bruttoCheck = round($nettoCheck * $vat, $inputPrecision); if ($bruttoCheck == $bruttoInput) { diff --git a/ajax/customerFiles/getFiles.php b/ajax/customerFiles/getFiles.php index 4da6b0d..c63b684 100644 --- a/ajax/customerFiles/getFiles.php +++ b/ajax/customerFiles/getFiles.php @@ -16,6 +16,7 @@ 'package_quiqqer_erp_ajax_customerFiles_getFiles', function ($hash) { $Entity = (new Processes())->getEntity($hash); + return $Entity->getCustomerFiles(true); }, ['hash'] diff --git a/ajax/output/sendMail.php b/ajax/output/sendMail.php index 1dab545..f00aea5 100644 --- a/ajax/output/sendMail.php +++ b/ajax/output/sendMail.php @@ -64,7 +64,11 @@ function ( } try { - $attachedMediaFiles[] = $Media->get((int)$fileId); + $File = $Media->get((int)$fileId); + + if ($File instanceof QUI\Projects\Media\File || $File instanceof QUI\Projects\Media\Image) { + $attachedMediaFiles[] = $File; + } } catch (Exception $Exception) { QUI\System\Log::writeException($Exception); } diff --git a/src/QUI/ERP/ErpEntityInterface.php b/src/QUI/ERP/ErpEntityInterface.php index 492d749..03832b2 100644 --- a/src/QUI/ERP/ErpEntityInterface.php +++ b/src/QUI/ERP/ErpEntityInterface.php @@ -117,5 +117,5 @@ public function addCustomerFile(string $fileHash, array $options = []): void; public function clearCustomerFiles(): void; - public function getCustomerFiles(): array; + public function getCustomerFiles(bool $parsing = false): array; } -- GitLab From 9233e394b840d75a52bce1283d123ac5661a10d2 Mon Sep 17 00:00:00 2001 From: Henning <leutz@pcsg.de> Date: Sat, 22 Feb 2025 11:56:10 +0100 Subject: [PATCH 5/7] fix(phpstan): optimize attribute checks and method calls in erp classes In this commit, several changes have been made to streamline the Manufacturer and Process classes within the ERP module: - Replaced the non-empty check for 'firstname' and 'lastname' attributes in the User class with an `empty()` function, resulting in cleaner code without changing the functionality. - Replaced the argument in `User->activate()` from `false` to `''` for consistency. - Removed unnecessary annotations and some unused `protected` properties from the Process class. - Altered the procedure to retrieve `salesOrder` from the Entity in the Process class. Now, the method first tries to retrieve it via `getPaymentDataEntry()`, and if unavailable, it attempts to fetch it using `getCustomDataEntry()`. This ensures a more robust and reliable retrieval of the 'salesOrder' property. - Added `@phpstan-ignore-next-line` in the Processes class to prevent phpstan from throwing unwarranted warnings regarding the following code line in specific scenarios. Related: quiqqer/erp#103 --- src/QUI/ERP/Manufacturers.php | 6 +++--- src/QUI/ERP/Process.php | 17 +++++------------ src/QUI/ERP/Processes.php | 2 ++ 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/src/QUI/ERP/Manufacturers.php b/src/QUI/ERP/Manufacturers.php index 33073a2..9b64886 100644 --- a/src/QUI/ERP/Manufacturers.php +++ b/src/QUI/ERP/Manufacturers.php @@ -159,11 +159,11 @@ public static function createManufacturer( $Address->save(); - if (!$User->getAttribute('firstname') || $User->getAttribute('firstname') === '') { + if (empty($User->getAttribute('firstname'))) { $User->setAttribute('firstname', $address['firstname']); } - if (!$User->getAttribute('lastname') || $User->getAttribute('lastname') === '') { + if (empty($User->getAttribute('lastname'))) { $User->setAttribute('lastname', $address['lastname']); } } @@ -183,7 +183,7 @@ public static function createManufacturer( // Set random password and activate $User->setPassword(QUI\Security\Password::generateRandom(), $SystemUser); - $User->activate(false, $SystemUser); + $User->activate('', $SystemUser); return $User; } diff --git a/src/QUI/ERP/Process.php b/src/QUI/ERP/Process.php index cddd76a..dcf28e6 100644 --- a/src/QUI/ERP/Process.php +++ b/src/QUI/ERP/Process.php @@ -31,19 +31,8 @@ class Process */ const PROCESS_ACTIVE_DATE = '2024-08-01 00:00:00'; - /** - * @var string - */ protected string $processId; - - /** - * @var null|array - */ protected ?array $transactions = null; - - /** - * @var null|QUI\ERP\Comments - */ protected ?Comments $History = null; /** @@ -166,7 +155,11 @@ class_exists('QUI\ERP\Accounting\Invoice\Invoice') $groups[$uuid][] = $Entity; if (class_exists('QUI\ERP\SalesOrders\Handler')) { - $salesOrder = $Entity->getPaymentData('salesOrder'); + $salesOrder = $Entity->getPaymentDataEntry('salesOrder'); + + if (empty($salesOrder)) { + $salesOrder = $Entity->getCustomDataEntry('salesOrder'); + } if ($salesOrder) { try { diff --git a/src/QUI/ERP/Processes.php b/src/QUI/ERP/Processes.php index ecb9a86..a7c66bb 100644 --- a/src/QUI/ERP/Processes.php +++ b/src/QUI/ERP/Processes.php @@ -43,6 +43,7 @@ public function getEntity($entityHash, $entityPlugin = false): ErpEntityInterfac if ($entityPlugin === false || $entityPlugin === 'quiqqer/booking') { try { // @todo quiqqer/booking + // @phpstan-ignore-next-line } catch (\Exception) { } } @@ -70,6 +71,7 @@ public function getEntity($entityHash, $entityPlugin = false): ErpEntityInterfac if ($entityPlugin === false || $entityPlugin === 'quiqqer/delivery-notes') { try { // @todo quiqqer/delivery-notes + // @phpstan-ignore-next-line } catch (\Exception) { } } -- GitLab 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 6/7] 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 From 81afaecb6356d3d7c70c185913449ad6cef4b4c7 Mon Sep 17 00:00:00 2001 From: Henning <leutz@pcsg.de> Date: Sat, 22 Feb 2025 12:24:57 +0100 Subject: [PATCH 7/7] chore(phpstan): address unknown classes for PHPStan analysis This commit addresses the issue of PHPStan not recognizing certain classes for type validation within our PHP codebase. This is done by adding these classes to the PHPStan configuration as ignored errors. This ensures accuracy in our static analysis for errors and warnings. Key classes such as QUI\\ERP\\Process, QUI\\ERP\\Accounting\\Calc and QUI\\ERP\\Accounting\\ArticleList have been catered to. --- phpstan-baseline.neon | 137 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 137 insertions(+) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index e69de29..8a31c96 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -0,0 +1,137 @@ +parameters: + ignoreErrors: + - + message: "#^Property QUI\\\\ERP\\\\Accounting\\\\ArticleList::\\$Order has unknown class QUI\\\\ERP\\\\Order\\\\AbstractOrder as its type\\.$#" + path: src/QUI/ERP/Accounting/ArticleList.php + - + message: "#^Parameter \\$Order of method QUI\\\\ERP\\\\Accounting\\\\ArticleList::setOrder\\(\\) has invalid type QUI\\\\ERP\\\\Order\\\\AbstractOrder\\.$#" + path: src/QUI/ERP/Accounting/ArticleList.php + - + message: "#^Method QUI\\\\ERP\\\\Accounting\\\\ArticleList::getOrder\\(\\) has invalid return type QUI\\\\ERP\\\\Order\\\\AbstractOrder\\.$#" + path: src/QUI/ERP/Accounting/ArticleList.php + - + message: "#^Call to method getDeliveryAddress\\(\\) on an unknown class QUI\\\\ERP\\\\Order\\\\AbstractOrder\\.$#" + path: src/QUI/ERP/Accounting/Calc.php + - + message: "#^Parameter \\$Invoice of method QUI\\\\ERP\\\\Accounting\\\\Calc::calculateInvoicePayments\\(\\) has invalid type QUI\\\\ERP\\\\Accounting\\\\Invoice\\\\Invoice\\.$#" + path: src/QUI/ERP/Accounting/Calc.php + - + message: "#^Call to static method getInstance\\(\\) on an unknown class QUI\\\\ERP\\\\Accounting\\\\Payments\\\\Transactions\\\\Handler\\.$#" + path: src/QUI/ERP/Accounting/Calc.php + - + message: "#^Call to static method getInstance\\(\\) on an unknown class QUI\\\\ERP\\\\Accounting\\\\Invoice\\\\Handler\\.$#" + path: src/QUI/ERP/Accounting/Calc.php + - + message: "#^Class QUI\\\\ERP\\\\Order\\\\AbstractOrder not found\\.$#" + path: src/QUI/ERP/Accounting/Calc.php + - + message: "#^Call to method getAttribute\\(\\) on an unknown class QUI\\\\ERP\\\\Order\\\\AbstractOrder\\.$#" + path: src/QUI/ERP/Accounting/Calc.php + - + message: "#^Parameter \\$Transaction of method QUI\\\\ERP\\\\ErpTransactionsInterface::linkTransaction\\(\\) has invalid type QUI\\\\ERP\\\\Accounting\\\\Payments\\\\Transactions\\\\Transaction\\.$#" + path: src/QUI/ERP/ErpTransactionsInterface.php + - + message: "#^Parameter \\$Transaction of method QUI\\\\ERP\\\\ErpTransactionsInterface::addTransaction\\(\\) has invalid type QUI\\\\ERP\\\\Accounting\\\\Payments\\\\Transactions\\\\Transaction\\.$#" + path: src/QUI/ERP/ErpTransactionsInterface.php + - + message: "#^Call to method getPrefixedNumber\\(\\) on an unknown class QUI\\\\ERP\\\\Accounting\\\\Invoice\\\\Invoice\\.$#" + path: src/QUI/ERP/Process.php + - + message: "#^Call to method getPrefixedNumber\\(\\) on an unknown class QUI\\\\ERP\\\\Accounting\\\\Invoice\\\\InvoiceTemporary\\.$#" + path: src/QUI/ERP/Process.php + - + message: "#^Call to method getAttribute\\(\\) on an unknown class QUI\\\\ERP\\\\Accounting\\\\Invoice\\\\Invoice\\.$#" + path: src/QUI/ERP/Process.php + - + message: "#^Call to method getAttribute\\(\\) on an unknown class QUI\\\\ERP\\\\Accounting\\\\Invoice\\\\InvoiceTemporary\\.$#" + path: src/QUI/ERP/Process.php + - + message: "#^Call to method getUUID\\(\\) on an unknown class QUI\\\\ERP\\\\Accounting\\\\Invoice\\\\Invoice\\.$#" + path: src/QUI/ERP/Process.php + - + message: "#^Call to method getUUID\\(\\) on an unknown class QUI\\\\ERP\\\\Accounting\\\\Invoice\\\\InvoiceTemporary\\.$#" + path: src/QUI/ERP/Process.php + - + message: "#^Call to method getHistory\\(\\) on an unknown class QUI\\\\ERP\\\\Accounting\\\\Invoice\\\\Invoice\\.$#" + path: src/QUI/ERP/Process.php + - + message: "#^Call to method getHistory\\(\\) on an unknown class QUI\\\\ERP\\\\Accounting\\\\Invoice\\\\InvoiceTemporary\\.$#" + path: src/QUI/ERP/Process.php + - + message: "#^Class QUI\\\\ERP\\\\Accounting\\\\Invoice\\\\Invoice not found\\.$#" + path: src/QUI/ERP/Process.php + - + message: "#^Class QUI\\\\ERP\\\\Accounting\\\\Invoice\\\\InvoiceTemporary not found\\.$#" + path: src/QUI/ERP/Process.php + - + message: "#^Method QUI\\\\ERP\\\\Process::getInvoices\\(\\) has invalid return type QUI\\\\ERP\\\\Accounting\\\\Invoice\\\\Invoice\\.$#" + path: src/QUI/ERP/Process.php + - + message: "#^Method QUI\\\\ERP\\\\Process::getInvoices\\(\\) has invalid return type QUI\\\\ERP\\\\Accounting\\\\Invoice\\\\InvoiceTemporary\\.$#" + path: src/QUI/ERP/Process.php + - + message: "#^Call to static method getInstance\\(\\) on an unknown class QUI\\\\ERP\\\\Accounting\\\\Invoice\\\\Handler\\.$#" + path: src/QUI/ERP/Process.php + - + message: "#^Method QUI\\\\ERP\\\\Process::getOrder\\(\\) has invalid return type QUI\\\\ERP\\\\Order\\\\Order\\.$#" + path: src/QUI/ERP/Process.php + - + message: "#^Method QUI\\\\ERP\\\\Process::getOrder\\(\\) has invalid return type QUI\\\\ERP\\\\Order\\\\OrderInProcess\\.$#" + path: src/QUI/ERP/Process.php + - + message: "#^Call to static method getInstance\\(\\) on an unknown class QUI\\\\ERP\\\\Order\\\\Handler\\.$#" + path: src/QUI/ERP/Process.php + - + message: "#^Call to method getHash\\(\\) on an unknown class QUI\\\\ERP\\\\Accounting\\\\Offers\\\\Offer\\.$#" + path: src/QUI/ERP/Process.php + - + message: "#^Call to method getAttribute\\(\\) on an unknown class QUI\\\\ERP\\\\Accounting\\\\Offers\\\\Offer\\.$#" + path: src/QUI/ERP/Process.php + - + message: "#^Call to method getHistory\\(\\) on an unknown class QUI\\\\ERP\\\\Accounting\\\\Offers\\\\Offer\\.$#" + path: src/QUI/ERP/Process.php + - + message: "#^Method QUI\\\\ERP\\\\Process::getOffers\\(\\) has invalid return type QUI\\\\ERP\\\\Accounting\\\\Offers\\\\Offer\\.$#" + path: src/QUI/ERP/Process.php + - + message: "#^Call to static method getInstance\\(\\) on an unknown class QUI\\\\ERP\\\\Accounting\\\\Offers\\\\Handler\\.$#" + path: src/QUI/ERP/Process.php + - + message: "#^Call to method getHash\\(\\) on an unknown class QUI\\\\ERP\\\\Accounting\\\\Payments\\\\Transactions\\\\Transaction\\.$#" + path: src/QUI/ERP/Process.php + - + message: "#^Call to method getAmountFormatted\\(\\) on an unknown class QUI\\\\ERP\\\\Accounting\\\\Payments\\\\Transactions\\\\Transaction\\.$#" + path: src/QUI/ERP/Process.php + - + message: "#^Call to method getDate\\(\\) on an unknown class QUI\\\\ERP\\\\Accounting\\\\Payments\\\\Transactions\\\\Transaction\\.$#" + path: src/QUI/ERP/Process.php + - + message: "#^Method QUI\\\\ERP\\\\Process::getTransactions\\(\\) has invalid return type QUI\\\\ERP\\\\Accounting\\\\Payments\\\\Transactions\\\\Transaction\\.$#" + path: src/QUI/ERP/Process.php + - + message: "#^Call to static method getInstance\\(\\) on an unknown class QUI\\\\ERP\\\\Accounting\\\\Payments\\\\Transactions\\\\Handler\\.$#" + path: src/QUI/ERP/Process.php + - + message: "#^Call to static method getInstance\\(\\) on an unknown class QUI\\\\ERP\\\\Accounting\\\\Invoice\\\\Handler\\.$#" + path: src/QUI/ERP/Processes.php + - + message: "#^Call to static method getInstance\\(\\) on an unknown class QUI\\\\ERP\\\\Order\\\\Handler\\.$#" + path: src/QUI/ERP/Processes.php + - + message: "#^Call to static method getInstance\\(\\) on an unknown class QUI\\\\ERP\\\\Accounting\\\\Offers\\\\Handler\\.$#" + path: src/QUI/ERP/Processes.php + - + message: "#^Call to static method getTableSalesOrders\\(\\) on an unknown class QUI\\\\ERP\\\\SalesOrders\\\\Handler\\.$#" + path: src/QUI/ERP/Processes.php + - + message: "#^Call to static method table\\(\\) on an unknown class QUI\\\\ERP\\\\Accounting\\\\Payments\\\\Transactions\\\\Factory\\.$#" + path: src/QUI/ERP/Processes.php + - + message: "#^Call to static method getInstance\\(\\) on an unknown class QUI\\\\ERP\\\\Order\\\\Handler\\.$#" + path: src/QUI/ERP/Utils/Process.php + - + message: "#^Call to static method getInvoiceByString\\(\\) on an unknown class QUI\\\\ERP\\\\Accounting\\\\Invoice\\\\Utils\\\\Invoice\\.$#" + path: src/QUI/ERP/Utils/Process.php + - + message: "#^Call to static method getInstance\\(\\) on an unknown class QUI\\\\ERP\\\\Accounting\\\\Payments\\\\Transactions\\\\Handler\\.$#" + path: src/QUI/ERP/Utils/Process.php \ No newline at end of file -- GitLab