Skip to content

Commit

Permalink
Added home facility as valid source for receive
Browse files Browse the repository at this point in the history
  • Loading branch information
DominikNoga committed Jul 2, 2024
1 parent e5ea461 commit 1bf878b
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/stock-adjustment-creation/adjustment-creation.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
// AO-805: Allow users with proper rights to edit product prices
'OrderableResource', 'permissionService', 'ADMINISTRATION_RIGHTS', 'authorizationService',
// AO-805: Ends here
'unitOfOrderableService', 'wardService', 'orderableGroupsByWard', 'WARDS_CONSTANTS'
'unitOfOrderableService', 'wardService', 'orderableGroupsByWard', 'WARDS_CONSTANTS', 'sourceDestinationService'
];

function controller($scope, $state, $stateParams, $filter, confirmDiscardService, program,
Expand All @@ -54,7 +54,7 @@
// AO-805: Allow users with proper rights to edit product prices
accessTokenFactory, $window, stockmanagementUrlFactory, OrderableResource, permissionService,
ADMINISTRATION_RIGHTS, authorizationService, unitOfOrderableService, wardService,
orderableGroupsByWard, WARDS_CONSTANTS) {
orderableGroupsByWard, WARDS_CONSTANTS, sourceDestinationService) {
// ANGOLASUP-717: ends here
// AO-805: Ends here
var vm = this;
Expand Down Expand Up @@ -1010,6 +1010,7 @@
vm.orderableGroups.forEach(function(group) {
vm.hasLot = vm.hasLot || orderableGroupService.lotsOf(group, hasPermissionToAddNewLot).length > 0;
});

// OAM-5: Lot code filter UI improvements.
var collator = new Intl.Collator('pt', {
numeric: true,
Expand Down Expand Up @@ -1062,9 +1063,13 @@
});

wardNames.push(vm.facility.name);
vm.wardsValidSources = vm.srcDstAssignments
.filter(function(assignment) {
return wardNames.includes(assignment.name);

sourceDestinationService
.getSourceAssignments(program.id, vm.homeFacilityWards[0].id)
.then(function(wardsValidSources) {
vm.wardsValidSources = wardsValidSources.filter(function(assignment) {
return wardNames.includes(assignment.name);
});
});
}
});
Expand Down

0 comments on commit 1bf878b

Please sign in to comment.