+
+
+ {/* ------------- Customer name ------------- */}
+
+ {({ from, field, meta: { error, touched } }) => (
+ }
+ className={classNames('form-group--select-list', CLASSES.FILL)}
+ labelInfo={}
+ intent={inputIntent({ error, touched })}
+ helperText={}
+ >
+
+
+ )}
+
+
+
+ {/* ------------ Payment receive no. ------------ */}
+
+ {({ form, field, meta: { error, touched } }) => (
+ }
+ labelInfo={}
+ className={('form-group--payment_receive_no', CLASSES.FILL)}
+ intent={inputIntent({ error, touched })}
+ helperText={}
+ >
+
+
+ )}
+
+
+
+ {/*------------ Amount Received -----------*/}
+
+ {({
+ form: { values, setFieldValue },
+ field: { value },
+ meta: { error, touched },
+ }) => (
+ }
+ labelInfo={}
+ className={classNames('form-group--payment_amount', CLASSES.FILL)}
+ intent={inputIntent({ error, touched })}
+ helperText={}
+ >
+
+
+
+ {
+ setFieldValue('payment_amount', amount);
+ }}
+ intent={inputIntent({ error, touched })}
+ inputRef={(ref) => (paymentReceiveFieldRef.current = ref)}
+ />
+
+
+ )}
+
+
+
+ {/* ------------- Payment date ------------- */}
+
+ {({ form, field: { value }, meta: { error, touched } }) => (
+ }
+ labelInfo={}
+ className={classNames('form-group--select-list', CLASSES.FILL)}
+ intent={inputIntent({ error, touched })}
+ helperText={}
+ >
+ {
+ form.setFieldValue('payment_date', formattedDate);
+ })}
+ popoverProps={{ position: Position.BOTTOM, minimal: true }}
+ inputProps={{
+ leftIcon: ,
+ }}
+ />
+
+ )}
+
+
+
+ {/* ------------ Deposit account ------------ */}
+
+ {({ form, field: { value }, meta: { error, touched } }) => (
+ }
+ className={classNames(
+ 'form-group--deposit_account_id',
+ 'form-group--select-list',
+ CLASSES.FILL,
+ )}
+ labelInfo={}
+ intent={inputIntent({ error, touched })}
+ helperText={}
+ >
+ }
+ onAccountSelected={(account) => {
+ form.setFieldValue('deposit_account_id', account.id);
+ }}
+ defaultSelectText={}
+ selectedAccountId={value}
+ />
+
+ )}
+
+
+
+ {/* ------------ Reference No. ------------ */}
+
+ {({ form, field, meta: { error, touched } }) => (
+ }
+ className={classNames('form-group--reference', CLASSES.FILL)}
+ intent={inputIntent({ error, touched })}
+ helperText={}
+ >
+
+
+ )}
+
+ {/* --------- Statement --------- */}
+
+ {({ form, field, meta: { error, touched } }) => (
+ }
+ className={'form-group--statement'}
+ >
+
+
+ )}
+
+
+ );
+}
diff --git a/client/src/containers/Dialogs/QuickPaymentReceiveFormDialog/QuickPaymentReceiveFormProvider.js b/client/src/containers/Dialogs/QuickPaymentReceiveFormDialog/QuickPaymentReceiveFormProvider.js
new file mode 100644
index 000000000..7ede85cb2
--- /dev/null
+++ b/client/src/containers/Dialogs/QuickPaymentReceiveFormDialog/QuickPaymentReceiveFormProvider.js
@@ -0,0 +1,48 @@
+import React, { useContext, createContext } from 'react';
+import { pick } from 'lodash';
+import { DialogContent } from 'components';
+import { useAccounts, useInvoice, useCreatePaymentReceive } from 'hooks/query';
+
+const QuickPaymentReceiveContext = createContext();
+
+/**
+ * Quick payment receive dialog provider.
+ */
+function QuickPaymentReceiveFormProvider({ invoiceId, dialogName, ...props }) {
+ // Handle fetch accounts data.
+ const { data: accounts, isLoading: isAccountsLoading } = useAccounts();
+
+ // Handle fetch invoice data.
+ const { data: invoice, isLoading: isInvoiceLoading } = useInvoice(invoiceId, {
+ enabled: !!invoiceId,
+ });
+
+ // Create and edit payment receive mutations.
+ const { mutateAsync: createPaymentReceiveMutate } = useCreatePaymentReceive();
+
+ // State provider.
+ const provider = {
+ accounts,
+ invoice: {
+ ...pick(invoice, ['id', 'due_amount', 'customer', 'currency_code']),
+ customer_id: invoice?.customer?.display_name,
+ payment_amount: invoice.due_amount,
+ },
+
+ isAccountsLoading,
+ dialogName,
+
+ createPaymentReceiveMutate,
+ };
+
+ return (
+