コード例 #1
0
    public function __construct(QueryBuilderFactory $builderFactory, UrlGenerator $routingGenerator, DispatcherInterface $eventDispatcher, array $currencies)
    {
        parent::__construct($builderFactory, $routingGenerator, $eventDispatcher, $currencies);
        $this->_setName('sales_by_unit');
        $this->_setDisplayName('Sales by Unit');
        $this->_setReportGroup('Sales');
        $this->_setDescription('
			This report groups the total income by unit.
			By default it includes all data(orders, returns, shipping) from the last month (by completed date)
		');
        $startDate = new \DateTime();
        $this->getFilters()->get('date_range')->setStartDate($startDate->setTimestamp(strtotime(date('Y-m-d H:i') . " -1 month")));
    }
コード例 #2
0
    /**
     * Constructor.
     *
     * @param QueryBuilderFactory   $builderFactory
     * @param UrlGenerator          $routingGenerator
     * @param DispatcherInterface   $eventDispatcher
     */
    public function __construct(QueryBuilderFactory $builderFactory, UrlGenerator $routingGenerator, DispatcherInterface $eventDispatcher, array $currencies)
    {
        parent::__construct($builderFactory, $routingGenerator, $eventDispatcher, $currencies);
        $this->_setName('sales_by_item');
        $this->_setDisplayName('Sales by Item');
        $this->_setReportGroup('Sales');
        $this->_setDescription('
			This report displays all individual items which save been sold/returned.
			By default it includes all data (orders, returns, shipping) from the last week (by completed date).
		');
        $startDate = new \DateTime();
        $this->getFilters()->get('date_range')->setStartDate($startDate->setTimestamp(strtotime(date('Y-m-d H:i') . " -1 week")));
    }