mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 05:10:31 +00:00
feat: add create & edit & delete in vendor credit.
This commit is contained in:
@@ -21,6 +21,36 @@ import {
|
||||
} from 'components';
|
||||
import { formattedAmount, safeCallback, calculateStatus } from 'utils';
|
||||
|
||||
/**
|
||||
* Actions menu.
|
||||
*/
|
||||
export function ActionsMenu({
|
||||
payload: { onEdit, onDelete, onViewDetails },
|
||||
row: { original },
|
||||
}) {
|
||||
return (
|
||||
<Menu>
|
||||
<MenuItem
|
||||
icon={<Icon icon="reader-18" />}
|
||||
text={intl.get('view_details')}
|
||||
onClick={safeCallback(onViewDetails, original)}
|
||||
/>
|
||||
<MenuDivider />
|
||||
<MenuItem
|
||||
icon={<Icon icon="pen-18" />}
|
||||
text={intl.get('vendor_credits.action.edit_vendor_credit')}
|
||||
onClick={safeCallback(onEdit, original)}
|
||||
/>
|
||||
<MenuItem
|
||||
text={intl.get('vendor_credits.action.delete_vendor_credit')}
|
||||
intent={Intent.DANGER}
|
||||
onClick={safeCallback(onDelete, original)}
|
||||
icon={<Icon icon="trash-16" iconSize={16} />}
|
||||
/>
|
||||
</Menu>
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve vendors credit note table columns.
|
||||
*/
|
||||
@@ -28,12 +58,12 @@ export function useVendorsCreditNoteTableColumns() {
|
||||
return React.useMemo(
|
||||
() => [
|
||||
{
|
||||
id: 'date',
|
||||
id: 'vendor_credit_date',
|
||||
Header: intl.get('date'),
|
||||
accessor: 'date',
|
||||
accessor: 'vendor_credit_date',
|
||||
Cell: FormatDateCell,
|
||||
width: 110,
|
||||
className: 'date',
|
||||
className: 'vendor_credit_date',
|
||||
clickable: true,
|
||||
textOverview: true,
|
||||
},
|
||||
@@ -47,11 +77,11 @@ export function useVendorsCreditNoteTableColumns() {
|
||||
textOverview: true,
|
||||
},
|
||||
{
|
||||
id: 'credit_note',
|
||||
Header: intl.get('credit_note.label_credit_note_no'),
|
||||
accessor: 'credit_note',
|
||||
id: 'vendor_credit_number',
|
||||
Header: intl.get('vendor_credits.column.vendor_credit_no'),
|
||||
accessor: 'vendor_credit_number',
|
||||
width: 100,
|
||||
className: 'credit_note',
|
||||
className: 'vendor_credit_number',
|
||||
clickable: true,
|
||||
textOverview: true,
|
||||
},
|
||||
@@ -59,6 +89,7 @@ export function useVendorsCreditNoteTableColumns() {
|
||||
id: 'amount',
|
||||
Header: intl.get('amount'),
|
||||
// accessor: 'formatted_amount',
|
||||
accessor: 'amount',
|
||||
width: 120,
|
||||
align: 'right',
|
||||
clickable: true,
|
||||
|
||||
Reference in New Issue
Block a user