mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-22 15:50:32 +00:00
feat(account): handle error.
This commit is contained in:
@@ -146,6 +146,7 @@ function AccountFormDialogFields({
|
|||||||
)}
|
)}
|
||||||
inline={true}
|
inline={true}
|
||||||
intent={inputIntent({ error, touched })}
|
intent={inputIntent({ error, touched })}
|
||||||
|
helperText={<ErrorMessage name="parent_account_id" />}
|
||||||
>
|
>
|
||||||
<AccountsSelectList
|
<AccountsSelectList
|
||||||
accounts={accounts}
|
accounts={accounts}
|
||||||
|
|||||||
@@ -10,6 +10,13 @@ export const transformApiErrors = (errors) => {
|
|||||||
if (errors.find((e) => e.type === 'ACCOUNT.NAME.NOT.UNIQUE')) {
|
if (errors.find((e) => e.type === 'ACCOUNT.NAME.NOT.UNIQUE')) {
|
||||||
fields.name = intl.get('account_name_is_already_used');
|
fields.name = intl.get('account_name_is_already_used');
|
||||||
}
|
}
|
||||||
|
if (
|
||||||
|
errors.find((e) => e.type === 'ACCOUNT_CURRENCY_NOT_SAME_PARENT_ACCOUNT')
|
||||||
|
) {
|
||||||
|
fields.parent_account_id = intl.get(
|
||||||
|
'accounts.error.account_currency_not_same_parent_account',
|
||||||
|
);
|
||||||
|
}
|
||||||
return fields;
|
return fields;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1787,5 +1787,7 @@
|
|||||||
"warehouse_locations.column.warehouse_name": "Warehouse name",
|
"warehouse_locations.column.warehouse_name": "Warehouse name",
|
||||||
"warehouse_locations.column.quantity": "Quantity",
|
"warehouse_locations.column.quantity": "Quantity",
|
||||||
"warehouse_locations.column.available_for_sale": "Available for sale",
|
"warehouse_locations.column.available_for_sale": "Available for sale",
|
||||||
"warehouse_locations.column.warehouse_code": "Warehouse code"
|
"warehouse_locations.column.warehouse_code": "Warehouse code",
|
||||||
|
"accounts.error.account_currency_not_same_parent_account": "لا يمكنك إنشاء حساب بعملة مختلفة عن عملة الحساب الأصلي."
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1883,5 +1883,6 @@
|
|||||||
"warehouse_transfer.alert.initiate_warehouse": "The given warehouse transfer has been initialized.",
|
"warehouse_transfer.alert.initiate_warehouse": "The given warehouse transfer has been initialized.",
|
||||||
"warehouse_transfer.alert.are_you_sure_you_want_to_initate": "Are you sure you want to initiate this warehouse transfer?",
|
"warehouse_transfer.alert.are_you_sure_you_want_to_initate": "Are you sure you want to initiate this warehouse transfer?",
|
||||||
"warehouse_transfer.alert.transferred_warehouse": "The given warehouse transfer has been delivered",
|
"warehouse_transfer.alert.transferred_warehouse": "The given warehouse transfer has been delivered",
|
||||||
"warehouse_transfer.alert.are_you_sure_you_want_to_deliver": "Are you sure you want to deliver this warehouse transfer?"
|
"warehouse_transfer.alert.are_you_sure_you_want_to_deliver": "Are you sure you want to deliver this warehouse transfer?",
|
||||||
|
"accounts.error.account_currency_not_same_parent_account": "You could not create an account in a currency different from the parent account currency."
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user