mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 21:00:31 +00:00
feat: add delete reconcile & handle error.
This commit is contained in:
@@ -125,6 +125,16 @@ export const handleDeleteErrors = (errors) => {
|
||||
intent: Intent.DANGER,
|
||||
});
|
||||
}
|
||||
if (
|
||||
errors.find((error) => error.type === 'BILL_HAS_APPLIED_TO_VENDOR_CREDIT')
|
||||
) {
|
||||
AppToaster.show({
|
||||
message: intl.get(
|
||||
'bills.error.you_couldn_t_delete_bill_has_reconciled_with_vendor_credit',
|
||||
),
|
||||
intent: Intent.DANGER,
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
import intl from 'react-intl-universal';
|
||||
import { Intent } from '@blueprintjs/core';
|
||||
import { AppToaster } from 'components';
|
||||
|
||||
export const handleDeleteErrors = (errors) => {
|
||||
if (
|
||||
errors.find((error) => error.type === 'VENDOR_CREDIT_HAS_APPLIED_BILLS')
|
||||
) {
|
||||
AppToaster.show({
|
||||
message: intl.get(
|
||||
'vendor_credit.error.you_couldn_t_delete_vendor_credit_has_reconciled',
|
||||
),
|
||||
intent: Intent.DANGER,
|
||||
});
|
||||
}
|
||||
if (
|
||||
errors.find(
|
||||
(error) => error.type === 'VENDOR_CREDIT_HAS_REFUND_TRANSACTIONS',
|
||||
)
|
||||
) {
|
||||
AppToaster.show({
|
||||
message: intl.get(
|
||||
'vendor_credit.error.you_couldn_t_delete_vendor_credit_that_has_associated_refund',
|
||||
),
|
||||
intent: Intent.DANGER,
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user