/**
  * Refresh sales refunded report statistics for last day
  *
  * @return void
  */
 public function execute()
 {
     $this->localeResolver->emulate(0);
     $currentDate = $this->localeDate->date();
     $date = $currentDate->subHour(25);
     $this->refundedFactory->create()->aggregate($date);
     $this->localeResolver->revert();
 }
Exemplo n.º 2
0
 public function testExecute()
 {
     $date = $this->setupAggregate();
     $refundedMock = $this->getMockBuilder('Magento\\Sales\\Model\\Resource\\Report\\Refunded')->disableOriginalConstructor()->getMock();
     $refundedMock->expects($this->once())->method('aggregate')->with($date);
     $this->refundedFactoryMock->expects($this->once())->method('create')->will($this->returnValue($refundedMock));
     $this->observer->execute();
 }
 /**
  * Refresh sales refunded report statistics for last day
  *
  * @return void
  */
 public function execute()
 {
     $this->localeResolver->emulate(0);
     $currentDate = $this->localeDate->date();
     $date = $currentDate->sub(new \DateInterval('PT25H'));
     $this->refundedFactory->create()->aggregate($date);
     $this->localeResolver->revert();
 }
Exemplo n.º 4
0
 /**
  * Refresh sales refunded report statistics for last day
  *
  * @param \Magento\Cron\Model\Schedule $schedule
  * @return $this
  */
 public function aggregateSalesReportRefundedData($schedule)
 {
     $this->_localeResolver->emulate(0);
     $currentDate = $this->_localeDate->date();
     $date = $currentDate->subHour(25);
     $this->_refundedFactory->create()->aggregate($date);
     $this->_localeResolver->revert();
     return $this;
 }