From 0ecb4161f2b5450a84be67efd2f6aeeddada3327 Mon Sep 17 00:00:00 2001 From: venbatechnologies Date: Wed, 1 Aug 2018 12:15:05 +0530 Subject: [PATCH] bank stat --- application/config/constants.php | 2 +- application/controllers/cashbook.php | 29 ++++++----- application/models/cashbook_model.php | 63 +++++++++++------------- application/views/alterpurchaseorder.php | 4 +- application/views/bankamountpaid.php | 7 ++- application/views/bankcashnew.php | 2 +- application/views/banksettlement.php | 14 ++++-- 7 files changed, 64 insertions(+), 57 deletions(-) diff --git a/application/config/constants.php b/application/config/constants.php index bc413e34..7d7b49a7 100755 --- a/application/config/constants.php +++ b/application/config/constants.php @@ -142,7 +142,7 @@ define('NO_RECEIVED', 'ST066'); define('PARTIALLY_RECEIVED', 'ST067'); define('AMOUNT_PAIDIGR', 'ST070'); define('PARTIALLY_PAIDIGR', 'ST071'); -define('NO_PAIDIGR', 'ST072'); +define('NO_PAIDIGR', '+ST072'); /* Work status code */ define('SERVICE_COMPLETED', 'ST046'); diff --git a/application/controllers/cashbook.php b/application/controllers/cashbook.php index f0b70f59..c28dd107 100755 --- a/application/controllers/cashbook.php +++ b/application/controllers/cashbook.php @@ -7,14 +7,14 @@ 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 { /** * This is default constructor of the class */ - public function __construct() + public function __construct() { parent::__construct(); $this->load->model('cashbook_model'); @@ -501,13 +501,14 @@ class cashbook extends BaseController //echo ""; echo ""; - if($amounttype == ' ')//Redirct To Listing Screen + if($bankorcash==Bank)//Redirct To Listing Screen { - redirect('ViewIncomeExpense','refresh'); + redirect('Bankingstatement','refresh'); + } - else if($amounttype != ' ')//Redirct To Bank Report Screen + else if($bankorcash != ' ')//Redirct To Bank Report Screen { - redirect('Bankingstatement','refresh'); + redirect('ViewIncomeExpense','refresh'); } } @@ -1012,12 +1013,13 @@ class cashbook extends BaseController function IGRFilelist() { - $igrno= $this->input->post('igrno'); - $igrsingle = $this->cashbook_model->igrmastersingle($igrno); - $igrmultiple =$this->cashbook_model->igrmastermultiple($igrno); + $igrno= $this->input->post('igrno'); + $pono =$this->input->post('pono'); + $igrsingle = $this->cashbook_model->igrmastersingle($igrno,$pono); + $igrmultiple =$this->cashbook_model->igrmastermultiple($igrno,$pono); $data = array_merge($igrsingle,$igrmultiple); - //print_r($data); - echo json_encode($data); + // print_r($data); + echo json_encode($data); } @@ -1026,8 +1028,9 @@ class cashbook extends BaseController public function filelist() { - $igrno= $this->input->post('igrno'); - $data = $this->cashbook_model->debitimage($igrno); + $igrno= $this->input->post('igrno'); + $pono =$this->input->post('pono'); + $data = $this->cashbook_model->debitimage($igrno,$pono); echo json_encode($data); diff --git a/application/models/cashbook_model.php b/application/models/cashbook_model.php index 2aa21633..62eb4dd5 100755 --- a/application/models/cashbook_model.php +++ b/application/models/cashbook_model.php @@ -431,40 +431,19 @@ 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 for image - function debitimage($igrno) + + function debitimage($igrno,$pono) { - // $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 != "" '); $this->db->where('IGRNO',$igrno); + $this->db->or_where('PONO',$pono); $query = $this->db->get(); $result = $query->result(); + // print_r($result);die; return $result; } @@ -476,7 +455,7 @@ function receiptdata() $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,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_Master igrm','igrm.PONO = bm.PONO or igrm.IGRNO = bm.IGRNO ','left'); //$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'); @@ -498,20 +477,38 @@ function receiptdata() } - function igrmastersingle($igrno) + function igrmastersingle($igrno,$pono) { + $this->db->distinct(); $this->db->select('IGRNO,file,PONO as pono'); $this->db->from('T_IGR_Master'); - $this->db->where('IGRNO',$igrno); + if(!empty($igrno) && !empty($pono)){ + $this->db->where('PONO',$pono); + $this->db->where('IGRNO',$igrno); + }else if(!empty($pono)){ + $this->db->where('PONO',$pono); + $this->db->where('IGRNO != ""'); + }else{ + $this->db->where('IGRNO',$IGRNO); + } + $query = $this->db->get(); return $query->result(); } - function igrmastermultiple($igrno) + function igrmastermultiple($igrno,$pono) { - + $this->db->distinct(); $this->db->select('BillNo,IGRNO,FilePath,PONO,Remarks'); $this->db->from('T_Inwardgateregister_fileupload'); - $this->db->where('IGRNO',$igrno); + if(!empty($igrno) && !empty($pono)){ + $this->db->where('PONO',$pono); + $this->db->where('IGRNO',$igrno); + }else if(!empty($pono)){ + $this->db->where('PONO',$pono); + $this->db->where('IGRNO != ""'); + }else{ + $this->db->where('IGRNO',$IGRNO); + } $query = $this->db->get(); return $query->result(); diff --git a/application/views/alterpurchaseorder.php b/application/views/alterpurchaseorder.php index 49e592f4..9781e610 100755 --- a/application/views/alterpurchaseorder.php +++ b/application/views/alterpurchaseorder.php @@ -171,8 +171,8 @@ if(!empty($INRSYMBOL)) $("#PODate").datepicker({ - minDate : 'now', - maxDate : 'now', + // minDate : 'now', + // maxDate : 'now', dateFormat: 'dd-mm-yy',changeMonth: true, changeYear: true,yearRange: '-100:+0' }); $("#Deliverydt").datepicker({ diff --git a/application/views/bankamountpaid.php b/application/views/bankamountpaid.php index 9775c0a6..36ec7b47 100644 --- a/application/views/bankamountpaid.php +++ b/application/views/bankamountpaid.php @@ -334,11 +334,13 @@ $.ajax({ function pono(i) { var igrno=$('#igrno'+i).text(); + var pono =$('#pono'+i).text(); + $("#Fileshow").modal('show'); $.ajax( { - data:{igrno:igrno}, + data:{igrno:igrno,pono:pono}, type:"POST", url:"cashbook/filelist", success:function(data) @@ -434,11 +436,12 @@ $( function() { function igrno(i) { var igrno=$('#igrno'+i).text(); + var pono=$('#pono'+i).text(); $("#Fileshow").modal('show'); $.ajax( { - data:{igrno:igrno}, + data:{igrno:igrno,pono:pono}, type:"POST", url:"cashbook/IGRFilelist", success:function(data) diff --git a/application/views/bankcashnew.php b/application/views/bankcashnew.php index abe19e76..cc9860f1 100644 --- a/application/views/bankcashnew.php +++ b/application/views/bankcashnew.php @@ -142,7 +142,7 @@ $('#merchant').autocomplete({ $('#payment').hide(); $('#towhom').text('Received From:'); $("#accode").append( $('').val(item.code).html(item.name)); - } + } }); diff --git a/application/views/banksettlement.php b/application/views/banksettlement.php index b26539a6..cbf8b578 100644 --- a/application/views/banksettlement.php +++ b/application/views/banksettlement.php @@ -3,7 +3,7 @@ file ?>"--> Suppliername?> Totalpoamount?> - Totalpoamount-$ap->Amountpaid?> + Balancetopay?> Amountpaid?> file !='') @@ -485,12 +485,15 @@ if(!empty($mapping)) function pono(i) { var igrno=$('#igrno'+i).text(); - //alert(igrno); + var pono =$('#pono'+i).text(); + // alert(igrno); + // alert(pono); + // return false; $("#Fileshow").modal('show'); $.ajax( { - data:{igrno:igrno}, + data:{igrno:igrno,pono:pono}, type:"POST", url:"cashbook/filelist", success:function(data) @@ -550,11 +553,12 @@ function pono(i) function igrno(i) { var igrno=$('#igrno'+i).text(); + var pono =$('#pono'+i).text(); $("#Fileshow").modal('show'); $.ajax( { - data:{igrno:igrno}, + data:{igrno:igrno,pono:pono}, type:"POST", url:"cashbook/IGRFilelist", success:function(data)