diff --git a/application/controllers/cashbook.php b/application/controllers/cashbook.php index 0e78abc8..58960b93 100755 --- a/application/controllers/cashbook.php +++ b/application/controllers/cashbook.php @@ -1038,6 +1038,14 @@ class cashbook extends BaseController $this->global['pageTitle'] = 'Siddharth : amountpaid'; + if ($this->input->post('btn_submit')) + { + $SupplierName = $this->input->post('SupplierName'); + $fdate = $this->input->post('from_date'); + $tdate = $this->input->post('to_date'); + + $data['bankdebit'] = $this->cashbook_model->debitpolistfilter($SupplierName,$fdate,$tdate); + } $data['amountpaid'] = $this->cashbook_model->paided(); $data['supplier'] = $this->cashbook_model->getsupplier(); $this->loadViews("bankamountpaid", $this->global,$data, NULL); @@ -1050,8 +1058,16 @@ class cashbook extends BaseController // $this->load->model('cashbook_model'); $this->global['pageTitle'] = 'Siddharth : Cashbook Listing'; + if ($this->input->post('btn_submit')) + { + $Customer = $this->input->post('Customer'); + $fdate = $this->input->post('from_date'); + $tdate = $this->input->post('to_date'); + + $data['bankcredit'] = $this->cashbook_model->creditinvoicelistfilter($Customer,$fdate,$tdate); + } $data['getcustomer'] = $this->cashbook_model->getcustomer(); - $data['amountreceived'] = $this->cashbook_model->received(); + $data['amountreceived'] = $this->cashbook_model->received(); $this->loadViews("bankamountreceived", $this->global,$data, NULL); } diff --git a/application/models/cashbook_model.php b/application/models/cashbook_model.php index 2dc43b43..45ed2e9f 100755 --- a/application/models/cashbook_model.php +++ b/application/models/cashbook_model.php @@ -202,6 +202,7 @@ class cashbook_model extends CI_Model return $query->result(); } + function receiptdata() { @@ -236,6 +237,27 @@ function debitpolist($bankid) $query = $this->db->get(); return $query->result(); + } + + function debitpolistfilter($SupplierName,$fdate,$tdate) + { + $this->db->select('bm.mid,bm.Podate,bm.PONO,bm.Suppliername,bm.Totalpoamount, + bm.Balancetopay,bm.Amountpaid'); + $this->db->from ('T_Bankmappingpo bm'); + $this->db->join ('T_SupplierDetailsN sd','sd.SupplierName = bm.Suppliername','left'); + if($fdate!='' && $tdate!='') + { + $this->db->where('bm.Podate BETWEEN "'. date('Y-m-d', strtotime($fdate)). '" and "'. date('Y-m-d', strtotime($tdate)).'"'); + } + if($SupplierName!='') + { + $this->db->where('sd.SupplierID',$SupplierName); + } + // $this->db->where('mid',$bankid); + $this->db->group_by('PONO'); + $query = $this->db->get(); + return $query->result(); + } function creditinvoicelist($bankid) @@ -248,6 +270,25 @@ function debitpolist($bankid) $query = $this->db->get(); return $query->result(); + } + function creditinvoicelistfilter($Customer,$fdate,$tdate) + { + $this->db->select('bm.indate,bm.invoiceno,bm.customername,bm.totinvoiceamount,bm.bankid, + bm.balancetoreceived,bm.amountreceived'); + $this->db->from ('T_Bankmappingiv bm'); + $this->db->join ('ip_clients ic','ic.client_name = bm.customername','left'); + if($fdate!='' && $tdate!='') + { + $this->db->where('bm.indate BETWEEN "'. date('Y-m-d', strtotime($fdate)). '" and "'. date('Y-m-d', strtotime($tdate)).'"'); + } + if($Customer!='') + { + $this->db->where('ic.client_id',$Customer); + } + //$this->db->group_by('invoiceno'); + $query = $this->db->get(); + return $query->result(); + } //for cashbook edit screen and update bankreport// function invoiceamonut($bankid) diff --git a/application/views/bankamountpaid.php b/application/views/bankamountpaid.php index fbb2fe97..bac96749 100644 --- a/application/views/bankamountpaid.php +++ b/application/views/bankamountpaid.php @@ -24,7 +24,7 @@ if(!empty($amountpaid)) } ?> - +