diff --git a/application/config/routes.php b/application/config/routes.php
index 0fbb63bb..a55f2d2d 100755
--- a/application/config/routes.php
+++ b/application/config/routes.php
@@ -47,7 +47,7 @@ $route['404_override'] = 'error';
$route['loginMe'] = 'login/loginMe';
$route['dashboard'] = 'user';
$route['logout'] = 'user/logout';
-
+$route['reports']='reportlistcontroller';
//<-----------Application listing Routes------------>
$route['userListing'] = 'user/userListing';
@@ -224,7 +224,9 @@ $route['Report_year_wise'] = "report/year_wise";
$route['Report_supplier'] = "report/purchase_supplier";
$route['Report_consolidate'] = "report/consolidate";
$route['Report_cumulative'] = "report/cumulative";
-
+$route['cashbookreport']="report/cashbook";
+$route['cashbookmonthlyexpenses']="report/monthexpenses";
+$route['cashbookyearlyexpenses']="report/yearexpenses";
// Company Information
$route['companyview'] = 'companycontroller/companyview';
diff --git a/application/controllers/report.php b/application/controllers/report.php
index f3ca0109..9df249d7 100755
--- a/application/controllers/report.php
+++ b/application/controllers/report.php
@@ -349,6 +349,62 @@ class report extends BaseController
$this->loadviews("Report_cumulative_day",$this->global,$data, NULL);
}
+ public function cashbook()
+ {
+
+ $this->global['pageTitle'] = 'Cashbook - Cashbook Reports - ';
+
+
+ $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();
+
+ $income="INCOME";
+ $expense="EXPENSE";
+ $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['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();
+ $this->loadviews("Reportcashbook",$this->global,$data, NULL);
+
+ }
+
+ public function monthexpenses()
+ {
+
+ $this->global['pageTitle'] = 'Cashbook - monthly expenses Reports - ';
+
+
+
+ $data['monthlyreport']=$this->dahsboard_Model->monthexpensereport();
+ // $data['monthlyincreport']=$this->dahsboard_Model->monthincomereport();
+
+ $this->loadviews("cashbookmonthlyexpenses",$this->global,$data, NULL);
+
+ }
+ public function yearexpenses()
+ {
+
+ $this->global['pageTitle'] = 'Cashbook - yearly expenses Reports - ';
+
+
+ //$data['yearlyincreport']=$this->dahsboard_Model->yearincomereport();
+ $data['yearlyreport']=$this->dahsboard_Model->yearexpensereport();
+
+
+ $this->loadviews("cashbookyearlyexpenses",$this->global,$data, NULL);
+
+ }
+
}
diff --git a/application/controllers/reportlistcontroller.php b/application/controllers/reportlistcontroller.php
new file mode 100644
index 00000000..172f4756
--- /dev/null
+++ b/application/controllers/reportlistcontroller.php
@@ -0,0 +1,39 @@
+load->model('user_model');
+ $this->load->library('form_validation');
+
+ $this->isLoggedIn();
+ }
+
+ /**
+ * This function used to load the first screen of the user
+ */
+ public function index()
+ {
+ $this->global['pageTitle'] = 'Reports list ';
+ $this->loadViews("reportslink", $this->global , NULL);
+ }
+
+
+
+}
+
+?>
diff --git a/application/logs/log-2017-11-30.php b/application/logs/log-2017-11-30.php
index 3db7712b..a105da57 100644
--- a/application/logs/log-2017-11-30.php
+++ b/application/logs/log-2017-11-30.php
@@ -5,3 +5,5 @@ ERROR - 2017-11-30 07:15:00 --> Severity: Notice --> Undefined variable: CostLi
ERROR - 2017-11-30 07:15:00 --> Severity: Notice --> Undefined variable: MaterialList /opt/lampp/htdocs/siddharth_application/application/views/alterpurchaseorder.php 235
ERROR - 2017-11-30 07:15:00 --> Severity: Notice --> Undefined variable: MaterialList /opt/lampp/htdocs/siddharth_application/application/views/alterpurchaseorder.php 281
ERROR - 2017-11-30 07:15:00 --> Severity: Notice --> Undefined variable: CostList /opt/lampp/htdocs/siddharth_application/application/views/alterpurchaseorder.php 309
+ERROR - 2017-11-30 15:14:51 --> Severity: Warning --> mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given C:\xampp\htdocs\siddharth_application\system\database\drivers\mysqli\mysqli_result.php 38
+ERROR - 2017-11-30 15:15:08 --> Severity: Notice --> Undefined property: stdClass::$AvlBudAmt C:\xampp\htdocs\siddharth_application\application\views\editimportpo.php 2715
diff --git a/application/models/dahsboard_model.php b/application/models/dahsboard_model.php
index a3ca47bd..ce5e55fc 100755
--- a/application/models/dahsboard_model.php
+++ b/application/models/dahsboard_model.php
@@ -510,13 +510,15 @@ ifnull(if(POType = 'REVENUE',sum(rt.AfterDiscount),sum(st.Afterdiscountval)),0)
ifnull(if(POType = 'REVENUE',sum(rt.AfterFreightValue),sum(st.AfterFreightValue)),0) as freight,
ifnull(if(POType = 'REVENUE',sum(rt.AfterPackagingValue),0),0) as Package,
round((ifnull(sum(pl.Quantity * pl.Rate),0)
+* ifnull(if(POType = 'IMPORT',sum(pm.ExchangeRate),0),0)
+ ifnull(if(POType = 'REVENUE',sum(rt.AfterSGST),sum(st.After_SGST)),0)
+ ifnull(if(POType = 'REVENUE',sum(rt.AfterCGST),sum(st.After_CGST)),0)
+ ifnull(if(POType = 'REVENUE',sum(rt.AfterIGST),sum(st.After_IGST)),0)
+ ifnull(if(POType = 'REVENUE',sum(rt.AfterFreightValue),sum(st.AfterFreightValue)),0)
+ ifnull(if(POType = 'REVENUE',sum(rt.AfterPackagingValue),0),0)
+
- ifnull(if(POType = 'REVENUE',sum(rt.AfterDiscount),sum(st.Afterdiscountval)),0)),2) as total
-FROM T_PurchaseOrder_Master pm
+ FROM T_PurchaseOrder_Master pm
left join T_PurchaseOrder_LineItem pl on pl.PONO = pm.PONO
left join T_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode
left join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID
@@ -905,6 +907,67 @@ group by supplier_name,material_name";
$query = $this->db->query($sql);
return $query->result();
}
+ function cashbook()
+ {
+ $sql="SELECT date,type,total,towhom,description,account_code FROM kasiram9_SIADEV.t_income_expense";
+ $query = $this->db->query($sql);
+ return $query->result();
+ }
+ // function monthincomereport()
+ // {
+ // $sql="SELECT date,type,sum(total)as total,towhom,description,account_code FROM kasiram9_SIADEV.t_income_expense where type='INCOME' and month(date)= month(current_date()) group by account_code order by total desc limit 10 ";
+ // $query = $this->db->query($sql);
+ // //echo $query;
+ // return $query->result();
+
+ // }
+ function monthexpensereport()
+ {
+ $sql="SELECT date,type,sum(total)as total,towhom,description,account_code FROM kasiram9_SIADEV.t_income_expense where type='EXPENSE' and month(date)= month(current_date()) group by account_code order by total desc limit 10 ";
+ $query = $this->db->query($sql);
+ return $query->result();
+
+ }
+ // function yearincomereport()
+ // {
+ // $sql="SELECT date,type,sum(total)as total,towhom,description,account_code FROM kasiram9_SIADEV.t_income_expense where type='INCOME' and year(date)= year(current_date()) group by account_code order by total desc limit 10 ";
+ // $query = $this->db->query($sql);
+ // return $query->result();
+
+ // }
+ function yearexpensereport()
+ {
+ $sql="SELECT date,type,sum(total)as total,towhom,description,account_code FROM kasiram9_SIADEV.t_income_expense where type='EXPENSE' and year(date)= year(current_date()) group by account_code order by total desc limit 10 ";
+ $query = $this->db->query($sql);
+ return $query->result();
+
+ }
+
+ function today_data($value='')
+ {
+ $sql="SELECT type,Sum(total) as todaydata FROM kasiram9_SIADEV.t_income_expense WHERE type = ? AND DATE(date) = CURRENT_DATE";
+ $query = $this->db->query($sql,array($value));
+ return $query->result();
+
+ }
+
+ function monthwise_data($value='')
+ {
+ $sql="SELECT type,Sum(total) as monthlydata FROM kasiram9_SIADEV.t_income_expense WHERE type = ? AND MONTH(date) = MONTH(curdate())";
+ $query = $this->db->query($sql,array($value));
+ return $query->result();
+
+ }
+ function yearwise_data($value='')
+ {
+
+ $sql="SELECT type,sum(total) as yearlydata from t_income_expense
+ where
+ type = ? and ((YEAR(date) = YEAR(CURRENT_DATE) and MONTH(date) >= 4) or (YEAR(date) = YEAR(CURRENT_DATE)+1 and MONTH(date) <= 3))";
+ $query = $this->db->query($sql,array($value));
+ return $query->result();
+
+ }
}
?>
\ No newline at end of file
diff --git a/application/views/cashbookmonthlyexpenses.php b/application/views/cashbookmonthlyexpenses.php
new file mode 100644
index 00000000..c7894811
--- /dev/null
+++ b/application/views/cashbookmonthlyexpenses.php
@@ -0,0 +1,127 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Monthly Expenses
+
+
+
+
+
+
+
+
+ | Date |
+ Paid To |
+ Paid Type |
+ Amount |
+ Account Code |
+ Description |
+
+
+
+
+
+
+
+
+ | date?> |
+ towhom?> |
+ type?> |
+ total?> |
+ account_code?> |
+ description?> |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/application/views/cashbookyearlyexpenses.php b/application/views/cashbookyearlyexpenses.php
new file mode 100644
index 00000000..4b5794a9
--- /dev/null
+++ b/application/views/cashbookyearlyexpenses.php
@@ -0,0 +1,166 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Yearly Expenses
+
+
+
+
+
+
+
+
+ | Date |
+ Paid To |
+ Paid Type |
+ Amount |
+ Account Code |
+ Description |
+
+
+
+
+
+
+
+
+ | date?> |
+ towhom?> |
+ type?> |
+ total?> |
+ account_code?> |
+ description?> |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/application/views/includes/header.php b/application/views/includes/header.php
index 9659b5e5..20dc236b 100755
--- a/application/views/includes/header.php
+++ b/application/views/includes/header.php
@@ -633,90 +633,10 @@ $(function() {
{ ?>
-
-
-
+
+ ReportList
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file