prepareDynTemplateData: setup for all TICKET_VARIANTs
This commit is contained in:
parent
cbc0dd0ad6
commit
fbfbe3d243
@ -1164,10 +1164,13 @@ void ATBDeviceControllerPlugin::prepareDynTemplateData()
|
||||
private_setupDynTemplatData_FINE_PAYMENT(dynTicketData, this->currentTicket);
|
||||
break;
|
||||
case nsDeviceControllerInterface::TICKET_VARIANT::RECEIPT:
|
||||
private_setupDynTemplateData_DEFAULT(dynTicketData, this->currentTicket);
|
||||
break;
|
||||
case nsDeviceControllerInterface::TICKET_VARIANT::ERROR_RECEIPT:
|
||||
private_setupDynTemplateData_DEFAULT(dynTicketData, this->currentTicket);
|
||||
break;
|
||||
case nsDeviceControllerInterface::TICKET_VARIANT::PARKING_TICKET:
|
||||
private_setupDynTemplateData_DEFAULT(dynTicketData, this->currentTicket);
|
||||
break;
|
||||
case nsDeviceControllerInterface::TICKET_VARIANT::FREE_TICKET:
|
||||
private_setupDynTemplatData_FREE_TICKET(dynTicketData, this->currentTicket);
|
||||
@ -1175,6 +1178,9 @@ void ATBDeviceControllerPlugin::prepareDynTemplateData()
|
||||
case nsDeviceControllerInterface::TICKET_VARIANT::FOOD_STAMP:
|
||||
private_setupDynTemplatData_FOOD_STAMP(dynTicketData, this->currentTicket);
|
||||
break;
|
||||
default:
|
||||
private_setupDynTemplateData_DEFAULT(dynTicketData, this->currentTicket);
|
||||
break;
|
||||
}
|
||||
|
||||
// C-Programmierung: wird hier nur 'licensePlate' gedruckt?
|
||||
@ -1330,6 +1336,41 @@ void ATBDeviceControllerPlugin::private_setupDynTemplatData_FREE_TICKET(struct T
|
||||
// ! and yes... 'ParkingEndDate' is 'currentTime'
|
||||
}
|
||||
|
||||
void ATBDeviceControllerPlugin::private_setupDynTemplateData_DEFAULT(struct T_dynDat *dynTicketData, Ticket *ticket)
|
||||
{
|
||||
QDateTime parkingEndDateTime = QDateTime::fromString(ticket->getPrintingData()["parkingEnd"].toString(), Qt::ISODate);
|
||||
QDateTime currentDateTime = QDateTime::fromString(ticket->getPrintingData()["currentDateTime"].toString(), Qt::ISODate);
|
||||
|
||||
QString parkingEndDateString = TicketUtils::getLocaleDateString(this->printerLocale, parkingEndDateTime.date());
|
||||
QString currentDateString = TicketUtils::getLocaleDateString(this->printerLocale, currentDateTime.date());
|
||||
|
||||
|
||||
// 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_parkingEndTime = codec->fromUnicode(parkingEndDateTime.toString("hh:mm"));
|
||||
memcpy((char*)dynTicketData->parkingEnd, ba_parkingEndTime.data(), std::min(ba_parkingEndTime.size(),8));
|
||||
|
||||
QByteArray ba_parkingEndDate = codec->fromUnicode(parkingEndDateString);
|
||||
memcpy((char*)dynTicketData->currentTime, ba_parkingEndDate.data(), std::min(ba_parkingEndDate.size(),8));
|
||||
// ! and yes... 'ParkingEndDate' is 'currentTime'
|
||||
|
||||
QByteArray ba_currentDate = codec->fromUnicode(currentDateString);
|
||||
memcpy((char*)dynTicketData->currentDate, ba_currentDate.data(), std::min(ba_currentDate.size(),8));
|
||||
|
||||
// Product-Text
|
||||
QByteArray ba_productText = codec->fromUnicode(ticket->getPrintingData()["productText"].toString());
|
||||
memcpy((char*)dynTicketData->dynDat5, ba_productText.data(), std::min(ba_productText.size(),8));
|
||||
|
||||
// Ticket-Number
|
||||
QByteArray ba_ticketNumber = codec->fromUnicode(ticket->getPrintingData()["ticketNumber"].toString());
|
||||
memcpy((char*)dynTicketData->dynDat7, ba_ticketNumber.data(), std::min(ba_ticketNumber.size(),8));
|
||||
}
|
||||
|
||||
/************************************************************************************************
|
||||
* cash payment
|
||||
|
@ -145,6 +145,7 @@ private:
|
||||
void initTicketTemplateList(const QSettings * settings);
|
||||
void prepareDynTemplateData();
|
||||
|
||||
void private_setupDynTemplateData_DEFAULT(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_FOOD_STAMP(struct T_dynDat *dynTicketData, Ticket *ticket);
|
||||
|
Loading…
x
Reference in New Issue
Block a user