diff --git a/Apollo/api/application/models/DayBook_model.php b/Apollo/api/application/models/DayBook_model.php
index e637863a..49119bd8 100644
--- a/Apollo/api/application/models/DayBook_model.php
+++ b/Apollo/api/application/models/DayBook_model.php
@@ -38,16 +38,18 @@ class DayBook_model extends CI_Model
public function get_Daybook_Details_List($reqData, $reqDataBy) {
- if($reqData['date'] != '') {
+ if($reqData['date'] != '' && $reqData['dateTo'] != '') {
$this->db->select('t1.*, t2.ListName, t3.TypeName');
$this->db->from(''.DAYBOOKMASTER. ' as t1');
$this->db->join('' . PICK_LIST_DETAILS . ' as t2', 't2.ListCode = t1.Name', 'LEFT');
$this->db->join('' . INCOMEOUTCOMEMASTER . ' as t3', 't3.ID = t1.Type', 'LEFT');
- $this->db->where('t1.Date', $reqData['date']);
+ $this->db->where('t1.Date >=', $reqData['date']);
+ $this->db->where('t1.Date <=', $reqData['dateTo']);
+ // $this->db->where('t1.Date', $reqData['date']);
$this->db->order_by('CreatedOn', 'DESC');
$this->db->where('t1.BranchCode', $reqDataBy['localBranchID']);
} else {
- $this->db->select('t1.*, t2.ListName, t3.TypeName');
+ $this->db->select('t1.*, t2.ListName, t3.TypeName');
$this->db->from(''.DAYBOOKMASTER. ' as t1');
$this->db->join('' . PICK_LIST_DETAILS . ' as t2', 't2.ListCode = t1.Name', 'LEFT');
$this->db->join('' . INCOMEOUTCOMEMASTER . ' as t3', 't3.ID = t1.Type', 'LEFT');
@@ -139,16 +141,31 @@ class DayBook_model extends CI_Model
}
public function get_Daybook_Details_List_superAdmin($reqData, $reqDataBy){
- $this->db->select('t1.*, t2.ListName, t3.TypeName, t4.BranchName');
- $this->db->from(''.DAYBOOKMASTER. ' as t1');
- $this->db->join('' . PICK_LIST_DETAILS . ' as t2', 't2.ListCode = t1.Name', 'LEFT');
- $this->db->join('' . INCOMEOUTCOMEMASTER . ' as t3', 't3.ID = t1.Type', 'LEFT');
- $this->db->join('' . BRANCH . ' as t4', 't4.BranchCode = t1.BranchCode', 'LEFT');
- $this->db->where('t1.Date', $reqData['date']);
- $this->db->order_by('CreatedOn', 'DESC');
- // $this->db->join('' . COURSE . ' as t2', 't2.UniversityID = t1.UniversityID', 'LEFT');
- $dayBookDetails = $this->db->get();
- $dayBookDetailsList = $dayBookDetails->result();
+
+ if($reqData['date'] != '' && $reqData['dateTo'] != '') {
+ $this->db->select('t1.*, t2.ListName, t3.TypeName, t4.BranchName');
+ $this->db->from(''.DAYBOOKMASTER. ' as t1');
+ $this->db->join('' . PICK_LIST_DETAILS . ' as t2', 't2.ListCode = t1.Name', 'LEFT');
+ $this->db->join('' . INCOMEOUTCOMEMASTER . ' as t3', 't3.ID = t1.Type', 'LEFT');
+ $this->db->join('' . BRANCH . ' as t4', 't4.BranchCode = t1.BranchCode', 'LEFT');
+ $this->db->where('t1.Date >=', $reqData['date']);
+ $this->db->where('t1.Date <=', $reqData['dateTo']);
+ $this->db->order_by('CreatedOn', 'DESC');
+ // $this->db->join('' . COURSE . ' as t2', 't2.UniversityID = t1.UniversityID', 'LEFT');
+ $dayBookDetails = $this->db->get();
+ $dayBookDetailsList = $dayBookDetails->result();
+ } else {
+ $this->db->select('t1.*, t2.ListName, t3.TypeName, t4.BranchName');
+ $this->db->from(''.DAYBOOKMASTER. ' as t1');
+ $this->db->join('' . PICK_LIST_DETAILS . ' as t2', 't2.ListCode = t1.Name', 'LEFT');
+ $this->db->join('' . INCOMEOUTCOMEMASTER . ' as t3', 't3.ID = t1.Type', 'LEFT');
+ $this->db->join('' . BRANCH . ' as t4', 't4.BranchCode = t1.BranchCode', 'LEFT');
+ // $this->db->where('t1.Date', $reqData['date']);
+ $this->db->order_by('CreatedOn', 'DESC');
+ // $this->db->join('' . COURSE . ' as t2', 't2.UniversityID = t1.UniversityID', 'LEFT');
+ $dayBookDetails = $this->db->get();
+ $dayBookDetailsList = $dayBookDetails->result();
+ }
$results['dayBookListStatus'] = true;
$results['dayBookListDetails'] = $dayBookDetailsList;
diff --git a/Apollo/assets/js/controllers/daybookCtrl.js b/Apollo/assets/js/controllers/daybookCtrl.js
index 66353cc1..9efc45e9 100644
--- a/Apollo/assets/js/controllers/daybookCtrl.js
+++ b/Apollo/assets/js/controllers/daybookCtrl.js
@@ -10,13 +10,15 @@ app.controller('daybookCtrl', ["$scope", "$rootScope", "toaster", "$filter", "ng
var localDetails = ipCookie('cookiechk');
$scope.searchData = {
- "date": ""
+ "date": "",
+ "dateTo": ""
}
$scope.init = function () {
$scope.currentDate = new Date();
var formate = "dd-MM-yyyy";
$scope.searchData.date = $filter('date')(new Date($scope.currentDate), formate);
+ $scope.searchData.dateTo = $filter('date')(new Date($scope.currentDate), formate);
$scope.getDayBookList();
$scope.getIncomeExpenseType_Status();
}
@@ -33,6 +35,25 @@ app.controller('daybookCtrl', ["$scope", "$rootScope", "toaster", "$filter", "ng
}
}
+ $scope.changeToDate = function () {
+
+ if($scope.searchData.dateTo !== undefined) {
+ var formate = "dd-MM-yyyy";
+ $scope.searchData.dateTo = $filter('date')(new Date($scope.searchData.dateTo), formate);
+ $scope.getDayBookList();
+ } else {
+ $scope.searchData.dateTo = '';
+ $scope.getDayBookList();
+ }
+ }
+
+ // sorting function for table params
+ $scope.sort = function (keyname) {
+ // alert();
+ $scope.sortKey = keyname; //set the sortKey to the param passed
+ $scope.reverse = !$scope.reverse; //if true make it false and vice versa
+ }
+
$scope.noRecordFound = true;
$scope.getDayBookList = function () {
@@ -204,7 +225,7 @@ app.controller('daybookCtrl', ["$scope", "$rootScope", "toaster", "$filter", "ng
} else {
var formate = "dd-MM-yyyy";
$scope.myModelAdd.date = $filter('date')(new Date($scope.myModelAdd.date), formate);
- $scope.myModelAdd.status = 'Pending';
+ $scope.myModelAdd.status = $scope.myModelAdd.name == 'I001' ? 'Pending' : 'Approved';
// $scope.data.push(myModelAdd);
var addDayBookDetails = {
diff --git a/Apollo/assets/js/controllers/daybookadminCtrl.js b/Apollo/assets/js/controllers/daybookadminCtrl.js
index abfce0e8..4a1f1512 100644
--- a/Apollo/assets/js/controllers/daybookadminCtrl.js
+++ b/Apollo/assets/js/controllers/daybookadminCtrl.js
@@ -21,8 +21,9 @@ app.controller('daybookadminCtrl', ["$scope", "$rootScope", "toaster", "$filter"
// }
// }
- $scope.searchData = {
- "date": ""
+ $scope.searchData = {
+ "date": "",
+ "dateTo": ""
}
$scope.init = function () {
@@ -34,6 +35,7 @@ app.controller('daybookadminCtrl', ["$scope", "$rootScope", "toaster", "$filter"
$scope.currentDate = new Date();
var formate = "dd-MM-yyyy";
$scope.searchData.date = $filter('date')(new Date($scope.currentDate), formate);
+ $scope.searchData.dateTo = $filter('date')(new Date($scope.currentDate), formate);
$scope.getIncomeExpenseType_Status();
$scope.getDayBookList();
} else if(LOCALTYPE === 'R004') {
@@ -43,13 +45,16 @@ app.controller('daybookadminCtrl', ["$scope", "$rootScope", "toaster", "$filter"
$scope.currentDate = new Date();
var formate = "dd-MM-yyyy";
$scope.searchData.date = $filter('date')(new Date($scope.currentDate), formate);
+ $scope.searchData.dateTo = $filter('date')(new Date($scope.currentDate), formate);
$scope.getIncomeExpenseType_Status();
$scope.getDayBookList();
}
}
+
$scope.changeDate = function () {
- if($scope.searchData.date !== undefined) {
+
+ if($scope.searchData.date !== undefined) {
var formate = "dd-MM-yyyy";
$scope.searchData.date = $filter('date')(new Date($scope.searchData.date), formate);
$scope.getDayBookList();
@@ -59,6 +64,24 @@ app.controller('daybookadminCtrl', ["$scope", "$rootScope", "toaster", "$filter"
}
}
+ $scope.changeToDate = function () {
+
+ if($scope.searchData.dateTo !== undefined) {
+ var formate = "dd-MM-yyyy";
+ $scope.searchData.dateTo = $filter('date')(new Date($scope.searchData.dateTo), formate);
+ $scope.getDayBookList();
+ } else {
+ $scope.searchData.dateTo = '';
+ $scope.getDayBookList();
+ }
+ }
+
+ // sorting function for table params
+ $scope.sort = function (keyname) {
+ // alert();
+ $scope.sortKey = keyname; //set the sortKey to the param passed
+ $scope.reverse = !$scope.reverse; //if true make it false and vice versa
+ }
$scope.getIncomeExpenseType_Status = function () {
var getIncomeExpenseType = {
diff --git a/Apollo/assets/js/controllers/daybooksuperadminCtrl.js b/Apollo/assets/js/controllers/daybooksuperadminCtrl.js
index 092678cc..d2f77e3c 100644
--- a/Apollo/assets/js/controllers/daybooksuperadminCtrl.js
+++ b/Apollo/assets/js/controllers/daybooksuperadminCtrl.js
@@ -21,8 +21,9 @@ app.controller('daybooksuperadminCtrl', ["$scope", "$rootScope", "toaster", "$fi
// }
// }
- $scope.searchData = {
- "date": ""
+ $scope.searchData = {
+ "date": "",
+ "dateTo": ""
}
$scope.init = function () {
@@ -35,6 +36,7 @@ app.controller('daybooksuperadminCtrl', ["$scope", "$rootScope", "toaster", "$fi
$scope.currentDate = new Date();
var formate = "dd-MM-yyyy";
$scope.searchData.date = $filter('date')(new Date($scope.currentDate), formate);
+ $scope.searchData.dateTo = $filter('date')(new Date($scope.currentDate), formate);
$scope.getIncomeExpenseType_Status();
$scope.getDayBookList();
} else {
@@ -42,8 +44,9 @@ app.controller('daybooksuperadminCtrl', ["$scope", "$rootScope", "toaster", "$fi
}
}
- $scope.changeDate = function () {
- if($scope.searchData.date !== undefined) {
+ $scope.changeDate = function () {
+
+ if($scope.searchData.date !== undefined) {
var formate = "dd-MM-yyyy";
$scope.searchData.date = $filter('date')(new Date($scope.searchData.date), formate);
$scope.getDayBookList();
@@ -53,6 +56,25 @@ app.controller('daybooksuperadminCtrl', ["$scope", "$rootScope", "toaster", "$fi
}
}
+ $scope.changeToDate = function () {
+
+ if($scope.searchData.dateTo !== undefined) {
+ var formate = "dd-MM-yyyy";
+ $scope.searchData.dateTo = $filter('date')(new Date($scope.searchData.dateTo), formate);
+ $scope.getDayBookList();
+ } else {
+ $scope.searchData.dateTo = '';
+ $scope.getDayBookList();
+ }
+ }
+
+ // sorting function for table params
+ $scope.sort = function (keyname) {
+ // alert();
+ $scope.sortKey = keyname; //set the sortKey to the param passed
+ $scope.reverse = !$scope.reverse; //if true make it false and vice versa
+ }
+
$scope.getIncomeExpenseType_Status = function () {
var getIncomeExpenseType = {
diff --git a/Apollo/assets/views/daybook/daybook.html b/Apollo/assets/views/daybook/daybook.html
index e978a056..a7982a29 100644
--- a/Apollo/assets/views/daybook/daybook.html
+++ b/Apollo/assets/views/daybook/daybook.html
@@ -45,8 +45,7 @@
+
+
+
+
+
+
+
+
- Description
-
+ | Description
+
|
- Status
-
+ | Status
+
|
Activity
|
@@ -93,18 +105,20 @@
{{p.TypeName}} |
{{p.Amount}} |
{{p.Description}} |
-
- - |
- {{p.Status}}
+
+ | {{p.Status}}
{{p.Status}}
{{p.Status}}
|
- - |
+ - |
+
+
+ |
|
-
@@ -230,10 +244,10 @@
Amount
-
+
Amount is Required
-
+
-->
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
@@ -58,22 +69,36 @@
+
- | Date
-
+ | Date
+
|
- Income/Expense
-
+ | Income/Expense
+
|
- Type
-
+ | Type
+
|
- Amount
-
+ | Amount
+
|
Description
@@ -109,23 +134,23 @@
|
- Date
-
+ | Date
+
|
- Income/Expense
-
+ | Income/Expense
+
|
- Type
-
+ | Type
+
|
- Amount
-
+ | Amount
+
|
- Description
-
+ | Description
+
|
- Status
-
+ | Status
+
|
diff --git a/Apollo/assets/views/daybook/daybooksuperadmin.html b/Apollo/assets/views/daybook/daybooksuperadmin.html
index eeb693d6..d2361c21 100644
--- a/Apollo/assets/views/daybook/daybooksuperadmin.html
+++ b/Apollo/assets/views/daybook/daybooksuperadmin.html
@@ -29,22 +29,33 @@
-->
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
@@ -58,28 +69,42 @@
+
- | Branch
-
+ | Branch
+
|
- Date
-
+ | Date
+
|
- Income/Expense
-
+ | Income/Expense
+
|
- Type
-
+ | Type
+
|
- Amount
-
+ | Amount
+
|
- Description
-
+ | Description
+
|
- Description
-
+ | Description
+
|
- Status
-
+ | Status
+
|