mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 13:50:31 +00:00
revert: form changes
This commit is contained in:
@@ -30,19 +30,19 @@ export default function InvoiceFloatingActions() {
|
||||
const { setSubmitPayload, invoice } = useInvoiceFormContext();
|
||||
|
||||
// Handle submit & deliver button click.
|
||||
const handleSubmitDeliverBtnClick = () => {
|
||||
setSubmitPayload({ redirectToEdit: true, deliverViaMail: true });
|
||||
const handleSubmitDeliverBtnClick = (event) => {
|
||||
setSubmitPayload({ redirect: true, deliver: true });
|
||||
submitForm();
|
||||
};
|
||||
|
||||
// Handle submit, deliver & new button click.
|
||||
const handleSubmitDeliverAndNewBtnClick = () => {
|
||||
const handleSubmitDeliverAndNewBtnClick = (event) => {
|
||||
setSubmitPayload({ redirect: false, deliver: true, resetForm: true });
|
||||
submitForm();
|
||||
};
|
||||
|
||||
// Handle submit, deliver & continue editing button click.
|
||||
const handleSubmitDeliverContinueEditingBtnClick = () => {
|
||||
const handleSubmitDeliverContinueEditingBtnClick = (event) => {
|
||||
setSubmitPayload({ redirect: false, deliver: true });
|
||||
submitForm();
|
||||
};
|
||||
|
||||
@@ -34,20 +34,12 @@ import {
|
||||
transformValueToRequest,
|
||||
resetFormState,
|
||||
} from './utils';
|
||||
import {
|
||||
InvoiceExchangeRateSync,
|
||||
InvoiceNoSyncSettingsToForm,
|
||||
} from './components';
|
||||
import { DialogsName } from '@/constants/dialogs';
|
||||
import withDialogActions from '@/containers/Dialog/withDialogActions';
|
||||
import { InvoiceExchangeRateSync, InvoiceNoSyncSettingsToForm } from './components';
|
||||
|
||||
/**
|
||||
* Invoice form.
|
||||
*/
|
||||
function InvoiceForm({
|
||||
// #withDialogActions
|
||||
openDialog,
|
||||
|
||||
// #withSettings
|
||||
invoiceNextNumber,
|
||||
invoiceNumberPrefix,
|
||||
@@ -119,7 +111,7 @@ function InvoiceForm({
|
||||
from_estimate_id: estimateId,
|
||||
};
|
||||
// Handle the request success.
|
||||
const onSuccess = (res) => {
|
||||
const onSuccess = () => {
|
||||
AppToaster.show({
|
||||
message: intl.get(
|
||||
isNewMode
|
||||
@@ -131,11 +123,6 @@ function InvoiceForm({
|
||||
});
|
||||
setSubmitting(false);
|
||||
|
||||
if (submitPayload.deliverViaMail) {
|
||||
openDialog(DialogsName.InvoiceFormMailDeliver, {
|
||||
invoiceId: res.data.id,
|
||||
});
|
||||
}
|
||||
if (submitPayload.redirect) {
|
||||
history.push('/invoices');
|
||||
}
|
||||
@@ -214,5 +201,4 @@ export default compose(
|
||||
invoiceTermsConditions: invoiceSettings?.termsConditions,
|
||||
})),
|
||||
withCurrentOrganization(),
|
||||
withDialogActions,
|
||||
)(InvoiceForm);
|
||||
|
||||
Reference in New Issue
Block a user