bankstatement

This commit is contained in:
gayathri1990 2018-07-06 12:01:17 +05:30
parent d59ee2c796
commit 506c2fa50c
3 changed files with 145 additions and 163 deletions

View File

@ -611,7 +611,8 @@ $prefile =array();
$CreatedBy = $this->session->userdata('userId'); $CreatedBy = $this->session->userdata('userId');
$igrDetails = array('IGRNO'=>$IGRNO,'MaterialCode'=>$MaterialCode,'QuantityAsPerInvoice'=>$QuantityAsPerInvoice,'Remarks'=>$Remarks,'IGRItemStatus'=>$IGRItemStatus,'CreatedBy'=>$CreatedBy,'CreatedDate'=>$createddt); $bankstatus = NO_PAIDIGR;
$igrDetails = array('IGRNO'=>$IGRNO,'MaterialCode'=>$MaterialCode,'QuantityAsPerInvoice'=>$QuantityAsPerInvoice,'Remarks'=>$Remarks,'IGRItemStatus'=>$IGRItemStatus,'CreatedBy'=>$CreatedBy,'CreatedDate'=>$createddt,'BankStatus'=>$bankstatus);
$igrD = $this->inwardgateregister_model->addigrD($igrDetails); $igrD = $this->inwardgateregister_model->addigrD($igrDetails);

View File

