Bug 23207: Add automatic checkin feature
authorAgustin Moyano <agustinmoyano@theke.io>
Fri, 4 Dec 2020 21:47:31 +0000 (18:47 -0300)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 22 Apr 2021 09:11:05 +0000 (11:11 +0200)
commit7439579b8b75a8b1b1a146b55c03b108df0c621d
treeea9a5145e4900f480d70e98ef02be74ca92dfd82
parent6b1b2be4c3fa65a9b3f65b368b2b9a9439ab3db9
Bug 23207: Add automatic checkin feature

This patch adds the posibility to set an itemtype with automatic
checkin. It means that when the checkout is due, it will
automatically check in.

To test:
1. apply patches
2. updatedatabase
3. go to koha administration -> item types and edin an item type (from
   now on called itemtype1)
CHECK => there is a checkbox almost at the end called automatic checkin
4. check that checkbox and save
5. checkout 2 items from itemtype1 and one item from another itemtype
   (from now on called itemtype2)
6. go to mysql database console (koha-mysql) and manually set date_due = current_timestamp
   in issues table for the item of itemtype2 and only one of the items of
itemtype1
7. run cronjob at misc/cronjobs/automatic_checkin.pl
8. go to mysql database console again and select * from issues
SUCCESS => All issues are present except for the issue of itemtype1
which had it's date_due set to current_timestamp. That one was
automatically checked in.
9. prove t/db_dependent/Koha/Checkouts.t

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Hasina Akhter <HasinaA@pascolibraries.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Koha/Checkouts.pm
admin/itemtypes.pl
debian/koha-common.cron.hourly
koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt
misc/cronjobs/automatic_checkin.pl [new file with mode: 0755]