pl excel
This commit is contained in:
parent
3a752ce495
commit
31d9a75d10
@ -1035,21 +1035,35 @@ public function GetPLexcelDetails($from,$to,$branch)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
$subQuery='select Name,ListName,Date,T_Income_Outcome_Master.ID,T_Income_Outcome_Master.TypeID as OrgType,T_Income_Outcome_Master.TypeName,
|
// $subQuery='select Name,ListName,Date,T_Income_Outcome_Master.ID,T_Income_Outcome_Master.TypeID as OrgType,T_Income_Outcome_Master.TypeName,
|
||||||
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
|
||||||
from T_NonOperationalMaster as q
|
// from T_NonOperationalMaster as q
|
||||||
Join T_Income_Outcome_Master on T_Income_Outcome_Master.ID= q.Type
|
// Join T_Income_Outcome_Master on T_Income_Outcome_Master.ID= q.Type
|
||||||
Join T_PickListDetails on T_PickListDetails.ListCode=q.Name
|
// Join T_PickListDetails on T_PickListDetails.ListCode=q.Name
|
||||||
where str_to_date(Date,?)>=? and str_to_date(Date,?)<=? and q.BranchCode=? group by Name,Month(str_to_date(Date,?));';
|
// where str_to_date(Date,?)>=? and str_to_date(Date,?)<=? and q.BranchCode=? group by Name,Month(str_to_date(Date,?));';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$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'));
|
// $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'));
|
||||||
|
|
||||||
|
|
||||||
|
$subQuery='select Name,ListName,q.Date as dat,month(str_to_date(Date,?)) as month,year(str_to_date(Date,?)) as Year,
|
||||||
|
T_Income_Outcome_Master.ID,T_Income_Outcome_Master.TypeID as OrgType,T_Income_Outcome_Master.TypeName,
|
||||||
|
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 NonOperationalIncome,
|
||||||
|
SUM(IF(q.Name=? and TypeID != ?,Amount,0)) AS NonOperationalExpense
|
||||||
|
from T_NonOperationalMaster as q
|
||||||
|
left Join T_Income_Outcome_Master on T_Income_Outcome_Master.ID= q.Type
|
||||||
|
left Join T_PickListDetails on T_PickListDetails.ListCode=q.Name
|
||||||
|
where str_to_date(Date,?)>=? and str_to_date(Date,?)<=?
|
||||||
|
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',$fromd,'%d-%m-%Y',$tod,'1',$branch,'%d-%m-%Y','%d-%m-%Y',$fromd,'%d-%m-%Y',$tod,$branch,'%d-%m-%Y'));
|
|
||||||
|
|
||||||
// print_r($this->db->last_query()); die();
|
// print_r($this->db->last_query()); die();
|
||||||
$expenseNon = $query->result();
|
$expenseNon = $query->result();
|
||||||
|
|||||||
@ -378,13 +378,16 @@ app.controller('income_reportCtrl', ["$scope","$rootScope","toaster", "$filter",
|
|||||||
$scope.grandTot =
|
$scope.grandTot =
|
||||||
{
|
{
|
||||||
|
|
||||||
NonOperationalExpense:"Grand Total",
|
OperationalExpense:"Grand Total",
|
||||||
ListName: $scope.Net_Total
|
NonOperationalExpense: $scope.Net_Total
|
||||||
}
|
}
|
||||||
|
|
||||||
$scope.expense = $scope.PLexceldetails.concat($scope.grandTot);
|
$scope.expense = $scope.PLexceldetails.concat($scope.grandTot);
|
||||||
|
|
||||||
alasql('SELECT Date,OperationalIncome,NonOperationalIncome,OperationalExpense,NonOperationalExpense,ListName as Type INTO XLS("Income Expense report.xls",?) FROM ?',[mystyle,$scope.expense]);
|
for (var i = 0; i < $scope.PLexceldetails.length; i++)
|
||||||
|
$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]);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user