TicketPrint: select ticket to print

dependent on printingData.
This commit is contained in:
Siegfried Siegert 2023-06-09 11:19:39 +02:00
parent c330be4f30
commit 596cf3ed25
Signed by: SiegfriedSiegert
GPG Key ID: 68371E015E8F0B03

View File

@ -174,6 +174,38 @@ void ATBDeviceControllerPlugin::requestPrintTicket(const QHash<QString, QVariant
return;
}
// set ticket type:
// 00281 - Szeged:
// 1 - Cash / ShortTimeParking
// 2 - Card / ShortTimeParking
// 3 - Cash / DayTicket
// 4 - Card / DayTicket
QString paymentType = printingData["paymentType"].toString(); // must be "CASH" | "CARD"
QString productName = printingData["product"].toString(); // must be "ShortTimeParking" | "DayTicket"
if ( (paymentType == "CASH") && (productName == "ShortTimeParking") ) {
this->currentSelectedTicketType = 1;
}
else
if ( (paymentType == "CARD") && (productName == "ShortTimeParking") ) {
this->currentSelectedTicketType = 2;
}
else
if ( (paymentType == "CASH") && (productName == "DayTicket") ) {
this->currentSelectedTicketType = 3;
}
else
if ( (paymentType == "CARD") && (productName == "DayTicket") ) {
this->currentSelectedTicketType = 4;
}
else {
qCritical() << "ERROR: requestPrintTicket(): invalid payment data:";
qCritical() << " paymentType = " << paymentType << endl
<< " productName = " << productName << endl;
this->onPrintFinishedERR();
return;
}
QTimer::singleShot(1000, this, SLOT(onPrinterDataPrepared()));
}