pluginregistroiva.h File Reference

#include "bulmacont.h"
#include "postgresiface2.h"
#include "empresa.h"
#include "asiento1.h"
#include "listlinasiento1view.h"
#include "asiento1view.h"

Go to the source code of this file.

Defines

#define MY_EXPORT

Functions

MY_EXPORT int entryPoint (Bulmacont *)
MY_EXPORT int Asiento1_guardaAsiento1_post (Asiento1 *)
 Buscamos en el asiento si hay indicios de una factura y actuamos en consecuencia.
MY_EXPORT int empresa_cobPag (Empresa *)
MY_EXPORT int empresa_registroiva (Empresa *)
MY_EXPORT int ListLinAsiento1View_boton_iva (ListLinAsiento1View *)
MY_EXPORT int Asiento1View_Asiento1View (Asiento1View *)


Define Documentation

#define MY_EXPORT

Definition at line 24 of file pluginregistroiva.h.


Function Documentation

MY_EXPORT int Asiento1_guardaAsiento1_post ( Asiento1 as  ) 

Buscamos en el asiento si hay indicios de una factura y actuamos en consecuencia.

Parameters:
as 
Returns:

Preparamos una expresión regular para usar en la consulta.

Le quitamos el último '|' que nos sobra.

Recorremos la tabla en busca de entradas de factura no introducidas y las preguntamos antes de cerrar nada.

Definition at line 152 of file pluginregistroiva.cpp.

References _depura(), QWorkspace2::addWindow(), postgresiface2::cargacursor(), Asiento1::companyact(), cuentas, DBRecord::DBvalue(), cursor2::eof(), RegistroIva::inicializa1(), EmpresaBase::pWorkspace(), postgresiface2::sanearCadena(), cursor2::siguienteregistro(), and cursor2::valor().

00152                                                {
00153     _depura("Asiento1_guardaAsiento1_post", 0);
00154     Empresa *companyact = as->companyact();
00155     QString cuentas = "";
00156     QString query = "SELECT valor FROM configuracion WHERE nombre = 'RegistroEmitida' OR nombre = 'RegistroSoportada'";
00157     cursor2 *curvalor = companyact->cargacursor(query);
00158     while (!curvalor->eof()) {
00160         cuentas += curvalor->valor("valor") + "%|";
00161         curvalor->siguienteregistro();
00162     } // end while
00163     delete curvalor;
00165     cuentas.truncate(cuentas.length() - 1);
00166 
00169     QString SQLQuery = "SELECT bcontrapartidaborr(idborrador) AS contra FROM borrador LEFT JOIN cuenta ON borrador.idcuenta = cuenta.idcuenta WHERE idasiento = " + as->DBvalue("idasiento") + " AND codigo SIMILAR TO '" + companyact->sanearCadena(cuentas.toAscii().constData()) + "' GROUP BY contra";
00170 
00171     cursor2 *cursborr= companyact->cargacursor(SQLQuery);
00172     while (!cursborr->eof()) {
00173         int idborrador = cursborr->valor("contra").toInt();
00174         RegistroIvaView *reg = new RegistroIvaView(companyact, 0);
00175         reg->inicializa1(idborrador);
00176         companyact->pWorkspace()->addWindow(reg);
00177         reg->show();
00178         cursborr->siguienteregistro();
00179     } // end while
00180     delete cursborr;
00181     _depura("END Asiento1_guardaAsiento1_post", 0);
00182     return 0;
00183 }

MY_EXPORT int Asiento1View_Asiento1View ( Asiento1View l  ) 

Parameters:
l 
Returns:

Definition at line 128 of file pluginregistroiva.cpp.

References _depura(), and Ui_AsientoBase::mui_plugbotones.

00128                                                {
00129        _depura("Asiento1View_Asiento1View", 0);
00130 //================================
00131        RegIVAQToolButton *mui_exporta_efactura2 = new RegIVAQToolButton(l,  l->mui_plugbotones);
00132 
00133        QHBoxLayout *m_hboxLayout1 = l->mui_plugbotones->findChild<QHBoxLayout *>("hboxLayout1");
00134        if (!m_hboxLayout1) {
00135                 m_hboxLayout1 = new QHBoxLayout(l->mui_plugbotones);
00136                 m_hboxLayout1->setSpacing(5);
00137                 m_hboxLayout1->setMargin(5);
00138                 m_hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1"));
00139        } // end if
00140        m_hboxLayout1->addWidget(mui_exporta_efactura2);
00141 //================================
00142        _depura("END Asiento1View_Asiento1View", 0);
00143        return 0;
00144 }

MY_EXPORT int empresa_cobPag ( Empresa  ) 

MY_EXPORT int empresa_registroiva ( Empresa  ) 

MY_EXPORT int entryPoint ( Bulmacont bcont  ) 

Returns:

Añade en el menú del programa la opci&oacuteMn para acceder al corrector.

Definition at line 91 of file plugin.cpp.

References _depura(), and myplugin::inicializa().

00091                                   {
00092     _depura("Estoy dentro del plugin\n", 0);
00093     myplugin *plug = new myplugin();
00094     plug->inicializa(bcont);
00097     bcont->setWindowTitle("Prueba de plugin.");
00098 }

MY_EXPORT int ListLinAsiento1View_boton_iva ( ListLinAsiento1View as  ) 

Parameters:
as 
Returns:

Definition at line 192 of file pluginregistroiva.cpp.

References _depura(), SubForm3::DBvalue(), SubForm2Bc::empresaBase(), SubForm3::guardar(), RegistroIva::inicializa1(), and mensajeInfo().

00192                                                            {
00193     _depura("ListLinAsiento1View_boton_iva", 0);
00194     as->guardar();
00195     try {
00196         int idborrador = as->DBvalue("idborrador").toInt();
00197         RegistroIvaView *nuevae = new RegistroIvaView((Empresa *) as->empresaBase(), 0);
00198         nuevae->inicializa1(idborrador);
00199         ((Empresa *)as->empresaBase())->pWorkspace()->addWindow(nuevae);
00200         nuevae->show();
00201     } catch (...) {
00202         mensajeInfo("Debe seleccionar un apunte");
00203         return 0;
00204     } // end try
00205     _depura("END ListLinAsiento1View_boton_iva", 0);
00206     return 0;
00207 }


Generated on Sat Dec 15 00:01:29 2007 for BulmaGes by  doxygen 1.5.1