Skip to content

Commit

Permalink
Merge pull request #164 from OpenLMIS-Angola/OAM-286-fix-unpack
Browse files Browse the repository at this point in the history
OAM-286: Fixed unpack view
  • Loading branch information
olewandowski1 authored Aug 1, 2024
2 parents ca07e21 + 5ef9a9b commit b79e6bb
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/stock-adjustment-creation/adjustment-creation.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,7 @@
return lotPromises;
}

function confirmSubmit() {
function onSubmit() {
loadingModalService.open();
var addedLineItems = angular.copy(vm.addedLineItems);
generateKitConstituentLineItem(addedLineItems);
Expand Down Expand Up @@ -763,6 +763,16 @@
});
}

function confirmSubmit() {
try {
onSubmit();
} catch (error) {
loadingModalService.close();
console.error(error.message);
alertService.error('openlmisStateChangeError.internalApplicationError.message');
}
}

function getLineItemsByDestinationMap(addedLineItems) {
var addedLineItemsMap = {};
addedLineItems.forEach(function(lineItem) {
Expand Down Expand Up @@ -1207,6 +1217,9 @@

// AO-804: Display product prices on Stock Issues, Adjustments and Receives Page
function getProductPrice(lineItem) {
if (!lineItem.orderable.programs) {
return undefined;
}
var programOrderable = lineItem.orderable.programs.find(function(programOrderable) {
return programOrderable.programId === program.id;
});
Expand Down Expand Up @@ -1251,7 +1264,7 @@

function getProductsWithPriceChanged(products) {
return products.filter(function(product) {
return product.price !== getProductPrice(product);
return product.price && product.price !== getProductPrice(product);
});
}

Expand Down

0 comments on commit b79e6bb

Please sign in to comment.