mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 21:30:31 +00:00
revert: form changes
This commit is contained in:
@@ -34,20 +34,12 @@ import {
|
||||
transformFormValuesToRequest,
|
||||
resetFormState,
|
||||
} from './utils';
|
||||
import {
|
||||
ReceiptSyncAutoExRateToForm,
|
||||
ReceiptSyncIncrementSettingsToForm,
|
||||
} from './components';
|
||||
import withDialogActions from '@/containers/Dialog/withDialogActions';
|
||||
import { DialogsName } from '@/constants/dialogs';
|
||||
import { ReceiptSyncAutoExRateToForm, ReceiptSyncIncrementSettingsToForm } from './components';
|
||||
|
||||
/**
|
||||
* Receipt form.
|
||||
*/
|
||||
function ReceiptForm({
|
||||
// #withDialogActions
|
||||
openDialog,
|
||||
|
||||
// #withSettings
|
||||
receiptNextNumber,
|
||||
receiptNumberPrefix,
|
||||
@@ -92,7 +84,10 @@ function ReceiptForm({
|
||||
}),
|
||||
};
|
||||
// Handle the form submit.
|
||||
const handleFormSubmit = (values, { setErrors, setSubmitting }) => {
|
||||
const handleFormSubmit = (
|
||||
values,
|
||||
{ setErrors, setSubmitting, resetForm },
|
||||
) => {
|
||||
const entries = values.entries.filter(
|
||||
(item) => item.item_id && item.quantity,
|
||||
);
|
||||
@@ -129,11 +124,6 @@ function ReceiptForm({
|
||||
if (submitPayload.resetForm) {
|
||||
resetFormState();
|
||||
}
|
||||
if (submitPayload.deliverMail) {
|
||||
openDialog(DialogsName.ReceiptFormMailDeliver, {
|
||||
receiptId: response.data.id,
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// Handle the request error.
|
||||
@@ -189,7 +179,6 @@ function ReceiptForm({
|
||||
}
|
||||
|
||||
export default compose(
|
||||
withDialogActions,
|
||||
withDashboardActions,
|
||||
withSettings(({ receiptSettings }) => ({
|
||||
receiptNextNumber: receiptSettings?.nextNumber,
|
||||
|
||||
@@ -33,7 +33,7 @@ export default function ReceiptFormFloatingActions() {
|
||||
|
||||
// Handle submit & close button click.
|
||||
const handleSubmitCloseBtnClick = (event) => {
|
||||
setSubmitPayload({ redirect: false, deliverMail: true, status: true });
|
||||
setSubmitPayload({ redirect: true, status: true });
|
||||
submitForm();
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user