diff --git a/application/controllers/cashbook.php b/application/controllers/cashbook.php index 4a3c8fd9..36f08699 100644 --- a/application/controllers/cashbook.php +++ b/application/controllers/cashbook.php @@ -1569,6 +1569,7 @@ class cashbook extends BaseController { $data['bankdebitsupp'] = $this->cashbook_model->amountpaidsupplierwise(); + $data['amountpaidcashbook']=$this->cashbook_model->amountpaidcashbook(); } diff --git a/application/models/cashbook_model.php b/application/models/cashbook_model.php index 310f579e..4868deee 100644 --- a/application/models/cashbook_model.php +++ b/application/models/cashbook_model.php @@ -1056,7 +1056,7 @@ function receiptdata() $this->db->where($date); } - $this->db->group_by('bm.IGRLineItemNo'); + $query = $this->db->get(); return $query->result(); @@ -1668,6 +1668,7 @@ function receiptdata() $this->db->join('T_bankreport br','br.ID=bm.mid','left'); $this->db->where('bm.SupplierID',$supplierid); $this->db->where('bm.IsActive',1); + //$this->db->group_by('bm.mid'); if ($fa and $aa != ''){ //$sql.=" and (im.CreatedDate >= '".$fa."-04-01' and im.CreatedDate <= '".$aa."-03-31')"; @@ -1688,7 +1689,7 @@ function receiptdata() and date(bm.Podate) <= '".$todate."'"; $this->db->where($date); } - $this->db->group_by('bm.IGRLineItemNo'); + //$this->db->group_by('bm.IGRLineItemNo'); $query = $this->db->get(); return $query->result(); @@ -1697,8 +1698,8 @@ function receiptdata() { $this->db->select('bm.id,bm.mid,bm.PONO,bm.Suppliername,bm.SupplierID,bm.Totalpoamount,bm.Podate, bm.Balancetopay,sum(bm.Amountpaid) as Amountpaid,bm.IGRNO,bm.IGRLineItemNo'); - $this->db->from ('T_Bankporeport bm'); - $this->db->where('bm.IsActive',1); + $this->db->from ('T_Bankporeport bm'); + $this->db->where('bm.IsActive',1); $this->db->group_by('bm.SupplierID'); $query = $this->db->get(); return $query->result(); @@ -1804,9 +1805,8 @@ function receiptdata() { $this->db->select('bm.id,bm.mid,bm.PONO,bm.Suppliername,bm.SupplierID,sum(bm.Totalpoamount)as Totalpoamount, bm.Balancetopay,sum(bm.Amountpaid) as Amountpaid,bm.Podate,bm.IGRLineItemNo'); - $this->db->where('bm.IsActive',1); $this->db->from ('T_Bankporeport bm'); - + $this->db->where('bm.IsActive',1); if ($fa and $aa != ''){ @@ -1988,6 +1988,9 @@ function receiptdata() $this->db->join ('ip_invoices iv','iva.invoice_id = iv.invoice_id','left'); $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('iv.receivedstatus','ST066'); + $this->db->where('iv.invoice_status_id','2'); + $this->db->where('bm.IsActive',1); // $this->db->where('bm.customername',$Customer); if ($fa and $aa != ''){ @@ -2010,9 +2013,7 @@ function receiptdata() and date(iv.invoice_date_created) <= '".$todate."'"; $this->db->where($date); } - $this->db->where('iv.receivedstatus','ST066'); - $this->db->where('iv.invoice_status_id','2'); - + $this->db->group_by('ic.client_name'); //$this->db->where('inc.type','PAYMENT'); diff --git a/application/views/bankpaidsupp.php b/application/views/bankpaidsupp.php index 3e34250e..15421490 100644 --- a/application/views/bankpaidsupp.php +++ b/application/views/bankpaidsupp.php @@ -221,7 +221,8 @@ foreach($financialyear as $item) - $rate=$t->Amountpaid; + $Amountpaid=$t->Amountpaid; + $supplierid=$t->SupplierID; @@ -231,7 +232,7 @@ foreach($financialyear as $item) Suppliername?> - +