Skip to content

Commit

Permalink
ANGOLASUP-908: fixed stock adjustments (#171)
Browse files Browse the repository at this point in the history
  • Loading branch information
DominikNoga authored Aug 23, 2024
1 parent c80df64 commit 6aad7f6
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -726,6 +726,7 @@
loadingModalService.open();
var addedLineItems = angular.copy(vm.addedLineItems);

calculateLineItemsQuantity(addedLineItems);
generateKitConstituentLineItem(addedLineItems);
var lotPromises = [],
errorLots = [],
Expand Down Expand Up @@ -935,6 +936,12 @@
return itemExistsOnList;
}

function calculateLineItemsQuantity(addedLineItems) {
addedLineItems.forEach(function(lineItem) {
lineItem.quantity = vm.getLineItemTotalQuantity(lineItem);
});
}

function generateKitConstituentLineItem(addedLineItems) {
if (adjustmentType.state !== ADJUSTMENT_TYPE.KIT_UNPACK.state) {
return;
Expand All @@ -948,7 +955,6 @@
var constituentLineItems = [];

addedLineItems.forEach(function(lineItem) {
lineItem.quantity = vm.getLineItemTotalQuantity(lineItem);
lineItem.orderable.children.forEach(function(constituent) {
var newConstituent = JSON.parse(JSON.stringify(constituent));

Expand Down

0 comments on commit 6aad7f6

Please sign in to comment.