Fix: Linea de Cero debe ser mayor a cero issue RedEcovida#57
This commit is contained in:
parent
2a908d4e05
commit
a90fb4d937
@ -239,6 +239,16 @@
|
|||||||
},
|
},
|
||||||
async submit() {
|
async submit() {
|
||||||
if (this.$refs.form.validate()) {
|
if (this.$refs.form.validate()) {
|
||||||
|
const hasInvalidQuantity = this.purchase.saleline_set.some(line => line.quantity <= 0);
|
||||||
|
if (hasInvalidQuantity) {
|
||||||
|
this.errorMessage = 'La cantidad de cada línea de compra debe ser mayor que cero.';
|
||||||
|
|
||||||
|
console.log(this.errorMessage);
|
||||||
|
return; // Detener el submit si hay cantidades inválidas
|
||||||
|
}
|
||||||
|
|
||||||
|
this.errorMessage = ''; // Limpiar el mensaje de error
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await fetch('/don_confiao/api/sales/', {
|
const response = await fetch('/don_confiao/api/sales/', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
|
Loading…
Reference in New Issue
Block a user