From 288225a0c1245e36677c24b4479ff26fec730e1f Mon Sep 17 00:00:00 2001 From: elforjani13 <39470382+elforjani13@users.noreply.github.com> Date: Sun, 26 Sep 2021 22:08:13 +0200 Subject: [PATCH] feat: add quick payment receive & made in action Bar detail. --- .../Dialogs/QuickPaymentMadeFormDialog/utils.js | 2 +- .../Drawers/BillDrawer/BillDetailActionsBar.js | 17 +++++++++++++++-- .../InvoiceDetailActionsBar.js | 17 +++++++++++++++-- .../Purchases/Bills/BillsLanding/components.js | 2 +- .../Invoices/InvoicesLanding/components.js | 2 +- src/lang/ar/index.json | 2 +- src/lang/en/index.json | 2 +- 7 files changed, 35 insertions(+), 9 deletions(-) diff --git a/src/containers/Dialogs/QuickPaymentMadeFormDialog/utils.js b/src/containers/Dialogs/QuickPaymentMadeFormDialog/utils.js index 95f14bfe6..b39a1d86e 100644 --- a/src/containers/Dialogs/QuickPaymentMadeFormDialog/utils.js +++ b/src/containers/Dialogs/QuickPaymentMadeFormDialog/utils.js @@ -21,7 +21,7 @@ export const transformErrors = (errors, { setFieldError }) => { intl.get('payment_number_is_not_unique'), ); } - if (getError('INVALID_PAYMENT_AMOUNT')) { + if (getError('INVALID_BILL_PAYMENT_AMOUNT')) { setFieldError( 'payment_amount', intl.get('the_payment_amount_bigger_than_invoice_due_amount'), diff --git a/src/containers/Drawers/BillDrawer/BillDetailActionsBar.js b/src/containers/Drawers/BillDrawer/BillDetailActionsBar.js index 78947d9fb..65bf1a998 100644 --- a/src/containers/Drawers/BillDrawer/BillDetailActionsBar.js +++ b/src/containers/Drawers/BillDrawer/BillDetailActionsBar.js @@ -16,7 +16,7 @@ import withDialogActions from 'containers/Dialog/withDialogActions'; import withAlertsActions from 'containers/Alert/withAlertActions'; import withDrawerActions from 'containers/Drawer/withDrawerActions'; -import { Icon, FormattedMessage as T } from 'components'; +import { If, Icon, FormattedMessage as T } from 'components'; import { safeCallback, compose } from 'utils'; @@ -32,7 +32,7 @@ function BillDetailActionsBar({ }) { const history = useHistory(); - const { billId } = useBillDrawerContext(); + const { billId, bill } = useBillDrawerContext(); // Handle edit bill. const onEditBill = () => { @@ -45,6 +45,11 @@ function BillDetailActionsBar({ openAlert('bill-delete', { billId }); }; + // Handle quick bill payment . + const handleQuickBillPayment = () => { + openDialog('quick-payment-made', { billId }); + }; + return ( @@ -54,6 +59,14 @@ function BillDetailActionsBar({ text={} onClick={safeCallback(onEditBill)} /> + +