Account: check account number and read again ...

if wrong account is provided by DC.
This commit is contained in:
Siegfried Siegert 2025-07-10 13:30:19 +02:00
parent a87a4e6c14
commit 232deb9245
Signed by: SiegfriedSiegert
GPG Key ID: 68371E015E8F0B03
2 changed files with 14 additions and 3 deletions

View File

@ -27,6 +27,7 @@ ATBDeviceControllerPlugin::ATBDeviceControllerPlugin(QObject *parent)
: isMaster(false)
, pluginState(PLUGIN_STATE::NOT_INITIALIZED)
, eventReceiver(nullptr)
, latestAccountNumber(0)
{
this->setParent(parent);
@ -477,13 +478,13 @@ void ATBDeviceControllerPlugin::private_startAccount()
qsort( backupedAccNumbers, nrOfVals, sizeof (uint16_t), Utils::compare );
uint16_t latestAccountNumber = backupedAccNumbers[nrOfVals-1];
this->latestAccountNumber = backupedAccNumbers[nrOfVals-1];
// DEBUG
qCritical() << " latestAccountNumber = " << latestAccountNumber;
qCritical() << " latestAccountNumber = " << this->latestAccountNumber;
hw->log_selectVaultRecord(latestAccountNumber);
hw->log_selectVaultRecord(this->latestAccountNumber);
this->accountCheckCounter = 0;
QTimer::singleShot(500, this, SLOT(private_checkAccountData()));
@ -527,6 +528,14 @@ void ATBDeviceControllerPlugin::private_getAccountData()
QHash<QString, QVariant> accountData;
if (this->latestAccountNumber != retVR.AccountingNumber) {
// this is the wrong account! -> read again
hw->log_selectVaultRecord(this->latestAccountNumber);
QTimer::singleShot(500, this, SLOT(private_checkAccountData()));
return;
}
accountData.insert("AccountingNumber", QString::number(retVR.AccountingNumber));

View File

@ -130,6 +130,8 @@ private:
// counts failed hw->log_chkIfVaultRecordAvailable()
int accountCheckCounter;
uint16_t latestAccountNumber;
// counts faild hw->prn-getPrintResult()
int printResultCheckCounter;