mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-20 14:50:32 +00:00
fix: active checkbox in manual journal.
This commit is contained in:
@@ -30,7 +30,7 @@ import {
|
|||||||
} from './ItemForm.schema';
|
} from './ItemForm.schema';
|
||||||
|
|
||||||
const defaultInitialValues = {
|
const defaultInitialValues = {
|
||||||
active: true,
|
active: 1,
|
||||||
name: '',
|
name: '',
|
||||||
type: 'service',
|
type: 'service',
|
||||||
code: '',
|
code: '',
|
||||||
|
|||||||
@@ -64,6 +64,7 @@ export const transformItemFormData = (item, defaultValue) => {
|
|||||||
...item,
|
...item,
|
||||||
sellable: !!defaultTo(item?.sellable, defaultValue.sellable),
|
sellable: !!defaultTo(item?.sellable, defaultValue.sellable),
|
||||||
purchasable: !!defaultTo(item?.purchasable, defaultValue.purchasable),
|
purchasable: !!defaultTo(item?.purchasable, defaultValue.purchasable),
|
||||||
|
active: !!defaultTo(item?.active, defaultValue.active),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import classNames from 'classnames';
|
|||||||
import { FastField } from 'formik';
|
import { FastField } from 'formik';
|
||||||
import { CLASSES } from 'common/classes';
|
import { CLASSES } from 'common/classes';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Item form floating actions.
|
* Item form floating actions.
|
||||||
*/
|
*/
|
||||||
@@ -56,13 +55,13 @@ export default function ItemFormFloatingActions({
|
|||||||
|
|
||||||
{/*----------- Active ----------*/}
|
{/*----------- Active ----------*/}
|
||||||
<FastField name={'active'} type={'checkbox'}>
|
<FastField name={'active'} type={'checkbox'}>
|
||||||
{({ form, field, field: { value } }) => (
|
{({ field }) => (
|
||||||
<FormGroup inline={true} className={'form-group--active'}>
|
<FormGroup inline={true} className={'form-group--active'}>
|
||||||
<Checkbox
|
<Checkbox
|
||||||
inline={true}
|
inline={true}
|
||||||
label={<T id={'active'} />}
|
label={<T id={'active'} />}
|
||||||
checked={value}
|
name={'active'}
|
||||||
onChange={() => form.setFieldValue('active', !value)}
|
{...field}
|
||||||
/>
|
/>
|
||||||
</FormGroup>
|
</FormGroup>
|
||||||
)}
|
)}
|
||||||
|
|||||||
Reference in New Issue
Block a user