|
|
@ -123,6 +123,12 @@ QByteArray ReceiptGenerator::generate()
|
|
|
|
out.append("\x0a");
|
|
|
|
out.append("\x0a");
|
|
|
|
out.append(prepareString("IC: " + QString::number(gs->ic())));
|
|
|
|
out.append(prepareString("IC: " + QString::number(gs->ic())));
|
|
|
|
out.append("\x0a");
|
|
|
|
out.append("\x0a");
|
|
|
|
|
|
|
|
out.append(prepareString("DIC: " + gs->dic()));
|
|
|
|
|
|
|
|
out.append("\x0a");
|
|
|
|
|
|
|
|
out.append(prepareString("ID provozovny: " + shopSettings->eetShopId()));
|
|
|
|
|
|
|
|
out.append("\x0a");
|
|
|
|
|
|
|
|
out.append(prepareString("ID pokladny: " + shopSettings->eetRegisterId()));
|
|
|
|
|
|
|
|
out.append("\x0a");
|
|
|
|
|
|
|
|
|
|
|
|
out.append("\x1b\x21");
|
|
|
|
out.append("\x1b\x21");
|
|
|
|
out.append(printMode);
|
|
|
|
out.append(printMode);
|
|
|
@ -135,12 +141,14 @@ QByteArray ReceiptGenerator::generate()
|
|
|
|
out.append("\x0a");
|
|
|
|
out.append("\x0a");
|
|
|
|
|
|
|
|
|
|
|
|
foreach (QSharedPointer<VoucherItem> item, m_voucher->items()) {
|
|
|
|
foreach (QSharedPointer<VoucherItem> item, m_voucher->items()) {
|
|
|
|
|
|
|
|
QString count = QString::number(item->count());
|
|
|
|
QString name = item->name();
|
|
|
|
QString name = item->name();
|
|
|
|
QString price = QString::number(item->price().toDouble(), 'f', 2);
|
|
|
|
QString price = QString::number(item->price().toDouble(), 'f', 2);
|
|
|
|
|
|
|
|
|
|
|
|
int numSpaces = 0;
|
|
|
|
int numSpaces = 0;
|
|
|
|
if ((name.length() + price.length()) < shopSettings->lettersPerLine())
|
|
|
|
if ((name.length() + price.length()) < shopSettings->lettersPerLine())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
name = count + "x " + name;
|
|
|
|
numSpaces = shopSettings->lettersPerLine() - (name.length() + price.length());
|
|
|
|
numSpaces = shopSettings->lettersPerLine() - (name.length() + price.length());
|
|
|
|
out.append(prepareString(name));
|
|
|
|
out.append(prepareString(name));
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -171,7 +179,7 @@ QByteArray ReceiptGenerator::generate()
|
|
|
|
|
|
|
|
|
|
|
|
out.append("\x1b\x21");
|
|
|
|
out.append("\x1b\x21");
|
|
|
|
out.append(printMode);
|
|
|
|
out.append(printMode);
|
|
|
|
out.append("Celekem:");
|
|
|
|
out.append("Celkem:");
|
|
|
|
|
|
|
|
|
|
|
|
QString totalPrice = QString::number(m_voucher->totalPrice().toDouble(), 'f', 2);
|
|
|
|
QString totalPrice = QString::number(m_voucher->totalPrice().toDouble(), 'f', 2);
|
|
|
|
int numSpaces = shopSettings->lettersPerLine() - (8 + totalPrice.length());
|
|
|
|
int numSpaces = shopSettings->lettersPerLine() - (8 + totalPrice.length());
|
|
|
@ -184,6 +192,8 @@ QByteArray ReceiptGenerator::generate()
|
|
|
|
out.append("\x1b\x21");
|
|
|
|
out.append("\x1b\x21");
|
|
|
|
out.append((char)0);
|
|
|
|
out.append((char)0);
|
|
|
|
out.append("\x0a");
|
|
|
|
out.append("\x0a");
|
|
|
|
|
|
|
|
if (!m_voucher->eetBkp().isEmpty())
|
|
|
|
|
|
|
|
{
|
|
|
|
out.append("BKP:");
|
|
|
|
out.append("BKP:");
|
|
|
|
out.append("\x0a");
|
|
|
|
out.append("\x0a");
|
|
|
|
out.append(prepareString(m_voucher->eetBkp()));
|
|
|
|
out.append(prepareString(m_voucher->eetBkp()));
|
|
|
@ -193,6 +203,9 @@ QByteArray ReceiptGenerator::generate()
|
|
|
|
out.append(prepareString(m_voucher->eetFik()));
|
|
|
|
out.append(prepareString(m_voucher->eetFik()));
|
|
|
|
out.append("\x0a");
|
|
|
|
out.append("\x0a");
|
|
|
|
out.append("\x0a");
|
|
|
|
out.append("\x0a");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
out.append("\x0a");
|
|
|
|
|
|
|
|
out.append("\x0a");
|
|
|
|
out.append("\x0a");
|
|
|
|
out.append("\x0a");
|
|
|
|
|
|
|
|
|
|
|
|
return out;
|
|
|
|
return out;
|
|
|
|