Skip to content

Commit

Permalink
OLMIS-7987: Move Submit Requisitionless Orders functionalities from A…
Browse files Browse the repository at this point in the history
…ngola to Core instance
  • Loading branch information
mdulko committed Sep 24, 2024
1 parent 6c67c08 commit d3ecf24
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 12 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2.1.6-SNAPSHOT / WIP
==================
New functionalities that are backwards-compatible:
* [OLMIS-7987](https://openlmis.atlassian.net/browse/OLMIS-7987): Move Submit Requisitionless Orders functionalities from Angola to Core instance

2.1.5 / 2023-06-26
==================
Bug fixes:
Expand Down
28 changes: 16 additions & 12 deletions src/stock-card-summary/stock-card-summary-repository-impl.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,17 +107,24 @@
var lotIds = getLotIds(stockCardSummariesPage.content),
orderableIds = getOrderableIds(stockCardSummariesPage.content);

return $q.all([
orderableResource.query({
var promisses = [];

if (orderableIds.length > 0) {
promisses.push(orderableResource.query({
id: orderableIds
}),
lotService.query({
}));
}

if (lotIds.length > 0) {
promisses.push(lotService.query({
id: lotIds
})
])
}));
}

return $q.all(promisses)
.then(function(responses) {
var orderablePage = responses[0],
lotPage = responses[1];
var orderablePage = responses[0] || [],
lotPage = responses[1] || [];

return combineResponses(stockCardSummariesPage, orderablePage.content,
lotPage.content, params);
Expand Down Expand Up @@ -145,7 +152,6 @@
stockCardSummariesPage.content,
params.includeInactive === 'true'
);

}

return stockCardSummariesPage;
Expand Down Expand Up @@ -197,7 +203,6 @@
return items;
}, []);
}

/**
* @param {StockCardSummary[]} stockCardSummariesPage
* @param {Boolean} includeInactive
Expand All @@ -207,7 +212,6 @@
if (includeInactive) {
return stockCardSummariesPage;
}

return _.filter(stockCardSummariesPage, function(summary) {
summary.canFulfillForMe = _.filter(summary.canFulfillForMe, function(item) {
return item.active === true;
Expand All @@ -216,4 +220,4 @@
}, []);
}
}
})();
})();

0 comments on commit d3ecf24

Please sign in to comment.