Bug 22788 - Wrong accruing Overdue Amount
Summary: Wrong accruing Overdue Amount
Status: RESOLVED INVALID
Alias: None
Product: Koha
Classification: Unclassified
Component: Fines and fees (show other bugs)
Version: 18.11
Hardware: All All
: P1 - high enhancement (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-04-26 17:54 UTC by hienpn
Modified: 2023-09-23 22:24 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Accruing fine amount (142.19 KB, image/jpeg)
2019-04-26 17:54 UTC, hienpn
Details
Checkout transaction (111.63 KB, image/jpeg)
2019-04-26 17:55 UTC, hienpn
Details

Note You need to log in before you can comment on or make changes to this bug.
Description hienpn 2019-04-26 17:54:03 UTC
Created attachment 88951 [details]
Accruing fine amount

Hi All,

I found an issue with fine function on koha 18.11.02. Please help to check.

When the item is overdue, koha run fines.pl cronjob and update accruing fine to patron account. But i think something wrong when koha run fines.pl cronjob to update accruing fine.

Example: I checked out two barcode for one patron account. The barcodes have the same item type, checkout from same location and same time.

System configuration:
- CalculateFinesOnReturn option is "Do"
- finesMode is "Calculate and charge"
- Loan period: 21 days
- Fine amount: RM0.5/day
- Overdue fines cap (amount): RM40

I checked out item on January 06, 2019 and item overdue on January 27, 2019. By circulation rule, patron has RM40 accruing fine in his account for one overdue item. But when i check accruing fine of patron, i see accruing fine incorrectly and timestamp of action is not today. The attached file is screenshot of this issue. 

Besides, this issue don't happen with all patron account in koha. Please help to check this
Comment 1 hienpn 2019-04-26 17:55:07 UTC
Created attachment 88952 [details]
Checkout transaction
Comment 2 Nick Clemens 2019-10-24 12:41:43 UTC
(In reply to hienpn from comment #0)
> Created attachment 88951 [details]
> Accruing fine amount
> 
> Hi All,
> 
> I found an issue with fine function on koha 18.11.02. Please help to check.
> 
> When the item is overdue, koha run fines.pl cronjob and update accruing fine
> to patron account. But i think something wrong when koha run fines.pl
> cronjob to update accruing fine.
> 
> Example: I checked out two barcode for one patron account. The barcodes have
> the same item type, checkout from same location and same time.
> 
> System configuration:
> - CalculateFinesOnReturn option is "Do"
> - finesMode is "Calculate and charge"
> - Loan period: 21 days
> - Fine amount: RM0.5/day
> - Overdue fines cap (amount): RM40
> 
> I checked out item on January 06, 2019 and item overdue on January 27, 2019.
> By circulation rule, patron has RM40 accruing fine in his account for one
> overdue item. But when i check accruing fine of patron, i see accruing fine
> incorrectly and timestamp of action is not today. The attached file is
> screenshot of this issue. 
> 
> Besides, this issue don't happen with all patron account in koha. Please
> help to check this

Do you have the MaxFine system preference set?  From what I see it looks like the patron had 66 dollars in fines existing, then got accrued up to a $100 limit.

Did you also check all libraries for other rules? it looks like the fine is being consistently capped at $33.

I cannot recreate the miscalculation, if it is only happening for certain categories I would suspect there is a rule applying that you did not expect
Comment 3 Martin Renvoize 2019-12-04 08:08:51 UTC
I agree with Nick, this is almost certainly MaxFine coming into play.

Overdues will work through overdue items one by one calculating and updating the fine for each one.  Part of that calculation is to look at all pre-existing fines on he users account (including any added within this loop) and sum the amountoutstandings to ensure we're not going to exceed the MaxFine cap when adding this fines next increment.

As nick has said, it look like you have a MaxFine of 100 set. So, when the overdues job looped over the first item it calculated a fine of 33 and added it unscathed. However, when it hit the second item it calculated a fine of 33, then compared the total outstanding (33 + 33 + 33 = 99) to the would be total outstanding if it added the full fine was added here (99 + 33 = 132) and spotted that it would exceed the MaxFine of 100.. As such it reduced the increment to $1 instead of $33.
Comment 4 Katrin Fischer 2023-09-23 22:24:56 UTC
I also vote MaxFine.