Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PSP-8746 | GST is modifiable for periods #4227

Merged
merged 6 commits into from
Jul 26, 2024

Conversation

FuriousLlama
Copy link
Collaborator

No description provided.

@FuriousLlama FuriousLlama added the enhancement New feature or request label Jul 24, 2024
@FuriousLlama FuriousLlama self-assigned this Jul 24, 2024
Copy link
Contributor

✅ No secrets were detected in the code.

1 similar comment
Copy link
Contributor

✅ No secrets were detected in the code.

Copy link
Contributor

✅ No secrets were detected in the code.

Copy link
Contributor

✅ No secrets were detected in the code.

Comment on lines 79 to 83
if (values === true) {
const gstDecimal = gstConstant !== undefined ? parseFloat(gstConstant.value) : undefined;
const calculated = round((formikState.values.paymentAmount as number) * (gstDecimal / 100));
formikState.setFieldValue('gstAmount', calculated);
} else {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a code path here where gstDecimal is undefined (when the GST constant is not defined).
I'm not sure what would be the result of line 81 would be in this case; ie: calculated = round(... * (undefined/100))

Would it make sense to put a check here for that case?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fair point. I added a better default value

Comment on lines 36 to 40
if (values === true) {
const gstDecimal = gstConstant !== undefined ? parseFloat(gstConstant.value) : undefined;
const calculated = round(
(getIn(formikProps.values, paymentAmountField) as number) * (gstDecimal / 100),
);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment here re: gstDecimal being undefined

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

Copy link
Contributor

✅ No secrets were detected in the code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants