CAnualesPrintView Class Reference

#include <canualesprintview.h>

Inheritance diagram for CAnualesPrintView:

QDialog Ui_CAnualesPrintBase PEmpresaBase

Public Slots

virtual void on_mui_aceptar_clicked ()

Public Member Functions

 CAnualesPrintView (Empresa *emp, QWidget *parent=0)
 ~CAnualesPrintView ()
void setidbalance (QString)
bool procesaFormula (const QDomNode &)
 Establece cual será el balance a imprimir.
bool procesaOperador (const QDomNode &)
bool valorItem (const QDomNode &, QString &, QString &)
void agregaValores (const QDomNode &, const QString &, const QString &)
void imprimir (QString, QString, QString, QString)

Private Attributes

char * fichero
QString idbalance
QDomDocument m_doc

Detailed Description

Definition at line 45 of file canualesprintview.h.


Constructor & Destructor Documentation

CAnualesPrintView::CAnualesPrintView ( Empresa emp,
QWidget parent = 0 
)

Parameters:
emp 
parent 

Definition at line 45 of file canualesprintview.cpp.

References _depura(), fichero, and Ui_CAnualesPrintBase::setupUi().

00046         : QDialog ( parent ), PEmpresaBase(emp)
00047 {
00048     _depura ( "CAnualesPrintView::CAnualesPrintView", 0 );
00049     setupUi ( this );
00050     fichero = NULL;
00051     _depura ( "END CAnualesPrintView::CAnualesPrintView", 0 );
00052 
00053 }

CAnualesPrintView::~CAnualesPrintView (  ) 

Definition at line 59 of file canualesprintview.cpp.

References _depura().

00060 {
00061     _depura ( "CAnualesPrintView::~CAnualesPrintView", 0 );
00062     _depura ( "END CAnualesPrintView::~CAnualesPrintView", 0 );
00063 }


Member Function Documentation

void CAnualesPrintView::setidbalance ( QString  id  ) 

Parameters:
id 
Returns:

Definition at line 557 of file canualesprintview.cpp.

References _depura(), m_doc, and Ui_CAnualesPrintBase::m_nomBalance.

Referenced by CAnualesView::imprimir().

00558 {
00559     _depura ( "CAnualesPrintView::setidbalance", 0 );
00560     QFile f ( id );
00561     if ( !f.open ( QIODevice::ReadOnly ) )
00562         return;
00563     if ( !m_doc.setContent ( &f ) )
00564     {
00565         f.close();
00566         return;
00567     } // end if
00568     f.close();
00569     m_nomBalance->setText ( id );
00570     _depura ( "END CAnualesPrintView::setidbalance", 0 );
00571 }

bool CAnualesPrintView::procesaFormula ( const QDomNode &  formula  ) 

Establece cual será el balance a imprimir.

Parameters:
formula 
return 
Returns:

Try to convert the node to an element.

The node was really an element.

Definition at line 262 of file canualesprintview.cpp.

References _depura(), agregaValores(), FALSE, procesaOperador(), Fixed::toQString(), TRUE, and valorItem().

Referenced by on_mui_aceptar_clicked().

00263 {
00264     _depura ( "CAnualesPrintView::procesaFormula", 0 );
00265     QDomElement valor = formula.firstChildElement ( "VALORACT" );
00266     //
00267     QString valors = valor.toElement().text();
00268     QString codigo = formula.parentNode().firstChildElement ( "CONCEPTO" ).toElement().text();
00269     //
00270     if ( !valor.isNull() )
00271     {
00272         return TRUE;
00273     } // end if
00274     Fixed tvaloract = Fixed ( "0.0" );
00275     Fixed tvalorant = Fixed ( "0.0" );
00276     QDomElement formula3 = formula.toElement();
00277     QDomNodeList litems = formula3.elementsByTagName ( "OPERADOR" );
00278     for ( int i = 0; i < litems.count(); i++ )
00279     {
00280         QDomNode item = litems.item ( i );
00281         QDomElement e1 = item.toElement(); 
00282         if ( !e1.isNull() )
00283         { 
00284             if ( !procesaOperador ( item ) )
00285                 return FALSE;
00286             QString valoract, valorant;
00287             if ( valorItem ( item, valoract, valorant ) )
00288             {
00289                 tvaloract = tvaloract + Fixed ( valoract );
00290                 tvalorant = tvalorant + Fixed ( valorant );
00291             }
00292             else
00293                 return FALSE;
00294         } // end if
00295     } // end for
00296     QString tvaloracts = tvaloract.toQString();
00297     QString tvalorants = tvalorant.toQString();
00298     agregaValores ( formula, tvaloracts, tvalorants );
00299     _depura ( "END CAnualesPrintView::procesaFormula", 0 );
00300     return TRUE;
00301 }

