From 1b9ae29251e574b5fc1bff8ca338670527cb19cf Mon Sep 17 00:00:00 2001 From: gayathri1990 Date: Sat, 12 May 2018 12:32:02 +0530 Subject: [PATCH] bankstatement file downloading option --- application/controllers/cashbook.php | 2 + application/logs/log-2018-05-12.php | 7 +++ application/models/cashbook_model.php | 54 ++++++++----------- .../views/Report_consolidate_inward.php | 6 +-- application/views/bankdebit.php | 24 ++++----- application/views/bankinvoice.php | 1 + application/views/banksettlement.php | 24 +++++++-- 7 files changed, 67 insertions(+), 51 deletions(-) create mode 100644 application/logs/log-2018-05-12.php diff --git a/application/controllers/cashbook.php b/application/controllers/cashbook.php index 00314ee4..37e495e0 100755 --- a/application/controllers/cashbook.php +++ b/application/controllers/cashbook.php @@ -1103,6 +1103,8 @@ class cashbook extends BaseController $status=PARTIALLY_RECEIVED; } $invoicemaster= array('receivedstatus'=>$status); + print_r($invoicemaster); + //die(); $result1 = $this->cashbook_model->invoiceamountstatus($invoicemaster,$invid); echo ""; diff --git a/application/logs/log-2018-05-12.php b/application/logs/log-2018-05-12.php new file mode 100644 index 00000000..ce6aa65f --- /dev/null +++ b/application/logs/log-2018-05-12.php @@ -0,0 +1,7 @@ + + +ERROR - 2018-05-12 08:49:52 --> Severity: Notice --> Undefined variable: balancetoreceived C:\xampp\htdocs\siddharth_application\application\controllers\cashbook.php 1038 +ERROR - 2018-05-12 08:49:52 --> Severity: Notice --> Undefined variable: clearedblnce C:\xampp\htdocs\siddharth_application\application\controllers\cashbook.php 1049 +ERROR - 2018-05-12 08:49:52 --> Severity: Notice --> Undefined variable: balancetoreceived C:\xampp\htdocs\siddharth_application\application\controllers\cashbook.php 1049 +ERROR - 2018-05-12 08:49:53 --> Query error: Unknown column 'receivedstatus' in 'field list' +ERROR - 2018-05-12 08:49:54 --> Query error: Unknown column 'receivedstatus' in 'field list' diff --git a/application/models/cashbook_model.php b/application/models/cashbook_model.php index 6da31567..e9757045 100755 --- a/application/models/cashbook_model.php +++ b/application/models/cashbook_model.php @@ -235,17 +235,19 @@ function bankstatement($fdate,$tdate,$fa,$aa){ } function bankinvoice($Customer,$fdate,$tdate) { - + // $status='ST065'; $this->db->distinct(); $this->db->select('iva.invoice_id,iva.invoice_total,iv.invoice_date_created,iv.invoice_number,iva.invoice_paid,ic.client_name,BI.balancetoreceived,BI.amountreceived'); $this->db->from ('ip_invoice_amounts iva'); - $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 = iv.invoice_number','left'); - $this->db->where_in('iv.invoice_status_id','2'); - $this->db->where('iva.receivedstatus !=','ST065'); - $this->db->where('iv.invoice_date_created BETWEEN "'. date('Y-m-d', strtotime($fdate)). '" and "'. date('Y-m-d', strtotime($tdate)).'"'); - $this->db->or_where('ic.client_id',$Customer); + $this->db->join ('ip_invoices iv','iva.invoice_id = iv.invoice_id'); + $this->db->join ('ip_clients ic','iv.client_id = ic.client_id','left'); + $this->db->join ('T_Bankinvoicereport BI',' iv.invoice_number =BI.invoiceno','left'); + //$this->db->where('iva.receivedstatus !=','ST065'); + $this->db->where('iv.invoice_status_id','2'); + $this->db->where('iv.receivedstatus !=','ST065'); + $this->db->where('ic.client_id',$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'); //$this->db->where('inc.type','PAYMENT'); @@ -280,9 +282,10 @@ function receiptdata() function debitpolist($bankid) { - $this->db->select('mid,Podate,PONO,Suppliername,Totalpoamount, - Balancetopay,Amountpaid'); - $this->db->from ('T_Bankmappingpo'); + $this->db->select('bp.mid,bp.Podate,bp.PONO,bp.Suppliername,bp.Totalpoamount, + bp.Balancetopay,bp.Amountpaid,bu.FilePath'); + $this->db->from ('T_Bankmappingpo bp'); + $this->db->join ('T_PurchaseOrder_BillUpload bu','bu.PONO = bp.PONO','left'); $this->db->where('mid',$bankid); //$this->db->group_by('PONO'); $query = $this->db->get(); @@ -373,18 +376,6 @@ function debitpolist($bankid) return $query->result(); } -// function mappingcash($SupplierName,$fdate,$tdate,$bankid) - // { - // $this->db->select('mid,btype,amount,boption,ie.total,ie.account_code,ie.date'); - // $this->db->from ('T_Bankmappingcashbook bmc'); - // $this->db->join ('t_income_expense ie','ie.bankid = bmc.mid','left'); - // $this->db->where('mid',$bankid); - - // $this->db->group_by('mid'); - // $query = $this->db->get(); - // return $query->result(); - - // } function mappingcash($SupplierName,$fdate,$tdate,$bankid) { @@ -398,8 +389,8 @@ function debitpolist($bankid) return $query->result(); } -function newcashbook() -{ + function newcashbook() + { $this->db->select('cdate,mid,btype,amount,boption,mappingamount,totalamount,amounttype,alreadycreditpaid'); $this->db->from ('T_Bankmappingcashbook'); //$this->db->where('mid',$bankid); @@ -408,10 +399,10 @@ function newcashbook() $query = $this->db->get(); return $query->result(); -} + } -function debitlistpo($SupplierName,$fdate,$tdate,$pono) - { + function debitlistpo($SupplierName,$fdate,$tdate,$pono) + { $this->db->select('bmp.mid,bmp.PONO,bmp.Amountpaid,br.Narration'); $this->db->from ('T_Bankmappingpo as bmp'); $this->db->join('T_bankreport br','br.ID = bmp.mid'); @@ -420,7 +411,7 @@ function debitlistpo($SupplierName,$fdate,$tdate,$pono) $query = $this->db->get(); return $query->result(); - } + } function creditlistinv($invno) { @@ -668,8 +659,9 @@ function debitlistpo($SupplierName,$fdate,$tdate,$pono) } function invoiceamountstatus($invoicemaster,$invid) { - $this->db->where('invoice_id',$invid); - $this->db->update('ip_invoice_amounts',$invoicemaster); + echo $invoicemaster; + $this->db->where('invoice_number',$invid); + $this->db->update('ip_invoices',$invoicemaster); $r = $this->db->affected_rows(); return $r; diff --git a/application/views/Report_consolidate_inward.php b/application/views/Report_consolidate_inward.php index 30b94636..1dfbd8ce 100755 --- a/application/views/Report_consolidate_inward.php +++ b/application/views/Report_consolidate_inward.php @@ -739,9 +739,9 @@ $(document).ready(function() { 'colvis' ], - columns:[ - { id:"col1", width:2 } -] + // columns:[ + // { id:"col1", width:2 } +// ] } ); } ); diff --git a/application/views/bankdebit.php b/application/views/bankdebit.php index d771a71f..6a5a2a25 100644 --- a/application/views/bankdebit.php +++ b/application/views/bankdebit.php @@ -411,11 +411,13 @@ 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 tta= $('#totala').val(); + //alert(tta+'tta'); var tempid = "debited"+value; //var credit=parseFloat(document.getElementById(tempid).innerText); - var t = '#invoicepaymet'+i; + var t ="totala"+value; var poamount1 =$(t).val(); - alert(poamount1+'amt'); + //alert(poamount1+'amt'); var ponovalue = pono+','+poamount; temppo.push(ponovalue); console.log(temppo); @@ -440,28 +442,28 @@ function GetPayment(i) var RowCount= $('#Rowid').val(); $('').attr({ - type:'text', + type:'hidden', name:'date1'+j, id:'date1'+j, value:date }).appendTo('#date1'); $('').attr({ - type:'text', + type:'hidden', name:'purchaseono'+j, id:'purchaseono'+j, value:pono }).appendTo('#purchaseono'); $('').attr({ - type:'text', + type:'hidden', name:'supname'+j, id:'supname'+j, value:supname }).appendTo('#supname'); $('').attr({ - type:'text', + type:'hidden', name:'totala'+j, id:'totala'+j, value:invoicepayment @@ -469,7 +471,7 @@ function GetPayment(i) $('').attr({ - type:'text', + type:'hidden', name:'ttamnt'+j, id:'ttamnt'+j, value:totalordervalue @@ -513,11 +515,9 @@ else var Payment= parseFloat( $('#invoicepaymet'+i).val() == '' ? '0.00' : $('#invoicepaymet'+i).val()); - var Inid = document.getElementById ('pono'+i ).innerText - var ponovalue = Inid+','+Payment; - //alert(Inid+'else'); - //temppo.pull(Inid); - var a = temppo.indexOf(ponovalue); + var Inid = document.getElementById ('pono'+i ).innerText + var ponovalue = Inid+','+Payment; + var a = temppo.indexOf(ponovalue); //console.log(a); if(a!=-1) { diff --git a/application/views/bankinvoice.php b/application/views/bankinvoice.php index 10b754db..92f91518 100644 --- a/application/views/bankinvoice.php +++ b/application/views/bankinvoice.php @@ -635,6 +635,7 @@ function Save() var bid=$('#bankid').val(); var date =$('#invoicedate1'+i).val(); var invid =$('#invoiceid1'+i).val(); + //alert(invid+'iid'); var customername=$('#customername1'+i).val(); var invoiceamount=$('#invoiceamount1'+i).val(); var amountreceived=$('#invoicerec'+i).val(); diff --git a/application/views/banksettlement.php b/application/views/banksettlement.php index 0c3d1d28..e186a236 100644 --- a/application/views/banksettlement.php +++ b/application/views/banksettlement.php @@ -191,7 +191,7 @@ if(!empty($mapping)) Balance To Pay Amount Paid - + File @@ -214,15 +214,29 @@ if(!empty($mapping)) Podate),'d-m-Y');?> PONO?> - + Suppliername?> Totalpoamount?> Balancetopay?> Amountpaid?> - - + FilePath=='') + { + ?> + No File + + +