Overdue Notice Enhancement

From Koha Wiki
Jump to navigation Jump to search

This development is sponsored by the Halland County Library in Sweden. Their goals are to :

  • manage a reminder fee when a reminder is sent
  • manage different reminder delays depending on whether the item is reserved or not, and is free of charge or has a rental fee.

This work will be based on a previous development inLibro did to manage invoices and fixed costs that goes along (http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11092) . We will re-work it for a better integration.

The requirements were thought to comply Halland County Library needs but also to be flexible and fulfil different settings. We also paid attention to keep Koha's behaviour, so libraries can keep their original set up if they doesn't need these new features.

To sum it up, the purpose of this development is to :

  • improve the management of the replacement cost and manage fixed costs for each item lost (processing fee)
  • manage a fee for each reminder sent
  • create new tags to manage fees/fines within the notice template tool
  • manage more than 3 notification levels
  • enhance the notice triggers tools with two new options : item type and on-hold status

We cut out the development in 5 features independant from each other. It will help the testing and the upstream to Koha main.

Replacement cost and processing fee management

Status: unknown
Sponsored by: Halland County Library
Developed by: inLibro
Expected for: unknown
Bug number: Bug 12768
Work in progress repository: No URL given.
Description: A default replacement cost and a processing fee will be added to the item type page. The input form and the table that displays all iten types will have these two new field/column :
  • "Default replacement cost"
  • "Processing fee (When lost)"

Item type cost fee.png

Two system preferences will be added.

  • "UseDefaultReplacementCost" to enable the use of the value set on the item type level.
  • "ProcessingFeeNote" to set the value that will populate the note in the table "accountlines" when the processing fee are applied.

These elements will be used as follows :

When the "longoverdue.pl" script is run or when an item is marked "Lost" (the value in items.itemlost> 0) :

If "UseDefaultReplacementCost" is enabled and the items.replacementcost = 0 :

  • The value of "Default replacement cost" set up in the itemtype populate the "accountlines" table.
  • If the value of "Processing fee (When lost)" is > 0, it is also used to populate the table "accountlines." The value in the system preference "ProcessingFeeNote" is used to update the note in accountlines for this item. Otherwise, no processing fees are added.

If "UseDefaultReplacementCost" is enabled and the value in items.replacementcost> 0

  • The default koha behavior is used. The value in items.replacementcost populate the "accountlines" table.
  • If the value of "Processing fee (When lost)" defined in the document type is > 0, it is also used to populate the table "accountlines." The value in the system preference "ProcessingFeeNote" is used to update the note in accountlines for this item. Otherwise, no processing fees are added.

If "UseDefaultReplacementCost" is disabled :

  • The default koha behavior is used.
  • If the value of "Processing fee (When lost)" defined in the document type is > 0, it is also used to populate the "accountlines" table. The value in the system preference "ProcessingFeeNote" is used to update the note in accountlines for this item. Otherwise, no processing fees are added.


Notice fee management

Status: unknown
Sponsored by: Halland County Library
Developed by: inLibro
Expected for: unknown
Bug number: Bug 12769
Work in progress repository: No URL given.
Description: Two new system preferences will be added :
  • "DefaultNoticeFee" to set up how much cost the sending of a notice.
  • "NoticeFeeNote" to set up the value which will populate the note in the "accountlines" table.

On top of the system preference "DefaultNoticeFee", we will add a new field within the notice template tool where a librarian could set up a different fee, specific to the notice. By default, this field will be populated by the default system preference value. One could empty it or change it.

This way, libraries can apply different fees depending on the type of notice they send.

Mock-up :

Notice fee.png


Notice template tool enhancement (to display fees, fines, total, etc. and create invoices)

Status: unknown
Sponsored by: Halland County Library
Developed by: inLibro
Expected for: unknown
Bug number: Bug 12770
Work in progress repository: No URL given.
Description: The invoice will be set up as a notice in the « Notices & slips » tool. Three new tags will display the amounts charged to the patron for a specific item :
  • <itemaccountlines>
  • <noticefee>
  • <total>

