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

if(isset($delete)){
  if($id){
    $o_CapitalInicialBean = new CapitalInicialBean();
    $o_CapitalInicialBean->setIdCapitalInicial($id);
    
    $o_CapitalInicialBean->setUsuarioEliminado(myUser::getUser()->getUserId());
    $o_CapitalInicialSystemClass = new CapitalInicialSystemClass($o_CapitalInicialBean);
    $bResult = $o_CapitalInicialSystemClass->eliminarCapitalInicial();
    
    if($bResult){
      ?>
      <script language="JavaScript">
      parent.objMainTab.reqBody('<?=buildUrl('iop/list')?>','001&delete=1&cod=<?=$o_CapitalInicialBean->getIdCapitalInicial()?>');
      parent.objMainTab.windowsCloseAll();
      </script>
      <?
      
    }else{
       $url = buildUrl('suc/delete', "block=".$block."&error=1");
    }
  } 
}
