Fix: Linea de Cero debe ser mayor a cero issue RedEcovida#57
This commit is contained in:
		@@ -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',
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user