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

if(isset($delete)){
  if($id){
    $o_SobranteFaltanteBean = new SobranteFaltanteBean();
    $o_SobranteFaltanteBean->setIdSofa($id);
    
    $o_SobranteFaltanteBean->setUsuarioEliminado(myUser::getUser()->getUserId());
    $o_SobranteFaltanteSystemClass = new SobranteFaltanteSystemClass($o_SobranteFaltanteBean);
    $bResult = $o_SobranteFaltanteSystemClass->eliminarSobranteFaltante();
    
    if($bResult){
      ?>
      <script language="JavaScript">
      parent.objMainTab.reqBody('<?=buildUrl('sof/list')?>','001&delete=1&cod=<?=$o_SobranteFaltanteBean->getIdSofa()?>');
      parent.objMainTab.windowsCloseAll();
      </script>
      <?
      
    }else{
       $url = buildUrl('sof/delete', "block=".$block."&error=1");
    }
  } 
}
