Right now, Koha only charges fines at the end of a given charge period. For example, let us assume a circulation rule has a charge period of one week ( 7 days ) and a fine of $5. This means that an item can be overdue for 6 days without accruing a fine. Koha should allow circulation rules to be configured to place the charge at the start of the end of the charge period so the library can decide when the fine should accrue.
Created attachment 35326 [details] [review] Bug 13590 - Add ability to charge fines at start of charge period
Created attachment 35327 [details] [review] Bug 13590 - Add ability to charge fines at start of charge period
Created attachment 35328 [details] [review] Bug 13590 - Add ability to charge fines at start of charge period
Created attachment 35329 [details] [review] Bug 13590 - Add ability to charge fines at start of charge period Right now, Koha only charges fines at the end of a given charge period. For example, let us assume a circulation rule has a charge period of one week ( 7 days ) and a fine of $5. This means that an item can be overdue for 6 days without accruing a fine. Koha should allow circulation rules to be configured to place the charge at the start of the end of the charge period so the library can decide when the fine should accrue. Test Plan: 1) Apply this patch 2) prove t/db_dependent/Circulation_Issuingrule.t 3) prove t/db_dependent/Fines.t 4) Ensure you can still create/edit circulation rules
Created attachment 35330 [details] [review] Bug 13590 - Add ability to charge fines at start of charge period Right now, Koha only charges fines at the end of a given charge period. For example, let us assume a circulation rule has a charge period of one week ( 7 days ) and a fine of $5. This means that an item can be overdue for 6 days without accruing a fine. Koha should allow circulation rules to be configured to place the charge at the start of the end of the charge period so the library can decide when the fine should accrue. Test Plan: 1) Apply this patch 2) Run updatedatabase.pl 3) prove t/db_dependent/Circulation_Issuingrule.t 4) prove t/db_dependent/Circulation.t 5) prove t/db_dependent/Fines.t 6) Ensure you can still create/edit circulation rules
Hi Kyle, this sounds very interesting - how is the grace period treated? Currently we have something like, if the grace period is < the charging interval, it won't have any effect, but only if it's > (iirc). We have libraries that would like something like: due date 2 days grace period 1st fine 7 days interval 2nd fine 7 days interval 3rd fine
Grace period behavior remains unchanged, but this patch should allow you to get the behavior you are looking for. (In reply to Katrin Fischer from comment #6) > Hi Kyle, > > this sounds very interesting - how is the grace period treated? > > Currently we have something like, if the grace period is < the charging > interval, it won't have any effect, but only if it's > (iirc). > > We have libraries that would like something like: > due date > 2 days grace period > 1st fine > 7 days interval > 2nd fine > 7 days interval > 3rd fine
Created attachment 35415 [details] [review] Bug 13590 - Add ability to charge fines at start of charge period Right now, Koha only charges fines at the end of a given charge period. For example, let us assume a circulation rule has a charge period of one week ( 7 days ) and a fine of $5. This means that an item can be overdue for 6 days without accruing a fine. Koha should allow circulation rules to be configured to place the charge at the start of the end of the charge period so the library can decide when the fine should accrue. Test Plan: 1) Apply this patch 2) Run updatedatabase.pl 3) prove t/db_dependent/Circulation_Issuingrule.t 4) prove t/db_dependent/Circulation.t 5) prove t/db_dependent/Fines.t 6) Ensure you can still create/edit circulation rules
Patch needs a rebase. Apply? [(y)es, (n)o, (i)nteractive] i Applying: Bug 13590 - Add ability to charge fines at start of charge period Using index info to reconstruct a base tree... Falling back to patching base and 3-way merge... Auto-merging t/db_dependent/Circulation_Issuingrule.t CONFLICT (content): Merge conflict in t/db_dependent/Circulation_Issuingrule.t Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt Auto-merging installer/data/mysql/updatedatabase.pl CONFLICT (content): Merge conflict in installer/data/mysql/updatedatabase.pl Auto-merging installer/data/mysql/kohastructure.sql Auto-merging admin/smart-rules.pl CONFLICT (content): Merge conflict in admin/smart-rules.pl Auto-merging Koha/Schema/Result/Issuingrule.pm CONFLICT (content): Merge conflict in Koha/Schema/Result/Issuingrule.pm Auto-merging C4/Overdues.pm CONFLICT (content): Merge conflict in C4/Overdues.pm Failed to merge in the changes.
Created attachment 37909 [details] [review] Bug 13590 - Add ability to charge fines at start of charge period Right now, Koha only charges fines at the end of a given charge period. For example, let us assume a circulation rule has a charge period of one week ( 7 days ) and a fine of $5. This means that an item can be overdue for 6 days without accruing a fine. Koha should allow circulation rules to be configured to place the charge at the start of the end of the charge period so the library can decide when the fine should accrue. Test Plan: 1) Apply this patch 2) Run updatedatabase.pl 3) prove t/db_dependent/Circulation_Issuingrule.t 4) prove t/db_dependent/Circulation.t 5) prove t/db_dependent/Fines.t 6) Ensure you can still create/edit circulation rules
When running updatedatabase.pl - Can't locate C4/Context.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .) at updatedatabase.pl line 37. BEGIN failed--compilation aborted at updatedatabase.pl line 37. Hoping this wasn't just me testing this wrong, setting as Failed QA
Hi Aleisha, you have to make sure your environment variables are set correctly or that you are using the koha shell (depending on how your Koha is set up) - I have checked the updatedatabase, it looks ok. Could you try again?
Created attachment 38732 [details] [review] Bug 13590 - Add ability to charge fines at start of charge period Right now, Koha only charges fines at the end of a given charge period. For example, let us assume a circulation rule has a charge period of one week ( 7 days ) and a fine of $5. This means that an item can be overdue for 6 days without accruing a fine. Koha should allow circulation rules to be configured to place the charge at the start of the end of the charge period so the library can decide when the fine should accrue. Test Plan: 1) Apply this patch 2) Run updatedatabase.pl 3) prove t/db_dependent/Circulation_Issuingrule.t 4) prove t/db_dependent/Circulation.t 5) prove t/db_dependent/Fines.t 6) Ensure you can still create/edit circulation rules
(In reply to Kyle M Hall from comment #13) > 3) prove t/db_dependent/Circulation_Issuingrule.t t/db_dependent/Circulation_Issuingrule.t .. ok All tests successful. Files=1, Tests=9, 2 wallclock secs ( 0.06 usr 0.02 sys + 1.98 cusr 0.23 csys = 2.29 CPU) Result: PASS > 4) prove t/db_dependent/Circulation.t t/db_dependent/Circulation.t .. 22/61 DBD::mysql::st execute failed: Duplicate entry '4' for key 'PRIMARY' at /home/mirko/koha/C4/Circulation.pm line 2100. DBD::mysql::st execute failed: Duplicate entry '4' for key 'PRIMARY' at /home/mirko/koha/C4/Circulation.pm line 2100. # Looks like you planned 61 tests but ran 43. # Looks like your test exited with 255 just after 43. t/db_dependent/Circulation.t .. Dubious, test returned 255 (wstat 65280, 0xff00) Failed 18/61 subtests Test Summary Report ------------------- t/db_dependent/Circulation.t (Wstat: 65280 Tests: 43 Failed: 0) Non-zero exit status: 255 Parse errors: Bad plan. You planned 61 tests but ran 43. Files=1, Tests=43, 5 wallclock secs ( 0.07 usr 0.03 sys + 3.02 cusr 0.40 csys = 3.52 CPU) Result: FAIL > 5) prove t/db_dependent/Fines.t t/db_dependent/Fines.t .. DBIx::Class::ResultSet::create(): No such column chargeperiod_charge_at on Koha::Schema::Result::Issuingrule at t/db_dependent/Fines.t line 21 # Looks like your test exited with 255 before it could output anything. t/db_dependent/Fines.t .. Dubious, test returned 255 (wstat 65280, 0xff00) Failed 5/5 subtests Test Summary Report ------------------- t/db_dependent/Fines.t (Wstat: 65280 Tests: 0 Failed: 0) Non-zero exit status: 255 Parse errors: Bad plan. You planned 5 tests but ran 0. Files=1, Tests=0, 3 wallclock secs ( 0.05 usr 0.03 sys + 1.84 cusr 0.23 csys = 2.15 CPU) Result: FAIL I ran updatedatabase before I tested, so I wonder if something is missing?
(In reply to Mirko Tietgen from comment #14) > (In reply to Kyle M Hall from comment #13) > > > 3) prove t/db_dependent/Circulation_Issuingrule.t > > t/db_dependent/Circulation_Issuingrule.t .. ok > All tests successful. > Files=1, Tests=9, 2 wallclock secs ( 0.06 usr 0.02 sys + 1.98 cusr 0.23 > csys = 2.29 CPU) > Result: PASS > > > 4) prove t/db_dependent/Circulation.t > > t/db_dependent/Circulation.t .. 22/61 DBD::mysql::st execute failed: > Duplicate entry '4' for key 'PRIMARY' at /home/mirko/koha/C4/Circulation.pm > line 2100. > DBD::mysql::st execute failed: Duplicate entry '4' for key 'PRIMARY' at > /home/mirko/koha/C4/Circulation.pm line 2100. > # Looks like you planned 61 tests but ran 43. > # Looks like your test exited with 255 just after 43. > t/db_dependent/Circulation.t .. Dubious, test returned 255 (wstat 65280, > 0xff00) > Failed 18/61 subtests > > > Test Summary Report > ------------------- > t/db_dependent/Circulation.t (Wstat: 65280 Tests: 43 Failed: 0) > Non-zero exit status: 255 > Parse errors: Bad plan. You planned 61 tests but ran 43. > Files=1, Tests=43, 5 wallclock secs ( 0.07 usr 0.03 sys + 3.02 cusr 0.40 > csys = 3.52 CPU) > Result: FAIL > > > > 5) prove t/db_dependent/Fines.t > > t/db_dependent/Fines.t .. DBIx::Class::ResultSet::create(): No such column > chargeperiod_charge_at on Koha::Schema::Result::Issuingrule at > t/db_dependent/Fines.t line 21 > # Looks like your test exited with 255 before it could output anything. > t/db_dependent/Fines.t .. Dubious, test returned 255 (wstat 65280, 0xff00) > Failed 5/5 subtests > > Test Summary Report > ------------------- > t/db_dependent/Fines.t (Wstat: 65280 Tests: 0 Failed: 0) > Non-zero exit status: 255 > Parse errors: Bad plan. You planned 5 tests but ran 0. > Files=1, Tests=0, 3 wallclock secs ( 0.05 usr 0.03 sys + 1.84 cusr 0.23 > csys = 2.15 CPU) > Result: FAIL > > I ran updatedatabase before I tested, so I wonder if something is missing? Did you run the unit tests with a fresh install of Koha with the default data? Kyle
To follow up on that question, on my test server those unit tests often fail unless I'm using a fresh install with all the default data.
Created attachment 41149 [details] [review] Bug 13590 - Add ability to charge fines at start of charge period Right now, Koha only charges fines at the end of a given charge period. For example, let us assume a circulation rule has a charge period of one week ( 7 days ) and a fine of $5. This means that an item can be overdue for 6 days without accruing a fine. Koha should allow circulation rules to be configured to place the charge at the start of the end of the charge period so the library can decide when the fine should accrue. Test Plan: 1) Apply this patch 2) Run updatedatabase.pl 3) prove t/db_dependent/Circulation_Issuingrule.t 4) prove t/db_dependent/Circulation.t 5) prove t/db_dependent/Fines.t 6) Ensure you can still create/edit circulation rules
Created attachment 41150 [details] [review] Bug 13590 - Add ability to charge fines at start of charge period Right now, Koha only charges fines at the end of a given charge period. For example, let us assume a circulation rule has a charge period of one week ( 7 days ) and a fine of $5. This means that an item can be overdue for 6 days without accruing a fine. Koha should allow circulation rules to be configured to place the charge at the start of the end of the charge period so the library can decide when the fine should accrue. Test Plan: 1) Apply this patch 2) Run updatedatabase.pl 3) prove t/db_dependent/Circulation_Issuingrule.t 4) prove t/db_dependent/Circulation.t 5) prove t/db_dependent/Fines.t 6) Ensure you can still create/edit circulation rules
Created attachment 41151 [details] [review] Bug 13590 - Add ability to charge fines at start of charge period Right now, Koha only charges fines at the end of a given charge period. For example, let us assume a circulation rule has a charge period of one week ( 7 days ) and a fine of $5. This means that an item can be overdue for 6 days without accruing a fine. Koha should allow circulation rules to be configured to place the charge at the start of the end of the charge period so the library can decide when the fine should accrue. Test Plan: 1) Apply this patch 2) Run updatedatabase.pl 3) prove t/db_dependent/Circulation_Issuingrule.t 4) prove t/db_dependent/Circulation.t 5) prove t/db_dependent/Fines.t 6) Ensure you can still create/edit circulation rules
11:48 ~/kohaclone (master % u=)$ git qa 13590 From git://git.koha-community.org/koha * branch master -> FETCH_HEAD Branch bug13590-qa set up to track remote branch master from origin. Switched to a new branch 'bug13590-qa' Bug 13590 - Add ability to charge fines at start of charge period 41151 - Bug 13590 - Add ability to charge fines at start of charge period Apply? [(y)es, (n)o, (i)nteractive] y Applying: Bug 13590 - Add ability to charge fines at start of charge period Using index info to reconstruct a base tree... Falling back to patching base and 3-way merge... Auto-merging t/db_dependent/Circulation_Issuingrule.t CONFLICT (content): Merge conflict in t/db_dependent/Circulation_Issuingrule.t Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt CONFLICT (content): Merge conflict in koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt Auto-merging installer/data/mysql/kohastructure.sql Auto-merging admin/smart-rules.pl CONFLICT (content): Merge conflict in admin/smart-rules.pl Auto-merging Koha/Schema/Result/Issuingrule.pm Failed to merge in the changes. Patch failed at 0001 Bug 13590 - Add ability to charge fines at start of charge period When you have resolved this problem run "git bz apply --continue". If you would prefer to skip this patch, instead run "git bz apply --skip". To restore the original branch and stop patching run "git bz apply --abort". Patch left in /tmp/Bug-13590---Add-ability-to-charge-fines-at-start-o-yKwpQy.patch 11:48 ~/kohaclone (bug13590-qa *+%|AM u=)$
Created attachment 43406 [details] [review] Bug 13590 - Add ability to charge fines at start of charge period Right now, Koha only charges fines at the end of a given charge period. For example, let us assume a circulation rule has a charge period of one week ( 7 days ) and a fine of $5. This means that an item can be overdue for 6 days without accruing a fine. Koha should allow circulation rules to be configured to place the charge at the start of the end of the charge period so the library can decide when the fine should accrue. Test Plan: 1) Apply this patch 2) Run updatedatabase.pl 3) prove t/db_dependent/Circulation_Issuingrule.t 4) prove t/db_dependent/Circulation.t 5) prove t/db_dependent/Fines.t 6) Ensure you can still create/edit circulation rules
Created attachment 43407 [details] [review] [SIGNED-OFF] Bug 13590 - Add ability to charge fines at start of charge period Right now, Koha only charges fines at the end of a given charge period. For example, let us assume a circulation rule has a charge period of one week ( 7 days ) and a fine of $5. This means that an item can be overdue for 6 days without accruing a fine. Koha should allow circulation rules to be configured to place the charge at the start of the end of the charge period so the library can decide when the fine should accrue. Test Plan: 1) Apply this patch 2) Run updatedatabase.pl 3) prove t/db_dependent/Circulation_Issuingrule.t 4) prove t/db_dependent/Circulation.t 5) prove t/db_dependent/Fines.t 6) Ensure you can still create/edit circulation rules Signed-off-by: Daniel Grobani <dgrobani@samuelmerritt.edu>
Created attachment 43424 [details] [review] Bug 13590 - Add ability to charge fines at start of charge period Right now, Koha only charges fines at the end of a given charge period. For example, let us assume a circulation rule has a charge period of one week ( 7 days ) and a fine of $5. This means that an item can be overdue for 6 days without accruing a fine. Koha should allow circulation rules to be configured to place the charge at the start of the end of the charge period so the library can decide when the fine should accrue. Test Plan: 1) Apply this patch 2) Run updatedatabase.pl 3) prove t/db_dependent/Circulation_Issuingrule.t 4) prove t/db_dependent/Circulation.t 5) prove t/db_dependent/Fines.t 6) Ensure you can still create/edit circulation rules Signed-off-by: Daniel Grobani <dgrobani@samuelmerritt.edu> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 43425 [details] [review] Bug 13590: Add missing th in tfoot Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
+1 for QA Jonathan - this was/is a wish list item for us!
Patches pushed to master. Thanks Kyle!
*** Bug 9768 has been marked as a duplicate of this bug. ***