fix: cashin notifications
This commit is contained in:
parent
e3dc1ef4fd
commit
978f33b498
1 changed files with 8 additions and 6 deletions
|
|
@ -20,6 +20,8 @@ const useStyles = makeStyles(styles)
|
||||||
const CASH_IN_KEY = 'fiatBalanceAlertsCashIn'
|
const CASH_IN_KEY = 'fiatBalanceAlertsCashIn'
|
||||||
const CASH_OUT_KEY = 'fiatBalanceAlertsCashOut'
|
const CASH_OUT_KEY = 'fiatBalanceAlertsCashOut'
|
||||||
const DEFAULT_NUMBER_OF_CASSETTES = 2
|
const DEFAULT_NUMBER_OF_CASSETTES = 2
|
||||||
|
const notesMin = 0
|
||||||
|
const notesMax = 9999999
|
||||||
|
|
||||||
const FiatBalance = ({ section, min = 0, max = 100, fieldWidth = 80 }) => {
|
const FiatBalance = ({ section, min = 0, max = 100, fieldWidth = 80 }) => {
|
||||||
const {
|
const {
|
||||||
|
|
@ -38,11 +40,11 @@ const FiatBalance = ({ section, min = 0, max = 100, fieldWidth = 80 }) => {
|
||||||
)
|
)
|
||||||
|
|
||||||
const schema = Yup.object().shape({
|
const schema = Yup.object().shape({
|
||||||
fillingPercentageCashbox: Yup.number()
|
cashInAlertThreshold: Yup.number()
|
||||||
.transform(transformNumber)
|
.transform(transformNumber)
|
||||||
.integer()
|
.integer()
|
||||||
.min(min)
|
.min(notesMin)
|
||||||
.max(max)
|
.max(notesMax)
|
||||||
.nullable(),
|
.nullable(),
|
||||||
fillingPercentageCassette1: Yup.number()
|
fillingPercentageCassette1: Yup.number()
|
||||||
.transform(transformNumber)
|
.transform(transformNumber)
|
||||||
|
|
@ -76,7 +78,7 @@ const FiatBalance = ({ section, min = 0, max = 100, fieldWidth = 80 }) => {
|
||||||
validateOnChange={false}
|
validateOnChange={false}
|
||||||
enableReinitialize
|
enableReinitialize
|
||||||
initialValues={{
|
initialValues={{
|
||||||
fillingPercentageCashbox: data?.fillingPercentageCashbox ?? '',
|
cashInAlertThreshold: data?.cashInAlertThreshold ?? '',
|
||||||
fillingPercentageCassette1: data?.fillingPercentageCassette1 ?? '',
|
fillingPercentageCassette1: data?.fillingPercentageCassette1 ?? '',
|
||||||
fillingPercentageCassette2: data?.fillingPercentageCassette2 ?? '',
|
fillingPercentageCassette2: data?.fillingPercentageCassette2 ?? '',
|
||||||
fillingPercentageCassette3: data?.fillingPercentageCassette3 ?? '',
|
fillingPercentageCassette3: data?.fillingPercentageCassette3 ?? '',
|
||||||
|
|
@ -104,10 +106,10 @@ const FiatBalance = ({ section, min = 0, max = 100, fieldWidth = 80 }) => {
|
||||||
<div className={classes.col2}>
|
<div className={classes.col2}>
|
||||||
<EditableNumber
|
<EditableNumber
|
||||||
label="Alert me over"
|
label="Alert me over"
|
||||||
name="fillingPercentageCashbox"
|
name="cashInAlertThreshold"
|
||||||
editing={isEditing(CASH_IN_KEY)}
|
editing={isEditing(CASH_IN_KEY)}
|
||||||
displayValue={x => (x === '' ? '-' : x)}
|
displayValue={x => (x === '' ? '-' : x)}
|
||||||
decoration="%"
|
decoration="notes"
|
||||||
width={fieldWidth}
|
width={fieldWidth}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue