diff --git a/application/controllers/quality.php b/application/controllers/quality.php index 543ee5c2..53c4381e 100644 --- a/application/controllers/quality.php +++ b/application/controllers/quality.php @@ -160,6 +160,16 @@ class quality extends BaseController $this->loadViews("viewindreport", $this->global, $data, NULL); } + + function viewIndInwardReport() + { + $reportid = $this->uri->segment(3); + + $data['reportdata'] = $this->quality_model->getIndividualInwardReportData($reportid); + $this->global['pageTitle'] = 'Resico : View Individual Report'; + $this->loadViews("viewindInwardreport", $this->global, $data, NULL); + + } /** @@ -400,7 +410,7 @@ class quality extends BaseController { $data['records'] = $this->quality_model->getIGRNOforReport(); $data['emplist'] = $this->quality_model->getEmplistforReport(); - $this->global['pageTitle'] = 'Siddharth : Inward Inspection'; + $this->global['pageTitle'] = 'Resico : Inward Inspection'; $this->loadViews("inward_report_create", $this->global,$data,NULL); } diff --git a/application/controllers/report.php b/application/controllers/report.php index bdc03bfc..c9b0e582 100755 --- a/application/controllers/report.php +++ b/application/controllers/report.php @@ -23,10 +23,38 @@ class report extends BaseController public function pending_report() { + $this->global['pageTitle'] = 'Resico : Reports'; + + if ($this->input->post('btn_submit')) { - $this->global['pageTitle'] = 'Total Pending Requests Reports -'; + $this->global['pageTitle'] = 'Total Pending Requests Reports -'; - $data['pending_list']=$this->dahsboard_Model->req_list(); + $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(); + + if($this->DEPCode == MANAGEMENT) { @@ -40,12 +68,37 @@ class report extends BaseController public function releasedPO() { + $this->global['pageTitle'] = 'Siddharth : Reports'; + + if ($this->input->post('btn_submit')) { - $this->global['pageTitle'] = 'Order Value - Released Reports - '; + $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(); - $data['rel_po']=$this->dahsboard_Model->report_relpo(); + //$data['rel_po']=$this->dahsboard_Model->report_relpo(); if($this->DEPCode == MANAGEMENT) { @@ -59,12 +112,45 @@ class report extends BaseController public function openorderPO() { + $this->global['pageTitle'] = 'Resico : 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->global['pageTitle'] = 'Open Orders - Pending Reports - '; + - $data['open_po']=$this->dahsboard_Model->report_openpending(); + //$data['open_po']=$this->dahsboard_Model->report_openpending(); if($this->DEPCode == MANAGEMENT) { @@ -167,13 +253,29 @@ class report extends BaseController } public function MM_ReceiptValue() { - - $this->global['pageTitle'] = 'Material Master - Receipt Value Reports-'; + $this->global['pageTitle'] = 'Resico : 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(); - $data['mmr']=$this->dahsboard_Model->report_MMReceiptValue(); - if($this->DEPCode == MANAGEMENT) { diff --git a/application/controllers/user.php b/application/controllers/user.php index 673dfa18..47fce54a 100644 --- a/application/controllers/user.php +++ b/application/controllers/user.php @@ -50,7 +50,7 @@ class user extends BaseController $data['details']=$this->dahsboard_Model->reqdetail(); $data['pending_details']=$this->dahsboard_Model->req_pending(); - $data['list']=$this->dahsboard_Model->req_list(); + // $data['list']=$this->dahsboard_Model->req_list(); $data['serviceprogress']=$this->dahsboard_Model->serviceprogress(); $data['revenueprogress']=$this->dahsboard_Model->revenueprogress(); diff --git a/application/models/dahsboard_model.php b/application/models/dahsboard_model.php index a3b5bb7e..78966dc7 100755 --- a/application/models/dahsboard_model.php +++ b/application/models/dahsboard_model.php @@ -4,6 +4,7 @@ class dahsboard_Model extends CI_Model { + /* HR DASHBOART Model START*/ function totemp() { @@ -55,15 +56,27 @@ $sql="select EmpID,CONCAT(FirstName,' ',LastName) as name FROM T_Employee_Detai function attyesterday($WH,$date) + { + //echo 'model' . $WH.'-'.$date; + $sql="select EmpID,".$WH." from T_Attendance where Month_Year = ? and EmpID in (select EmpID from T_Attendance)" ; + $query = $this->db->query($sql,array($date)); + // print_r($query->result()); + //echo count($query->result()); + return $query->result_array(); +} + + + function dayAllPersentEmpSalary($WH,$OT,$date) { //echo $EmpID.'-'.$dates; - $sql="select ".$WH." from T_Attendance where Month_Year = ? and EmpID in (select EmpID from T_Attendance)"; + $sql="select EmpID,".$WH.",".$OT." from T_Attendance where Month_Year = ? and EmpID in (select EmpID from T_Attendance)"; $query = $this->db->query($sql,array($date)); //return return $query->result_array(); } + function attendance($EmpID,$dates) { //echo $EmpID.'-'.$dates; @@ -105,26 +118,44 @@ where att.Month_Year = ? and att.EmpID = ?;"; } +function persentEmployeeDetails($EmpID){ +//join T_Attendance att on att.EmpID = pay.EmpID +$sql= "select * FROM T_Emp_Pay_Data where EmpID = ?;"; + $query = $this->db->query($sql,array($EmpID)); + + return $query->result(); - function attendanceyear($EmpID , $MONTH) +} + + + + function attendanceyear($EmpID,$MONTH) { // $sql="select Att.EmpID,Att.Month_Year,Att.*,NoofDays,Days_Worked,emp.DateofJoining from T_Attendance Att // join T_Employee_Details as emp on emp.EmpID = Att.EmpID // where Att.Month_Year between ? and ? and Att.EmpID = ?"; + // else + // (YEAR(Month_Year) = YEAR(CURRENT_DATE)-1 and MONTH(Month_Year) >= ? ) or ( YEAR(Month_Year) = YEAR(CURRENT_DATE) and MONTH(Month_Year) <= 3 ) $sql = 'select sum(NoofDays) as TotalWorkingDays,sum(Days_worked) as DaysWorked from T_Attendance where case when (month(Month_Year) >=4) then (YEAR(Month_Year) = YEAR(CURRENT_DATE) and MONTH(Month_Year) >= ? ) or ( YEAR(Month_Year) = YEAR(CURRENT_DATE)+1 and MONTH(Month_Year) <= 3 ) - else - (YEAR(Month_Year) = YEAR(CURRENT_DATE)-1 and MONTH(Month_Year) >= ? ) or ( YEAR(Month_Year) = YEAR(CURRENT_DATE) and MONTH(Month_Year) <= 3 ) + end and EmpID = ? and month(Month_Year) != month(current_date());'; - $query= $this->db->query($sql,array($MONTH, $MONTH, $EmpID)); + $query= $this->db->query($sql,array($MONTH, $EmpID)); return $query->result(); } + + + + + /* HR DASHBOARD Model END*/ + + function totalpurchaseorder(){ @@ -476,27 +507,44 @@ WHERE Cost_Center_Budget.BudgetType='REVENUE' and YEAR(STR_TO_DATE(`BudgetYear`, - function req_list(){ - - + function req_list($fa,$aa,$m,$frm,$t,$agf,$agt){ $sql="select date_format(mas.ReqDate,'%d-%m-%Y') as ReqDate,mas.ReqNo,emp.FirstName as Requestedby,dep.DepartmentName,mas.ReqType,DATEDIFF(CURDATE(),mas.ReqDate) AS Aging from T_Requestion_Master as mas join T_CostCenter_Master cos on cos.CostCenterCode = mas.CostCenterCode join T_Employee_Details emp on emp.EmpID = mas.Requestedby join T_DepartmentDetails dep on dep.DEPCode=emp.Departmentcode where mas.Status = 'ST002' "; + if ($fa and $aa != ''){ + + $sql.=" and (mas.ReqDate >= '".$fa."-04-01' and mas.ReqDate <= '".$aa."-03-31')"; + + } + if ($m!= ''){ + + $sql.="and monthname(mas.ReqDate) = '".$m."'"; + + } + + if ($frm and $t != ''){ + $fromd= date("Y-m-d",strtotime($frm)); + $tod=date("Y-m-d",strtotime($t)); + + $sql.="and date(mas.ReqDate) >= '".$fromd."' + and date(mas.ReqDate) <= '".$tod."'"; + + } + if ($agf and $agt != ''){ + + $sql.="and DATEDIFF(CURDATE(),mas.ReqDate) >= '".$agf."' + and DATEDIFF(CURDATE(),mas.ReqDate) <= '".$agt."'"; + + } $query = $this->db->query($sql); //print_r($this->db->last_query()); return $query->result(); - - - + } - } - - function report_relpo(){ - - + function report_relpo($fa,$aa,$m,$frm,$t,$agf,$agt){ $sql="select Mast.PONO,Mast.POType,date_format(Mast.PODate,'%d-%m-%Y') as PODate,date_format(Mast.ReleasedOn,'%d-%m-%Y') as ReleasedDate,Dept_Details.DepartmentName As Dept_Name,Mast.TotalOrderValue from T_PurchaseOrder_Master Mast JOIN T_PurchaseOrder_LineItem Det on Det.PONO=Mast.PONO @@ -507,17 +555,38 @@ JOIN T_CostCenter_Master as Cost on Cost.CostCenterCode=Req.CostCenterCode JOIN T_CostCenter_Budget as Cost_Center_Bdgt on Cost.CostCenterCode=Cost_Center_Bdgt.CostCenterCode where Mast.Status='ST026' -group by Mast.PONO"; + "; +if ($fa and $aa != ''){ + + $sql.=" and (Mast.PODate >= '".$fa."-04-01' and Mast.PODate <= '".$aa."-03-31')"; + + } + if ($m!= ''){ + + $sql.="and monthname(Mast.PODate) = '".$m."'"; + + } + + if ($frm and $t != ''){ + $fromd= date("Y-m-d",strtotime($frm)); + $tod=date("Y-m-d",strtotime($t)); + + $sql.="and date(Mast.PODate) >= '".$fromd."' + and date(Mast.PODate) <= '".$tod."'"; + + } + if ($agf and $agt != ''){ + + $sql.="and Mast.TotalOrderValue >= '".$agf."' + and Mast.TotalOrderValue <= '".$agt."'"; + + } + $sql.=" group by Mast.PONO"; $query = $this->db->query($sql); return $query->result(); - - - - } + } - function report_openpending(){ - - + function report_openpending($fa,$aa,$m,$frm,$t,$agf,$agt){ $sql="select Mast.PONO as PONO,Mast.POType as POType,date_format(Mast.PODate,'%d-%m-%Y') as PODate,date_format(Mast.ApprovedOn,'%d-%m-%Y') as ApprovedDate,Dept_Details.DepartmentName As Dept_Name,Mast.TotalOrderValue from T_PurchaseOrder_Master Mast JOIN T_PurchaseOrder_LineItem Det on Det.PONO=Mast.PONO @@ -527,9 +596,36 @@ JOIN T_DepartmentDetails Dept_Details on Dept_Details.DEPCode=Emp_Det.Department JOIN T_CostCenter_Master as Cost on Cost.CostCenterCode=Req.CostCenterCode JOIN T_CostCenter_Budget as Cost_Center_Bdgt on Cost.CostCenterCode=Cost_Center_Bdgt.CostCenterCode -where Mast.Status='ST025' or Mast.Status='ST005' -group by PONO,POType,Dept_Name"; +where (Mast.Status='ST025' or Mast.Status='ST005') + "; +if ($fa and $aa != ''){ + + $sql.=" and (Mast.PODate >= '".$fa."-04-01' and Mast.PODate <= '".$aa."-03-31')"; + + } + if ($m!= ''){ + + $sql.="and monthname(Mast.PODate) = '".$m."'"; + + } + + if ($frm and $t != ''){ + $fromd= date("Y-m-d",strtotime($frm)); + $tod=date("Y-m-d",strtotime($t)); + + $sql.="and date(Mast.PODate) >= '".$fromd."' + and date(Mast.PODate) <= '".$tod."'"; + + } + if ($agf and $agt != ''){ + + $sql.="and Mast.TotalOrderValue >= '".$agf."' + and Mast.TotalOrderValue <= '".$agt."'"; + + } + $sql.=" group by PONO,POType,Dept_Name"; $query = $this->db->query($sql); + //echo $sql; return $query->result(); @@ -635,17 +731,28 @@ group by po.SupplierID,pl.MaterialCode"; } - function report_MMReceiptValue(){ + function report_MMReceiptValue($fa,$aa,$m){ $sql="select - DATE_FORMAT(IF(pm.PODate = '0000-00-00', NOW(), pm.PODate), '%b-%Y') AS Month, - matv.MaterialCode,mat.MaterialName,mat.UOM,ROUND(AVG(matv.Rate),2) as Average_Rate - from T_MaterialItem_PO matv - join T_PurchaseOrder_Master pm on pm.CreatedDate = matv.CreatedDate - join T_MaterialMaster mat on matv.MaterialCode=mat.MaterialCode - group by matv.MaterialCode - order by monthname(pm.PODate)"; +DATE_FORMAT(IF(pm.PODate = '0000-00-00', NOW(), pm.PODate), '%b-%Y') AS Month, +matv.MaterialCode,mat.MaterialName,mat.UOM,ROUND(AVG(matv.Rate),2) as Average_Rate +from T_MaterialItem_PO matv +join T_PurchaseOrder_Master pm on pm.CreatedDate = matv.CreatedDate +join T_MaterialMaster mat on matv.MaterialCode=mat.MaterialCode +where pm.PODate != 0 "; +if ($fa and $aa != ''){ + + $sql.=" and (pm.PODate >= '".$fa."-04-01' and pm.PODate <= '".$aa."-03-31')"; + + } + if ($m!= ''){ + + $sql.="and monthname(pm.PODate) = '".$m."'"; + + } + $sql.=" group by matv.MaterialCode"; + $sql.=" order by monthname(pm.PODate)"; $query = $this->db->query($sql); return $query->result(); diff --git a/application/views/Report_Material_Master_ReceiptValue.php b/application/views/Report_Material_Master_ReceiptValue.php index 46c95bad..d7be26f1 100755 --- a/application/views/Report_Material_Master_ReceiptValue.php +++ b/application/views/Report_Material_Master_ReceiptValue.php @@ -28,6 +28,12 @@ if(!empty($mmr)) float: right; } + .btn-success { + background-color: #5d0411; + + border-color: #5d0411; + + } @@ -45,11 +51,145 @@ if(!empty($mmr))
Report - Material Master - Receipt Value
Report - Material Master - Receipt Value
+ input->post('financialyear')){
+
+ $ab=$this->input->post('financialyear');
+
+ echo '('.$ab.')';
+
+ echo ' ';
+
+
+
+ }
+
+ if($this->input->post('month')){
+
+ $m=$this->input->post('month');
+
+ echo '('.$m.')';
+
+ echo ' ';
+
+ }
+ ?>
Order Value - Released
Order Value - Released
+
+
+ input->post('financialyear')){
+
+ $ab=$this->input->post('financialyear');
+
+ echo '('.$ab.')';
+
+ echo ' ';
+
+
+
+ }
+
+ if($this->input->post('month')){
+
+ $m=$this->input->post('month');
+
+ echo '('.$m.')';
+
+ echo ' ';
+
+ }
+
+ if($this->input->post('from_date') && $this->input->post('to_date')){
+
+ $frm = $this->input->post('from_date');
+
+ $t = $this->input->post('to_date');
+
+ echo $frm.'-to-'.$t;
+
+ }
+
+ if($this->input->post('total_order_value_From') && $this->input->post('total_order_value_To')){
+
+ $tfrm = $this->input->post('total_order_value_From');
+
+ $tt = $this->input->post('total_order_value_To');
+
+ echo 'Total Order Value between'.' '.'RS.'.$tfrm.'-to-'.'RS.'.$tt;
+
+ }
+
+ ?>
Open Orders - Pending
Open Orders - Pending
+ input->post('financialyear')){
+
+ $ab=$this->input->post('financialyear');
+
+ echo '('.$ab.')';
+
+ echo ' ';
+
+ }
+
+ if($this->input->post('month')){
+
+ $m=$this->input->post('month');
+
+ echo '('.$m.')';
+
+ echo ' ';
+
+ }
+
+ if($this->input->post('from_date') && $this->input->post('to_date')){
+
+ $frm = $this->input->post('from_date');
+
+ $t = $this->input->post('to_date');
+
+ echo $frm.'-to-'.$t;
+
+ }
+
+ if($this->input->post('total_order_value_From') && $this->input->post('total_order_value_To')){
+
+ $tfrm = $this->input->post('total_order_value_From');
+
+ $tt = $this->input->post('total_order_value_To');
+
+ echo 'Total Order Value between'.' '.'RS.'.$tfrm.'-to-'.'RS.'.$tt;
+
+ }
+ ?>