mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 06:10:31 +00:00
fix: project billable entries dilaog
This commit is contained in:
@@ -10,7 +10,7 @@ import {
|
|||||||
ControlGroup,
|
ControlGroup,
|
||||||
} from '@blueprintjs/core';
|
} from '@blueprintjs/core';
|
||||||
import { DateInput } from '@blueprintjs/datetime';
|
import { DateInput } from '@blueprintjs/datetime';
|
||||||
import { FastField, Field, ErrorMessage } from 'formik';
|
import { FastField, Field, ErrorMessage, useFormikContext } from 'formik';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
FFormGroup,
|
FFormGroup,
|
||||||
@@ -56,6 +56,8 @@ function InvoiceFormHeaderFields({
|
|||||||
// Invoice form context.
|
// Invoice form context.
|
||||||
const { customers, projects } = useInvoiceFormContext();
|
const { customers, projects } = useInvoiceFormContext();
|
||||||
|
|
||||||
|
const { values } = useFormikContext();
|
||||||
|
|
||||||
// Handle invoice number changing.
|
// Handle invoice number changing.
|
||||||
const handleInvoiceNumberChange = () => {
|
const handleInvoiceNumberChange = () => {
|
||||||
openDialog('invoice-number-form');
|
openDialog('invoice-number-form');
|
||||||
@@ -76,6 +78,14 @@ function InvoiceFormHeaderFields({
|
|||||||
// Syncs invoice number settings with form.
|
// Syncs invoice number settings with form.
|
||||||
useObserveInvoiceNoSettings(invoiceNumberPrefix, invoiceNextNumber);
|
useObserveInvoiceNoSettings(invoiceNumberPrefix, invoiceNextNumber);
|
||||||
|
|
||||||
|
React.useEffect(() => {
|
||||||
|
if (values.project_id) {
|
||||||
|
openDialog('project-billable-entries', {
|
||||||
|
projectId: values.project_id,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}, [values]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={classNames(CLASSES.PAGE_FORM_HEADER_FIELDS)}>
|
<div className={classNames(CLASSES.PAGE_FORM_HEADER_FIELDS)}>
|
||||||
{/* ----------- Customer name ----------- */}
|
{/* ----------- Customer name ----------- */}
|
||||||
|
|||||||
Reference in New Issue
Block a user