busquedareferencia.cpp

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2005 by Tomeu Borras Riera                              *
00003  *   tborras@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 "busquedareferencia.h"
00022 #include "company.h"
00023 #include "funcaux.h"
00024 #include "informereferencia.h"
00025 #include "presupuestoview.h"
00026 #include "pedidoclienteview.h"
00027 #include "albaranclienteview.h"
00028 #include "facturaview.h"
00029 #include "cobroview.h"
00030 #include "pagoview.h"
00031 #include "pedidoproveedorview.h"
00032 #include "albaranproveedorview.h"
00033 #include "facturapview.h"
00034 
00035 
00042 BusquedaReferencia::BusquedaReferencia(QWidget *parent)
00043         : BLWidget(parent) {
00044     _depura("BusquedaReferencia::BusquedaReferencia", 0);
00045     setupUi(this);
00046     _depura("END BusquedaReferencia::BusquedaReferencia", 0);
00047 }
00048 
00049 
00054 BusquedaReferencia::~BusquedaReferencia() {
00055     _depura("BusquedaReferencia::~BusquedaReferencia", 0);
00056     _depura("END BusquedaReferencia::~BusquedaReferencia", 0);
00057 }
00058 
00059 
00065 void BusquedaReferencia::on_mui_informe_clicked() {
00066     _depura("BusquedaReferencia::on_mui_buscar_clicked\n", 0);
00067     InformeReferencia *inf = new InformeReferencia((Company *)empresaBase());
00068     inf->setreferencia(mui_referencia->text());
00069     inf->generarinforme();
00070     delete inf;
00071     _depura("END BusquedaReferencia::on_mui_buscar_clicked\n", 0);
00072 
00073 }
00074 
00075 
00081 void BusquedaReferencia::on_mui_referencia_editingFinished() {
00082     _depura("BusquedaReferencia::on_m_cifcliente_editingFinished", 0);
00083     emit(valueChanged(mui_referencia->text()));
00084     _depura("END BusquedaReferencia::on_m_cifcliente_editingFinished", 0);
00085 }
00086 
00087 
00095 void BusquedaReferencia::on_mui_abrirtodo_clicked() {
00096     _depura("BusquedddaReferencia::on_mui_abrirtodo_clicked", 0);
00098     QString SQLQuery = "SELECT * FROM presupuesto WHERE refpresupuesto = '" + mui_referencia->text() + "'";
00099     cursor2 *cur = empresaBase()->cargacursor(SQLQuery);
00100     while (!cur->eof()) {
00101         PresupuestoView *bud = ((Company *)empresaBase())->nuevoPresupuestoView();
00102         empresaBase()->m_pWorkspace->addWindow(bud);
00103         bud->cargar(cur->valor("idpresupuesto"));
00104         bud->show();
00105         cur->siguienteregistro();
00106     } // end while
00107     delete cur;
00108 
00109     SQLQuery = "SELECT * FROM pedidocliente WHERE refpedidocliente = '" + mui_referencia->text() + "'";
00110     cur = empresaBase()->cargacursor(SQLQuery);
00111     while (!cur->eof()) {
00112         PedidoClienteView *bud = ((Company *)empresaBase())->newPedidoClienteView();
00113         empresaBase()->m_pWorkspace->addWindow(bud);
00114         bud->cargar(cur->valor("idpedidocliente"));
00115         bud->show();
00116         cur->siguienteregistro();
00117     } // end while
00118     delete cur;
00119 
00120     SQLQuery = "SELECT * FROM albaran WHERE refalbaran = '" + mui_referencia->text() + "'";
00121     cur = empresaBase()->cargacursor(SQLQuery);
00122     while (!cur->eof()) {
00123         AlbaranClienteView *bud = ((Company *)empresaBase())->newAlbaranClienteView();
00124         empresaBase()->m_pWorkspace->addWindow(bud);
00125         bud->cargar(cur->valor("idalbaran"));
00126         bud->show();
00127         cur->siguienteregistro();
00128     } // end while
00129     delete cur;
00130 
00131     SQLQuery = "SELECT * FROM factura WHERE reffactura = '" + mui_referencia->text() + "'";
00132     cur = empresaBase()->cargacursor(SQLQuery);
00133     while (!cur->eof()) {
00134         FacturaView *bud = ((Company *)empresaBase())->newFacturaView();
00135         empresaBase()->m_pWorkspace->addWindow(bud);
00136         bud->cargar(cur->valor("idfactura"));
00137         bud->show();
00138         cur->siguienteregistro();
00139     } // end while
00140     delete cur;
00141 
00142     SQLQuery = "SELECT * FROM cobro WHERE refcobro = '" + mui_referencia->text() + "'";
00143     cur = empresaBase()->cargacursor(SQLQuery);
00144     while (!cur->eof()) {
00145         CobroView *bud = ((Company *)empresaBase())->newCobroView();
00146         empresaBase()->m_pWorkspace->addWindow(bud);
00147         bud->cargar(cur->valor("idcobro"));
00148         bud->show();
00149         cur->siguienteregistro();
00150     } // end while
00151     delete cur;
00152 
00153     SQLQuery = "SELECT * FROM pago WHERE refpago = '" + mui_referencia->text() + "'";
00154     cur = empresaBase()->cargacursor(SQLQuery);
00155     while (!cur->eof()) {
00156         PagoView *bud = ((Company *)empresaBase())->newPagoView();
00157         empresaBase()->m_pWorkspace->addWindow(bud);
00158         bud->cargar(cur->valor("idpago"));
00159         bud->show();
00160         cur->siguienteregistro();
00161     } // end while
00162     delete cur;
00163 
00164     SQLQuery = "SELECT * FROM pedidoproveedor WHERE refpedidoproveedor = '" + mui_referencia->text() + "'";
00165     cur = empresaBase()->cargacursor(SQLQuery);
00166     while (!cur->eof()) {
00167         PedidoProveedorView *bud = ((Company *)empresaBase())->nuevoPedidoProveedorView();
00168         empresaBase()->m_pWorkspace->addWindow(bud);
00169         bud->cargar(cur->valor("idpedidoproveedor"));
00170         bud->show();
00171         cur->siguienteregistro();
00172     } // end while
00173     delete cur;
00174 
00175     SQLQuery = "SELECT * FROM albaranp WHERE refalbaranp = '" + mui_referencia->text() + "'";
00176     cur = empresaBase()->cargacursor(SQLQuery);
00177     while (!cur->eof()) {
00178         AlbaranProveedorView *bud = ((Company *)empresaBase())->newAlbaranProveedorView();
00179         empresaBase()->m_pWorkspace->addWindow(bud);
00180         bud->cargar(cur->valor("idalbaranp"));
00181         bud->show();
00182         cur->siguienteregistro();
00183     } // end while
00184     delete cur;
00185 
00186 
00187     SQLQuery = "SELECT * FROM facturap WHERE reffacturap = '" + mui_referencia->text() + "'";
00188     cur = empresaBase()->cargacursor(SQLQuery);
00189     while (!cur->eof()) {
00190         FacturaProveedorView *bud = ((Company *)empresaBase())->newFacturaProveedorView();
00191         empresaBase()->m_pWorkspace->addWindow(bud);
00192         bud->cargar(cur->valor("idfacturap"));
00193         bud->show();
00194         cur->siguienteregistro();
00195     } // end while
00196     delete cur;
00197 
00198     _depura("END BusquedddaReferencia::on_mui_abrirtodo_clicked", 0);
00199 }
00200 
00201 
00207 void BusquedaReferencia::setText(QString val) {
00208     _depura("BusquedaReferencia::setText", 0);
00209     mui_referencia->setText(val);
00210     _depura("END BusquedaReferencia::setText", 0);
00211 }
00212 
00213 
00219 void BusquedaReferencia::setValorCampo(QString val) {
00220     _depura("BusquedaReferencia::setText", 0);
00221     mui_referencia->setText(val);
00222     _depura("END BusquedaReferencia::setText", 0);
00223 }
00224 
00225 
00231 QString BusquedaReferencia::text() {
00232     _depura("BusquedaReferencia::text", 0);
00233     _depura("END BusquedaReferencia::text", 0);
00234     return mui_referencia->text();
00235 }
00236 
00237 
00243 QString BusquedaReferencia::valorCampo() {
00244     _depura("BusquedaReferencia::text", 0);
00245     _depura("END BusquedaReferencia::text", 0);
00246     return mui_referencia->text();
00247 }
00248 
00249 

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