year filter desc
This commit is contained in:
parent
8497d6565b
commit
bf0eca549a
@ -766,15 +766,17 @@ class cashbook extends BaseController
|
||||
if ($this->input->post('btn_submit'))
|
||||
{
|
||||
$this->global['pageTitle'] = 'Siddharth : bankstatement';
|
||||
// $ab=$this->input->post('financialyear');
|
||||
// $fa=substr($ab,0,-5);
|
||||
// $aa=substr($ab,5,5);
|
||||
|
||||
$ab=$this->input->post('financialyear');
|
||||
|
||||
$fa=substr($ab,0,-5);
|
||||
$aa=substr($ab,5,5);
|
||||
|
||||
|
||||
$fdate = $this->input->post('from_date');
|
||||
$tdate = $this->input->post('to_date');
|
||||
}
|
||||
// $data['finyear']=$this->cashbook_model->report_finyear();
|
||||
$data['bankreport'] = $this->cashbook_model->bankstatement($fdate,$tdate);
|
||||
$data['finyear']=$this->cashbook_model->report_finyear();
|
||||
$data['bankreport'] = $this->cashbook_model->bankstatement($fdate,$tdate,$fa,$aa);
|
||||
|
||||
|
||||
$this->loadViews("bankstatement", $this->global, $data,NULL);
|
||||
|
||||
@ -146,10 +146,37 @@ class cashbook_model extends CI_Model
|
||||
return $r;
|
||||
}
|
||||
}
|
||||
function bankstatement($fdate,$tdate,$fa,$aa){
|
||||
|
||||
|
||||
|
||||
function report_finyear(){
|
||||
|
||||
|
||||
$sql="SELECT
|
||||
CASE WHEN MONTH(reportdate)>=4 THEN
|
||||
concat(YEAR(reportdate), '-',YEAR(reportdate)+1)
|
||||
ELSE concat(YEAR(reportdate)-1,'-', YEAR(reportdate)) END AS financial_year
|
||||
FROM T_bankreport
|
||||
GROUP BY financial_year";
|
||||
$query = $this->db->query($sql);
|
||||
return $query->result();
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
function bankstatement($fdate,$tdate,$fa,$aa){
|
||||
|
||||
|
||||
|
||||
$sql="SELECT *,date_format(reportdate,'%d-%m-%Y')as date,tie.total,date_format(valuedate,'%d-%m-%Y')as valuedate from T_bankreport as br left join t_income_expense as tie on tie.bankid=br.ID where br.reportdate !=0 ";
|
||||
$sql="SELECT *,date_format(reportdate,'%d-%m-%Y')as date,tie.total,date_format(valuedate,'%d-%m-%Y')as valuedate from T_bankreport as br left join t_income_expense as tie on tie.bankid=br.ID where br.reportdate !=0 ";
|
||||
|
||||
|
||||
if ($fa and $aa != ''){
|
||||
|
||||
$sql.=" and (reportdate >= '".$fa."-04-01' and reportdate<= '".$aa."-03-31')";
|
||||
|
||||
}
|
||||
if ($fdate and $tdate != '')
|
||||
{
|
||||
|
||||
@ -163,11 +190,9 @@ function bankstatement($fdate,$tdate,$fa,$aa){
|
||||
|
||||
|
||||
|
||||
$sql.=" group by(br.ID) "."ORDER BY br.ID+0 DESC ";
|
||||
// $sql.=" ORDER BY br.ID+0 DESC ";
|
||||
|
||||
$sql.=" group by(br.ID) ";
|
||||
$sql.=" ORDER BY br.ID+0 DESC ";
|
||||
|
||||
|
||||
|
||||
$query = $this->db->query($sql);
|
||||
return $query->result();
|
||||
|
||||
@ -74,7 +74,7 @@ if(!empty($amountpaid))
|
||||
|
||||
|
||||
<form method="post" action="<?php echo base_url($this->uri->uri_string()); ?>">
|
||||
<center><h3 class="box-title"><p style="color:#3c8dbc"><b>Bankss Debit Amount Paid Reports</b></p></h3></center>
|
||||
<center><h3 class="box-title"><p style="color:#3c8dbc"><b>Banks Debit Amount Paid Reports</b></p></h3></center>
|
||||
<div class="box-body">
|
||||
|
||||
<div class="row">
|
||||
|
||||
@ -108,7 +108,7 @@
|
||||
<select class="form-control" id="financialyear" name="financialyear">
|
||||
<option value="">Select Year</option>
|
||||
<?php
|
||||
foreach($financialyear as $item):
|
||||
foreach($finyear as $item):
|
||||
|
||||
{?>
|
||||
|
||||
@ -170,7 +170,7 @@
|
||||
|
||||
|
||||
|
||||
<table class="table table-bordered table-hover" id="req" style="table-layout:auto;">
|
||||
<table class="table table-bordered table-hover" data-order='[[1,"desc"]]' id="req" style="table-layout:auto;">
|
||||
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user