mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 21:30:31 +00:00
BIG-81: handle error message.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
export const ERROR = {
|
||||
// Sales Estimates
|
||||
ESTIMATE_NUMBER_IS_NOT_UNQIUE: 'ESTIMATE.NUMBER.IS.NOT.UNQIUE',
|
||||
SALE_ESTIMATE_NO_IS_REQUIRED: 'SALE_ESTIMATE_NO_IS_REQUIRED',
|
||||
|
||||
// Sales Invoices
|
||||
SALE_INVOICE_NUMBER_IS_EXISTS: 'SALE.INVOICE.NUMBER.IS.EXISTS',
|
||||
@@ -13,5 +14,5 @@ export const ERROR = {
|
||||
|
||||
// Bills
|
||||
BILL_NUMBER_EXISTS: 'BILL.NUMBER.EXISTS',
|
||||
SALE_INVOICE_NO_IS_REQUIRED: 'SALE_INVOICE_NO_IS_REQUIRED'
|
||||
SALE_INVOICE_NO_IS_REQUIRED: 'SALE_INVOICE_NO_IS_REQUIRED',
|
||||
};
|
||||
|
||||
@@ -78,6 +78,13 @@ function EstimateForm({
|
||||
estimate_number: intl.get('estimate_number_is_not_unqiue'),
|
||||
});
|
||||
}
|
||||
if (
|
||||
errors.some((error) => error.type === ERROR.SALE_ESTIMATE_NO_IS_REQUIRED)
|
||||
) {
|
||||
setErrors({
|
||||
estimate_number: intl.get('estimate.field.error.estimate_number'),
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// Handles form submit.
|
||||
|
||||
@@ -153,6 +153,7 @@ function InvoiceFormHeaderFields({
|
||||
{({ form, field, meta: { error, touched } }) => (
|
||||
<FormGroup
|
||||
label={<T id={'invoice_no'} />}
|
||||
labelInfo={<FieldRequiredHint />}
|
||||
inline={true}
|
||||
className={classNames('form-group--invoice-no', CLASSES.FILL)}
|
||||
intent={inputIntent({ error, touched })}
|
||||
|
||||
@@ -93,8 +93,7 @@ export const transformErrors = (errors, { setErrors }) => {
|
||||
errors.some((error) => error.type === ERROR.SALE_INVOICE_NO_IS_REQUIRED)
|
||||
) {
|
||||
setErrors({
|
||||
invoice_no:
|
||||
'Invoice number is required, use auto-increment mode or enter manually.',
|
||||
invoice_no: intl.get('invoice.field.error.invoice_no'),
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1323,5 +1323,7 @@
|
||||
"payment_receive.auto_increment.manually": "Yor payment numbers are set on manual mode. Are you sure chaning this settings?",
|
||||
"auto_increment.field.manually": "I will enter them manually each time",
|
||||
"auto_increment.field.manual_this_transaction": "Manual entering for this transaction.",
|
||||
"auto_increment.field.auto": "Auto-incrementing number."
|
||||
"auto_increment.field.auto": "Auto-incrementing number.",
|
||||
"estimate.field.error.estimate_number":"Estimate number is required, use auto-increment mode or enter manually.",
|
||||
"invoice.field.error.invoice_no":"Invoice number is required, use auto-increment mode or enter manually"
|
||||
}
|
||||
Reference in New Issue
Block a user