[Bug 10481] New: No enrollment fee when changing patron category
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10481 Bug ID: 10481 Summary: No enrollment fee when changing patron category Classification: Unclassified 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: jonathan.druart@biblibre.com CC: gmcharlt@gmail.com, kyle.m.hall@gmail.com When a patron changes to a category with enrollment fee, they are not generated. -- 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=10481 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Assignee|koha-bugs@lists.koha-commun |jonathan.druart@biblibre.co |ity.org |m Severity|enhancement |normal -- 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=10481 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10481 --- Comment #1 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 19071 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=19071&action=edit Bug 10481: FIX No enrollment fee when changing patron category. When a patron changes to a category with enrollment fee, they are not generated. Test plan: - Choose a category without fee (e.g. Kid) - Add an enrollment fee for another category (e.g. Young adult) - Choose a kid and change his category to "Young adult". - Note the warning message "Fees & Charges: Patron has Outstanding fees & charges of XX" on the check out page. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10481 --- Comment #2 from Galen Charlton <gmcharlt@gmail.com> --- There are two other places in C4/Members.pm that calculate and add the enrollment fee. Time for a new function rather than copy-pasta. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10481 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #19071|0 |1 is obsolete| | --- Comment #3 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 19556 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=19556&action=edit Bug 10481: FIX No enrollment fee when changing patron category. When a patron changes to a category with enrollment fee, they are not generated. Test plan: - Choose a category without fee (e.g. Kid) - Add an enrollment fee for another category (e.g. Young adult) - Choose a kid and change his category to "Young adult". - Note the warning message "Fees & Charges: Patron has Outstanding fees & charges of XX" on the check out page. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10481 --- Comment #4 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 19557 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=19557&action=edit Bug 10481: Unit tests for C4::Members::AddEnrolmentFeeIfNeeded prove t/db_dependent/Members/AddEnrolmentFeeIfNeeded.t t/db_dependent/Members/AddEnrolmentFeeIfNeeded.t .. ok All tests successful. Files=1, Tests=3, 0 wallclock secs ( 0.02 usr 0.00 sys + 0.38 cusr 0.01 csys = 0.41 CPU) Result: PASS -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10481 --- Comment #5 from Jonathan Druart <jonathan.druart@biblibre.com> --- (In reply to Galen Charlton from comment #2)
There are two other places in C4/Members.pm that calculate and add the enrollment fee. Time for a new function rather than copy-pasta.
Yes of course, you are right. Last 2 patches refactores code into 1 routine and add unit tests for it. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10481 Srdjan Jankovic <srdjan@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |srdjan@catalyst.net.nz --- Comment #6 from Srdjan Jankovic <srdjan@catalyst.net.nz> --- prove t/db_dependent/Members/AddEnrolmentFeeIfNeeded.t t/db_dependent/Members/AddEnrolmentFeeIfNeeded.t .. Use of uninitialized value in pattern match (m//) at C4/SQLHelper.pm line 407. DBD::mysql::st execute failed: Cannot add or update a child row: a foreign key constraint fails (`koha`.`borrowers`, CONSTRAINT `borrowers_ibfk_1` FOREIGN KEY (`categorycode`) REFERENCES `categories` (`categorycode`)) at C4/SQLHelper.pm line 184. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10481 --- Comment #7 from Jonathan Druart <jonathan.druart@biblibre.com> --- (In reply to Srdjan Jankovic from comment #6)
prove t/db_dependent/Members/AddEnrolmentFeeIfNeeded.t t/db_dependent/Members/AddEnrolmentFeeIfNeeded.t .. Use of uninitialized value in pattern match (m//) at C4/SQLHelper.pm line 407. DBD::mysql::st execute failed: Cannot add or update a child row: a foreign key constraint fails (`koha`.`borrowers`, CONSTRAINT `borrowers_ibfk_1` FOREIGN KEY (`categorycode`) REFERENCES `categories` (`categorycode`)) at C4/SQLHelper.pm line 184.
It seems you don't have the good category codes. You have to insert sample data before executing this unit tests file. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10481 --- Comment #8 from Srdjan Jankovic <srdjan@catalyst.net.nz> --- installer/data/mysql/sample_only_param_tables.sql? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10481 --- Comment #9 from Jonathan Druart <jonathan.druart@biblibre.com> --- (In reply to Srdjan Jankovic from comment #8)
installer/data/mysql/sample_only_param_tables.sql?
The patch for bug 10337 creates a DB with all sample data. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10481 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #19556|0 |1 is obsolete| | --- Comment #10 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 19694 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=19694&action=edit [SIGNED-OFF] Bug 10481: FIX No enrollment fee when changing patron category. When a patron changes to a category with enrollment fee, they are not generated. Test plan: - Choose a category without fee (e.g. Kid) - Add an enrollment fee for another category (e.g. Young adult) - Choose a kid and change his category to "Young adult". - Note the warning message "Fees & Charges: Patron has Outstanding fees & charges of XX" on the check out page. Signed-off-by: Owen Leonard <oleonard@myacpl.org> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10481 --- Comment #11 from Srdjan Jankovic <srdjan@catalyst.net.nz> ---
The patch for bug 10337 creates a DB with all sample data.
Sorry, did not know of that. It is in discussion, what is the instruction for using it atm? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10481 --- Comment #12 from Jonathan Druart <jonathan.druart@biblibre.com> --- (In reply to Srdjan Jankovic from comment #11)
The patch for bug 10337 creates a DB with all sample data.
Sorry, did not know of that. It is in discussion, what is the instruction for using it atm?
There is no instruction atm. I sent an email to the mailing list, but I did not get an answer. The patch allows to create a new DB with sample data only. These sample data are required for some unit tests (indeed, it is really boring to create *all* data for each unit tests). -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10481 --- Comment #13 from Jonathan Druart <jonathan.druart@biblibre.com> --- (In reply to Owen Leonard from comment #10)
Created attachment 19694 [details] [review] [...] Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Owen, did you forgot to change the status to Signed Off? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10481 --- Comment #14 from Jonathan Druart <jonathan.druart@biblibre.com> --- (In reply to Jonathan Druart from comment #13)
(In reply to Owen Leonard from comment #10)
Created attachment 19694 [details] [review] [review] [...] Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Owen, did you forgot to change the status to Signed Off?
Ok, I understood after sending the comment, only 1 patch is signed off. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10481 --- Comment #15 from Srdjan Jankovic <srdjan@catalyst.net.nz> --- I still got the same result after applying 10337 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10481 --- Comment #16 from Jonathan Druart <jonathan.druart@biblibre.com> --- (In reply to Srdjan Jankovic from comment #15)
I still got the same result after applying 10337
the sql file installer/data/mysql/en/optional/patron_categories.sql inserts needed categories (K, J, YA). -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10481 --- Comment #17 from Srdjan Jankovic <srdjan@catalyst.net.nz> --- prove t/db_dependent/Members/AddEnrolmentFeeIfNeeded.t t/db_dependent/Members/AddEnrolmentFeeIfNeeded.t .. DBD::mysql::st execute failed: Cannot add or update a child row: a foreign key constraint fails (`koha`.`borrowers`, CONSTRAINT `borrowers_ibfk_2` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`)) at C4/SQLHelper.pm line 184. DBD::mysql::st execute failed: Cannot add or update a child row: a foreign key constraint fails (`koha`.`accountlines`, CONSTRAINT `accountlines_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE) at C4/Accounts.pm line 474. DBD::mysql::st execute failed: Cannot add or update a child row: a foreign key constraint fails (`koha`.`accountlines`, CONSTRAINT `accountlines_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE) at C4/Accounts.pm line 474. # Looks like your test exited with 255 before it could output anything. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10481 --- Comment #18 from Jonathan Druart <jonathan.druart@biblibre.com> --- The branchcode "CPL" does not exist in your DB (added by installer/data/mysql/en/optional/sample_libraries.sql). -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10481 Srdjan Jankovic <srdjan@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10481 Srdjan Jankovic <srdjan@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #19557|0 |1 is obsolete| | --- Comment #19 from Srdjan Jankovic <srdjan@catalyst.net.nz> --- Created attachment 19787 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=19787&action=edit [SIGNED-OFF] Bug 10337: Unit tests is based on an existing database This patchs adds a new unit tests file which will launched before all others db_dependent tests. It will drop and recreate the database with sample data. Prerequisite: The database 'koha_ut' have to be created with CREATE DATABASE $dbname CHARACTER SET utf8 COLLATE utf8_bin -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10481 --- Comment #20 from Jonathan Druart <jonathan.druart@biblibre.com> --- Srdjan, Thanks for signing off this patch! But you did not sent the good one :) -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10481 Srdjan Jankovic <srdjan@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #19787|0 |1 is obsolete| | --- Comment #21 from Srdjan Jankovic <srdjan@catalyst.net.nz> --- Created attachment 19797 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=19797&action=edit [SIGNED-OFF] Bug 10481: Unit tests for C4::Members::AddEnrolmentFeeIfNeeded prove t/db_dependent/Members/AddEnrolmentFeeIfNeeded.t t/db_dependent/Members/AddEnrolmentFeeIfNeeded.t .. ok All tests successful. Files=1, Tests=3, 0 wallclock secs ( 0.02 usr 0.00 sys + 0.38 cusr 0.01 csys = 0.41 CPU) Result: PASS Signed-off-by: Srdjan <srdjan@catalyst.net.nz> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10481 --- Comment #22 from Srdjan Jankovic <srdjan@catalyst.net.nz> --- Oh what a mess... Terribly sorry. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10481 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #19694|0 |1 is obsolete| | Attachment #19797|0 |1 is obsolete| | --- Comment #23 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 20406 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=20406&action=edit Bug 10481: FIX No enrollment fee when changing patron category. When a patron changes to a category with enrollment fee, they are not generated. Test plan: - Choose a category without fee (e.g. Kid) - Add an enrollment fee for another category (e.g. Young adult) - Choose a kid and change his category to "Young adult". - Note the warning message "Fees & Charges: Patron has Outstanding fees & charges of XX" on the check out page. Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10481 Kyle M Hall <kyle@bywatersolutions.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=10481 --- Comment #24 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 20407 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=20407&action=edit Bug 10481: Unit tests for C4::Members::AddEnrolmentFeeIfNeeded prove t/db_dependent/Members/AddEnrolmentFeeIfNeeded.t t/db_dependent/Members/AddEnrolmentFeeIfNeeded.t .. ok All tests successful. Files=1, Tests=3, 0 wallclock secs ( 0.02 usr 0.00 sys + 0.38 cusr 0.01 csys = 0.41 CPU) Result: PASS Signed-off-by: Srdjan <srdjan@catalyst.net.nz> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10481 --- Comment #25 from Galen Charlton <gmcharlt@gmail.com> --- Comment on attachment 20407 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=20407 Bug 10481: Unit tests for C4::Members::AddEnrolmentFeeIfNeeded Review of attachment 20407: --> (http://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=10481&attachment=20407) ----------------------------------------------------------------- ::: t/db_dependent/Members/AddEnrolmentFeeIfNeeded.t @@ +50,5 @@
+ +# Check with calling directly AddEnrolmentFeeIfNeeded +C4::Members::AddEnrolmentFeeIfNeeded( 'YA', $borrowernumber ); +( $total ) = C4::Members::GetMemberAccountRecords( $borrowernumber ); +is( $total, $enrolmentfee_K + $enrolmentfee_J + $enrolmentfee_YA, "Juvenile growing and become an young adult, he should pay " . ( $enrolmentfee_K + $enrolmentfee_J + $enrolmentfee_YA ) );
If I were a kid in this library district, I would think twice about reporting my age! ;) -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10481 --- Comment #26 from Galen Charlton <gmcharlt@gmail.com> --- Pushed to master. Thanks, Jonathan! -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10481 Galen Charlton <gmcharlt@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10481 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |Pushed to Stable CC| |tomascohen@gmail.com --- Comment #27 from Tomás Cohen Arazi <tomascohen@gmail.com> --- This patch has been pushed to 3.12.x, will be in 3.12.5. Thanks Jonathan! -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10481 Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bgkriegel@gmail.com --- Comment #28 from Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> --- Pushed to 3.10.x, will be in 3.10.11 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10481 Chris Hall <chrish@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |chrish@catalyst.net.nz --- Comment #29 from Chris Hall <chrish@catalyst.net.nz> --- Pushed to 3.8.x, will be in 3.8.19 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10481 Sophie MEYNIEUX <sophie.meynieux@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |sophie.meynieux@biblibre.co | |m --- Comment #30 from Sophie MEYNIEUX <sophie.meynieux@biblibre.com> --- This patch introduce a new bug in 3.8.x It uses C4::Members::GetBorrowerCategorycode that is introduced only in 3.10 with http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=5742 This patch should be reverted for 3.8.x version -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10481 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kyle@bywatersolutions.com --- Comment #31 from Kyle M Hall <kyle@bywatersolutions.com> --- (In reply to Sophie MEYNIEUX from comment #30)
This patch introduce a new bug in 3.8.x It uses C4::Members::GetBorrowerCategorycode that is introduced only in 3.10 with http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=5742
This patch should be reverted for 3.8.x version
This patch has now been reverted in 3.8.x and the reversion will be part of 3.8.22 Kyle -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org