Skip to content

Commit

Permalink
Merge pull request #68 from OpenLMIS/OLMIS-7987
Browse files Browse the repository at this point in the history
OLMIS-7987: Move Submit Requisitionless Orders functionalities from Angola to Core instance
  • Loading branch information
saleksandra authored Sep 24, 2024
2 parents 8953ec8 + e141926 commit a9693c6
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 12 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ Improvements:
* [OLMIS-7954](https://openlmis.atlassian.net/browse/OLMIS-7954): Added fixes to improve performance on login page
* [OLMIS-7991](https://openlmis.atlassian.net/browse/OLMIS-7991): Filtered out lots that not expired on Issue screeen

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

Bug fixes:
* [OLMIS-7748](https://openlmis.atlassian.net/browse/OLMIS-7748): Fix filtering 'includeInactive' on the Physical Inventory page

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 a9693c6

Please sign in to comment.