registroivaview.h

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 #ifndef REGISTROIVAVIEW_H
00022 #define REGISTROIVAVIEW_H
00023 
00024 #include <QLineEdit>
00025 #include <QLabel>
00026 #include <QCheckBox>
00027 
00028 #include "ui_registroivabase.h"
00029 #include "registroiva.h"
00030 #include "postgresiface2.h"
00031 #include "ficha.h"
00032 #include "fixed.h"
00033 #include "dialogchanges.h"
00034 
00035 
00036 class empresa;
00037 
00038 
00039 class myRegIVA : public QObject {
00040 Q_OBJECT
00041 
00042 public:
00043     Bulmacont *m_bulmacont;
00044 
00045 public:
00046     myRegIVA();
00047     ~myRegIVA();
00048     void inicializa(Bulmacont *);
00049 
00050 public slots:
00051     void elslot();
00052     void elslot1();
00053 };
00054 
00055 
00056 
00057 class RegistroIvaView : public RegistroIva, public Ui_RegistroIvaBase {
00058     Q_OBJECT
00059 
00060 private:
00061     cursor2 *m_cursorcombo;
00063     cursor2 *m_cursorFPago;
00064 
00065 public:
00066     RegistroIvaView(Empresa *, QWidget *);
00067     virtual ~RegistroIvaView();
00068     void manageArticle(int);
00069     virtual void pintaidregistroiva(const QString &) {}
00070     ;
00071     virtual void pintacontrapartida(const QString &val) {
00072         m_contrapartida->setidcuenta(val);
00073     };
00074     virtual void pintabaseimp(const QString &val) {
00075         Fixed total(val);
00076         total = total + Fixed(iva());
00077         m_baseImponible->setText(val);
00078         m_totalFactura->setText(total.toQString());
00079     };
00080     virtual void pintaiva(const QString &val) {
00081         Fixed total(val);
00082         total = total + Fixed(baseimp());
00083         m_totalFactura->setText(total.toQString());
00084         m_importeiva->setText(val);
00085     };
00086     virtual void pintaffactura(const QString &val) {
00087         m_ffactura->setText(val);
00088     };
00089     virtual void pintafemisionregistroiva(const QString &val) {
00090         m_femisionregistroiva->setText(val);
00091     };
00092     virtual void pintaserieregistroiva(const QString &val) {
00093         m_serieregistroiva->setText(val);
00094     };
00095     virtual void pintafactura(const QString &val) {
00096         m_factura->setText(val);
00097     };
00098     virtual void pintaidborrador(const QString &) {}
00099     ;
00100     virtual void pintaregularizacion(const QString &) {}
00101     ;
00102     virtual void pintaplan349(const QString &) {}
00103     ;
00104     virtual void pintanumorden(const QString &val) {
00105         m_numorden->setText(val);
00106     };
00107     virtual void pintacif(const QString &val) {
00108         m_cif->setText(val);
00109     };
00110     virtual void pintaidfpago(const QString &) {}
00111     ;
00112     virtual void pintafactemitida(const QString &val) {
00113         if (val == "t" || val == "TRUE")
00114             m_factEmitida->setChecked(TRUE);
00115         else
00116             m_factSoportada->setChecked(TRUE);
00117     };
00118 virtual void pintarectificaaregistroiva(const QString &) {}
00119     ;
00120     virtual void pintaincregistro(const QString &val) {
00121         if (val == "t" || val == "TRUE")
00122             m_incregistroIVA->setChecked(TRUE);
00123         else
00124             m_incregistroIVA->setChecked(FALSE);
00125     };
00126 
00127     virtual void recalculaIva() {
00128         Fixed base = mui_listIva->sumarCampo("baseiva");
00129         Fixed iva = mui_listIva->sumarCampo("ivaiva");
00130         setbaseimp(base.toQString());
00131         setiva(iva.toQString());
00132         pintabaseimp(base.toQString());
00133         pintaiva(iva.toQString());
00134     };
00135     virtual int guardar();
00136     int cargar(QString id);
00137     virtual int borrar() {
00138         return RegistroIva::borrar();
00139     };
00140 
00141 private:
00142     void generarPedidoCliente();
00143     void cargarComboFPago(QString);
00144 
00145 public slots:
00146     virtual void on_mui_generarPrevisiones_clicked();
00148     virtual void on_mui_listIva_editFinish(int, int) {
00149         _depura("RegistroIvaView::on_mui_listIva_editFinish", 0);
00150         recalculaIva();
00151         _depura("END RegistroIvaView::on_mui_listIva_editFinish", 0);
00152     };
00153 };
00154 
00155 #endif
00156 

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