diff --git a/application/controllers/inwardgateregister.php b/application/controllers/inwardgateregister.php index e39bcfe0..014915f6 100644 --- a/application/controllers/inwardgateregister.php +++ b/application/controllers/inwardgateregister.php @@ -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); diff --git a/application/models/cashbook_model.php b/application/models/cashbook_model.php index 8b43d265..322c5ef7 100755 --- a/application/models/cashbook_model.php +++ b/application/models/cashbook_model.php @@ -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(); diff --git a/application/views/bankdebit.php b/application/views/bankdebit.php index f263116b..13e8dfc0 100644 --- a/application/views/bankdebit.php +++ b/application/views/bankdebit.php @@ -46,11 +46,11 @@ foreach($financialyear as $item) - Payment ID - Payment Mode - Payment Amount (₹) - Payment date - Narration + Payment ID + Payment Mode + Payment Amount (₹) + Payment date + Narration @@ -58,10 +58,10 @@ foreach($financialyear as $item)

- Bank -

+ Bank +

-

+

@@ -229,25 +229,37 @@ foreach($financialyear as $item)
-
+
+
-
+
-
+
-
+
-
+
-
+ -
+
+ +
+ + + + + + + + + + + - - - +
@@ -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) $('').attr({ type:'hidden', - name:'hidedate'+i, - id:'hidedate'+i, + name:'date1'+j, + id:'date1'+j, value:date - }).appendTo('#HideDateDiv'); + }).appendTo('#date1'); $('').attr({ type:'hidden', - name:'hidepono'+i, - id:'hidepono'+i, + name:'purchaseono'+j, + id:'purchaseono'+j, value:pono - }).appendTo('#HidePONODiv'); + }).appendTo('#purchaseono'); $('').attr({ type:'hidden', - name:'hideigrno'+i, - id:'hideigrno'+i, + name:'hideigrno'+j, + id:'hideigrno'+j, value:igrno }).appendTo('#HideIGRDiv'); $('').attr({ type:'hidden', - name:'hideigrline'+i, - id:'hideigrline'+i, + name:'hideigrline'+j, + id:'hideigrline'+j, value:igrlineitem - }).appendTo('#HideIGRLineItem'); + }).appendTo('#hideigrline'); $('').attr({ type:'hidden', - name:'hidesupname'+i, - id:'hidesupname'+i, + name:'supname'+j, + id:'supname'+j, value:supname - }).appendTo('#HideSuppDiv'); + }).appendTo('#supname'); $('').attr({ type:'hidden', - name:'hidettlPoamt'+i, - id:'hidettlPoamt'+i, - value:totalordervalue - }).appendTo('#HideTtlPoAmtDiv'); - - $('').attr({ - type:'hidden', - name:'hideamtpaid'+i, - id:'hideamtpaid'+i, + name:'totala'+j, + id:'totala'+j, value:invoicepayment - }).appendTo('#HideAmtPaidDiv'); + }).appendTo('#totala'); + + $('').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=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:"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:"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; +} + +