From d049be389b21ec6b9a1a4632cf58919292b5b352 Mon Sep 17 00:00:00 2001 From: "venbatechnologies@gmail.com" Date: Fri, 2 Feb 2018 14:41:03 +0530 Subject: [PATCH] payroll bank report (cheque no and cheque date) --- application/controllers/payslip.php | 25 ++++++++- application/models/payroll_model.php | 21 ++++++- application/views/bankreport.php | 79 ++++++++++++++++++++++++++- application/views/bankreportprint.php | 15 ++++- 4 files changed, 135 insertions(+), 5 deletions(-) diff --git a/application/controllers/payslip.php b/application/controllers/payslip.php index 569065cf..c96b690b 100755 --- a/application/controllers/payslip.php +++ b/application/controllers/payslip.php @@ -58,6 +58,10 @@ function phpAlert($msg) { { $bank = $this->input->post('bank'); $payon = $this->input->post('month'); + $chequeno = $this->input->post('chequeno'); + $chequedate = date("Y-m-d", strtotime($this->input->post('chequedate'))); + $createdby = $this->session->userdata ( 'userId' ); + $monthsoptions = array("01" => "Jan", "02" => "Feb","03" => "Mar","04" => "Apr","05" => "May","06" => "June","07"=> "July","08"=> "Aug","09" => "Sep","10"=> "Oct","11" => "Nov","12"=>"Dec"); $m = substr($payon,0,2); $y = substr($payon,3); @@ -81,6 +85,12 @@ function phpAlert($msg) { if($this->input->post('Bank_Report')) { $data['result'] = $this->payroll_model->getReportforBank($bank,$payon); + if($chequeno != '' && $chequedate != '') + { + $empcount=count($data['result']); + $cheque = array('ChequeNO'=>$chequeno, 'ChequeDate'=>$chequedate, 'BankName'=>$bank, 'Monthyear'=>$payon, 'Empcount'=>$empcount, 'CreatedBy'=>$createdby); + $data['insertcheque'] = $this->payroll_model->ChequeDetails($cheque); + } //print_r($data['result']);die(); $totamtwords = ''; $totalamt=0.00; @@ -92,7 +102,7 @@ function phpAlert($msg) { } $totamtwords = $this->convertNumber($totalamt); $data['bankdetails']=$this->payroll_model->getBankInfo($bank); - + $data['chequedetails']=$this->payroll_model->getChequeInfo($bank,$payon); $data['Totalamount']=$totalamt; $data['Totalamtwords']=$totamtwords; $data['PayMonth']=$month; @@ -1279,6 +1289,19 @@ $amountInWords = "Rupees " . $result ." Paise ". $points." Only"; //print_r($data['MonthwiseReport']); $this->loadViews("Bonusreportmonthwise", $this->global,$data,NULL); } + function ValidationCheque(){ + + $bank = $this->input->post("id1"); + $payon = $this->input->post("id2"); + + $result = $this->payroll_model->getChequeInfo($bank,$payon); + + $count = count($result); + + echo $count; + + } + } ?> \ No newline at end of file diff --git a/application/models/payroll_model.php b/application/models/payroll_model.php index ae0946ba..ef1b0262 100755 --- a/application/models/payroll_model.php +++ b/application/models/payroll_model.php @@ -430,6 +430,25 @@ class Payroll_model extends CI_Model //print_r($query->result());die(); return $query->result(); - } + } + + function ChequeDetails($cheque){ + $this->db->insert('T_ChequeDetails', $cheque); + } + + function getChequeInfo($bank,$payon) + { + + $sql = "SELECT Cheque.* + FROM T_ChequeDetails Cheque + WHERE Cheque.BankName = ? + AND Cheque.MonthYear = ? "; + + $query = $this->db->query($sql,array($bank,$payon)); + //$query_count = $query->num_rows(); + + //return $query_count; + return $query->result(); + } } ?> \ No newline at end of file diff --git a/application/views/bankreport.php b/application/views/bankreport.php index 67f36313..bc8a7db2 100755 --- a/application/views/bankreport.php +++ b/application/views/bankreport.php @@ -9,11 +9,17 @@ $(function() { $(".select2").select2(); + $( "#chequedate" ).datepicker({ + maxDate :'now', + dateFormat :'dd-mm-yy' + }); $("#bankreport").click(function(){ var bank = $('#bank').val(); var payon = $('#month').val(); + var chequeno = $('#chequeno').val(); + var chequedate = $('#chequedate').val(); var excel = $('#excel').is(":checked"); // alert(excel); @@ -156,6 +162,14 @@ $("#esireport").click(function(){ +
+
+ Cheque No +
+
+ Cheque Date +
+

@@ -172,4 +186,67 @@ $("#esireport").click(function(){ -
\ No newline at end of file + + + \ No newline at end of file diff --git a/application/views/bankreportprint.php b/application/views/bankreportprint.php index 9280d1ae..2de710c6 100755 --- a/application/views/bankreportprint.php +++ b/application/views/bankreportprint.php @@ -31,7 +31,9 @@ Bank_name ; $bankaddress = $b->Address; } + } + + if(!empty($chequedetails)) + { + foreach($chequedetails as $cheque) + { + $ChequeNO = $cheque->ChequeNO ; + $ChequeDate = $cheque->ChequeDate; + } } ?>
@@ -50,7 +61,7 @@

Dear Sir,

Sub: Salary transfer of respective SB a/c through Account Transfer.

-

Please find herewith enclosed a Cheque bearing No: _________________ dated ________________ for /- () Kindly transfer the same to the respective account holders mentioned below

+

Please find herewith enclosed a Cheque bearing No: dated for /- () Kindly transfer the same to the respective account holders mentioned below