feat(webapp): add convert to invoice on estimate drawer toolbar

This commit is contained in:
a.nasouf
2024-02-10 22:18:13 +02:00
parent cd8f64dfdc
commit a8671a8d99

View File

@@ -52,6 +52,15 @@ function EstimateDetailActionsBar({
history.push(`/estimates/${estimateId}/edit`);
closeDrawer(DRAWERS.ESTIMATE_DETAILS);
};
// Handle convert to invoice.
const handleConvertEstimate = () => {
history.push(`/invoices/new?from_estimate_id=${estimateId}`, {
action: estimateId,
});
closeDrawer(DRAWERS.ESTIMATE_DETAILS);
};
// Handle delete sale estimate.
const handleDeleteEstimate = () => {
openAlert('estimate-delete', { estimateId });
@@ -84,6 +93,12 @@ function EstimateDetailActionsBar({
</Can>
<Can I={SaleEstimateAction.View} a={AbilitySubject.Estimate}>
<Button
className={Classes.MINIMAL}
icon={<Icon icon="convert_to" />}
text={<T id={'convert_to_invoice'} />}
onClick={handleConvertEstimate}
/>
<Button
className={Classes.MINIMAL}
icon={<Icon icon="envelope" />}