Skip to content

Fix resolved loans blocking preparation count updates#7829

Open
acwhite211 wants to merge 1 commit intomainfrom
issue-7625
Open

Fix resolved loans blocking preparation count updates#7829
acwhite211 wants to merge 1 commit intomainfrom
issue-7625

Conversation

@acwhite211
Copy link
Member

@acwhite211 acwhite211 commented Mar 19, 2026

Fixes #7625

The preparation count validator was counting historical resolved loans as if they were still active. This change updates the front-end check to only block decreases when there is unresolved quantity still on loan.

Checklist

  • Self-review the PR after opening it to make sure the changes look good and
    self-explanatory (or properly documented)
  • Add relevant issue to release milestone
  • Add pr to documentation list

Testing instructions

  • Create a preparation with count 3.
  • Add that preparation to a loan with quantity 3.
  • Return and resolve all 3 items on the loan.
  • Open the preparation again.
  • Change the preparation count from 3 to 1.
  • Save the record.
  • Confirm the save succeeds and the "The preparation is used in a loan." error does not appear.
  • Reopen the same preparation and confirm the new count is still 1.

@github-project-automation github-project-automation bot moved this to 📋Back Log in General Tester Board Mar 19, 2026
@acwhite211 acwhite211 added this to the 7.12.1 milestone Mar 19, 2026
@acwhite211 acwhite211 requested review from a team March 19, 2026 16:44
@CarolineDenis CarolineDenis requested a review from alesan99 March 19, 2026 17:42
Copy link
Collaborator

@emenslin emenslin left a comment

Choose a reason for hiding this comment

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

  • Confirm the save succeeds and the "The preparation is used in a loan." error does not appear.
  • Reopen the same preparation and confirm the new count is still 1.

Looks good!

@emenslin emenslin requested a review from a team March 23, 2026 14:59
Copy link
Collaborator

@bhumikaguptaa bhumikaguptaa left a comment

Choose a reason for hiding this comment

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

  • Confirm the save succeeds and the "The preparation is used in a loan." error does not appear.
  • Reopen the same preparation and confirm the new count is still 1.

--
Works as expected.

Image

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

Labels

None yet

Projects

Status: 📋Back Log

Development

Successfully merging this pull request may close these issues.

Cannot reduce Preparation count even if all associated Loans are returned/resolved

4 participants