From 6fd233da87086e79c7d12a7dc3370804233c0520 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Sun, 17 Sep 2023 17:18:33 -0500 Subject: [PATCH] Validate amount when adding receiving quantity --- src/components/receiving/ByjoveReceiving.vue | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/components/receiving/ByjoveReceiving.vue b/src/components/receiving/ByjoveReceiving.vue index 7aa9fea..6bb1945 100644 --- a/src/components/receiving/ByjoveReceiving.vue +++ b/src/components/receiving/ByjoveReceiving.vue @@ -314,6 +314,16 @@ export default { }, addAmount() { + + let amount = parseInt(this.inputQuantity) + if (!amount) { + this.$buefy.toast.open({ + message: "Please specify an amount", + type: 'is-info', + }) + return + } + let url = `/api/receiving-batch-row/${this.row.uuid}/receive` let params = { row: this.row.uuid, @@ -325,9 +335,9 @@ export default { } if (this.inputUOM == 'CS') { - params.cases = this.inputQuantity + params.cases = amount } else { - params.units = this.inputQuantity + params.units = amount } this.$http.post(url, params).then(response => {