1624 lines
51 KiB
PHP
1624 lines
51 KiB
PHP
<?php if(!defined('BASEPATH')) exit('No direct script access allowed');
|
|
|
|
require APPPATH . '/libraries/BaseController.php';
|
|
|
|
/**
|
|
* Class : Inward Gate Register Controller (security)
|
|
* User Class to control all user related operations.
|
|
* @author : Saravana kumar
|
|
* @version : 1.1
|
|
* @since : 10 Jun 2017
|
|
*/
|
|
class report extends BaseController
|
|
{
|
|
/**
|
|
* This is default constructor of the class
|
|
*/
|
|
|
|
public function __construct()
|
|
{
|
|
parent::__construct();
|
|
$this->load->model('dahsboard_Model');
|
|
|
|
$this->isLoggedIn();
|
|
}
|
|
public function pending_report()
|
|
{
|
|
$this->global['pageTitle'] = 'Siddharth : Reports';
|
|
if ($this->input->post('btn_submit')) {
|
|
$this->global['pageTitle'] = 'Siddharth : 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);
|
|
//print_r($data);
|
|
}
|
|
$data['finyear']=$this->dahsboard_Model->report_finyear();
|
|
|
|
//print_r($data);
|
|
|
|
|
|
|
|
$this->loadviews("report_pendingreqst",$this->global,$data, NULL);
|
|
|
|
|
|
}
|
|
public function releasedPO()
|
|
{
|
|
$this->global['pageTitle'] = 'Siddharth : Reports';
|
|
if ($this->input->post('btn_submit')) {
|
|
$this->global['pageTitle'] = 'Siddharth : 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);
|
|
//print_r($data);
|
|
|
|
|
|
|
|
}
|
|
|
|
$data['finyear']=$this->dahsboard_Model->report_finyear();
|
|
|
|
|
|
$this->loadviews("Report_POreleased",$this->global,$data, NULL);
|
|
|
|
|
|
}
|
|
public function openorderPO()
|
|
{
|
|
$this->global['pageTitle'] = 'Siddharth : Reports';
|
|
if ($this->input->post('btn_submit')) {
|
|
$this->global['pageTitle'] = 'Siddharth : 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);
|
|
//print_r($data);
|
|
|
|
|
|
|
|
}
|
|
|
|
$data['finyear']=$this->dahsboard_Model->report_finyear();
|
|
|
|
|
|
|
|
$this->loadviews("Report_openorder",$this->global,$data, NULL);
|
|
|
|
|
|
}
|
|
public function TotalOrd()
|
|
{
|
|
|
|
$this->global['pageTitle'] = 'Siddharth : 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'] = 'Siddharth : 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'] = 'Siddharth : 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'] = 'Siddharth : 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'] = 'Siddharth : Reports';
|
|
if ($this->input->post('btn_submit')) {
|
|
$this->global['pageTitle'] = 'Siddharth : 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'] = 'Siddharth : 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'] = 'Siddharth : 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'] = 'Siddharth : 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'] = 'Siddharth : 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'] = 'Siddharth : 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'] = 'Siddharth : 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'] = 'Siddharth : 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'] = 'Siddharth : 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'] = 'Siddharth : 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'] = 'Siddharth : 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'] = 'Siddharth : 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'] = 'Siddharth : 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'] = 'Siddharth : 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'] = 'Siddharth : 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);
|
|
|
|
}
|
|
|
|
|
|
|
|
function Viewfiles()
|
|
{
|
|
|
|
$PO= $this->input->post('id');
|
|
|
|
//$PONO= substr($PO,10);
|
|
$split_id = explode('-', $PO,2);
|
|
$PONO=$split_id[1];
|
|
$data = $this->dahsboard_Model->getfile($PONO);
|
|
|
|
// print_r( $data);die;
|
|
|
|
echo json_encode($data);
|
|
|
|
}
|
|
|
|
function Viewnormaligrfiles()
|
|
{
|
|
|
|
$igr= $this->input->post('id');
|
|
$PONO= $this->input->post('id1');
|
|
|
|
|
|
// $PONO= substr($PO,5);
|
|
//echo $PONO; die;
|
|
|
|
$igrfile= $this->dahsboard_Model->getfiles($igr,$PONO);
|
|
// $igrfile = $this->inwardgateregister_model->viewIGRFile($IGRNO);
|
|
$billfile = $this->dahsboard_Model->viewIGRFile1($igr,$PONO);
|
|
|
|
$data = array_merge($igrfile,$billfile);
|
|
|
|
// print_r( $data);die;
|
|
|
|
echo json_encode($data);
|
|
|
|
}
|
|
|
|
public function ipurchase()
|
|
{
|
|
|
|
$this->global['pageTitle'] = 'Siddharth : Inward PO 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();/* finyear based on po date */
|
|
$data['finyear']=$this->dahsboard_Model->ireport_finyear();/* year based on material rcvd date */
|
|
$data['purchase']=$this->dahsboard_Model->ireport_purchase($cname,$prod,$fa,$aa,$m,$frm,$t,$cat);
|
|
$data['cashbookdatas']=$this->dahsboard_Model->report_inwardcashbook($cname,$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();/* finyear based on po date */
|
|
$data['finyear']=$this->dahsboard_Model->ireport_finyear();/* year based on material rcvd date */
|
|
|
|
$this->loadviews("Report_purchase_inward",$this->global,$data, NULL);
|
|
|
|
}
|
|
public function ilink_purchase()
|
|
{
|
|
if ($this->input->post('btn_submit')) {
|
|
|
|
$this->global['pageTitle'] = 'Siddharth : Inward PO 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();/* finyear based on po date */
|
|
$data['finyear']=$this->dahsboard_Model->ireport_finyear();/* year based on material rcvd date */
|
|
$data['purchase']=$this->dahsboard_Model->ireport_purchase($cname,$prod,$fa,$aa,$m,$frm,$t,$sid,$mid,$d);
|
|
|
|
|
|
} else{
|
|
$this->global['pageTitle'] = 'Siddharth : Inward PO 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');
|
|
|
|
//print_r($m);die();
|
|
$data['material']=$this->dahsboard_Model->material_name();
|
|
$data['cust']=$this->dahsboard_Model->customer_name();
|
|
//$data['finyear']=$this->dahsboard_Model->report_finyear();/* finyear based on po date */
|
|
$data['finyear']=$this->dahsboard_Model->ireport_finyear();/* year based on material rcvd date */
|
|
$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'] = 'Siddharth : Inward Reports - Summary';
|
|
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();/* finyear based on po date */
|
|
$data['finyear']=$this->dahsboard_Model->ireport_finyear();/* year based on material rcvd date */
|
|
$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->ireport_finyear();/* year based on material rcvd date */
|
|
// 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'] = 'Siddharth : Inward Reports - Yearwise ';
|
|
|
|
|
|
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();/* finyear based on po date */
|
|
$data['finyear']=$this->dahsboard_Model->ireport_finyear();/* year based on material rcvd date */
|
|
|
|
//$this->loadviews("Report_year_wise",$this->global,$data, NULL);
|
|
}
|
|
$data['finyear']=$this->dahsboard_Model->ireport_finyear();/* year based on material rcvd date */
|
|
|
|
|
|
|
|
$this->loadviews("Report_year_wise_inward",$this->global,$data, NULL);
|
|
|
|
}
|
|
|
|
public function imonth_wise()
|
|
{
|
|
|
|
$this->global['pageTitle'] = 'Siddharth : Inward Reports - Monthwise';
|
|
|
|
|
|
$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'] = 'Siddharth : Inward Reports - Yearwise';
|
|
|
|
$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'] = 'Siddharth : Inward Reports - Supplierwise';
|
|
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();/* finyear based on po date */
|
|
$data['finyear']=$this->dahsboard_Model->ireport_finyear();/* year based on material rcvd date */
|
|
$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->ireport_finyear();/* year based on material rcvd date */
|
|
|
|
|
|
|
|
$this->loadviews("Report_supplier_inward",$this->global,$data, NULL);
|
|
|
|
}
|
|
|
|
public function iconsolidate()
|
|
{
|
|
|
|
$this->global['pageTitle'] = 'Siddharth : Inward Reports - Consolidate';
|
|
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();/* finyear based on po date */
|
|
$data['finyear']=$this->dahsboard_Model->ireport_finyear();/* year based on material rcvd date */
|
|
$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();/* finyear based on po date */
|
|
$data['finyear']=$this->dahsboard_Model->ireport_finyear();/* year based on material rcvd date */
|
|
|
|
$this->loadviews("Report_consolidate_inward",$this->global,$data, NULL);
|
|
|
|
}
|
|
public function i_consolidate_month()
|
|
{
|
|
|
|
$this->global['pageTitle'] = 'Siddharth : Inward Reports - Consolidate-Monthwise';
|
|
//$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();/* finyear based on po date */
|
|
$data['finyear']=$this->dahsboard_Model->ireport_finyear();/* year based on material rcvd date */
|
|
$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'] = 'Siddharth : Inward Reports - Consolidate-Yearwise';
|
|
//$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();/* finyear based on po date */
|
|
$data['finyear']=$this->dahsboard_Model->ireport_finyear();/* year based on material rcvd date */
|
|
$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'] = 'Siddharth : Inward Reports - Cumulative ';
|
|
|
|
//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'] = 'Siddharth : Inward Reports - Cumulative-Monthwise';
|
|
$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'] = 'Siddharth : Inward Reports - Cumulative-Yearwise ';
|
|
$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'] = 'Siddharth : Inward Reports - Cumulative-Daywise ';
|
|
$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'] = 'Siddharth : Inward Reports - Cumulative Category-Wise';
|
|
|
|
//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'] = 'Siddharth : Inward Reports - Cumulative Year-Category-Wise';
|
|
//$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'] = 'Siddharth : Inward Report - Cumulative Month-Category-Wise';
|
|
//$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'] = 'Siddharth : Inward Reports - Cumulative Daily-Category-Wise';
|
|
//$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'] = 'Siddharth : Inward Report - Consolidate ';
|
|
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();/* finyear based on po date */
|
|
$data['finyear']=$this->dahsboard_Model->ireport_finyear();/* year based on material rcvd date */
|
|
$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();/* finyear based on po date */
|
|
$data['finyear']=$this->dahsboard_Model->ireport_finyear();/* year based on material rcvd date */
|
|
|
|
$this->loadviews("Report_consolidate_raw",$this->global,$data, NULL);
|
|
|
|
|
|
}
|
|
public function rawi_consolidate_month()
|
|
{
|
|
|
|
$this->global['pageTitle'] = 'Siddharth : Inward Reports - Consolidate Month-Wise';
|
|
//$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();/* finyear based on po date */
|
|
$data['finyear']=$this->dahsboard_Model->ireport_finyear();/* year based on material rcvd date */
|
|
$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'] = 'Siddharth : Inward Reports - Consolidate Year-Wise';
|
|
//$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();/* finyear based on po date */
|
|
$data['finyear']=$this->dahsboard_Model->ireport_finyear();/* year based on material rcvd date */
|
|
$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'] = 'Siddharth : 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 monthly_gst()
|
|
{
|
|
|
|
$this->global['pageTitle'] = 'Siddharth : Reports';
|
|
if ($this->input->post('btn_submit')) {
|
|
|
|
$m=$this->input->post('month');
|
|
$frm = $this->input->post('from_date');
|
|
$t = $this->input->post('to_date');
|
|
$ab=$this->input->post('financialyear');
|
|
$fa=substr($ab,0,-5);
|
|
$aa=substr($ab,5,5);
|
|
//print_r($prod);
|
|
|
|
$data['monthly_gst_purchase']=$this->dahsboard_Model->monthly_gst_purchase($m,$frm,$t,$fa,$aa);
|
|
$data['monthly_gst_sales']=$this->dahsboard_Model->monthly_gst_sales($m,$frm,$t,$fa,$aa);
|
|
|
|
}
|
|
$data['finyear']=$this->dahsboard_Model->report_finyear();
|
|
$this->loadviews("Report_monthly_gst",$this->global,$data, NULL);
|
|
//print_r($data);die();
|
|
}
|
|
public function monthly_gst_table()
|
|
{
|
|
|
|
$this->global['pageTitle'] = 'Siddharth : Reports';
|
|
|
|
|
|
$m=$this->input->get('m');
|
|
$frm = $this->input->get('frm');
|
|
$t = $this->input->get('t');
|
|
$ab=$this->input->get('financialyear');
|
|
$fa=substr($ab,0,-5);
|
|
$aa=substr($ab,5,5);
|
|
// print_r($frm);
|
|
// print_r($t);
|
|
// print_r($m);die();
|
|
|
|
$data['monthly_gst_purchase']=$this->dahsboard_Model->purchase_gst($m,$frm,$t,$fa,$aa);
|
|
$data['monthly_gst_sales']=$this->dahsboard_Model->sales_gst($m,$frm,$t,$fa,$aa);
|
|
|
|
|
|
$this->loadviews("Report_monthly_gst_table",$this->global,$data, NULL);
|
|
//print_r($data);die();
|
|
}
|
|
/*******************Performance report start **************/
|
|
public function getFinancialStartDate()
|
|
{
|
|
|
|
|
|
|
|
$CURMONTH = date('n');
|
|
$CURYEAR = date('Y');
|
|
$FINYEAR = 0;
|
|
if ($CURMONTH >= 4)
|
|
{
|
|
$FINYEAR = $CURYEAR;
|
|
} else
|
|
{
|
|
$FINYEAR = $CURYEAR - 1;
|
|
}
|
|
|
|
$dateInString = $FINYEAR . '-4-1';
|
|
$result = date_create($dateInString);
|
|
// print_r($result);
|
|
|
|
return $result;
|
|
|
|
}
|
|
|
|
|
|
/*this function uesd to finance EndDate */
|
|
public function getFinancialEndDate()
|
|
{
|
|
$CURMONTH = date('n');
|
|
$CURYEAR = date('Y');
|
|
$FINYEAR = 0;
|
|
if ($CURMONTH < 4)
|
|
{
|
|
$FINYEAR = $CURYEAR;
|
|
} else
|
|
{
|
|
$FINYEAR = $CURYEAR + 1;
|
|
}
|
|
|
|
$dateInString = $FINYEAR . '-3-31';
|
|
$result = date_create($dateInString);
|
|
|
|
|
|
// print_r($result);
|
|
return $result;
|
|
|
|
|
|
}
|
|
|
|
|
|
public function per()
|
|
{
|
|
|
|
$this->global['pageTitle'] = 'Siddharth : 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);
|
|
$cur_month = date('M');
|
|
//echo $cur_month;
|
|
if($cur_month == $m ){
|
|
|
|
$cur_date = date('d');
|
|
}else{
|
|
|
|
$cur_date = date('t',strtotime($m));
|
|
}
|
|
$data['cur_month'] = $cur_date;
|
|
|
|
$CURMONTH = date('m');
|
|
$CURDATE = date('d');
|
|
$CURYEAR = date('Y');
|
|
$EmpID = '';
|
|
$empId = $this->dahsboard_Model->get_employee();
|
|
foreach($empId as $Employee){
|
|
|
|
$day = array();
|
|
|
|
$DateofJoiningInString = $Employee->DateofJoining;
|
|
$DateofJoining = date_create($DateofJoiningInString);
|
|
// print_r($DateofJoining);
|
|
$doj_month = date_format($DateofJoining, "n");
|
|
$doj_year = date_format($DateofJoining, "Y");
|
|
$doj_day = date_format($DateofJoining, "j");
|
|
|
|
$finStart = $this->getFinancialStartDate();
|
|
$finEnd = $this->getFinancialEndDate();
|
|
|
|
$JoinedMonth = date_format($DateofJoining, "n");
|
|
//print_r($JoinedMonth);echo "1285<br/>";
|
|
// print_r($finStart);print_r($finEnd);
|
|
//print $JoinedMonth;
|
|
|
|
if ($DateofJoining >= $finStart && $DateofJoining <= $finEnd)
|
|
{
|
|
$JoinedMonthAttendance = $this->dahsboard_Model->getAllAttendances($EmpID,$JoinedMonth);
|
|
$joinedMonthDaysCount = cal_days_in_month(CAL_GREGORIAN, $doj_month, $doj_year);
|
|
|
|
if ($CURMONTH == $doj_month && $CURYEAR == $doj_year)
|
|
{
|
|
$joinedMonthWorkingDayCount = $CURDATE - $doj_day +1 ;
|
|
}
|
|
else
|
|
{
|
|
$joinedMonthWorkingDayCount = $joinedMonthDaysCount - $doj_day +1;
|
|
}
|
|
|
|
$joinedMonthDays = 0;
|
|
for ($j = $doj_day; $j <= $joinedMonthDaysCount; $j++)
|
|
{
|
|
$weekdays[] = 'WH' . $j;
|
|
}
|
|
foreach ($JoinedMonthAttendance as $day)
|
|
{
|
|
foreach ($day as $key => $value)
|
|
{
|
|
foreach ($weekdays as $weeks)
|
|
{
|
|
if ($weeks == $key)
|
|
{
|
|
if ($value != 0)
|
|
{
|
|
// echo $value;
|
|
$joinedMonthDays++;
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
//echo $joinedMonthDays;die;
|
|
|
|
$result = $this->dahsboard_Model->attendanceyear($EmpID, $JoinedMonth + 1);
|
|
|
|
//print_r($result);
|
|
$yearabs = $this->dahsboard_Model->getAllAttendance($EmpID, $CURMONTH);
|
|
$TotalNoofDays = $result[0]->TotalWorkingDays;
|
|
$DaysWorked = $result[0]->DaysWorked;
|
|
|
|
// echo $TotalNoofDays;
|
|
// echo $DaysWorked;die;
|
|
$values = 0;
|
|
$values = array();
|
|
$weekdays = array();
|
|
$date = date('d');
|
|
|
|
$Work = array_sum($weekdays);
|
|
|
|
for ($j = 1; $j <= $date; $j++)
|
|
{
|
|
$weekdays[] = 'WH' . $j;
|
|
}
|
|
$totalhours =0;
|
|
foreach ($yearabs as $day)
|
|
{
|
|
foreach ($day as $key => $value)
|
|
{
|
|
foreach ($weekdays as $weeks)
|
|
{
|
|
if ($weeks == $key)
|
|
{
|
|
if ($value != 0)
|
|
{
|
|
//$values++;
|
|
//$totalhours = array_sum($value);
|
|
$values[] = $value;
|
|
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|
|
|
|
$DaysWorked = 0;
|
|
|
|
$totalhours = array_sum($values);
|
|
|
|
$values = $totalhours/8;
|
|
//print_r($totalhours);
|
|
|
|
if ($CURMONTH == $doj_month && $CURYEAR == $doj_year)
|
|
{
|
|
$TotalNoofDays = $TotalNoofDays + $joinedMonthWorkingDayCount;
|
|
$DaysWorked = $joinedMonthDays;
|
|
}
|
|
else
|
|
{
|
|
$TotalNoofDays = $TotalNoofDays + $CURDATE + $joinedMonthWorkingDayCount;
|
|
$DaysWorked = $DaysWorked + $joinedMonthDays + $values;
|
|
}
|
|
|
|
|
|
|
|
|
|
$final_res = round(($DaysWorked / $TotalNoofDays) * 100);
|
|
// echo "------";
|
|
//echo $final_res;exit();
|
|
$workeds[] = $DaysWorked;
|
|
$yeardata[] = $final_res;
|
|
$totaldays[] = $TotalNoofDays;
|
|
|
|
|
|
}
|
|
|
|
else
|
|
{
|
|
$EmpID = $Employee->EmpID;
|
|
$result = $this->dahsboard_Model->attendanceyear($EmpID, 4);
|
|
$yearabs = $this->dahsboard_Model->getAllAttendance($EmpID, $CURMONTH);
|
|
$TotalNoofDays = $result[0]->TotalWorkingDays;
|
|
$DaysWorked = $result[0]->DaysWorked;
|
|
|
|
|
|
$values = 0;
|
|
$values = array();
|
|
$weekdays = array();
|
|
$date = date('d');
|
|
|
|
$Work = array_sum($weekdays);
|
|
|
|
for ($j = 1; $j <= $date; $j++)
|
|
{
|
|
$weekdays[] = 'WH' . $j;
|
|
}
|
|
foreach ($yearabs as $day)
|
|
{
|
|
foreach ($day as $key => $value)
|
|
{
|
|
foreach ($weekdays as $weeks)
|
|
{
|
|
if ($weeks == $key)
|
|
{
|
|
if ($value != 0)
|
|
{
|
|
|
|
$values[]=$value;
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|
|
|
|
$totalhours = array_sum($values);
|
|
|
|
$values = $totalhours/8;
|
|
|
|
$TotalNoofDays = $TotalNoofDays + $CURDATE;
|
|
$DaysWorked = $DaysWorked + $values;
|
|
$final_res = round(($DaysWorked / $TotalNoofDays) * 100);
|
|
// echo "------";
|
|
//echo $final_res;exit();
|
|
$workeds[] = $DaysWorked;
|
|
$yeardata[] = $final_res;
|
|
$totaldays[] = $TotalNoofDays;
|
|
//print_r($data);
|
|
|
|
}
|
|
}
|
|
$data['dayworked'] = $workeds;
|
|
$data['yearpercentage'] = $yeardata;
|
|
$data['yeardays'] = $totaldays;
|
|
//print_r($data['workeds']);echo"<br/>asdasd";die;
|
|
|
|
// print_r( $data['spurchse']);
|
|
|
|
$this->loadviews("report_emp",$this->global,$data, NULL);
|
|
|
|
|
|
}
|
|
/***************End *************/
|
|
public function cashbook()
|
|
{
|
|
|
|
$this->global['pageTitle'] = 'Cashbook - 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();
|
|
|
|
$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']);
|
|
$data['Indiancurrency']=$this->dahsboard_Model->INRSymbol();
|
|
//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();
|
|
$now = new DateTime();
|
|
|
|
$currentdate = $now->format('Y-m-d'); // MySQL datetime format
|
|
$yesterday = date('Y-m-d', strtotime("-1 day"));
|
|
|
|
$month = $now->format('m') ;
|
|
$year = $now->format('y');
|
|
|
|
$premonth = $month-1;
|
|
$premonth = $premonth < 10 ? '0'.$premonth : ''.$premonth;
|
|
$premonth = $premonth == '00' ? '12' : $premonth;
|
|
$yearvalue = $premonth == '12' ? $year-1 : $year;
|
|
$preyear = $yearvalue-1;
|
|
|
|
$data['yearlybalances']=$this->dahsboard_Model->getYearlyOpeningAmt($yearvalue);
|
|
$lastdate =cal_days_in_month(CAL_GREGORIAN,$premonth,$yearvalue);
|
|
$dateformat = '20'.$yearvalue.'-'.$premonth.'-'.$lastdate;
|
|
$data['monthlybalances']=$this->dahsboard_Model->getMonthlyOpeningAmt($dateformat);
|
|
$data['yesterdaybalances'] = $this->dahsboard_Model->getDailyOpeningAmt($yesterday);
|
|
|
|
$this->loadviews("reportcashbook",$this->global,$data, NULL);
|
|
|
|
}
|
|
|
|
public function monthexpenses()
|
|
{
|
|
$monthyearvalue = $this->input->post('monthyear');
|
|
$this->global['pageTitle'] = ' Cashbook - 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['monthlyreport']=$this->dahsboard_Model->monthexpensereport($month,$year);
|
|
|
|
}
|
|
|
|
$this->loadviews("cashbookmonthlyexpenses",$this->global,$data, NULL);
|
|
|
|
}
|
|
public function yearexpenses()
|
|
{
|
|
|
|
$this->global['pageTitle'] = 'Cashbook - Cashbook Yearly Reports';
|
|
|
|
$data['financialyear']=$this->dahsboard_Model->cashbookfinyear();
|
|
|
|
$fyear = $this->input->post('financialyear');
|
|
|
|
if($fyear ==''){
|
|
|
|
$data['fyears'] = '';
|
|
|
|
}else{
|
|
|
|
$data['fyears'] = $fyear;
|
|
|
|
$fa=substr( $fyear,0,-5);
|
|
$aa=substr( $fyear,5,5);
|
|
|
|
$finyear = explode("-",$fyear);
|
|
|
|
$prev_year = $finyear[0];
|
|
|
|
$data['yearlyreport']=$this->dahsboard_Model->yearexpensereport($fa,$aa);
|
|
|
|
$data['yearlybalances']=$this->dahsboard_Model->getYearlyOpeningAmt($prev_year);
|
|
|
|
|
|
}
|
|
$this->loadviews("cashbookyearlyexpenses",$this->global,$data, NULL);
|
|
}
|
|
public function cashbookdepartment()
|
|
{
|
|
$this->global['pageTitle'] = 'Cashbook - department - ';
|
|
|
|
if(!empty($_GET['sid'])){$sid=$_GET['sid'];}else{ $sid='';}
|
|
if(!empty($_GET['d'])){$d=$_GET['d'];}else{$d='';}
|
|
$c=$_GET['c'];
|
|
$finyear=$_GET['finyear'];
|
|
$fy=substr( $finyear,0,-5);
|
|
$ty=substr( $finyear,5,5);
|
|
|
|
if ($c=='PAYMENT')
|
|
{
|
|
|
|
$data['departmentwise']=$this->dahsboard_Model->departmentwise($sid,$d,$c,$fy,$ty);
|
|
$data['Indiancurrency']=$this->dahsboard_Model->INRSymbol();
|
|
$this->loadviews("cashbookmonthlydep",$this->global,$data, NULL);
|
|
}
|
|
else{
|
|
$data['departmentwise']=$this->dahsboard_Model->departmentwise($sid,$d,$c,$fy,$ty);
|
|
$data['Indiancurrency']=$this->dahsboard_Model->INRSymbol();
|
|
$this->loadviews("cashbookmonthlyexp",$this->global,$data, NULL);
|
|
}
|
|
}
|
|
public function cashbookdepartmentexp()
|
|
{
|
|
$sid=$_GET['sid'];
|
|
$d=$_GET['d'];
|
|
$c=$_GET['c'];
|
|
$this->global['pageTitle'] = 'Cashbook - department - ';
|
|
$data['departmentwise']=$this->dahsboard_Model->departmentwise($sid,$d,$c);
|
|
$data['Indiancurrency']=$this->dahsboard_Model->INRSymbol();
|
|
//print_r($data['departmentwise']);
|
|
$this->loadviews("cashbookmonthlyexp",$this->global,$data, NULL);
|
|
}
|
|
//for cashbook menu link//
|
|
// public function cashbookmonthmenu()
|
|
// {
|
|
|
|
// $this->global['pageTitle'] = 'Cashbook monthly ';
|
|
// $data['yearmonthwise']=$this->dahsboard_Model->yearmonthwise();
|
|
// $data['Indiancurrency']=$this->dahsboard_Model->INRSymbol();
|
|
// //print_r($data['departmentwise']);
|
|
// $this->loadviews("cashbookyearmonthwise",$this->global,$data, NULL);
|
|
// }
|
|
public function yearmonthwise()
|
|
{
|
|
$sid=$_GET['sid'];
|
|
$this->global['pageTitle'] = 'Cashbook - yearmonthwise - ';
|
|
$data['yearmonthwise']=$this->dahsboard_Model->yearmonthwise($sid);
|
|
$data['Indiancurrency']=$this->dahsboard_Model->INRSymbol();
|
|
//print_r($data['departmentwise']);
|
|
$this->loadviews("cashbookyearmonthwise",$this->global,$data, NULL);
|
|
}
|
|
|
|
//this function used to today menu option//
|
|
public function Viewtoday()
|
|
{
|
|
$this->global['pageTitle'] = 'Cashbook - viewtoday ';
|
|
$data['tdy']=$this->dahsboard_Model->today();
|
|
$now = new DateTime();
|
|
$currentdate = $now->format('Y-m-d'); // MySQL datetime format
|
|
$yesterday = date('Y-m-d', strtotime("-1 day"));
|
|
|
|
$data['yesterdaybalances'] = $this->dahsboard_Model->getDailyOpeningAmt($yesterday);
|
|
$data['Indiancurrency']=$this->dahsboard_Model->INRSymbol();
|
|
$this->loadviews("cashbooktoday",$this->global,$data, NULL);
|
|
}
|
|
public function depmenu()
|
|
{
|
|
$this->global['pageTitle'] = 'Cashbook - AllReport ';
|
|
$fdate = $this->input->post('from_date');
|
|
$tdate = $this->input->post('to_date');
|
|
$finyear = $this->input->post('financialyear');
|
|
$fa=substr( $finyear,0,-5);
|
|
$aa=substr( $finyear,5,5);
|
|
$data['depmenu']=$this->dahsboard_Model->departmentmenu($fdate,$tdate,$fa,$aa);
|
|
$data['financialyear']=$this->dahsboard_Model->cashbookfinyear();
|
|
$data['Indiancurrency']=$this->dahsboard_Model->INRSymbol();
|
|
$this->loadviews("cashbookall",$this->global,$data, NULL);
|
|
}
|
|
public function cashbookmenudepartment()
|
|
{
|
|
$sid=$_GET['sid'];
|
|
|
|
$this->global['pageTitle'] = 'Cashbook - department - ';
|
|
$data['menudepartmentwise']=$this->dahsboard_Model->menudepartmentwise($sid);
|
|
$data['Indiancurrency']=$this->dahsboard_Model->INRSymbol();
|
|
//print_r($data['departmentwise']);
|
|
$this->loadviews("cashbookdepday",$this->global,$data, NULL);
|
|
}
|
|
public function cashbook_cumulative_report()
|
|
{
|
|
$this->global['pageTitle'] = 'Siddharth : Cashbook Cumulative - Report';
|
|
$data['datas']=$this->dahsboard_Model->report_cumulative_cashbook();
|
|
$this->loadviews("cashbook_cumulative_report",$this->global,$data, NULL);
|
|
}
|
|
|
|
// public function cashbook_month_cumulative_reported1()
|
|
// {
|
|
|
|
// $this->global['pageTitle'] = 'Cashbook Cumulative(Monthwise) - report ';
|
|
|
|
// if (date('m') >= 4) {
|
|
// $yearl = date('Y').'-'.(date('Y')+1);
|
|
// } else {
|
|
// $yearl = (date('Y')-1).'-'.date('Y');
|
|
// }
|
|
// $ab=$yearl;
|
|
// $fa=substr($ab,0,-5);
|
|
// $aa=substr($ab,5,5);
|
|
|
|
|
|
// $data['datas'] = $this->dahsboard_Model->report_cumulative_month_cashbook();
|
|
// $this->loadviews("cashbook_cumulative_month_report1",$this->global,$data, NULL);
|
|
|
|
// }
|
|
|
|
public function cashbook_month_cumulative_report()
|
|
{
|
|
$this->global['pageTitle'] = 'Siddharth : Cashbook Cumulative(Monthwise) - Report';
|
|
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);
|
|
|
|
$data['accountname']=$this->dahsboard_Model->accountname();
|
|
$data['finyear']=$this->dahsboard_Model->cashbook_finyear();
|
|
// $data['spurchse']=$this->dahsboard_Model->rawi_report_consolidate($cname,$fa,$aa);
|
|
$data['datas'] = $this->dahsboard_Model->report_cumulative_month_cashbook($cname,$fa,$aa);
|
|
}
|
|
|
|
$data['accountname']=$this->dahsboard_Model->accountname();
|
|
$data['finyear']=$this->dahsboard_Model->cashbook_finyear();
|
|
|
|
$this->loadviews("cashbook_cumulative_month_report",$this->global,$data, NULL);
|
|
}
|
|
}
|
|
?>
|
|
|
|
|