Department Based Report
| date | -Account Name | -Paid Type | -Amount | -Description | - -
|---|---|---|---|---|
| date?> | -name?> | -type?> | -total,2,'.','');?> | -description?> | - - - -
diff --git a/application/controllers/report.php b/application/controllers/report.php index c915d0fb..c10ce962 100755 --- a/application/controllers/report.php +++ b/application/controllers/report.php @@ -985,7 +985,7 @@ class report extends BaseController public function per() { - $this->global['pageTitle'] = 'Siddharth : Reports'; + $this->global['pageTitle'] = 'Resico : Reports'; $ab=$this->input->post('financialyear'); @@ -1007,150 +1007,172 @@ class report extends BaseController public function cashbook() { - $this->global['pageTitle'] = 'Cashbook - Cashbook Reports - '; - - $data['gettoptotal1'] = $this->dahsboard_Model->gettoptotal(); - $data['getTotalServicePoCount'] = $this->dahsboard_Model->getTotalServicePoCount(); - $data['getTotalimportPoCount'] = $this->dahsboard_Model->getTotalimportPoCount(); - $data['getTotalcapitalPoCount'] = $this->dahsboard_Model->getTotalcapitalPoCount(); - $data['getTotalrevenuePoCount'] = $this->dahsboard_Model->getTotalrevenuePoCount(); - $data['cashbook']=$this->dahsboard_Model->cashbook(); + $this->global['pageTitle'] = 'Resico : Cashbook Reports'; $income="RECEIPT"; $expense="PAYMENT"; - $data['monthlywiseincome']=$this->dahsboard_Model->monthwise_data($income); - $data['monthlywiseexpense']=$this->dahsboard_Model->monthwise_data($expense); - $data['todayincome']=$this->dahsboard_Model->today_data($income); - $data['todayexpense']=$this->dahsboard_Model->today_data($expense); - $data['yearincome']=$this->dahsboard_Model->yearwise_data($income); - $data['yearexpense']=$this->dahsboard_Model->yearwise_data($expense); + + $data['cashbook']=$this->dahsboard_Model->cashbook(); $data['gettoptotal1'] = $this->dahsboard_Model->gettoptotal(); $data['tdy']=$this->dahsboard_Model->today(); - $data['Indiancurrency']=$this->dahsboard_Model->INRSymbol(); + //This Array used to get and display today data (for today tile option) + $data['todayincome']=$this->dahsboard_Model->today_data($income); + $data['todayexpense']=$this->dahsboard_Model->today_data($expense); + //This Array used to get and display current month data (for monthly tile option) + $data['monthlywiseincome']=$this->dahsboard_Model->monthwise_data($income); + $data['monthlywiseexpense']=$this->dahsboard_Model->monthwise_data($expense); + //This Array used to get and display current fin year data (for yearly tile option) + $data['yearincome']=$this->dahsboard_Model->yearwise_data($income); + $data['yearexpense']=$this->dahsboard_Model->yearwise_data($expense); + $now = new DateTime(); + $currentdate = $now->format('Y-m-d'); // MySQL datetime format + $yesterday = date('Y-m-d', strtotime("-1 day")); + + $data['yesterdaytotal'] = $this->dahsboard_Model->daybeforetotal($yesterday); + + $this->loadviews("reportcashbook",$this->global,$data, NULL); } - public function monthexpenses() - { - - $this->global['pageTitle'] = 'Cashbook - monthly expenses Reports - '; + + + //This Function used to get and display today data (link = form today tile option)// + // public function Viewtoday() + public function daily_incexp() + { + + $this->global['pageTitle'] = 'Resico : Cashbook Daily Reports'; + $data['tdy']=$this->dahsboard_Model->today(); + //$data['Indiancurrency']=$this->dahsboard_Model->INRSymbol(); + + $now = new DateTime(); + $currentdate = $now->format('Y-m-d'); // MySQL datetime format + $yesterday = date('Y-m-d', strtotime("-1 day")); + + $data['yesterdaytotal'] = $this->dahsboard_Model->daybeforetotal($yesterday); + + $this->loadviews("cashbooktoday",$this->global,$data, NULL); + } + + //This Function used to get and display current monthly data (link = form monthly tile option)// + //public function monthexpenses() + public function load_monthly_incexp() + { + $this->global['pageTitle'] = 'Resico : Cashbook Monthly Reports'; + $this->loadviews("cashbookmthlyreport",$this->global,NULL, NULL); + } + + public function monthly_incexp() + { + + $this->global['pageTitle'] = 'Resico : Cashbook Monthly Reports'; + $monthyearvalue = $this->input->post('monthyear'); - + $data['monthyearvalue'] = $monthyearvalue; + $monthyear = explode("-",$monthyearvalue); + + $month = $monthyear[0]; + $year = $monthyear[1]; + + + $premonth = $monthyear[0]-1; + $premonth = $premonth < 10 ? '0'.$premonth : ''.$premonth; + $premonth = $premonth == '00' ? '12' : $premonth; + + $yearvalue = $premonth == '12' ? $year-1 : $year; + + $data['prevmonthtotal']=$this->dahsboard_Model->monthbeforetotal($premonth,$yearvalue); + + $data['monthlyreport']=$this->dahsboard_Model->month_incexp_report($month,$year); + + + + $this->loadviews("cashbookmthlyreport",$this->global,$data, NULL); + //cashbookmonthlyexpenses=>cashbookmthlyreport + - $data['monthlyreport']=$this->dahsboard_Model->monthexpensereport(); - // $data['monthlyincreport']=$this->dahsboard_Model->monthincomereport(); - $data['Indiancurrency']=$this->dahsboard_Model->INRSymbol(); - - - $this->loadviews("cashbookmonthlyexpenses",$this->global,$data, NULL); - - - - } - public function yearexpenses() + + + } + + + + //This Function used to get and display current fin year data (link = form yearly tile option)// + //public function yearexpenses() + public function load_yearly_incexp() { - - $this->global['pageTitle'] = 'Cashbook - yearly expenses Reports - '; + $this->global['pageTitle'] = 'Resico : Cashbook Yearly Reports'; + + $data['financialyear']=$this->dahsboard_Model->cashbookfinyear(); + + $this->loadviews("cashbookyearlyreport",$this->global,$data, NULL); + //cashbookyearlyexpenses=>cashbookyearlyreport + + } + + public function yearly_incexp() + { + $this->global['pageTitle'] = 'Resico : Cashbook Yearly Reports'; $fyear = $this->input->post('financialyear'); - + $fa=substr( $fyear,0,-5); $aa=substr( $fyear,5,5); - //echo $fyear; - //$data['yearlyincreport']=$this->dahsboard_Model->yearincomereport(); - $data['yearlyreport']=$this->dahsboard_Model->yearexpensereport($fa,$aa); - $data['financialyear']=$this->dahsboard_Model->cashbookfinyear(); - //print_r($data['finyear']); - $data['Indiancurrency']=$this->dahsboard_Model->INRSymbol(); + $finyear = explode("-",$fyear); + + + + $b4oneyear = $finyear[0] -1; + $b4twoyear = $finyear[1] -1; - - $this->loadviews("cashbookyearlyexpenses",$this->global,$data, NULL); - + $data['yearlyreport']=$this->dahsboard_Model->yearexpensereport($fa,$aa); + $data['financialyear']=$this->dahsboard_Model->cashbookfinyear(); + $data['b4finyeartotal']=$this->dahsboard_Model->yearbeforetotal($b4oneyear,$b4twoyear); + $date['fyears'] = array('fina' => $fyear); + $this->loadviews("cashbookyearlyreport",$this->global,$data, NULL); + + + } + - } public function cashbookdepartment() { - $this->global['pageTitle'] = 'Cashbook - department - '; + //$this->global['pageTitle'] = 'Cashbook - department - '; $sid=$_GET['sid']; $d=$_GET['d']; $c=$_GET['c']; if ($c=='PAYMENT') { + $this->global['pageTitle'] = 'Resico : PaymentWise Reports'; - $data['departmentwise']=$this->dahsboard_Model->departmentwise($sid,$d,$c); - $data['Indiancurrency']=$this->dahsboard_Model->INRSymbol(); + $data['departmentwise']=$this->dahsboard_Model->departmentwise($sid,$d,$c); + $data['Indiancurrency']=$this->dahsboard_Model->INRSymbol(); - $this->loadviews("cashbookmonthlydep",$this->global,$data, NULL); + $this->loadviews("cashbookmthlypaydep",$this->global,$data, NULL); + //cashbookmonthlydep=>cashbookmthlypaydep } else{ + $this->global['pageTitle'] = 'Resico : ReceiptWise Reports'; $data['departmentwise']=$this->dahsboard_Model->departmentwise($sid,$d,$c); $data['Indiancurrency']=$this->dahsboard_Model->INRSymbol(); - $this->loadviews("cashbookmonthlyexp",$this->global,$data, NULL); + $this->loadviews("cashbookmthlyrecdep",$this->global,$data, NULL); + //cashbookmonthlyexp=>cashbookmthlyrecdep } } - public function cashbookdepartmentexp() - { - $sid=$_GET['sid']; - $d=$_GET['d']; - $c=$_GET['c']; - $this->global['pageTitle'] = 'Cashbook - department - '; - $data['departmentwise']=$this->dahsboard_Model->departmentwise($sid,$d,$c); - $data['Indiancurrency']=$this->dahsboard_Model->INRSymbol(); - //print_r($data['departmentwise']); - $this->loadviews("cashbookmonthlyexp",$this->global,$data, NULL); - } - //for cashbook menu link// - // public function cashbookmonthmenu() - // { - - // $this->global['pageTitle'] = 'Cashbook monthly '; - // $data['yearmonthwise']=$this->dahsboard_Model->yearmonthwise(); - // $data['Indiancurrency']=$this->dahsboard_Model->INRSymbol(); - // //print_r($data['departmentwise']); - // $this->loadviews("cashbookyearmonthwise",$this->global,$data, NULL); - // } + public function yearmonthwise() { $sid=$_GET['sid']; - $this->global['pageTitle'] = 'Cashbook - yearmonthwise - '; + //$this->global['pageTitle'] = 'Cashbook - yearmonthwise - '; + $this->global['pageTitle'] = 'Resico : Cashbook Yearly Reports'; $data['yearmonthwise']=$this->dahsboard_Model->yearmonthwise($sid); $data['Indiancurrency']=$this->dahsboard_Model->INRSymbol(); $this->loadviews("cashbookyearmonthwise",$this->global,$data, NULL); } - //this function used to today menu option// - public function Viewtoday() - { - $this->global['pageTitle'] = 'Cashbook - viewtoday '; - $data['tdy']=$this->dahsboard_Model->today(); - $data['Indiancurrency']=$this->dahsboard_Model->INRSymbol(); - $this->loadviews("cashbooktoday",$this->global,$data, NULL); - } - public function depmenu() - { - $this->global['pageTitle'] = 'Cashbook - AllReport '; - $fdate = $this->input->post('from_date'); - $tdate = $this->input->post('to_date'); - $finyear = $this->input->post('financialyear'); - $fa=substr( $finyear,0,-5); - $aa=substr( $finyear,5,5); - $data['depmenu']=$this->dahsboard_Model->departmentmenu($fdate,$tdate,$fa,$aa); - $data['financialyear']=$this->dahsboard_Model->cashbookfinyear(); - $data['Indiancurrency']=$this->dahsboard_Model->INRSymbol(); - $this->loadviews("cashbookall",$this->global,$data, NULL); - } - public function cashbookmenudepartment() - { - $sid=$_GET['sid']; - - $this->global['pageTitle'] = 'Cashbook - department - '; - $data['menudepartmentwise']=$this->dahsboard_Model->menudepartmentwise($sid); - $data['Indiancurrency']=$this->dahsboard_Model->INRSymbol(); - $this->loadviews("cashbookdepday",$this->global,$data, NULL); - } } ?> diff --git a/application/models/dahsboard_model.php b/application/models/dahsboard_model.php index fc9225c6..17f24011 100755 --- a/application/models/dahsboard_model.php +++ b/application/models/dahsboard_model.php @@ -2103,6 +2103,30 @@ if ($cname!= ''){ $query = $this->db->query($sql); return $query->result(); + } + function month_incexp_report($month,$year) + { + $sql="SELECT date_format(tinc.date,'%d-%m-%Y')as date, + ifnull(case + when tinc.type = 'PAYMENT' + then sum(tinc.total) + end,'0') as expense, + ifnull(case + when tinc.type = 'RECEIPT' + then sum(tinc.total) + end, '0') as income, + ifnull(case + when tinc.type = 'PAYMENT' + then tinc.towhom + end,'-') as paymentname, + ifnull(case + when tinc.type = 'RECEIPT' + then tinc.towhom + end, '-') as receiptname, + tinc.total,tinc.towhom,tinc.description,monthname(tinc.date)as month,tinc.type,tinc.account_code,ac.name FROM t_income_expense tinc join t_accountcode ac on ac.code=tinc.account_code where month(tinc.date)= ".$month." and year(tinc.date)=".$year." group by tinc.account_code"; + $query = $this->db->query($sql); + return $query->result(); + } //home--this year// function yearexpensereport($fa,$aa) @@ -2342,7 +2366,62 @@ function INRSymbol() //echo $sql; return $query->result(); - } + } + + function daybeforetotal($yesterday){ + $sql="select date, + sum(if(type = 'PAYMENT',total,0)) as payment_amt, + sum(if(type = 'RECEIPT',total,0)) as receipt_amt + from t_income_expense + where date = ? "; + $query = $this->db->query($sql,array($yesterday)); + return $query->result(); + } + + function minmaxdatevalue(){ + $sql="SELECT MAX(date) AS Max_Date, MIN(date) AS Min_Date + FROM t_income_expense"; + $query = $this->db->query($sql); + return $query->result(); + } + + // function monthbeforetotal($mindate,$maxdate){ + + // $sql="SELECT + // sum(if(type = 'PAYMENT',total,0)) as payment_amt, + // sum(if(type = 'RECEIPT',total,0)) as receipt_amt + // FROM t_income_expense + // WHERE date BETWEEN ? AND ? "; + // $query = $this->db->query($sql,array($mindate,$maxdate)); + // return $query->result(); + + // } + + function monthbeforetotal($month,$year){ + + $sql="SELECT month(date) as monthnum ,year(date) as yearnum, + sum(if(type = 'PAYMENT',total,0)) as payment_amt, + sum(if(type = 'RECEIPT',total,0)) as receipt_amt + FROM t_income_expense + WHERE + month(date) = '".$month."'and year(date) = '".$year."'"; + $query = $this->db->query($sql); + return $query->result(); + + } + + function yearbeforetotal($prefy,$fa){ + $sql="SELECT + sum(if(type = 'PAYMENT',total,0)) as payment_amt, + sum(if(type = 'RECEIPT',total,0)) as receipt_amt + FROM t_income_expense + where date >= '".$prefy."-04-01' and date <= '".$fa."-03-31'"; + $query = $this->db->query($sql); + return $query->result(); + //print_r($query->result()); + + } + } ?> diff --git a/application/views/cashbookall.php b/application/views/cashbookall.php deleted file mode 100755 index 48186804..00000000 --- a/application/views/cashbookall.php +++ /dev/null @@ -1,323 +0,0 @@ - - -FontCode2000; - }} - foreach($financialyear as $item) - - { - $finyear = $item->financial_year; - - } ?> - - - - - - - - - - - - - - - - -
| date | -Account Name | -Paid Type | -Amount | -Description | - -
|---|---|---|---|---|
| date?> | -name?> | -type?> | -total,2,'.','');?> | -description?> | - - - -
| Account Name | -Paid Type | -Amount | - - -
|---|---|---|
| name?> | - -type?> | -total,2,'.','');?> | - - - - -
Month Report()
| Account Name | -Type | - -Receipt | -Payment | - - - - - -
|---|---|---|---|
| name?> | -type?> | - - - -income,2,'.',''); - echo number_format($mr->income,2,'.','');?> | -expense,2,'.',''); - echo number_format($mr->expense,2,'.','');?> | - - - - - - - -
| Total | -- - - | - - - | -- - - | - - - - - - -
| Date | - - -Paid To | -Paid Type | -Amount | - - -
|---|---|---|---|
| date?> | - -name ?> | - -type?> | -total,2,'.','');?> | - - - - -
Report(DEP:)
| Date | - -Account Name | -Type | - +Account Name | +Type | Paid To | - -Payment | +Payment (₹) | Description | Action | @@ -79,7 +70,7 @@ if(!empty($Indiancurrency))date?> | -name?> | type?> | -paymentname?> | -expense,2,'.',''); echo number_format($dw->expense,2,'.','');?> | -description?> | - |
|---|---|---|---|---|---|---|---|---|---|
| Total | - -- | - | - - | - - - | - +|||||
| Total | ++ | + | + | - | - - - + |
Report (DEP:)
| Date | - -Account Name | -Type | -Received From | - -Receipt | +Date | +Account Name | +Type | +Received From | +Receipt (₹) | Description | File | @@ -94,14 +83,11 @@ if(!empty($Indiancurrency))name?> | type?> | receiptname?> | -income,2,'.',''); echo number_format($dw->income,2,'.','');?> | - -description?> | -+ | document)) { @@ -129,39 +115,24 @@ if(!empty($Indiancurrency)) ?> |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Total | +||||||||||||||||||
| Total | - | - - | - - - | - - -- | - - - + | + | + | + |
Month Report
| Account Name | +Type | +Receipt (₹) | +Payment (₹) | +Current Balances(₹) | +
|---|---|---|---|---|
| Previous Month Balance(Opening Balances) | ++ + | + | + | + |
| name?> | +type?> | +income,2,'.',''); + echo number_format($mr->income,2,'.','');?> | +expense,2,'.',''); + echo number_format($mr->expense,2,'.','');?> | ++ |
| Total | ++ | + | + | + + |
| Current Month Closing Balances | ++ | + | + | + |
-CompanyName;?>Address;?> Mobile AlternateContactNumber;?> E-mail EmailAddress;?> GSTIN : GSTNO;?> + CompanyName;?>Address;?> Mobile : AlternateContactNumber;?> E-mail : EmailAddress;?> GSTIN : GSTNO;?> |
CASH VOUCHER |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| type) == 'PAYMENT'){echo 'Voucher Number';}else{echo 'Invoice Number';} ?> | +type) == 'PAYMENT'){echo 'Voucher Number';}else{echo 'Invoice Number';} ?> | type) == 'PAYMENT'){echo $data[0]->invoice_no;}else{echo $data[0]->invoice_no;}?> |
Rs total;?>Amount |
+
₹ total;?>Amount |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Date | +Date | date),'d-m-Y');?> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| + | towhom;?> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Amount (In Words) | +Amount (In Words) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Tax | +Tax | SGST :₹sgst;?> | CGST :₹cgst;?> | IGST :₹igst;?> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Payment Details | +Payment Details |
-
-
-
- Today Report
-
-
+
+
+
+ Today Report
-
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/application/views/cashbookyearmonthwise.php b/application/views/cashbookyearmonthwise.php
index ff43f6ee..7bb13d4e 100755
--- a/application/views/cashbookyearmonthwise.php
+++ b/application/views/cashbookyearmonthwise.php
@@ -1,136 +1,89 @@
-
-FontCode2000;
- }}
- ?>
-
-
+
+
+
+
+
+
+ Year Report
+
+
+
+
+
+
+
+
+
-
+
+
+
@@ -146,7 +99,7 @@ if(!empty($Indiancurrency))
// Bootstrap datepicker
// Set up your table
$(document).ready(function() {
- table = $('#req').DataTable( {
+ table = $('#yrly_mthwise').DataTable( {
"dom": "<'row'<'col-md-5'l><'col-md-7'Bf>>" +
"<'row'<'col-md-6'><'col-md-6'>>" +
"<'row'<'col-md-12't>><'row'<'col-md-4'i><'col-md-8'p>>",
diff --git a/application/views/reportcashbook.php b/application/views/reportcashbook.php
index 12da95dd..c4dbb7f6 100755
--- a/application/views/reportcashbook.php
+++ b/application/views/reportcashbook.php
@@ -7,14 +7,6 @@ $month_in='';
$month_ex='';
$year_in='';
$year_ex='';
-if(!empty($cashbook))
-{
-
-}
-if(!empty($monthlyreport))
-{
-
-}
if(!empty($todayincome))
{
@@ -23,91 +15,104 @@ if(!empty($todayincome))
$today_in=$ti->todaydata;
}}
- if(!empty($todayexpense))
- {
- foreach ($todayexpense as $te)
- {
- $today_ex=$te->todaydata;
+if(!empty($todayexpense))
+{
+ foreach ($todayexpense as $te)
+ {
+ $today_ex=$te->todaydata;
}}
- if(!empty($monthlywiseincome))
+if(!empty($monthlywiseincome))
+{
+ foreach ($monthlywiseincome as $mi)
{
- foreach ($monthlywiseincome as $mi)
- {
$month_in = $mi->monthlydata;
- }}
+ }}
- if(!empty($monthlywiseexpense))
- {
- foreach ($monthlywiseexpense as $me)
- {
+if(!empty($monthlywiseexpense))
+{
+ foreach ($monthlywiseexpense as $me)
+ {
$month_ex = $me->monthlydata;
- }}
- if(!empty($yearexpense))
- {
- foreach ($yearexpense as $ye)
- {
+ }}
+if(!empty($yearexpense))
+{
+ foreach ($yearexpense as $ye)
+ {
$year_ex=$ye->yearlydata;
- }}
+ }}
- if(!empty($yearincome))
- {
- foreach ($yearincome as $yi)
- {
+if(!empty($yearincome))
+{
+ foreach ($yearincome as $yi)
+ {
$year_in = $yi->yearlydata;
- }}
+ }}
- $inrsymbol='';
- if(!empty($Indiancurrency))
- {
- foreach ($Indiancurrency as $inr)
- {
- $inrsymbol = $inr->FontCode2000;
- }}
+ // $inrsymbol='';
+ // if(!empty($Indiancurrency))
+ // {
+ // foreach ($Indiancurrency as $inr)
+ // {
+ // $inrsymbol = $inr->FontCode2000;
+ // }}
-?>
+ $in=0.00;
+ $payamt=0.00;
+ $recamt = 0.00;
+ $zero=0.00;
+ $curr_balances=0.00;
+ $ti=0.00;
+ $tvt=0.00;
+ // [date] => 2018-02-21 [payment_amt] => 0 [receipt_amt] => 13 ) )
+ if(!empty($yesterdaytotal))
+ {
+ foreach ($yesterdaytotal as $ttl)
+ {
+ $strdayttl = $ttl->date;
+ $payamt = $ttl->payment_amt;
+ $recamt = $ttl->receipt_amt;
+ }}
+ ?>
-
-
-
-
+
-
+
-
+
-
- Month Report()
-
-
-
-
-
-
-
+
+
+
-
+
+
- +
+
@@ -115,10 +120,10 @@ if(!empty($todayincome))
@@ -130,9 +135,9 @@ if(!empty($todayincome))
@@ -143,196 +148,170 @@ if(!empty($todayincome))
-
-
+
+
+
+
-
+
-
-
diff --git a/application/views/reportslink.php b/application/views/reportslink.php
index a957af26..5d934023 100644
--- a/application/views/reportslink.php
+++ b/application/views/reportslink.php
@@ -67,9 +67,7 @@
-
-
+
-
-
-
-
-
-
-
-
+ Day Wise Report
-
+
-
+ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||