Exemplo n.º 1
0
 public function recalcStock()
 {
     $stock4Compras = ProductoPeer::recalcStock4Compras($this->getId());
     $stock4Eventos = ProductoPeer::recalcStock4Eventos($this->getId());
     $stock4Ventas = ProductoPeer::recalcStock4Ventas($this->getId());
     $stock = $stock4Compras + $stock4Eventos - $stock4Ventas;
     $this->setStockActual($stock);
     $this->save();
 }