feat(Sale invoice): quick payment receive.

This commit is contained in:
elforjani3
2021-03-11 19:34:57 +02:00
parent 77968489b2
commit 1d23bffff6
15 changed files with 556 additions and 3 deletions

View File

@@ -14,6 +14,7 @@ import withInvoiceActions from './withInvoiceActions';
import withSettings from 'containers/Settings/withSettings';
import withAlertsActions from 'containers/Alert/withAlertActions';
import withDrawerActions from 'containers/Drawer/withDrawerActions';
import withDialogActions from 'containers/Dialog/withDialogActions';
import { useInvoicesTableColumns, ActionsMenu } from './components';
import { useInvoicesListContext } from './InvoicesListProvider';
@@ -36,6 +37,9 @@ function InvoicesDataTable({
// #withDrawerActions
openDrawer,
// #withDialogAction
openDialog,
}) {
const history = useHistory();
@@ -71,6 +75,10 @@ function InvoicesDataTable({
openDrawer('invoice-drawer', { invoiceId: id });
};
// handle quick payment receive.
const handleQuickPaymentReceive = ({ id }) => {
openDialog('quick-payment-receive', { invoiceId: id });
};
// Handles fetch data once the table state change.
const handleDataTableFetchData = useCallback(
({ pageSize, pageIndex, sortBy }) => {
@@ -114,6 +122,7 @@ function InvoicesDataTable({
onDeliver: handleDeliverInvoice,
onEdit: handleEditInvoice,
onDrawer: handleDrawerInvoice,
onQuick: handleQuickPaymentReceive,
baseCurrency,
}}
/>
@@ -125,6 +134,7 @@ export default compose(
withInvoiceActions,
withAlertsActions,
withDrawerActions,
withDialogActions,
withInvoices(({ invoicesTableState }) => ({ invoicesTableState })),
withSettings(({ organizationSettings }) => ({
baseCurrency: organizationSettings?.baseCurrency,