bool CAnualesPrintView::procesaOperador ( const QDomNode &  operador  ) 

Parameters:
operador 
Returns:

Miramos la fórmula.

Try to convert the node to an element.

The node was really an element.

Este item es la fórmula referenciada.

Definition at line 311 of file canualesprintview.cpp.

References _depura(), agregaValores(), FALSE, m_doc, TRUE, and valorItem().

Referenced by procesaFormula().

00312 {
00313     _depura ( "CAnualesPrintView::procesaOperador", 0, operador.toElement().text() );
00314     QDomElement valor = operador.firstChildElement ( "VALORACT" );
00315     if ( !valor.isNull() )
00316         return TRUE;
00318     QDomElement lineaid = operador.firstChildElement ( "LINEAID" );
00319 
00320     if ( !lineaid.isNull() )
00321     {
00322         QDomNodeList litems = m_doc.elementsByTagName ( "ID" );
00323         for ( int i = 0; i < litems.count(); i++ )
00324         {
00325             QDomNode item = litems.item ( i );
00326             QDomElement e1 = item.toElement(); 
00327             if ( !e1.isNull() )
00328             { 
00329                 if ( e1.text() == lineaid.text() )
00330                 {
00332                     QDomNode formula = item.parentNode().firstChildElement ( "FORMULA" );
00333                     QString valoract, valorant;
00334                     if ( valorItem ( formula, valoract, valorant ) )
00335                     {
00336                         agregaValores ( operador, valoract, valorant );
00337                         return TRUE;
00338                     }
00339                     else
00340                     {
00341                         return FALSE;
00342                     } // end if
00343                 } // end if
00344             } // end if
00345         } // end for
00346     } // end if
00347     _depura ( "CAnualesPrintView::procesaOperador", 0 );
00348     return FALSE;
00349 }

bool CAnualesPrintView::valorItem ( const QDomNode &  formula,
QString &  valoract,
QString &  valorant 
)

Parameters:
formula 
valoract 
valorant 
Returns:

Definition at line 359 of file canualesprintview.cpp.

References _depura(), FALSE, and TRUE.

Referenced by procesaFormula(), and procesaOperador().

00360 {
00361     _depura ( "CAnualesPrintView::valorItem", 0, formula.toElement().tagName() );
00362     QDomElement valor = formula.namedItem ( "VALORACT" ).toElement();
00363     if ( valor.isNull() )
00364     {
00365         return FALSE;
00366     } // end if
00367     valoract = valor.text();
00368     valorant = formula.namedItem ( "VALORANT" ).toElement().text();
00369     _depura ( "END CAnualesPrintView::valorItem", 0, formula.toElement().text() + "--" + valoract );
00370     return TRUE;
00371 }

void CAnualesPrintView::agregaValores ( const QDomNode &  nodo,
const QString &  valoract,
const QString &  valorant 
)

Parameters:
nodo 
valoract 
valorant 

Miramos las opciones pasadas

Definition at line 380 of file canualesprintview.cpp.

References _depura(), m_doc, and Fixed::toQString().

Referenced by on_mui_aceptar_clicked(), procesaFormula(), and procesaOperador().

