#include <impqtoolbutton.h>
Inheritance diagram for ImpQToolButton:

Public Slots | |
| virtual void | click () |
Public Member Functions | |
| ImpQToolButton (PresupuestoList *pres=NULL, PedidosClienteList *ped=NULL, AlbaranClienteList *alb=NULL, FacturasList *fac=NULL, CobrosList *cob=NULL, QWidget *parent=NULL) | |
| ~ImpQToolButton () | |
| void | setBoton () |
Private Attributes | |
| Company * | m_companyact |
| PresupuestoList * | m_presupuestoList |
| PedidosClienteList * | m_pedidosClienteList |
| AlbaranClienteList * | m_albaranClienteList |
| FacturasList * | m_facturasList |
| CobrosList * | m_cobrosList |
Definition at line 37 of file impqtoolbutton.h.
| ImpQToolButton::ImpQToolButton | ( | PresupuestoList * | pres = NULL, |
|
| PedidosClienteList * | ped = NULL, |
|||
| AlbaranClienteList * | alb = NULL, |
|||
| FacturasList * | fac = NULL, |
|||
| CobrosList * | cob = NULL, |
|||
| QWidget * | parent = NULL | |||
| ) |
| pres | ||
| ped | ||
| alb | ||
| fac | ||
| cob | ||
| parent | ||
Definition at line 60 of file impqtoolbutton.cpp.
References _depura(), m_albaranClienteList, m_cobrosList, m_facturasList, m_pedidosClienteList, m_presupuestoList, and setBoton().
00060 : QToolButton(parent) { 00061 _depura("ImpQToolButton::ImpQToolButton", 0); 00062 m_presupuestoList = pres; 00063 m_pedidosClienteList = ped; 00064 m_albaranClienteList = alb; 00065 m_facturasList = fac; 00066 m_cobrosList = cob; 00067 00068 setBoton(); 00069 _depura("END ImpQToolButton::ImpQToolButton", 0); 00070 }
| ImpQToolButton::~ImpQToolButton | ( | ) |
Definition at line 76 of file impqtoolbutton.cpp.
References _depura().
00076 { 00077 _depura("ImpQToolButton::~ImpQToolButton", 0); 00078 _depura("END ImpQToolButton::~ImpQToolButton", 0); 00079 }
| void ImpQToolButton::setBoton | ( | ) |
Definition at line 85 of file impqtoolbutton.cpp.
References _depura(), and click().
Referenced by ImpQToolButton().
00085 { 00086 _depura("ImpQToolButton::setBoton", 0); 00087 connect(this, SIGNAL(clicked()), this, SLOT(click())); 00088 setObjectName(QString::fromUtf8("exporta")); 00089 setStatusTip("Imprimir elementos seleccionados"); 00090 setToolTip("Imprimir elementos seleccionados"); 00091 setMinimumSize(QSize(32, 32)); 00092 setIcon(QIcon(QString::fromUtf8(":/Genericos32x32/images/png/i_print1.png"))); 00093 setIconSize(QSize(22, 22)); 00094 _depura("END ImpQToolButton::setBoton", 0); 00095 }
| void ImpQToolButton::click | ( | void | ) | [virtual, slot] |
Reseteamos los valores
Reseteamos los valores
Reseteamos los valores
Reseteamos los valores
TRATAMOS LOS COBROS CUYO LISTADO ES ESPECIAL.
Copiamos el archivo.
Copiamos el logo
Reseteamos los valores
En la version para windows hay problemas con las imagenes, por eso de momento lo dejamos asi.
Si ha quedado memoria reservada la liberamos.
Definition at line 102 of file impqtoolbutton.cpp.
References _depura(), postgresiface2::cargacursor(), Ficha::cargar(), CONF_DIR_OPENREPORTS, CONF_DIR_USER, confpr, DBRecord::DBvalue(), PEmpresaBase::empresaBase(), cursor2::eof(), generaPDF(), FichaBf::generaRML(), invocaPDF(), SubForm3::lineaat(), m_albaranClienteList, m_cobrosList, m_companyact, m_facturasList, m_pedidosClienteList, m_presupuestoList, mensajeInfo(), Ui_CobrosListBase::mui_list, Ui_AlbaranClienteListBase::mui_list, Ui_PedidosClienteListBase::mui_list, Ui_FacturasListBase::mui_list, Ui_PresupuestosListBase::mui_list, Company::newAlbaranClienteView(), Company::newFacturaView(), Company::newPedidoClienteView(), Company::nuevoPresupuestoView(), num2texto(), SDBRecord::refresh(), SubForm3::rowCount(), cursor2::valor(), and configuracion::valor().
Referenced by setBoton().
00102 { 00103 _depura("ImpQToolButton::click", 0); 00104 00105 cursor2 *cur1 = NULL; 00106 cursor2 *cur = NULL; 00107 00108 try { 00109 00110 QString res = ""; 00111 00112 if (m_presupuestoList != NULL) { 00113 m_companyact = (Company *)m_presupuestoList->empresaBase(); 00114 SubForm3 *sub = m_presupuestoList->mui_list; 00115 00117 for (int i = 0; i < sub->rowCount(); i++) { 00118 SDBRecord *rec = sub->lineaat(i); 00119 rec->refresh(); 00120 QString val = rec->DBvalue("selector"); 00121 if (val == "TRUE") { 00122 QString id = rec->DBvalue("idpresupuesto"); 00123 00124 PresupuestoView *pres = m_companyact->nuevoPresupuestoView(); 00125 pres->cargar(id); 00126 00127 pres->generaRML(); 00128 pres->close(); 00129 00130 generaPDF("presupuesto"); 00131 00132 QString cad = "mv "+confpr->valor(CONF_DIR_USER)+"presupuesto.pdf "+confpr->valor(CONF_DIR_USER)+"presupuesto"+id+".pdf"; 00133 system(cad.toAscii().data()); 00134 res += confpr->valor(CONF_DIR_USER)+"presupuesto"+id+".pdf "; 00135 } // end if 00136 } // end for 00137 } 00138 00139 if (m_facturasList != NULL) { 00140 m_companyact = (Company *)m_facturasList->empresaBase(); 00141 SubForm3 *sub = m_facturasList->mui_list; 00142 00144 for (int i = 0; i < sub->rowCount(); i++) { 00145 SDBRecord *rec = sub->lineaat(i); 00146 rec->refresh(); 00147 QString val = rec->DBvalue("selector"); 00148 if (val == "TRUE") { 00149 QString id = rec->DBvalue("idfactura"); 00150 00151 FacturaView *pres = m_companyact->newFacturaView(); 00152 pres->cargar(id); 00153 00154 pres->generaRML(); 00155 pres->close(); 00156 00157 generaPDF("factura"); 00158 00159 QString cad = "mv "+confpr->valor(CONF_DIR_USER)+"factura.pdf "+confpr->valor(CONF_DIR_USER)+"factura"+id+".pdf"; 00160 system(cad.toAscii().data()); 00161 res += confpr->valor(CONF_DIR_USER)+"factura"+id+".pdf "; 00162 } // end if 00163 } // end for 00164 } // end if 00165 00166 if (m_pedidosClienteList != NULL) { 00167 m_companyact = (Company *)m_pedidosClienteList->empresaBase(); 00168 SubForm3 *sub = m_pedidosClienteList->mui_list; 00169 00171 for (int i = 0; i < sub->rowCount(); i++) { 00172 SDBRecord *rec = sub->lineaat(i); 00173 rec->refresh(); 00174 QString val = rec->DBvalue("selector"); 00175 if (val == "TRUE") { 00176 QString id = rec->DBvalue("idpedidocliente"); 00177 00178 PedidoClienteView *pres = m_companyact->newPedidoClienteView(); 00179 pres->cargar(id); 00180 00181 pres->generaRML(); 00182 pres->close(); 00183 00184 generaPDF("pedidocliente"); 00185 00186 QString cad = "mv "+confpr->valor(CONF_DIR_USER)+"pedidocliente.pdf "+confpr->valor(CONF_DIR_USER)+"pedidocliente"+id+".pdf"; 00187 system(cad.toAscii().data()); 00188 res += confpr->valor(CONF_DIR_USER)+"pedidocliente"+id+".pdf "; 00189 } // end if 00190 } // end for 00191 } // end if 00192 00193 00194 if (m_albaranClienteList != NULL) { 00195 m_companyact = (Company *)m_albaranClienteList->empresaBase(); 00196 SubForm3 *sub = m_albaranClienteList->mui_list; 00197 00199 for (int i = 0; i < sub->rowCount(); i++) { 00200 SDBRecord *rec = sub->lineaat(i); 00201 rec->refresh(); 00202 QString val = rec->DBvalue("selector"); 00203 if (val == "TRUE") { 00204 QString id = rec->DBvalue("idalbaran"); 00205 00206 AlbaranClienteView *pres = m_companyact->newAlbaranClienteView(); 00207 pres->cargar(id); 00208 00209 pres->generaRML(); 00210 pres->close(); 00211 00212 generaPDF("albaran"); 00213 00214 QString cad = "mv "+confpr->valor(CONF_DIR_USER)+"albaran.pdf "+confpr->valor(CONF_DIR_USER)+"albaran"+id+".pdf"; 00215 system(cad.toAscii().data()); 00216 res += confpr->valor(CONF_DIR_USER)+"albaran"+id+".pdf "; 00217 } // end if 00218 } // end for 00219 } // end if 00220 00222 if (m_cobrosList != NULL) { 00223 00224 m_companyact = (Company *)m_cobrosList->empresaBase(); 00225 SubForm3 *sub = m_cobrosList->mui_list; 00226 QString txt = ""; 00227 00228 00229 QString archivo = confpr->valor(CONF_DIR_OPENREPORTS) +"recibos.rml"; 00230 QString archivod = confpr->valor(CONF_DIR_USER) + "recibos.rml"; 00231 QString archivologo = confpr->valor(CONF_DIR_OPENREPORTS) + "logo.jpg"; 00232 00233 00235 #ifdef WINDOWS 00236 00237 archivo = "copy " + archivo + " " + archivod; 00238 #else 00239 00240 archivo = "cp " + archivo + " " + archivod; 00241 #endif 00242 00243 system (archivo.toAscii().constData()); 00245 #ifdef WINDOWS 00246 00247 archivologo = "copy " + archivologo + " " + confpr->valor(CONF_DIR_USER) + "logo.jpg"; 00248 #else 00249 00250 archivologo = "cp " + archivologo + " " + confpr->valor(CONF_DIR_USER) + "logo.jpg"; 00251 #endif 00252 00253 system(archivologo.toAscii().constData()); 00254 QFile file; 00255 file.setFileName(archivod); 00256 file.open(QIODevice::ReadOnly); 00257 QTextStream stream(&file); 00258 QString buff = stream.readAll(); 00259 file.close(); 00260 00261 00262 00264 int j = 0; 00265 for (int i = 0; i < sub->rowCount(); i++) { 00266 SDBRecord *rec = sub->lineaat(i); 00267 rec->refresh(); 00268 QString val = rec->DBvalue("selector"); 00269 if (val == "TRUE") { 00270 QString id = rec->DBvalue("idcobro"); 00271 00272 CobroView *pres = new CobroView(m_companyact, 0); 00273 pres->cargar(id); 00274 00275 int col1 = j % 3; 00276 double col = 0; 00277 if (col1 == 2) col = 1.00; 00278 if (col1 == 1) col = 10; 00279 if (col1 == 0) col = 19.5; 00280 00281 txt += " <storyPlace x=\"0cm\" y=\"0cm\" width=\"15cm\" height=\"1cm\">\n"; 00282 txt += " <setFont name=\"Courier\" size=\"8\"/>\n"; 00283 txt += " <drawString x=\"4.7cm\" y=\""+ QString::number(col+7.6) +"cm\">"+pres->DBvalue("idcobro")+"</drawString>\n"; 00284 txt += " <drawString x=\"7.2cm\" y=\""+ QString::number(col+7.6) +"cm\">PALMA DE MALLORCA</drawString>\n"; 00285 txt += " <drawString x=\"14.2cm\" y=\""+ QString::number(col+7.6) +"cm\">EUROS "+pres->DBvalue("cantcobro")+"</drawString>\n"; 00286 00287 txt += " <drawString x=\"5.7cm\" y=\""+ QString::number(col+6.8) +"cm\">"+pres->DBvalue("fechacobro")+"</drawString>\n"; 00288 txt += " <drawString x=\"12.4cm\" y=\""+ QString::number(col+6.8) +"cm\">"+pres->DBvalue("fechavenccobro")+"</drawString>\n"; 00289 00290 if (pres->DBvalue("idbanco") != "") { 00291 QString query = "SELECT * FROM banco WHERE idbanco ="+pres->DBvalue("idbanco"); 00292 cur1 = m_companyact->cargacursor(query); 00293 if (!cur1->eof()){ 00294 txt += " <drawString x=\"9.4cm\" y=\""+ QString::number(col+4.4) +"cm\">"+cur1->valor("nombanco")+"</drawString>\n"; 00295 txt += " <drawString x=\"9.4cm\" y=\""+ QString::number(col+4) +"cm\">"+cur1->valor("pobbanco")+"</drawString>\n"; 00296 txt += " <drawString x=\"12.4cm\" y=\""+ QString::number(col+3.5) +"cm\">"+cur1->valor("codentidadbanco")+" "+cur1->valor("codagenciabanco")+" "+cur1->valor("dcbanco")+" "+cur1->valor("numcuentabanco")+"</drawString>\n"; 00297 } // end if 00298 delete cur1; 00299 } // end if 00300 00301 00302 if (pres->DBvalue("idcliente") != "") { 00303 QString query = "SELECT * FROM cliente WHERE idcliente ="+pres->DBvalue("idcliente"); 00304 cur = m_companyact->cargacursor(query); 00305 if (!cur->eof()){ 00306 txt += " <drawString x=\"4.8cm\" y=\""+ QString::number(col+2.3) +"cm\">"+cur->valor("nomcliente")+"</drawString>\n"; 00307 // txt += " <drawString x=\"4.8cm\" y=\""+ QString::number(col+1.9) +"cm\">"+cur->valor("nomaltcliente")+"</drawString>\n"; 00308 txt += " <drawString x=\"4.8cm\" y=\""+ QString::number(col+1.5) +"cm\">"+cur->valor("dircliente")+"</drawString>\n"; 00309 txt += " <drawString x=\"4.8cm\" y=\""+ QString::number(col+1.1) +"cm\">"+cur->valor("cpcliente")+" "+cur->valor("provcliente")+"</drawString>\n"; 00310 } // end if 00311 delete cur; 00312 } // end if 00313 00314 txt += " <drawString x=\"4.8cm\" y=\""+ QString::number(col+5.6) +"cm\">a</drawString>\n"; 00315 txt += " <drawString x=\"4.8cm\" y=\""+ QString::number(col+5.2) +"cm\">"+num2texto(pres->DBvalue("cantcobro"))+"</drawString>\n"; 00316 00317 txt += " </storyPlace>\n"; 00318 00319 if (col1 == 2) 00320 txt += "<nextPage/><nextFrame/>\n"; 00321 j++; 00322 delete pres; 00323 00324 } // end if 00325 00326 } // end for 00327 00328 00329 buff.replace("[story]", txt); 00330 00331 res = confpr->valor(CONF_DIR_USER)+"recibos.pdf "; 00332 00333 00336 #ifndef WINDOWS 00337 // buff.replace("[detallearticulos]", detalleArticulos()); 00338 #endif 00339 00340 if (file.open(QIODevice::WriteOnly)) { 00341 QTextStream stream(&file); 00342 stream << buff; 00343 file.close(); 00344 } // end if 00345 00346 00347 invocaPDF("recibos"); 00348 00349 return; 00350 } // end if 00351 00352 00353 00354 00355 00356 QString comando = "kprinter "+res; 00357 system(comando.toAscii().data()); 00358 comando = "rm "+res; 00359 system(comando.toAscii().data()); 00360 _depura("END ImpQToolButton::click", 0); 00361 00362 } catch(...) { 00363 mensajeInfo("Error en los calculos"); 00365 if (cur1) delete cur1; 00366 if (cur) delete cur; 00367 } // end try 00368 }
Company* ImpQToolButton::m_companyact [private] |
PresupuestoList* ImpQToolButton::m_presupuestoList [private] |
FacturasList* ImpQToolButton::m_facturasList [private] |
CobrosList* ImpQToolButton::m_cobrosList [private] |
1.5.1