Validate amount when adding receiving quantity

This commit is contained in:
Lance Edgar 2023-09-17 17:18:33 -05:00
parent 99fbe0e5ec
commit 6fd233da87

View file

@ -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 => {