Initial commit: Vendor Sales Report Magento 2 module

This commit is contained in:
shopkeeperdev
2025-11-03 17:20:07 -05:00
commit fc2838d68a
25 changed files with 1839 additions and 0 deletions

View File

@@ -0,0 +1,78 @@
<?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'));
}
}