+
+ {notes}
+
+
+
{notes * denomination} {currency.code}
diff --git a/new-lamassu-admin/src/components/inputs/cashbox/Cashbox.styles.js b/new-lamassu-admin/src/components/inputs/cashbox/Cashbox.styles.js
index 2dff1eb2..909ce311 100644
--- a/new-lamassu-admin/src/components/inputs/cashbox/Cashbox.styles.js
+++ b/new-lamassu-admin/src/components/inputs/cashbox/Cashbox.styles.js
@@ -44,16 +44,15 @@ const cashboxStyles = {
const gridStyles = {
row: {
- height: 36,
- width: 183,
- display: 'grid',
- gridTemplateColumns: 'repeat(2,1fr)',
- gridTemplateRows: '1fr',
- gridColumnGap: 18,
- gridRowGap: 0
+ display: 'flex',
+ justifyContent: 'flex-end'
+ },
+ innerRow: {
+ display: 'flex',
+ justifyContent: 'flex-start'
},
col2: {
- width: 117
+ marginLeft: 16
},
noMarginText: {
marginTop: 0,
@@ -61,6 +60,9 @@ const gridStyles = {
},
link: {
marginTop: spacer
+ },
+ chip: {
+ margin: [[0, 0, 0, 7]]
}
}
diff --git a/new-lamassu-admin/src/pages/Maintenance/Cashboxes.js b/new-lamassu-admin/src/pages/Maintenance/Cashboxes.js
index e8843f95..474715d5 100644
--- a/new-lamassu-admin/src/pages/Maintenance/Cashboxes.js
+++ b/new-lamassu-admin/src/pages/Maintenance/Cashboxes.js
@@ -1,22 +1,31 @@
import { useQuery, useMutation } from '@apollo/react-hooks'
+import { makeStyles } from '@material-ui/core'
import gql from 'graphql-tag'
import React from 'react'
import * as Yup from 'yup'
import { Table as EditableTable } from 'src/components/editableTable'
+import { CashOut } from 'src/components/inputs/cashbox/Cashbox'
import { NumberInput } from 'src/components/inputs/formik'
import TitleSection from 'src/components/layout/TitleSection'
+import { fromNamespace } from 'src/utils/config'
+
+import styles from './Cashboxes.styles.js'
+
+const useStyles = makeStyles(styles)
const ValidationSchema = Yup.object().shape({
name: Yup.string().required('Required'),
cassette1: Yup.number()
.required('Required')
.integer()
- .min(0),
+ .min(0)
+ .max(500),
cassette2: Yup.number()
.required('Required')
.integer()
.min(0)
+ .max(500)
})
const GET_MACHINES_AND_CONFIG = gql`
@@ -52,6 +61,8 @@ const RESET_CASHOUT_BILLS = gql`
`
const Cashboxes = () => {
+ const classes = useStyles()
+
const { data } = useQuery(GET_MACHINES_AND_CONFIG)
const [resetCashOut] = useMutation(RESET_CASHOUT_BILLS, {
@@ -62,6 +73,10 @@ const Cashboxes = () => {
}
})
+ const cashout = data?.config && fromNamespace('cashOut')(data.config)
+ const locale = data?.config && fromNamespace('locale')(data.config)
+ const fiatCurrency = locale?.fiatCurrency
+
const onSave = (...[, { id, cassette1, cassette2 }]) => {
return resetCashOut({
variables: {
@@ -73,6 +88,8 @@ const Cashboxes = () => {
})
}
+ const getDenomination = id => fromNamespace(id)(cashout)
+
const elements = [
{
name: 'name',
@@ -86,6 +103,14 @@ const Cashboxes = () => {
header: 'Cash-out 1',
width: 265,
textAlign: 'right',
+ view: (value, { id }) => (
+
+ ),
input: NumberInput,
inputProps: {
decimalPlaces: 0
@@ -96,6 +121,14 @@ const Cashboxes = () => {
header: 'Cash-out 2',
width: 265,
textAlign: 'right',
+ view: (value, { id }) => (
+
+ ),
input: NumberInput,
inputProps: {
decimalPlaces: 0
diff --git a/new-lamassu-admin/src/pages/Maintenance/Cashboxes.styles.js b/new-lamassu-admin/src/pages/Maintenance/Cashboxes.styles.js
new file mode 100644
index 00000000..8b574172
--- /dev/null
+++ b/new-lamassu-admin/src/pages/Maintenance/Cashboxes.styles.js
@@ -0,0 +1,6 @@
+export default {
+ cashbox: {
+ width: 80,
+ height: 36
+ }
+}