<itemaccountlines> will display the note and the outstanding amount for a specific item. The values will come from the accountlines table (the values available in the « fines » tab from the patron account page). Before being inserted in the invoice, the information will be sorted by date. Only the daily fees will be displayed. The old fees will be put aside.

<itemaccountlines> will be used along with the <item> tag.

<itemaccountlines> is different from <fines> because it works with <item> tag. Set up together, they will build a table which will display for each item: the bibliographic information, the note from the accountlines table and the outstanding amount. See mock-up below.

Example : <item>biblio.title, biblio.author, items.barcode <itemaccountlines> </item>

<noticefee> will add the notice fee to the invoice. To avoid having multiple « notice fee » lines if several invoices are sent the same day, the system will take the first found in the accountlines table.

<total> will calcute the total amount.

Below, a mock-up of the invoice for this example :

<item>biblio.title, biblio.author, items.barcode, item.itemcallnumber <itemaccountlines> </item> <noticefee> <total>

New tags.png


Enhancement to manage more than 3 levels of overdue notice

Status: unknown
Sponsored by: Halland County Library, Sweden (Region Halland, Regionbibliotek)
Developed by: inLibro
Expected for: unknown
Bug number: Bug 12771
Work in progress repository: No URL given.
Description: A new system preference will be added : "MaxNumberReminders".

It will set the maximum number of notifications the system can send. This preference will affect the number of tabs in the « Overdue notice/status triggers » tool.

Note : if the librarian changes the settings and reduce the number of reminders, the current trigger settings will be disabled and hidden but not deleted.

The requirements changed to take into consideration the suggestions we had on the koha-dev list. We are going to change the ergonomy of « Overdue notice/status triggers » tool. We will remove the tab sytem to have every rules in one page. The new ergonomy will look like what we have in the "circulation and fines rules" page.


Overdue Notice/Status triggers tool

Status: unknown
Sponsored by: Halland County Library, Sweden (Region Halland, Regionbibliotek)
Developed by: inLibro
Expected for: unknown
Bug number: Bug 12772
Work in progress repository: No URL given.
Description: The ergonomy of the notice triggers tool will be enhanced with two new parameters : the item type et the on-hold status.

We will re-use the ergonomy and the logic of the circulation rules model. The rules will apply from the more specific to the less specific. One will be able to set up a notice trigger for a specific patron catagory and a specific item type. A default value for the item types and the patron categories will be available to generalize the rules.

For a specific notice level, we will prevent the user to set up different delay for the same combination of options.

For each rule created, the new "on-hold" option will specify that the rule applies for the « on hold » items only.

Mock-up :

Triggers.png

These new features will allow for example :

  • to set up different rules for free of charge items or items with rental fee (since we can set up rules per item types).
  • to set up different rules for available item or "on hold" item.

For this example, there are 4 different options (paths) when the item is late :

The item is available / the item free of charge The item is availaibe / the item has rental fee The item is on hold / the item is free of charge The item is on hold / the item has rental fee

And the tool allows the librarian to set up different delays for each path.

There is one restriction to make sure the system is consistent. To explain this, here a schema which represents the different paths :

Overdue notice triggers example.png

It shows that the path are not interchangeable. If the late item takes the first path (no rental fee / available), it can't change its path even if its status changes because it will lead the system to some inconstancies.

For example, the item is free of charge and available after his due date. If it's not checked-in before two weeks, the first reminder will be sent. One week later, a patron put a hold on the item. The item can't switch from the first path to the second one. If so, the system will send the invoice a week after without having sent the two first reminders. To avoid this, the system will keep track of which path the item falls under. And no matter what would change, everyday, the system will check which reminders has to be sent and will send the letter according to this first chosen path.


Changings in the overdue_notices.pl script

1 How do I know which letter should be sent?

1.1 Current

The overdue_notice.pl script looks at the components of the rules in this order :

  • for each branch
    • for each rule of this branch
      • for each period (delay 1, 2, 3)
        • for every borrower who has a current loan
            • the script looks for a copy that meets the rule (-t) or a period (without -t).

1.2 Now

The overdue_notice.pl script will look at the issues in the database (table issues) and look if a rule applies.

