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');
$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);

View File

@ -373,7 +373,7 @@ function debitpolist($bankid)
bp.Balancetopay,bp.Amountpaid,bp.IGRNO,bp.IGRLineItemNo,igrm.file,bu.FilePath');
$this->db->from ('T_Bankmappingpo bp');
$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.mid',$bankid);
// $this->db->where('igrde.BankStatus !=','ST072');
@ -402,13 +402,13 @@ function debitpolist($bankid)
function debitpolistfilter($SupplierName,$fdate,$tdate)
{
$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->join ('T_IGR_Master igrm','igrm.IGRNO = bm.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_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!='')
{
$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->group_by('bm.IGRLineItemNo');
$this->db->group_by('bm.id');
$query = $this->db->get();
return $query->result();

View File

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