plugintrazabilidad.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 <stdio.h>
00022 
00023 #include <QAction>
00024 #include <QObject>
00025 #include <QMessageBox>
00026 #include <QLineEdit>
00027 #include <QTabWidget>
00028 
00029 #include "company.h"
00030 #include "plugintrazabilidad.h"
00031 #include "funcaux.h"
00032 #include "movimientosview.h"
00033 
00034 
00036 
00038 myplugin::myplugin() {
00039     _depura("myplugin::myplugin", 0);
00040     _depura("END myplugin::myplugin", 0);
00041 }
00042 
00043 
00045 
00047 myplugin::~myplugin() {
00048     _depura("myplugin::~myplugin", 0);
00049     _depura("END myplugin::~myplugin", 0);
00050 }
00051 
00052 
00054 
00056 void myplugin::elslot() {
00057     _depura("myplugin::elslot", 0);
00058         MovimientosView *mov = new MovimientosView((Company *)empresaBase());
00059         empresaBase()->pWorkspace()->addWindow(mov);
00060         mov->show();
00061     _depura("END myplugin::elslot", 0);
00062 }
00063 
00064 
00066 
00069 void myplugin::inicializa(Bulmafact *bges) {
00070     _depura("myplugin::inicializa", 0);
00072     setEmpresaBase(bges->getcompany());
00073     m_bulmafact = bges;
00074     QAction *accion = new QAction("&Movimientos", 0);
00075     accion->setStatusTip("Ventana de Movimientos");
00076     accion->setWhatsThis("Movimientos");
00077 
00078     bges->menuMaestro->addSeparator();
00079     bges->menuMaestro->addAction(accion);
00080 
00081     connect(accion, SIGNAL(activated()), this, SLOT(elslot()));
00082     _depura("END myplugin::inicializa", 0);
00083 }
00084 
00085 
00087 
00091 int entryPoint(Bulmafact *bges) {
00092     _depura("Punto de Entrada del plugin PluginTrazabilidad", 0);
00093     myplugin *plug = new myplugin();
00094     plug->inicializa(bges);
00095     _depura("END Punto de Entrada del plugin PluginTrazabilidad", 0);
00096     return 0;
00097 }
00098 
00099 
00101 
00105 int ListLinAlbaranProveedorView_ListLinAlbaranProveedorView(ListLinAlbaranProveedorView *subform) {
00106     _depura("ListLinAlbaranProveedorView_ListLinAlbaranProveedorView", 0);
00107     subform->addSHeader("lotelalbaranp", DBCampo::DBvarchar, DBCampo::DBNothing, SHeader::DBNone, "Lote");
00108     _depura("END ListLinAlbaranProveedorView_ListLinAlbaranProveedorView", 0);
00109     return 0;
00110 }
00111 
00113 
00117 int ListLinAlbaranClienteView_ListLinAlbaranClienteView(ListLinAlbaranClienteView *subform) {
00118     _depura("ListLinAlbaranClienteView_ListLinAlbaranClienteView", 0);
00119     subform->addSHeader("lotelalbaran", DBCampo::DBvarchar, DBCampo::DBNothing, SHeader::DBNone, "Lote");
00120     _depura("END ListLinAlbaranClienteView_ListLinAlbaranClienteView", 0);
00121     return 0;
00122 }
00123 
00124 
00126 
00130 int ListLinFacturaView_ListLinFacturaView(ListLinFacturaView *subform) {
00131     _depura("ListLinFacturaView_ListLinFacturaView", 0);
00132     subform->addSHeader("lotelfactura", DBCampo::DBvarchar, DBCampo::DBNothing, SHeader::DBNone, "Lote");
00133     _depura("END ListLinFacturaView_ListLinFacturaView", 0);
00134     return 0;
00135 }
00136 
00137 
00139 
00143 int ListLinFacturaProveedorView_ListLinFacturaProveedorView(ListLinFacturaProveedorView *subform) {
00144     _depura("ListLinFacturaProveedorView_ListLinFacturaProveedorView", 0);
00145     subform->addSHeader("lotelfacturap", DBCampo::DBvarchar, DBCampo::DBNothing, SHeader::DBNone, "Lote");
00146     _depura("END ListLinFacturaProveedorView_ListLinFacturaProveedorView", 0);
00147     return 0;
00148 }
00149 
00150 
00152 
00155 int SubForm2Bf_on_mui_list_editFinished(SubForm2Bf *) {
00156     _depura("SubForm2Bf_on_mui_list_editFinished", 0);
00157 
00158 /*
00159 
00160     if(subform->m_prevRow == -1 || subform->m_prevCol == -1) {
00161         return 0;
00162     } // end if
00163 
00164     SDBRecord *rec = subform->lineaat(subform->m_prevRow);
00165     SDBCampo *camp = (SDBCampo *) subform->item(subform->m_prevRow, subform->m_prevCol);
00166     SDBCampo *campact = (SDBCampo *) subform->item(subform->currentRow(), subform->currentColumn());
00167     camp->refresh();
00168 
00169 
00170 
00171     if (camp->nomcampo() == "lote"+subform->tableName()) {
00172         QString query = "SELECT * FROM movimiento LEFT JOIN articulo ON movimiento.idarticulo = articulo.idarticulo WHERE lotemovimiento = '"+camp->valorcampo()+"'";
00173         cursor2 *cur = subform->empresaBase()->cargacursor(query);
00174         if (!cur->eof()) {
00175                 if (campact->nomcampo() == "codigocompletoarticulo") {
00176                         subform->situarse1(subform->m_prevRow, subform->m_prevCol);
00177                         campact->setText(cur->valor("codigocompletoarticulo"));
00178                 } else {
00179                         rec->setDBvalue("idarticulo", cur->valor("idarticulo"));
00180                         rec->setDBvalue("codigocompletoarticulo", cur->valor("codigocompletoarticulo"));
00181                         rec->setDBvalue("nomarticulo", cur->valor("nomarticulo"));
00182                         rec->refresh();
00183                 } // end if
00184         } // end if
00185         delete cur;
00186     } // end if
00187 
00188 */
00189     return 0;
00190 
00191     _depura("END SubForm2Bf_on_mui_list_editFinished", 0);
00192 }

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