From 8cb2b218143a36995ef878477010c1b3adb0d14f Mon Sep 17 00:00:00 2001 From: venbatechnologies Date: Mon, 23 Jul 2018 18:12:39 +0530 Subject: [PATCH] bankmulplefileviewpopwindow --- application/controllers/cashbook.php | 29 ++++++-- application/controllers/report.php | 3 +- application/models/cashbook_model.php | 96 +++++++++++++++++++-------- application/views/bankamountpaid.php | 1 + application/views/banksettlement.php | 7 +- 5 files changed, 100 insertions(+), 36 deletions(-) diff --git a/application/controllers/cashbook.php b/application/controllers/cashbook.php index 8f835c59..2f8bed90 100755 --- a/application/controllers/cashbook.php +++ b/application/controllers/cashbook.php @@ -7,7 +7,7 @@ require APPPATH . '/third_party/mpdf/mpdf.php'; * User Class to control all user related operations. * @author : Gandhimathi * @version : 1.1 - * @since : 13 Nov 2017 + * @since : 13 Nov 2017 */ class cashbook extends BaseController { @@ -1007,13 +1007,30 @@ class cashbook extends BaseController $this->loadViews("bankinvoice", $this->global,$data,NULL); } - public function filelist() - { - $pono= $this->input->post('pono'); - $data = $this->cashbook_model->debitimage($pono); + + + function IGRFilelist() + { + $igrno= $this->input->post('igrno'); + $igrsingle = $this->cashbook_model->igrmastersingle($igrno); + $igrmultiple =$this->cashbook_model->igrmastermultiple($igrno); + $data = array_merge($igrsingle,$igrmultiple); echo json_encode($data); - } + + } + /*end*/ + + public function filelist() + + { + $igrno= $this->input->post('igrno'); + $data = $this->cashbook_model->debitimage($igrno); + + echo json_encode($data); + + } + public function mappingpo() { diff --git a/application/controllers/report.php b/application/controllers/report.php index 821926da..8b0cb3eb 100755 --- a/application/controllers/report.php +++ b/application/controllers/report.php @@ -513,7 +513,8 @@ class report extends BaseController $PO= $this->input->post('id'); - $PONO= substr($PO,5); + $PONO= substr($PO,10); + //echo $PONO; die; $data = $this->dahsboard_Model->getfile($PONO); diff --git a/application/models/cashbook_model.php b/application/models/cashbook_model.php index df930005..4c2b37e6 100755 --- a/application/models/cashbook_model.php +++ b/application/models/cashbook_model.php @@ -429,48 +429,56 @@ function receiptdata() } -function debitpolist($bankid) - { - $this->db->select('bp.id,bp.mid,igrm.MaterialRcvdDate,bp.PONO,bp.Suppliername,bp.Totalpoamount,br.Debit, - 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','left'); - $this->db->join ('T_bankreport br','br.ID=bp.mid'); - $this->db->where('bp.IsActive',1); - $this->db->where('bp.mid',$bankid); - // $this->db->where('igrde.BankStatus !=','ST072'); - $this->db->group_by('bp.id'); - $query = $this->db->get(); - return $query->result(); +// function debitpolist($bankid) +// { +// $this->db->select('bp.id,bp.mid,igrm.MaterialRcvdDate,bp.PONO,bp.Suppliername,bp.Totalpoamount,br.Debit, +// 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','left'); +// $this->db->join ('T_bankreport br','br.ID=bp.mid'); +// $this->db->where('bp.IsActive',1); +// $this->db->where('bp.mid',$bankid); +// // $this->db->where('igrde.BankStatus !=','ST072'); +// $this->db->group_by('bp.id'); +// $query = $this->db->get(); +// return $query->result(); - } +// } //function for image - function debitimage($pono) + function debitimage($igrno) { - $this->db->select('bp.PONO,bp.mid,bu.FilePath,bu.BillNo,bu.IGRNO'); - $this->db->from ('T_Bankmappingpo bp'); - $this->db->join ('T_PurchaseOrder_BillUpload bu','bp.PONO = bu.PONO','left'); - $this->db->where('bp.PONO',$pono); - $this->db->group_by('bu.BillNo'); - $query = $this->db->get(); - return $query->result(); + // $this->db->select('bp.PONO,bp.mid,bu.FilePath,bu.BillNo,bu.IGRNO'); + // $this->db->from ('T_Bankmappingpo bp'); + // $this->db->join ('T_PurchaseOrder_BillUpload bu','bp.PONO = bu.PONO','left'); + // $this->db->where('bp.PONO',$pono); + // $this->db->group_by('bu.BillNo'); + // $query = $this->db->get(); + // return $query->result(); + + $this->db->select('*'); + $this->db->from ('T_PurchaseOrder_BillUpload'); + $this->db->where('IGRNO',$igrno); + $query = $this->db->get(); + $result = $query->result(); + return $result; - } + } 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'); + bm.Balancetopay,bm.Amountpaid,bm.IGRNO,igrm.file,bm.IGRLineItemNo,br.Clearbalance,br.Balancetocleared,bu.FilePath,bu.BillNo,inward.FilePath as Fpath'); $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_bankreport br','br.ID=bm.mid'); + $this->db->join('T_Inwardgateregister_fileupload inward','inward.IGRNO =igrm.IGRNO','left'); $this->db->join ('T_PurchaseOrder_BillUpload bu','bm.PONO=bu.PONO','left'); if($fdate!='' && $tdate!='') { @@ -487,6 +495,42 @@ function debitpolist($bankid) return $query->result(); } + + function igrmastersingle($igrno) + { + $this->db->select('IGRNO,file,PONO as pono'); + $this->db->from('T_IGR_Master'); + $this->db->where('IGRNO',$igrno); + $query = $this->db->get(); + return $query->result(); + } + function igrmastermultiple($igrno) + { + + $this->db->select('BillNo,IGRNO,FilePath,PONO'); + $this->db->from('T_Inwardgateregister_fileupload'); + $this->db->where('IGRNO',$igrno); + $query = $this->db->get(); + return $query->result(); + + } + function debitpolist($bankid) + { + $this->db->select('bp.id,bp.mid,igrm.MaterialRcvdDate,bp.PONO,bp.Suppliername,bp.Totalpoamount,br.Debit,bp.Balancetopay,bp.Amountpaid,bp.IGRNO,bp.IGRLineItemNo,igrm.file,bu.FilePath,inward.FilePath as Fpath'); + $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','left'); + $this->db->join('T_Inwardgateregister_fileupload inward','inward.IGRNO =igrm.IGRNO','left'); + $this->db->join ('T_bankreport br','br.ID=bp.mid'); + $this->db->where('bp.IsActive',1); + $this->db->where('bp.mid',$bankid); + // $this->db->where('igrde.BankStatus !=','ST072'); + $this->db->group_by('bp.id'); + $query = $this->db->get(); + return $query->result(); + + } + function creditinvoicelist($bankid) { diff --git a/application/views/bankamountpaid.php b/application/views/bankamountpaid.php index 663f718d..efae2331 100644 --- a/application/views/bankamountpaid.php +++ b/application/views/bankamountpaid.php @@ -480,6 +480,7 @@ $( function() { if(Filename != null) { i=i+1; + i=i-1; trHTML += '' + '' + i + '' + '' + BillNO+ '' + diff --git a/application/views/banksettlement.php b/application/views/banksettlement.php index c3e1d7ed..2ba59378 100644 --- a/application/views/banksettlement.php +++ b/application/views/banksettlement.php @@ -6,7 +6,7 @@ if(!empty($mapping)) { -} +} foreach($financialyear as $item) @@ -566,7 +566,7 @@ function pono(i) var Filename = ''; var PONO =''; var BillNO =''; - + $.each($.parseJSON(data),function (i, item) { if(item.file == null) @@ -592,10 +592,11 @@ function pono(i) FilePath =item.file; } - i=0; + if(Filename != null) { i=i+1; + i=i-1; trHTML += '' + '' + i + '' + '' + BillNO+ '' +