#include <subform2bt.h>
Inheritance diagram for SubForm2Bt:

Public Slots | |
| virtual void | on_mui_list_pressedSlash (int row, int col) |
| virtual void | on_mui_list_pressedAsterisk (int row, int col) |
| virtual void | on_mui_list_pressedMinus (int row, int col) |
Public Member Functions | |
| SubForm2Bt (QWidget *parent=0) | |
| virtual | ~SubForm2Bt () |
| virtual void | cargar (QString query) |
| virtual void | setEmpresaBase (EmpresaBase *) |
| virtual void | on_mui_list_cellChanged (int row, int col) |
| virtual int | cerrarEditor () |
| void | setIdCliente (QString id) |
| void | setIdProveedor (QString id) |
Data Fields | |
| QSubForm2BtDelegate * | m_delegate |
Protected Attributes | |
| QString | mdb_idcliente |
| QString | mdb_idproveedor |
Es la primera abstraccion de los subformularios que incluye todas las características comunes de la facturación.
Definition at line 59 of file subform2bt.h.
| SubForm2Bt::SubForm2Bt | ( | QWidget * | parent = 0 |
) |
| parent |
Definition at line 39 of file subform2bt.cpp.
References _depura(), m_delegate, mdb_idcliente, Ui_SubForm3Base::mui_list, SubForm3::setDelete(), and TRUE.
00039 : SubForm3(parent) { 00040 _depura("SubForm2Bt::SubForm2Bt", 0); 00041 setDelete(TRUE); 00042 m_delegate = new QSubForm2BtDelegate(this); 00043 mui_list->setItemDelegate(m_delegate); 00044 mdb_idcliente = ""; 00045 _depura("END SubForm2Bt::SubForm2Bt", 0); 00046 }
| SubForm2Bt::~SubForm2Bt | ( | ) | [virtual] |
Definition at line 52 of file subform2bt.cpp.
References _depura(), and m_delegate.
00052 { 00053 _depura("SubForm2Bt::~SubForm2Bt", 0); 00054 delete m_delegate; 00055 _depura("END SubForm2Bt::~SubForm2Bt", 0); 00056 }
| void SubForm2Bt::cargar | ( | QString | query | ) | [virtual] |
| query |
Reimplemented from SubForm3.
Definition at line 63 of file subform2bt.cpp.
References _depura(), and SubForm3::cargar().
Referenced by myplugin::inicializa().
00063 { 00064 _depura("SubForm2Bt::cargar", 0); 00065 SubForm3::cargar(query); 00066 _depura("END SubForm2Bt::cargar", 0); 00067 }
| void SubForm2Bt::setEmpresaBase | ( | EmpresaBase * | c | ) | [virtual] |
| c |
Reimplemented from SubForm3.
Definition at line 234 of file subform2bt.cpp.
References _depura(), m_delegate, PEmpresaBase::setEmpresaBase(), and SubForm3::setEmpresaBase().
Referenced by myplugin::inicializa().
00234 { 00235 _depura("SubForm2Bt::setcompany", 0); 00236 SubForm3::setEmpresaBase(c); 00237 m_delegate->setEmpresaBase(c); 00238 _depura("END SubForm2Bt::setcompany", 0); 00239 }
| void SubForm2Bt::on_mui_list_cellChanged | ( | int | row, | |
| int | col | |||
| ) | [virtual] |
| row | ||
| col |
Reimplemented from SubForm3.
Definition at line 113 of file subform2bt.cpp.
References _depura().
00113 { 00114 _depura("SubForm2Bt::on_mui_list_cellChanged", 0, QString::number(row) + " " + QString::number(col)); 00115 _depura("END SubForm2Bt::on_mui_list_editFinished", 0); 00116 }
| int SubForm2Bt::cerrarEditor | ( | ) | [virtual] |
Reimplemented from SubForm3.
Definition at line 246 of file subform2bt.cpp.
References _depura(), QSubForm2BtDelegate::cerrarEditor(), m_delegate, and Ui_SubForm3Base::mui_list.
00246 { 00247 _depura("SubForm2Bt::cerrarEditor", 0); 00248 QWidget *editor = mui_list->QAbstractItemView::indexWidget(mui_list->currentIndex()); 00249 m_delegate->cerrarEditor(editor); 00250 _depura("END SubForm2Bt::cerrarEditor", 0); 00251 return 0; 00252 }
| void SubForm2Bt::setIdCliente | ( | QString | id | ) |
| id |
En la primera carga no hay reajustes, pero si actualización del cliente.
En las cargas sucesivas si el idcliente no ha cambiado no se hace nada
Reseteamos los valores.
Si el idcliente no existe salimos.
Cuando se cambia el cliente se deben recalcular las lineas por si hay Recargo Equivalente
Definition at line 124 of file subform2bt.cpp.
References _depura(), postgresiface2::cargacursor(), PEmpresaBase::empresaBase(), cursor2::eof(), SubForm3::lineaat(), SubForm3::m_tablename, mdb_idcliente, SubForm3::rowCount(), DBRecord::setDBvalue(), and cursor2::valor().
00124 { 00125 _depura("SubForm2Bt::setIdCliente", 0, id); 00126 00128 if (mdb_idcliente == "" ) { 00129 mdb_idcliente = id; 00130 return; 00131 } // end if 00132 00134 if (mdb_idcliente == id) return; 00135 00137 for (int i = 0; i < rowCount() - 1; i++) { 00138 SDBRecord *rec = lineaat(i); 00139 rec->setDBvalue("iva" + m_tablename, "0"); 00140 rec->setDBvalue("reqeq" + m_tablename, "0"); 00141 } // end for 00142 00143 mdb_idcliente = id; 00144 00146 if (id == "") { 00147 _depura("END SubForm2Bt::setIdCliente", 0, "idcliente invalido"); 00148 return; 00149 } // end if 00150 00151 cursor2 *curcliente = empresaBase()->cargacursor("SELECT recargoeqcliente, regimenfiscalcliente FROM cliente WHERE idcliente = " + mdb_idcliente); 00152 00153 if (!curcliente->eof()) { 00155 for (int i = 0; i < rowCount() - 1; i++) { 00156 SDBRecord *rec = lineaat(i); 00157 cursor2 *cur = empresaBase()->cargacursor("SELECT * FROM articulo WHERE idarticulo = " + rec->DBvalue("idarticulo") ); 00158 cursor2 *cur1 = empresaBase()->cargacursor("SELECT * FROM tasa_iva WHERE idtipo_iva = " + cur->valor("idtipo_iva") + " ORDER BY fechatasa_iva LIMIT 1"); 00159 if (!cur->eof()) { 00160 00161 if (curcliente->valor("regimenfiscalcliente") == "Normal") { 00162 rec->setDBvalue("iva" + m_tablename, cur1->valor("porcentasa_iva")); 00163 } // end if 00164 00165 if (curcliente->valor("recargoeqcliente") == "t") { 00166 rec->setDBvalue("reqeq" + m_tablename, cur1->valor("porcentretasa_iva")); 00167 } // end if 00168 00169 } // end if 00170 delete cur1; 00171 delete cur; 00172 } // end for 00173 } // end if 00174 delete curcliente; 00175 _depura("END SubForm2Bt::setIdCliente", 0); 00176 }
| void SubForm2Bt::setIdProveedor | ( | QString | id | ) |
| id |
En la primera carga no hay reajustes, pero si actualización del proveedor.
En las cargas sucesivas si el idproveedor no ha cambiado no se hace nada
Reseteamos los valores
Cuando se cambia el cliente se deben recalcular las lineas por si hay Recargo Equivalente
Definition at line 184 of file subform2bt.cpp.
References _depura(), postgresiface2::cargacursor(), PEmpresaBase::empresaBase(), cursor2::eof(), SubForm3::lineaat(), SubForm3::m_tablename, mdb_idproveedor, SubForm3::rowCount(), DBRecord::setDBvalue(), and cursor2::valor().
00184 { 00185 _depura("SubForm2Bt::setIdProveedor", 0, id); 00186 00188 if (mdb_idproveedor == "" ) { 00189 mdb_idproveedor = id; 00190 return; 00191 } // end if 00192 00194 if (mdb_idproveedor == id) return; 00195 00196 mdb_idproveedor = id; 00197 00199 for (int i = 0; i < rowCount() - 1; i++) { 00200 SDBRecord *rec = lineaat(i); 00201 rec->setDBvalue("iva"+m_tablename, "0"); 00202 rec->setDBvalue("reqeq"+m_tablename, "0"); 00203 } // end for 00204 00205 cursor2 *curproveedor = empresaBase()->cargacursor("SELECT recargoeqproveedor, regimenfiscalproveedor FROM proveedor WHERE idproveedor="+mdb_idproveedor); 00206 if (!curproveedor->eof()) { 00208 for (int i = 0; i < rowCount() - 1; i++) { 00209 SDBRecord *rec = lineaat(i); 00210 cursor2 *cur = empresaBase()->cargacursor("SELECT * FROM articulo WHERE idarticulo = " + rec->DBvalue("idarticulo") ); 00211 cursor2 *cur1 = empresaBase()->cargacursor("SELECT * FROM tasa_iva WHERE idtipo_iva = " + cur->valor("idtipo_iva") + " ORDER BY fechatasa_iva LIMIT 1"); 00212 if (!cur->eof() ) { 00213 if (curproveedor->valor("regimenfiscalproveedor") == "Normal") { 00214 rec->setDBvalue("iva"+m_tablename, cur1->valor("porcentasa_iva")); 00215 } // end if 00216 if (curproveedor->valor("recargoeqproveedor") == "t") { 00217 rec->setDBvalue("reqeq"+m_tablename, cur1->valor("porcentretasa_iva")); 00218 } // end if 00219 00220 } // end if 00221 delete cur1; 00222 delete cur; 00223 } // end for 00224 } // end if 00225 delete curproveedor; 00226 _depura("END SubForm2Bt::setIdProveedor", 0); 00227 }
| void SubForm2Bt::on_mui_list_pressedSlash | ( | int | row, | |
| int | col | |||
| ) | [virtual, slot] |
| row | ||
| col |
Reimplemented from SubForm3.
Definition at line 87 of file subform2bt.cpp.
References _depura(), editaTexto(), SubForm3::item(), and SDBCampo::set().
00087 { 00088 _depura("SubForm2Bt::pressedSlash", 0); 00089 SDBCampo *camp = (SDBCampo *) item(row, col); 00090 QString text = editaTexto(camp->text()); 00091 camp->set(text); 00092 _depura("END SubForm2Bt::pressedSlash", 0); 00093 }
| void SubForm2Bt::on_mui_list_pressedAsterisk | ( | int | row, | |
| int | col | |||
| ) | [virtual, slot] |
| void SubForm2Bt::on_mui_list_pressedMinus | ( | int | row, | |
| int | col | |||
| ) | [virtual, slot] |
Definition at line 63 of file subform2bt.h.
Referenced by cerrarEditor(), setEmpresaBase(), SubForm2Bt(), and ~SubForm2Bt().
QString SubForm2Bt::mdb_idcliente [protected] |
QString SubForm2Bt::mdb_idproveedor [protected] |
1.5.1