It will test each components of the rule in this order :

  • Library branch
    • User Category
      • Item type
        • "Reserved" status
          • Delay
            • for every borrower who has a current loan
              • the script looks for a copy that meets the rule (-t) or a period (without -t).

The rules will apply from the most specific to the most general.

To help you to understand, you can ask yourself these questions :

Is there a rule for :

  • this library, this patron type, this item type, the « on-hold » status checked?

If not, is there a rule for :

  • this library, this patron type, this item type?

If not, is there a rule for :

  • this library, this patron type, all item types, the « on-hold » status checked ?

If not, is there a rule for :

  • this library, this patron type, all item types ?

If not, is there a rule for :

  • this library, all patron types, this item type, the « on-hold » status checked ?

If not, is there a rule for :

  • this library, all patron types, this item type ?

If not, is there a rule for :

  • this library, all patron types, all item types, the « on-hold » status checked ?

If not, is there a rule for :

  • this library, all patron types, all item types ?

If not, is there a rule for :

  • all libraries, this patron type, this item type, the « on-hold » status checked ?

If not, is there a rule for :

  • all libraries, this patron type, this item type ?

If not, is there a rule for :

  • all libraries, this patron type, all item types, the « on-hold » status checked ?

If not, is there a rule for :

  • all libraries, this patron type, all item types ?

If not, is there a rule for :

  • all libraries, all patron types, this item type, the « on-hold » status checked ?

If not, is there a rule for :

  • all libraries, all patron types, this item type ?

If not, is there a rule for :

  • all libraries, all patron types, all item types, the « on-hold » status checked ?

If not, is there a rule for :

  • all libraries, all patron types, all item types ?

Than, when the script find a rule that applies, it deals with the delay. The script compares the overdue delay with the rule's delay. If the overdue delay is equal or greater to the rule's delay, the issue is placed in the notification.

For the same user, overdue items will be grouped by letter code and branch.

2 How are the rules by library implemented?

2.1 Current

The tool "Overdue notice / status triggers" can define rules for a default library and rules for specific libraries.

The default rules and the specific rules are mutually exclusive. If a rule does not exist for a specific library, overdue notice does not look at the rule of the default library.

The rules of the default library match the rules that apply to all libraries EXCEPT if at least one rule is set up for a specific library. In this case, only the rules of that specific library apply.

2.2 Now

The overdue_notices.pl script looks at the rules from the more specific to the more general. If a rule does not exist for a specific library, the script will look at the rules for the default library. If a library wants to avoid this control, they will have to set up a "no notification" rule.

3 How does the script find on-hold items?

The script looks at the biblionumber to know whether the issue is on hold or not. This way, no matter what kind of hold the patron put on the item (the next available item or a specific item), the script will be able to retreive the hold.

However, if a library manage holds on specific items to allow users to put hold on specific serial issues, the script will not be able to apply different rules (“on-hold” rule or “not on-hold” rule) if a specific item is on hold or not. For example : On one specific serial title :

  • copy n3 is late.
  • a hold is placed on copy n4.
  • the script applies the “on-hold” rule because it relies on the biblionumber of the copy n4 which is the same of copy n3.

4 What happens when the script groups messages that have the same letter code but different transport types?

If at time “t”, we have an issue that matches a 7 days rule and another issue that match a 14 days rule. 1. The issues whose rules have the same letter code will be group together in the same notification. 2. The notifications that have the same transport types will be grouped as well.

For example:

  • Branch A / Item type A / User category A / 7 days / ODUE / Email
  • Branch A / Item type A / User category A / 14 days / ODUE / Email

Because the two rules have the same ODUE letter code, at time t, the script will group the issues that match these rules. Because both rules also have the same type of transportation (email), at time t, the script will send only one email.

Comments :

The issues will not be grouped if the rules that apply are rules for different libraries. The issues from the library A will be sent with the issues from the library A, the issues from the library B with those from the library B, etc.

Limitation :

When the invoice is generated, it is based on fines which have already been generated and the script only displays those. The script will check the date of entry into the database. So it is mandatory to run the fines.pl script just before running overdue_notices.pl the same day. Otherwise, the invoice will be empty. It only displays the today's entries .

Complete Overdue_notices.pl test plan

