From 1bf878b5951657d4b074252cecfe0ad91cbe8b94 Mon Sep 17 00:00:00 2001 From: DominikNoga Date: Tue, 2 Jul 2024 11:06:54 +0200 Subject: [PATCH] Added home facility as valid source for receive --- .../adjustment-creation.controller.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/stock-adjustment-creation/adjustment-creation.controller.js b/src/stock-adjustment-creation/adjustment-creation.controller.js index cd3b71b..b951a36 100644 --- a/src/stock-adjustment-creation/adjustment-creation.controller.js +++ b/src/stock-adjustment-creation/adjustment-creation.controller.js @@ -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, @@ -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; @@ -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, @@ -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); + }); }); } });