pl report excel

This commit is contained in:
venbatechnologies@gmail.com 2018-10-15 18:13:03 +05:30
parent 31d9a75d10
commit 7b22a619b6
2 changed files with 7 additions and 5 deletions

View File

@ -1055,14 +1055,16 @@ $subQuery='select Name,ListName,q.Date as dat,month(str_to_date(Date,?)) as mont
SUM(IF(q.Name=? and TypeID =?,Amount,0)) AS OperationalIncome, SUM(IF(q.Name=? and TypeID =?,Amount,0)) AS OperationalIncome,
SUM(IF(q.Name=? and TypeID = ?,Amount,0)) AS OperationalExpense, SUM(IF(q.Name=? and TypeID = ?,Amount,0)) AS OperationalExpense,
SUM(IF(q.Name=? and TypeID != ?,Amount,0)) AS NonOperationalIncome, SUM(IF(q.Name=? and TypeID != ?,Amount,0)) AS NonOperationalIncome,
SUM(IF(q.Name=? and TypeID != ?,Amount,0)) AS NonOperationalExpense SUM(IF(q.Name=? and TypeID != ?,Amount,0)) AS NonOperationalExpense,
(SUM(IF(q.Name=? and TypeID =?,Amount,0))+SUM(IF(q.Name=? and TypeID != ?,Amount,0)))-
(SUM(IF(q.Name=? and TypeID = ?,Amount,0))+SUM(IF(q.Name=? and TypeID != ?,Amount,0))) as Net
from T_NonOperationalMaster as q from T_NonOperationalMaster as q
left Join T_Income_Outcome_Master on T_Income_Outcome_Master.ID= q.Type left Join T_Income_Outcome_Master on T_Income_Outcome_Master.ID= q.Type
left Join T_PickListDetails on T_PickListDetails.ListCode=q.Name left Join T_PickListDetails on T_PickListDetails.ListCode=q.Name
where str_to_date(Date,?)>=? and str_to_date(Date,?)<=? where str_to_date(Date,?)>=? and str_to_date(Date,?)<=?
and q.BranchCode=? group by month'; and q.BranchCode=? group by month';
$query = $this->db->query($subQuery,array('%d-%m-%Y','%d-%m-%Y','I002','I002','I001','I001','I002','I002','I001','I001','%d-%m-%Y',$fromd,'%d-%m-%Y',$tod,$branch)); $query = $this->db->query($subQuery,array('%d-%m-%Y','%d-%m-%Y','I002','I002','I001','I001','I002','I002','I001','I001','I002','I002','I002','I002','I001','I001','I001','I001','%d-%m-%Y',$fromd,'%d-%m-%Y',$tod,$branch));
// print_r($this->db->last_query()); die(); // print_r($this->db->last_query()); die();

View File

@ -378,8 +378,8 @@ app.controller('income_reportCtrl', ["$scope","$rootScope","toaster", "$filter",
$scope.grandTot = $scope.grandTot =
{ {
OperationalExpense:"Grand Total", NonOperationalExpense:"Grand Total",
NonOperationalExpense: $scope.Net_Total Net: $scope.Net_Total
} }
$scope.expense = $scope.PLexceldetails.concat($scope.grandTot); $scope.expense = $scope.PLexceldetails.concat($scope.grandTot);
@ -387,7 +387,7 @@ app.controller('income_reportCtrl', ["$scope","$rootScope","toaster", "$filter",
for (var i = 0; i < $scope.PLexceldetails.length; i++) for (var i = 0; i < $scope.PLexceldetails.length; i++)
$scope.expense[i].SL_NO = i + 1; $scope.expense[i].SL_NO = i + 1;
alasql('SELECT SL_NO,concat(month,"/",Year)as Date,OperationalIncome,NonOperationalIncome,OperationalExpense,NonOperationalExpense INTO XLS("Income Expense report.xls",?) FROM ?',[mystyle,$scope.expense]); alasql('SELECT SL_NO,concat(month,"/",Year)as Date,OperationalIncome,NonOperationalIncome,OperationalExpense,NonOperationalExpense,Net as Profit_or_Loss INTO XLS("Income Expense report.xls",?) FROM ?',[mystyle,$scope.expense]);
}; };