mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 21:00:31 +00:00
fix(webapp): payment receive auto-increment
This commit is contained in:
@@ -33,6 +33,7 @@ import {
|
||||
defaultReceipt,
|
||||
handleErrors,
|
||||
transformFormValuesToRequest,
|
||||
resetFormState,
|
||||
} from './utils';
|
||||
import { ReceiptSyncIncrementSettingsToForm } from './components';
|
||||
|
||||
@@ -122,7 +123,7 @@ function ReceiptForm({
|
||||
history.push('/receipts');
|
||||
}
|
||||
if (submitPayload.resetForm) {
|
||||
resetForm();
|
||||
resetFormState();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -239,3 +239,14 @@ export const useReceiptIsForeignCustomer = () => {
|
||||
);
|
||||
return isForeignCustomer;
|
||||
};
|
||||
|
||||
export const resetFormState = ({ initialValues, values, resetForm }) => {
|
||||
resetForm({
|
||||
values: {
|
||||
// Reset the all values except the warehouse and brand id.
|
||||
...initialValues,
|
||||
warehouse_id: values.warehouse_id,
|
||||
brand_id: values.brand_id,
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user