2024-07-10 12:43:19 +00:00
|
|
|
<?php
|
|
|
|
defined('BASEPATH') or exit('No direct script access allowed');
|
|
|
|
class Reports extends CI_Controller
|
|
|
|
{
|
|
|
|
function __construct()
|
|
|
|
{
|
|
|
|
parent::__construct();
|
|
|
|
$this->load->model('MStocks');
|
|
|
|
$this->load->model('MSales');
|
|
|
|
$this->load->model('MPurchases');
|
|
|
|
checkLogin();
|
|
|
|
}
|
|
|
|
public function _remap($alias = "", $params = array())
|
|
|
|
{
|
2024-10-04 10:46:02 +00:00
|
|
|
// dd($this->session);
|
|
|
|
$data['dataValue'] = $this->session;
|
2024-07-10 12:43:19 +00:00
|
|
|
$data['pageTitle'] = "Sales";
|
2024-10-04 10:46:02 +00:00
|
|
|
$datas['fiscalStart'] =NepaliDate($this->session->FiscalYear->fiscalyear_from);
|
|
|
|
$datas['fiscalEnd'] =NepaliDate($this->session->FiscalYear->fiscalyear_to);
|
2024-07-10 12:43:19 +00:00
|
|
|
switch ($alias) {
|
|
|
|
case 'purchase_vs_sales':
|
|
|
|
$data['StockRecords']=$this->MStocks->getStockRecords();
|
|
|
|
$data['PurchaseDetails'] = $this->MPurchases->getItemPurchases();
|
|
|
|
$data['SalesDetails'] = $this->MSales->getItemSales();
|
2024-10-04 10:46:02 +00:00
|
|
|
$data['StockItems'] = $this->MStocks->getStockSummary($datas);
|
2024-07-10 12:43:19 +00:00
|
|
|
loadview("inventory/reports/purchase_vs_sales", $data);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|