Skip to content

Commit

Permalink
Merge pull request #177 from OpenLMIS-Angola/ANGOLASUP-909-fix-error
Browse files Browse the repository at this point in the history
ANGOLASUP-909: handled case when no stock is available
  • Loading branch information
DominikNoga committed Sep 4, 2024
2 parents afc5104 + 6913dcc commit 467f919
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/shipment-view/shipment-view.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,12 @@

function setGroupTotalQuantity(lineItemGroup) {
var totalQuantity = 0;
if (!lineItemGroup.lineItems) {
if (!lineItemGroup.lineItems || lineItemGroup.lineItems.length === 0) {
return;
}

var firstItem = lineItemGroup.lineItems[0];

if (lineItemGroup.isMainGroup && isGroup(firstItem)) {
lineItemGroup.lineItems.forEach(function(itemGroup) {
totalQuantity += getGroupTotalQuantity(itemGroup);
Expand Down

0 comments on commit 467f919

Please sign in to comment.