function getListRecibos($tipo, $socio)
{
    $sql = new cSQLListas();
    $cTbl = new cTabla($sql->getListadoDeRecibos($tipo, $socio));
    $xImg = new cHImg();
    $cTbl->setKeyField("idoperaciones_recibos");
    $cTbl->setTdClassByType();
    $cTbl->OButton("TR.Reporte", "jsGetReporteRecibo(" . HP_REPLACE_ID . ")", $cTbl->ODicIcons()->REPORTE);
    $cTbl->OButton("TR.Panel", "var xRec = new RecGen(); xRec.panel(" . HP_REPLACE_ID . ")", $cTbl->ODicIcons()->EJECUTAR);
    $cTbl->setEventKey("setRecibo");
    return $cTbl->Show();
}
function jsaGetListadoCierres($fecha)
{
    $xLi = new cSQLListas();
    $xF = new cFecha();
    $fecha = $xF->getFechaISO($fecha);
    $sqlList = $xLi->getListadoDeRecibos(12, "", "", $fecha);
    $xTab = new cTabla($sqlList);
    $xTab->OButton("TR.Reporte", "var xR = new RecGen(); xR.reporte(" . HP_REPLACE_ID . ")", $xTab->ODicIcons()->REPORTE);
    $xTab->OButton("TR.Panel", "var xR = new RecGen(); xR.panel(" . HP_REPLACE_ID . ")", $xTab->ODicIcons()->CONTROL);
    $xBtn = new cHButton();
    $xSel = new cHSelect();
    $xCA = $xSel->getListaDeCajasAbiertas();
    $T2 = new cTabla($xCA->getSQL() . " AND `tesoreria_cajas`.`fecha_inicio` = '{$fecha}' ");
    $T2->addEspTool($xBtn->getBasic("", "jsToCerrarCorte('{$fecha}')", "bloquear", "idcerrar", true));
    $html = $xTab->Show("TR.LISTADO DE CIERRES");
    if (MODULO_CAJA_ACTIVADO == true) {
        $html .= $T2->Show("TR.Cajas Abiertas");
        $itemsAbier = $T2->getRowCount();
        $html .= "<input type='hidden' id='idabiertas' value='{$itemsAbier}' />";
    } else {
        $html .= "<input type='hidden' id='idabiertas' value='0' />";
    }
    return $html;
}
$xDate = new cHDate();
$xSel = new cHSelect();
if ($cuenta <= 0) {
    $xFRM->addJsBasico(iDE_CAPTACION);
    $xFRM->addCuentaCaptacionBasico(true);
    $xFRM->addSubmit();
} else {
    $xCta = new cCuentaDeCaptacion($cuenta);
    $xCta->init();
    $xFRM->addHTML($xCta->getFicha(true, "", true));
    $xFRM->addSubmit();
    //$xFRM->addToolbar( $xBtn->getBasic("TR.refrescar", "jsRecargar()", "refrescar", "refrescar", false ) );
    //$xFRM->addToolbar( $xBtn->getBasic("TR.imprimir contrato", "jsRecargar()", "refrescar", "refrescar", false ) );
    $xFRM->addCaptacionComandos($cuenta);
    $xHTabs = new cHTabs();
    $cTblx = new cTabla($mSQL->getListadoDeRecibos("", $xCta->getClaveDePersona(), $xCta->getNumeroDeCuenta()));
    $cTblx->setKeyField("idoperaciones_recibos");
    $cTblx->setTdClassByType();
    $cTblx->setEventKey("jsGoPanelRecibos");
    $xHTabs->addTab("TR.RECIBOS", $cTblx->Show());
    $xFRM->addHTML($xHTabs->get());
    $xFRM->OHidden("idcuentacaptacion", $cuenta);
    /*
    	 * <fieldset>
    				<legend>Barra de Acciones</legened>
    					<table  align='center'>
    						<tr>
    							<td>
    								<input type='button' name='printcontrato' value='IMPRIMIR CONTRATO DE CAPTACION' onClick='printrec();'>
    							</td>
    							<td>
 /**
  * Genera las polizas del dia por Cajero
  * @param date $fecha
  */
 function setGenerarPolizasAlCierre($fecha = false)
 {
     $xLi = new cSQLListas();
     $ql = new MQL();
     $msg = "";
     $otros = " AND (`operaciones_recibostipo`.`tipo_poliza_generada` != 999) AND `operaciones_recibos`.`total_operacion` > 0 ";
     $sql = $xLi->getListadoDeRecibos("", "", "", $fecha, $fecha, $otros);
     $rs = $ql->getDataRecord($sql);
     foreach ($rs as $rw) {
         $recibo = $rw["numero"];
         $xPol = new cPoliza(false);
         if ($xPol->setPorRecibo($recibo) == true) {
             $msg .= "WARN\tLa Poliza del recibo {$recibo} Existe con el ID " . $xPol->getCodigoUnico() . "\r\n";
         } else {
             $msg .= $this->setRegenerarPrepolizaContable($fecha, $recibo);
             $msg .= $this->setPolizaPorRecibo($recibo, true);
             if ($xPol->setPorRecibo($recibo) == false) {
                 $msg .= "ERROR\tAl generar la Poliza del recibo {$recibo}\r\n";
             }
         }
         $msg .= $xPol->getMessages();
     }
     $this->mMessages .= $msg;
     return $msg;
 }
 $oFrm->addToolbar($xBtn->getBasic("TR.CONTRATO", "contratocredito()", "imprimir", "print-contrato", false));
 $oFrm->addToolbar($xBtn->getBasic("TR.IMPRIMIR RECIBO DE credito", "printrec()", "imprimir", "print-recP", false));
 $oFrm->addToolbar($xBtn->getBasic("TR.IMPRIMIR MANDATO", "printMandato()", "imprimir", "print-mandato", false));
 $oFrm->addToolbar($xBtn->getBasic("TR.ESTADO_DE_CUENTA", "getEstadoDeCuenta({$idsolicitud})", "statistics", "estado-cta", false));
 $oFrm->addToolbar($xBtn->getBasic("TR.ESTADO_DE_CUENTA Intereses", "getEstadoDeCuentaIntereses({$idsolicitud})", $oFrm->ic()->COBROS, "estado-cta2", false));
 $idrecibo = $xCred->getNumeroReciboDeMinistracion();
 $idnumeroplan = $xCred->getNumeroDePlanDePagos();
 if (setNoMenorQueCero($idnumeroplan) > 0) {
     $oFrm->addToolbar($xBtn->getBasic("TR.PLAN_DE_PAGOS #{$idnumeroplan}", "printplan({$idnumeroplan})", "print", "print-plan", false));
 }
 $oFrm->addToolbar($xBtn->getBasic("TR.RENEGOCIAR", "jsRenegociar()", "editar", "mcediatar", false));
 $oFrm->OButton("TR.Parcialidades Pendientes", "var xcg = new CredGen();xcg.getLetrasEnMora({$idsolicitud})", $oFrm->ic()->PREGUNTAR);
 if ($codigo_de_oficial == USUARIO_TIPO_OFICIAL_AML or OPERACION_LIBERAR_ACCIONES == true) {
 }
 //Agregar Listado de Recibos
 $cTblx = new cTabla($mSQL->getListadoDeRecibos("", $xCred->getClaveDePersona(), $xCred->getNumeroDeCredito()));
 $cTblx->setKeyField("idoperaciones_recibos");
 $cTblx->setTdClassByType();
 $cTblx->setEventKey("jsGoPanelRecibos");
 $xHTabs->addTab("TR.RECIBOS", $cTblx->Show());
 if ($codigo_de_oficial == getUsuarioActual() or OPERACION_LIBERAR_ACCIONES == true) {
     $setSql = $mSQL->getListadoDeLlamadas($idsolicitud);
     $setSql3 = $mSQL->getListadoDeNotificaciones($idsolicitud);
     $c2Tbl = new cTabla($mSQL->getListadoDeNotas(false, $idsolicitud), 0);
     $c2Tbl->setWidth();
     $xHTabs->addTab("TR.NOTAS", $c2Tbl->Show());
     $c4Tbl = new cTabla($mSQL->getListadoDeCompromisos($idsolicitud), 5);
     $c4Tbl->setWidth();
     $xHTabs->addTab("TR.COMPROMISOS", $c4Tbl->Show());
     $cTbl = new cTabla($setSql, 0);
     $cTbl->addTool(SYS_DOS);
function jsaGetRecibosEmitidos($fecha)
{
    $xF = new cFecha();
    $fecha = $xF->getFechaISO($fecha);
    $xL = new cSQLListas();
    $sql = $xL->getListadoDeRecibos("", "", "", $fecha);
    $xT = new cTabla($sql);
    $xT->setEventKey("jsGetPanelRecibo");
    return $xT->Show();
}
$credito = parametro("credito", DEFAULT_CREDITO, MQL_INT);
$credito = parametro("idsolicitud", $credito, MQL_INT);
$credito = parametro("solicitud", $credito, MQL_INT);
$cuenta = parametro("cuenta", DEFAULT_CUENTA_CORRIENTE, MQL_INT);
$cuenta = parametro("idcuenta", $cuenta, MQL_INT);
$jscallback = parametro("callback");
$tiny = parametro("tiny");
$form = parametro("form");
$action = parametro("action", SYS_NINGUNO);
$xHP->init();
$xFRM = new cHForm("frm", "./");
$msg = "";
$FechaInit = $xF->getDiaInicial();
$FechaFin = $xF->getDiaFinal();
$otros = " AND (`operaciones_recibostipo`.`tipo_poliza_generada` != 999) AND `operaciones_recibos`.`total_operacion` > 0 ";
$xTbl = new cTabla($xLi->getListadoDeRecibos("", "", "", $FechaInit, $FechaFin, $otros));
//$xTbl->addEspTool();
$xTbl->OButton("TR.Poliza", "jsBuscarPoliza(" . HP_REPLACE_ID . ")", $xTbl->ODicIcons()->CONTABLE);
$xTbl->OButton("TR.Factura", "jsBuscarFactura(" . HP_REPLACE_ID . ")", $xTbl->ODicIcons()->REPORTE);
$xTbl->setEventKey("jsGetPanel");
//$table_s->addEspTool("\$xS=new cSocio(_REPLACE_ID_,true);\$D=\$xS->getTotalColocacionActual();PHP::(\$D[SYS_NUMERO]>0) ? \"<div class='noticon'><i class='fa fa-credit-card fa-lg'></i><span class='noticount'>\" . \$D[SYS_NUMERO] . \"</span></div>\":\"\";");
$xFRM->addHTML($xTbl->Show());
//$xFRM->addJsBasico();
//$xFRM->addCreditBasico();
//$xFRM->addSubmit();
$xFRM->OHidden("idclaveactual", 0, "");
$xFRM->addAviso("");
echo $xFRM->get();
$jxc->drawJavaScript(false, true);
?>
<script>
$permiso = getSIPAKALPermissions($theFile);
if ($permiso === false) {
    header("location:../404.php?i=999");
}
$_SESSION["current_file"] = addslashes($theFile);
//<=====	FIN_H
$iduser = $_SESSION["log_id"];
//=====================================================================================================
include_once "../core/entidad.datos.php";
include_once "../core/core.deprecated.inc.php";
include_once "../core/core.fechas.inc.php";
include_once "../core/core.config.inc.php";
include_once "../core/core.common.inc.php";
header("Content-type: text/xml");
$txt = "";
$iSQL = new cSQLListas();
$persona = isset($_REQUEST["persona"]) ? $_REQUEST["persona"] : "";
$docto = isset($_REQUEST["documento"]) ? $_REQUEST["documento"] : "";
$fecha = isset($_REQUEST["fecha"]) ? $_REQUEST["fecha"] : fechasys();
$mx = isset($_REQUEST["mx"]) ? true : false;
$xF = new cFecha();
if ($mx == true) {
    $fecha = $xF->getFechaISO($fecha);
}
$rs = getRecordset($iSQL->getListadoDeRecibos("", $persona, $docto, $fecha));
while ($rw = mysql_fetch_array($rs)) {
    $txt .= "<recibo codigo=\"" . $rw["numero"] . "\" fecha=\"" . $rw["fecha"] . "\" documento=\"" . $rw["documento"] . "\" persona=\"" . $rw["socio"] . "\">";
    $txt .= "" . $rw["total"];
    $txt .= "</recibo>\n";
}
echo "<?xml version =\"1.0\" ?>\n<result>\n" . $txt . "</result>";