Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed: scanning failure issue caused by empty quantity values when scanning barcode #308 #310

Merged
merged 6 commits into from
Feb 21, 2024
Prev Previous commit
Next Next commit
Fixed: code by giving the toast messege when product not found
  • Loading branch information
Ritika-Patel08 committed Feb 13, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 62d33f8b69e77fa8695c27afc303ad1a3e0634ac
17 changes: 10 additions & 7 deletions src/store/modules/shipment/actions.ts
Original file line number Diff line number Diff line change
@@ -34,14 +34,17 @@
},

async updateShipmentProductCount ({ commit, state }, payload) {
await state.current.items.find((item: any) => {
if(item.sku === payload){
if (item.quantityAccepted === "") {
item.quantityAccepted = 0;
}
item.quantityAccepted = parseInt(item.quantityAccepted) + 1;
const findItem = state.current.items.find((item:any) => item.sku === payload);

if (findItem ) {
ymaheshwari1 marked this conversation as resolved.
Show resolved Hide resolved
if (findItem.quantityAccepted === "") {
findItem.quantityAccepted = 0;
}
});
findItem.quantityAccepted = parseInt(findItem.quantityAccepted) + 1;
} else {
showToast(translate("Product not found"));
ymaheshwari1 marked this conversation as resolved.
Show resolved Hide resolved
}

commit(types.SHIPMENT_CURRENT_UPDATED, state);
},
async setCurrent ({ commit }, payload) {
@@ -80,7 +83,7 @@
return Promise.reject(new Error(err))
}
},
receiveShipmentItem ({ commit }, payload) {

Check warning on line 86 in src/store/modules/shipment/actions.ts

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (18.x)

'commit' is defined but never used

Check warning on line 86 in src/store/modules/shipment/actions.ts

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (20.x)

'commit' is defined but never used
return Promise.all(payload.items.map(async (item: any) => {
const params = {
shipmentId: payload.shipmentId,
Loading