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) {
|
function buildAvailableCassettes (excludeTxId) {
|
||||||
const cashOutConfig = configManager.getCashOut(deviceId, settings.config)
|
const cashOutConfig = configManager.getCashOut(deviceId, settings.config)
|
||||||
|
|
||||||
|
|
@ -145,7 +133,7 @@ function plugins (settings, deviceId) {
|
||||||
|
|
||||||
const denominations = [cashOutConfig.top, cashOutConfig.bottom]
|
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)])
|
return Promise.all([dbm.cassetteCounts(deviceId), cashOutHelper.redeemableTxs(deviceId, excludeTxId)])
|
||||||
.then(([rec, _redeemableTxs]) => {
|
.then(([rec, _redeemableTxs]) => {
|
||||||
|
|
|
||||||
|
|
@ -7,12 +7,12 @@ const DenominationsSchema = Yup.object().shape({
|
||||||
top: Yup.number()
|
top: Yup.number()
|
||||||
.label('Cassette 1 (Top)')
|
.label('Cassette 1 (Top)')
|
||||||
.required()
|
.required()
|
||||||
.min(0)
|
.min(1)
|
||||||
.max(currencyMax),
|
.max(currencyMax),
|
||||||
bottom: Yup.number()
|
bottom: Yup.number()
|
||||||
.label('Cassette 2 (Bottom)')
|
.label('Cassette 2 (Bottom)')
|
||||||
.required()
|
.required()
|
||||||
.min(0)
|
.min(1)
|
||||||
.max(currencyMax),
|
.max(currencyMax),
|
||||||
zeroConfLimit: Yup.number()
|
zeroConfLimit: Yup.number()
|
||||||
.label('0-conf Limit')
|
.label('0-conf Limit')
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue