#include <ticketqtoolbutton.h>
Inheritance diagram for TicketQToolButton:

Public Slots | |
| virtual void | click () |
Public Member Functions | |
| TicketQToolButton (PresupuestoView *, PedidoClienteView *, AlbaranClienteView *, FacturaView *, QWidget *parent=NULL) | |
| ~TicketQToolButton () | |
| void | setBoton () |
Private Attributes | |
| Company * | m_companyact |
| PresupuestoView * | m_presupuestoView |
| PedidoClienteView * | m_pedidoClienteView |
| AlbaranClienteView * | m_albaranClienteView |
| FacturaView * | m_facturaView |
Definition at line 40 of file ticketqtoolbutton.h.
| TicketQToolButton::TicketQToolButton | ( | PresupuestoView * | pres, | |
| PedidoClienteView * | ped, | |||
| AlbaranClienteView * | alb, | |||
| FacturaView * | fac, | |||
| QWidget * | parent = NULL | |||
| ) |
| pres | ||
| ped | ||
| alb | ||
| fac | ||
| parent |
Definition at line 55 of file ticketqtoolbutton.cpp.
References _depura(), m_albaranClienteView, m_facturaView, m_pedidoClienteView, m_presupuestoView, and setBoton().
00055 : QToolButton(parent) { 00056 _depura("TicketQToolButton::TicketQToolButton", 0); 00057 m_presupuestoView = pres; 00058 m_pedidoClienteView = ped; 00059 m_albaranClienteView = alb; 00060 m_facturaView = fac; 00061 setBoton(); 00062 _depura("END TicketQToolButton::TicketQToolButton", 0); 00063 }
| TicketQToolButton::~TicketQToolButton | ( | ) |
Definition at line 69 of file ticketqtoolbutton.cpp.
References _depura().
00069 { 00070 _depura("TicketQToolButton::~TicketQToolButton", 0); 00071 _depura("END TicketQToolButton::~TicketQToolButton", 0); 00072 }
| void TicketQToolButton::setBoton | ( | ) |
Definition at line 78 of file ticketqtoolbutton.cpp.
References _depura(), and click().
Referenced by TicketQToolButton().
00078 { 00079 _depura("TicketQToolButton::setBoton", 0); 00080 connect(this, SIGNAL(clicked()), this, SLOT(click())); 00081 setObjectName(QString::fromUtf8("exporta")); 00082 setStatusTip("Imprimir Ticket"); 00083 setToolTip("Imprimir Ticket"); 00084 setMinimumSize(QSize(32, 32)); 00085 setIcon(QIcon(QString::fromUtf8("/usr/share/bulmages/icons/ticket.png"))); 00086 setIconSize(QSize(22, 22)); 00087 _depura("END TicketQToolButton::setBoton", 0); 00088 }
| void TicketQToolButton::click | ( | ) | [virtual, slot] |
Definition at line 94 of file ticketqtoolbutton.cpp.
References _depura(), BusquedaCliente::cifcliente(), CONF_TICKET_PRINTER_FILE, confpr, DBRecord::DBvalue(), FichaBf::empresaBase(), FichaBf::getlistalineas(), SubForm3::lineaat(), m_albaranClienteView, m_companyact, m_facturaView, Ui_AlbaranClienteBase::m_totalalbaran, Ui_FacturaBase::m_totalBases, Ui_AlbaranClienteBase::m_totalBases, Ui_FacturaBase::m_totalfactura, Ui_FacturaBase::m_totalTaxes, Ui_AlbaranClienteBase::m_totalTaxes, Ui_FacturaBase::mui_idcliente, Ui_AlbaranClienteBase::mui_idcliente, Ui_AlbaranClienteBase::mui_idtrabajador, BusquedaCliente::nomcliente(), SubForm3::rowCount(), TRUE, and configuracion::valor().
Referenced by setBoton().
00094 { 00095 _depura("ImpQToolButton::click", 0); 00096 00097 00098 00099 if (m_albaranClienteView != NULL) { 00100 00101 m_companyact = m_albaranClienteView->empresaBase(); 00102 00103 00104 QFile file( "/dev/usblp0" ); 00105 if ( !file.open(QIODevice::WriteOnly | QIODevice::Unbuffered)) { 00106 _depura("Error en la Impresion de ticket", 2); 00107 } // end if 00108 00109 00110 file.write (QString("Conetxia Soluciones Informaticas S.L\n").toAscii()); 00111 file.write (QString("====================================\n").toAscii()); 00112 file.write(QString("Joaquin Turina, 1 Local 4\n").toAscii()); 00113 file.write(QString("CP: 07004 Palma de Mallorca\n").toAscii()); 00114 file.write(QString("Tel: 971 29 06 29\n").toAscii()); 00116 file.write ( "\n \n", 3); 00118 file.write( QString("Fecha: ").toAscii()); 00119 QDate fecha = QDate::currentDate(); 00120 QString sfecha = fecha.toString("d-M-yyyy"); 00121 file.write( sfecha.toAscii()); 00122 file.write ( "\n", 1); 00123 00124 file.write( QString("Trabajador: ").toAscii()); 00125 file.write( m_albaranClienteView->mui_idtrabajador->currentText().toAscii()); 00126 file.write ( "\n", 1); 00127 00128 file.write( QString("Cliente: ").toAscii()); 00129 file.write( m_albaranClienteView->mui_idcliente->cifcliente().toAscii()); 00130 file.write ( " ", 1); 00131 file.write( m_albaranClienteView->mui_idcliente->nomcliente().toAscii()); 00132 file.write ( "\n", 1); 00133 00134 00135 00136 file.write( QString("Descripcion: ").toAscii()); 00137 file.write( m_albaranClienteView->DBvalue("descalbaran").toAscii()); 00138 file.write ( "\n", 1); 00139 00141 file.write ( "\n \n", 3); 00142 00143 QString l; 00144 SDBRecord *linea; 00145 for (int i = 0; i < m_albaranClienteView->getlistalineas()->rowCount(); ++i) { 00146 linea = m_albaranClienteView->getlistalineas()->lineaat(i); 00147 if (linea->DBvalue( "idarticulo") != "") { 00148 QString str = linea->DBvalue("cantlalbaran").rightJustified(5,' ')+QString(" ")+linea->DBvalue("desclalbaran").leftJustified(23,' ', TRUE)+linea->DBvalue("pvplalbaran").rightJustified(10, ' '); 00149 file.write(str.toAscii()); 00150 file.write ( "\n", 1); 00151 } // end if 00152 } // end for 00153 00155 file.write ( "\n \n", 3); 00156 00158 QString stotalbases = QString("Base Imp").rightJustified(30,' '); 00159 stotalbases = stotalbases + m_albaranClienteView->m_totalBases->text().rightJustified(10,' '); 00160 file.write(stotalbases.toAscii()); 00161 file.write ( "\n", 1); 00162 00164 QString stotaltases = QString("I.V.A.").rightJustified(30,' '); 00165 stotaltases = stotaltases + m_albaranClienteView->m_totalTaxes->text().rightJustified(10,' '); 00166 file.write(stotaltases.toAscii()); 00167 file.write ( "\n", 1); 00168 00170 file.write (QString("____________________\n").rightJustified(42,' ').toAscii()); 00171 00172 QString stotal = QString("TOTAL").rightJustified(30,' '); 00173 stotal = stotal + m_albaranClienteView->m_totalalbaran->text().rightJustified(10,' '); 00174 file.write(stotal.toAscii()); 00175 file.write ( "\n", 1); 00176 00177 00179 file.write ( "\n \n \n \n", 7); 00180 00183 file.write ("\x1Dh\x40",3); 00185 file.write ( "\x1DH\x02",3); 00187 file.write ( "\x1D",1); 00188 file.write ( "f\x01",2); 00189 ; 00191 file.write ( "\x1D\x77\x01",3); 00193 file.write ( "\x1Dk\x04",3); 00194 file.write (QString("ALB").toAscii()); 00195 file.write (" ", 1); 00196 file.write (m_albaranClienteView->DBvalue("idalbaran").toAscii()); 00197 file.write (" ", 1); 00198 file.write (m_albaranClienteView->DBvalue("numalbaran").toAscii()); 00199 file.write (" ", 1); 00200 file.write (m_albaranClienteView->DBvalue("refalbaran").toAscii()); 00201 file.write ("\x00", 1); 00202 00204 /* 00205 file.write ("\x1B\x2A\x00\xD2\x00", 5); 00206 for (int i=0; i <15; i++) { 00207 file.write ( "\x01\x02\x04\x08\x10\x20\x40\x80", 8); 00208 file.write ("\x40\x20\x10\x08\x04\x02", 6); 00209 } 00210 */ 00212 file.write ( "\n \n \n \n \n", 9); 00213 00214 00216 file.write ("\x1D\x56\x01", 3); 00217 file.close(); 00218 } // end if 00219 00220 if (m_facturaView != NULL) { 00221 m_companyact = m_facturaView->empresaBase(); 00222 00223 //========================== 00224 00225 QFile file( confpr->valor(CONF_TICKET_PRINTER_FILE) ); 00226 if ( !file.open(QIODevice::WriteOnly | QIODevice::Unbuffered)) { 00227 _depura("Error en la Impresion de ticket", 2); 00228 } // end if 00229 00230 00231 file.write (QString("Conetxia Soluciones Informaticas S.L\n").toAscii()); 00232 file.write (QString("====================================\n").toAscii()); 00233 file.write(QString("Joaquin Turina, 1 Local 4\n").toAscii()); 00234 file.write(QString("CP: 07004 Palma de Mallorca\n").toAscii()); 00235 file.write(QString("Tel: 971 29 06 29\n").toAscii()); 00237 file.write ( "\n \n", 3); 00239 file.write( QString("Fecha: ").toAscii()); 00240 QDate fecha = QDate::currentDate(); 00241 QString sfecha = fecha.toString("d-M-yyyy"); 00242 file.write( sfecha.toAscii()); 00243 file.write ( "\n", 1); 00244 00245 file.write( QString("Cliente: ").toAscii()); 00246 file.write( m_facturaView->mui_idcliente->cifcliente().toAscii()); 00247 file.write ( " ", 1); 00248 file.write( m_facturaView->mui_idcliente->nomcliente().toAscii()); 00249 file.write ( "\n", 1); 00250 00251 00252 00253 file.write( QString("Descripcion: ").toAscii()); 00254 file.write( m_facturaView->DBvalue("descfactura").toAscii()); 00255 file.write ( "\n", 1); 00256 00258 file.write ( "\n \n", 3); 00259 00260 QString l; 00261 SDBRecord *linea; 00262 for (int i = 0; i < m_facturaView->getlistalineas()->rowCount(); ++i) { 00263 linea = m_facturaView->getlistalineas()->lineaat(i); 00264 if (linea->DBvalue( "idarticulo") != "") { 00265 QString str = linea->DBvalue("cantlfactura").rightJustified(5,' ')+QString(" ")+linea->DBvalue("desclfactura").leftJustified(23,' ', TRUE)+linea->DBvalue("pvplfactura").rightJustified(10, ' '); 00266 file.write(str.toAscii()); 00267 file.write ( "\n", 1); 00268 } // end if 00269 } // end for 00270 00272 file.write ( "\n \n", 3); 00273 00275 QString stotalbases = QString("Base Imp").rightJustified(30,' '); 00276 stotalbases = stotalbases + m_facturaView->m_totalBases->text().rightJustified(10,' '); 00277 file.write(stotalbases.toAscii()); 00278 file.write ( "\n", 1); 00279 00281 QString stotaltases = QString("I.V.A.").rightJustified(30,' '); 00282 stotaltases = stotaltases + m_facturaView->m_totalTaxes->text().rightJustified(10,' '); 00283 file.write(stotaltases.toAscii()); 00284 file.write ( "\n", 1); 00285 00287 file.write (QString("____________________\n").rightJustified(42,' ').toAscii()); 00288 00289 QString stotal = QString("TOTAL").rightJustified(30,' '); 00290 stotal = stotal + m_facturaView->m_totalfactura->text().rightJustified(10,' '); 00291 file.write(stotal.toAscii()); 00292 file.write ( "\n", 1); 00293 00294 00296 file.write ( "\n \n \n \n", 7); 00297 00300 file.write ("\x1Dh\x40",3); 00302 file.write ( "\x1DH\x02",3); 00304 file.write ( "\x1D",1); 00305 file.write ( "f\x01",2); 00306 ; 00308 file.write ( "\x1D\x77\x01",3); 00310 file.write ( "\x1Dk\x04",3); 00311 file.write (QString("FAC").toAscii()); 00312 file.write (" ", 1); 00313 file.write (m_facturaView->DBvalue("idfactura").toAscii()); 00314 file.write (" ", 1); 00315 file.write (m_facturaView->DBvalue("numfactura").toAscii()); 00316 file.write (" ", 1); 00317 file.write (m_facturaView->DBvalue("reffactura").toAscii()); 00318 file.write ("\x00", 1); 00319 00321 /* 00322 file.write ("\x1B\x2A\x00\xD2\x00", 5); 00323 for (int i=0; i <15; i++) { 00324 file.write ( "\x01\x02\x04\x08\x10\x20\x40\x80", 8); 00325 file.write ("\x40\x20\x10\x08\x04\x02", 6); 00326 } 00327 */ 00329 file.write ( "\n \n \n \n \n", 9); 00330 00331 00333 file.write ("\x1D\x56\x01", 3); 00334 file.close(); 00335 } // end if 00336 00337 _depura("END ImpQToolButton::click", 0); 00338 }
Company* TicketQToolButton::m_companyact [private] |
FacturaView* TicketQToolButton::m_facturaView [private] |
1.5.1