00381 {
00382     _depura ( "CAnualesPrintView::agregaValores", 0, nodo.toElement().tagName() + " " + valoract );
00383     QDomElement enodo = nodo.toElement();
00384     Fixed fvaloract ( valoract );
00385     Fixed fvalorant ( valorant );
00387     if ( nodo.nodeName() == QString ( "OPERADOR" ) )
00388     {
00389         QDomNodeList opcs = enodo.elementsByTagName ( "OPCIONES" );
00390         for ( int i = 0; i < opcs.count(); i++ )
00391         {
00392             QDomElement op = opcs.item ( i ).toElement();
00393             QString opciones = op.text();
00394             if ( opciones == "POSITIVO" )
00395             {
00396                 if ( fvaloract < 0 )
00397                     fvaloract = fvaloract * -1;
00398                 if ( fvalorant < 0 )
00399                     fvalorant = fvalorant * -1;
00400             } // end if
00401             if ( opciones == "NEGATIVO" )
00402             {
00403                 if ( fvaloract > 0 )
00404                     fvaloract = fvaloract * -1;
00405                 if ( fvalorant > 0 )
00406                     fvalorant = fvalorant * -1;
00407             } // end if
00408             if ( opciones == "RESTAR" )
00409             {
00410                 fvaloract = fvaloract * -1;
00411                 fvalorant = fvalorant * -1;
00412             } // end if
00413         } // end for
00414     }
00415     else
00416     {
00417         QDomNodeList opcs = nodo.parentNode().toElement().elementsByTagName ( "OPCIONES" );
00418         for ( int i = 0; i < opcs.count(); i++ )
00419         {
00420             QDomElement op = opcs.item ( i ).toElement();
00421             QString opciones = op.text();
00422             if ( opciones == "MAYORCERO" )
00423             {
00424                 if ( fvaloract < 0 )
00425                     fvaloract = 0;
00426                 if ( fvalorant < 0 )
00427                     fvalorant = 0;
00428             } // end if
00429             if ( opciones == "MENORCERO" )
00430             {
00431                 if ( fvaloract > 0 )
00432                     fvaloract = 0;
00433                 if ( fvalorant > 0 )
00434                     fvalorant = 0;
00435             } // end if
00436         } // end for
00437     } // end if
00438     QDomElement valoract1 = m_doc.createElement ( "VALORACT" );
00439     valoract1.setTagName ( "VALORACT" );
00440     QDomText etx = m_doc.createTextNode ( fvaloract.toQString() );
00441     valoract1.appendChild ( etx );
00442     QDomElement valorant1 = m_doc.createElement ( "VALORANT" );
00443     valorant1.setTagName ( "VALORANT" );
00444     QDomText etc = m_doc.createTextNode ( fvalorant.toQString() );
00445     valorant1.appendChild ( etc );
00446     QDomNode n = nodo;
00447     enodo.appendChild ( valoract1 );
00448     enodo.appendChild ( valorant1 );
00449     _depura ( "END CAnualesPrintView::agregaValores", 0 );
00450 }

void CAnualesPrintView::imprimir ( QString  periodo1finicial,
QString  periodo1ffinal,
QString  periodo2finicial,
QString  periodo2ffinal 
)

Parameters:
periodo1finicial 
periodo1ffinal 
periodo2finicial 
periodo2ffinal 

Copiamos el archivo.

Copiamos el logo.

Iteramos para cada componente del listado.

Escribimos el titulo del componente

Cogemos los elementos del componente y los ponemos en forma de tabla.

Try to convert the node to an element.

The node was really an element.

Definition at line 460 of file canualesprintview.cpp.

References _depura(), CONF_DIR_OPENREPORTS, CONF_DIR_USER, confpr, invocaPDF(), m_doc, and configuracion::valor().

Referenced by on_mui_aceptar_clicked().

