daybook updates: kdk
This commit is contained in:
parent
6b57550938
commit
696973b7fc
@ -1704,9 +1704,16 @@ class Fees_status_model extends CI_Model
|
||||
$sql = "SELECT * FROM ".DAYBOOKMASTER." WHERE BranchCode = '$branch'
|
||||
ORDER BY CreatedOn DESC
|
||||
LIMIT 1";
|
||||
$prevBalance = 0;
|
||||
$latestUpdate = $this->db->query($sql);
|
||||
$latestUpdateDetails = $latestUpdate->result();
|
||||
|
||||
If(is_array($latestUpdateDetails) && count($latestUpdateDetails)>0)
|
||||
{
|
||||
$prevBalance = $latestUpdateDetails[0]->Balance;
|
||||
}else{
|
||||
}
|
||||
|
||||
if($Arr['Name'] == 'I002') {
|
||||
//Income
|
||||
$Arr['Balance'] = $prevBalance + $Arr['Amount'];
|
||||
@ -1719,8 +1726,8 @@ class Fees_status_model extends CI_Model
|
||||
|
||||
$this->db->insert(DAYBOOKMASTER, $Arr);
|
||||
if ($this->db->affected_rows() == '1') {
|
||||
$result['addDayBookStatus'] = true;
|
||||
$result['message'] = "Successfully DayBook Details Added";
|
||||
$result['addDayBookStatus'] = true;
|
||||
$result['message'] = "Successfully DayBook Details Added";
|
||||
} else {
|
||||
$result['addDayBookStatus'] = false;
|
||||
$result['message'] = "Something went wrong.please try again";
|
||||
|
||||
@ -8,12 +8,14 @@ app.controller('daybookCtrl', ["$scope", "$rootScope", "toaster", "$filter", "ng
|
||||
// get local client details
|
||||
var localDetail = JSON.parse(localStorage.getItem('localObj'));
|
||||
var localDetails = ipCookie('cookiechk');
|
||||
|
||||
$scope.disableAddButton = false;
|
||||
$scope.disableEditButton = false;
|
||||
|
||||
$scope.searchData = {
|
||||
"date": "",
|
||||
"dateTo": ""
|
||||
}
|
||||
|
||||
|
||||
// get the data while page loading functions goes here
|
||||
$scope.init = function () {
|
||||
const LOCALTYPE = localDetail.localType;
|
||||
@ -331,7 +333,7 @@ $scope.dayBookApprovalAccess = '';
|
||||
angular.element('.ng-invalid[name=' + firstError + ']').focus();
|
||||
// swal("The form cannot be submitted because it contains validation errors!", "Errors are marked with a red, dashed border!", "error");
|
||||
} else {
|
||||
|
||||
$scope.disableAddButton = true;
|
||||
var formate = "dd-MM-yyyy";
|
||||
$scope.myModelAdd.date = $filter('date')(new Date($scope.myModelAdd.date), formate);
|
||||
$scope.myModelAdd.status = $scope.myModelAdd.name == 'I001' ? 'Pending' : 'Approved';
|
||||
@ -352,8 +354,10 @@ $scope.dayBookApprovalAccess = '';
|
||||
if (response.data.addDayBookStatus) {
|
||||
swal(" ", "Income/Expense added successfully.", "success");
|
||||
$state.go($state.current, {}, { reload: true });
|
||||
$scope.disableAddButton = false;
|
||||
} else {
|
||||
swal(" ", response.data.message, "error");
|
||||
$scope.disableAddButton = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -395,6 +399,7 @@ $scope.dayBookApprovalAccess = '';
|
||||
// swal("The form cannot be submitted because it contains validation errors!", "Errors are marked with a red, dashed border!", "error");
|
||||
} else {
|
||||
// alert(JSON.stringify($scope.myModel));exit();
|
||||
$scope.disableEditButton = true;
|
||||
var updateDayBookDetails = {
|
||||
method: 'POST',
|
||||
url: apiPoint.url + 'updateDayBookDetails/',
|
||||
@ -412,8 +417,10 @@ $scope.dayBookApprovalAccess = '';
|
||||
// for success state
|
||||
$scope.editId = -1;
|
||||
$scope.getDayBookList();
|
||||
$scope.disableEditButton = false;
|
||||
} else {
|
||||
swal(" ", response.data.message, "error");
|
||||
$scope.disableEditButton = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -9,6 +9,9 @@ app.controller('daybookadminCtrl', ["$scope", "$rootScope", "toaster", "$filter"
|
||||
var localDetail = JSON.parse(localStorage.getItem('localObj'));
|
||||
var localDetails = ipCookie('cookiechk');
|
||||
|
||||
$scope.disableAddButton = false;
|
||||
$scope.disableEditButton = false;
|
||||
|
||||
$scope.searchData = {
|
||||
"date": "",
|
||||
"dateTo": ""
|
||||
@ -331,7 +334,7 @@ $scope.dayBookApprovalAccess = '';
|
||||
angular.element('.ng-invalid[name=' + firstError + ']').focus();
|
||||
// swal("The form cannot be submitted because it contains validation errors!", "Errors are marked with a red, dashed border!", "error");
|
||||
} else {
|
||||
|
||||
$scope.disableAddButton = true;
|
||||
var formate = "dd-MM-yyyy";
|
||||
$scope.myModelAdd.date = $filter('date')(new Date($scope.myModelAdd.date), formate);
|
||||
$scope.myModelAdd.status = $scope.myModelAdd.name == 'I001' ? 'Pending' : 'Approved';
|
||||
@ -352,8 +355,10 @@ $scope.dayBookApprovalAccess = '';
|
||||
if (response.data.addDayBookStatus) {
|
||||
swal(" ", "Income/Expense added successfully.", "success");
|
||||
$state.go($state.current, {}, { reload: true });
|
||||
$scope.disableAddButton = false;
|
||||
} else {
|
||||
swal(" ", response.data.message, "error");
|
||||
$scope.disableAddButton = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -395,6 +400,7 @@ $scope.dayBookApprovalAccess = '';
|
||||
// swal("The form cannot be submitted because it contains validation errors!", "Errors are marked with a red, dashed border!", "error");
|
||||
} else {
|
||||
// alert(JSON.stringify($scope.myModel));exit();
|
||||
$scope.disableEditButton = true;
|
||||
var updateDayBookDetails = {
|
||||
method: 'POST',
|
||||
url: apiPoint.url + 'updateDayBookDetails/',
|
||||
@ -412,8 +418,10 @@ $scope.dayBookApprovalAccess = '';
|
||||
// for success state
|
||||
$scope.editId = -1;
|
||||
$scope.getDayBookList();
|
||||
$scope.disableEditButton = false;
|
||||
} else {
|
||||
swal(" ", response.data.message, "error");
|
||||
$scope.disableEditButton = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -11,6 +11,8 @@ app.controller('daybookadminapprovalCtrl', ["$scope", "$rootScope", "toaster", "
|
||||
$scope.localTypeViewAdmin = false;
|
||||
$scope.localTypeViewSuperAdmin = false;
|
||||
|
||||
$scope.disableStatusUpdateButton = false;
|
||||
|
||||
$scope.searchData = {
|
||||
"date": "",
|
||||
"dateTo": ""
|
||||
@ -238,6 +240,7 @@ app.controller('daybookadminapprovalCtrl', ["$scope", "$rootScope", "toaster", "
|
||||
this.comments = $scope.myStatusModel.description;
|
||||
}
|
||||
if(selectedItems.length > 0) {
|
||||
$scope.disableStatusUpdateButton = true;
|
||||
var updateStudyMaterial = {
|
||||
method: 'POST',
|
||||
url: apiPoint.url + 'updateDayBookStatusAdmin/',
|
||||
@ -261,8 +264,10 @@ app.controller('daybookadminapprovalCtrl', ["$scope", "$rootScope", "toaster", "
|
||||
}
|
||||
$scope.allSelected('undefined');
|
||||
$scope.OpenWindowStatus = false;
|
||||
$scope.disableStatusUpdateButton = false;
|
||||
} else {
|
||||
swal(" ", response.data.message, "error");
|
||||
$scope.disableStatusUpdateButton = false;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
|
||||
@ -11,6 +11,8 @@ app.controller('daybookapprovalCtrl', ["$scope", "$rootScope", "toaster", "$filt
|
||||
$scope.localTypeViewAdmin = false;
|
||||
$scope.localTypeViewSuperAdmin = false;
|
||||
|
||||
$scope.disableStatusUpdateButton = false;
|
||||
|
||||
$scope.searchData = {
|
||||
"date": "",
|
||||
"dateTo": ""
|
||||
@ -224,6 +226,7 @@ app.controller('daybookapprovalCtrl', ["$scope", "$rootScope", "toaster", "$filt
|
||||
}
|
||||
angular.element('.ng-invalid[name=' + firstError + ']').focus();
|
||||
} else {
|
||||
|
||||
var selectedItems = [];
|
||||
var ItemsSelected = $scope.searchResultDetails.filter(function (item) {
|
||||
if (item.Selected === true && item.Status === 'Pending' ) {
|
||||
@ -238,6 +241,7 @@ app.controller('daybookapprovalCtrl', ["$scope", "$rootScope", "toaster", "$filt
|
||||
this.comments = $scope.myStatusModel.description;
|
||||
}
|
||||
if(selectedItems.length > 0) {
|
||||
$scope.disableStatusUpdateButton = true;
|
||||
var updateStudyMaterial = {
|
||||
method: 'POST',
|
||||
url: apiPoint.url + 'updateDayBookStatusAdmin/',
|
||||
@ -261,8 +265,10 @@ app.controller('daybookapprovalCtrl', ["$scope", "$rootScope", "toaster", "$filt
|
||||
}
|
||||
$scope.allSelected('undefined');
|
||||
$scope.OpenWindowStatus = false;
|
||||
$scope.disableStatusUpdateButton = false;
|
||||
} else {
|
||||
swal(" ", response.data.message, "error");
|
||||
$scope.disableStatusUpdateButton = false;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
|
||||
@ -8,6 +8,8 @@ app.controller('daybooksuperadminCtrl', ["$scope", "$rootScope", "toaster", "$fi
|
||||
// get local client details
|
||||
var localDetail = JSON.parse(localStorage.getItem('localObj'));
|
||||
var localDetails = ipCookie('cookiechk');
|
||||
$scope.disableAddButton = false;
|
||||
$scope.disableEditButton = false;
|
||||
|
||||
$scope.searchData = {
|
||||
"date": "",
|
||||
@ -59,7 +61,7 @@ app.controller('daybooksuperadminCtrl', ["$scope", "$rootScope", "toaster", "$fi
|
||||
}
|
||||
|
||||
function getDetails() {
|
||||
const LOCALTYPE = localDetail.localType;
|
||||
const LOCALTYPE = localDetail.localType;
|
||||
if(LOCALTYPE === 'R004') {
|
||||
$scope.currentDate = new Date();
|
||||
var d = new Date();
|
||||
@ -396,7 +398,7 @@ $scope.dayBookApprovalAccess = '';
|
||||
angular.element('.ng-invalid[name=' + firstError + ']').focus();
|
||||
// swal("The form cannot be submitted because it contains validation errors!", "Errors are marked with a red, dashed border!", "error");
|
||||
} else {
|
||||
|
||||
$scope.disableAddButton = true;
|
||||
var formate = "dd-MM-yyyy";
|
||||
$scope.myModelAdd.date = $filter('date')(new Date($scope.myModelAdd.date), formate);
|
||||
$scope.myModelAdd.status = $scope.myModelAdd.name == 'I001' ? 'Pending' : 'Approved';
|
||||
@ -419,8 +421,10 @@ $scope.dayBookApprovalAccess = '';
|
||||
// $state.go($state.current, {}, { reload: true });
|
||||
$scope.viewStudentDetailsPage = false;
|
||||
$scope.myActivateDiv();
|
||||
$scope.disableAddButton = false;
|
||||
} else {
|
||||
swal(" ", response.data.message, "error");
|
||||
$scope.disableAddButton = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -484,6 +488,7 @@ $scope.dayBookApprovalAccess = '';
|
||||
// swal("The form cannot be submitted because it contains validation errors!", "Errors are marked with a red, dashed border!", "error");
|
||||
} else {
|
||||
// alert(JSON.stringify($scope.myModel));exit();
|
||||
$scope.disableEditButton = true;
|
||||
var updateDayBookDetails = {
|
||||
method: 'POST',
|
||||
url: apiPoint.url + 'updateDayBookDetails/',
|
||||
@ -501,8 +506,10 @@ $scope.dayBookApprovalAccess = '';
|
||||
// for success state
|
||||
$scope.editId = -1;
|
||||
$scope.getDayBookList();
|
||||
$scope.disableEditButton = false;
|
||||
} else {
|
||||
swal(" ", response.data.message, "error");
|
||||
$scope.disableEditButton = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -323,8 +323,8 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="center">
|
||||
<button type="submit" tabindex="8" ladda="ldloading1.zoom_in" class="btn btn-sm btn-success" data-style="zoom-in">
|
||||
Update
|
||||
<button type="submit" tabindex="8" ladda="ldloading1.zoom_in" class="btn btn-sm btn-success" data-style="zoom-in" ng-disabled="disableStatusUpdateButton">
|
||||
<i class='fa fa-spinner fa-spin' ng-if="disableStatusUpdateButton"> </i> Update
|
||||
</button>
|
||||
<!--<button type="reset" tabindex="9" class="btn btn-warning btn-wide" tabindex="9" ng-click="employeeForm.resetCourse(Form)">
|
||||
Reset
|
||||
|
||||
@ -323,8 +323,8 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="center">
|
||||
<button type="submit" tabindex="8" ladda="ldloading1.zoom_in" class="btn btn-sm btn-success" data-style="zoom-in">
|
||||
Update
|
||||
<button type="submit" tabindex="8" ladda="ldloading1.zoom_in" class="btn btn-sm btn-success" data-style="zoom-in" ng-disabled="disableStatusUpdateButton">
|
||||
<i class='fa fa-spinner fa-spin' ng-if="disableStatusUpdateButton"> </i> Update
|
||||
</button>
|
||||
<!--<button type="reset" tabindex="9" class="btn btn-warning btn-wide" tabindex="9" ng-click="employeeForm.resetCourse(Form)">
|
||||
Reset
|
||||
|
||||
@ -238,9 +238,9 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="center">
|
||||
<button type="submit" ng-disabled="disableButton" tabindex="4" ladda="ldloading1.zoom_in" class="btn btn-sm btn-success"
|
||||
<button type="submit" ng-disabled="disableEditButton" tabindex="4" ladda="ldloading1.zoom_in" class="btn btn-sm btn-success"
|
||||
data-style="zoom-in">
|
||||
Submit
|
||||
<i class='fa fa-spinner fa-spin' ng-if="disableEditButton"> </i> Submit
|
||||
</button>
|
||||
<button type="cancel" ng-click="editClose()" tabindex="5" class="btn btn-warning btn-sm" ng-click="employeeForm.resetCourse(Form)">
|
||||
Cancel
|
||||
@ -364,9 +364,9 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="pull-right">
|
||||
<button type="submit" ng-disabled="disableButton" tabindex="4" ladda="ldloading1.zoom_in" class="btn btn-sm btn-success"
|
||||
<button type="submit" ng-disabled="disableAddButton" tabindex="4" ladda="ldloading1.zoom_in" class="btn btn-sm btn-success"
|
||||
data-style="zoom-in">
|
||||
Submit
|
||||
<i class='fa fa-spinner fa-spin' ng-if="disableAddButton"> </i> Submit
|
||||
</button>
|
||||
<button type="cancel" ng-click="daybookAdd.reset(Form)" tabindex="5" class="btn btn-warning btn-sm" ng-click="employeeForm.resetCourse(Form)">
|
||||
Reset
|
||||
|
||||
@ -239,9 +239,9 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="center">
|
||||
<button type="submit" ng-disabled="disableButton" tabindex="4" ladda="ldloading1.zoom_in" class="btn btn-sm btn-success"
|
||||
<button type="submit" ng-disabled="disableEditButton" tabindex="4" ladda="ldloading1.zoom_in" class="btn btn-sm btn-success"
|
||||
data-style="zoom-in">
|
||||
Submit
|
||||
<i class='fa fa-spinner fa-spin' ng-if="disableEditButton"> </i> Submit
|
||||
</button>
|
||||
<button type="cancel" ng-click="editClose()" tabindex="5" class="btn btn-warning btn-sm" ng-click="employeeForm.resetCourse(Form)">
|
||||
Cancel
|
||||
@ -365,9 +365,9 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="pull-right">
|
||||
<button type="submit" ng-disabled="disableButton" tabindex="4" ladda="ldloading1.zoom_in" class="btn btn-sm btn-success"
|
||||
<button type="submit" ng-disabled="disableAddButton" tabindex="4" ladda="ldloading1.zoom_in" class="btn btn-sm btn-success"
|
||||
data-style="zoom-in">
|
||||
Submit
|
||||
<i class='fa fa-spinner fa-spin' ng-if="disableAddButton"> </i> Submit
|
||||
</button>
|
||||
<button type="cancel" ng-click="daybookAdd.reset(Form)" tabindex="5" class="btn btn-warning btn-sm" ng-click="employeeForm.resetCourse(Form)">
|
||||
Reset
|
||||
|
||||
@ -263,9 +263,9 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="center">
|
||||
<button type="submit" ng-disabled="disableButton" tabindex="4" ladda="ldloading1.zoom_in" class="btn btn-sm btn-success"
|
||||
<button type="submit" ng-disabled="disableEditButton" tabindex="4" ladda="ldloading1.zoom_in" class="btn btn-sm btn-success"
|
||||
data-style="zoom-in">
|
||||
Submit
|
||||
<i class='fa fa-spinner fa-spin' ng-if="disableEditButton"> </i> Submit
|
||||
</button>
|
||||
<button type="cancel" ng-click="editClose()" tabindex="5" class="btn btn-warning btn-sm" ng-click="employeeForm.resetCourse(Form)">
|
||||
Cancel
|
||||
@ -389,9 +389,9 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="pull-right">
|
||||
<button type="submit" ng-disabled="disableButton" tabindex="4" ladda="ldloading1.zoom_in" class="btn btn-sm btn-success"
|
||||
<button type="submit" ng-disabled="disableAddButton" tabindex="4" ladda="ldloading1.zoom_in" class="btn btn-sm btn-success"
|
||||
data-style="zoom-in">
|
||||
Submit
|
||||
<i class='fa fa-spinner fa-spin' ng-if="disableAddButton"> </i> Submit
|
||||
</button>
|
||||
<button type="cancel" ng-click="daybookAdd.reset(Form)" tabindex="5" class="btn btn-warning btn-sm" ng-click="employeeForm.resetCourse(Form)">
|
||||
Reset
|
||||
|
||||
Loading…
Reference in New Issue
Block a user