Uploaded image for project: 'mod-circulation'
  1. mod-circulation
  2. CIRC-524

(1-OD-B-2) Calculate overdue fine using Overdue Fine Policy

    XMLWordPrintable

Details

    • EPAM-Veg Sprint 31, EPAM-Veg Sprint 32, EPAM-Veg Sprint 33, EPAM-Veg Sprint 34, EPAM-Veg Sprint 35
    • 8
    • Vega

    Description

      To see how this JIRA issue integrates with the other overdue fine JIRA issues please see the diagram at https://drive.google.com/file/d/1uzezgYpgZ8XiSmSdqC2fntda1HomjbP-/view?usp=sharing

      OVERVIEW

      Purpose: Module that will calculate and bill overdue fines when items are returned late (UIU-1147) or renewed after they are already overdue (UIU-1157). Post-MVP this module will also be called for the calculation of pending fees/fines UXPROD-392.

      Assumptions: This module has been called AFTER the item has already been deemed to be returned/renewed after its due date and an Overdue Fine Policy has been proven to exist. In the case of renewed items, the Overdue Fine Policy field Forgive overdue fine if item renewed has been check and it is set to "No."

      Inputs:
      Loan record (used to calculate Overdue Fine)

      • Due date (used by process called to find overdue minutes)
      • Check in service point (used to set Create at in Fee/Fine Action record
      • Loan policy (used by process called to find overdue minutes)
      • Overdue fine policy (used by process called to find overdue minutes; will be added; see attached screen mock-up Automated Overdue Fines - Loan Details Changes.png)
      • dueDateChangedByRecall (used by process called to find overdue minutes; this is an existing back-end flag that is not displayed in the UI)

      Loan Policy record (used to calculate Overdue Fine)

      • Grace period (used by process called to find overdue minutes)
      • Loan period (used by process called to find overdue minutes)

      Overdue Fine Policy record (used to calculate Overdue Fine)

      • Overdue fine
      • Count closed days/hours/minutes (used by process called to find overdue minutes)
      • Maximum overdue fine
      • Overdue recall fine
      • Ignore grace periods for recalls (used by process called to find overdue minutes)
      • Maximum recall overdue fine

      Library Calendar at Settings>Calendar, to see when library is opened/closed, for libraries that only include open time in overdue calculation (used by process called to find overdue minutes)

      Result from process Calculate intervals between due-date and returned/renewed-date (CIRC-548)

      • overdueMinutes

      Item record (used to find Fee/Fine Owner)

      • Effective location for item

      Fee/fee owner settings (used to find Fee/Fine Owner)

      • Fee/fine owner

      Organization settings (used to find Fee/Fine Owner)

      • Location
      • Service Point

      Outputs:
      See BILLING section below

      Processing Considerations:

      • Does library have a grace period? (A grace period is a short period of time after the due date during with the library allows the item to be returned with charging an overdue fine.)
      • Does library count closed days? (Libraries may elect to include the minutes/hours/days they are closed as part of the overdue calculation. If they don't, the library's calendar must be used to determine if/when the library was opened for each day the item was overdue.)
      • Is returned item the result of a recall? (Items that are requested by other patrons while they are checked out are called recalls. The patron who currently has the item checked out is given a certain amount of time to return the book. The institution may ignore the grace period for a recalled item.)

      Calculation examples: See attached file Overdue Fine Calculation Examples.zip for many different calculation examples.

      CALCULATION

      Important Note

      The smallest allowable interval is minutes, so the best approach is to convert everything to minutes for the calculations, then convert back to hours, days, weeks or month as needed.

      STEP #1: Calculate intervals between due-date and returned/renewed-date

      • Call process created by CIRC-548 (Calculate intervals between due-date and returned/renewed-date) to obtain overdueMinutes

      STEP #2: Determine what additional processing, if any, is appropriate

      • If overdueMinutes = 0
        • Exit this process because the patron does not owe an overdue fine for this item (they returned the item within the grace period)
      • Else
        • If *dueDateChangedByRecall = "true"
          • Go to SECTION B: PROCESS RECALL
        • Else
          • Go to SECTION A: PROCESS NON-RECALL

      SECTION A: PROCESS NON-RECALL (dueDateChangedByRecall = "false" or blank)
      STEP #3: Convert overdueMinutes to the interval used by Overdue fine (from the Overdue Fine Policy record)

      • If Overdue fine interval = Hour(s)
        • overdueInterval = overdueMinutes / 60, rounded up to next highest hour
      • Else If Overdue fine interval = Day(s)
        • overdueInterval = overdueMinutes / 1440, rounded up to next highest hour
      • Else If Overdue fine interval = Week(s)
        • overdueInterval = overdueMinutes / 10080, rounded up to next highest week
      • Else If Overdue fine interval = Month(s)
        • overdueInterval = overdueMinutes / 44640, rounded up to next highest month
      • Else
        • overdueInterval = overdueMinutes
      Example

      If a book is overdue 7,886 minutes, and the Overdue fine interval for the book is Day(s), we would need to divide 7,886 by 1,440, which is 5.48. We would not charge for 5.48 days (which is 5 days plus a partial day) or round down to 5 days, but rather we would round up to 6 days. The patron did not return the book on the 5th day so it is 6 days overdue. It is not very likely that an Week(s) or Month(s), but we must allow for it.

      STEP #4: Determine the overdue fine

      • Billed amount = Overdue fine (from the Overdue Fine Policy record) * overdueInterval (calculated in STEP #3 above)

      STEP #5: If the overdue fine is over the maximum allowed, reduce it to the maximum

      • If Overdue Fine Policy field Maximum overdue fine > 0
        • If Billed amount ((calculated in STEP #4 above)) > Overdue Fine Policy field Maximum overdue fine
          • Set Billed amount = Overdue Fine Policy field Maximum overdue fine
        • Else
          • Leave Billed amount as is
      • Else
        • Leave Billed amount as is

      STEP #6: Create fee/fine record, display checkin page message and trigger notice

      • Go to BILLING

      SECTION B: PROCESS RECALL (dueDateChangedByRecall = "true")
      STEP #3: Convert overdueMinutes to the interval used by Recall overdue fine (from the Overdue Fine Policy record)

      • If Recall overdue fine interval = Hour(s)
        • overdueInterval = overdueMinutes / 60, rounded up to next highest hour
      • Else If Recall overdue fine interval = Day(s)
        • overdueInterval = overdueMinutes / 1440, rounded up to next highest hour
      • Else If Recall overdue fine interval = Week(s)
        • overdueInterval = overdueMinutes / 10080, rounded up to next highest week
      • Else If Recall overdue fine interval = Month(s)
        • overdueInterval = overdueMinutes / 44640, rounded up to next highest month
      • Else
        • overdueInterval = overdueMinutes
      Example

      If a recalled book is overdue 7,886 minutes, and the Recall overdue fine interval for the book is Day(s), we would need to divide 7,886 by 1,440, which is 5.48. We would not charge for 5.48 days (which is 5 days plus a partial day) or round down to 5 days, but rather we would round up to 6 days. The patron did not return the book on the 5th day so it is 6 days overdue. It is not very likely that an Week(s) or Month(s), but we must allow for it.

      STEP #4: Determine the overdue fine

      • Billed amount = Recall overdue fine (from the Overdue Fine Policy record) * overdueInterval (calculated in STEP #3 above)

      STEP #5: If the overdue fine is over the maximum allowed, reduce it to the maximum

      • If Overdue Fine Policy field Maximum recall overdue fine > 0
        • If Billed amount (calculated in STEP #4 above) > Overdue Fine Policy field Maximum recall overdue fine
          • Set Billed amount = Overdue Fine Policy field Maximum recall overdue fine
        • Else
          • Leave Billed amount as is
      • Else
        • Leave Billed amount as is

      STEP #6: Create fee/fine record, display checkin page message and trigger notice

      • Go to BILLING

      BILLING

      Create a fee/fine record:
      Save the overdue fine in the same manner as manual fees/fines are saved (as shown in the attached screen print Overdue-FF-Details.JPG)
      Please note that changes to Fee/Fine Details will be made by UIU-1247

      • Fee/fine type = "Overdue fine"
      • Fee/fine owner = Use Effective location of item to find Service point within Organization settings, then use Service Point in Fee/Fine Owners settings to find associated Fee/fine owner
      • Billed date = System date and time
      • Billed amount = calculated overdue fine or recall overdue fine (depending on the situation) from STEP #4 above
      • Remaining amount = calculated overdue fine or recall overdue fine (depending on the situation) from STEP #4 above
      • Payment status = "Outstanding"
      • Loan details = link to loan record
      • Overdue policy = Overdue fine policy link from Loan record
      • Lost item policy = Lost item fee policy link from Loan record
      • Action date = System date and time
      • Action = "Overdue fine"
      • Amount = Billed amount from STEP #4 above
      • Balance = Billed amount from STEP #4 above
      • Transaction information = blank
      • Created at = Check in service point
      • Source should be "System"
      • Additional information = blank

      Send a patron notice:
      Sending the notice is out scope for this user story...

      TestRail: Results

        Attachments

          1. Adding-Automated-FF-to-Manual-Charges-Table.jpg
            Adding-Automated-FF-to-Manual-Charges-Table.jpg
            364 kB
          2. Automated Overdue Fines - Loan Details Changes.png
            Automated Overdue Fines - Loan Details Changes.png
            275 kB
          3. Checkin-Page-Changes.jpg
            Checkin-Page-Changes.jpg
            126 kB
          4. CIRC-524_Test_Plan.xlsx
            21 kB
          5. Loan-Details.JPG
            Loan-Details.JPG
            122 kB
          6. Loan-Policy.JPG
            Loan-Policy.JPG
            49 kB
          7. Overdue-FF-Details.JPG
            Overdue-FF-Details.JPG
            157 kB
          8. Overdue Fine Calculation Examples.zip
            1.12 MB
          9. Overdue-fine-policy.JPG
            Overdue-fine-policy.JPG
            46 kB
          10. screenshot-1.png
            screenshot-1.png
            101 kB
          11. screenshot-2.png
            screenshot-2.png
            101 kB
          12. Screen Shot 2020-01-27 at 13.17.56.png
            Screen Shot 2020-01-27 at 13.17.56.png
            127 kB

          Issue Links

            Activity

              People

                oleksandrkurash Alexander Kurash
                hollyolepm Holly Mistlebauer
                Holly Mistlebauer Holly Mistlebauer
                Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  TestRail: Runs

                    TestRail: Cases