feat: convert estimate to invoice.

This commit is contained in:
elforjani3
2021-03-02 11:45:20 +02:00
parent 4d751f772e
commit aa8ba546aa
11 changed files with 111 additions and 40 deletions

View File

@@ -66,12 +66,17 @@ function EstimatesDataTable({
const handleRejectEstimate = ({ id }) => {
openAlert('estimate-reject', { estimateId: id });
};
// Handle drawer estimate.
const handleDrawerEstimate = () => {
openDrawer('estimate-drawer', {});
};
// Handle convent to invoice.
const handleConvertToInvoice = ({ id }) => {
history.push(`/invoices/new?from_estimate_id=${id}`, { action: id });
};
// Handles fetch data.
const handleFetchData = useCallback(
({ pageIndex, pageSize, sortBy }) => {
@@ -114,6 +119,7 @@ function EstimatesDataTable({
onDeliver: handleDeliverEstimate,
onDelete: handleDeleteEstimate,
onDrawer: handleDrawerEstimate,
onConvert: handleConvertToInvoice,
}}
/>
);