100% of total calculation is different on FE and BE

Description

Overview: When using only dollar amount distributions the system doesn't acknowledge that all cost in accounted for and order will not open

Steps to Reproduce:

  1. Log into some FOLIO environment as User X

  2. Create order

  3. Add order line with cost of $90

  4. Add 3 fund distributions using percentage

  5. Each Fund 33.33%

  6. Save POL

  7. Click action menu for order

  8. Click Open

Expected Results: Order is opened and encumbered successfully. Three encumbrances, 1 for each fund for $30

 
Actual Results: Order fails to open. error shown "Fund distribution total must add to 100% or totalPrice"

Approach
Update : org.folio.orders.utils.FundDistributionUtils#validateFundDistributionTotal

Additional Information: This was found in bugfest lotus release.

URL:

Interested parties:

CSP Request Details

None

CSP Rejection Details

None

Potential Workaround

Use a dollar amount for at least one of your fund distributions such that the system will not encounter a rounding error. ie. for $90 use 33.33%, 33.33% and $33.34. This ensures the total after rounding up or down is in fact $90 and not $89.991 resulting in 1 penny missing.

Attachments

10

Checklist

hide

TestRail: Results

Activity

Show:

Dennis Bridges August 8, 2022 at 5:25 PM

Test successful in bugfest-mg

Oleksii Petrenko July 27, 2022 at 9:34 PM

Deployed to MG bugfest. Please verify

Dennis Bridges July 22, 2022 at 9:10 PM

Test successful in folio-snapshot-2.

Yury Saukou July 22, 2022 at 2:32 PM

Tested on snapshot 2 (https://folio-snapshot-2.dev.folio.org/)

Review it please, thx!

Dennis Bridges June 1, 2022 at 10:03 PM

Ah yes  I see what you mean. There is once again a problem on the UI when adding 3 Fund distributions for 33.33% for an amount of $90. This does need to be fixed in the validation because the user actually can see what is wrong.

I thought in past we distributed the "extra penny" automatically for the user? Perhaps not when all are percentages. However, the ui should either show what is missing or add what is missing to the distribution automatically so that users don't get a confusing error. 

Done

Details

Assignee

Reporter

Tester Assignee

Priority

Story Points

Sprint

Development Team

Thunderjet

Fix versions

Release

Morning Glory (R2 2022) Bug Fix

RCA Group

Legitimate regression

Affected Institution

!!!ALL!!!

TestRail: Cases

Open TestRail: Cases

TestRail: Runs

Open TestRail: Runs
Created March 31, 2022 at 3:02 PM
Updated August 8, 2022 at 5:25 PM
Resolved July 22, 2022 at 9:10 PM
TestRail: Cases
TestRail: Runs