fix: batch creation and UI details

This commit is contained in:
José Oliveira 2021-05-13 14:38:48 +01:00 committed by Josh Harvey
parent c83b3cda56
commit 3281df1a91
4 changed files with 20 additions and 14 deletions

View file

@ -10,7 +10,7 @@ const namespaces = {
COIN_ATM_RADAR: 'coinAtmRadar',
TERMS_CONDITIONS: 'termsConditions',
CASH_OUT: 'cashOut',
CASH_IN: 'cashInt',
CASH_IN: 'cashIn',
COMPLIANCE: 'compliance'
}

View file

@ -2,22 +2,20 @@ const express = require('express')
const router = express.Router()
const cashbox = require('../cashbox-batches')
const machine = require('../machine-loader')
const { getMachine, setMachine } = require('../machine-loader')
const { loadLatestConfig } = require('../new-settings-loader')
const { getCashInSettings } = require('../new-config-manager')
function notifyCashboxRemoval (req, res, next) {
console.log('We got a notification for the cashbox removal!!')
return machine.getMachine(req.deviceId)
return getMachine(req.deviceId)
.then(machine => {
loadLatestConfig()
.then(async config => {
console.log('entered the config')
const cashInSettings = getCashInSettings(config)
console.log(cashInSettings)
if (cashInSettings.cashboxReset === 'Automatic') {
console.log('We proceed with the cashbox reset!!')
await cashbox.createCashboxBatch(req.deviceId, machine.cashbox)
await machine.setMachine({ deviceId: req.deviceId, action: 'emptyCashInBills' })
await setMachine({ deviceId: req.deviceId, action: 'emptyCashInBills' })
return res.status(200).send({ status: 'OK' })
}
})

View file

@ -13,7 +13,7 @@ import { CashOut, CashIn } from 'src/components/inputs/cashbox/Cashbox'
import { NumberInput, CashCassetteInput } from 'src/components/inputs/formik'
import TitleSection from 'src/components/layout/TitleSection'
import { EmptyTable } from 'src/components/table'
import { P } from 'src/components/typography'
import { P, Label1 } from 'src/components/typography'
import { ReactComponent as EditIcon } from 'src/styling/icons/action/edit/enabled.svg'
import { ReactComponent as ReverseHistoryIcon } from 'src/styling/icons/circle buttons/history/white.svg'
import { ReactComponent as HistoryIcon } from 'src/styling/icons/circle buttons/history/zodiac.svg'
@ -254,14 +254,14 @@ const CashCassettes = () => {
}}
iconClassName={classes.listViewButton}
className={classes.tableWidth}>
<P className={classes.descriptions}>Cashbox reset</P>
<Box display="flex" alignItems="center">
<Box alignItems="center" justifyContent="end">
<Label1 className={classes.cashboxReset}>Cashbox reset</Label1>
<Box
display="flex"
alignItems="center"
justifyContent="end"
mr="-5px">
<P>{cashboxReset}</P>
mr="-4px">
<P className={classes.selection}>{cashboxReset}</P>
<IconButton
onClick={() => setEditingSchema(true)}
className={classes.button}>
@ -331,7 +331,7 @@ const CashCassettes = () => {
/>
<P className={classes.descriptions}>
Choose this option if you want your cash-in cashbox count to be
automatically when it is physically removed from the machine.
reset automatically when it is physically removed from the machine.
</P>
<RadioGroup
name="set-manual-reset"

View file

@ -19,6 +19,14 @@ export default {
marginRight: 90
},
descriptions: {
color: offColor
color: offColor,
marginTop: '0px'
},
cashboxReset: {
color: offColor,
margin: '13px 0px -5px 20px'
},
selection: {
marginRight: '12px'
}
}