fix: auto-increment transaction field

This commit is contained in:
a.bouhuolia
2023-05-23 14:39:57 +02:00
parent 0c689459cb
commit 4082e4e2b8
7 changed files with 56 additions and 35 deletions

View File

@@ -1,11 +1,11 @@
// @ts-nocheck
import React, { useMemo } from 'react';
import { sumBy, isEmpty, defaultTo } from 'lodash';
import intl from 'react-intl-universal';
import classNames from 'classnames';
import { Formik, Form } from 'formik';
import { omit, sumBy, pick, isEmpty, defaultTo } from 'lodash';
import { Intent } from '@blueprintjs/core';
import { useHistory } from 'react-router-dom';
import { Intent } from '@blueprintjs/core';
import '@/style/pages/PaymentReceive/PageForm.scss';
@@ -69,7 +69,6 @@ function PaymentReceiveForm({
paymentReceiveNumberPrefix,
paymentReceiveNextNumber,
);
// Form initial values.
const initialValues = useMemo(
() => ({
@@ -114,7 +113,8 @@ function PaymentReceiveForm({
const form = transformFormToRequest(values);
// Handle request response success.
const onSaved = (response) => {
const onSaved = () => {
setSubmitting(false);
AppToaster.show({
message: intl.get(
paymentReceiveId
@@ -123,7 +123,6 @@ function PaymentReceiveForm({
),
intent: Intent.SUCCESS,
});
setSubmitting(false);
if (submitPayload.redirect) {
history.push('/payment-receives');

View File

@@ -109,6 +109,7 @@ const PaymentReceivePaymentNoField = R.compose(
>
<ControlGroup fill={true}>
<InputGroup
name={'payment_receive_no'}
minimal={true}
value={values.payment_receive_no}
asyncControl={true}
@@ -136,7 +137,7 @@ const PaymentReceivePaymentNoField = R.compose(
/**
* Payment receive header fields.
*/
export default function PaymentReceiveHeaderFields({}) {
export default function PaymentReceiveHeaderFields() {
// Payment receive form context.
const { customers, accounts, projects, isNewMode } =
usePaymentReceiveFormContext();