localeDate = $localeDate; $this->reportTaxFactory = $reportTaxFactory; $this->localeResolver = $localeResolver; } /** * Refresh sales tax report statistics for last day * * @return $this */ public function invoke() { $this->localeResolver->emulate(0); $currentDate = $this->localeDate->date(); $date = $currentDate->modify('-25 hours'); /** @var $reportTax \Magento\Tax\Model\ResourceModel\Report\Tax */ $reportTax = $this->reportTaxFactory->create(); $reportTax->aggregate($date); $this->localeResolver->revert(); return $this; } }