fix(webapp): auto-increment estimate transactions

This commit is contained in:
a.bouhuolia
2023-05-25 22:04:21 +02:00
parent aaceea5338
commit e92c4486aa
7 changed files with 48 additions and 18 deletions

View File

@@ -56,13 +56,13 @@ export const EstimateIncrementSyncSettingsToForm = R.compose(
const { setFieldValue } = useFormikContext();
useUpdateEffect(() => {
// Do not update if the estimate auto-increment mode is disabled.
if (!estimateAutoIncrement) return null;
const estimateNo = transactionNumber(
estimateNumberPrefix,
estimateNextNumber,
setFieldValue(
'estimate_number',
transactionNumber(estimateNumberPrefix, estimateNextNumber),
);
setFieldValue('estimate_number', estimateNo);
}, [
setFieldValue,
estimateNumberPrefix,