Logo Search packages:      
Sourcecode: lemonpos version File versions  Download package

void lemonView::printBalance ( QStringList  lines  )  [private, slot]

Slot used to print balance for the user.

Definition at line 1880 of file lemonview.cpp.

Referenced by corteDeCaja().

{
  if (Settings::printTicket()) {
    QString printerFile=Settings::printerDevice();
    if (printerFile.length() == 0) printerFile="/dev/lp0";
    QString printerCodec=Settings::printerCodec();
    QFile file(printerFile);
    if (file.open(QIODevice::ReadWrite)) {
      qDebug()<<"Printing balance...";
      QTextStream out(&file);
      if (printerCodec.length() != 0) out.setCodec(QTextCodec::codecForName(printerCodec.toLatin1()));
      else out.setCodec(QTextCodec::codecForName("UTF-8"));
      out << "\x1b\x4b\x30";              // Feed back x30 dot lines
      out << "\x1b\x4b\x20";              // Feed back x20 dot lines
      out << lines.join("\n");    // Print data
      out << "\x1b\x64\x06";              // Feed 6 lines
      file.close();
    } else qDebug()<<"ERROR: Could not open printer...";
  }
}


Generated by  Doxygen 1.6.0   Back to index