Ver Mensaje Individual
  #13 (permalink)  
Antiguo 17/01/2013, 10:13
Avatar de GatorV
GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 18 años
Puntos: 2135
Respuesta: Validar valor negativo

No, obviamente tienes que validar la resta, te lo dejo en pseudocódigo:
Código:
si ( (cantidadExistente - cantidadPedida) < 0) 
    imprime error, no hay suficiente producto para surtir
fin si