TEST THE PATRON HAS OVERDUE RULES (library / patron category / item type / on hold – delay – letter code) I SHOULD GET
classic rules 1 DVD from Midway (7 days late) * / * / * - 7j. - ODUE 1 ODUE letter from Midway
classic rules 1 DVD from Centerville (7 days late) * / * / * - 7j. - ODUE 1 ODUE letter from Centerville
classic rules 1 CD à Midway (7 days late) * / * / * - 7j. - ODUE 1 ODUE letter from Midway
classic rules 1 CD from Centerville (7 days late) * / * / * - 7j. - ODUE 1 ODUE letter from Centerville
classic rules 2 DVD from Midway (7 days late) * / * / * - 7j. - ODUE 1 ODUE letter from Midway
classic rules 1 DVD from Midway (7 days late) & 1 DVD from Centerville (7 days late) * / * / * - 7j. - ODUE 1 ODUE letter from Midway & 1 ODUE letter from Centerville
classic rules 1 DVD from Midway (7 days late) & 1 CD from Midway (7 days late) * / * / * - 7j. - ODUE 1 ODUE letter from Midway
classic rules 1 DVD from Midway (7 days late) & 1 CD from Centerville (7 days late) * / * / * - 7j. - ODUE 1 ODUE letter from Midway & 1 ODUE letter from Centerville
classic rules 1 DVD from Midway (7 days late) * / * / DVD – 7j. - ODUEDVD 1 ODUEDVD letter from Midway
classic rules 1 DVD from Centerville (7 days late) * / * / DVD – 7j. - ODUEDVD 1 ODUEDVD letter from Centerville
classic rules 1 CD from Midway (7 days late) * / * / DVD – 7j. - ODUEDVD 1 ODUE letter from Midway
classic rules 1 CD from Centerville (7 days late) * / * / DVD – 7j. - ODUEDVD 1 ODUE letter from Centerville
classic rules 2 DVD from Midway (7 days late) * / * / DVD – 7j. - ODUEDVD 1 ODUEDVD letter from Midway
classic rules 1 DVD from Midway (7 days late) & 1 DVD from Centerville (7 days late) * / * / DVD – 7j. - ODUEDVD 1 ODUEDVD letter from Midway & 1 ODUEDVD letter from Centerville
classic rules 1 DVD from Midway (7 days late) & 1 CD from Midway (7 days late) * / * / DVD – 7j. - ODUEDVD 1 ODUEDVD letter from Midway & 1 ODUE letter from Midway
classic rules 1 DVD from Midway (7 days late) & 1 CD from Centerville (7 days late) * / * / DVD – 7j. - ODUEDVD 1 ODUEDVD letter from Midway & 1 ODUE letter from Centerville
classic rules 1 DVD from Midway (7 days late) * / BOARD / DVD – 7j. ODUEBDVD 1 ODUEBDVD letter from Midway
classic rules 1 DVD from Centerville (7 days late) * / BOARD / DVD – 7j. ODUEBDVD 1 ODUEBDVD letter from Centerville
classic rules 1 CD from Midway (7 days late) * / BOARD / DVD – 7j. ODUEBDVD 1 ODUE letter from Midway
classic rules 1 CD from Centerville (7 days late) * / BOARD / DVD – 7j. ODUEBDVD 1 ODUE letter from Centerville
classic rules 2 DVD from Midway (7 days late) * / BOARD / DVD – 7j. ODUEBDVD 1 ODUEBDVD letter from Midway
classic rules 1 DVD from Midway (7 days late) & 1 DVD from Centerville (7 days late) * / BOARD / DVD – 7j. ODUEBDVD 1 ODUEBDVD letter from Midway & 1 ODUEBDVD letter from Centerville
classic rules 1 DVD from Midway (7 days late) & 1 CD from Midway (7 days late) * / BOARD / DVD – 7j. ODUEBDVD 1 ODUEBDVD letter from Midway & 1 ODUE letter from Midway
classic rules 1 DVD from Midway (7 days late) & 1 CD from Centerville (7 days late) * / BOARD / DVD – 7j. ODUEBDVD 1 ODUEBDVD letter from Midway & 1 ODUE letter from Centerville
classic rules 1 DVD from Midway (7 days late) MIDWAY / BOARD / DVD – 7j. ODUEMIDBDVD 1 ODUEMIDBDVD letter from Midway
classic rules 1 DVD from Centerville (7 days late) MIDWAY / BOARD / DVD – 7j. ODUEMIDBDVD 1 ODUEBDVD letter from Centerville
classic rules 1 CD from Midway (7 days late) MIDWAY / BOARD / DVD – 7j. ODUEMIDBDVD 1 ODUE letter from Midway
classic rules 1 CD from Centerville (7 days late) MIDWAY / BOARD / DVD – 7j. ODUEMIDBDVD 1 ODUE letter from Centerville
classic rules 2 DVD from Midway (7 days late) MIDWAY / BOARD / DVD – 7j. ODUEMIDBDVD 1 ODUEMIDBDVD letter from Midway
classic rules 1 DVD from Midway (7 days late) & 1 DVD from Centerville (7 days late) MIDWAY / BOARD / DVD – 7j. ODUEMIDBDVD 1 ODUEMIDBDVD letter from Midway & 1 ODUEBDVD letter from Centerville
classic rules 1 DVD from Midway (7 days late) & 1 CD from Midway (7 days late) MIDWAY / BOARD / DVD – 7j. ODUEMIDBDVD 1 ODUEMIDBDVD letter from Midway & 1 ODUE letter from Midway
classic rules 1 DVD from Midway (7 days late) & 1 CD from Centerville (7 days late) MIDWAY / BOARD / DVD – 7j. ODUEMIDBDVD 1 ODUEMIDBDVD letter from Midway & 1 ODUE letter from Centerville
letter merging 1 DVD from Midway (7 days late) & 1 CD from Midway (7 days late)& 1 DVD from Centerville (7 days late) Midway / * / DVD – 7j – ODUE & Midway / * / CD – 7j – ODUE & Centerville / * / DVD – 7j – ODUE 1 letter from Midway & 1 letter from Centerville
letter merging 1 DVD from Midway (7 days late) & 1 CD from Midway (7 days late) & 1 DVD from Centerville (7 days late) Midway / * / DVD – 7j – ODUE & Midway / * / CD – 7j – ODUECD & Centerville / * / DVD – 7j – ODUE 1 letter for the DVD from Midway & 1 letter for the CD from Midway & 1 letter for the DVD from Centerville
letter merging 1 DVD from Midway (7 days late) & 1 CD from Midway (14 days late) & 1 DVD from Centerville (7 days late) Midway / * / DVD – 7j – ODUE & Midway / * / CD – 7j – ODUE & Midway / * / CD – 14j – ODUE & Centerville / * / DVD – 7j – ODUE 1 letter from Midway (with 7 and 14 days late items) & 1 letter from Centerville
letter merging 1 DVD from Midway (7 days late) & 1 CD from Midway (14 days late) & 1 DVD from Centerville (7 days late) Midway / * / DVD – 7j – ODUE & Midway / * / CD – 7j – ODUECD & Midway / * / CD – 14j – ODUECD & Centerville / * / DVD – 7j – ODUE 1 letter for the DVD from Midway & 1 letter pour le CD from Midway & 1 letter from Centerville
on hold status 1 DVD from Midway (7 days late) – on hold MIDWAY / * / DVD – 7j – ODUE No letter
on hold status 1 DVD from Midway (7 days late) – on hold MIDWAY / * / DVD– on hold – 7j – ODUE 1 letter
on hold status 1 DVD from Midway (7 days late) – on hold & 1 DVD from Midway (7 days late) – not on hold MIDWAY / * / DVD – on hold – 7j – ODUE & MIDWAY / * / DVD – 7j – ODUE 1 letter with 2 items
on hold status 1 DVD from Midway (7 days late) – on hold & 1 DVD from Midway (7 days late) – not on hold MIDWAY / * / DVD – on hold – 7j - ODUE & MIDWAY / * / DVD – 7j – ODUECD 2 letters with 1 item each
Restrict option 1 DVD from Midway (7 days late) MIDWAY / * / DVD – 7j – restrict – ODUE 1 letter and the borrower account is restricted