<?php 
class eventclass_ajuste  extends eventsBase
{ 
	function eventclass_ajuste()
	{
	// fill list of events
		$this->events["BeforeAdd"]=true;


//	onscreen events


	}
// Captchas functions	

//	handlers

		
		
		
		
		
		
		
		
		
		
				// Before record added
function BeforeAdd(&$values,&$message,$inline,&$pageObject)
{

		global $conn;
$idarticulo = $values["idarticulo"];
$strSQLExists = "select * from articulo where idarticulo=$idarticulo";
$rsExists = db_query($strSQLExists,$conn);
$data=db_fetch_array($rsExists);

$values["cant_antes"] = $data["stock"];
$values["cant_ajustada"] = $values["cant_despues"] - $values["cant_antes"];



// Place event code here.
// Use "Add Action" button to add code snippets.

return true;
;		
} // function BeforeAdd

		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
//	onscreen events

} 
?>
