mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 13:50:31 +00:00
feat: payment receive and made form.
This commit is contained in:
@@ -13,10 +13,12 @@ import classNames from 'classnames';
|
||||
import { FormattedMessage as T, useIntl } from 'react-intl';
|
||||
import { pick } from 'lodash';
|
||||
import { CLASSES } from 'common/classes';
|
||||
|
||||
import BillFormHeader from './BillFormHeader';
|
||||
import EstimatesItemsTable from 'containers/Sales/Estimate/EntriesItemsTable';
|
||||
import BillFloatingActions from './BillFloatingActions';
|
||||
import BillFormFooter from './BillFormFooter';
|
||||
|
||||
import withDashboardActions from 'containers/Dashboard/withDashboardActions';
|
||||
import withMediaActions from 'containers/Media/withMediaActions';
|
||||
import withBillActions from './withBillActions';
|
||||
@@ -41,6 +43,7 @@ function BillForm({
|
||||
|
||||
//#withDashboard
|
||||
changePageTitle,
|
||||
changePageSubtitle,
|
||||
|
||||
//#withBillDetail
|
||||
bill,
|
||||
@@ -235,6 +238,7 @@ function BillForm({
|
||||
setSubmitting(false);
|
||||
saveBillSubmit({ action: 'update', ...payload });
|
||||
resetForm();
|
||||
changePageSubtitle('');
|
||||
})
|
||||
.catch((errors) => {
|
||||
handleErrors(errors, { setErrors });
|
||||
@@ -302,10 +306,22 @@ function BillForm({
|
||||
orderingIndex([...formik.values.entries, defaultBill]),
|
||||
);
|
||||
};
|
||||
|
||||
const handleBillNumberChanged = useCallback((billNumber) => {
|
||||
changePageSubtitle(billNumber);
|
||||
}, []);
|
||||
|
||||
// Clear page subtitle once unmount bill form page.
|
||||
useEffect(() => () => {
|
||||
changePageSubtitle('');
|
||||
}, [changePageSubtitle]);
|
||||
|
||||
return (
|
||||
<div className={classNames(CLASSES.PAGE_FORM, CLASSES.PAGE_FORM_BILL)}>
|
||||
<form onSubmit={formik.handleSubmit}>
|
||||
<BillFormHeader formik={formik} />
|
||||
<BillFormHeader
|
||||
formik={formik}
|
||||
onBillNumberChanged={handleBillNumberChanged} />
|
||||
|
||||
<EstimatesItemsTable
|
||||
formik={formik}
|
||||
|
||||
Reference in New Issue
Block a user