Files
module-vendor-sales-report/Block/Adminhtml/Report.php

79 lines
1.6 KiB
PHP
Raw Normal View History

<?php
namespace Shopkeeper\VendorSalesReport\Block\Adminhtml;
use Magento\Backend\Block\Template;
use Magento\Backend\Block\Template\Context;
use Shopkeeper\VendorSalesReport\Helper\Data as ConfigHelper;
class Report extends Template
{
/**
* @var ConfigHelper
*/
protected $configHelper;
/**
* @param Context $context
* @param ConfigHelper $configHelper
* @param array $data
*/
public function __construct(
Context $context,
ConfigHelper $configHelper,
array $data = []
) {
$this->configHelper = $configHelper;
parent::__construct($context, $data);
}
/**
* Get grid URL
*
* @return string
*/
public function getGridUrl()
{
return $this->getUrl('*/*/grid');
}
/**
* Get export URL
*
* @return string
*/
public function getExportUrl()
{
return $this->getUrl('*/*/export');
}
/**
* Get configured order statuses
*
* @return array
*/
public function getOrderStatuses()
{
return $this->configHelper->getOrderStatus();
}
/**
* Get default start date (first day of last month)
*
* @return string
*/
public function getDefaultStartDate()
{
return date('Y-m-01', strtotime('first day of last month'));
}
/**
* Get default end date (last day of last month)
*
* @return string
*/
public function getDefaultEndDate()
{
return date('Y-m-t', strtotime('last day of last month'));
}
}