Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 3.0.0, 3.4.4, 3.5.0-b5
-
Fix Version/s: 3.5.0
-
Component/s: None
-
Labels:None
Description
CORE-1706 fixed an issue with over applying transaction amounts. By doing so, it increased the likelyhood of encountering a floating point precision error related to applying credits, similar to CORE-629.
An example is a credit amount of "0.0101" and an invoice it is paying for "0.0101". The values equate, but the floating point precision error causes them to be evaluated as if they do not.
The floating point precision error should be resolved so that applying legitimate credits do not fail due to error: "One or more Amount to Pay values could not be applied to the specified invoice. Ensure that the Amount to Pay does not exceed the Amount Due on the invoice, that the invoice is open, and the sum of the Amount to Pay values do not exceed the Payment or Credit Amount."
Issue Links
- relates to
-
CORE-1706 Invoice amounts can be applied in excess of the transaction amount
- Closed
Activity
Link | This issue relates to CORE-629 [ CORE-629 ] |
Status | Open [ 1 ] | Resolved [ 5 ] |
Resolution | Fixed [ 1 ] |
Description |
The floating point precision error should be resolved so that applying legitimate credits do not fail due to error: "One or more Amount to Pay values could not be applied to the specified invoice. Ensure that the Amount to Pay does not exceed the Amount Due on the invoice, that the invoice is open, and the sum of the Amount to Pay values do not exceed the Payment or Credit Amount." |
An example is a credit amount of "0.0101" and an invoice it is paying for "0.0101". The values equate, but the floating point precision error causes them to be evaluated as if they do not. The floating point precision error should be resolved so that applying legitimate credits do not fail due to error: "One or more Amount to Pay values could not be applied to the specified invoice. Ensure that the Amount to Pay does not exceed the Amount Due on the invoice, that the invoice is open, and the sum of the Amount to Pay values do not exceed the Payment or Credit Amount." |
Status | Resolved [ 5 ] | Closed [ 6 ] |
To fix yourself:
Open /app/models/transactions.php
Find the following line:
if ($total !== null && $total < $apply_total)
Update it to:
if ($total !== null && round($total, 4) < round($apply_total, 4))
Save the changes.