diff --git a/Apollo/api/application/models/DayBook_model.php b/Apollo/api/application/models/DayBook_model.php index e2bcb06e..9a1f08ee 100755 --- a/Apollo/api/application/models/DayBook_model.php +++ b/Apollo/api/application/models/DayBook_model.php @@ -696,19 +696,25 @@ class DayBook_model extends CI_Model $tod=date("Y-m-d",strtotime($to)); $expid = 'I001'; - // $subQuery = 'select T_DayBookMaster.ID,TypeName,Amount,T_DayBookMaster.Date,Reason,Description from T_DayBookMaster - // join T_Income_Outcome_Master on T_Income_Outcome_Master.TypeID=T_DayBookMaster.Name and - // T_Income_Outcome_Master.ID = T_DayBookMaster.Type where Name=? and date>=? and date<=?'; - $subQuery = 'select Name,T_DayBookMaster.ID,T_Income_Outcome_Master.TypeID as OrgType,T_Income_Outcome_Master.TypeName,SUM(Amount) as Tot_Amount,T_Income_Outcome_Master.ID as SID,T_Income_Outcome_Master.TypeName as Type,T_DayBookMaster.Date,Reason,T_DayBookMaster.Description,ListName from T_DayBookMaster left join T_Income_Outcome_Master on - T_Income_Outcome_Master.ID = T_DayBookMaster.Type - join T_PickListDetails on T_PickListDetails.ListCode = T_Income_Outcome_Master.TypeID - where Name in (?,?) and str_to_date(date,?)>=? and str_to_date(date,?)<=? group by ListName'; + // $subQuery = 'select Name,T_DayBookMaster.ID,T_Income_Outcome_Master.TypeID as OrgType,T_Income_Outcome_Master.TypeName,SUM(Amount) as Tot_Amount,T_Income_Outcome_Master.ID as SID,T_Income_Outcome_Master.TypeName as Type,T_DayBookMaster.Date,Reason,T_DayBookMaster.Description,ListName from T_DayBookMaster left join T_Income_Outcome_Master on + // T_Income_Outcome_Master.ID = T_DayBookMaster.Type + // join T_PickListDetails on T_PickListDetails.ListCode = T_Income_Outcome_Master.TypeID + // where Name in (?,?) and str_to_date(date,?)>=? and str_to_date(date,?)<=? group by ListName'; - $query = $this->db->query($subQuery,array($incid,$expid,'%d-%m-%Y',$fromd,'%d-%m-%Y',$tod)); + // $query = $this->db->query($subQuery,array($incid,$expid,'%d-%m-%Y',$fromd,'%d-%m-%Y',$tod)); + + + + $subQuery='select Name,sum(Amount) as Total,T_DayBookMaster.ID,T_Income_Outcome_Master.ID as SubID,T_Income_Outcome_Master.TypeID as OrgType,T_Income_Outcome_Master.TypeName,T_DayBookMaster.Date,Reason,T_DayBookMaster.Description,ListName from T_DayBookMaster +left join T_Income_Outcome_Master on T_Income_Outcome_Master.ID = T_DayBookMaster.Type +join T_PickListDetails on T_PickListDetails.ListCode = T_Income_Outcome_Master.TypeID +where str_to_date(date,?)>=? and str_to_date(date,?)<=? group by Type'; + +$query = $this->db->query($subQuery,array('%d-%m-%Y',$fromd,'%d-%m-%Y',$tod)); - // print_r( $this->db->last_query()); + //print_r( $this->db->last_query()); // die(); $expense = $query->result(); diff --git a/Apollo/assets/js/controllers/income_reportCtrl.js b/Apollo/assets/js/controllers/income_reportCtrl.js index 1f2bc912..b2188c5c 100644 --- a/Apollo/assets/js/controllers/income_reportCtrl.js +++ b/Apollo/assets/js/controllers/income_reportCtrl.js @@ -63,6 +63,8 @@ app.controller('income_reportCtrl', ["$scope","$rootScope","toaster", "$filter", $scope.Total_income = ''; $scope.load = ''; $scope.isLoaderShow = ''; + $scope.fromda = ''; + $scope.toda =''; var response_data = { @@ -75,8 +77,11 @@ app.controller('income_reportCtrl', ["$scope","$rootScope","toaster", "$filter", branch: JSON.parse(localStorage.getItem('localObj')).localBranchID, from : $scope.filters.from_date, to : $scope.filters.to_date + } + + }; $http(response_data).then(function (response) { diff --git a/Apollo/assets/views/income_expense_report.html b/Apollo/assets/views/income_expense_report.html index 6af776f9..13ea187f 100644 --- a/Apollo/assets/views/income_expense_report.html +++ b/Apollo/assets/views/income_expense_report.html @@ -133,38 +133,50 @@ -
-
-

{{load}}

-
+
+
+

{{load}}

+
-
+
+ +
+

Apollo Distance Education

+

Profit and Loss Report

+
+
+
+
+ + +
-
+
{{li.ListName }}
{{li.TypeName}}
-
{{li.Tot_Amount}}
+
{{li.Total}}
-
+
@@ -183,7 +195,7 @@ {{li.ListName }}
{{li.TypeName}}
-
{{li.Tot_Amount}}
+
{{li.Total}}
@@ -215,16 +227,16 @@
-
+
{{li.ListName }}
{{li.TypeName}}
-
{{li.Tot_Amount}}
+
{{li.Total}}
-
+
@@ -245,7 +257,7 @@ {{li.ListName }}
{{li.TypeName}}
-
{{li.Tot_Amount}}
+
{{li.Total}}
@@ -282,14 +294,14 @@ - - + + - - + diff --git a/Apollo/assets/views/income_expense_report_pdf.html b/Apollo/assets/views/income_expense_report_pdf.html index c62b8e3b..f6910464 100644 --- a/Apollo/assets/views/income_expense_report_pdf.html +++ b/Apollo/assets/views/income_expense_report_pdf.html @@ -70,16 +70,16 @@ -
+
{{li.ListName }}
{{li.TypeName}}
-
{{li.Tot_Amount}}
+
{{li.Total}}
-
+ @@ -97,7 +97,7 @@ {{li.ListName }}
{{li.TypeName}}
-
{{li.Tot_Amount}}
+
{{li.Total}}
@@ -129,16 +129,16 @@ -
+
{{li.ListName }}
{{li.TypeName}}
-
{{li.Tot_Amount}}
+
{{li.Total}}
-
+ @@ -159,7 +159,7 @@ {{li.ListName }}
{{li.TypeName}}
-
{{li.Tot_Amount}}
+
{{li.Total}}