-
Notifications
You must be signed in to change notification settings - Fork 7
fix: BLI total bug #4826
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
fix: BLI total bug #4826
Conversation
backend does not keep up with user changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes a bug in the Budget Line Item (BLI) total calculation. The main issue was that the component was using a pre-calculated total property from the backend instead of calculating it dynamically from amount + fees, which caused display inconsistencies when budget lines were edited before saving.
Key changes:
- Replaced
getProcurementShopSubTotalwith a simplerfeesForCardsfunction that sums pre-calculated fees from budget lines - Updated
BLIRow.jsxto calculatebudgetLineTotalPlusFeesasamount + feesinstead of using thetotalproperty - Updated Cypress test to verify that totals update correctly after editing and duplicating budget lines
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| frontend/src/components/BudgetLineItems/CreateBLIsAndSCs/CreateBLIsAndSCs.hooks.js | Removed getProcurementShopSubTotal import, added feesForCards function to calculate total fees by summing pre-calculated fees from budget lines, reorganized imports alphabetically, and fixed indentation |
| frontend/src/components/BudgetLineItems/BudgetLinesTable/BLIRow.jsx | Changed calculation of budgetLineTotalPlusFees from using budgetLine?.total to calculating (budgetLine?.amount ?? 0) + budgetLine?.fees |
| frontend/cypress/e2e/createAgreement.cy.js | Added test steps to verify that editing a budget line amount updates the total correctly, and updated expected value after duplication from $2M to $4M |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
frontend/src/components/BudgetLineItems/BudgetLinesTable/BLIRow.jsx
Outdated
Show resolved
Hide resolved
|
🎉 This PR is included in version 1.253.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
What changed
This PR fixes a bug in the Budget Line Item (BLI) total calculation. The main issue was that the component was using a pre-calculated
totalproperty from the backend instead of calculating it dynamically fromamount + fees, which caused display inconsistencies when budget lines were edited before saving.Key changes:
getProcurementShopSubTotalwith a simplerfeesForCardsfunction that sums pre-calculated fees from budget linesBLIRow.jsxto calculatebudgetLineTotalPlusFeesasamount + feesinstead of using thetotalpropertyIssue
How to test
Definition of Done Checklist