Proposal for usage of TICKET_VARIANT::FINE_PAYMENT
This commit is contained in:
parent
c076090e03
commit
32d70abf44
@ -983,6 +983,9 @@ void ATBDeviceControllerPlugin::prepareDynTemplateData()
|
||||
case nsDeviceControllerInterface::TICKET_VARIANT::STOP_RECEIPT:
|
||||
private_setupDynTemplatData_STOP_RECEIPT(dynTicketData, this->currentTicket);
|
||||
break;
|
||||
case nsDeviceControllerInterface::TICKET_VARIANT::FINE_PAYMENT:
|
||||
private_setupDynTemplatData_FINE_PAYMENT(dynTicketData, this->currentTicket);
|
||||
break;
|
||||
case nsDeviceControllerInterface::TICKET_VARIANT::RECEIPT:
|
||||
break;
|
||||
case nsDeviceControllerInterface::TICKET_VARIANT::ERROR_RECEIPT:
|
||||
@ -1091,6 +1094,27 @@ void ATBDeviceControllerPlugin::private_setupDynTemplatData_FOOD_STAMP(struct T_
|
||||
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));
|
||||
}
|
||||
|
||||
|
||||
/************************************************************************************************
|
||||
|
@ -144,6 +144,7 @@ private:
|
||||
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_FOOD_STAMP(struct T_dynDat *dynTicketData, Ticket *ticket);
|
||||
void private_setupDynTemplatData_FINE_PAYMENT(struct T_dynDat *dynTicketData, Ticket *ticket);
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
private slots:
|
||||
|
@ -64,6 +64,9 @@ bool Ticket::initNew(TICKET_VARIANT ticketVariant, const QList<quint8> & templat
|
||||
case TICKET_VARIANT::STOP_RECEIPT:
|
||||
this->_templateList << 24 << 25 << 26;
|
||||
break;
|
||||
case TICKET_VARIANT::FINE_PAYMENT:
|
||||
this->_templateList << 24 << 25 << 26;
|
||||
break;
|
||||
case TICKET_VARIANT::FOOD_STAMP:
|
||||
if (printingData.contains("dyn1_list")) {
|
||||
this->_hasTemplateDynData = true;
|
||||
@ -160,6 +163,9 @@ QDebug operator<<(QDebug debug, TICKET_VARIANT ticketVariant)
|
||||
case TICKET_VARIANT::STOP_RECEIPT:
|
||||
debug << "TICKET_VARIANT::STOP_RECEIPT";
|
||||
break;
|
||||
case TICKET_VARIANT::FINE_PAYMENT:
|
||||
debug << "TICKET_VARIANT::FINE_PAYMENT";
|
||||
break;
|
||||
case TICKET_VARIANT::FOOD_STAMP:
|
||||
debug << "TICKET_VARIANT::FOOD_STAMP";
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user