mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-23 00:00:31 +00:00
fix: checkbox cell.
This commit is contained in:
@@ -11,7 +11,7 @@ const CheckboxEditableCell = ({
|
|||||||
const [value, setValue] = React.useState(initialValue);
|
const [value, setValue] = React.useState(initialValue);
|
||||||
|
|
||||||
const onChange = (e) => {
|
const onChange = (e) => {
|
||||||
setValue(e.target.value);
|
setValue(e.target.checked);
|
||||||
};
|
};
|
||||||
const onBlur = () => {
|
const onBlur = () => {
|
||||||
payload.updateData(index, id, value);
|
payload.updateData(index, id, value);
|
||||||
@@ -24,12 +24,13 @@ const CheckboxEditableCell = ({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<FormGroup
|
<FormGroup
|
||||||
// intent={error ? Intent.DANGER : null}
|
intent={error ? Intent.DANGER : null}
|
||||||
className={classNames(Classes.FILL)}
|
className={classNames(Classes.FILL)}
|
||||||
>
|
>
|
||||||
<Checkbox
|
<Checkbox
|
||||||
value={value}
|
value={value}
|
||||||
onChange={onChange}
|
onChange={onChange}
|
||||||
|
checked={initialValue}
|
||||||
onBlur={onBlur}
|
onBlur={onBlur}
|
||||||
minimal={true}
|
minimal={true}
|
||||||
className="ml2"
|
className="ml2"
|
||||||
|
|||||||
@@ -79,10 +79,7 @@ function ExpenseForm({
|
|||||||
}
|
}
|
||||||
const categories = values.categories.filter(
|
const categories = values.categories.filter(
|
||||||
(category) =>
|
(category) =>
|
||||||
category.amount &&
|
category.amount && category.index && category.expense_account_id,
|
||||||
category.index &&
|
|
||||||
category.expense_account_id &&
|
|
||||||
category.landed_cost,
|
|
||||||
);
|
);
|
||||||
|
|
||||||
const form = {
|
const form = {
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ export const defaultExpenseEntry = {
|
|||||||
amount: '',
|
amount: '',
|
||||||
expense_account_id: '',
|
expense_account_id: '',
|
||||||
description: '',
|
description: '',
|
||||||
landed_cost: false,
|
landed_cost: 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
export const defaultExpense = {
|
export const defaultExpense = {
|
||||||
|
|||||||
Reference in New Issue
Block a user