mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 13:20:31 +00:00
feat: add refund transactions.
This commit is contained in:
@@ -13,6 +13,7 @@ import withDashboardActions from 'containers/Dashboard/withDashboardActions';
|
||||
import withVendorsCreditNotesActions from './withVendorsCreditNotesActions';
|
||||
import withAlertsActions from 'containers/Alert/withAlertActions';
|
||||
import withDrawerActions from 'containers/Drawer/withDrawerActions';
|
||||
import withDialogActions from 'containers/Dialog/withDialogActions';
|
||||
import withSettings from '../../../Settings/withSettings';
|
||||
|
||||
import { useVendorsCreditNoteTableColumns, ActionsMenu } from './components';
|
||||
@@ -33,6 +34,9 @@ function VendorsCreditNoteDataTable({
|
||||
// #withDrawerActions
|
||||
openDrawer,
|
||||
|
||||
// #withDialogAction
|
||||
openDialog,
|
||||
|
||||
// #withSettings
|
||||
creditNoteTableSize,
|
||||
}) {
|
||||
@@ -92,6 +96,10 @@ function VendorsCreditNoteDataTable({
|
||||
});
|
||||
};
|
||||
|
||||
const handleRefundCreditVendor = ({ id }) => {
|
||||
openDialog('refund-vendor-credit', { vendorCreditId: id });
|
||||
};
|
||||
|
||||
return (
|
||||
<DashboardContentTable>
|
||||
<DataTable
|
||||
@@ -118,6 +126,7 @@ function VendorsCreditNoteDataTable({
|
||||
onViewDetails: handleViewDetailVendorCredit,
|
||||
onDelete: handleDeleteVendorCreditNote,
|
||||
onEdit: hanldeEditVendorCreditNote,
|
||||
onRefund: handleRefundCreditVendor,
|
||||
}}
|
||||
/>
|
||||
</DashboardContentTable>
|
||||
@@ -129,6 +138,7 @@ export default compose(
|
||||
withVendorsCreditNotesActions,
|
||||
withAlertsActions,
|
||||
withDrawerActions,
|
||||
withDialogActions,
|
||||
withSettings(({ vendorsCreditNoteSetting }) => ({
|
||||
creditNoteTableSize: vendorsCreditNoteSetting?.tableSize,
|
||||
})),
|
||||
|
||||
@@ -25,7 +25,7 @@ import { formattedAmount, safeCallback, calculateStatus } from 'utils';
|
||||
* Actions menu.
|
||||
*/
|
||||
export function ActionsMenu({
|
||||
payload: { onEdit, onDelete, onViewDetails },
|
||||
payload: { onEdit, onDelete, onRefund, onViewDetails },
|
||||
row: { original },
|
||||
}) {
|
||||
return (
|
||||
@@ -41,6 +41,11 @@ export function ActionsMenu({
|
||||
text={intl.get('vendor_credits.action.edit_vendor_credit')}
|
||||
onClick={safeCallback(onEdit, original)}
|
||||
/>
|
||||
<MenuItem
|
||||
icon={<Icon icon="quick-payment-16" />}
|
||||
text={intl.get('vendor_credits.action.refund_vendor_credit')}
|
||||
onClick={safeCallback(onRefund, original)}
|
||||
/>
|
||||
<MenuItem
|
||||
text={intl.get('vendor_credits.action.delete_vendor_credit')}
|
||||
intent={Intent.DANGER}
|
||||
|
||||
@@ -4,6 +4,10 @@ const VendorCreditDeleteAlert = React.lazy(() =>
|
||||
import('../../Alerts/VendorCeditNotes/VendorCreditDeleteAlert'),
|
||||
);
|
||||
|
||||
const RefundVendorCreditDeleteAlert = React.lazy(() =>
|
||||
import('../../Alerts/VendorCeditNotes/RefundVendorCreditDeleteAlert'),
|
||||
);
|
||||
|
||||
/**
|
||||
* Vendor Credit notes alerts.
|
||||
*/
|
||||
@@ -12,4 +16,8 @@ export default [
|
||||
name: 'vendor-credit-delete',
|
||||
component: VendorCreditDeleteAlert,
|
||||
},
|
||||
{
|
||||
name: 'refund-vendor-delete',
|
||||
component: RefundVendorCreditDeleteAlert,
|
||||
},
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user