From 596cf3ed25970e668bb9ebf38e97a559f3f9e7c8 Mon Sep 17 00:00:00 2001 From: Siegfried Siegert Date: Fri, 9 Jun 2023 11:19:39 +0200 Subject: [PATCH] TicketPrint: select ticket to print dependent on printingData. --- src/ATBAPP/ATBDeviceControllerPlugin.cpp | 32 ++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/src/ATBAPP/ATBDeviceControllerPlugin.cpp b/src/ATBAPP/ATBDeviceControllerPlugin.cpp index 4219002..986a038 100644 --- a/src/ATBAPP/ATBDeviceControllerPlugin.cpp +++ b/src/ATBAPP/ATBDeviceControllerPlugin.cpp @@ -174,6 +174,38 @@ void ATBDeviceControllerPlugin::requestPrintTicket(const QHashcurrentSelectedTicketType = 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())); }