<?php use_helper('UrlFunctions'); ?>
<?php

if(isset($delete)){
  if($id){
    $o_GastosGeneralesBean = new GastosGeneralesBean();
    $o_GastosGeneralesBean->setIdGasto($id);
    
    $o_GastosGeneralesBean->setUsuarioEliminado(myUser::getUser()->getUserId());
    $o_GastosGeneralesSystemClass = new GastosGeneralesSystemClass($o_GastosGeneralesBean);
    $bResult = $o_GastosGeneralesSystemClass->eliminarGastosGenerales();
    
    if($bResult){
      ?>
      <script language="JavaScript">
      parent.objMainTab.reqBody('<?=buildUrl('gge/list')?>','001&delete=1&cod=<?=$o_GastosGeneralesBean->getIdGasto()?>');
      //parent.objMainTab.windowsCloseAll();
      </script>
      <?
      
    }else{
       $url = buildUrl('gge/delete', "block=".$block."&error=1");
    }
  } 
}
