#include <stdio.h>#include <QAction>#include <QMessageBox>#include <QStringList>#include <QWidget>#include <QIcon>#include <QApplication>#include <QObject>#include "pluginregistroiva.h"#include "empresa.h"#include "registroivaview.h"#include "cobropagoview.h"#include "asiento1.h"#include "listlinasiento1view.h"#include "listregistroivaview.h"#include "regivaqtoolbutton.h"Go to the source code of this file.
Functions | |
| int | entryPoint (Bulmacont *bcont) |
| int | Asiento1View_Asiento1View (Asiento1View *l) |
| int | Asiento1_guardaAsiento1_post (Asiento1 *as) |
| Buscamos en el asiento si hay indicios de una factura y actuamos en consecuencia. | |
| int | ListLinAsiento1View_boton_iva (ListLinAsiento1View *as) |
| int Asiento1_guardaAsiento1_post | ( | Asiento1 * | as | ) |
Buscamos en el asiento si hay indicios de una factura y actuamos en consecuencia.
| as |
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 }
| int Asiento1View_Asiento1View | ( | Asiento1View * | l | ) |
| l |
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 }
| int entryPoint | ( | Bulmacont * | bcont | ) |
Añade en el menú del programa la opcióMn para acceder al corrector.
Definition at line 115 of file pluginregistroiva.cpp.
References _depura(), and myRegIVA::inicializa().
00115 { 00116 _depura("Punto de entrada del plugin registroIVA", 0); 00117 myRegIVA *my = new myRegIVA(); 00118 my->inicializa(bcont); 00119 return 0; 00120 }
| int ListLinAsiento1View_boton_iva | ( | ListLinAsiento1View * | as | ) |
| as |
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 }
1.5.1