zview.cpp

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2004 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 <QMessageBox>
00022 #include <QCloseEvent>
00023 #include <QFile>
00024 #include <QTextStream>
00025 
00026 #include <fstream>
00027 
00028 #include "zview.h"
00029 #include "company.h"
00030 #include "configuracion.h"
00031 #include "plugins.h"
00032 
00033 #include "funcaux.h"
00034 
00035 
00044 ZView::ZView(Company *comp, QWidget *parent)
00045         : FichaBf(comp, parent) {
00046     _depura("ZView::ZView", 0);
00047     setAttribute(Qt::WA_DeleteOnClose);
00048     try {
00049         setupUi(this);
00050 
00052         if (g_plugins->lanza("ZView_ZView", this)) return;
00053 
00054         setTitleName(tr("Cuadre de Caja"));
00055         setDBTableName("z");
00056         setDBCampoId("idz");
00057         addDBCampo("idz", DBCampo::DBint, DBCampo::DBPrimaryKey, tr( "ID"));
00058         addDBCampo("fechaz", DBCampo::DBdate, DBCampo::DBNotNull, tr( "Fecha"));
00059         addDBCampo("horaz", DBCampo::DBvarchar, DBCampo::DBNotNull  , tr( "Hora"));
00060         addDBCampo("totalz", DBCampo::DBnumeric, DBCampo::DBNotNull  , tr( "Total"));
00061         addDBCampo("numtickets", DBCampo::DBint, DBCampo::DBNotNull  , tr( "Num. Tickets"));
00062         addDBCampo("idalmacen", DBCampo::DBint, DBCampo::DBNothing, tr( "Id. almacen"));
00063         addDBCampo("nomalmacen", DBCampo::DBvarchar, DBCampo::DBNothing, tr( "Almacen"));
00064 
00065         mui_idalmacen->setEmpresaBase(comp);
00066 
00067 
00068         mui_list->setEmpresaBase(comp);
00069         mui_list->setDBTableName("albaran");
00070         mui_list->setDBCampoId("idalbaran");
00071         mui_list->addSHeader("idalbaran",  DBCampo::DBint, DBCampo::DBNoSave,     SHeader::DBNoWrite,                         tr("Id. Albaran"));
00072         mui_list->addSHeader("numalbaran",  DBCampo::DBvarchar, DBCampo::DBNoSave,     SHeader::DBNoWrite,                         tr("Numero"));
00073         mui_list->addSHeader("descalbaran",  DBCampo::DBvarchar, DBCampo::DBNoSave,     SHeader::DBNoWrite,                         tr("Descripcion"));
00074         mui_list->addSHeader("refalbaran",  DBCampo::DBvarchar, DBCampo::DBNoSave,     SHeader::DBNoWrite,                         tr("Referencia"));
00075         mui_list->addSHeader("fechaalbaran",  DBCampo::DBdate, DBCampo::DBNoSave,     SHeader::DBNoWrite,                         tr("Fecha"));
00076         mui_list->addSHeader("procesadoalbaran",  DBCampo::DBboolean, DBCampo::DBNoSave,     SHeader::DBNoWrite,                         tr("Procesado"));
00077         mui_list->addSHeader("anuladoalbaran",  DBCampo::DBboolean, DBCampo::DBNoSave,     SHeader::DBNoWrite,                         tr("Anulado"));
00078         mui_list->addSHeader("horaalbaran",  DBCampo::DBvarchar, DBCampo::DBNoSave,     SHeader::DBNoWrite,                         tr("Hora"));
00079         mui_list->addSHeader("totalalbaran",  DBCampo::DBnumeric, DBCampo::DBNoSave,     SHeader::DBNoWrite,                         tr("Total"));
00080         mui_list->addSHeader("bimpalbaran",  DBCampo::DBnumeric, DBCampo::DBNoSave,     SHeader::DBNoWrite,                         tr("Base Imponible"));
00081         mui_list->addSHeader("impalbaran",  DBCampo::DBnumeric, DBCampo::DBNoSave,     SHeader::DBNoWrite,                         tr("Impuestos"));
00082 
00083 
00084         mui_list->setinsercion(FALSE);
00085         mui_list->setDelete(FALSE);
00086         mui_list->setSortingEnabled(TRUE);
00087 
00088         dialogChanges_cargaInicial();
00089         meteWindow(windowTitle(), this, FALSE);
00090     } catch (...) {
00091         mensajeInfo(tr("Error al crear el almacen"));
00092     } // end try
00093     _depura("END ZView::ZView", 0);
00094 }
00095 
00096 
00098 
00101 ZView::~ZView() {
00102     _depura("ZView::~ZView", 0);
00103     _depura("END ZView::~ZView", 0);
00104 }
00105 
00106 
00108 
00112 int ZView::cargarPost(QString idz) {
00113     mui_list->cargar("SELECT * FROM albaran WHERE idz=" + idz);
00114     return 0;
00115 }
00116 
00117 
00118 

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