This commit is contained in:
venbatechnologies@gmail.com 2018-08-04 16:26:54 +05:30
parent 8188e464f6
commit 45f73f2eba
4 changed files with 57 additions and 34 deletions

View File

@ -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();

View File

@ -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) {

View File

@ -133,38 +133,50 @@
</div>
<div>
<div ng-if="isLoaderShow">
<center> <h1>{{load}}</h1> </center>
</div>
<div>
<div ng-if="isLoaderShow">
<center> <h1>{{load}}</h1> </center>
</div>
<div ng-if="expense_data.length>0">
<div ng-if="expense_data.length>0">
<!-- hearde start -- >
<!-- header end -->
<!-- Operating Income Part -->
<div class="col-md-12">
<!-- header -->
<div>
<h4 align="center" style="color:black;"><strong>Apollo Distance Education</strong></h4>
<p align="center" style="color: black">Profit and Loss Report</p>
<br/>
<div class="col-md-12" style="background-color: #D3D3D3;font-size: 15px; height: 40px">
</div>
</div>
<!-- header end -->
<div class="col-md-3"><b>
<label style="color: black; font-size: 15px">Operating Income</label></b>
</div>
<div ng-repeat="f in fullincomedetail" ng-if="f.OrgType =='I002'">
<!-- <div ng-repeat="f in fullincomedetail" ng-if="f.OrgType =='I002'"> -->
<div class="col-md-12" ng-repeat="li in fullincomedetail " ng-if="li.Name=='I002' && li.OrgType == 'I002'">
{{li.ListName }}
<div id="test" class="pad">
<div id="a" class="fif">{{li.TypeName}}</div>
<div id="b" class="right">{{li.Tot_Amount}}</div>
<div id="b" class="right">{{li.Total}}</div>
</div>
</div>
</div>
<!-- </div> -->
</div>
@ -183,7 +195,7 @@
{{li.ListName }}
<div id="test" class="pad">
<div id="a" class="fif">{{li.TypeName}}</div>
<div id="b" class="right">{{li.Tot_Amount}}</div>
<div id="b" class="right">{{li.Total}}</div>
</div>
</div>
@ -215,16 +227,16 @@
<label style="color: black; font-size: 15px">Operating Expense</label></b>
</div>
<div ng-repeat="f in fullincomedetail" ng-if="f.OrgType =='I001'">
<!-- <div ng-repeat="f in fullincomedetail" ng-if="f.OrgType =='I001'"> -->
<div class="col-md-12" ng-repeat="li in fullincomedetail " ng-if="li.Name=='I001' && li.OrgType == 'I001'">
{{li.ListName }}
<div id="test" class="pad">
<div id="a" class="fif">{{li.TypeName}}</div>
<div id="b" class="right">{{li.Tot_Amount}}</div>
<div id="b" class="right">{{li.Total}}</div>
</div>
</div>
</div>
<!-- </div> -->
</div>
@ -245,7 +257,7 @@
{{li.ListName }}
<div id="test" class="pad">
<div id="a" class="fif">{{li.TypeName}}</div>
<div id="b" class="right">{{li.Tot_Amount}}</div>
<div id="b" class="right">{{li.Total}}</div>
</div>
</div>
@ -282,14 +294,14 @@
<!--Net profit Completed -->
</div>
</div>
</div>
</div>
<!-- <div ng-if="load=0">
<b><h1 style="color:black;"><center> No Records Found</h1></center></b>
</div> -->
<dir-pagination-controls direction-links="true" boundary-links="true">
</dir-pagination-controls>
<!-- <dir-pagination-controls direction-links="true" boundary-links="true">
</dir-pagination-controls> -->
</div>
</div>

View File

@ -70,16 +70,16 @@
<label style="color: black; font-size: 12px">Operating Income</label></b>
</div>
<div ng-repeat="f in income_expensedetails" ng-if="f.OrgType =='I002'">
<!-- <div ng-repeat="f in income_expensedetails" ng-if="f.OrgType =='I002'"> -->
<div class="col-md-12" ng-repeat="li in income_expensedetails " ng-if="li.Name=='I002' && li.OrgType == 'I002'">
{{li.ListName }}
<div id="test" class="pad">
<div id="a" class="fif">{{li.TypeName}}</div>
<div id="b" class="right">{{li.Tot_Amount}}</div>
<div id="b" class="right">{{li.Total}}</div>
</div>
</div>
</div>
<!-- </div> -->
</div>
@ -97,7 +97,7 @@
{{li.ListName }}
<div id="test" class="pad">
<div id="a" class="fif">{{li.TypeName}}</div>
<div id="b" class="right">{{li.Tot_Amount}}</div>
<div id="b" class="right">{{li.Total}}</div>
</div>
</div>
@ -129,16 +129,16 @@
<label style="color: black; font-size: 12px">Operating Expense</label></b>
</div>
<div ng-repeat="f in income_expensedetails" ng-if="f.OrgType =='I001'">
<!-- <div ng-repeat="f in income_expensedetails" ng-if="f.OrgType =='I001'"> -->
<div class="col-md-12" ng-repeat="li in income_expensedetails " ng-if="li.Name=='I001' && li.OrgType == 'I001'">
{{li.ListName }}
<div id="test" class="pad">
<div id="a" class="fif">{{li.TypeName}}</div>
<div id="b" class="right">{{li.Tot_Amount}}</div>
<div id="b" class="right">{{li.Total}}</div>
</div>
</div>
</div>
<!-- </div> -->
</div>
@ -159,7 +159,7 @@
{{li.ListName }}
<div id="test" class="pad">
<div id="a" class="fif">{{li.TypeName}}</div>
<div id="b" class="right">{{li.Tot_Amount}}</div>
<div id="b" class="right">{{li.Total}}</div>
</div>
</div>