feat: add reconcile credit note.

This commit is contained in:
elforjani13
2021-12-07 20:55:47 +02:00
parent 192bcdc696
commit 78c42acb17
18 changed files with 589 additions and 7 deletions

View File

@@ -3,7 +3,7 @@ import { useHistory } from 'react-router-dom';
import { Formik, Form } from 'formik';
import { Intent } from '@blueprintjs/core';
import intl from 'react-intl-universal';
import { sumBy, omit, isEmpty } from 'lodash';
import { isEmpty } from 'lodash';
import classNames from 'classnames';
import { CLASSES } from 'common/classes';
import {

View File

@@ -105,6 +105,11 @@ function CreditNotesDataTable({
openAlert('credit-note-open', { creditNoteId: id });
};
// Handle reconcile credit note.
const handleReconcileCreditNote = ({ id }) => {
openDialog('reconcile-credit-note', { creditNoteId: id });
};
return (
<DashboardContentTable>
<DataTable
@@ -132,6 +137,7 @@ function CreditNotesDataTable({
onEdit: hanldeEditCreditNote,
onRefund: handleRefundCreditNote,
onOpen: handleOpenCreditNote,
onReconcile: handleReconcileCreditNote,
}}
/>
</DashboardContentTable>

View File

@@ -14,7 +14,7 @@ import {
import { safeCallback } from 'utils';
export function ActionsMenu({
payload: { onEdit, onDelete, onRefund, onOpen, onViewDetails },
payload: { onEdit, onDelete, onRefund, onOpen, onReconcile, onViewDetails },
row: { original },
}) {
return (
@@ -44,7 +44,12 @@ export function ActionsMenu({
onClick={safeCallback(onOpen, original)}
/>
</If>
<MenuItem
text={'Reconcile Credit Note With Invoice'}
// icon={<Icon icon="quick-payment-16" />}
// text={intl.get('credit_note.action.refund_credit_note')}
onClick={safeCallback(onReconcile, original)}
/>
<MenuItem
text={intl.get('credit_note.action.delete_credit_note')}
intent={Intent.DANGER}