bankstatement

This commit is contained in:
gayathri1990 2018-04-02 19:44:19 +05:30
parent 1f1496ab14
commit 612b37baa3
9 changed files with 240 additions and 58 deletions

View File

@ -133,6 +133,9 @@ define('ST063', 'ST063');
define('AMOUNT_PAID', 'ST057');
define('NO_PAID', 'ST058');
define('PARTIALLY_PAID', 'ST059');
define('AMOUNT_RECEIVED', 'ST065');
define('NO_RECEIVED', 'ST066');
define('PARTIALLY_RECEIVED', 'ST067');
/* Work status code */
define('SERVICE_COMPLETED', 'ST046');

View File

@ -221,7 +221,7 @@ class cashbook extends BaseController
$total=$directamount+$alreadypaid;
$ctotal=$directamount+$alreadycreditpaid;
//echo $totalbankamount;
if($amounttype==0)
if($amounttype==CREDIT)
{
$type=RECEIPT;
$bankamounttype=CREDIT;
@ -338,7 +338,7 @@ class cashbook extends BaseController
{
$cashbookstatus = array('Clearbalance'=>$total,'Status'=>$stat);
//print_r($cashbookstatus);
$res = $this->cashbook_model->cashbankupdate($cashbookstatus,$bankid);
$res23 = $this->cashbook_model->cashbankupdate($cashbookstatus,$bankid);
}
@ -608,6 +608,7 @@ class cashbook extends BaseController
$amounttype = $this->input->post('amounttype');
$bankid=$this->input->post('bankid');
$normalid=$this->input->post('normalid');
$bankamount=$this->input->post('bankamount');
$document =null;
//$document1=$this->input->post('myfile');
@ -657,13 +658,20 @@ class cashbook extends BaseController
{
$cashamnt=$ca->total;
}
if($bankamount==$cashamnt)
{
$status='CLOSE';
}
else
{
$status='OPEN';
}
//print_r($invoiceamount);
if($amounttype=='CREDIT')
{
$updatecredit=$invam+$cashamnt;
//print_r($updateamount);
$cashbookstatus1= array('cclearbalance'=>$updatecredit,'cstatus'=>$statu);
$cashbookstatus1= array('cclearbalance'=>$updatecredit,'cstatus'=>$status);
//print_r($cashbookstatus1);
//die();
$res1 = $this->cashbook_model->cashcreditupdate($cashbookstatus1,$bankid);
@ -672,7 +680,7 @@ class cashbook extends BaseController
else
{
$updatedepit=$poamnt+$cashamnt;
$cashbookstatus = array('Clearbalance'=>$updatedepit,'Status'=>$stat);
$cashbookstatus = array('Clearbalance'=>$updatedepit,'Status'=>$status);
// print_r($cashbookstatus);
//die();
$res = $this->cashbook_model->cashbankupdate($cashbookstatus,$bankid);
@ -744,6 +752,8 @@ class cashbook extends BaseController
$bankid= $_GET['d'];
$data['mappingcashbook']=$this->cashbook_model->mappingcash($SupplierName,$fdate,$tdate,$bankid);
$data['mapping'] = $this->cashbook_model->debitpolist($bankid);
$data['paidcbook'] = $this->cashbook_model->cashbookamount($bankid);
$data['paidpoamount'] = $this->cashbook_model->poamonut($bankid);
$data['supplier'] = $this->cashbook_model->getsupplier();
$this->loadViews("banksettlement", $this->global,$data,NULL);
@ -759,6 +769,8 @@ class cashbook extends BaseController
$bankid= $_GET['d'];
$data['mappingcashbook']=$this->cashbook_model->mappingcash($SupplierName,$fdate,$tdate,$bankid);
$data['mappingiv'] = $this->cashbook_model->creditinvoicelist($SupplierName,$fdate,$tdate,$bankid);
$data['paidcbook'] = $this->cashbook_model->cashbookamount($bankid);
$data['invoiceramount'] = $this->cashbook_model->invoiceamonut($bankid);
$data['supplier'] = $this->cashbook_model->getsupplier();
$this->loadViews("bankinvoicesettlement", $this->global,$data,NULL);
@ -1000,6 +1012,17 @@ class cashbook extends BaseController
$result3 = $this->cashbook_model->invoiceupdate1($invoicedata,$invid);
}
if($balancetoreceived1==0)
{
$status=AMOUNT_RECEIVED;
}
else
{
$status=PARTIALLY_RECEIVED;
}
$invoicemaster= array('receivedstatus'=>$status);
$result1 = $this->cashbook_model->invoiceamountstatus($invoicemaster,$invid);
echo "<script>alert('Saved Successfully!');window.location.href='Bankingstatement';</script>";

View File

@ -87,9 +87,9 @@ class cashbook_model extends CI_Model
}
function viewdepartment($sid='')
{
$sql="SELECT ie.*,br.ID,ac.name,ie.id,date_format(ie.date,'%d-%m-%Y')as date FROM t_income_expense ie
join t_accountcode ac on ac.code=ie.account_code
join T_bankreport br on br.ID=ie.bankid
$sql="SELECT ie.*,br.ID,ie.totalbankamount,ac.name,ie.id,date_format(ie.date,'%d-%m-%Y')as date FROM t_income_expense ie
left join t_accountcode ac on ac.code=ie.account_code
left join T_bankreport br on br.ID=ie.bankid
WHERE ie.id = ?";
$query = $this->db->query($sql,array($sid));
//print_r($this->db->last_query());
@ -189,6 +189,7 @@ class cashbook_model extends CI_Model
$this->db->join ('ip_invoices iv','iv.invoice_id = iva.invoice_id','left');
$this->db->join ('ip_clients ic','ic.client_id = iv.client_id','left');
$this->db->join ('T_Bankinvoicereport BI','BI.invoiceno = iva.invoice_id','left');
$this->db->where('iva.receivedstatus !=','ST065');
$this->db->where('ic.client_name',$Customer);
$this->db->or_where('iv.invoice_date_created BETWEEN "'. date('Y-m-d', strtotime($fdate)). '" and "'. date('Y-m-d', strtotime($tdate)).'"');
$this->db->group_by('iva.invoice_id');
@ -223,7 +224,7 @@ function receiptdata()
function debitpolist($bankid)
{
$this->db->select('mid,Podate,PONO,Suppliername,Totalpoamount,
$this->db->select('mid,Podate,PONO,Suppliername,Totalpoamount,
Balancetopay,Amountpaid');
$this->db->from ('T_Bankmappingpo');
$this->db->where('mid',$bankid);
@ -233,9 +234,13 @@ function debitpolist($bankid)
return $query->result();
}
function paidcbook($bankid)
{
}
function creditinvoicelist($SupplierName,$fdate,$tdate,$bankid)
{
$this->db->select('indate,invoiceno,customername,totinvoiceamount,
$this->db->select('indate,invoiceno,customername,totinvoiceamount,bankid as id,
balancetoreceived,amountreceived');
$this->db->from ('T_Bankinvoicereport');
$this->db->where('bankid',$bankid);
@ -433,7 +438,7 @@ function debitlistpo($SupplierName,$fdate,$tdate,$pono)
}
public function cashbankupdate($cashbookstatus,$bankid)
{
echo $bankid;
$this->db->where('ID',$bankid);
$this->db->update('T_bankreport',$cashbookstatus);
return TRUE;
@ -549,6 +554,14 @@ function debitlistpo($SupplierName,$fdate,$tdate,$pono)
$r = $this->db->affected_rows();
return $r;
}
function invoiceamountstatus($invoicemaster,$invid)
{
$this->db->where('invoice_id',$invid);
$this->db->update('ip_invoice_amounts',$invoicemaster);
$r = $this->db->affected_rows();
return $r;
}
// function poamountstatus1($pomaster1,$pono)
// {

View File

@ -1,5 +1,8 @@
<?php //print_r($dropdownvalues);?>
<?php
?>
<script>
@ -13,6 +16,7 @@ $(function() {
$.each(t,function(i,item){
if(item.type == 'RECEIPT')
{
$("#accode").append( $('<option></option>').val(item.code).html(item.name));
}
@ -66,7 +70,8 @@ function isNumberKey(evt)
return true;
}
//$(document).ready(function(id)
//$(document).ready(function()
function loadAccountType(id)
{
//alert('called'+id);
@ -78,13 +83,14 @@ function loadAccountType(id)
if(id == 'myradio1')
{
// alert('INCOME clicked');
//alert('INCOME clicked');
$('#accode').find('option').remove().end().append('<option value="-1">Select Account Name</option>').val('Select Account Code');
$.each(t,function(i,item){
if(item.type == 'RECEIPT')
{
$('#towhom').text('Received From:');
$("#accode").append( $('<option></option>').val(item.code).html(item.name));
}
});
@ -100,6 +106,7 @@ function loadAccountType(id)
$.each(t,function(i,item){
if(item.type == 'PAYMENT')
{
$('#towhom').text('Paid To:');
$("#accode").append( $('<option></option>').val(item.code).html(item.name));
}
});
@ -116,11 +123,32 @@ if(!empty($cashbanking))
//print_r($cashbanking);
foreach($cashbanking as $cb)
{
$amounttype=$cb->amounttype;
}
}
?>
<script>
$(document).ready(function()
{
amounttype= <?php echo json_encode($amounttype)?>;
//alert(amounttype);
if(amounttype=='CREDIT')
{
id='myradio1'
loadAccountType(id);
}
else
{
//alert('debit')
id='myradio2'
loadAccountType(id);
}
});
</script>
<div class="content-wrapper" style="min-height: 537px;">
<!-- Content Header (Page header) -->
<section class="content-header">
@ -351,7 +379,7 @@ if(!empty($cashbanking))
<!-- /.box-body -->
<div class="box-footer" style="text-align:right">
<input type="button" onclick="validate();"class="btn btn-primary" value="Submit" />
<input type="button" onclick="amountcheck();"class="btn btn-primary" value="Submit" />
<input type="reset" class="btn btn-primary" value="Reset" />
</div>
@ -405,8 +433,26 @@ if(!empty($cashbanking))
// $('#towhom').text('Received From:');
// }
// } );
function amountcheck()
{
var bankamount=$('#totalbankamount').val();
var total = $('#totalamount').val();
if(parseFloat(bankamount)>=parseFloat(total))
{
validate();
}
else
{
alert('your mapping amount is large')
}
}
function validate()
{
//var paidcash=$('#totalbankamount').val();
var accode = $('#accode').val();
var date = $('#Date').val();
var towhome = $('#towhome').val();
@ -419,6 +465,7 @@ function validate()
var cgst = $('#CGST').val();
var igst = $('#IGST').val();
var total = $('#totalamount').val();
var errorflag = 0;
@ -510,19 +557,19 @@ function calculateTotal()
$('#totalamount').val((total.toFixed(2)));
}
$('#myradio1').click(function(){
// $('#myradio1').ready(function(){
$('#towhom').ready('Received From:');
// $('#towhom').ready('Received From:');
});
// });
$('#myradio2').ready(function(){
// $('#myradio2').ready(function(){
$('#towhom').text('Paid To:');
// $('#towhom').text('Paid To:');
});
// });
</script>
@ -531,15 +578,3 @@ $('#myradio2').ready(function(){
<script>
// $(document).ready(function() {
// $('#myradio1').click(function(){
// $('#towhom').text('Received From:');
// });
// $('#myradio2').click(function(){
// $('#towhom').text('Paid To:');
// });
// </script>

View File

@ -72,7 +72,7 @@ function checkYearMonthAsEmpty()
<div class="col-md-4">
<div class="box-header">
<input type="file" accept=".xlsx,.png" onchange="readURL(this);" id="userfile" name="userfile" />
<input type="file" accept=".xlsx" onchange="readURL(this);" id="userfile" name="userfile" />
<label for="photo">Select Excel File to upload<br/>(only .xls)</label>
@ -95,10 +95,11 @@ function checkYearMonthAsEmpty()
<script>
function save()
{
var x=checkYearMonthAsEmpty();
var file=$('#userfile').val();
var bank=$('#bankbranchname').val();
//var x=checkYearMonthAsEmpty();
//alert(x);
if(x == 0)
if(file!='' && bank!='')
{
$('form#upload').submit();
@ -107,7 +108,8 @@ var x=checkYearMonthAsEmpty();
}else
}
else
{
alert("Please Provide All Information Correctly!");
return false;

View File

@ -70,11 +70,53 @@ if(!empty($debitmapping))
<!--<center><h3 class="box-title"><p style="color:#3c8dbc"><b>Cashbook Reports</b></p></h3></center>-->
<!--</div>-->
<!-- /.box-header -->
<?php
if(!empty($mappingiv)){
foreach($mappingiv as $ap)
{
$bankid=$ap->id;
}
}
if(!empty($mappingcashbook))
{
foreach($mappingcashbook as $mc)
{
$bankid=$mc->bankid;
}
}
if(!empty($paidcbook)){
foreach($paidcbook as $pc)
{
$pcamount=$pc->total;
}
}
if(!empty($invoiceramount))
{
foreach($invoiceramount as $ia)
{
$inamount=$ia->amountreceived;
}
}
$totalamount=$pcamount+$inamount;
?>
<form method="post" action="<?php echo base_url($this->uri->uri_string()); ?>">
<center><h3 class="box-title"><p style="color:#3c8dbc"><b>Bank Credit Amount Paid Report</b></p></h3></center>
<div class="box-body">
<div style="border-style: solid;width:40%;height:30%;margin-left:30%;font-size:18px;background-color:#ccc;">
<p style="margin-left:10px;"><b>Payment ID:&nbsp;&nbsp;<?php echo $bankid?></b></p>
<p style="margin-left:10px;"><b>Payment Mode:&nbsp;&nbsp;Bank</b></p>
<p style="margin-left:10px;"><b>Payment Amount:&nbsp;&nbsp;<?php echo $totalamount ?></b></p>
</div>
<!--<div class="row">
<div class="col-md-3">

View File

@ -71,11 +71,57 @@ if(!empty($mapping))
<!--</div>-->
<!-- /.box-header -->
<?php
if(!empty($mappingcashbook)){
foreach($mappingcashbook as $mc)
{
$bankid=$mc->bankid;
}
}
if(!empty($mapping)){
foreach($mapping as $ap)
{
$bankid=$ap->mid;
}
}
?>
<?php
if(!empty($paidcbook)){
foreach($paidcbook as $pc)
{
$pcamount=$pc->total;
}
}
if(!empty($paidpoamount)){
foreach($paidpoamount as $pa)
{
$poamount=$pa->amountpaid;
}
}
?>
<?php
$paymentamount=$pcamount+$poamount;
?>
<form method="post" action="<?php echo base_url($this->uri->uri_string()); ?>">
<center><h3 class="box-title"><p style="color:#3c8dbc"><b>Bank Debit Amount Paid Report</b></p></h3></center>
<div class="box-body">
<div style="border-style: solid;width:40%;height:30%;margin-left:30%;font-size:18px;background-color:#ccc;">
<p style="margin-left:10px;"><b>Payment ID:&nbsp;&nbsp;<?php echo $bankid?></b></p>
<p style="margin-left:10px;"><b>Payment Mode:&nbsp;&nbsp;Bank</b></p>
<p style="margin-left:10px;"><b>Payment Amount:&nbsp;&nbsp;<?php echo $paymentamount ?></b></p>
</div>
<!--<div class="row">
<div class="col-md-3">
<label for="from_date">

View File

@ -146,7 +146,7 @@
<div class="row">
<div class="col-md-12" style="padding:0px;">
<div class="col-md-2" style="padding-bottom:10px;">
<select style="height:35px;" name="selectedId" id="selectedId<?php echo $i?>" onchange="checkscreen(<?php echo $type ?>,<?php echo $i ?>);" title="Select Your Option">
<select style="height:35px;" name="selectedId" id="selectedId<?php echo $i?>" onchange="checkscreen();" title="Select Your Option">
<option value="-1" style="color:#FFF;">Select Option</option>
<option value="1">Invoice</option>
<option value="2">Po screen</option>
@ -375,7 +375,7 @@ var tempcredit=[];
var overalltype;
var before='';
var amounttype='';
var bankid='';
var i1='';
var tpaid='';
var debit1='';
var credit1='';
@ -383,7 +383,7 @@ var tcpaid='';
function checkamount(t,i)
{
value=i;
bankid=value;
i1=value;
type= t;
amounttype=type;
var totalpaid= document.getElementById("totalpaid"+value).innerText;
@ -464,24 +464,27 @@ if (x==true)
function checkscreen(t,i)
function checkscreen()
{
$type=t;
var i=i1;
//alert(i);
var avalue= $('#addvalue').val();
//alert(avalue);
localStorage.setItem('test',avalue);
var damount =$('#debit'+i).val();
var e = document.getElementById("selectedId");
var value = e.options[e.selectedIndex].value;
//alert(value+'dd');
var text = e.options[e.selectedIndex].text;
var camount =$('#credit'+i).text();
var text = e.options[e.selectedIndex].text;
var id=document.getElementById ("bankid"+i).innerText;
var date=document.getElementById ("date"+i).innerText;
var debit=document.getElementById ("debit"+i).innerText;
//var camount =document.getElementById ("#credit"+i).innerText;
var RowCount= $('#Rowid').val();
var id=document.getElementById ("bankid"+bankid).innerText;
var date=document.getElementById ("date"+value).innerText;
var debit=document.getElementById ("debit"+value ).innerText;
var idvalue = id+'-'+debit;
var credit=document.getElementById ("credit"+value ).innerText;
//var credit=$('#credit'+i).val();
if(avalue=='')
{
//alert(avalue);
@ -519,14 +522,13 @@ if (x==true)
}
}
else if(value=='3' && (type=='0' ||type=='1'))
else if(value=='3')
{
if(avalue>0)
{
$('#content').loader('show');
$.ajax(
{
$.ajax({
data:{bankdate:date,bankid:id,type:amounttype,bankamount:avalue,forstatus:avalue,alreadypaid:tpaid,alreadycreditpaid:tcpaid,debitamount:debit1,creditamount:credit1},
type:"POST",
url:"<?php echo base_url() ?>Payment",

View File

@ -30,6 +30,7 @@ if(!empty($DepDetails))
$final = base_url().$document;
//echo $final;
// print_r( $DepDetails);die();
$bankamount=$ded->totalbankamount;
$bankid=$ded->ID;
$normalid=$ded->id;
$accountcode1=$ded->account_code;
@ -286,6 +287,7 @@ function loadAccountType(id)
<input type="text" class="form-control required" id="towhome" name="towhome" value="<?php echo $towhom1; ?>">
<input type="hidden" class="form-control read_only" id="id1" name="id1" value="<?php echo $id; ?>">
<input type="hidden" class="form-control read_only" id="accode1" name="accode1" value="<?php echo $accountcode1; ?>">
</div>
@ -397,6 +399,7 @@ function loadAccountType(id)
</div>
<input type="hidden" id="amounttype" name="amounttype" value="<?php echo $amounttype;?>">
<input type="hidden" id="bankid" name="bankid" value="<?php echo $bankid;?>">
<input type="hidden" class="form-control read_only" id="bankamount" name="bankamount" value="<?php echo $bankamount; ?>">
</div>
@ -438,7 +441,7 @@ function loadAccountType(id)
<!-- /.box-body -->
<div class="box-footer" style="text-align:right">
<input type="button" onclick="validate();"class="btn btn-primary" value="update" />
<input type="button" onclick="amountcheck();"class="btn btn-primary" value="update" />
<input type="reset" class="btn btn-primary" value="Reset" />
</div>
@ -480,6 +483,19 @@ function loadAccountType(id)
</div>
<script>
function amountcheck()
{
var bankamount = $('#bankamount').val();
var cashamount = $('#totalamount').val();
if(parseFloat(bankamount)>=parseFloat(cashamount))
{
validate();
}
else
{
alert('Your mapping amount is large');
}
}
function validate()
{