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

BTHAMM-31: Set sales order line items from backend #1033

Merged
merged 1 commit into from
Aug 19, 2024

Conversation

olayiwola-compucorp
Copy link

@olayiwola-compucorp olayiwola-compucorp commented Aug 16, 2024

Overview

This PR set the sales order line items from the backend using PHP, instead of the frontend which was causing issues with the total amount displaying incorrect values.

Previously:
We pass the user-supplied percentage to the frontend JavaScript and perform the necessary computations there. However, this approach is causing conflicts with other extensions, such as finance-extras (due to changes in the contribution form) and lineitemedit, which also modify line items.

In this PR:
We perform all percentage computations on the backend and prepopulate the form items using the altercontent hook.

Before

The total amount value resets to zero when the financial type or any value changes on the form.
111qqqqqqqqwewew

After

The total amount always display the correct value
qwewew

@olayiwola-compucorp olayiwola-compucorp merged commit 431cb63 into 4.2.0-dev Aug 19, 2024
2 checks passed
@olayiwola-compucorp olayiwola-compucorp deleted the BTHAMM-31-correct-qot branch August 19, 2024 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants