diff --git a/app/global-translations/locale-en.json b/app/global-translations/locale-en.json index 083bbc57..0de2e2e3 100644 --- a/app/global-translations/locale-en.json +++ b/app/global-translations/locale-en.json @@ -272,6 +272,7 @@ "label.heading.news": "Latest News", "label.heading.amountdisbursedfortoday":"Amount Disbursed for Today", "label.heading.loginname":"Login Name", + "label.savecollectionsheetsuccessfully":"Collection Sheet saved successfully", "#Menu Links": "..", "label.menu.office": "Office", @@ -332,6 +333,9 @@ "label.selectentity": "Select Entity", "label.nodata": "No Data", + "#Enumeration & Error Messages": "..", + "validation.msg.collectionsheet.calendarId.cannot.be.blank":"Collection sheet cannot be generated for center/group without attachmeeting define", + "------": "------------", "#Clients": "....", diff --git a/app/scripts/controllers/collection/EnterCollectionSheetController.js b/app/scripts/controllers/collection/EnterCollectionSheetController.js index a4c6a388..32534070 100644 --- a/app/scripts/controllers/collection/EnterCollectionSheetController.js +++ b/app/scripts/controllers/collection/EnterCollectionSheetController.js @@ -1,6 +1,6 @@ (function(module) { mifosX.controllers = _.extend(module, { - EnterCollectionSheetController: function(scope, resourceFactory, location, routeParams, dateFilter) { + EnterCollectionSheetController: function(scope, resourceFactory, location, routeParams, dateFilter, localStorageService, route, $timeout) { scope.offices = []; scope.centers = []; scope.groups = []; @@ -16,7 +16,16 @@ resourceFactory.officeResource.getAllOffices(function(data) { scope.offices = data; }); - + + if (localStorageService.get('Success') == 'true') { + scope.savesuccess = true; + localStorageService.remove('Success'); + scope.val = true; + $timeout(function() { + scope.val = false; + }, 3000); + + } scope.officeSelected = function(officeId) { if(officeId) { resourceFactory.centerResource.get({'officeId' : officeId}, function(data) { @@ -56,7 +65,9 @@ scope.collectionsheetdata = ""; resourceFactory.groupResource.get({'groupId' : groupId, associations : 'collectionMeetingCalendar'}, function(data) { scope.groupdetails = data.pageItems; - scope.calendarId = data.collectionMeetingCalendar.id; + if (data.collectionMeetingCalendar) { + scope.calendarId = data.collectionMeetingCalendar.id; + } if (data.collectionMeetingCalendar && data.collectionMeetingCalendar.recentEligibleMeetingDate) { scope.date.transactionDate = new Date(dateFilter(data.collectionMeetingCalendar.recentEligibleMeetingDate,'dd MMMM yyyy')); } @@ -303,17 +314,20 @@ scope.formData.bulkRepaymentTransactions = scope.bulkRepaymentTransactions; if (centerOrGroupResource == "centerResource") { resourceFactory.centerResource.save({'centerId' : scope.centerId, command : 'saveCollectionSheet'}, scope.formData,function(data){ - location.path('/home/'); + localStorageService.add('Success', true); + route.reload(); }); } else if (centerOrGroupResource == "groupResource") { resourceFactory.groupResource.save({'groupId' : scope.groupId, command : 'saveCollectionSheet'}, scope.formData,function(data){ - location.path('#/home/'); + localStorageService.add('Success', true); + route.reload(); }); - } + } }; } }); - mifosX.ng.application.controller('EnterCollectionSheetController', ['$scope', 'ResourceFactory', '$location', '$routeParams', 'dateFilter', mifosX.controllers.EnterCollectionSheetController]).run(function($log) { + mifosX.ng.application.controller('EnterCollectionSheetController', ['$scope', 'ResourceFactory', '$location', '$routeParams', 'dateFilter', 'localStorageService', + '$route', '$timeout', mifosX.controllers.EnterCollectionSheetController]).run(function($log) { $log.info("EnterCollectionSheetController initialized"); }); }(mifosX.controllers || {})); diff --git a/app/styles/app.css b/app/styles/app.css index 29a9e80f..ba3155b0 100644 --- a/app/styles/app.css +++ b/app/styles/app.css @@ -919,3 +919,8 @@ nav:hover:after{ color:deepskyblue; } +.display-save-message { + top:50%; + left:35%; + position:absolute; +} diff --git a/app/views/centers/centerattendance.html b/app/views/centers/centerattendance.html index 5f2a1ecf..472b4e3e 100644 --- a/app/views/centers/centerattendance.html +++ b/app/views/centers/centerattendance.html @@ -12,7 +12,7 @@   - {{ 'label.heading..name' | translate }} + {{ 'label.heading.name' | translate }} {{ 'label.heading.attendance' | translate }} diff --git a/app/views/centers/viewcenter.html b/app/views/centers/viewcenter.html index aa4c0607..ce1e42e8 100644 --- a/app/views/centers/viewcenter.html +++ b/app/views/centers/viewcenter.html @@ -154,7 +154,7 @@
{{ 'label.button.add' | translate }} - {{ 'label.button.attendance' | translate }} + {{ 'label.button.attendance' | translate }} {{ 'label.button.attachmeeting' | translate }}
diff --git a/app/views/collection/entercollectionsheet.html b/app/views/collection/entercollectionsheet.html index 7f7ebc4b..0f29b339 100644 --- a/app/views/collection/entercollectionsheet.html +++ b/app/views/collection/entercollectionsheet.html @@ -1,6 +1,7 @@ -
+ -
+

{{'label.savecollectionsheetsuccessfully' | translate}}

+
@@ -21,7 +22,7 @@
- +