payroll bank report (cheque no and cheque date)
This commit is contained in:
parent
d1821f510c
commit
d049be389b
@ -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;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@ -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();
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -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(){
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-2">
|
||||
<span>Cheque No</span><input type="text" class="form-control" id="chequeno" name="chequeno" readonly/>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<span>Cheque Date</span><input type="text" class="form-control" id="chequedate" name="chequedate" readonly/>
|
||||
</div>
|
||||
</div>
|
||||
<br/>
|
||||
<div class="col-md-4 col-md-offset-6" align = "right">
|
||||
|
||||
@ -172,4 +186,67 @@ $("#esireport").click(function(){
|
||||
|
||||
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
|
||||
$("#bank").change(function(){
|
||||
chequeajaxcall();
|
||||
} );
|
||||
|
||||
$("#month").change(function(){
|
||||
chequeajaxcall();
|
||||
} );
|
||||
|
||||
function chequeajaxcall()
|
||||
{
|
||||
var bank = $('#bank').val();
|
||||
var payon = $('#month').val();
|
||||
var chequeno = $('#chequeno').val();
|
||||
var chequedate = $('#chequedate').val();
|
||||
|
||||
$('#content').loader('show');
|
||||
if(bank != '-1' && payon !='-1')
|
||||
{
|
||||
|
||||
$.ajax({
|
||||
data:{id1:bank,id2:payon},
|
||||
type:"POST",
|
||||
url:"<?php echo base_url();?>payslip/ValidationCheque",
|
||||
success:function(data) {
|
||||
$('#content').loader('hide');
|
||||
|
||||
if(data != 0){
|
||||
alert('Value already exists ! ..');
|
||||
$("#chequeno").val('');
|
||||
$("#chequeno").prop("readonly", true);
|
||||
$("#chequedate").val('');
|
||||
$("#chequedate").prop("readonly", true);
|
||||
|
||||
}else{
|
||||
$("#chequeno").val('');
|
||||
$("#chequeno").prop("readonly", false);
|
||||
$("#chequedate").val('');
|
||||
$("#chequedate").prop("readonly", false);
|
||||
}
|
||||
}//success
|
||||
})//ajax
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
$('#content').loader('hide');
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$(window).bind("pageshow", function() {
|
||||
|
||||
//$('#bank').val('-1');
|
||||
//$('#month').val('-1');
|
||||
|
||||
$('#chequeno').val('');
|
||||
$('#chequedate').val('');
|
||||
});
|
||||
</script>
|
||||
@ -31,7 +31,9 @@
|
||||
|
||||
<?php
|
||||
$bankname = '';
|
||||
$bankaddress = '';
|
||||
$bankaddress = '';
|
||||
$ChequeNO = '';
|
||||
$ChequeDate = '';
|
||||
|
||||
if(!empty($bankdetails))
|
||||
{
|
||||
@ -40,6 +42,15 @@
|
||||
$bankname = $b->Bank_name ;
|
||||
$bankaddress = $b->Address;
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($chequedetails))
|
||||
{
|
||||
foreach($chequedetails as $cheque)
|
||||
{
|
||||
$ChequeNO = $cheque->ChequeNO ;
|
||||
$ChequeDate = $cheque->ChequeDate;
|
||||
}
|
||||
}
|
||||
?>
|
||||
<div class="page" style="font-size:12px;">
|
||||
@ -50,7 +61,7 @@
|
||||
<div>
|
||||
<p>Dear Sir,</p>
|
||||
<p>Sub: Salary transfer of respective SB a/c through Account Transfer.</p>
|
||||
<p>Please find herewith enclosed a Cheque bearing No: _________________ dated ________________ for <b><?php echo number_format($Totalamount,2,'.','');?></b> /- (<b><?php echo $Totalamtwords;?></b>) Kindly transfer the same to the respective account holders mentioned below</p>
|
||||
<p>Please find herewith enclosed a Cheque bearing No: <b><u><?php echo $ChequeNO ?></u></b> dated <b><u><?php echo $ChequeDate ?></u></b> for <b><?php echo number_format($Totalamount,2,'.','');?></b> /- (<b><?php echo $Totalamtwords;?></b>) Kindly transfer the same to the respective account holders mentioned below</p>
|
||||
</div>
|
||||
<table style="border-collapse: collapse;" border="1" width="100%" cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user