mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 21:00:31 +00:00
feat: add reconcile credit note.
This commit is contained in:
35
src/containers/Dialogs/ReconcileCreditNoteDialog/utils.js
Normal file
35
src/containers/Dialogs/ReconcileCreditNoteDialog/utils.js
Normal file
@@ -0,0 +1,35 @@
|
||||
import React from 'react';
|
||||
import intl from 'react-intl-universal';
|
||||
import { Callout, Intent, Classes } from '@blueprintjs/core';
|
||||
|
||||
import { AppToaster, T } from 'components';
|
||||
|
||||
export const transformErrors = (errors, { setErrors }) => {
|
||||
if (errors.some((e) => e.type === 'INVOICES_HAS_NO_REMAINING_AMOUNT')) {
|
||||
AppToaster.show({
|
||||
message: 'INVOICES_HAS_NO_REMAINING_AMOUNT',
|
||||
intent: Intent.DANGER,
|
||||
});
|
||||
}
|
||||
|
||||
if (
|
||||
errors.find((error) => error.type === 'CREDIT_NOTE_HAS_NO_REMAINING_AMOUNT')
|
||||
) {
|
||||
AppToaster.show({
|
||||
message: 'CREDIT_NOTE_HAS_NO_REMAINING_AMOUNT',
|
||||
intent: Intent.DANGER,
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
export function EmptyStatuCallout() {
|
||||
return (
|
||||
<div className={Classes.DIALOG_BODY}>
|
||||
<Callout intent={Intent.PRIMARY}>
|
||||
<p>
|
||||
<T id={'reconcile_credit_note.alert.there_is_no_open_sale_invoices'} />
|
||||
</p>
|
||||
</Callout>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user