Changer: skip polling, if amount due to change is 0

This commit is contained in:
Siegfried Siegert 2024-01-25 14:26:19 +01:00
parent bdb0f9911b
commit b058b6aee0
Signed by: SiegfriedSiegert
GPG Key ID: 68371E015E8F0B03

View File

@ -1105,10 +1105,24 @@ void ATBDeviceControllerPlugin::onCashChangerState()
amountCoinsChangedInt = amountInt - this->cashStartAmountInt;
}
else {
amountCoinsChangedInt = 0;
amountCoinsChangedInt = 0;
}
QString amountCoinsChangedString = QString::number(amountCoinsChangedInt);
// if we do not need to give change:
if (amountCoinsChangedInt == 0) {
emit this->cashPaymentFinished(nsDeviceControllerInterface::RESULT_STATE::SUCCESS,
amountString,
amountCoinsString, // coins
amountNotesString, // notes
amountCoinsChangedString, // change
"",
"");
changerStateRequestCounter = 0;
lastChangerResult = 0;
return;
}
// get changer state ------------------------------------------------
// Note: 'returnedAmount'-parameter is missleading here!