Bug 30642: Record renewal type
authorMatt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Tue, 6 Dec 2022 16:48:45 +0000 (16:48 +0000)
committerTomas Cohen Arazi <tomascohen@theke.io>
Fri, 10 Feb 2023 14:07:57 +0000 (11:07 -0300)
commit5045da59f15a7dfb3da72b5f96e249976a84692b
treeb602fae6a0969dc9abf64b3c38b609f3c237b6df
parent73b20abfb3f340adb4e1ac1880fb70ae6bfd2d77
Bug 30642: Record renewal type

A requirement has been requested to record whether a renewal was done manually or automatically. A column has been added to the checkout_renewals table in the database to record this and a check is now in place to determine whether the renewal was manual or automatic. The API has also been updated to reflect this new column and return the data when requested. The renewals modal view has also been updated to show what type the renewal was.

Test plan:
1) In the database shell run "show columns from checkout_renewals;" and observe that there is currently no column for recording the type of renewal
2) Apply patch
3) In the shell run "dbic" and "perl installer/data/mysql/updatedatabase.pl" to update the database schema with the new column.
4) Create some checkouts
5) Renew some checkouts manually and observe in the database that there is now a column called "renewal_type" that will have recorded these as "Manual"
6) Create some checkouts that can be automatically renewed
7) Run the cron script in automatic_renewals.pl and observe that there are now also entries with a renewal_type of "Automatic"
8) Send a GET request to http://localhost:8081/api/v1/checkouts/1/renewals and observe that the renewal_type is now returned in the response
9) In the Item Details tab for a record, there is the "Current renewals" option which has a button to view renewals. Click on this and observe that the modal now displays the new information.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
C4/Circulation.pm
Koha/Schema/Result/CheckoutRenewal.pm
api/v1/swagger/definitions/renewal.yaml
installer/data/mysql/atomicupdate/bug_30642-add_renewal_type.pl [new file with mode: 0644]
installer/data/mysql/kohastructure.sql
koha-tmpl/intranet-tmpl/prog/en/includes/str/checkout_renewals.inc
koha-tmpl/intranet-tmpl/prog/js/checkout_renewals_modal.js