$xL = new cSQLListas();
$xF = new cFecha();
$query = new MQL();
$subproducto = parametro("subproducto", SYS_TODAS, MQL_INT);
$producto = parametro("producto", SYS_TODAS, MQL_INT);
$operacion = parametro("operacion", SYS_TODAS, MQL_INT);
$out = parametro("out", SYS_DEFAULT);
$FechaInicial = parametro("on", false);
$FechaInicial = parametro("fecha-0", $FechaInicial);
$FechaInicial = $FechaInicial == false ? FECHA_INICIO_OPERACIONES_SISTEMA : $xF->getFechaISO($FechaInicial);
$FechaFinal = parametro("off", false);
$FechaFinal = parametro("fecha-1", $FechaFinal);
$FechaFinal = $FechaFinal == false ? fechasys() : $xF->getFechaISO($FechaFinal);
$senders = getEmails($_REQUEST);
$xHP->init();
$sql = $xL->getListadoDeMvtosDeCaptacion(false, false, $producto, $subproducto, $FechaInicial, $FechaFinal, $operacion);
//exit($sql);
$titulo = "";
$archivo = "reporte-de-captacion-del-{$FechaInicial}-al-{$FechaFinal}";
$xRPT = new cReportes($titulo);
$xRPT->setFile($archivo);
$xRPT->setOut($out);
$xRPT->setSQL($sql);
$xRPT->setTitle($xHP->getTitle());
//============ Reporte
$xT = new cTabla($sql, 2);
$xT->setTipoSalida($out);
$body = $xRPT->getEncabezado($xHP->getTitle(), $FechaInicial, $FechaFinal);
$xRPT->setBodyMail($body);
$xRPT->addContent($body);
$xT->setFootSum(array(4 => "monto"));