mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-21 07:10:33 +00:00
feat: add quick payment receive & made in action Bar detail.
This commit is contained in:
@@ -21,7 +21,7 @@ export const transformErrors = (errors, { setFieldError }) => {
|
|||||||
intl.get('payment_number_is_not_unique'),
|
intl.get('payment_number_is_not_unique'),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (getError('INVALID_PAYMENT_AMOUNT')) {
|
if (getError('INVALID_BILL_PAYMENT_AMOUNT')) {
|
||||||
setFieldError(
|
setFieldError(
|
||||||
'payment_amount',
|
'payment_amount',
|
||||||
intl.get('the_payment_amount_bigger_than_invoice_due_amount'),
|
intl.get('the_payment_amount_bigger_than_invoice_due_amount'),
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import withDialogActions from 'containers/Dialog/withDialogActions';
|
|||||||
import withAlertsActions from 'containers/Alert/withAlertActions';
|
import withAlertsActions from 'containers/Alert/withAlertActions';
|
||||||
import withDrawerActions from 'containers/Drawer/withDrawerActions';
|
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';
|
import { safeCallback, compose } from 'utils';
|
||||||
|
|
||||||
@@ -32,7 +32,7 @@ function BillDetailActionsBar({
|
|||||||
}) {
|
}) {
|
||||||
const history = useHistory();
|
const history = useHistory();
|
||||||
|
|
||||||
const { billId } = useBillDrawerContext();
|
const { billId, bill } = useBillDrawerContext();
|
||||||
|
|
||||||
// Handle edit bill.
|
// Handle edit bill.
|
||||||
const onEditBill = () => {
|
const onEditBill = () => {
|
||||||
@@ -45,6 +45,11 @@ function BillDetailActionsBar({
|
|||||||
openAlert('bill-delete', { billId });
|
openAlert('bill-delete', { billId });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Handle quick bill payment .
|
||||||
|
const handleQuickBillPayment = () => {
|
||||||
|
openDialog('quick-payment-made', { billId });
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<DashboardActionsBar>
|
<DashboardActionsBar>
|
||||||
<NavbarGroup>
|
<NavbarGroup>
|
||||||
@@ -54,6 +59,14 @@ function BillDetailActionsBar({
|
|||||||
text={<T id={'edit_bill'} />}
|
text={<T id={'edit_bill'} />}
|
||||||
onClick={safeCallback(onEditBill)}
|
onClick={safeCallback(onEditBill)}
|
||||||
/>
|
/>
|
||||||
|
<If condition={bill.is_open && !bill.is_fully_paid}>
|
||||||
|
<Button
|
||||||
|
className={Classes.MINIMAL}
|
||||||
|
icon={<Icon icon="quick-payment-16" iconSize={16} />}
|
||||||
|
text={<T id={'payment_divider'} />}
|
||||||
|
onClick={handleQuickBillPayment}
|
||||||
|
/>
|
||||||
|
</If>
|
||||||
<NavbarDivider />
|
<NavbarDivider />
|
||||||
<Button
|
<Button
|
||||||
className={Classes.MINIMAL}
|
className={Classes.MINIMAL}
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import withDialogActions from 'containers/Dialog/withDialogActions';
|
|||||||
import withAlertsActions from 'containers/Alert/withAlertActions';
|
import withAlertsActions from 'containers/Alert/withAlertActions';
|
||||||
import withDrawerActions from 'containers/Drawer/withDrawerActions';
|
import withDrawerActions from 'containers/Drawer/withDrawerActions';
|
||||||
|
|
||||||
import { Icon, FormattedMessage as T } from 'components';
|
import { If, Icon, FormattedMessage as T } from 'components';
|
||||||
|
|
||||||
import { compose } from 'utils';
|
import { compose } from 'utils';
|
||||||
|
|
||||||
@@ -36,7 +36,7 @@ function InvoiceDetailActionsBar({
|
|||||||
const history = useHistory();
|
const history = useHistory();
|
||||||
|
|
||||||
// Invoice detail drawer context.
|
// Invoice detail drawer context.
|
||||||
const { invoiceId } = useInvoiceDetailDrawerContext();
|
const { invoiceId, invoice } = useInvoiceDetailDrawerContext();
|
||||||
|
|
||||||
// Handle edit sale invoice.
|
// Handle edit sale invoice.
|
||||||
const handleEditInvoice = () => {
|
const handleEditInvoice = () => {
|
||||||
@@ -54,6 +54,11 @@ function InvoiceDetailActionsBar({
|
|||||||
openDialog('invoice-pdf-preview', { invoiceId });
|
openDialog('invoice-pdf-preview', { invoiceId });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Handle quick payment invoice.
|
||||||
|
const handleQuickPaymentInvoice = () => {
|
||||||
|
openDialog('quick-payment-receive', { invoiceId });
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<DashboardActionsBar>
|
<DashboardActionsBar>
|
||||||
<NavbarGroup>
|
<NavbarGroup>
|
||||||
@@ -63,6 +68,14 @@ function InvoiceDetailActionsBar({
|
|||||||
text={<T id={'edit_invoice'} />}
|
text={<T id={'edit_invoice'} />}
|
||||||
onClick={handleEditInvoice}
|
onClick={handleEditInvoice}
|
||||||
/>
|
/>
|
||||||
|
<If condition={invoice.is_delivered && !invoice.is_fully_paid}>
|
||||||
|
<Button
|
||||||
|
className={Classes.MINIMAL}
|
||||||
|
icon={<Icon icon="quick-payment-16" iconSize={16} />}
|
||||||
|
text={<T id={'payment_divider'} />}
|
||||||
|
onClick={handleQuickPaymentInvoice}
|
||||||
|
/>
|
||||||
|
</If>
|
||||||
<NavbarDivider />
|
<NavbarDivider />
|
||||||
<Button
|
<Button
|
||||||
className={Classes.MINIMAL}
|
className={Classes.MINIMAL}
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ export function ActionsMenu({
|
|||||||
<If condition={original.is_open && !original.is_fully_paid}>
|
<If condition={original.is_open && !original.is_fully_paid}>
|
||||||
<MenuItem
|
<MenuItem
|
||||||
icon={<Icon icon="quick-payment-16" iconSize={16} />}
|
icon={<Icon icon="quick-payment-16" iconSize={16} />}
|
||||||
text={intl.get('add_payment')}
|
text={intl.get('payment_divider')}
|
||||||
onClick={safeCallback(onQuick, original)}
|
onClick={safeCallback(onQuick, original)}
|
||||||
/>
|
/>
|
||||||
</If>
|
</If>
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ export function ActionsMenu({
|
|||||||
<If condition={original.is_delivered && !original.is_fully_paid}>
|
<If condition={original.is_delivered && !original.is_fully_paid}>
|
||||||
<MenuItem
|
<MenuItem
|
||||||
icon={<Icon icon="quick-payment-16" iconSize={16} />}
|
icon={<Icon icon="quick-payment-16" iconSize={16} />}
|
||||||
text={intl.get('add_payment')}
|
text={intl.get('payment_divider')}
|
||||||
onClick={safeCallback(onQuick, original)}
|
onClick={safeCallback(onQuick, original)}
|
||||||
/>
|
/>
|
||||||
</If>
|
</If>
|
||||||
|
|||||||
@@ -833,7 +833,7 @@
|
|||||||
"the_payment_amount_that_received": "مبلغ الدفع الذي تم استلامه من الزبون أكبر من المبلغ المستحق لهذه الفاتورة.",
|
"the_payment_amount_that_received": "مبلغ الدفع الذي تم استلامه من الزبون أكبر من المبلغ المستحق لهذه الفاتورة.",
|
||||||
"invoice_number": "رقم الفاتورة",
|
"invoice_number": "رقم الفاتورة",
|
||||||
"make_payment": "قم بالدفع",
|
"make_payment": "قم بالدفع",
|
||||||
"add_payment": "إضافة الدفع",
|
"payment_divider": "إضافة الدفع",
|
||||||
"quick_receive_payment": "سند قبض سريع",
|
"quick_receive_payment": "سند قبض سريع",
|
||||||
"amount_received": "تم استلام المبلغ",
|
"amount_received": "تم استلام المبلغ",
|
||||||
"payment_receive_number_required": "مطلوب رقم استلام الدفعة",
|
"payment_receive_number_required": "مطلوب رقم استلام الدفعة",
|
||||||
|
|||||||
@@ -820,7 +820,7 @@
|
|||||||
"invoice_date": "Invoice date",
|
"invoice_date": "Invoice date",
|
||||||
"invoice_amount": "Invoice amount",
|
"invoice_amount": "Invoice amount",
|
||||||
"make_payment": "Make Payment",
|
"make_payment": "Make Payment",
|
||||||
"add_payment": "Add Payment",
|
"payment_divider": "Payment divider",
|
||||||
"quick_receive_payment": "Quick Receive Payment",
|
"quick_receive_payment": "Quick Receive Payment",
|
||||||
"amount_received": "Amount Received",
|
"amount_received": "Amount Received",
|
||||||
"payment_no": "Payment No.",
|
"payment_no": "Payment No.",
|
||||||
|
|||||||
Reference in New Issue
Block a user