-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #119 from OpenLMIS-Angola/OAM-187
OAM-187: Handle receive for wards
- Loading branch information
Showing
13 changed files
with
898 additions
and
127 deletions.
There are no files selected for viewing
303 changes: 197 additions & 106 deletions
303
src/stock-adjustment-creation/adjustment-creation.controller.js
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
96 changes: 96 additions & 0 deletions
96
src/stock-adjustment-creation/adjustment-creation.routes.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
/* | ||
* This program is part of the OpenLMIS logistics management information system platform software. | ||
* Copyright © 2017 VillageReach | ||
* | ||
* This program is free software: you can redistribute it and/or modify it under the terms | ||
* of the GNU Affero General Public License as published by the Free Software Foundation, either | ||
* version 3 of the License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; | ||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
* See the GNU Affero General Public License for more details. You should have received a copy of | ||
* the GNU Affero General Public License along with this program. If not, see | ||
* http://www.gnu.org/licenses. For additional information contact [email protected]. | ||
*/ | ||
|
||
(function() { | ||
'use strict'; | ||
|
||
angular | ||
.module('stock-adjustment-creation') | ||
.config(routes); | ||
|
||
routes.$inject = ['$stateProvider', 'STOCKMANAGEMENT_RIGHTS', 'SEARCH_OPTIONS', 'ADJUSTMENT_TYPE', | ||
'WARDS_CONSTANTS']; | ||
|
||
function routes($stateProvider, STOCKMANAGEMENT_RIGHTS, SEARCH_OPTIONS, ADJUSTMENT_TYPE, | ||
WARDS_CONSTANTS) { | ||
$stateProvider.state('openlmis.stockmanagement.adjustment.creation', { | ||
isOffline: true, | ||
url: '/:programId/create?page&size&keyword', | ||
views: { | ||
'@openlmis': { | ||
controller: 'StockAdjustmentCreationController', | ||
templateUrl: 'stock-adjustment-creation/adjustment-creation.html', | ||
controllerAs: 'vm' | ||
} | ||
}, | ||
accessRights: [STOCKMANAGEMENT_RIGHTS.STOCK_ADJUST], | ||
params: { | ||
program: undefined, | ||
facility: undefined, | ||
stockCardSummaries: undefined, | ||
reasons: undefined, | ||
displayItems: undefined, | ||
addedLineItems: undefined, | ||
orderableGroups: undefined | ||
}, | ||
resolve: { | ||
program: function($stateParams, programService) { | ||
if (_.isUndefined($stateParams.program)) { | ||
return programService.get($stateParams.programId); | ||
} | ||
return $stateParams.program; | ||
}, | ||
facility: function($stateParams, facilityFactory) { | ||
if (_.isUndefined($stateParams.facility)) { | ||
return facilityFactory.getUserHomeFacility(); | ||
} | ||
return $stateParams.facility; | ||
}, | ||
user: function(authorizationService) { | ||
return authorizationService.getUser(); | ||
}, | ||
orderableGroups: function($stateParams, program, facility, existingStockOrderableGroupsFactory) { | ||
if (!$stateParams.orderableGroups) { | ||
$stateParams.orderableGroups = existingStockOrderableGroupsFactory | ||
.getGroups($stateParams, program, facility); | ||
} | ||
|
||
return $stateParams.orderableGroups; | ||
}, | ||
orderableGroupsByWard: function() { | ||
return undefined; | ||
}, | ||
displayItems: function($stateParams, registerDisplayItemsService) { | ||
return registerDisplayItemsService($stateParams); | ||
}, | ||
reasons: function($stateParams, stockReasonsFactory, facility) { | ||
if (_.isUndefined($stateParams.reasons)) { | ||
return stockReasonsFactory.getAdjustmentReasons($stateParams.programId, facility.type.id); | ||
} | ||
return $stateParams.reasons; | ||
}, | ||
adjustmentType: function() { | ||
return ADJUSTMENT_TYPE.ADJUSTMENT; | ||
}, | ||
srcDstAssignments: function() { | ||
return undefined; | ||
}, | ||
hasPermissionToAddNewLot: function() { | ||
return false; | ||
} | ||
} | ||
}); | ||
} | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
/* | ||
* This program is part of the OpenLMIS logistics management information system platform software. | ||
* Copyright © 2017 VillageReach | ||
* | ||
* This program is free software: you can redistribute it and/or modify it under the terms | ||
* of the GNU Affero General Public License as published by the Free Software Foundation, either | ||
* version 3 of the License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; | ||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
* See the GNU Affero General Public License for more details. You should have received a copy of | ||
* the GNU Affero General Public License along with this program. If not, see | ||
* http://www.gnu.org/licenses. For additional information contact [email protected]. | ||
*/ | ||
|
||
(function() { | ||
|
||
'use strict'; | ||
|
||
/** | ||
* @ngdoc service | ||
* @name stock-card-summary.StockCardSummaryRepository | ||
* | ||
* @description | ||
* Repository of Stock Card Summaries. It's an abstraction layer over internals communicating with the OpenLMIS | ||
* server. | ||
*/ | ||
angular | ||
.module('stock-card-summary') | ||
.factory('StockCardSummaryRepository', StockCardSummaryRepository); | ||
|
||
StockCardSummaryRepository.$inject = ['StockCardSummary']; | ||
|
||
function StockCardSummaryRepository(StockCardSummary) { | ||
|
||
StockCardSummaryRepository.prototype.query = query; | ||
|
||
return StockCardSummaryRepository; | ||
|
||
function StockCardSummaryRepository(impl) { | ||
this.impl = impl; | ||
} | ||
|
||
/** | ||
* @ngdoc method | ||
* @methodOf stock-card-summary.StockCardSummaryRepository | ||
* @name query | ||
* | ||
* @description | ||
* Searches for Stock Card Summaries. | ||
* | ||
* @param {Object} params search and pagination parameters | ||
* @return {Promise} the promise resolving to instance of the StockCardSummary class | ||
*/ | ||
function query(params) { | ||
return this.impl.query(params) | ||
.then(function(page) { | ||
if (!page.content) { | ||
return page; | ||
} | ||
|
||
page.content = page.content.map(function(stockCardSummaryJson) { | ||
return new StockCardSummary(stockCardSummaryJson); | ||
}); | ||
return page; | ||
}); | ||
} | ||
} | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.