Skip to content

Commit

Permalink
Merge pull request #189 from OpenLMIS-Angola/AO-901
Browse files Browse the repository at this point in the history
AO-901: Enabled new lot edition in receive view
  • Loading branch information
DominikNoga authored Nov 5, 2024
2 parents 6a41fb1 + b83b648 commit 0eb2e4a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/stock-edit-lot-modal/edit-lot-modal.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,9 @@
if (noErrors) {
selectedItem.lot = vm.newLot;
selectedItem.displayLotMessage = vm.newLot.lotCode;
physicalInventoryDraftCacheService.cacheDraft(draft);
if (draft.lineItems) {
physicalInventoryDraftCacheService.cacheDraft(draft);
}
modalDeferred.resolve();
}
}
Expand Down Expand Up @@ -160,7 +162,11 @@
* Validate if on line item list exists the same orderable with the same lot code
*/
function validateLotCode() {
draft.lineItems.forEach(function(lineItem) {
var items = vm.allLineItems;
if (draft.lineItems) {
items = draft.lineItems;
}
items.forEach(function(lineItem) {
if (lineItem.orderable.productCode === vm.selectedItem.orderable.productCode
&& lineItem.lot && vm.selectedItem.lot && vm.selectedItem.lot.lotCode === lineItem.lot.lotCode
&& !(vm.selectedItem.lot.lotCode === selectedItem.lot.lotCode)) {
Expand Down

0 comments on commit 0eb2e4a

Please sign in to comment.