@ -373,7 +373,7 @@ function debitpolist($bankid)
bp.Balancetopay,bp.Amountpaid,bp.IGRNO,bp.IGRLineItemNo,igrm.file,bu.FilePath'); bp.Balancetopay,bp.Amountpaid,bp.IGRNO,bp.IGRLineItemNo,igrm.file,bu.FilePath');
$this->db->from ('T_Bankmappingpo bp'); $this->db->from ('T_Bankmappingpo bp');
$this->db->join ('T_IGR_Master igrm','bp.IGRNO = igrm.IGRNO','left'); $this->db->join ('T_IGR_Master igrm','bp.IGRNO = igrm.IGRNO','left');
$this->db->join ('T_PurchaseOrder_BillUpload bu','bu.PONO = bp.PONO'); $this->db->join ('T_PurchaseOrder_BillUpload bu','bu.PONO = bp.PONO','left');
$this->db->where('bp.IsActive',1); $this->db->where('bp.IsActive',1);
$this->db->where('bp.mid',$bankid); $this->db->where('bp.mid',$bankid);
// $this->db->where('igrde.BankStatus !=','ST072'); // $this->db->where('igrde.BankStatus !=','ST072');
@ -402,13 +402,13 @@ function debitpolist($bankid)
function debitpolistfilter($SupplierName,$fdate,$tdate) function debitpolistfilter($SupplierName,$fdate,$tdate)
{ {
$this->db->select('bm.id,bm.mid,igrm.MaterialRcvdDate,bm.PONO,bm.Suppliername,bm.Totalpoamount, $this->db->select('bm.id,bm.mid,igrm.MaterialRcvdDate,bm.PONO,bm.Suppliername,bm.Totalpoamount,
bm.Balancetopay,bm.Amountpaid,bm.IGRNO,igrm.file,bm.IGRLineItemNo,br.Clearbalance,br.Balancetocleared,bu.FilePath,bu.BillNo,bu.IGRNO'); bm.Balancetopay,bm.Amountpaid,bm.IGRNO,igrm.file,bm.IGRLineItemNo,br.Clearbalance,br.Balancetocleared,bu.FilePath,bu.BillNo');
$this->db->from ('T_Bankmappingpo bm'); $this->db->from ('T_Bankmappingpo bm');
$this->db->join ('T_IGR_Master igrm','igrm.IGRNO = bm.IGRNO'); $this->db->join ('T_IGR_Master igrm','igrm.IGRNO = bm.IGRNO');
//$this->db->join ('T_IGR_Details igrde','igrde.IGRNO=igrm.IGRNO'); //$this->db->join ('T_IGR_Details igrde','igrde.IGRNO=igrm.IGRNO');
$this->db->join ('T_SupplierDetailsN sd','sd.SupplierName = bm.Suppliername'); $this->db->join ('T_SupplierDetailsN sd','sd.SupplierName = bm.Suppliername');
$this->db->join ('T_bankreport br','br.ID=bm.mid'); $this->db->join ('T_bankreport br','br.ID=bm.mid');
$this->db->join ('T_PurchaseOrder_BillUpload bu','bm.PONO=bu.PONO'); $this->db->join ('T_PurchaseOrder_BillUpload bu','bm.PONO=bu.PONO','left');
if($fdate!='' && $tdate!='') if($fdate!='' && $tdate!='')
{ {
$this->db->where('bm.Podate BETWEEN "'. date('Y-m-d', strtotime($fdate)). '" and "'. date('Y-m-d', strtotime($tdate)).'"'); $this->db->where('bm.Podate BETWEEN "'. date('Y-m-d', strtotime($fdate)). '" and "'. date('Y-m-d', strtotime($tdate)).'"');
@ -419,7 +419,7 @@ function debitpolist($bankid)
} }
$this->db->where('bm.IsActive',1);; $this->db->where('bm.IsActive',1);;
$this->db->group_by('bm.IGRLineItemNo'); $this->db->group_by('bm.id');
$query = $this->db->get(); $query = $this->db->get();
return $query->result(); return $query->result();

View File

@ -46,11 +46,11 @@ foreach($financialyear as $item)
<thead> <thead>
<tr> <tr>
<th>Payment ID</th> <th style="text-align:center">Payment ID</th>
<th>Payment Mode</th> <th style="text-align:center">Payment Mode</th>
<th>Payment Amount (&#8377;)</th> <th style="text-align:center">Payment Amount (&#8377;)</th>
<th>Payment date </th> <th style="text-align:center">Payment date </th>
<th>Narration </th> <th style="text-align:center">Narration </th>
</tr> </tr>
@ -58,10 +58,10 @@ foreach($financialyear as $item)
<tbody> <tbody>
<tr> <tr>
<td><p style="margin-left:25px;" id="bid"></p></td> <td><p style="margin-left:25px;" id="bid"></p></td>
<td>Bank</td> <td style="text-align:center">Bank</td>
<td><p style="margin-left:25px;" id="bamount" ></p></td> <td><p style="text-align:center" id="bamount" ></p></td>
<td><p style="margin-left:25px;" id="bdate"></p></td> <td><p style="margin-left:25px;" id="bdate"></p></td>
<td><p style="margin-left:25px;" id="narration"></p></td> <td><p style="text-align:center" id="narration"></p></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -229,25 +229,37 @@ foreach($financialyear as $item)
</div><!-- /.col --> </div><!-- /.col -->
<div class="row"> <div class="row">
<div class="col-md-12" id="HideDateDiv"></div> <div class="row">
<div class="col-md-12" id="date1"></div>
<div class="col-md-12" id="HidePONODiv"></div> <div class="col-md-12" id="purchaseono"></div>
<div class="col-md-12" id="HideIGRDiv"></div> <div class="col-md-12" id="HideIGRDiv"></div>
<div class="col-md-12" id="HideIGRLineItem"></div> <div class="col-md-12" id="hideigrline"></div>
<div class="col-md-12" id="HideSuppDiv"></div> <div class="col-md-12" id="supname"></div>
<div class="col-md-12" id="aa1"></div> <div class="col-md-12" id="aa1"></div>
<div class="col-md-12" id="HideTtlPoAmtDiv"></div> <!--<div class="col-md-12" id="aa2"></div>-->
<div class="col-md-12" id="HideAmtPaidDiv"></div> <div class="col-md-12" id="ttamnt"></div>
<div class="col-md-12" id="totala"></div>
<!--<input type="text" name="qw1" id="qw1">-->
<input type="hidden" name="Recid" id="Recid" value="">
<!-- <input type="hidden" name="bankid" id="bankid" value="">-->
<input type="hidden" name="bankamount" id="bankamount" value="">
<input type="hidden" name="Recid" id="Recid" value="" readonly>
<input type="hidden" name="bankamount" id="bankamount" value="" readonly>
</div> </div>
</section> </section>
@ -268,12 +280,15 @@ foreach($financialyear as $item)
var res=localStorage.getItem('test1'); var res=localStorage.getItem('test1');
var amount=localStorage.getItem('test'); var amount=localStorage.getItem('test');
var debamount=localStorage.getItem('damount'); var debamount=localStorage.getItem('damount');
var cashdate=localStorage.getItem('cddate');
var narration= localStorage.getItem('narr');
$('#debitamount').val(localStorage.getItem('test')); $('#debitamount').val(localStorage.getItem('test'));
//$('#bamount').val(localStorage.getItem('test'));
document.getElementById("bamount").innerHTML='Payment Amount:'+amount; document.getElementById("bamount").innerHTML=amount;
//document.getElementById("debit1amount").innerHTML='Total Amount:'+debamount; document.getElementById("bdate").innerHTML=cashdate;
//alert(res.length); document.getElementById("narration").innerHTML=narration;
//alert(localStorage.getItem('test1'));
// alert(document.getElementById("bdate").innerHTML='Payment date:'+cashdate);
var res1 = res.split(','); var res1 = res.split(',');
var i; var i;
$.each(res1, function( index, value ) $.each(res1, function( index, value )
@ -374,13 +389,15 @@ function GetPayment(i)
var date= document.getElementById ( "date"+i ).innerText; var date= document.getElementById ( "date"+i ).innerText;
var pono =document.getElementById ( "pono"+i ).innerText; var pono =document.getElementById ( "pono"+i ).innerText;
var poamount =document.getElementById ( "qw"+i ).innerText; var poamount =document.getElementById ( "qw"+i ).innerText;
var igrno =document.getElementById ( "igrno"+i ).innerText; var igrno =document.getElementById ( "igrno"+i ).innerText;
var igrlineitem=document.getElementById ( "igrlineitem"+i ).innerText; var igrlineitem=document.getElementById ( "igrlineitem"+i ).innerText;
var tta= $('#totala').val(); var tta= $('#totala').val();
var tempid = "debited"+value; var tempid = "debited"+value;
//var credit=parseFloat(document.getElementById(tempid).innerText);
var t ="totala"+value; var t ="totala"+value;
var poamount1 =$(t).val(); var poamount1 =$(t).val();
var ponovalue = pono+','+poamount; //alert(poamount1+'amt');
var ponovalue = igrlineitem+','+poamount;
temppo.push(ponovalue); temppo.push(ponovalue);
console.log(temppo); console.log(temppo);
var total=0; var total=0;
@ -405,53 +422,53 @@ function GetPayment(i)
$('<input>').attr({ $('<input>').attr({
type:'hidden', type:'hidden',
name:'hidedate'+i, name:'date1'+j,
id:'hidedate'+i, id:'date1'+j,
value:date value:date
}).appendTo('#HideDateDiv'); }).appendTo('#date1');
$('<input>').attr({ $('<input>').attr({
type:'hidden', type:'hidden',
name:'hidepono'+i, name:'purchaseono'+j,
id:'hidepono'+i, id:'purchaseono'+j,
value:pono value:pono
}).appendTo('#HidePONODiv'); }).appendTo('#purchaseono');
$('<input>').attr({ $('<input>').attr({
type:'hidden', type:'hidden',
name:'hideigrno'+i, name:'hideigrno'+j,
id:'hideigrno'+i, id:'hideigrno'+j,
value:igrno value:igrno
}).appendTo('#HideIGRDiv'); }).appendTo('#HideIGRDiv');
$('<input>').attr({ $('<input>').attr({
type:'hidden', type:'hidden',
name:'hideigrline'+i, name:'hideigrline'+j,
id:'hideigrline'+i, id:'hideigrline'+j,
value:igrlineitem value:igrlineitem
}).appendTo('#HideIGRLineItem'); }).appendTo('#hideigrline');
$('<input>').attr({ $('<input>').attr({
type:'hidden', type:'hidden',
name:'hidesupname'+i, name:'supname'+j,
id:'hidesupname'+i, id:'supname'+j,
value:supname value:supname
}).appendTo('#HideSuppDiv'); }).appendTo('#supname');
$('<input>').attr({ $('<input>').attr({
type:'hidden', type:'hidden',
name:'hidettlPoamt'+i, name:'totala'+j,
id:'hidettlPoamt'+i, id:'totala'+j,
value:totalordervalue
}).appendTo('#HideTtlPoAmtDiv');
$('<input>').attr({
type:'hidden',
name:'hideamtpaid'+i,
id:'hideamtpaid'+i,
value:invoicepayment value:invoicepayment
}).appendTo('#HideAmtPaidDiv'); }).appendTo('#totala');
$('<input>').attr({
type:'hidden',
name:'ttamnt'+j,
id:'ttamnt'+j,
value:totalordervalue
}).appendTo('#ttamnt');
intex = parseInt(intex)+1; intex = parseInt(intex)+1;
@ -491,7 +508,7 @@ else
var Payment= parseFloat( $('#invoicepaymet'+i).val() == '' ? '0.00' : $('#invoicepaymet'+i).val()); var Payment= parseFloat( $('#invoicepaymet'+i).val() == '' ? '0.00' : $('#invoicepaymet'+i).val());
var Inid = document.getElementById ('pono'+i ).innerText var Inid = document.getElementById ('igrlineitem'+i ).innerText
var ponovalue = Inid+','+Payment; var ponovalue = Inid+','+Payment;
var a = temppo.indexOf(ponovalue); var a = temppo.indexOf(ponovalue);
//console.log(a); //console.log(a);
@ -504,8 +521,7 @@ else
for(s=1;s<=j;s++) for(s=1;s<=j;s++)
{ {
// alert(j+'else'); // alert(j+'else');
var ch= $('#purchaseono'+s).val(); var ch= $('#hideigrline'+s).val();
//alert(ch);
if(Inid==ch) if(Inid==ch)
{ {
@ -530,39 +546,18 @@ else
$('#Rowid').val(ro); $('#Rowid').val(ro);
//$('#addvalue').val(''); //$('#addvalue').val('');
$('#invoicepaymet'+i).val(''); $('#invoicepaymet'+i).val('');
$('#invoicepaymet'+i).val('');
$('#hidedate'+i).val('');
$('#hidepono'+i).val('');
$('#hideigrno'+i).val('');
$('#hideigrline'+i).val(''); $('#hideigrline'+i).val('');
$('#hidesupname'+i).val(''); $('#date1'+i).val('');
$('#hidettlPoamt'+i).val(''); $('#purchaseono'+i).val('');
$('#hideamtpaid'+i).val(''); $('#supname'+i).val('');
$('#ttamnt'+i).val('');
//$('#invoicepaymet'+i).remove(); $('#totala'+i).val('');
$('#hidedate'+i).remove(); //$('#aa'+i).val('');
$('#hidepono'+i).remove();
$('#hideigrno'+i).remove();
$('#hideigrline'+i).remove();
$('#hidesupname'+i).remove();
$('#hidettlPoamt'+i).remove();
$('#hideamtpaid'+i).remove();
} }
} }
function isNumberKey(evt)
{
var charCode = (evt.which) ? evt.which : evt.keyCode;
// Added to allow decimal, period, or delete
if (charCode == 110 || charCode == 190 || charCode == 46)
return true;
if (charCode > 31 && (charCode < 48 || charCode > 57))
return false;
return true;
}
function GetAmount(i) function GetAmount(i)
{ {
//alert('text'); //alert('text');
@ -585,17 +580,18 @@ function GetAmount(i)
var pono =document.getElementById ( "pono"+i ).innerText; var pono =document.getElementById ( "pono"+i ).innerText;
var igr =document.getElementById ( "igrno"+i ).innerText; var igr =document.getElementById ( "igrno"+i ).innerText;
var igrlineitem=document.getElementById ( "igrlineitem"+i ).innerText; var igrlineitem=document.getElementById ( "igrlineitem"+i ).innerText;
var supname =document.getElementById ("sn"+i ).innerText; var supname =document.getElementById ("sn"+i ).innerText;
var totalordervalue =document.getElementById ("tov"+i ).innerText; var totalordervalue =document.getElementById ("tov"+i ).innerText;
var balancetopay =document.getElementById ( "qw"+i ).innerText; var balancetopay=document.getElementById ( "qw"+i ).innerText;
for(k=1;k<=j-1;k++) for(k=1;k<=j-1;k++)
{ {
//alert(k) //alert(k)
var idcheck=$('#igrlineitem'+k).val(); var idcheck=$('#hideigrline'+k).val();
// alert(idcheck) // alert(idcheck)
if(pono==idcheck) if(igrlineitem==idcheck)
{ {
var cid=k; var cid=k;
//alert(cid+'if'); //alert(cid+'if');
@ -611,7 +607,7 @@ function GetAmount(i)
{ {
//alert(cid+'cid'); //alert(cid+'cid');
$('#date1').val(date); $('#date1').val(date);
$('#purchaseono'+cid).val(pono); $('#hideigrline'+cid).val(igrlineitem);
$('#supname'+cid).val(supname); $('#supname'+cid).val(supname);
$('#ttamnt'+cid).val(totalordervalue); $('#ttamnt'+cid).val(totalordervalue);
$('#totala'+cid).val(amount); $('#totala'+cid).val(amount);
@ -631,10 +627,9 @@ function GetAmount(i)
var tot11=0 var tot11=0
for(l=1;l<j;l++) for(l=1;l<j;l++)
{ {
var Payingamount=parseFloat( $('#invoicepaymet'+l).val() == '' ? '0.00' : $('#invoicepaymet'+l).val()); alert('hai');
//alert(Payingamount); var Payingamount=parseFloat( $('#totala'+l).val() == '' ? '0.00' : $('#totala'+l).val());
tot11= parseFloat(tot11)+parseFloat(Payingamount); tot11= parseFloat(tot11)+parseFloat(Payingamount);
//alert(tot11);
$('#addvalue').val(parseFloat(tot11).toFixed(2)); $('#addvalue').val(parseFloat(tot11).toFixed(2));
} }
@ -645,6 +640,7 @@ function GetAmount(i)
} }
// else // else
// { // {
// //document.getElementById('checkboxcheckbox'+i).checked = false; // //document.getElementById('checkboxcheckbox'+i).checked = false;
@ -654,7 +650,8 @@ function GetAmount(i)
} }
function Save() function Save()
{ {
$('#content').loader('show'); $('#content').loader('show');
var rowCount= $('#Rowid').val(); var rowCount= $('#Rowid').val();
@ -667,92 +664,74 @@ function Save()
check = parseFloat(check)+1; check = parseFloat(check)+1;
var bankdebitamount=$('#debitamount').val(); var bankdebitamount=$('#debitamount').val();
var bid =$('#bankid').val(); var bid=$('#bankid').val();
var date =$('#date1'+i).val();
var date =$('#hidedate'+i).val(); var pono =$('#purchaseono'+i).val();
var pono =$('#hidepono'+i).val();
var igrno =$('#hideigrno'+i).val(); var igrno =$('#hideigrno'+i).val();
var igrlineitem =$('#hideigrline'+i).val(); var igrlineitem =$('#hideigrline'+i).val();
var suppliername=$('#supname'+i).val();
//alert(suppliername);
var suppliername=$('#hidesupname'+i).val(); var totalordervalue=$('#ttamnt'+i).val();
var amountpaid=$('#totala'+i).val();
var totalordervalue=$('#hidettlPoamt'+i).val(); //alert(amountpaid+'qw1');
var invoicepaymet=$('#invoicepaymet'+i).text();
var amountpaid=$('#invoicepaymet'+i).val(); // alert(invoicepaymet);
var invoicepaymet=$('#invoicepaymet'+i).val();
var totalvalue=$('#addvalue').val(); var totalvalue=$('#addvalue').val();
//alert(totalvalue);
if(totalvalue!=0)
{
var payment = parseFloat(amountpaid); var payment = parseFloat(amountpaid);
var balnceamount=bankdebitamount-totalvalue; var balnceamount=bankdebitamount-totalvalue;
if(parseFloat(bankdebitamount)>=parseFloat(totalvalue)) if(parseFloat(bankdebitamount)>=parseFloat(totalvalue))
{ {
//alert(date+'date');
$.ajax( //die();
{ //alert('you have remainining'+balnceamount);
data:{podate:date,pono:pono,igrno:igrno,igrlineitem:igrlineitem,sname:suppliername,tot:totalordervalue,aa:amountpaid,ip:invoicepaymet,rc:rowCount,tpv:totalvalue,bda:bankdebitamount,bi:bid,check:check,rw:rw}, $.ajax(
type:"POST", {
url:"<?php echo base_url() ?>cashbook/receipt", data:{podate:date,pono:pono,igrno:igrno,igrlineitem:igrlineitem,sname:suppliername,tot:totalordervalue,aa:amountpaid,ip:invoicepaymet,rc:rowCount,tpv:totalvalue,bda:bankdebitamount,bi:bid,check:check,rw:rw},
success:function(data) type:"POST",
{ url:"<?php echo base_url() ?>cashbook/receipt",
success:function(data)
{
if(data)
{
window.location.href ="Bankingstatement";
//location.reload();
if(data) }
{ }
});
window.location.href ="Bankingstatement";
//location.reload();
}
}
});
} }
}
else{ else{
alert('Your payment exceeding '); alert('You are payment exceeding');
location.reload(); location.reload();
} }
} }
// alert('i'+i); }
// if(rowCount<=i)
// {
// if(data)
// {
// alert(data);
// location.reload();
// }
// else
// {
//alert("Error");
// }
// }
// }
// });
// alert(i);
// }
// else{
// alert('You are payment exceeding');
// location.reload();
// }
// j=j+1;
}
function isNumberKey(evt)
{
var charCode = (evt.which) ? evt.which : evt.keyCode;
// Added to allow decimal, period, or delete
if (charCode == 110 || charCode == 190 || charCode == 46)
return true;
if (charCode > 31 && (charCode < 48 || charCode > 57))
return false;
return true;
}
</script> </script>
<script> <script>
@ -794,3 +773,5 @@ $( function() {
} }
} ); } );
</script> </script>