diff --git a/src/ATBAPP/ATBDeviceControllerPlugin.cpp b/src/ATBAPP/ATBDeviceControllerPlugin.cpp index a37f71a..071cb0f 100644 --- a/src/ATBAPP/ATBDeviceControllerPlugin.cpp +++ b/src/ATBAPP/ATBDeviceControllerPlugin.cpp @@ -6,6 +6,7 @@ #include "src/ATBAPP/support/DBusControllerInterface.h" #include "src/ATBAPP/support/PTUSystem.h" #include "src/ATBAPP/support/CashUtils.h" +#include "src/ATBAPP/support/TicketUtils.h" #include #include @@ -729,11 +730,12 @@ void ATBDeviceControllerPlugin::requestPrintTicket(const QHashprinterLocale.toString(parkingEndDateTime.date(), QLocale::ShortFormat); - QString currentDateString = this->printerLocale.toString(currentDateTime.date(), QLocale::ShortFormat); + QString parkingEndDateString = TicketUtils::getLocaleDateString(this->printerLocale, parkingEndDateTime.date()); + QString currentDateString = TicketUtils::getLocaleDateString(this->printerLocale, currentDateTime.date()); + /* ----------------------------------------------------------------------------------------- * note: the following highly depends on printer template files! @@ -1057,9 +1059,8 @@ void ATBDeviceControllerPlugin::private_setupDynTemplateData_START_RECEIPT(struc QDateTime parkingEndDateTime = QDateTime::fromString(ticket->getPrintingData()["parkingEnd"].toString(), Qt::ISODate); QDateTime currentDateTime = QDateTime::fromString(ticket->getPrintingData()["currentDateTime"].toString(), Qt::ISODate); - QString parkingEndDateString = this->printerLocale.toString(parkingEndDateTime.date(), QLocale::ShortFormat); - QString currentDateString = this->printerLocale.toString(currentDateTime.date(), QLocale::ShortFormat); - + 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()); @@ -1184,7 +1185,7 @@ void ATBDeviceControllerPlugin::private_setupDynTemplatData_FREE_TICKET(struct T QByteArray ba_parkingEndTime = codec->fromUnicode(parkingEndDateTime.toString("hh:mm")); memcpy((char*)dynTicketData->parkingEnd, ba_parkingEndTime.data(), std::min(ba_parkingEndTime.size(),8)); - QString parkingEndDateString = this->printerLocale.toString(parkingEndDateTime.date(), QLocale::ShortFormat); + QString parkingEndDateString = TicketUtils::getLocaleDateString(this->printerLocale, parkingEndDateTime.date()); QByteArray ba_parkingEndDate = codec->fromUnicode(parkingEndDateString); memcpy((char*)dynTicketData->currentTime, ba_parkingEndDate.data(), std::min(ba_parkingEndDate.size(),8));