feat: add convert to vendor credit.

This commit is contained in:
elforjani13
2021-12-26 13:25:07 +02:00
parent f9a7306e47
commit 93aa60124b
4 changed files with 33 additions and 3 deletions

View File

@@ -70,6 +70,11 @@ function BillsDataTable({
history.push(`/bills/${bill.id}/edit`);
};
// Handle convert to vendor credit.
const handleConvertToVendorCredit = ({ id }) => {
history.push(`/vendor-credits/new?from_bill_id=${id}`, { billId: id });
};
// Handle bill delete action.
const handleDeleteBill = (bill) => {
openAlert('bill-delete', { billId: bill.id });
@@ -137,6 +142,7 @@ function BillsDataTable({
onQuick: handleQuickPaymentMade,
onAllocateLandedCost: handleAllocateLandedCost,
onViewDetails: handleViewDetailBill,
onConvert: handleConvertToVendorCredit,
}}
/>
</DashboardContentTable>

View File

@@ -34,6 +34,7 @@ export function ActionsMenu({
onOpen,
onDelete,
onQuick,
onConvert,
onViewDetails,
onAllocateLandedCost,
},
@@ -53,6 +54,11 @@ export function ActionsMenu({
text={intl.get('edit_bill')}
onClick={safeCallback(onEdit, original)}
/>
<MenuItem
icon={<Icon icon="convert_to" />}
text={intl.get('convert_to_vendor_credit')}
onClick={safeCallback(onConvert, original)}
/>
<If condition={!original.is_open}>
<MenuItem