efactura.cpp

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2006 by Arturo Martin Llado                             *
00003  *   amartin@conetxia.com                                                  *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00019  ***************************************************************************/
00020 
00021 #include "efactura.h"
00022 #include "funcaux.h"
00023 #include <QFileDialog>
00024 #include <QLineEdit>
00025 #include <QString>
00026 
00027 
00031 
00035 EFactura::EFactura(Company *emp, QWidget *parent) : FichaBf(emp, parent) {
00036         
00037         _depura("EFactura::EFactura", 2);
00038         
00039         QString query;
00040         
00041         setupUi(this);  // Para que el form se inicialice bien
00042         
00043 //      query = "SELECT valor FROM configuracion WHERE nombre = 'eFactura_server'";
00044 //      cursor2 *cur1 = empresaBase()->cargacursor(query);
00045 //      mui_URLServidorTiempo->setText(cur1->valor("valor"));
00046 //      delete cur1;
00047 //      
00048 //      query = "SELECT valor FROM configuracion WHERE nombre = 'eFactura_certificado'";
00049 //      cursor2 *cur2 = empresaBase()->cargacursor(query);
00050 //      mui_ficheroECertificado->setText(cur2->valor("valor"));
00051 //      delete cur2;
00052 //      
00053 //      query = "SELECT valor FROM configuracion WHERE nombre = 'eFactura_server_valida'";
00054 //      cursor2 *cur3 = empresaBase()->cargacursor(query);
00055 //      mui_URLServidorValidaCert->setText(cur3->valor("valor"));
00056 //      delete cur3;
00057         
00058         _depura("END EFactura::EFactura", 2);
00059 }
00060 
00061 
00063 
00065 EFactura::~EFactura() {
00066         _depura("EFactura::~EFactura", 0);
00067         _depura("EFactura::~EFactura", 0);
00068 }
00069 
00070 
00072 
00074 void EFactura::on_mui_guardar_clicked() {
00075         
00076         _depura("EFactura::on_mui_guardar_clicked", 0);
00077         
00078         QString query;
00079         
00080         if (mui_URLServidorTiempo->isModified()) {
00081                 query = "DELETE FROM configuracion WHERE nombre = 'eFactura_server'";
00082                 empresaBase()->ejecuta(query);
00083                 
00084                 query = "INSERT INTO configuracion (nombre, valor) VALUES ('eFactura_server', '";
00085                 query += mui_URLServidorTiempo->text();
00086                 query += "')";
00087                 empresaBase()->ejecuta(query);
00088         }
00089         
00093         
00094         query = "DELETE FROM configuracion WHERE nombre = 'eFactura_certificado'";
00095         empresaBase()->ejecuta(query);
00096         
00097         query = "INSERT INTO configuracion (nombre, valor) VALUES ('eFactura_certificado', '";
00098         query += mui_ficheroECertificado->text();
00099         query += "')";
00100         empresaBase()->ejecuta(query);
00101 
00102         _depura("END EFactura::on_mui_guardar_clicked", 0);
00103 }
00104 
00105 
00107 
00109 void EFactura::on_mui_examinaECertificado_clicked() {
00110         _depura("EFactura::on_mui_examinar_clicked", 0);
00111         
00112         QString s = QFileDialog::getOpenFileName(
00113                         this,
00114                         "Escoja un fichero por favor",
00115                         "/home",
00116                         "Todos los archivos (*)"
00117                         );
00118 
00120         
00121         if (s != "")
00122                 mui_ficheroECertificado->setText(s);
00123         
00124         _depura("END EFactura::on_mui_examinar_clicked", 0);
00125 }
00126 
00127 
00129 
00131 void EFactura::on_mui_cancelar_clicked() {
00132         _depura("EFactura::on_mui_cancelar_clicked", 0);
00133         
00134 //      QString query = "SELECT * FROM configuracion";
00135 //      cursor2 *cur = empresaBase()->cargacursor(query);
00136 //      
00137 //      while(!cur->eof()) {
00138 //              _depura(cur->valor("nombre"), 0);
00139 //              cur->siguienteregistro();
00140 //      } // end while
00141 //      
00142 //      delete cur;
00143 //      
00144 //      query = "UPDATE configuracion SET nombre='nombre' WHRE nombre='elnombre'";
00145 //      empresaBase()->begin();
00146 //      empresaBase()->ejecuta(query);
00147 //      empresaBase()->rollback();
00148         _depura("END EFactura::on_mui_cancelar_clicked", 0);
00149 }

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