mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-21 07:10:33 +00:00
feat(bill): add quick payment made.
This commit is contained in:
@@ -13,6 +13,7 @@ import withBills from './withBills';
|
|||||||
import withBillActions from './withBillsActions';
|
import withBillActions from './withBillsActions';
|
||||||
import withSettings from 'containers/Settings/withSettings';
|
import withSettings from 'containers/Settings/withSettings';
|
||||||
import withAlertsActions from 'containers/Alert/withAlertActions';
|
import withAlertsActions from 'containers/Alert/withAlertActions';
|
||||||
|
import withDialogActions from 'containers/Dialog/withDialogActions';
|
||||||
import { useBillsTableColumns, ActionsMenu } from './components';
|
import { useBillsTableColumns, ActionsMenu } from './components';
|
||||||
import { useBillsListContext } from './BillsListProvider';
|
import { useBillsListContext } from './BillsListProvider';
|
||||||
|
|
||||||
@@ -28,6 +29,9 @@ function BillsDataTable({
|
|||||||
|
|
||||||
// #withAlerts
|
// #withAlerts
|
||||||
openAlert,
|
openAlert,
|
||||||
|
|
||||||
|
// #withDialogActions
|
||||||
|
openDialog,
|
||||||
}) {
|
}) {
|
||||||
// Bills list context.
|
// Bills list context.
|
||||||
const {
|
const {
|
||||||
@@ -69,6 +73,11 @@ function BillsDataTable({
|
|||||||
openAlert('bill-open', { billId: bill.id });
|
openAlert('bill-open', { billId: bill.id });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Handle quick payment made action.
|
||||||
|
const handleQuickPaymentMade = ({ id }) => {
|
||||||
|
openDialog('quick-payment-made', { billId: id });
|
||||||
|
};
|
||||||
|
|
||||||
if (isEmptyStatus) {
|
if (isEmptyStatus) {
|
||||||
return <BillsEmptyStatus />;
|
return <BillsEmptyStatus />;
|
||||||
}
|
}
|
||||||
@@ -95,6 +104,7 @@ function BillsDataTable({
|
|||||||
onDelete: handleDeleteBill,
|
onDelete: handleDeleteBill,
|
||||||
onEdit: handleEditBill,
|
onEdit: handleEditBill,
|
||||||
onOpen: handleOpenBill,
|
onOpen: handleOpenBill,
|
||||||
|
onQuick: handleQuickPaymentMade,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
@@ -104,6 +114,7 @@ export default compose(
|
|||||||
withBills(({ billsTableState }) => ({ billsTableState })),
|
withBills(({ billsTableState }) => ({ billsTableState })),
|
||||||
withBillActions,
|
withBillActions,
|
||||||
withAlertsActions,
|
withAlertsActions,
|
||||||
|
withDialogActions,
|
||||||
withSettings(({ organizationSettings }) => ({
|
withSettings(({ organizationSettings }) => ({
|
||||||
baseCurrency: organizationSettings?.baseCurrency,
|
baseCurrency: organizationSettings?.baseCurrency,
|
||||||
})),
|
})),
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import moment from 'moment';
|
|||||||
* Actions menu.
|
* Actions menu.
|
||||||
*/
|
*/
|
||||||
export function ActionsMenu({
|
export function ActionsMenu({
|
||||||
payload: { onEdit, onOpen, onDelete },
|
payload: { onEdit, onOpen, onDelete, onQuick },
|
||||||
row: { original },
|
row: { original },
|
||||||
}) {
|
}) {
|
||||||
const { formatMessage } = useIntl();
|
const { formatMessage } = useIntl();
|
||||||
@@ -43,6 +43,13 @@ export function ActionsMenu({
|
|||||||
onClick={safeCallback(onOpen, original)}
|
onClick={safeCallback(onOpen, original)}
|
||||||
/>
|
/>
|
||||||
</If>
|
</If>
|
||||||
|
<If condition={!original.is_fully_paid}>
|
||||||
|
<MenuItem
|
||||||
|
icon={<Icon icon="quick-payment-16" iconSize={16} />}
|
||||||
|
text={formatMessage({ id: 'add_payment' })}
|
||||||
|
onClick={safeCallback(onQuick, original)}
|
||||||
|
/>
|
||||||
|
</If>
|
||||||
|
|
||||||
<MenuItem
|
<MenuItem
|
||||||
text={formatMessage({ id: 'delete_bill' })}
|
text={formatMessage({ id: 'delete_bill' })}
|
||||||
|
|||||||
Reference in New Issue
Block a user