mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 21:00:31 +00:00
refactoring: invoice, receipt, payment receive, estimate and journal number dialogs.
This commit is contained in:
@@ -8,7 +8,7 @@ import {
|
||||
Position,
|
||||
} from '@blueprintjs/core';
|
||||
import { FormattedMessage as T } from 'react-intl';
|
||||
import { ErrorMessage, FastField, useFormikContext } from 'formik';
|
||||
import { ErrorMessage, FastField } from 'formik';
|
||||
import {
|
||||
CategoriesSelectList,
|
||||
Hint,
|
||||
@@ -26,13 +26,11 @@ import { handleStringChange, inputIntent } from 'utils';
|
||||
* Item form primary section.
|
||||
*/
|
||||
export default function ItemFormPrimarySection() {
|
||||
const { itemsCategories } = useItemFormContext();
|
||||
// Item form context.
|
||||
const { isNewMode, item, itemsCategories } = useItemFormContext();
|
||||
|
||||
const nameFieldRef = useRef(null);
|
||||
|
||||
// Formik context.
|
||||
const { values: { type } } = useFormikContext();
|
||||
|
||||
useEffect(() => {
|
||||
// Auto focus item name field once component mount.
|
||||
if (nameFieldRef.current) {
|
||||
@@ -87,7 +85,7 @@ export default function ItemFormPrimarySection() {
|
||||
form.setFieldValue('type', _value);
|
||||
})}
|
||||
selectedValue={value}
|
||||
disabled={type === 'inventory'}
|
||||
disabled={!isNewMode && item.type === 'inventory'}
|
||||
>
|
||||
<Radio label={<T id={'service'} />} value="service" />
|
||||
<Radio label={<T id={'non_inventory'} />} value="non-inventory" />
|
||||
|
||||
Reference in New Issue
Block a user