[Bug 14368] New: Add discharges history
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14368 Bug ID: 14368 Summary: Add discharges history Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Patrons Assignee: koha-bugs@lists.koha-community.org Reporter: matthias.meusburger@biblibre.com QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle.m.hall@gmail.com Currently there is no way to see when a user was discharged, or to have an history if the user was discharged several time. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14368 --- Comment #1 from Matthias Meusburger <matthias.meusburger@biblibre.com> --- Created attachment 40079 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=40079&action=edit Bug 14368: Add discharges history. Currently, once a user is discharged, lifting the discharge debarment does not allow the user to ask for a discharge again. This patch adds the ability for a user to be discharged several times and to keep an history of the discharges. Test plan: - As a user, ask for a discharge. - As a librarian, allow the discharge. - Check that the requested and validated dates appear on the discharge panel of the borrower in the admin interface. - Lift the discharge debarment of the user. - Check that you can repeat these steps and that the new discharges are added in the discharge panel of the borrower in the admin interface. Please note that you will need to run misc/devel/update_dbix_class_files.pl after the SQL update. Adding a primary key to the discharges table was mandatory for DBIX::Class to be able to query with order_by. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14368 Matthias Meusburger <matthias.meusburger@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14368 Indranil Das Gupta <indradg@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |indradg@gmail.com --- Comment #2 from Indranil Das Gupta <indradg@gmail.com> --- I get the part about having discharge history. But why would an user be 'discharged' several times? Is that not counter intuitive? Could you elaborate with an use-case where there could be multiple "discharge"? -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14368 Indranil Das Gupta <indradg@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |In Discussion --- Comment #3 from Indranil Das Gupta <indradg@gmail.com> --- Academic libraries in India particularly require discharge management feature. A multiple discharge of the same patron will create confusion and major patron management headaches (fees, fines, access card issuance etc). Setting this to IN DISCUSSION -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14368 vinod <vinod_librarian@rediffmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |vinod_librarian@rediffmail. | |com --- Comment #4 from vinod <vinod_librarian@rediffmail.com> --- Please mention some case where this kind of feature is needed and it could not be manage by temporarily block feature? -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14368 Matthias Meusburger <matthias.meusburger@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |8007 -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14368 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@biblibre.co | |m -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14368 claire.hernandez@biblibre.com <claire.hernandez@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |matthias.meusburger@biblibr |ity.org |e.com CC| |claire.hernandez@biblibre.c | |om -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14368 Indranil Das Gupta <indradg@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #40079|0 |1 is obsolete| | --- Comment #5 from Indranil Das Gupta <indradg@gmail.com> --- Created attachment 40171 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=40171&action=edit Bug 14368: Add discharges history. Currently, once a user is discharged, lifting the discharge debarment does not allow the user to ask for a discharge again. This patch adds the ability for a user to be discharged several times and to keep an history of the discharges. Test plan: - As a user, ask for a discharge. - As a librarian, allow the discharge. - Check that the requested and validated dates appear on the discharge panel of the borrower in the admin interface. - Lift the discharge debarment of the user. - Check that you can repeat these steps and that the new discharges are added in the discharge panel of the borrower in the admin interface. Please note that you will need to run misc/devel/update_dbix_class_files.pl after the SQL update. Adding a primary key to the discharges table was mandatory for DBIX::Class to be able to query with order_by. Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14368 Indranil Das Gupta <indradg@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|In Discussion |Signed Off --- Comment #6 from Indranil Das Gupta <indradg@gmail.com> --- Signed off based on discussions referenced at http://irc.koha-community.org/koha/2015-06-16#i_1688844 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14368 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA --- Comment #7 from Jonathan Druart <jonathan.druart@biblibre.com> --- The indentation should be 4 spaces, please resubmit. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14368 Matthias Meusburger <matthias.meusburger@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #40171|0 |1 is obsolete| | --- Comment #8 from Matthias Meusburger <matthias.meusburger@biblibre.com> --- Created attachment 40508 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=40508&action=edit Bug 14368: Add discharges history. Currently, once a user is discharged, lifting the discharge debarment does not allow the user to ask for a discharge again. This patch adds the ability for a user to be discharged several times and to keep an history of the discharges. Test plan: - As a user, ask for a discharge. - As a librarian, allow the discharge. - Check that the requested and validated dates appear on the discharge panel of the borrower in the admin interface. - Lift the discharge debarment of the user. - Check that you can repeat these steps and that the new discharges are added in the discharge panel of the borrower in the admin interface. Please note that you will need to run misc/devel/update_dbix_class_files.pl after the SQL update. Adding a primary key to the discharges table was mandatory for DBIX::Class to be able to query with order_by. Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14368 Matthias Meusburger <matthias.meusburger@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off --- Comment #9 from Matthias Meusburger <matthias.meusburger@biblibre.com> --- Submitted with 4 spaces identation. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14368 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14368 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #40508|0 |1 is obsolete| | --- Comment #10 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 40512 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=40512&action=edit Bug 14368: Add discharges history. Currently, once a user is discharged, lifting the discharge debarment does not allow the user to ask for a discharge again. This patch adds the ability for a user to be discharged several times and to keep an history of the discharges. Test plan: - As a user, ask for a discharge. - As a librarian, allow the discharge. - Check that the requested and validated dates appear on the discharge panel of the borrower in the admin interface. - Lift the discharge debarment of the user. - Check that you can repeat these steps and that the new discharges are added in the discharge panel of the borrower in the admin interface. Please note that you will need to run misc/devel/update_dbix_class_files.pl after the SQL update. Adding a primary key to the discharges table was mandatory for DBIX::Class to be able to query with order_by. Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14368 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com Status|Passed QA |Failed QA --- Comment #11 from Tomás Cohen Arazi <tomascohen@gmail.com> --- It makes sense to have more than one discharge in a patron's lifetime (requested when ending studies, and then if he leaves the institution as a professor...). I tested the feature and it showed more information about the discharge, but I doesn't seem to be working as expected as only the first discharge is being saved... -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14368 --- Comment #12 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Matts, a few notes on this patch. - I like the idea, I think we should've had this for the 3.20 release already. - There's a bug on the unit test you introduce for lifting the discharge, because it should look like: ok( ! Koha::Borrower::Discharge::is_discharged({ borrowernumber => $borrowernumber }), 'The patron is not discharged after the restriction has been lifted' ); And you will notice it fails :/ - There's a problem with Koha::Borrower::Discharge::discharge (not introduced by your patch, but affects the beaviour): it overwrites the already defined discharges... so no history! Heh. - For fixing the previous, you will need to add a column to address the fact that the discharge is active/non active. So you can have more than one discharges for a borrowernumber, and always check only one is active at a time. I'm attaching a followup with those changes on the tests, It'd be great if you could take a look and maybe talk tomorrow on IRC about this to have this ready ASAP. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14368 --- Comment #13 from Matthias Meusburger <matthias.meusburger@biblibre.com> --- (In reply to Tomás Cohen Arazi from comment #12)
- There's a bug on the unit test you introduce for lifting the discharge, because it should look like:
ok( ! Koha::Borrower::Discharge::is_discharged({ borrowernumber => $borrowernumber }), 'The patron is not discharged after the restriction has been lifted' );
And you will notice it fails :/
Indeed. Misuse of DelDebarment. Fixed in the follow-up.
- There's a problem with Koha::Borrower::Discharge::discharge (not introduced by your patch, but affects the beaviour): it overwrites the already defined discharges... so no history! Heh.
Hmm, the sql patch introducing discharge_id in the discharges table and the following part of the patch should prevent this behavior, shouldn't it ? - my $discharge = $rs->search({ borrower => $borrowernumber }); + my $discharge = $rs->search({ borrower => $borrowernumber }, { order_by => { -desc => 'needed' }, rows => 1 }); -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14368 --- Comment #14 from Matthias Meusburger <matthias.meusburger@biblibre.com> --- Created attachment 42593 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=42593&action=edit Bug 14368 [Follow-up]: Fix tests. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14368 Matthias Meusburger <matthias.meusburger@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14368 --- Comment #15 from Matthias Meusburger <matthias.meusburger@biblibre.com> --- Created attachment 42598 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=42598&action=edit Bug 14368 [Follow-up]: Add filter on borrower when displaying discharges history on borrower's page. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14368 --- Comment #16 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 42640 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=42640&action=edit Bug 14368: Add some missing tests -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14368 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA --- Comment #17 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- It does not work anymore. When I try to allow the discharge (/members/discharges.pl?op=allow&borrowernumber=XXXX), I get DBIx::Class::ResultSet::_rs_update_delete(): Unable to perform complex resultset update() without an identifying set of columns on source 'Discharge' at /home/koha/src/Koha/Borrower/Discharge.pm line 96 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14368 --- Comment #18 from Matthias Meusburger <matthias.meusburger@biblibre.com> --- Jonathan, did you run misc/devel/update_dbix_class_files.pl , as stated in the commit message, to update the DBIx Discharge schema ? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14368 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off --- Comment #19 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Matthias Meusburger from comment #18)
Jonathan, did you run misc/devel/update_dbix_class_files.pl , as stated in the commit message, to update the DBIx Discharge schema ?
Oops, no! -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14368 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14368 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #40512|0 |1 is obsolete| | --- Comment #20 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 42670 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=42670&action=edit Bug 14368: Add discharges history. Currently, once a user is discharged, lifting the discharge debarment does not allow the user to ask for a discharge again. This patch adds the ability for a user to be discharged several times and to keep an history of the discharges. Test plan: - As a user, ask for a discharge. - As a librarian, allow the discharge. - Check that the requested and validated dates appear on the discharge panel of the borrower in the admin interface. - Lift the discharge debarment of the user. - Check that you can repeat these steps and that the new discharges are added in the discharge panel of the borrower in the admin interface. Please note that you will need to run misc/devel/update_dbix_class_files.pl after the SQL update. Adding a primary key to the discharges table was mandatory for DBIX::Class to be able to query with order_by. Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14368 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #42593|0 |1 is obsolete| | --- Comment #21 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 42671 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=42671&action=edit Bug 14368 [Follow-up]: Fix tests. Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14368 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #42598|0 |1 is obsolete| | --- Comment #22 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 42672 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=42672&action=edit Bug 14368 [Follow-up]: Add filter on borrower when displaying discharges history on borrower's page. Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14368 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #42640|0 |1 is obsolete| | --- Comment #23 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 42673 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=42673&action=edit Bug 14368: Add some missing tests Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14368 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Failed QA --- Comment #24 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Hum, something does not work correctly IMO. Let say the given workflow: - A patron asks for a discharge at the OPAC - The patron comes at the librarian's office. - On the patron page, there is no track of this demand, so the librarian goes on the discharge page (members/discharge.pl) and generates the discharge - The discharge does not appear in the discharge list but still exist in the pending discharge requests. There is something which is not consistent here, it should be fixed. Failing QA (sorry!) -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14368 --- Comment #25 from Matthias Meusburger <matthias.meusburger@biblibre.com> --- Created attachment 42720 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=42720&action=edit Bug 14368 [Follow-up]: Fix workflow. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14368 --- Comment #26 from Matthias Meusburger <matthias.meusburger@biblibre.com> --- The last patch fixes the bug you described, Jonathan. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14368 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #42720|0 |1 is obsolete| | --- Comment #27 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 42723 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=42723&action=edit Bug 14368 [Follow-up]: Fix workflow. Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14368 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Passed QA --- Comment #28 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Matthias Meusburger from comment #26)
The last patch fixes the bug you described, Jonathan.
Thanks, everything sounds good now! -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14368 --- Comment #29 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 42930 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=42930&action=edit Bug 14368: (RM followup) DBIx update Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14368 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master --- Comment #30 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Patches pushed to master. Good job, Matthias! -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org