Skip to content

Conversation

@fpigeonjr
Copy link
Contributor

@fpigeonjr fpigeonjr commented Jan 7, 2026

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 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 getProcurementShopSubTotal with a simpler feesForCards function that sums pre-calculated fees from budget lines
  • Updated BLIRow.jsx to calculate budgetLineTotalPlusFees as amount + fees instead of using the total property
  • Updated Cypress test to verify that totals update correctly after editing and duplicating budget lines

Issue

How to test

  • review 4825

Definition of Done Checklist

  • OESA: Code refactored for clarity
  • OESA: Dependency rules followed
  • Automated unit tests updated and passed
  • Automated integration tests updated and passed
  • Automated quality tests updated and passed
  • Automated load tests updated and passed
  • Automated a11y tests updated and passed
  • Automated security tests updated and passed
  • 90%+ Code coverage achieved
  • [-] Form validations updated

backend does not keep up with user changes
@fpigeonjr fpigeonjr self-assigned this Jan 7, 2026
Copy link
Contributor

Copilot AI left a 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 getProcurementShopSubTotal with a simpler feesForCards function that sums pre-calculated fees from budget lines
  • Updated BLIRow.jsx to calculate budgetLineTotalPlusFees as amount + fees instead of using the total property
  • 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.

@fpigeonjr fpigeonjr marked this pull request as ready for review January 7, 2026 22:13
@fpigeonjr fpigeonjr merged commit 47a30a5 into main Jan 9, 2026
52 checks passed
@fpigeonjr fpigeonjr deleted the OPS-4825/bli-total-bug branch January 9, 2026 01:17
@github-actions
Copy link

github-actions bot commented Jan 9, 2026

🎉 This PR is included in version 1.253.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ui: when updating an BLI amount the total does not update

3 participants