orderUtil = $orderUtil; } public static function getSubscribedEvents() { return [ OrderEvent::ORDER_COMPLETE => [ ['orderAddFlag'], ], ]; } public function orderAddFlag(OrderEvent $event) { $order = $event->getOrder(); $vatContext = Contexts::get(VatContext::class); if ($vatContext->isCountryOSSActive() && empty($order->invoice_dic) && $vatContext->isEUCountry()) { $this->orderUtil->addFlag($order, 'OSS'); } } }