$li_monpagpre = 0;
 $lb_valido = $io_report->uf_select_pagosprevios($ls_tipproben, $ls_codpro, $ls_cedbene, $ld_fecemides, $ld_fecemihas, $li_monpagpre, $li_monretpre);
 if ($ls_estretiva == "B") {
     $li_monpagpre = $li_monpagpre + $li_monretpre;
 }
 $li_monsalant = $li_monsolpre - $li_monpagpre;
 if ($li_monsalant > 0) {
     $ls_saldoanterior = number_format($li_monsalant, 2, ',', '.');
     $ls_saldoanterior = "(" . $ls_saldoanterior . ")";
 } else {
     $ls_saldoanterior = abs($li_monsalant);
     $ls_saldoanterior = number_format($ls_saldoanterior, 2, ',', '.');
 }
 //////////////////////////////////        SALDO PREVIO        //////////////////////////////////
 //////////////////////////////////    SOLICITUDES ACTUALES    //////////////////////////////////
 $lb_valido = $io_report->uf_select_solicitudesactualescxp($ls_tipproben, $ls_cedbene, $ls_codpro, $ld_fecemides, $ld_fecemihas);
 if ($lb_valido) {
     $li_salsol = $li_monsalant;
     $li_totsolact = $io_report->ds_solactuales->getRowCount('numsol');
     for ($li_j = 1; $li_j <= $li_totsolact; $li_j++) {
         $ls_numsol = $io_report->ds_solactuales->getValue('numsol', $li_j);
         $ls_estprodoc = $io_report->ds_solactuales->getValue('estprodoc', $li_j);
         $ls_consol = $io_report->ds_solactuales->getValue('consol', $li_j);
         $li_monsol = $io_report->ds_solactuales->getValue('monsol', $li_j);
         //Monto de la Solicitudes de Pago actuales.
         $ld_fecsol = $io_report->ds_solactuales->getValue('fecha', $li_j);
         if ($ls_estretiva == "B") {
             $li_monretiva = $io_report->uf_select_det_deducciones_solpag($ls_numsol);
             $li_monsol = $li_monsol + $li_monretiva;
         }
         $li_salsol = $li_salsol + $li_monsol;