diff --git a/application/controllers/cashbook.php b/application/controllers/cashbook.php index e2ef0968..839c80b7 100644 --- a/application/controllers/cashbook.php +++ b/application/controllers/cashbook.php @@ -995,12 +995,12 @@ class cashbook extends BaseController $this->global['pageTitle'] = 'Siddharth : Bank Debit Report'; if ($this->input->post('btn_submit')) { - $Supplierid = $this->input->post('SupplierName'); + $SupplierName = $this->input->post('SupplierName'); $fdate = $this->input->post('from_date'); $tdate = $this->input->post('to_date'); //$data['cash'] = $_GET['sid']; //$data['bankid'] = $_GET['d']; - $data['bankdepitpaid'] = $this->cashbook_model->debitbankstatemet($Supplierid,$fdate,$tdate); + $data['bankdepitpaid'] = $this->cashbook_model->debitbankstatemet($SupplierName,$fdate,$tdate); // print_r($data['bankdepitpaid']); } diff --git a/application/models/cashbook_model.php b/application/models/cashbook_model.php index 2389de8f..b8c6e7f2 100644 --- a/application/models/cashbook_model.php +++ b/application/models/cashbook_model.php @@ -578,19 +578,20 @@ function amountunpaid($supplierid1,$fa,$aa,$m,$fdate,$tdate) return $query->result(); } - function debitbankstatemet($Supplierid,$fdate,$tdate) + function debitbankstatemet($SupplierName,$fdate,$tdate) { + $sql="select pono,igrn,potype,date_format(created_date,'%d-%m-%Y') as created_date,date_format(materialrcvddate,'%d-%m-%Y') as materialrcvddate,supplier_name,sid,Balancetopay,Amountpaid, sum(total) as total,file,ifile from bankdebit - where status != 'ST030' and PaymentStatus !='ST070'"; + where status != 'ST030' and PaymentStatus != 'ST070'"; - if ($Supplierid!= ''){ + if ($SupplierName!= ''){ - $sql.="and sid = '".$Supplierid."'"; + $sql.="and supplier_name = '".$SupplierName."'"; } @@ -604,7 +605,7 @@ function amountunpaid($supplierid1,$fa,$aa,$m,$fdate,$tdate) } - $sql.="group by pono,igrn"; + $sql.="group by igrn"; $query = $this->db->query($sql); return $query->result(); diff --git a/application/views/bankdebit.php b/application/views/bankdebit.php index 2514f675..425789f0 100644 --- a/application/views/bankdebit.php +++ b/application/views/bankdebit.php @@ -125,7 +125,7 @@ foreach($financialyear as $item) - + @@ -178,6 +178,7 @@ foreach($financialyear as $item) $balancetopay=$t->Balancetopay; $ReceivedQuantity=$t->ReceivedQuantity; $rate=$t->total; + $Amountpaid=$t->Amountpaid; //$rate=$t->TotalOrderValue; if($status !='ST057') {