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