fix: virtual cassette and denomination min value
This commit is contained in:
parent
521363a296
commit
0d3eb2e392
2 changed files with 3 additions and 15 deletions
|
|
@ -126,18 +126,6 @@ function plugins (settings, deviceId) {
|
|||
]
|
||||
}
|
||||
|
||||
function getLcmOrBigx2 (n1, n2) {
|
||||
let big = Math.max(n1, n2);
|
||||
let small = Math.min(n1, n2);
|
||||
|
||||
let i = big * 2;
|
||||
while(i % small !== 0){
|
||||
i += lar;
|
||||
}
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
function buildAvailableCassettes (excludeTxId) {
|
||||
const cashOutConfig = configManager.getCashOut(deviceId, settings.config)
|
||||
|
||||
|
|
@ -145,7 +133,7 @@ function plugins (settings, deviceId) {
|
|||
|
||||
const denominations = [cashOutConfig.top, cashOutConfig.bottom]
|
||||
|
||||
const virtualCassettes = [getLcmOrBigx2(cashOutConfig.top, cashOutConfig.bottom)]
|
||||
const virtualCassettes = [Math.max(cashOutConfig.top, cashOutConfig.bottom) * 2]
|
||||
|
||||
return Promise.all([dbm.cassetteCounts(deviceId), cashOutHelper.redeemableTxs(deviceId, excludeTxId)])
|
||||
.then(([rec, _redeemableTxs]) => {
|
||||
|
|
|
|||
|
|
@ -7,12 +7,12 @@ const DenominationsSchema = Yup.object().shape({
|
|||
top: Yup.number()
|
||||
.label('Cassette 1 (Top)')
|
||||
.required()
|
||||
.min(0)
|
||||
.min(1)
|
||||
.max(currencyMax),
|
||||
bottom: Yup.number()
|
||||
.label('Cassette 2 (Bottom)')
|
||||
.required()
|
||||
.min(0)
|
||||
.min(1)
|
||||
.max(currencyMax),
|
||||
zeroConfLimit: Yup.number()
|
||||
.label('0-conf Limit')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue