1169 lines
37 KiB
PHP
Executable File
1169 lines
37 KiB
PHP
Executable File
<?php if(!defined('BASEPATH')) exit('No direct script access allowed');
|
|
|
|
require APPPATH . '/libraries/BaseController.php';
|
|
|
|
/**
|
|
* Class :report (Report Details - Controller)
|
|
* report Class to control all report related operations.
|
|
* @author : Venba Info Tech - Saravana kumar
|
|
* @version : 1.1
|
|
* @since : 18 November 2017
|
|
*/
|
|
class report extends BaseController
|
|
{
|
|
/**
|
|
* This is default constructor of the class
|
|
*/
|
|
public function __construct()
|
|
{
|
|
parent::__construct();
|
|
$this->load->model('dahsboard_Model');
|
|
$this->isLoggedIn();
|
|
$this->CompanyName = $this->global['CompanyName'];
|
|
}
|
|
|
|
public function pending_report()
|
|
{
|
|
|
|
$this->global['pageTitle'] = $this->CompanyName.' : Reports';
|
|
if ($this->input->post('btn_submit')) {
|
|
|
|
$this->global['pageTitle'] = 'Total Pending Requests Reports ';
|
|
|
|
$ab=$this->input->post('financialyear');
|
|
$fa=substr($ab,0,-5);
|
|
$aa=substr($ab,5,5);
|
|
$m=$this->input->post('month');
|
|
$frm = $this->input->post('from_date');
|
|
$t = $this->input->post('to_date');
|
|
$agf = $this->input->post('aging_from');
|
|
$agt = $this->input->post('aging_to');
|
|
$data['finyear']=$this->dahsboard_Model->report_finyear();
|
|
$data['pending_list']=$this->dahsboard_Model->req_list($fa,$aa,$m,$frm,$t,$agf,$agt);
|
|
|
|
}
|
|
$data['finyear']=$this->dahsboard_Model->report_finyear();
|
|
|
|
|
|
$this->loadviews("report_pendingreqst",$this->global,$data, NULL);
|
|
|
|
|
|
}
|
|
public function releasedPO()
|
|
{
|
|
$this->global['pageTitle'] = $this->CompanyName.' : Reports';
|
|
if ($this->input->post('btn_submit')) {
|
|
|
|
$this->global['pageTitle'] = 'Order Value - Released Reports ';
|
|
|
|
$ab=$this->input->post('financialyear');
|
|
$fa=substr($ab,0,-5);
|
|
$aa=substr($ab,5,5);
|
|
$m=$this->input->post('month');
|
|
$frm = $this->input->post('from_date');
|
|
$t = $this->input->post('to_date');
|
|
$agf = $this->input->post('total_order_value_From');
|
|
$agt = $this->input->post('total_order_value_To');
|
|
$data['finyear']=$this->dahsboard_Model->report_finyear();
|
|
$data['rel_po']=$this->dahsboard_Model->report_relpo($fa,$aa,$m,$frm,$t,$agf,$agt);
|
|
|
|
|
|
}
|
|
|
|
$data['finyear']=$this->dahsboard_Model->report_finyear();
|
|
|
|
|
|
$this->loadviews("Report_POreleased",$this->global,$data, NULL);
|
|
|
|
|
|
}
|
|
public function openorderPO()
|
|
{
|
|
$this->global['pageTitle'] = $this->CompanyName.' : Reports';
|
|
|
|
if ($this->input->post('btn_submit')) {
|
|
|
|
$this->global['pageTitle'] = 'Open Orders - Pending Reports ';
|
|
|
|
$ab=$this->input->post('financialyear');
|
|
$fa=substr($ab,0,-5);
|
|
$aa=substr($ab,5,5);
|
|
$m=$this->input->post('month');
|
|
$frm = $this->input->post('from_date');
|
|
$t = $this->input->post('to_date');
|
|
$agf = $this->input->post('total_order_value_From');
|
|
$agt = $this->input->post('total_order_value_To');
|
|
$data['finyear']=$this->dahsboard_Model->report_finyear();
|
|
$data['open_po']=$this->dahsboard_Model->report_openpending($fa,$aa,$m,$frm,$t,$agf,$agt);
|
|
|
|
|
|
}
|
|
|
|
$data['finyear']=$this->dahsboard_Model->report_finyear();
|
|
|
|
|
|
|
|
$this->loadviews("Report_openorder",$this->global,$data, NULL);
|
|
|
|
|
|
}
|
|
public function TotalOrd()
|
|
{
|
|
|
|
$this->global['pageTitle'] = 'Total Orders Reports';
|
|
|
|
if ($this->input->post('financialyear')) {
|
|
$ab = $this->input->post('financialyear');
|
|
$fa=substr($ab,0,-5);
|
|
$aa=substr($ab,5,5);
|
|
$data['finyear']=$this->dahsboard_Model->report_finyear();
|
|
$data['Total']=$this->dahsboard_Model->report_total($fa,$aa);
|
|
}
|
|
$data['finyear']=$this->dahsboard_Model->report_finyear();
|
|
|
|
|
|
$this->loadviews("Report_totalorders",$this->global,$data, NULL);
|
|
|
|
|
|
}
|
|
public function ccr()
|
|
{
|
|
|
|
$this->global['pageTitle'] = 'Cost Center Reports ';
|
|
|
|
|
|
if ($this->input->post('financialyear')) {
|
|
$ab = $this->input->post('financialyear');
|
|
$fa=substr($ab,0,-5);
|
|
$aa=substr($ab,5,5);
|
|
|
|
$data['finyear']=$this->dahsboard_Model->report_finyear();
|
|
$data['ccrpt']=$this->dahsboard_Model->report_ccr($fa,$aa);
|
|
|
|
}
|
|
$data['finyear']=$this->dahsboard_Model->report_finyear();
|
|
|
|
|
|
|
|
$this->loadviews("Report_costcenter",$this->global,$data, NULL);
|
|
|
|
|
|
//print_r($data);
|
|
|
|
}
|
|
public function MM_Supplier()
|
|
{
|
|
|
|
$this->global['pageTitle'] = 'Material Master - Supplier Wise Reports -';
|
|
|
|
|
|
|
|
$data['mms']=$this->dahsboard_Model->report_MMSupplier();
|
|
|
|
|
|
|
|
$this->loadviews("Report_Material_Master_SupplierWise",$this->global,$data, NULL);
|
|
|
|
|
|
|
|
}
|
|
public function MM_Item()
|
|
{
|
|
|
|
$this->global['pageTitle'] = 'Material Master - Item Wise Reports-';
|
|
|
|
|
|
$data['mmi']=$this->dahsboard_Model->report_MMItem();
|
|
$this->loadviews("Report_Material_Master_ItemWise",$this->global,$data, NULL);
|
|
|
|
|
|
}
|
|
public function MM_ReceiptValue()
|
|
{
|
|
|
|
$this->global['pageTitle'] = $this->CompanyName.' : Reports';
|
|
if ($this->input->post('btn_submit')) {
|
|
$this->global['pageTitle'] = 'Material Master - Receipt Value Reports-';
|
|
|
|
$ab=$this->input->post('financialyear');
|
|
$fa=substr($ab,0,-5);
|
|
$aa=substr($ab,5,5);
|
|
$m=$this->input->post('month');
|
|
$data['finyear']=$this->dahsboard_Model->report_finyear();
|
|
$data['mmr']=$this->dahsboard_Model->report_MMReceiptValue($fa,$aa,$m);
|
|
}
|
|
$data['finyear']=$this->dahsboard_Model->report_finyear();
|
|
|
|
$this->loadviews("Report_Material_Master_ReceiptValue",$this->global,$data, NULL);
|
|
|
|
|
|
|
|
}
|
|
public function purchase()
|
|
{
|
|
|
|
$this->global['pageTitle'] = $this->CompanyName.' : Reports ';
|
|
if ($this->input->post('btn_submit')) {
|
|
$cname = $this->input->post('client_name');
|
|
$prod = $this->input->post('item_name');
|
|
$ab=$this->input->post('financialyear');
|
|
$fa=substr($ab,0,-5);
|
|
$aa=substr($ab,5,5);
|
|
$m=$this->input->post('month');
|
|
$frm = $this->input->post('from_date');
|
|
$t = $this->input->post('to_date');
|
|
//print_r($prod);
|
|
$data['material']=$this->dahsboard_Model->material_name();
|
|
$data['cust']=$this->dahsboard_Model->customer_name();
|
|
$data['finyear']=$this->dahsboard_Model->report_finyear();
|
|
$data['purchase']=$this->dahsboard_Model->report_purchase($cname,$prod,$fa,$aa,$m,$frm,$t);
|
|
}
|
|
$data['material']=$this->dahsboard_Model->material_name();
|
|
$data['cust']=$this->dahsboard_Model->customer_name();
|
|
$data['finyear']=$this->dahsboard_Model->report_finyear();
|
|
|
|
$this->loadviews("Report_purchase",$this->global,$data, NULL);
|
|
|
|
}
|
|
public function link_purchase()
|
|
{
|
|
if ($this->input->post('btn_submit')) {
|
|
|
|
$this->global['pageTitle'] = $this->CompanyName.' : Reports';
|
|
//$this->input->post('btn_submit');
|
|
$cname = $this->input->post('client_name');
|
|
$prod = $this->input->post('item_name');
|
|
$ab=$this->input->post('financialyear');
|
|
$fa=substr($ab,0,-5);
|
|
$aa=substr($ab,5,5);
|
|
$m=$this->input->post('month');
|
|
$frm = $this->input->post('from_date');
|
|
$t = $this->input->post('to_date');
|
|
//print_r($prod);
|
|
$data['material']=$this->dahsboard_Model->material_name();
|
|
$data['cust']=$this->dahsboard_Model->customer_name();
|
|
$data['finyear']=$this->dahsboard_Model->report_finyear();
|
|
$data['purchase']=$this->dahsboard_Model->report_purchase($cname,$prod,$fa,$aa,$m,$frm,$t);
|
|
|
|
|
|
} else{
|
|
|
|
$this->global['pageTitle'] = $this->CompanyName.' : Reports';
|
|
//$this->input->post('btn_submit');
|
|
$cname = $this->input->get('cname');
|
|
$prod = $this->input->get('prod');
|
|
$ab=$this->input->get('ab');
|
|
$fa=substr($ab,0,-5);
|
|
$aa=substr($ab,5,5);
|
|
$m=$this->input->get('month');
|
|
$frm = $this->input->get('frm');
|
|
$t = $this->input->get('t');
|
|
$sid=$this->input->get('sid');
|
|
$mid = $this->input->get('mid');
|
|
$d = $this->input->get('d');
|
|
|
|
//print_r($prod);
|
|
$data['material']=$this->dahsboard_Model->material_name();
|
|
$data['cust']=$this->dahsboard_Model->customer_name();
|
|
$data['finyear']=$this->dahsboard_Model->report_finyear();
|
|
$data['purchase']=$this->dahsboard_Model->report_purchase_link($cname,$prod,$fa,$aa,$m,$frm,$t,$sid,$mid,$d);
|
|
}
|
|
|
|
|
|
|
|
$this->loadviews("Report_purchase",$this->global,$data, NULL);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
public function year_wise()
|
|
{
|
|
$this->global['pageTitle'] = $this->CompanyName.' : Reports';
|
|
|
|
|
|
if ($this->input->post('financialyear')) {
|
|
$ab=$this->input->post('financialyear');
|
|
$a=substr($ab,0,-5);
|
|
$b=substr($ab,5,5);
|
|
$data['year']=$this->dahsboard_Model->report_year_wise($a,$b);
|
|
$data['finyear']=$this->dahsboard_Model->report_finyear();
|
|
|
|
//$this->loadviews("Report_year_wise",$this->global,$data, NULL);
|
|
}
|
|
$data['finyear']=$this->dahsboard_Model->report_finyear();
|
|
|
|
|
|
$this->loadviews("Report_year_wise",$this->global,$data, NULL);
|
|
}
|
|
|
|
public function month_wise()
|
|
{
|
|
|
|
$this->global['pageTitle'] = $this->CompanyName.' : Reports';
|
|
|
|
|
|
$month=$this->input->get('dat');
|
|
$mon= date("F",strtotime($month));
|
|
//print_r($month);
|
|
$data['mont']=$mon;
|
|
$data['month']=$this->dahsboard_Model->report_month_wise($month);
|
|
|
|
|
|
$this->loadviews("Report_month_wise",$this->global,$data, NULL);
|
|
|
|
|
|
|
|
}
|
|
public function year_wise_total()
|
|
{
|
|
|
|
$this->global['pageTitle'] = $this->CompanyName.' : Reports';
|
|
|
|
$last = $this->uri->total_segments();
|
|
$month=$this->uri->segment($last);
|
|
$a=substr($month,0,-5);
|
|
$b=substr($month,5,5);
|
|
//print_r($month);
|
|
$data['year']=$month;
|
|
$data['ytotal']=$this->dahsboard_Model->report_year_wise_total($a,$b);
|
|
|
|
|
|
$this->loadviews("Report_year_wise_total",$this->global,$data, NULL);
|
|
|
|
|
|
}
|
|
|
|
public function purchase_supplier()
|
|
{
|
|
|
|
$this->global['pageTitle'] = $this->CompanyName.' : Reports';
|
|
if ($this->input->post('btn_submit')) {
|
|
$cname = $this->input->post('client_name');
|
|
$ab=$this->input->post('financialyear');
|
|
$fa=substr($ab,0,-5);
|
|
$aa=substr($ab,5,5);
|
|
$m=$this->input->post('month');
|
|
$frm = $this->input->post('from_date');
|
|
$t = $this->input->post('to_date');
|
|
//print_r($prod);
|
|
$data['material']=$this->dahsboard_Model->material_name();
|
|
$data['cust']=$this->dahsboard_Model->customer_name();
|
|
$data['finyear']=$this->dahsboard_Model->report_finyear();
|
|
$data['spurchse']=$this->dahsboard_Model->report_supplier($cname,$fa,$aa,$m,$frm,$t);
|
|
}
|
|
$data['material']=$this->dahsboard_Model->material_name();
|
|
$data['cust']=$this->dahsboard_Model->customer_name();
|
|
$data['finyear']=$this->dahsboard_Model->report_finyear();
|
|
|
|
|
|
|
|
$this->loadviews("Report_supplier",$this->global,$data, NULL);
|
|
|
|
|
|
}
|
|
public function consolidate()
|
|
{
|
|
|
|
$this->global['pageTitle'] = $this->CompanyName.' : Reports';
|
|
if ($this->input->post('btn_submit')) {
|
|
$cname = $this->input->post('client_name');
|
|
$ab=$this->input->post('financialyear');
|
|
$fa=substr($ab,0,-5);
|
|
$aa=substr($ab,5,5);
|
|
//print_r($prod);
|
|
$data['material']=$this->dahsboard_Model->material_name();
|
|
$data['cust']=$this->dahsboard_Model->customer_name();
|
|
$data['finyear']=$this->dahsboard_Model->report_finyear();
|
|
$data['spurchse']=$this->dahsboard_Model->report_consolidate($cname,$fa,$aa);
|
|
}
|
|
$data['material']=$this->dahsboard_Model->material_name();
|
|
$data['cust']=$this->dahsboard_Model->customer_name();
|
|
$data['finyear']=$this->dahsboard_Model->report_finyear();
|
|
|
|
|
|
$this->loadviews("Report_consolidate",$this->global,$data, NULL);
|
|
|
|
|
|
|
|
|
|
}
|
|
public function consolidate_month()
|
|
{
|
|
|
|
$this->global['pageTitle'] = $this->CompanyName.' : Reports';
|
|
//$this->input->post('btn_submit');
|
|
$sid=$this->input->get('sid');
|
|
$mid = $this->input->get('mid');
|
|
$cname = $this->input->get('cname');
|
|
$prod = $this->input->get('prod');
|
|
//$mat = $this->input->get('mid');
|
|
$m = $this->input->get('m');
|
|
$ab=$this->input->get('ab');
|
|
$fa=substr($ab,0,-5);
|
|
$aa=substr($ab,5,5);
|
|
//print_r($prod);
|
|
$data['material']=$this->dahsboard_Model->material_name();
|
|
$data['cust']=$this->dahsboard_Model->customer_name();
|
|
$data['finyear']=$this->dahsboard_Model->report_finyear();
|
|
$data['spurchse']=$this->dahsboard_Model->consolidate_month($m,$sid,$mid,$fa,$aa);
|
|
// print_r( $data['spurchse']);
|
|
|
|
$this->loadviews("Report_consolidate_m",$this->global,$data, NULL);
|
|
|
|
|
|
}
|
|
public function consolidate_year()
|
|
{
|
|
|
|
$this->global['pageTitle'] = $this->CompanyName.' : Reports';
|
|
//$this->input->post('btn_submit');
|
|
$sid=$this->input->get('sid');
|
|
$mid = $this->input->get('mid');
|
|
$cname = $this->input->get('cname');
|
|
$prod = $this->input->get('prod');
|
|
//$mat = $this->input->get('mid');
|
|
$ab=$this->input->get('ab');
|
|
$fa=substr($ab,0,-5);
|
|
$aa=substr($ab,5,5);
|
|
//print_r($prod);
|
|
$data['material']=$this->dahsboard_Model->material_name();
|
|
$data['cust']=$this->dahsboard_Model->customer_name();
|
|
$data['finyear']=$this->dahsboard_Model->report_finyear();
|
|
$data['spurchse']=$this->dahsboard_Model->consolidate_year($sid,$mid,$fa,$aa);
|
|
// print_r( $data['spurchse']);
|
|
|
|
$this->loadviews("Report_consolidate_y",$this->global,$data, NULL);
|
|
|
|
|
|
}
|
|
public function cumulative()
|
|
{
|
|
|
|
$this->global['pageTitle'] = $this->CompanyName.' : Reports';
|
|
|
|
//print_r($prod);
|
|
|
|
$data['cum']=$this->dahsboard_Model->report_cumulative();
|
|
|
|
|
|
$this->loadviews("Report_cumulative",$this->global,$data, NULL);
|
|
|
|
|
|
|
|
}
|
|
public function cum_month()
|
|
{
|
|
|
|
$this->global['pageTitle'] = $this->CompanyName.' : Reports';
|
|
$last = $this->uri->segment_array();
|
|
|
|
$sup = $last[3];
|
|
$mat = $last[4];
|
|
//print_r($prod);
|
|
|
|
$data['cum_month']=$this->dahsboard_Model->report_cum_month($sup,$mat);
|
|
$this->loadviews("Report_cumulative_month",$this->global,$data, NULL);
|
|
|
|
}
|
|
public function cum_year()
|
|
{
|
|
|
|
$this->global['pageTitle'] = $this->CompanyName.' : Reports';
|
|
$last = $this->uri->segment_array();
|
|
|
|
$sup = $last[3];
|
|
$mat = $last[4];
|
|
|
|
//print_r($sup);
|
|
|
|
$data['cum_year']=$this->dahsboard_Model->report_cum_year($sup,$mat);
|
|
$this->loadviews("Report_cumulative_year",$this->global,$data, NULL);
|
|
|
|
}
|
|
public function cum_day()
|
|
{
|
|
|
|
$this->global['pageTitle'] = $this->CompanyName.' : Reports';
|
|
$last = $this->uri->segment_array();
|
|
|
|
$sup = $last[3];
|
|
$mat = $last[4];
|
|
//print_r($prod);
|
|
|
|
$data['cum_day']=$this->dahsboard_Model->report_cum_day($sup,$mat);
|
|
$this->loadviews("Report_cumulative_day",$this->global,$data, NULL);
|
|
|
|
}
|
|
public function ipurchase()
|
|
{
|
|
|
|
$this->global['pageTitle'] = $this->CompanyName.' : Reports';
|
|
if ($this->input->post('btn_submit')) {
|
|
$cname = $this->input->post('client_name');
|
|
$prod = $this->input->post('item_name');
|
|
$ab=$this->input->post('financialyear');
|
|
$cat = $this->input->get('cat');
|
|
$fa=substr($ab,0,-5);
|
|
$aa=substr($ab,5,5);
|
|
$m=$this->input->post('month');
|
|
$frm = $this->input->post('from_date');
|
|
$t = $this->input->post('to_date');
|
|
//print_r($prod);
|
|
$data['material']=$this->dahsboard_Model->material_name();
|
|
$data['cust']=$this->dahsboard_Model->customer_name();
|
|
$data['finyear']=$this->dahsboard_Model->report_finyear();
|
|
$data['purchase']=$this->dahsboard_Model->ireport_purchase($cname,$prod,$fa,$aa,$m,$frm,$t,$cat);
|
|
}
|
|
$data['material']=$this->dahsboard_Model->material_name();
|
|
$data['cust']=$this->dahsboard_Model->customer_name();
|
|
$data['finyear']=$this->dahsboard_Model->report_finyear();
|
|
|
|
$this->loadviews("Report_purchase_inward",$this->global,$data, NULL);
|
|
|
|
}
|
|
public function ilink_purchase()
|
|
{
|
|
if ($this->input->post('btn_submit')) {
|
|
|
|
$this->global['pageTitle'] = $this->CompanyName.' : Reports';
|
|
//$this->input->post('btn_submit');
|
|
$cname = $this->input->post('client_name');
|
|
$prod = $this->input->post('item_name');
|
|
$ab=$this->input->post('financialyear');
|
|
$fa=substr($ab,0,-5);
|
|
$aa=substr($ab,5,5);
|
|
$m=$this->input->post('month');
|
|
$frm = $this->input->post('from_date');
|
|
$t = $this->input->post('to_date');
|
|
$sid=$this->input->get('sid');
|
|
$mid = $this->input->get('mid');
|
|
$d = $this->input->get('d');
|
|
//print_r($prod);
|
|
$data['material']=$this->dahsboard_Model->material_name();
|
|
$data['cust']=$this->dahsboard_Model->customer_name();
|
|
$data['finyear']=$this->dahsboard_Model->report_finyear();
|
|
$data['purchase']=$this->dahsboard_Model->ireport_purchase($cname,$prod,$fa,$aa,$m,$frm,$t,$sid,$mid,$d);
|
|
|
|
|
|
} else{
|
|
$this->global['pageTitle'] = $this->CompanyName.' : Reports';
|
|
//$this->input->post('btn_submit');
|
|
$cat = $this->input->get('cat');
|
|
$cname = $this->input->get('cname');
|
|
$prod = $this->input->get('prod');
|
|
$ab=$this->input->get('ab');
|
|
$fa=substr($ab,0,-5);
|
|
$aa=substr($ab,5,5);
|
|
$m=$this->input->get('m');
|
|
$frm = $this->input->get('frm');
|
|
$t = $this->input->get('t');
|
|
$sid=$this->input->get('sid');
|
|
$mid = $this->input->get('mid');
|
|
$d = $this->input->get('d');
|
|
$da = $this->input->get('da');
|
|
$po = $this->input->get('po');
|
|
$data['material']=$this->dahsboard_Model->material_name();
|
|
$data['cust']=$this->dahsboard_Model->customer_name();
|
|
$data['finyear']=$this->dahsboard_Model->report_finyear();
|
|
$data['purchase']=$this->dahsboard_Model->ireport_purchase_link($cname,$prod,$fa,$aa,$m,$frm,$t,$sid,$mid,$d,$cat,$da,$po);
|
|
}
|
|
|
|
$this->loadviews("Report_purchase_inward",$this->global,$data, NULL);
|
|
|
|
}
|
|
public function iattach()
|
|
{
|
|
|
|
$this->global['pageTitle'] = $this->CompanyName.' : Reports';
|
|
if ($this->input->post('btn_submit')) {
|
|
$cname = $this->input->post('client_name');
|
|
$ab=$this->input->post('financialyear');
|
|
$fa=substr($ab,0,-5);
|
|
$aa=substr($ab,5,5);
|
|
$m=$this->input->post('month');
|
|
$frm = $this->input->post('from_date');
|
|
$t = $this->input->post('to_date');
|
|
//print_r($prod);
|
|
$data['material']=$this->dahsboard_Model->material_name();
|
|
$data['cust']=$this->dahsboard_Model->customer_name();
|
|
$data['finyear']=$this->dahsboard_Model->report_finyear();
|
|
$data['purchase']=$this->dahsboard_Model->ireport_attachment($cname,$fa,$aa,$m,$frm,$t);
|
|
}
|
|
|
|
$data['cust']=$this->dahsboard_Model->customer_name();
|
|
$data['finyear']=$this->dahsboard_Model->report_finyear();
|
|
// if($this->DEPCode == MANAGEMENT)
|
|
// {
|
|
$this->loadviews("Report_attach_inward",$this->global,$data, NULL);
|
|
// }
|
|
// else
|
|
// {
|
|
// $this->loadViews("access", $this->global, $data, NULL);
|
|
// }
|
|
|
|
}
|
|
public function iyear_wise()
|
|
{
|
|
$this->global['pageTitle'] = $this->CompanyName.' : Reports';
|
|
|
|
|
|
if ($this->input->post('financialyear')) {
|
|
$ab=$this->input->post('financialyear');
|
|
$a=substr($ab,0,-5);
|
|
$b=substr($ab,5,5);
|
|
$data['year']=$this->dahsboard_Model->ireport_year_wise($a,$b);
|
|
$data['finyear']=$this->dahsboard_Model->report_finyear();
|
|
|
|
//$this->loadviews("Report_year_wise",$this->global,$data, NULL);
|
|
}
|
|
$data['finyear']=$this->dahsboard_Model->report_finyear();
|
|
|
|
|
|
|
|
$this->loadviews("Report_year_wise_inward",$this->global,$data, NULL);
|
|
|
|
}
|
|
|
|
public function imonth_wise()
|
|
{
|
|
|
|
$this->global['pageTitle'] = $this->CompanyName.' : Reports';
|
|
|
|
|
|
$month=$this->input->get('dat');
|
|
$mon= date("F",strtotime($month));
|
|
//print_r($month);
|
|
$data['mont']=$mon;
|
|
$data['month']=$this->dahsboard_Model->ireport_month_wise($month);
|
|
$this->loadviews("Report_month_wise_inward",$this->global,$data, NULL);
|
|
|
|
}
|
|
public function iyear_wise_total()
|
|
{
|
|
|
|
$this->global['pageTitle'] = $this->CompanyName.' : Reports';
|
|
|
|
$last = $this->uri->total_segments();
|
|
$month=$this->uri->segment($last);
|
|
$a=substr($month,0,-5);
|
|
$b=substr($month,5,5);
|
|
//print_r($month);
|
|
$data['year']=$month;
|
|
$data['ytotal']=$this->dahsboard_Model->ireport_year_wise_total($a,$b);
|
|
$this->loadviews("Report_year_wise_total_inward",$this->global,$data, NULL);
|
|
|
|
}
|
|
|
|
public function ipurchase_supplier()
|
|
{
|
|
|
|
$this->global['pageTitle'] = $this->CompanyName.' : Reports';
|
|
if ($this->input->post('btn_submit')) {
|
|
$cname = $this->input->post('client_name');
|
|
$ab=$this->input->post('financialyear');
|
|
$fa=substr($ab,0,-5);
|
|
$aa=substr($ab,5,5);
|
|
$m=$this->input->post('month');
|
|
$frm = $this->input->post('from_date');
|
|
$t = $this->input->post('to_date');
|
|
//print_r($prod);
|
|
$data['material']=$this->dahsboard_Model->material_name();
|
|
$data['cust']=$this->dahsboard_Model->customer_name();
|
|
$data['finyear']=$this->dahsboard_Model->report_finyear();
|
|
$data['spurchse']=$this->dahsboard_Model->ireport_supplier($cname,$fa,$aa,$m,$frm,$t);
|
|
}
|
|
$data['material']=$this->dahsboard_Model->material_name();
|
|
$data['cust']=$this->dahsboard_Model->customer_name();
|
|
$data['finyear']=$this->dahsboard_Model->report_finyear();
|
|
$this->loadviews("Report_supplier_inward",$this->global,$data, NULL);
|
|
}
|
|
public function iconsolidate()
|
|
{
|
|
|
|
$this->global['pageTitle'] = $this->CompanyName.' : Reports';
|
|
if ($this->input->post('btn_submit')) {
|
|
$cname = $this->input->post('client_name');
|
|
$ab=$this->input->post('financialyear');
|
|
$fa=substr($ab,0,-5);
|
|
$aa=substr($ab,5,5);
|
|
//print_r($prod);
|
|
$data['material']=$this->dahsboard_Model->material_name();
|
|
$data['cust']=$this->dahsboard_Model->customer_name();
|
|
$data['finyear']=$this->dahsboard_Model->report_finyear();
|
|
$data['spurchse']=$this->dahsboard_Model->ireport_consolidate($cname,$fa,$aa);
|
|
}
|
|
$data['material']=$this->dahsboard_Model->material_name();
|
|
$data['cust']=$this->dahsboard_Model->customer_name();
|
|
$data['finyear']=$this->dahsboard_Model->report_finyear();
|
|
|
|
$this->loadviews("Report_consolidate_inward",$this->global,$data, NULL);
|
|
|
|
}
|
|
public function i_consolidate_month()
|
|
{
|
|
|
|
$this->global['pageTitle'] = $this->CompanyName.' : Reports';
|
|
//$this->input->post('btn_submit');
|
|
$sid=$this->input->get('sid');
|
|
$mid = $this->input->get('mid');
|
|
$cname = $this->input->get('cname');
|
|
$prod = $this->input->get('prod');
|
|
//$mat = $this->input->get('mid');
|
|
$m = $this->input->get('m');
|
|
$ab=$this->input->get('ab');
|
|
$fa=substr($ab,0,-5);
|
|
$aa=substr($ab,5,5);
|
|
//print_r($prod);
|
|
$data['material']=$this->dahsboard_Model->material_name();
|
|
$data['cust']=$this->dahsboard_Model->customer_name();
|
|
$data['finyear']=$this->dahsboard_Model->report_finyear();
|
|
$data['spurchse']=$this->dahsboard_Model->i_consolidate_month($m,$sid,$mid,$fa,$aa);
|
|
// print_r( $data['spurchse']);
|
|
|
|
$this->loadviews("Report_consolidate_month_inward",$this->global,$data, NULL);
|
|
|
|
|
|
}
|
|
public function i_consolidate_year()
|
|
{
|
|
|
|
$this->global['pageTitle'] = $this->CompanyName.' : Reports';
|
|
|
|
$sid=$this->input->get('sid');
|
|
$mid = $this->input->get('mid');
|
|
$cname = $this->input->get('cname');
|
|
$prod = $this->input->get('prod');
|
|
//$mat = $this->input->get('mid');
|
|
$ab=$this->input->get('ab');
|
|
$fa=substr($ab,0,-5);
|
|
$aa=substr($ab,5,5);
|
|
//print_r($prod);
|
|
$data['material']=$this->dahsboard_Model->material_name();
|
|
$data['cust']=$this->dahsboard_Model->customer_name();
|
|
$data['finyear']=$this->dahsboard_Model->report_finyear();
|
|
$data['spurchse']=$this->dahsboard_Model->i_consolidate_year($sid,$mid,$fa,$aa);
|
|
// print_r( $data['spurchse']);
|
|
|
|
$this->loadviews("Report_consolidate_year_inward",$this->global,$data, NULL);
|
|
// }
|
|
// else
|
|
// {
|
|
// $this->loadViews("access", $this->global, $data, NULL);
|
|
// }
|
|
|
|
}
|
|
public function icumulative()
|
|
{
|
|
|
|
$this->global['pageTitle'] = $this->CompanyName.' : Reports';
|
|
|
|
//print_r($prod);
|
|
|
|
$data['cum']=$this->dahsboard_Model->ireport_cumulative();
|
|
|
|
|
|
$this->loadviews("Report_cumulative_inward",$this->global,$data, NULL);
|
|
|
|
}
|
|
public function icum_month()
|
|
{
|
|
|
|
$this->global['pageTitle'] = $this->CompanyName.' : Reports';
|
|
$last = $this->uri->segment_array();
|
|
|
|
$sup = $last[3];
|
|
$mat = $last[4];
|
|
//print_r($prod);
|
|
|
|
$data['cum_month']=$this->dahsboard_Model->ireport_cum_month($sup,$mat);
|
|
$this->loadviews("Report_cumulative_month_inward",$this->global,$data, NULL);
|
|
|
|
}
|
|
public function icum_year()
|
|
{
|
|
|
|
$this->global['pageTitle'] = $this->CompanyName.' : Reports';
|
|
$last = $this->uri->segment_array();
|
|
|
|
$sup = $last[3];
|
|
$mat = $last[4];
|
|
|
|
//print_r($sup);
|
|
|
|
$data['cum_year']=$this->dahsboard_Model->ireport_cum_year($sup,$mat);
|
|
$this->loadviews("Report_cumulative_year_inward",$this->global,$data, NULL);
|
|
|
|
}
|
|
public function icum_day()
|
|
{
|
|
|
|
$this->global['pageTitle'] = $this->CompanyName.' : Reports';
|
|
$last = $this->uri->segment_array();
|
|
|
|
$sup = $last[3];
|
|
$mat = $last[4];
|
|
//print_r($prod);
|
|
|
|
$data['cum_day']=$this->dahsboard_Model->ireport_cum_day($sup,$mat);
|
|
$this->loadviews("Report_cumulative_day_inward",$this->global,$data, NULL);
|
|
|
|
}
|
|
public function rawi_cumulative()
|
|
{
|
|
|
|
$this->global['pageTitle'] = $this->CompanyName.' : Reports';
|
|
|
|
//print_r($prod);
|
|
|
|
$data['cum']=$this->dahsboard_Model->rawi_report_cumulative();
|
|
|
|
|
|
$this->loadviews("Report_cumulative_raw",$this->global,$data, NULL);
|
|
|
|
}
|
|
public function rawi_cum_year()
|
|
{
|
|
|
|
$this->global['pageTitle'] = $this->CompanyName.' : Reports';
|
|
//$mat=$this->input->get('mid');
|
|
$cat=$this->input->get('cat');
|
|
//print_r($sup);
|
|
|
|
$data['cum_year']=$this->dahsboard_Model->rawi_report_cum_year($cat);
|
|
$this->loadviews("Report_cumulative_year_raw",$this->global,$data, NULL);
|
|
|
|
}
|
|
public function rawi_cum_month()
|
|
{
|
|
|
|
$this->global['pageTitle'] = $this->CompanyName.' : Reports';
|
|
//$mat=$this->input->get('mid');
|
|
$cat=$this->input->get('cat');
|
|
|
|
//print_r($prod);
|
|
|
|
$data['cum_month']=$this->dahsboard_Model->rawi_report_cum_month($cat);
|
|
$this->loadviews("Report_cumulative_month_raw",$this->global,$data, NULL);
|
|
|
|
}
|
|
public function rawi_cum_day()
|
|
{
|
|
|
|
$this->global['pageTitle'] = $this->CompanyName.' : Reports';
|
|
//$mat=$this->input->get('mid');
|
|
$cat=$this->input->get('cat');
|
|
//print_r($prod);
|
|
|
|
$data['cum_day']=$this->dahsboard_Model->rawi_report_cum_day($cat);
|
|
$this->loadviews("Report_cumulative_day_raw",$this->global,$data, NULL);
|
|
|
|
}
|
|
public function rawi_consolidate()
|
|
{
|
|
|
|
$this->global['pageTitle'] = $this->CompanyName.' : Reports';
|
|
if ($this->input->post('btn_submit')) {
|
|
$cname = $this->input->post('client_name');
|
|
$ab=$this->input->post('financialyear');
|
|
$fa=substr($ab,0,-5);
|
|
$aa=substr($ab,5,5);
|
|
//print_r($prod);
|
|
$data['material']=$this->dahsboard_Model->category();
|
|
$data['cust']=$this->dahsboard_Model->customer_name();
|
|
$data['finyear']=$this->dahsboard_Model->report_finyear();
|
|
$data['spurchse']=$this->dahsboard_Model->rawi_report_consolidate($cname,$fa,$aa);
|
|
}
|
|
$data['material']=$this->dahsboard_Model->category();
|
|
$data['cust']=$this->dahsboard_Model->customer_name();
|
|
$data['finyear']=$this->dahsboard_Model->report_finyear();
|
|
|
|
$this->loadviews("Report_consolidate_raw",$this->global,$data, NULL);
|
|
|
|
|
|
}
|
|
public function rawi_consolidate_month()
|
|
{
|
|
|
|
$this->global['pageTitle'] = $this->CompanyName.' : Reports';
|
|
//$this->input->post('btn_submit');
|
|
$cat = $this->input->get('cat');
|
|
$sup = $this->input->get('sup');
|
|
//$mat = $this->input->get('mid');
|
|
$m = $this->input->get('m');
|
|
$ab=$this->input->get('ab');
|
|
$fa=substr($ab,0,-5);
|
|
$aa=substr($ab,5,5);
|
|
//print_r($prod);
|
|
$data['material']=$this->dahsboard_Model->material_name();
|
|
$data['cust']=$this->dahsboard_Model->customer_name();
|
|
$data['finyear']=$this->dahsboard_Model->report_finyear();
|
|
$data['spurchse']=$this->dahsboard_Model->rawi_consolidate_month($m,$cat,$sup,$fa,$aa);
|
|
// print_r( $data['spurchse']);
|
|
|
|
$this->loadviews("Report_consolidate_month",$this->global,$data, NULL);
|
|
|
|
|
|
}
|
|
public function rawi_consolidate_year()
|
|
{
|
|
|
|
$this->global['pageTitle'] = $this->CompanyName.' : Reports';
|
|
//$this->input->post('btn_submit');
|
|
$cat = $this->input->get('cat');
|
|
$sup = $this->input->get('sup');
|
|
//$mat = $this->input->get('mid');
|
|
$ab=$this->input->get('ab');
|
|
$fa=substr($ab,0,-5);
|
|
$aa=substr($ab,5,5);
|
|
//print_r($prod);
|
|
$data['material']=$this->dahsboard_Model->material_name();
|
|
$data['cust']=$this->dahsboard_Model->customer_name();
|
|
$data['finyear']=$this->dahsboard_Model->report_finyear();
|
|
$data['spurchse']=$this->dahsboard_Model->rawi_consolidate_year($cat,$sup,$fa,$aa);
|
|
// print_r( $data['spurchse']);
|
|
|
|
$this->loadviews("Report_consolidate_year",$this->global,$data, NULL);
|
|
|
|
|
|
}
|
|
public function pending_purchase()
|
|
{
|
|
|
|
$this->global['pageTitle'] = $this->CompanyName.' : Reports';
|
|
if ($this->input->post('btn_submit')) {
|
|
$cname = $this->input->post('client_name');
|
|
$prod = $this->input->post('item_name');
|
|
$ab=$this->input->post('financialyear');
|
|
$cat = $this->input->get('cat');
|
|
$fa=substr($ab,0,-5);
|
|
$aa=substr($ab,5,5);
|
|
$m=$this->input->post('month');
|
|
$frm = $this->input->post('from_date');
|
|
$t = $this->input->post('to_date');
|
|
//print_r($prod);
|
|
$data['material']=$this->dahsboard_Model->material_name();
|
|
$data['cust']=$this->dahsboard_Model->customer_name();
|
|
$data['finyear']=$this->dahsboard_Model->report_finyear();
|
|
$data['ppurchse']=$this->dahsboard_Model->pending_purchase($cname,$prod,$fa,$aa,$m,$frm,$t);
|
|
}
|
|
$data['material']=$this->dahsboard_Model->material_name();
|
|
$data['cust']=$this->dahsboard_Model->customer_name();
|
|
$data['finyear']=$this->dahsboard_Model->report_finyear();
|
|
|
|
// print_r( $data['spurchse']);
|
|
|
|
$this->loadviews("Report_pending_purchase",$this->global,$data, NULL);
|
|
|
|
|
|
}
|
|
public function per()
|
|
{
|
|
|
|
$this->global['pageTitle'] = $this->CompanyName.' : Reports';
|
|
|
|
|
|
$ab=$this->input->post('financialyear');
|
|
|
|
$fa=substr($ab,0,-5);
|
|
$aa=substr($ab,5,5);
|
|
$m=$this->input->post('month');
|
|
|
|
//print_r($prod);
|
|
|
|
$data['fy']=$this->dahsboard_Model->fy();
|
|
$data['per']=$this->dahsboard_Model->per($fa,$aa,$m);
|
|
|
|
// print_r( $data['spurchse']);
|
|
|
|
$this->loadviews("report_emp",$this->global,$data, NULL);
|
|
|
|
|
|
}
|
|
public function cashbook()
|
|
{
|
|
|
|
|
|
$this->global['pageTitle'] = $this->CompanyName.' : Cashbook Reports';
|
|
|
|
$data['gettoptotal1'] = $this->dahsboard_Model->gettoptotal();
|
|
$data['getTotalServicePoCount'] = $this->dahsboard_Model->getTotalServicePoCount();
|
|
$data['getTotalimportPoCount'] = $this->dahsboard_Model->getTotalimportPoCount();
|
|
$data['getTotalcapitalPoCount'] = $this->dahsboard_Model->getTotalcapitalPoCount();
|
|
$data['getTotalrevenuePoCount'] = $this->dahsboard_Model->getTotalrevenuePoCount();
|
|
$data['cashbook']=$this->dahsboard_Model->cashbook();
|
|
|
|
// $income="RECEIPT";
|
|
// $expense="PAYMENT";
|
|
// $data['monthlywiseincome']=$this->dahsboard_Model->monthwise_data($income);
|
|
// $data['monthlywiseexpense']=$this->dahsboard_Model->monthwise_data($expense);
|
|
// $data['todayincome']=$this->dahsboard_Model->today_data($income);
|
|
// $data['todayexpense']=$this->dahsboard_Model->today_data($expense);
|
|
// $data['yearincome']=$this->dahsboard_Model->yearwise_data($income);
|
|
// $data['yearexpense']=$this->dahsboard_Model->yearwise_data($expense);
|
|
|
|
|
|
$data['dailyIncomeExpense']=$this->dahsboard_Model->today_data();
|
|
$data['monthlyIncomeExpense']=$this->dahsboard_Model->monthwise_data();
|
|
$data['yearlyIncomeExpense']=$this->dahsboard_Model->yearwise_data();
|
|
|
|
$data['gettoptotal1'] = $this->dahsboard_Model->gettoptotal();
|
|
$data['tdy']=$this->dahsboard_Model->today();
|
|
|
|
//echo ($data['tdy']);
|
|
//print_r($data['gettoptotal1']);
|
|
// $data['monthlywiseincome']=$this->dahsboard_Model->monthwise_data_income();
|
|
// $data['monthlywiseexpense']=$this->dahsboard_Model->monthwise_data_expense();
|
|
// $data['todayincome']=$this->dahsboard_Model->today_data_income();
|
|
// $data['todayexpense']=$this->dahsboard_Model->today_data_expense();
|
|
|
|
|
|
$this->loadviews("reportcashbook",$this->global,$data, NULL);
|
|
|
|
}
|
|
|
|
//This Function used to get and display today data (link = form today tile option)//
|
|
// public function Viewtoday()
|
|
public function daily_incexp()
|
|
{
|
|
|
|
$this->global['pageTitle'] = $this->CompanyName.' : Cashbook Daily Reports';
|
|
$data['tdy']=$this->dahsboard_Model->today();
|
|
//$data['Indiancurrency']=$this->dahsboard_Model->INRSymbol();
|
|
|
|
$now = new DateTime();
|
|
$currentdate = $now->format('Y-m-d'); // MySQL datetime format
|
|
$yesterday = date('Y-m-d', strtotime("-1 day"));
|
|
|
|
$data['yesterdaytotal'] = $this->dahsboard_Model->daybeforetotal($yesterday);
|
|
|
|
$this->loadviews("cashbooktoday",$this->global,$data, NULL);
|
|
}
|
|
|
|
//This Function used to get and display current monthly data (link = form monthly tile option)//
|
|
public function load_monthly_incexp()
|
|
{ $data['monthyearvalue'] = '';
|
|
$this->global['pageTitle'] = $this->CompanyName.' : Cashbook Monthly Reports';
|
|
$this->loadviews("cashbookmthlyreport",$this->global,$data, NULL);
|
|
}
|
|
|
|
public function monthly_incexp()
|
|
{
|
|
$monthyearvalue = $this->input->post('monthyear');
|
|
$this->global['pageTitle'] = $this->CompanyName.' : Cashbook Monthly Reports';
|
|
|
|
if($monthyearvalue == ''){
|
|
|
|
$data['monthyearvalue'] = '';
|
|
|
|
}
|
|
else{
|
|
|
|
$data['monthyearvalue'] = $monthyearvalue;
|
|
$monthyear = explode("-",$monthyearvalue);
|
|
|
|
$month = $monthyear[0];
|
|
$year = $monthyear[1];
|
|
|
|
|
|
$premonth = $monthyear[0]-1;
|
|
$premonth = $premonth < 10 ? '0'.$premonth : ''.$premonth;
|
|
$premonth = $premonth == '00' ? '12' : $premonth;
|
|
|
|
$yearvalue = $premonth == '12' ? $year-1 : $year;
|
|
|
|
$lastdate = cal_days_in_month(CAL_GREGORIAN,$premonth,$yearvalue);
|
|
$dateformat = $yearvalue.'-'.$premonth.'-'.$lastdate;
|
|
$data['monthlybalances']=$this->dahsboard_Model->getMonthlyOpeningAmt($dateformat);
|
|
|
|
//$data['prevmonthtotal']=$this->dahsboard_Model->monthbeforetotal($premonth,$yearvalue);
|
|
|
|
$data['monthlyreport']=$this->dahsboard_Model->month_incexp_report($month,$year);
|
|
|
|
}
|
|
|
|
$this->loadviews("cashbookmthlyreport",$this->global,$data, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function yearly_incexp()
|
|
{
|
|
$this->global['pageTitle'] = $this->CompanyName.' : Cashbook Yearly Reports';
|
|
|
|
$data['financialyear']=$this->dahsboard_Model->cashbookfinyear();
|
|
|
|
$fyear = $this->input->post('financialyear');
|
|
|
|
if($fyear ==''){
|
|
|
|
$data['fyears'] = '';
|
|
|
|
}else{
|
|
|
|
$data['fyears'] = $fyear;
|
|
//echo $data['fyears'];
|
|
$fa=substr( $fyear,0,-5);
|
|
$aa=substr( $fyear,5,5);
|
|
|
|
$finyear = explode("-",$fyear);
|
|
|
|
$prev_year = $finyear[0];
|
|
// $b4oneyear = $finyear[0] -1;
|
|
// $b4twoyear = $finyear[1] -1;
|
|
|
|
$data['yearlyreport']=$this->dahsboard_Model->yearexpensereport($fa,$aa);
|
|
|
|
//$data['b4finyeartotal']=$this->dahsboard_Model->yearbeforetotal($b4oneyear,$b4twoyear);
|
|
|
|
$data['yearlybalances']=$this->dahsboard_Model->getYearlyOpeningAmt($prev_year);
|
|
|
|
|
|
//$this->loadviews("cashbookyearlyreport",$this->global,$data, NULL);
|
|
|
|
}
|
|
$this->loadviews("cashbookyearlyreport",$this->global,$data, NULL);
|
|
}
|
|
|
|
|
|
public function cashbookdepartment()
|
|
{
|
|
//$this->global['pageTitle'] = 'Cashbook - department - ';
|
|
$sid=$_GET['sid'];
|
|
|
|
$d=$_GET['d'];
|
|
$c=$_GET['c'];
|
|
if ($c=='PAYMENT')
|
|
{
|
|
$this->global['pageTitle'] = $this->CompanyName.' : PaymentWise Reports';
|
|
|
|
$data['departmentwise']=$this->dahsboard_Model->departmentwise($sid,$d,$c);
|
|
$data['Indiancurrency']=$this->dahsboard_Model->INRSymbol();
|
|
|
|
$this->loadviews("cashbookmthlypaydep",$this->global,$data, NULL);
|
|
//cashbookmonthlydep=>cashbookmthlypaydep
|
|
}
|
|
else{
|
|
$this->global['pageTitle'] = $this->CompanyName.' : ReceiptWise Reports';
|
|
$data['departmentwise']=$this->dahsboard_Model->departmentwise($sid,$d,$c);
|
|
$data['Indiancurrency']=$this->dahsboard_Model->INRSymbol();
|
|
$this->loadviews("cashbookmthlyrecdep",$this->global,$data, NULL);
|
|
//cashbookmonthlyexp=>cashbookmthlyrecdep
|
|
}
|
|
}
|
|
|
|
public function yearmonthwise()
|
|
{
|
|
$sid=$_GET['sid'];
|
|
//$this->global['pageTitle'] = 'Cashbook - yearmonthwise - ';
|
|
$this->global['pageTitle'] = $this->CompanyName.' : Cashbook Yearly Reports';
|
|
$data['yearmonthwise']=$this->dahsboard_Model->yearmonthwise($sid);
|
|
$data['Indiancurrency']=$this->dahsboard_Model->INRSymbol();
|
|
|
|
$this->loadviews("cashbookyearmonthwise",$this->global,$data, NULL);
|
|
}
|
|
}
|
|
?>
|