00461 {
00462     _depura ( "CAnualesPrintView::imprimir", 0 );
00463     QString archivo = confpr->valor ( CONF_DIR_OPENREPORTS ) + "canuales.rml";
00464     QString archivod = confpr->valor ( CONF_DIR_USER ) + "canuales.rml";
00465     QString archivologo = confpr->valor ( CONF_DIR_OPENREPORTS ) + "logo.jpg";
00467 #ifdef WINDOWS
00468 
00469     archivo = "copy " + archivo + " " + archivod;
00470 #else
00471 
00472     archivo = "cp " + archivo + " " + archivod;
00473 #endif
00474 
00475     system ( archivo.toAscii().constData() );
00477 #ifdef WINDOWS
00478 
00479     archivologo = "copy " + archivologo + " " + confpr->valor ( CONF_DIR_USER ) + "logo.jpg";
00480 #else
00481 
00482     archivologo = "cp " + archivologo + " " + confpr->valor ( CONF_DIR_USER ) + "logo.jpg";
00483 #endif
00484 
00485     system ( archivologo.toAscii().constData() );
00486     QFile file;
00487     file.setFileName ( archivod );
00488     file.open ( QIODevice::ReadOnly );
00489     QTextStream stream ( &file );
00490     QString buff = stream.readAll();
00491     file.close();
00492     QString fitxersortidatxt;
00493     fitxersortidatxt = "";
00494 
00496     QDomNodeList componentes = m_doc.elementsByTagName ( "COMPONENTE" );
00497     for ( int j = 0; j < componentes.count(); j++ )
00498     {
00499         QDomElement comp = componentes.item ( j ).toElement();
00501         QString debeohaber = comp.namedItem ( "SUBTITULO" ).toElement().text();
00502         fitxersortidatxt += "" + debeohaber + "\n";
00504         fitxersortidatxt += "<blockTable style=\"tabla\" repeatRows=\"1\" colWidths=\"12cm,3cm,3cm\">\n";
00505         fitxersortidatxt += "<tr><td><para style=\"debeohaber\">" + debeohaber + "</para></td>\n";
00506         fitxersortidatxt += "<td><para style=\"periodo\">Periodo:</para><para style=\"periodo\">" + periodo1finicial + " ~ " + periodo1ffinal + "</para></td>\n";
00507         fitxersortidatxt += "<td><para style=\"periodo\">Periodo:</para><para style=\"periodo\">" + periodo2finicial + " ~ " + periodo2ffinal + "</para></td></tr>\n";
00508 
00509         QDomNodeList litems = comp.elementsByTagName("LBALANCE");
00510     QLocale::setDefault(QLocale(QLocale::Spanish, QLocale::Spain));
00511     QLocale spanish;
00512         for ( int i = 0; i < litems.count(); i++ )
00513         {
00514             QDomNode item = litems.item ( i );
00515             QDomElement e1 = item.toElement(); 
00516             if ( !e1.isNull() )
00517             { 
00518                 QDomNode formul = item.firstChildElement ( "FORMULA" );
00519                 QString vact = formul.firstChildElement ( "VALORACT" ).toElement().text();
00520         vact = spanish.toString(vact.toDouble(), 'f', 2);
00521                 QString vant = formul.firstChildElement ( "VALORANT" ).toElement().text();
00522         vant = spanish.toString(vant.toDouble(), 'f', 2);
00523                 QString texto = item.firstChildElement ( "CONCEPTO" ).toElement().text();
00524                 fitxersortidatxt += "<tr>\n";
00525                 fitxersortidatxt += "<td>"+texto+"</td>\n";
00526                 fitxersortidatxt += "<td>"+vact+"</td>\n";
00527                 fitxersortidatxt += "<td>"+vant+"</td>\n";
00528                 fitxersortidatxt += "</tr>\n";
00529             } // end if
00530         } // end for
00531     QLocale::setDefault(QLocale::C);
00532         fitxersortidatxt += "</blockTable>\n";
00533         fitxersortidatxt += "<nextFrame/>\n";
00534     } // end for
00535 
00536     buff.replace ( "[story]", fitxersortidatxt );
00537     QDomElement nodo = m_doc.namedItem ( "BALANCE" ).namedItem ( "TITULO" ).toElement();
00538     buff.replace ( "[titulo]", nodo.text() );
00539 
00540     if ( file.open ( QIODevice::WriteOnly ) )
00541     {
00542         QTextStream stream ( &file );
00543         stream << buff;
00544         file.close();
00545     } // end if
00546 
00547     invocaPDF ( "canuales" );
00548     _depura ( "END CAnualesPrintView::imprimir", 0 );
00549 }

void CAnualesPrintView::on_mui_aceptar_clicked (  )  [virtual, slot]

