overpaying with patron credit can generate a double credit
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Evergreen |
Fix Released
|
Undecided
|
Dan Wells |
Bug Description
If you overpay a bill with 'Payment Type' of 'Patron Credit', but also have the 'Convert Change to Patron Credit' option turned on, you will get a double credit for the overage, as it is passed in as the 'patron_credit' option, then the overage is applied to the credit inside the function as well. For example:
Bill - $1
Patron Credit Payment - $3
results in:
request open-ils.circ open-ils.
Which works out to:
$2 (passed in credit, $3 payment - $1 bill)
-$1 (payment)
= net $1 of credit
Ultimately, the interface should probably not be generating "change" for patron credit payments at all, so the patron_credit for any credit payment should always be zero. It is tempting to simply zero-out any patron_credit for credit payments, but ultimately we cannot always know where that number came from.
Changed in evergreen: | |
status: | New → Fix Committed |
assignee: | nobody → Dan Wells (dbw2) |
Changed in evergreen: | |
status: | Fix Committed → Fix Released |
If we want to allow for cash refunds of patron credit, instead of sending a zero amount for patron_credit, we could always ensure we send the full payment amount. The key is to inform the server in some accurate way of the actual credit being "used", as we do not receive this from the patron, but rather retrieve it from their account.