diff --git a/Apollo/api/application/models/DayBook_model.php b/Apollo/api/application/models/DayBook_model.php index d05603db..fcab2433 100644 --- a/Apollo/api/application/models/DayBook_model.php +++ b/Apollo/api/application/models/DayBook_model.php @@ -1123,19 +1123,19 @@ class DayBook_model extends CI_Model // echo $from.'ff'; // echo $to.'to'; + $incomecode='I002'; $expensecode='I001'; $fromd= date("Y-m-d",strtotime($from)); $tod=date("Y-m-d",strtotime($to)); - // echo $fromd; - // echo $tod; - // die(); + if($from != null && $to != null){ - $where="str_to_date(Date,'%d-%m-%Y')>=".$fromd." and str_to_date(Date,'%d-%m-%Y')<=".$tod." and"; + $where="str_to_date(Date,'%d-%m-%Y')>='".$fromd."' and str_to_date(Date,'%d-%m-%Y')<='".$tod."' and"; }else{ $where=""; } + $subQuery= 'SELECT DISTINCT(p.Name) AS TID,ListName, SUM(IF(p.Name=?,Amount,0)) AS Income, @@ -1152,7 +1152,6 @@ class DayBook_model extends CI_Model $query = $this->db->query($subQuery,array($incomecode,$expensecode,'Pending',$incomecode,$expensecode,'1','I001','Pending','I002','WAIVER','REFERRAL','Cancel',$br)); $expense = $query->result(); - // print_r($this->db->last_query());die(); // and p.Isdaybook=? // if(count($expense) > 0) // { @@ -1192,11 +1191,11 @@ class DayBook_model extends CI_Model public function getIncome_Details($from,$to,$incid,$branch) { - $fromd= date("d-m-Y",strtotime($from)); - $tod=date("d-m-Y",strtotime($to)); + $fromd= date("Y-m-d",strtotime($from)); + $tod=date("Y-m-d",strtotime($to)); $expid = 'I001'; if($from != null && $to != null){ - $where="str_to_date(Date,'%d-%m-%Y')>=str_to_date('".$fromd."','%d-%m-%Y') and str_to_date(Date,'%d-%m-%Y')<=str_to_date('".$tod."','%d-%m-%Y') and"; + $where="str_to_date(Date,'%d-%m-%Y')>='".$fromd."' and str_to_date(Date,'%d-%m-%Y')<='".$tod."' and"; }else{ $where=""; } @@ -1308,7 +1307,8 @@ public function GetPLexcelDetails($from,$to,$branch) // $query = $this->db->query($subQuery,array('I002','I002','I001','I001','I002','I002','I001','I001','%d-%m-%Y',$fromd,'%d-%m-%Y',$tod,$branch,'%d-%m-%Y')); if($from != null && $to != null){ - $where="str_to_date(Date,'%d-%m-%Y')>=str_to_date('".$fromd."','%d-%m-%Y') and str_to_date(Date,'%d-%m-%Y')<=str_to_date('".$tod."','%d-%m-%Y') and"; + //$where="str_to_date(Date,'%d-%m-%Y')>=str_to_date('".$fromd."','%d-%m-%Y') and str_to_date(Date,'%d-%m-%Y')<=str_to_date('".$tod."','%d-%m-%Y') and"; + $where="str_to_date(Date,'%d-%m-%Y')>='".$from."' and str_to_date(Date,'%d-%m-%Y')<='".$to."' and"; }else{$where="";} $subQuery='select Name,ListName,q.Date as dat,month(str_to_date(Date,?)) as month,year(str_to_date(Date,?)) as Year, diff --git a/Apollo/api/application/models/Fees_status_model.php b/Apollo/api/application/models/Fees_status_model.php index 95724004..8d1aca12 100755 --- a/Apollo/api/application/models/Fees_status_model.php +++ b/Apollo/api/application/models/Fees_status_model.php @@ -1214,6 +1214,7 @@ class Fees_status_model extends CI_Model // echo 'Set Fee Function ** '; // print_r($details); // print_r($jsonData); + // die(); $RollNo= $details['RollNo']; @@ -1259,9 +1260,10 @@ class Fees_status_model extends CI_Model for($j=0;$jdb->query($sql); diff --git a/Apollo/assets/js/controllers/income_reportCtrl.js b/Apollo/assets/js/controllers/income_reportCtrl.js index e424d47f..4fa19581 100644 --- a/Apollo/assets/js/controllers/income_reportCtrl.js +++ b/Apollo/assets/js/controllers/income_reportCtrl.js @@ -111,8 +111,8 @@ app.controller('income_reportCtrl', ["$scope","$rootScope","toaster", "$filter", $scope.PLexceldetails=''; $scope.expense =''; $scope.alldata=''; - - + // from : $filter('date')(new Date($scope.filters.from_date), "dd-MM-yyyy"), + // to : $filter('date')(new Date($scope.filters.to_date), "dd-MM-yyyy") var response_data = { method: 'POST', url: apiPoint.url + 'IncomeExpenseDetails/',