src/Invoice/EventSubscriber/SetInvoiceBankAccountByCurrencyForTCGSubscriber.php line 35
<?phpdeclare(strict_types=1);/*** Copyright (c) 2022 TECLA Consulting Group oü.* All rights reserved.** This unpublished material is proprietary to TECLA Consulting Group oü.* All rights reserved. The methods and* techniques described herein are considered trade secrets* and/or confidential. Reproduction or distribution, in whole* or in part, is forbidden except by express written permission* of TECLA Consulting Group oü.** @author Matúš Sýkorjak <matus@tecla.no>* @copyright 2022 TECLA Consulting Group oü*/namespace App\Invoice\EventSubscriber;use App\Invoice\Event\InvoiceCreateEvent;use JetBrains\PhpStorm\ArrayShape;use Symfony\Component\EventDispatcher\EventSubscriberInterface;final class SetInvoiceBankAccountByCurrencyForTCGSubscriber implements EventSubscriberInterface{#[ArrayShape([InvoiceCreateEvent::class => 'string'])]public static function getSubscribedEvents(): array{return [InvoiceCreateEvent::class => 'onInvoiceCreate',];}public function onInvoiceCreate(InvoiceCreateEvent $event): void{$invoice = $event->getInvoice();$supplier = $invoice->getSupplier();if (2860 !== $supplier->getOldId()) {return;}if ('NOK' === $invoice->getCurrency()) {$invoice->setSupplierBankAccountNumber(null);$invoice->setSupplierBankIban('EE531700017001100361');$invoice->setSupplierBankBic('RIKOEE22');return;}if ('EUR' === $invoice->getCurrency()) {$invoice->setSupplierBankAccountNumber(null);$invoice->setSupplierBankIban('EE221700017000892272');$invoice->setSupplierBankBic('RIKOEE22');}}}