diff --git a/application/controllers/cashbook.php b/application/controllers/cashbook.php
index 0ecac413..3cfbb064 100755
--- a/application/controllers/cashbook.php
+++ b/application/controllers/cashbook.php
@@ -953,6 +953,13 @@ class cashbook extends BaseController
$tdate = $this->input->post('to_date');
$bankid= $_GET['d'];
$data['clearbalance']= $_GET['clearbalance'];
+ if($data['clearbalance']==0)
+ {
+ echo "";
+ redirect('Bankingstatement','refresh');
+ }
+ else
+ {
$data['balancetoclear'] =$_GET['balancetoclear'];
$data['mappingcashbook']=$this->cashbook_model->mappingcash($SupplierName,$fdate,$tdate,$bankid);
$data['mapping'] = $this->cashbook_model->debitpolist($bankid);
@@ -961,6 +968,7 @@ class cashbook extends BaseController
$data['paidpoamount'] = $this->cashbook_model->poamonut($bankid);
$data['supplier'] = $this->cashbook_model->getsupplier();
$this->loadViews("banksettlement", $this->global,$data,NULL);
+ }
}
public function mappinginvoice()
@@ -974,6 +982,13 @@ class cashbook extends BaseController
$tdate = $this->input->post('to_date');
$bankid= $_GET['d'];
$data['clearbalance']=$_GET['cb'];
+ if($data['clearbalance']==0)
+ {
+ echo "";
+ redirect('Bankingstatement','refresh');
+ }
+ else
+ {
$data['balancetoclear']=$_GET['btc'];
$data['mappingcashbook']=$this->cashbook_model->mappingcash($SupplierName,$fdate,$tdate,$bankid);
$data['mappingiv'] = $this->cashbook_model->creditinvoicelist($bankid);
@@ -982,7 +997,7 @@ class cashbook extends BaseController
$data['supplier'] = $this->cashbook_model->getsupplier();
//redirect('Bankingstatement','refresh');
$this->loadViews("bankinvoicesettlement", $this->global,$data,NULL);
-
+ }
}
public function mappingdebit()
{
diff --git a/application/models/cashbook_model.php b/application/models/cashbook_model.php
index 322c5ef7..fb886c23 100755
--- a/application/models/cashbook_model.php
+++ b/application/models/cashbook_model.php
@@ -46,6 +46,7 @@ class cashbook_model extends CI_Model
$this->db->join('t_accountcode','t_income_expense.account_code=t_accountcode.code','left');
$this->db->join('tbl_users','t_income_expense.Created_By=tbl_users.userId','left');
$this->db->join('T_Employee_Details','tbl_users.EmpID=T_Employee_Details.EmpID','left');
+ $this->db->where('t_income_expense.IsActive',1);
$this->db->order_by("date","desc");
if(!empty($i))
{
@@ -62,7 +63,7 @@ class cashbook_model extends CI_Model
$this->db->join('t_accountcode','t_income_expense.account_code=t_accountcode.code','left');
$this->db->join('tbl_users','t_income_expense.Created_By=tbl_users.userId','left');
$this->db->join('T_Employee_Details','tbl_users.EmpID=T_Employee_Details.EmpID','left');
-
+ $this->db->where('t_income_expense.IsActive',1);
if ($firstyear and $secondyear != ''){
$finyear = "t_income_expense.date >= '".$firstyear."-04-01' and t_income_expense.date <= '".$secondyear."-03-31'";
$this->db->where($finyear);
@@ -276,7 +277,7 @@ function bankstatement($fdate,$tdate,$fa,$aa){
}
function clearedbalance(){
- $sql = 'SELECT SUM(cbalancetocleared) as credit,SUM(Balancetocleared) as debit FROM T_bankreport';
+ $sql = 'SELECT SUM(cclearbalance) as credit,SUM(Clearbalance) as debit FROM T_bankreport';
$query = $this->db->query($sql);
return $query->result();
@@ -308,7 +309,8 @@ function clearedbalance(){
if ($Supplierid != ''){
$this->db->where('supp.SupplierID',$Supplierid);
}
- $this->db->where_in('pom.Status',[ST044,ST056]);
+ $this->db->where_in('igr.IGRStatus','ST027');
+ //$this->db->where_in('pom.Status',[ST044,ST056]);
$this->db->where('igrli.BankStatus !=','ST070');
$query = $this->db->get();
return $query->result();
diff --git a/application/views/bankdebit.php b/application/views/bankdebit.php
index 13e8dfc0..22db01e4 100644
--- a/application/views/bankdebit.php
+++ b/application/views/bankdebit.php
@@ -627,7 +627,6 @@ function GetAmount(i)
var tot11=0
for(l=1;lid;
+ $bankid=$ap->bankid;
}
}