feat: checkbox show negative in red.

This commit is contained in:
elforjani3
2021-01-14 15:21:09 +02:00
parent dbf8cae5e5
commit b24a5e31e8
4 changed files with 17 additions and 2 deletions

View File

@@ -115,6 +115,19 @@ export default function NumberFormatFields({
</FormGroup>
)}
</FastField>
{/*------------ show negative in red-----------*/}
<FastField name={'show_in_red'} type={'checkbox'}>
{({ field }) => (
<FormGroup inline={true}>
<Checkbox
inline={true}
label={<T id={'show_negative_in_red'} />}
name={'show_in_red'}
{...field}
/>
</FormGroup>
)}
</FastField>
{/*------------ Divide on 1000 -----------*/}
<FastField name={'divide_on_1000'} type={'checkbox'}>
{({ field }) => (

View File

@@ -6,6 +6,7 @@ import { defaultTo } from 'lodash';
const Schema = Yup.object().shape({
format_money: Yup.string(),
show_zero: Yup.boolean(),
show_in_red: Yup.boolean(),
divide_on_1000: Yup.boolean(),
negative_format: Yup.string(),
precision: Yup.string(),

View File

@@ -14,6 +14,7 @@ function NumberFormats() {
() => ({
format_money: '',
show_zero: '',
show_in_red: '',
divide_on_1000: '',
negative_format: '',
precision: '',
@@ -21,8 +22,7 @@ function NumberFormats() {
[],
);
// Handle cancel button click.
const handleCancelClick = useCallback(() => {
}, []);
const handleCancelClick = useCallback(() => {}, []);
// Handle form submit.
const handleFormSubmit = (values, { setSubmitting }) => {