diff --git a/src/QUI/ERP/Accounting/Invoice/EventHandler.php b/src/QUI/ERP/Accounting/Invoice/EventHandler.php index f077d2ef141f8751c8e6dc2820767f5c98a3b5f1..130697a6d57281e929ec5a068a1d12c020e85b43 100644 --- a/src/QUI/ERP/Accounting/Invoice/EventHandler.php +++ b/src/QUI/ERP/Accounting/Invoice/EventHandler.php @@ -243,10 +243,9 @@ public static function onUserSaveBegin(QUI\Users\User $User): void * @param QUI\ERP\Comments $Comments */ public static function onQuiqqerErpGetCommentsByUser( - QUI\Users\User $User, + QUI\Users\User $User, QUI\ERP\Comments $Comments - ): void - { + ): void { $Handler = Handler::getInstance(); $invoices = $Handler->getInvoicesByUser($User); @@ -262,10 +261,9 @@ public static function onQuiqqerErpGetCommentsByUser( * @param QUI\ERP\Comments $Comments */ public static function onQuiqqerErpGetHistoryByUser( - QUI\Users\User $User, + QUI\Users\User $User, QUI\ERP\Comments $Comments - ): void - { + ): void { $Handler = Handler::getInstance(); $invoices = $Handler->getInvoicesByUser($User); @@ -306,8 +304,7 @@ public static function onQuiqqerErpOutputSendMailBefore( string $recipient, QUI\Mail\Mailer $Mailer, string $mailFile = '' - ): void - { + ): void { $allowedEntityTypes = [ OutputProviderInvoice::getEntityType(), OutputProviderCancelled::getEntityType(), @@ -362,7 +359,7 @@ public static function onQuiqqerErpOutputSendMailBefore( public static function onQuiqqerHtmlToPDFCreated(QUI\HtmlToPdf\Document $Document, $filename): void { $Entity = $Document->getAttribute('Entity'); - + if (!($Entity instanceof Invoice)) { return; } @@ -378,7 +375,6 @@ public static function onQuiqqerHtmlToPDFCreated(QUI\HtmlToPdf\Document $Documen $pdfBuilder = new ZugferdDocumentPdfBuilder($document, $filename); $pdfBuilder->generateDocument()->saveDocument($filename); } - } /** diff --git a/src/QUI/ERP/Accounting/Invoice/Utils/Invoice.php b/src/QUI/ERP/Accounting/Invoice/Utils/Invoice.php index 3b8d8dcdaaec2e7ee22935ca2a7611eac89f0050..de0cf6fd1cedc81628ac5751d30f57b01a353c64 100644 --- a/src/QUI/ERP/Accounting/Invoice/Utils/Invoice.php +++ b/src/QUI/ERP/Accounting/Invoice/Utils/Invoice.php @@ -441,8 +441,7 @@ protected static function verificateField( array|string $eMessage = 'Error occurred', int $eCode = 0, array $eContext = [] - ): void - { + ): void { if (empty($value)) { throw new Exception($eMessage, $eCode, $eContext); } @@ -459,9 +458,8 @@ protected static function verificateField( */ public static function getInvoiceFilename( QUI\ERP\Accounting\Invoice\Invoice|InvoiceTemporary $Invoice, - QUI\Locale $Locale = null - ): string - { + QUI\Locale $Locale = null + ): string { if ( !($Invoice instanceof QUI\ERP\Accounting\Invoice\Invoice) && !($Invoice instanceof QUI\ERP\Accounting\Invoice\InvoiceTemporary) @@ -526,10 +524,9 @@ public static function getInvoiceFilename( * @return int|float */ public static function roundInvoiceSum( - float|int $amount, + float|int $amount, QUI\ERP\Currency\Currency $Currency = null - ): float|int - { + ): float|int { if ($Currency === null) { $Currency = QUI\ERP\Defaults::getCurrency(); @@ -570,10 +567,9 @@ public static function getInvoiceTimeForPaymentDate(InvoiceTemporary|Invoice $In * @return array */ public static function getVatTextArrayFromVatArray( - array|string $vatArray, + array|string $vatArray, QUI\ERP\Currency\Currency $Currency - ): array - { + ): array { if (is_string($vatArray)) { $vatArray = json_decode($vatArray, true); } @@ -676,9 +672,8 @@ public static function addressRequirementThreshold(): float public static function getElectronicInvoice( InvoiceTemporary|QUI\ERP\Accounting\Invoice\Invoice $Invoice, - $type = ZugferdProfiles::PROFILE_EN16931 - ): ZugferdDocumentBuilder - { + $type = ZugferdProfiles::PROFILE_EN16931 + ): ZugferdDocumentBuilder { $document = ZugferdDocumentBuilder::CreateNew($type); $date = $Invoice->getAttribute('date');