income expense
This commit is contained in:
parent
6b1a0765d7
commit
f7193c3d32
@ -651,12 +651,17 @@ class DayBook_model extends CI_Model
|
||||
|
||||
public function Income_expense($from,$to,$br)
|
||||
{
|
||||
|
||||
// echo $from.'ff';
|
||||
// echo $to.'to';
|
||||
$incomecode='I002';
|
||||
$expensecode='I001';
|
||||
|
||||
$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));
|
||||
// echo $fromd;
|
||||
// echo $tod;
|
||||
// die();
|
||||
$subQuery= 'SELECT
|
||||
DISTINCT(p.Name) AS TID,ListName,
|
||||
SUM(IF(p.Name=?,Amount,0)) AS Income,
|
||||
@ -668,15 +673,17 @@ class DayBook_model extends CI_Model
|
||||
FROM
|
||||
T_DayBookMaster AS p
|
||||
join T_PickListDetails on T_PickListDetails.ListCode = p.name
|
||||
where Date>=? and Date<=? and p.IsActive=? and (p.Name=? or p.Name=?)
|
||||
where str_to_date(Date,?)>=? and str_to_date(Date,?)<=? and p.IsActive=? and (p.Name=? or p.Name=?)
|
||||
GROUP BY p.`Name`';
|
||||
$query = $this->db->query($subQuery,array($incomecode,$expensecode,$incomecode,$expensecode,$fromd,$tod,'1','I001','I002'));
|
||||
$query = $this->db->query($subQuery,array($incomecode,$expensecode,$incomecode,$expensecode,'%d-%m-%Y',$fromd,'%d-%m-%Y',$tod,'1','I001','I002'));
|
||||
$expense = $query->result();
|
||||
|
||||
if(count($query)>0)
|
||||
{
|
||||
$results['expense_data'] = $expense;
|
||||
}
|
||||
}
|
||||
|
||||
//print_r( $this->db->last_query());
|
||||
|
||||
return $results;
|
||||
|
||||
@ -685,8 +692,8 @@ class DayBook_model extends CI_Model
|
||||
|
||||
public function getIncome_Details($from,$to,$incid)
|
||||
{
|
||||
$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';
|
||||
|
||||
// $subQuery = 'select T_DayBookMaster.ID,TypeName,Amount,T_DayBookMaster.Date,Reason,Description from T_DayBookMaster
|
||||
@ -696,9 +703,9 @@ class DayBook_model extends CI_Model
|
||||
$subQuery = 'select Name,T_DayBookMaster.ID,T_Income_Outcome_Master.TypeID as OrgType,T_Income_Outcome_Master.TypeName,Amount,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 date>=? and date<=?';
|
||||
where Name in (?,?) and str_to_date(date,?)>=? and str_to_date(date,?)<=?';
|
||||
|
||||
$query = $this->db->query($subQuery,array($incid,$expid,$fromd,$tod));
|
||||
$query = $this->db->query($subQuery,array($incid,$expid,'%d-%m-%Y',$fromd,'%d-%m-%Y',$tod));
|
||||
|
||||
|
||||
// print_r( $this->db->last_query());
|
||||
|
||||
@ -325,8 +325,14 @@ var Total_exp = 0;
|
||||
{
|
||||
|
||||
|
||||
kendo.drawing.drawDOM($("#income_expensepdf")).then(function(group) {
|
||||
kendo.drawing.pdf.saveAs(group, "income_expensepdf"+".pdf");
|
||||
// kendo.drawing.drawDOM($("#income_expensepdf")).then(function(group) {
|
||||
// kendo.drawing.pdf.saveAs(group, "income_expensepdf"+".pdf");
|
||||
|
||||
|
||||
kendo.drawing.drawDOM($("#income_expensepdf"),
|
||||
{ paperSize: "A4",
|
||||
margin:"1cm"} ).then(function(group) {
|
||||
kendo.drawing.pdf.saveAs(group, "income_expensepdf"+".pdf");
|
||||
});
|
||||
|
||||
|
||||
|
||||
@ -47,7 +47,7 @@
|
||||
<div class="col-md-offset-10 col-md-1">
|
||||
<button class="btn btn-success" id="print"ng-click="generatePDF();">Print</button></div>
|
||||
<div id="income_expensepdf">
|
||||
<h1 align="center" style="color:black;"><strong>Apollo Distance Education</strong></h1>
|
||||
<h5 align="center" style="color:black;"><strong>Apollo Distance Education</strong></h5>
|
||||
<p align="center" style="color: black">Profit and Loss Report</p>
|
||||
<p align="center" style="color: black">From: {{income_expensedetails.fdate}} to {{income_expensedetails.tdate}}</p>
|
||||
<br/>
|
||||
@ -58,7 +58,7 @@
|
||||
<!-- Income part -->
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-3"><b>
|
||||
<label style="color: black; font-size: 20px">Income</label></b>
|
||||
<label style="color: black; font-size: 12px">Income</label></b>
|
||||
</div>
|
||||
<!-- {{}} -->
|
||||
|
||||
@ -67,8 +67,8 @@
|
||||
<div class="col-md-12" ng-repeat="li in income_expensedetails " ng-if="li.Name=='I002' && list.ListCode == li.OrgType">
|
||||
{{li.ListName }}
|
||||
<div id="test" class="pad">
|
||||
<div id="a" class="fif">{{li.TypeName}}</div>
|
||||
<div id="b" class="right">{{li.Amount}}</div>
|
||||
<div id="a" style="color: black; font-size: 8px" class="fif">{{li.TypeName}}</div>
|
||||
<div id="a" style="color: black; font-size: 8px" class="right">{{li.Amount}}</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@ -78,9 +78,9 @@
|
||||
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-6"><b>
|
||||
<label style="color: black; font-size: 17px">Total Income</label></b>
|
||||
<label style="color: black; font-size: 12px">Total Income</label></b>
|
||||
</div>
|
||||
<div class="col-md-offset-10" style="color: black; font-size: 17px" ng-repeat="de in income_expendelist" ng-if="de.TID=='I002'" >
|
||||
<div class="col-md-offset-10" style="color: black; font-size: 12px" ng-repeat="de in income_expendelist" ng-if="de.TID=='I002'" >
|
||||
{{de.Total}}
|
||||
</div>
|
||||
</div>
|
||||
@ -93,7 +93,7 @@
|
||||
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-3"><b>
|
||||
<label style="color: black; font-size: 20px">Expense</label></b>
|
||||
<label style="color: black; font-size: 12px">Expense</label></b>
|
||||
</div>
|
||||
|
||||
<div ng-repeat="list in listdetails">
|
||||
@ -101,8 +101,8 @@
|
||||
|
||||
{{li.ListName}}
|
||||
<div id="test" class="pad">
|
||||
<div id="a" class="fif">{{li.TypeName}}</div>
|
||||
<div id="b" class="right">{{li.Amount}}</div>
|
||||
<div id="a" style="color: black; font-size: 8px" class="fif">{{li.TypeName}}</div>
|
||||
<div id="b" style="color: black; font-size: 8px" class="right">{{li.Amount}}</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@ -111,9 +111,9 @@
|
||||
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-6"><b>
|
||||
<label style="color: black; font-size: 17px">Total Expense</label></b>
|
||||
<label style="color: black; font-size: 12px">Total Expense</label></b>
|
||||
</div>
|
||||
<div class="col-md-offset-10" style="color: black; font-size: 17px" ng-repeat="de in income_expendelist" ng-if="de.TID=='I001'" >
|
||||
<div class="col-md-offset-10" style="color: black; font-size: 12px" ng-repeat="de in income_expendelist" ng-if="de.TID=='I001'" >
|
||||
{{de.Total}}
|
||||
</div>
|
||||
</div>
|
||||
@ -131,9 +131,9 @@
|
||||
</p>
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-6"><b>
|
||||
<label style="color: black; font-size: 17px">Net Profit/Loss</label></b>
|
||||
<label style="color: black; font-size: 15px">Net Profit/Loss</label></b>
|
||||
</div>
|
||||
<div class="col-md-offset-10" style="color: black; font-size: 17px"><b>
|
||||
<div class="col-md-offset-10" style="color: black; font-size: 15px"><b>
|
||||
{{sum}}
|
||||
|
||||
</b></div>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user