TicketPrint: select ticket to print
dependent on printingData.
This commit is contained in:
parent
c330be4f30
commit
596cf3ed25
@ -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()));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user