Returns:

Version sin ARBOL

/ Ponemos todos los valores de las cuentas. Hacemos la carga. QDomNodeList lcuentas = m_doc.elementsByTagName("CUENTA"); for (int i = 0; i < lcuentas.count(); i++) { QDomNode cuenta = lcuentas.item(i); QDomElement e1 = cuenta.toElement(); /// try to convert the node to an element. if( !e1.isNull() ) { /// the node was really an element. / Este es el cálculo de los saldos para la cuenta. QString query = "SELECT saldototal('" + e1.text() + "','" + finicial + "','" + ffinal + "') AS valoract, saldototal('" + e1.text() + "','" + finicial1 + "','" + ffinal1 + "') AS valorant"; cursor2 *cur = empresaBase()->cargacursor(query); if (!cur->eof()) { QString valoract = cur->valor("valoract"); QString valorant = cur->valor("valorant"); QDomNode c = e1.parentNode(); agregaValores(c, valoract, valorant); } // end if delete cur; } // end if } // end for

Version con ARBOL: mas rollo de codigo pero muuuucho mas eficiente

Vamos a crear un arbol en la memoria dinamica con los distintos niveles de cuentas.

Primero, averiguaremos la cantidad de ramas iniciales (tantos como numero de cuentas de nivel 2) y las vamos creando.

un arbol por cada periodo

Cuenta raíz.

filtro para saber si es el de perdidas y ganancias

Discernimos entre Balances y Cuenta de Resultados

Hay que excluir el asiento de Regularizacion para el calculo de beneficios o perdidas si existe ya en el periodo

No hay que tener en cuenta el asiento de cierre para obtener los saldos

OJO!! Antes de nada, hay que calcular el asiento de REGULARIZACION que nos guarda el resultado en la 129

Ahora, recopilamos todos los apuntes agrupados por cuenta para poder establecer así los valores de cada cuenta para el periodo 1.

Para cada cuenta con sus saldos calculados hay que actualizar hojas del árbol.

borramos el asiento temporal creado indicando que no queremos confirmacion

Para el segundo periodo, calculamos el asiento de REGULARIZACION que nos guarda el resultado en la 129

Ahora, recopilamos todos los apuntes agrupados por cuenta para poder establecer así los valores de cada cuenta para el periodo 2.

Para cada cuenta con sus saldos calculados hay que actualizar hojas del árbol.

borramos indicando que no queremos confirmacion

Eliminamos el árbol y cerramos la conexión con la BD.

Fin de la version con ARBOL

Hacemos el calculo recursivo del balance.

Recogemos los valores de cuenta.

Try to convert the node to an element.

The node was really an element.

Una vez que tenemos el objeto bien generado y a punto pasamos a la generacion del PDF.

Definition at line 81 of file canualesprintview.cpp.

References _depura(), Arbol::actualizahojas(), agregaValores(), asiento, postgresiface2::begin(), postgresiface2::cargacursor(), postgresiface2::commit(), PEmpresaBase::empresaBase(), cursor2::eof(), FALSE, Arbol::hojaactual(), imprimir(), Arbol::inicializa(), Arbol::irHoja(), m_doc, Ui_CAnualesPrintBase::mui_fechafinal, Ui_CAnualesPrintBase::mui_fechafinal1, Ui_CAnualesPrintBase::mui_fechainicial, Ui_CAnualesPrintBase::mui_fechainicial1, Arbol::nuevarama(), Asiento1View::on_mui_borrar_clicked(), procesaFormula(), cursor2::siguienteregistro(), BusquedaFecha::text(), Fixed::toQString(), TRUE, and cursor2::valor().

00082 {
00083     _depura ( "CAnualesPrintView::on_mui_aceptar_clicked", 0 );
00084     QString finicial = mui_fechainicial->text();
00085     QString ffinal = mui_fechafinal->text();
00086     QString finicial1 = mui_fechainicial1->text();
00087     QString ffinal1 = mui_fechafinal1->text();
00088     if ( finicial1 == "" )
00089     {
00090         finicial1 = finicial;
00091     } // end if
00092     if ( ffinal1 == "" )
00093     {
00094         ffinal1 = ffinal;
00095     }
00096     if ( finicial == "" || ffinal == "" )
00097     {
00098         return;
00099     } // end if
00100 
00101 
00105 
00111 
00126 
00127 
00128 
00129 
00132     empresaBase()->begin();
00133     QString query = "SELECT *, nivel(codigo) AS nivel FROM cuenta ORDER BY codigo";
00134     cursor2 *ramas;
00135     ramas = empresaBase()->cargacursor ( query, "Ramas" );
00136     Arbol *arbolP1, *arbolP2; 
00137     arbolP1 = new Arbol;
00138     arbolP2 = new Arbol;
00139     while ( !ramas->eof() )
00140     {
00141         if ( atoi ( ramas->valor ( "nivel" ).toAscii().constData() ) == 2 )
00142         { 
00143             arbolP1->nuevarama ( ramas );
00144             arbolP2->nuevarama ( ramas );
00145         } // end if
00146         ramas->siguienteregistro();
00147     } // end while
00148     arbolP1->inicializa ( ramas );
00149     arbolP2->inicializa ( ramas );
00150     delete ramas;
00151     empresaBase()->commit();
00152 
00153     QRegExp rx("^.*perdidas y ganancias.*$"); 
00154     rx.setCaseSensitivity(Qt::CaseInsensitive);
00155     QString asiento;
00157     if(rx.exactMatch(m_doc.elementsByTagName("TITULO").item(0).toElement().text()))
00159     asiento = "%Asiento de Regularizaci%";
00160     else
00161     asiento = "%Asiento de Cierre%"; 
00162 
00164     Asiento1View *asientoReg;
00165     ((Empresa *)empresaBase())->regularizaempresa(finicial, ffinal);
00166     asientoReg = ((Empresa *)empresaBase())->intapuntsempresa2();
00167 
00170     empresaBase()->begin();
00171     query = "SELECT cuenta.idcuenta, numapuntes, cuenta.codigo, saldoant, debe, haber, saldo, debeej, haberej, saldoej FROM (SELECT idcuenta, codigo FROM cuenta) AS cuenta NATURAL JOIN (SELECT idcuenta, count(idcuenta) AS numapuntes,sum(debe) AS debeej, sum(haber) AS haberej, (sum(debe)-sum(haber)) AS saldoej FROM apunte WHERE EXTRACT(year FROM fecha) = EXTRACT(year FROM timestamp '"+finicial+"') GROUP BY idcuenta) AS ejercicio LEFT OUTER JOIN (SELECT idcuenta,sum(debe) AS debe, sum(haber) AS haber, (sum(debe)-sum(haber)) AS saldo FROM apunte WHERE fecha >= '"+finicial+"' AND fecha <= '"+ffinal+"' AND conceptocontable NOT SIMILAR TO '"+asiento+"' GROUP BY idcuenta) AS periodo ON periodo.idcuenta=ejercicio.idcuenta LEFT OUTER JOIN (SELECT idcuenta, (sum(debe)-sum(haber)) AS saldoant FROM apunte WHERE fecha < '"+finicial+"' GROUP BY idcuenta) AS anterior ON cuenta.idcuenta=anterior.idcuenta ORDER BY codigo";
00172     cursor2 *hojas;
00173     hojas = empresaBase()->cargacursor ( query, "Periodo1" );
00175     while ( !hojas->eof() )
00176     {
00177         arbolP1->actualizahojas ( hojas );
00178         hojas->siguienteregistro();
00179     } // end while
00180     empresaBase()->commit();
00181     asientoReg->on_mui_borrar_clicked(FALSE); 
00182 
00184     ((Empresa *)empresaBase())->regularizaempresa(finicial1, ffinal1);
00185     asientoReg = ((Empresa *)empresaBase())->intapuntsempresa2();
00186 
00189     empresaBase()->begin();
00190     query = "SELECT cuenta.idcuenta, numapuntes, cuenta.codigo, saldoant, debe, haber, saldo, debeej, haberej, saldoej FROM (SELECT idcuenta, codigo FROM cuenta) AS cuenta NATURAL JOIN (SELECT idcuenta, count(idcuenta) AS numapuntes,sum(debe) AS debeej, sum(haber) AS haberej, (sum(debe)-sum(haber)) AS saldoej FROM apunte WHERE EXTRACT(year FROM fecha) = EXTRACT(year FROM timestamp '"+finicial1+"') GROUP BY idcuenta) AS ejercicio LEFT OUTER JOIN (SELECT idcuenta,sum(debe) AS debe, sum(haber) AS haber, (sum(debe)-sum(haber)) AS saldo FROM apunte WHERE fecha >= '"+finicial1+"' AND fecha <= '"+ffinal1+"' AND conceptocontable NOT SIMILAR TO '"+asiento+"' GROUP BY idcuenta) AS periodo ON periodo.idcuenta=ejercicio.idcuenta LEFT OUTER JOIN (SELECT idcuenta, (sum(debe)-sum(haber)) AS saldoant FROM apunte WHERE fecha < '"+finicial1+"' GROUP BY idcuenta) AS anterior ON cuenta.idcuenta=anterior.idcuenta ORDER BY codigo";
00191     hojas = empresaBase()->cargacursor ( query, "Periodo2" );
00193     while ( !hojas->eof() )
00194     {
00195         arbolP2->actualizahojas ( hojas );
00196         hojas->siguienteregistro();
00197     } // end while
00198     delete hojas;
00199     empresaBase()->commit();
00200     asientoReg->on_mui_borrar_clicked(FALSE); 
00201 
00202     QDomNodeList lcuentas = m_doc.elementsByTagName ( "CUENTA" );
00203     for ( int i = 0; i < lcuentas.count(); i++ )
00204     {
00205         QDomNode cuenta = lcuentas.item ( i );
00206         QDomElement e1 = cuenta.toElement();
00207         QString valorP1, valorP2;
00208         Fixed valor = Fixed ( "0.00" );
00209         if ( !e1.isNull() )
00210         {
00211             if ( arbolP1->irHoja ( e1.text() ) )
00212                 valor = Fixed ( arbolP1->hojaactual ( "saldo" ) );
00213             else
00214                 valor = Fixed ( "0.00" );
00215             valorP1 = valor.toQString();
00216             if ( arbolP2->irHoja ( e1.text() ) )
00217                 valor = Fixed ( arbolP2->hojaactual ( "saldo" ) );
00218             else
00219                 valor = Fixed ( "0.00" );
00220             valorP2 = valor.toQString();
00221             QDomNode c = e1.parentNode();
00222             agregaValores ( c, valorP1, valorP2 );
00223         } // end if
00224     } // end for
00225 
00227     delete arbolP1;
00228     delete arbolP2;
00229 
00232 
00233     bool terminado = FALSE;
00234     while ( !terminado )
00235     {
00236         terminado = TRUE;
00238         QDomNodeList litems = m_doc.elementsByTagName ( "FORMULA" );
00239         for ( int i = 0; i < litems.count(); i++ )
00240         {
00241             QDomNode item = litems.item ( i );
00242             QDomElement e1 = item.toElement(); 
00243             if ( !e1.isNull() )
00244             { 
00245                 terminado &= procesaFormula ( item );
00246             } // end if
00247         } // end for
00248     } // end while
00249 
00251     imprimir ( finicial, ffinal, finicial1, ffinal1 );
00252     _depura ( "END CAnualesPrintView::on_mui_aceptar_clicked", 0 );
00253 }


Field Documentation

char* CAnualesPrintView::fichero [private]

Definition at line 49 of file canualesprintview.h.

Referenced by CAnualesPrintView().

QString CAnualesPrintView::idbalance [private]

Definition at line 50 of file canualesprintview.h.

QDomDocument CAnualesPrintView::m_doc [private]

Definition at line 51 of file canualesprintview.h.

Referenced by agregaValores(), imprimir(), on_mui_aceptar_clicked(), procesaOperador(), and setidbalance().


The documentation for this class was generated from the following files:
Generated on Sat Dec 15 00:01:46 2007 for BulmaGes by  doxygen 1.5.1