Description
Jesse Weaver
2015-07-21 03:39:48 UTC
Created attachment 47936 [details] [review] Bug 14577 - Allow restriction of checkouts based on fines of guarantor's guarantees This enhancment allows a library to prevent patrons from checking out items if his or her guarantees own too much. Created attachment 48632 [details] [review] Bug 14577 - Allow restriction of checkouts based on fines of guarantor's guarantees This enhancment allows a library to prevent patrons from checking out items if his or her guarantees own too much. Created attachment 48639 [details] [review] Bug 14577 - Allow restriction of checkouts based on fines of guarantor's guarantees This enhancment allows a library to prevent patrons from checking out items if his or her guarantees own too much. Test Plan: 1) Apply this patch 2) Find or create a patron with a guarantor 3) Add a fine to the patron's account 4) Set the new system preference NoIssuesChargeGuarantees to be less than the amount owed by the patron 4) Attempt to check out an item to the guarantor, you will either be warned or prevented from checking out based on your system settings. Created attachment 48759 [details] [review] Bug 14577 - Allow restriction of checkouts based on fines of guarantor's guarantees This enhancment allows a library to prevent patrons from checking out items if his or her guarantees own too much. Test Plan: 1) Apply this patch 2) Find or create a patron with a guarantor 3) Add a fine to the patron's account 4) Set the new system preference NoIssuesChargeGuarantees to be less than the amount owed by the patron 4) Attempt to check out an item to the guarantor, you will either be warned or prevented from checking out based on your system settings. Apply? [(y)es, (n)o, (i)nteractive] y Applying: Bug 14577 - Allow restriction of checkouts based on fines of guarantor's guarantees Using index info to reconstruct a base tree... M C4/Circulation.pm M installer/data/mysql/sysprefs.sql M koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref Falling back to patching base and 3-way merge... Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref Auto-merging installer/data/mysql/sysprefs.sql Auto-merging C4/Circulation.pm Auto packing the repository in background for optimum performance. See "git help gc" for manual housekeeping. Created attachment 48784 [details] [review] Bug 14577 - Allow restriction of checkouts based on fines of guarantor's guarantees This enhancment allows a library to prevent patrons from checking out items if his or her guarantees own too much. Test Plan: 1) Apply this patch 2) Find or create a patron with a guarantor 3) Add a fine to the patron's account 4) Set the new system preference NoIssuesChargeGuarantees to be less than the amount owed by the patron 4) Attempt to check out an item to the guarantor, you will either be warned or prevented from checking out based on your system settings. Signed-off-by: Cathi Wiggin <CWIGGINS@arcadiaca.gov> I have added the Koha::Patron->guarantees method for bug 15656. Do you mind rebasing this new enhancement on top of it? I have provided much more tests and it has reached the QA queue 1 month ago. Created attachment 49036 [details] [review] Bug 14577 - Allow restriction of checkouts based on fines of guarantor's guarantees This enhancment allows a library to prevent patrons from checking out items if his or her guarantees own too much. Test Plan: 1) Apply this patch 2) Find or create a patron with a guarantor 3) Add a fine to the patron's account 4) Set the new system preference NoIssuesChargeGuarantees to be less than the amount owed by the patron 4) Attempt to check out an item to the guarantor, you will either be warned or prevented from checking out based on your system settings. Signed-off-by: Cathi Wiggin <CWIGGINS@arcadiaca.gov> Comment on attachment 49036 [details] [review] Bug 14577 - Allow restriction of checkouts based on fines of guarantor's guarantees Review of attachment 49036 [details] [review]: ----------------------------------------------------------------- - circ/circulation_batch_checkouts.tt will need to be modified too - The tests in Patron.t are not necessary. It's covered by t/db_dependent/Koha/Patrons.t ::: C4/Circulation.pm @@ +852,5 @@ > my $allfinesneedoverride = C4::Context->preference("AllFinesNeedOverride"); > + > + # Check the debt of this patrons guarantees > + my $no_issues_charge_guarantees = C4::Context->preference("NoIssuesChargeGuarantees"); > + $no_issues_charge_guarantees = undef unless looks_like_number( $no_issues_charge_guarantees ); Is there a difference with 'defined $a && $a > 0'? @@ +867,5 @@ > + $issuingimpossible{DEBT_GUARANTEES} = sprintf( "%.2f", $guarantees_non_issues_charges ); > + } elsif ( $guarantees_non_issues_charges > $no_issues_charge_guarantees && !$inprocess && $allowfineoverride) { > + $needsconfirmation{DEBT_GUARANTEES} = sprintf( "%.2f", $guarantees_non_issues_charges ); > + } elsif ( $allfinesneedoverride && $guarantees_non_issues_charges > 0 && $guarantees_non_issues_charges <= $no_issues_charge_guarantees && !$inprocess ) { > + $needsconfirmation{DEBT_GUARANTEES} = sprintf( "%.2f", $guarantees_non_issues_charges ); It would be better to use the Price TT plugin to display these values. Created attachment 49236 [details] [review] Bug 14577 - Allow restriction of checkouts based on fines of guarantor's guarantees This enhancment allows a library to prevent patrons from checking out items if his or her guarantees own too much. Test Plan: 1) Apply this patch 2) Find or create a patron with a guarantor 3) Add a fine to the patron's account 4) Set the new system preference NoIssuesChargeGuarantees to be less than the amount owed by the patron 4) Attempt to check out an item to the guarantor, you will either be warned or prevented from checking out based on your system settings. Signed-off-by: Cathi Wiggin <CWIGGINS@arcadiaca.gov> Created attachment 49237 [details] [review] Bug 14577 [QA Followup] (In reply to Jonathan Druart from comment #9) > - circ/circulation_batch_checkouts.tt will need to be modified too Fixed! > - The tests in Patron.t are not necessary. It's covered by > t/db_dependent/Koha/Patrons.t Fixed! > ::: C4/Circulation.pm > @@ +852,5 @@ > > my $allfinesneedoverride = C4::Context->preference("AllFinesNeedOverride"); > > + > > + # Check the debt of this patrons guarantees > > + my $no_issues_charge_guarantees = C4::Context->preference("NoIssuesChargeGuarantees"); > > + $no_issues_charge_guarantees = undef unless looks_like_number( $no_issues_charge_guarantees ); > > Is there a difference with 'defined $a && $a > 0'? It's a safety check in case some puts a non-number in the system preference ( since it's free text ). > @@ +867,5 @@ > > + $issuingimpossible{DEBT_GUARANTEES} = sprintf( "%.2f", $guarantees_non_issues_charges ); > > + } elsif ( $guarantees_non_issues_charges > $no_issues_charge_guarantees && !$inprocess && $allowfineoverride) { > > + $needsconfirmation{DEBT_GUARANTEES} = sprintf( "%.2f", $guarantees_non_issues_charges ); > > + } elsif ( $allfinesneedoverride && $guarantees_non_issues_charges > 0 && $guarantees_non_issues_charges <= $no_issues_charge_guarantees && !$inprocess ) { > > + $needsconfirmation{DEBT_GUARANTEES} = sprintf( "%.2f", $guarantees_non_issues_charges ); > > It would be better to use the Price TT plugin to display these values. Fixed! Created attachment 49303 [details] [review] Bug 14577 - Allow restriction of checkouts based on fines of guarantor's guarantees This enhancment allows a library to prevent patrons from checking out items if his or her guarantees own too much. Test Plan: 1) Apply this patch 2) Find or create a patron with a guarantor 3) Add a fine to the patron's account 4) Set the new system preference NoIssuesChargeGuarantees to be less than the amount owed by the patron 4) Attempt to check out an item to the guarantor, you will either be warned or prevented from checking out based on your system settings. Signed-off-by: Cathi Wiggin <CWIGGINS@arcadiaca.gov> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Created attachment 49304 [details] [review] Bug 14577 [QA Followup] Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Didn't apply cleanly (In reply to Brendan Gallagher from comment #15) > Didn't apply cleanly Odd, it seems to apply cleanly now! Created attachment 50834 [details] [review] Bug 14577 - Allow restriction of checkouts based on fines of guarantor's guarantees This enhancment allows a library to prevent patrons from checking out items if his or her guarantees own too much. Test Plan: 1) Apply this patch 2) Find or create a patron with a guarantor 3) Add a fine to the patron's account 4) Set the new system preference NoIssuesChargeGuarantees to be less than the amount owed by the patron 4) Attempt to check out an item to the guarantor, you will either be warned or prevented from checking out based on your system settings. Signed-off-by: Cathi Wiggin <CWIGGINS@arcadiaca.gov> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Created attachment 50835 [details] [review] Bug 14577 [QA Followup] Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Pushed to master for the May 2016 release! |