mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 12:50:38 +00:00
Merge remote-tracking branch 'origin/feature/breadcrumb/fix_localize'
This commit is contained in:
@@ -57,21 +57,21 @@ const ItemForm = ({
|
||||
});
|
||||
|
||||
const ItemTypeDisplay = useMemo(() => [
|
||||
{ value: null, label: 'Select Item Type' },
|
||||
{ value: 'service', label: 'Service' },
|
||||
{ value: 'inventory', label: 'Inventory' },
|
||||
{ value: 'non-inventory', label: 'Non-Inventory' },
|
||||
{ value: null, label: formatMessage({id:'select_item_type'}) },
|
||||
{ value: 'service', label: formatMessage({id:'service'}) },
|
||||
{ value: 'inventory', label: formatMessage({id:'inventory'}) },
|
||||
{ value: 'non-inventory', label: formatMessage({id:'non_inventory'}) },
|
||||
], []);
|
||||
|
||||
const validationSchema = Yup.object().shape({
|
||||
active: Yup.boolean(),
|
||||
name: Yup.string().required(),
|
||||
type: Yup.string().trim().required(),
|
||||
name: Yup.string().required().label(formatMessage({id:'item_name_'})),
|
||||
type: Yup.string().trim().required().label(formatMessage({id:'item_type_'})),
|
||||
sku: Yup.string().trim(),
|
||||
cost_price: Yup.number(),
|
||||
sell_price: Yup.number(),
|
||||
cost_account_id: Yup.number().required(),
|
||||
sell_account_id: Yup.number().required(),
|
||||
cost_account_id: Yup.number().required().label(formatMessage({id:'cost_account_id'})),
|
||||
sell_account_id: Yup.number().required().label(formatMessage({id:'sell_account_id'})),
|
||||
inventory_account_id: Yup.number().when('type', {
|
||||
is: (value) => value === 'inventory',
|
||||
then: Yup.number().required(),
|
||||
@@ -308,7 +308,7 @@ const ItemForm = ({
|
||||
rightIcon='caret-down'
|
||||
text={getSelectedAccountLabel(
|
||||
'category_id',
|
||||
'Select category'
|
||||
formatMessage({id:'select_category'})
|
||||
)}
|
||||
/>
|
||||
</Select>
|
||||
@@ -399,7 +399,7 @@ const ItemForm = ({
|
||||
rightIcon='caret-down'
|
||||
text={getSelectedAccountLabel(
|
||||
'sell_account_id',
|
||||
'Select account'
|
||||
formatMessage({id:'select_account'})
|
||||
)}
|
||||
/>
|
||||
</Select>
|
||||
@@ -462,7 +462,8 @@ const ItemForm = ({
|
||||
rightIcon='caret-down'
|
||||
text={getSelectedAccountLabel(
|
||||
'cost_account_id',
|
||||
'Select account'
|
||||
formatMessage({id:'select_account'})
|
||||
|
||||
)}
|
||||
/>
|
||||
</Select>
|
||||
@@ -508,7 +509,8 @@ const ItemForm = ({
|
||||
rightIcon='caret-down'
|
||||
text={getSelectedAccountLabel(
|
||||
'inventory_account_id',
|
||||
'Select account'
|
||||
formatMessage({id:'select_account'})
|
||||
|
||||
)}
|
||||
/>
|
||||
</Select>
|
||||
|
||||
Reference in New Issue
Block a user