cashInputFinished: return coins/notes/change

This commit is contained in:
Siegfried Siegert 2023-11-30 18:18:43 +01:00
parent 96db7be126
commit d2a0491bba
Signed by: SiegfriedSiegert
GPG Key ID: 68371E015E8F0B03

View File

@ -986,18 +986,32 @@ void ATBDeviceControllerPlugin::onCashPayStopedSuccess()
// DEBUG
qCritical() << "ATBDeviceControllerPlugin::onCashPayStopedSuccess()";
// inserted amount
uint32_t amountInt = this->hw->getInsertedAmount();
QString amountString = QString::number(amountInt);
// inserted coins
uint32_t amountCoinsInt = CashUtils::getAmountOfInsertedCoins(this->hw);
QString amountCoinsString = QString::number(amountCoinsInt);
// inserted notes
uint32_t amountNotesInt = CashUtils::getAmountOfInsertedNotes(this->hw);
QString amountNotesString = QString::number(amountNotesInt);
// amount due to change
uint32_t amountDueToChangeInt = this->cashStartAmountInt - amountInt;
QString amountDueToChangeString = QString::number(amountDueToChangeInt);
// DEBUG
qCritical() << " insertedAmount (int) = " << amountInt;
qCritical() << " insertedAmount = " << amountString;
emit this->cashInputFinished(nsDeviceControllerInterface::RESULT_STATE::SUCCESS,
amountString,
"", // coins
"", // notes
"", // change
amountCoinsString, // coins
amountNotesString, // notes
amountDueToChangeString, // proposed change
"",
"");
}