diff --git a/app/global-translations/locale-en.json b/app/global-translations/locale-en.json index 11f7ac2e..05dea205 100644 --- a/app/global-translations/locale-en.json +++ b/app/global-translations/locale-en.json @@ -198,6 +198,7 @@ "error.msg.column.mandatory": "Mandatory field not provided.", "error.msg.header": "You have the following errors:", "validation.msg.validation.errors.exist": "Validation errors exist.", + "validation.msg.productivecollectionsheet.staffId.cannot.be.blank":"Staff is mandatory.", "validation.msg.domain.rule.violation": "Errors contain reason for domain rule violation.", "validation.msg.invalid.date.format": "Invalid date format.", "validation.msg.invalid.month.day": "`{{params[0].value}}` is an invalid month day. ", diff --git a/app/scripts/controllers/collection/CollectionSheetController.js b/app/scripts/controllers/collection/CollectionSheetController.js index 325b8875..d74b77f7 100644 --- a/app/scripts/controllers/collection/CollectionSheetController.js +++ b/app/scripts/controllers/collection/CollectionSheetController.js @@ -28,9 +28,17 @@ scope.officeSelected = function (officeId) { scope.officeId = officeId; if (officeId) { - resourceFactory.employeeResource.getAllEmployees({loanOfficersOnly: 'true', officeId: officeId}, function (data) { + resourceFactory.employeeResource.getAllEmployees({officeId: officeId}, function (data) { scope.loanOfficers = data; }); + + resourceFactory.centerResource.getAllCenters({officeId: scope.officeId, orderBy: 'name', sortOrder: 'ASC', limit: -1}, function (data) { + scope.centers = data; + }); + + resourceFactory.groupResource.getAllGroups({officeId: scope.officeId, orderBy: 'name', sortOrder: 'ASC', limit: -1}, function (data) { + scope.groups = data; + }); } }; @@ -48,16 +56,10 @@ if (loanOfficerId) { resourceFactory.centerResource.getAllCenters({officeId: scope.officeId, staffId: loanOfficerId, orderBy: 'name', sortOrder: 'ASC', limit: -1}, function (data) { scope.centers = data; - if (data.length > 0) { - scope.centerMandatory = true; - } }); resourceFactory.groupResource.getAllGroups({officeId: scope.officeId, staffId: loanOfficerId, orderBy: 'name', sortOrder: 'ASC', limit: -1}, function (data) { scope.groups = data; - if (data.length > 0 && scope.centers.length < 0) { - scope.groupMandatory = true; - } }); } else { scope.centers = ''; @@ -75,7 +77,9 @@ } if (data.collectionMeetingCalendar && data.collectionMeetingCalendar.recentEligibleMeetingDate) { - scope.date.transactionDate = new Date(dateFilter(data.collectionMeetingCalendar.recentEligibleMeetingDate, scope.df)); + if (!scope.date.transactionDate) { + scope.date.transactionDate = new Date(dateFilter(data.collectionMeetingCalendar.recentEligibleMeetingDate, scope.df)); + } } if (data.collectionMeetingCalendar) { scope.calendarId = data.collectionMeetingCalendar.id; @@ -94,7 +98,10 @@ scope.calendarId = data.collectionMeetingCalendar.id; } if (data.collectionMeetingCalendar && data.collectionMeetingCalendar.recentEligibleMeetingDate) { - scope.date.transactionDate = new Date(dateFilter(data.collectionMeetingCalendar.recentEligibleMeetingDate, scope.df)); + if (!scope.date.transactionDate) { + scope.date.transactionDate = new Date(dateFilter(data.collectionMeetingCalendar.recentEligibleMeetingDate, scope.df)); + + } } centerOrGroupResource = "groupResource"; }); diff --git a/app/scripts/controllers/collection/ProductiveCollectionSheetController.js b/app/scripts/controllers/collection/ProductiveCollectionSheetController.js index 11259e1f..f646f4d2 100644 --- a/app/scripts/controllers/collection/ProductiveCollectionSheetController.js +++ b/app/scripts/controllers/collection/ProductiveCollectionSheetController.js @@ -7,6 +7,9 @@ params.meetingDate = routeParams.meetingDate; params.officeId = routeParams.officeId; params.staffId = routeParams.staffId; + if (params.staffId === "undefined") { + params.staffId = null; + } var centerIdArray = []; scope.submitButtonShow = false; scope.completedCenter = false; diff --git a/app/views/collection/collectionsheet.html b/app/views/collection/collectionsheet.html index 3fe09b02..bd57bb40 100644 --- a/app/views/collection/collectionsheet.html +++ b/app/views/collection/collectionsheet.html @@ -31,7 +31,7 @@