Proposal for usage of TICKET_VARIANT::FINE_PAYMENT

This commit is contained in:
Siegfried Siegert 2024-06-27 11:48:16 +02:00
parent c076090e03
commit 32d70abf44
Signed by: SiegfriedSiegert
GPG Key ID: 68371E015E8F0B03
3 changed files with 31 additions and 0 deletions

View File

@ -983,6 +983,9 @@ void ATBDeviceControllerPlugin::prepareDynTemplateData()
case nsDeviceControllerInterface::TICKET_VARIANT::STOP_RECEIPT: case nsDeviceControllerInterface::TICKET_VARIANT::STOP_RECEIPT:
private_setupDynTemplatData_STOP_RECEIPT(dynTicketData, this->currentTicket); private_setupDynTemplatData_STOP_RECEIPT(dynTicketData, this->currentTicket);
break; break;
case nsDeviceControllerInterface::TICKET_VARIANT::FINE_PAYMENT:
private_setupDynTemplatData_FINE_PAYMENT(dynTicketData, this->currentTicket);
break;
case nsDeviceControllerInterface::TICKET_VARIANT::RECEIPT: case nsDeviceControllerInterface::TICKET_VARIANT::RECEIPT:
break; break;
case nsDeviceControllerInterface::TICKET_VARIANT::ERROR_RECEIPT: case nsDeviceControllerInterface::TICKET_VARIANT::ERROR_RECEIPT:
@ -1091,6 +1094,27 @@ void ATBDeviceControllerPlugin::private_setupDynTemplatData_FOOD_STAMP(struct T_
qCritical() << "-------------------------------------------------------"; qCritical() << "-------------------------------------------------------";
} }
void ATBDeviceControllerPlugin::private_setupDynTemplatData_FINE_PAYMENT(struct T_dynDat *dynTicketData, Ticket *ticket)
{
QDateTime currentDateTime = QDateTime::fromString(ticket->getPrintingData()["currentDateTime"].toString(), Qt::ISODate);
QString currentDateString = this->printerLocale.toString(currentDateTime.date(), QLocale::ShortFormat);
// set dynamic printer data:
QByteArray ba_licenseplate = codec->fromUnicode(ticket->getPrintingData()["licenseplate"].toString());
memcpy((char*)dynTicketData->licensePlate, ba_licenseplate.data(), std::min(ba_licenseplate.size(),8));
QByteArray ba_amount = codec->fromUnicode(ticket->getPrintingData()["amount"].toString());
memcpy((char*)dynTicketData->vendingPrice, ba_amount.data(), std::min(ba_amount.size(),8)); // Szeged
memcpy((char*)dynTicketData->dynDat6, ba_amount.data(), std::min(ba_amount.size(),8)); // Schoenau
QByteArray ba_currentDate = codec->fromUnicode(currentDateString);
memcpy((char*)dynTicketData->currentDate, ba_currentDate.data(), std::min(ba_currentDate.size(),8));
QByteArray ba_ticketId = codec->fromUnicode(ticket->getPrintingData()["ticketId"].toString());
memcpy((char*)dynTicketData->dynDat7, ba_amount.data(), std::min(ba_ticketId.size(),8));
}
/************************************************************************************************ /************************************************************************************************

View File

@ -144,6 +144,7 @@ private:
void private_setupDynTemplateData_START_RECEIPT(struct T_dynDat *dynTicketData, Ticket *ticket); void private_setupDynTemplateData_START_RECEIPT(struct T_dynDat *dynTicketData, Ticket *ticket);
void private_setupDynTemplatData_STOP_RECEIPT(struct T_dynDat *dynTicketData, Ticket *ticket); void private_setupDynTemplatData_STOP_RECEIPT(struct T_dynDat *dynTicketData, Ticket *ticket);
void private_setupDynTemplatData_FOOD_STAMP(struct T_dynDat *dynTicketData, Ticket *ticket); void private_setupDynTemplatData_FOOD_STAMP(struct T_dynDat *dynTicketData, Ticket *ticket);
void private_setupDynTemplatData_FINE_PAYMENT(struct T_dynDat *dynTicketData, Ticket *ticket);
// --------------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------------
private slots: private slots:

View File

@ -64,6 +64,9 @@ bool Ticket::initNew(TICKET_VARIANT ticketVariant, const QList<quint8> & templat
case TICKET_VARIANT::STOP_RECEIPT: case TICKET_VARIANT::STOP_RECEIPT:
this->_templateList << 24 << 25 << 26; this->_templateList << 24 << 25 << 26;
break; break;
case TICKET_VARIANT::FINE_PAYMENT:
this->_templateList << 24 << 25 << 26;
break;
case TICKET_VARIANT::FOOD_STAMP: case TICKET_VARIANT::FOOD_STAMP:
if (printingData.contains("dyn1_list")) { if (printingData.contains("dyn1_list")) {
this->_hasTemplateDynData = true; this->_hasTemplateDynData = true;
@ -160,6 +163,9 @@ QDebug operator<<(QDebug debug, TICKET_VARIANT ticketVariant)
case TICKET_VARIANT::STOP_RECEIPT: case TICKET_VARIANT::STOP_RECEIPT:
debug << "TICKET_VARIANT::STOP_RECEIPT"; debug << "TICKET_VARIANT::STOP_RECEIPT";
break; break;
case TICKET_VARIANT::FINE_PAYMENT:
debug << "TICKET_VARIANT::FINE_PAYMENT";
break;
case TICKET_VARIANT::FOOD_STAMP: case TICKET_VARIANT::FOOD_STAMP:
debug << "TICKET_VARIANT::FOOD_STAMP"; debug << "TICKET_VARIANT::FOOD_STAMP";
break; break;