function init($include_ceros = true) { $QL = new MQL(); $xL = new cSQLListas(); $sql = $xL->getListadoDeSaldosPorMes($this->mCuenta, $this->mFecha); $rs = $QL->getDataRecord($sql); $titAnt = 0; $subAnt = 0; $titCant = 0; $subCant = 0; $titNam = ""; $subNam = ""; $xLng = new cLang(); $nTot = $xLng->getT("TR.Total"); foreach ($rs as $rows) { $nivel = $rows["nivel"]; $monto = $rows["monto"]; $cuenta = $rows["numero"]; $nombre = $rows["nombre"]; $xEsq = new cCuentaContableEsquema($cuenta); $txt = ""; $fmonto = $monto == 0 ? "" : getFMoney($monto); if ($cuenta > 0) { switch ($nivel) { case 1: //$this->mTitulos[$cuenta][SYS_DATOS] = $rows; $txt .= ($cuenta != $titAnt and $titAnt > 0) ? "<tr><td /><th colspan='3' class='total'>{$nTot} {$titNam}</th><th class='total'>" . getFMoney($titCant) . "</th></tr>" : ""; $txt .= "<tr><td>" . $xEsq->CUENTA_FORMATEADA . "</td><td colspan='3'>{$nombre}</td><td /></tr>"; $titAnt = $cuenta; $titCant = $monto; $titNam = $nombre; break; case 2: //$this->mSubtitulos[$cuenta][SYS_DATOS] = $rows; $txt .= ($cuenta != $subAnt and $subAnt > 0) ? "<tr><td /><th colspan='3' class='total'>{$nTot} {$subNam}</th><th class='total'>" . getFMoney($subCant) . "</th></tr>" : ""; $txt .= "<tr><th>" . $xEsq->CUENTA_FORMATEADA . "</th><td /><td colspan='2'>{$nombre}</td><td /></tr>"; $subAnt = $cuenta; $subCant = $monto; $subNam = $nombre; break; case 3: //$this->mMayor[$cuenta] = $rows; //$this->mSubtitulos[$xEsq->CUENTA_SUPERIOR][$cuenta] = $rows; $txt .= ($monto == 0 and $include_ceros == false) ? "" : "<tr><td>" . $xEsq->CUENTA_FORMATEADA . "</td><td /><td /><td >{$nombre}</td> <td class='mny'>{$fmonto}</td></tr>"; break; } $this->mTxt .= $txt; } } $this->mSumaTitulo = $titCant; }