[Bug 18783] New: Allow automatic claims for serials
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18783 Bug ID: 18783 Summary: Allow automatic claims for serials Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: ASSIGNED Severity: enhancement Priority: P5 - low Component: Serials Assignee: julian.maurice@biblibre.com Reporter: julian.maurice@biblibre.com QA Contact: testopia@bugs.koha-community.org CC: colin.campbell@ptfs-europe.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18783 --- Comment #1 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 64195 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=64195&action=edit Bug 18783: Allow automatic claims for serials This patch adds a new script misc/cronjobs/serialsClaim.pl which send email notification to all suppliers that have late or missing issues. This is configurable per subscription and is disabled by default. Test plan: 1. Create a new bookseller B1 with a delivery time of 5 days 2. Create a new daily subscription with bookseller B1 and enable automatic claims (new checkbox on the first page of subscription-add.pl) 3. Generate some late serials with an expected date in the past (some with more than 5 days in the past, some with less) 4. Create a notice for module "Claim serial issue" CLAIMSERIAL and write something in the 'Email' template 5. Run `misc/cronjobs/serialsClaims.pl --letter-code CLAIMSERIAL` and verify that it sends an email notification only for serials that were expected more than 5 days ago -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18783 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18783 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |18784 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18784 [Bug 18784] Add 'auto claim' option to subscription batch edit tool -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18783 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA CC| |katrin.fischer@bsz-bw.de --- Comment #2 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- This is another of the 'missing features' that I have been asked about often. I have tried to test, but when running the script, I receive an error: kohadev-koha@kohadevbox:/home/vagrant/kohaclone$ ./misc/cronjobs/serialsClaim.pl --letter-code RLIST The method auto_claim_enabled is not covered by tests! Possible future enh: For servers with multiple instances it would be nice if the letter code could be configured inside Koha. Either as a system preference or even better per vendor, then you could have different letters for different languages. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18783 --- Comment #3 from Julian Maurice <julian.maurice@biblibre.com> --- Hi Katrin, (In reply to Katrin Fischer from comment #2)
kohadev-koha@kohadevbox:/home/vagrant/kohaclone$ ./misc/cronjobs/serialsClaim.pl --letter-code RLIST The method auto_claim_enabled is not covered by tests!
Did you run updatedatabase.pl and misc/devel/update_dbix_class_files.pl ? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18783 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff --- Comment #4 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Hi Julian, that fixed the issue. I have tested adding and modifying subscriptions, the new option works nicely. I have also run the command without errors, but then realized that I cannot currently test emails on my installation. As they are not going through the message_queue I can't verify them being sent/generated correctly right now. Leaving this Needs Signoff for now, maybe someone else can continue testing. Note: You might want to add a test for the changes to SendAlert. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18783 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA --- Comment #5 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Ok, I have figured out a way to see the email: 1) Errors when running script My message template was: Das folgende Heft ist jetzt verfügbar: <<biblio.title>> <<biblio.author>> <<biblio.serial>> When I run the command, I receive some errors: kohadev-koha@kohadevbox:/home/vagrant/kohaclone$ ./misc/cronjobs/serialsClaim.pl --letter-code RLIST Use of uninitialized value in substitution iterator at /home/vagrant/kohaclone/C4/Letters.pm line 776. Use of uninitialized value in substitution iterator at /home/vagrant/kohaclone/C4/Letters.pm line 776. Claim sent to Osiandersche Buchhandlung (3) for serials 3 The email is generated, but the placeholders are not being replaced. 2) Verbosity I wonder if the success message should only be shown if you add -v, this way it would be a bit less noisy when run as cronjob. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18783 --- Comment #6 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Would be nice to see this progressing, it's often asked for! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18783 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m --- Comment #7 from Fridolin SOMERS <fridolin.somers@biblibre.com> --- Needs rebase. For example serials/subscription-add.pl has been modified by Bug 20461 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18783 Jessie Zairo <jzairo@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jzairo@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18783 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #64195|0 |1 is obsolete| | --- Comment #8 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 91428 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=91428&action=edit Bug 18783: Allow automatic claims for serials This patch adds a new script misc/cronjobs/serialsClaim.pl which send email notification to all suppliers that have late or missing issues. This is configurable per subscription and is disabled by default. Test plan: 1. Create a new bookseller B1 with a delivery time of 5 days 2. Create a new daily subscription with bookseller B1 and enable automatic claims (new checkbox on the first page of subscription-add.pl) 3. Generate some late serials with an expected date in the past (some with more than 5 days in the past, some with less) 4. Create a notice for module "Claim serial issue" CLAIMSERIAL and write something in the 'Email' template 5. Run `misc/cronjobs/serialsClaims.pl --letter-code CLAIMSERIAL` and verify that it sends an email notification only for serials that were expected more than 5 days ago -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18783 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff --- Comment #9 from Julian Maurice <julian.maurice@biblibre.com> --- Patch rebased on master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18783 Laurence Rault <laurence.rault@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Patch doesn't apply CC| |laurence.rault@biblibre.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18783 --- Comment #10 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I am sorry, doesn't apply - can we get another rebase? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18783 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #91428|0 |1 is obsolete| | --- Comment #11 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 124984 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=124984&action=edit Bug 18783: Allow automatic claims for serials This patch adds a new script misc/cronjobs/serialsClaim.pl which send email notification to all suppliers that have late or missing issues. This is configurable per subscription and is disabled by default. Test plan: 1. Create a new bookseller B1 with a delivery time of 5 days 2. Create a new daily subscription with bookseller B1 and enable automatic claims (new checkbox on the first page of subscription-add.pl) 3. Generate some late serials with an expected date in the past (some with more than 5 days in the past, some with less) 4. Create a notice for module "Claim serial issue" CLAIMSERIAL and write something in the 'Email' template 5. Run `misc/cronjobs/serialsClaims.pl --letter-code CLAIMSERIAL` and verify that it sends an email notification only for serials that were expected more than 5 days ago -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18783 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Needs Signoff --- Comment #12 from Julian Maurice <julian.maurice@biblibre.com> --- Patch rebased on master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18783 Jessie Zairo <jzairo@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Patch doesn't apply --- Comment #13 from Jessie Zairo <jzairo@bywatersolutions.com> --- When testing we got an error of DBIx::Class::Row::store_column(): No such column 'auto_claim_enabled' on Koha::Schema::Result::Subscription at /kohadevbox/koha/Koha/Object.pm line 79 at /usr/share/perl5/DBIx/Class/Exception.pm line 77 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18783 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=18745 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18783 --- Comment #14 from Fridolin Somers <fridolin.somers@biblibre.com> --- Hi, This change looks like outside of scope : @@ -502,7 +507,8 @@ sub SendAlerts { } my $success = try { - $mail->send_or_die({ transport => $library->smtp_server->transport }); + my $smtp_server = $library ? $library->smtp_server : Koha::SMTP::Servers->get_default; + $mail->send_or_die({ transport => $smtp_server->transport }); } -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18783 --- Comment #15 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to Jessie Zairo from comment #13)
When testing we got an error of DBIx::Class::Row::store_column(): No such column 'auto_claim_enabled' on Koha::Schema::Result::Subscription at /kohadevbox/koha/Koha/Object.pm line 79 at /usr/share/perl5/DBIx/Class/Exception.pm line 77
If you see an error like this, make sure that the database update has run and if there is no Schema update patch, you need to 'refresh schema' in the sandbox or run the dbic command. Would love to see this back in the queues! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18783 --- Comment #16 from Fridolin Somers <fridolin.somers@biblibre.com> --- + use C4::Installer qw(column_exists); Not sure this is needed in atomicupdate bug-18783.pl, I dont see it in existing DBRevs -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18783 --- Comment #17 from Fridolin Somers <fridolin.somers@biblibre.com> --- installer/data/mysql/atomicupdate/bug-18783.pl needs exec file permission : chmod 775 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18783 --- Comment #18 from Fridolin Somers <fridolin.somers@biblibre.com> --- @@ -1859,7 +1862,7 @@ sub GetLateOrMissingIssues { if ($supplierid) { $sth = $dbh->prepare( "SELECT - serialid, aqbooksellerid, name, + serialid, serial.aqbooksellerid, name, This is outside of scope no ? Maybe linked to Bug 18745 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18783 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #124984|0 |1 is obsolete| | --- Comment #19 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 155458 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=155458&action=edit Bug 18783: Allow automatic claims for serials This patch adds a new script misc/cronjobs/serialsClaim.pl which send email notification to all suppliers that have late or missing issues. This is configurable per subscription and is disabled by default. Test plan: 1. Create a new bookseller B1 with a delivery time of 5 days 2. Create a new daily subscription with bookseller B1 and enable automatic claims (new checkbox on the first page of subscription-add.pl) 3. Generate some late serials with an expected date in the past (some with more than 5 days in the past, some with less) 4. Create a notice for module "Claim serial issue" CLAIMSERIAL and write something in the 'Email' template 5. Run `misc/cronjobs/serialsClaims.pl --letter-code CLAIMSERIAL` and verify that it sends an email notification only for serials that were expected more than 5 days ago -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18783 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@ptfs-europe | |.com Status|Patch doesn't apply |Needs Signoff --- Comment #20 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Rebased ready for testing again -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18783 --- Comment #21 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Taking a look at some modernising patches now to bring it closer to current guidelines/practices. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18783 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #155458|0 |1 is obsolete| | --- Comment #22 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 155462 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=155462&action=edit Bug 18783: Allow automatic claims for serials This patch adds a new script misc/cronjobs/serialsClaim.pl which send email notification to all suppliers that have late or missing issues. This is configurable per subscription and is disabled by default. Test plan: 1. Create a new bookseller B1 with a delivery time of 5 days 2. Create a new daily subscription with bookseller B1 and enable automatic claims (new checkbox on the first page of subscription-add.pl) 3. Generate some late serials with an expected date in the past (some with more than 5 days in the past, some with less) 4. Create a notice for module "Claim serial issue" CLAIMSERIAL and write something in the 'Email' template 5. Run `misc/cronjobs/serialsClaims.pl --letter-code CLAIMSERIAL` and verify that it sends an email notification only for serials that were expected more than 5 days ago Rescued-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18783 --- Comment #23 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Patch tidied and other minor QA script issues resolved inline. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18783 --- Comment #24 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 155463 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=155463&action=edit Bug 18783: DBIC Build -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18783 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Patch doesn't apply CC| |pedro.amorim@ptfs-europe.co | |m -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18783 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #155462|0 |1 is obsolete| | --- Comment #25 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 168423 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168423&action=edit Bug 18783: Allow automatic claims for serials This patch adds a new script misc/cronjobs/serialsClaim.pl which send email notification to all suppliers that have late or missing issues. This is configurable per subscription and is disabled by default. Test plan: 1. Create a new bookseller B1 with a delivery time of 5 days 2. Create a new daily subscription with bookseller B1 and enable automatic claims (new checkbox on the first page of subscription-add.pl) 3. Generate some late serials with an expected date in the past (some with more than 5 days in the past, some with less) 4. Create a notice for module "Claim serial issue" CLAIMSERIAL and write something in the 'Email' template 5. Run `misc/cronjobs/serialsClaims.pl --letter-code CLAIMSERIAL` and verify that it sends an email notification only for serials that were expected more than 5 days ago Rescued-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18783 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #155463|0 |1 is obsolete| | --- Comment #26 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 168424 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168424&action=edit Bug 18783: DBIC Build -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18783 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18783 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|julian.maurice@biblibre.com |martin.renvoize@ptfs-europe | |.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18783 --- Comment #27 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Rebased again and ready for testing -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18783 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18783 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #168423|0 |1 is obsolete| | --- Comment #28 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 168428 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168428&action=edit Bug 18783: Allow automatic claims for serials This patch adds a new script misc/cronjobs/serialsClaim.pl which send email notification to all suppliers that have late or missing issues. This is configurable per subscription and is disabled by default. Test plan: 1. Create a new bookseller B1 with a delivery time of 5 days 2. Create a new daily subscription with bookseller B1 and enable automatic claims (new checkbox on the first page of subscription-add.pl) 3. Generate some late serials with an expected date in the past (some with more than 5 days in the past, some with less) 4. Create a notice for module "Claim serial issue" CLAIMSERIAL and write something in the 'Email' template 5. Run `misc/cronjobs/serialsClaims.pl --letter-code CLAIMSERIAL` and verify that it sends an email notification only for serials that were expected more than 5 days ago Rescued-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18783 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #168424|0 |1 is obsolete| | --- Comment #29 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 168429 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168429&action=edit Bug 18783: DBIC Build -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18783 Boubacar OUATTARA <boubacar.ouattara@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Patch doesn't apply CC| |boubacar.ouattara@biblibre. | |com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18783 --- Comment #30 from Fridolin Somers <fridolin.somers@biblibre.com> --- Ping :D -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18783 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #168428|0 |1 is obsolete| | --- Comment #31 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 183793 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=183793&action=edit Bug 18783: Allow automatic claims for serials This patch adds a new script misc/cronjobs/serialsClaim.pl which send email notification to all suppliers that have late or missing issues. This is configurable per subscription and is disabled by default. Test plan: 1. Create a new bookseller B1 with a delivery time of 5 days 2. Create a new daily subscription with bookseller B1 and enable automatic claims (new checkbox on the first page of subscription-add.pl) 3. Generate some late serials with an expected date in the past (some with more than 5 days in the past, some with less) 4. Create a notice for module "Claim serial issue" CLAIMSERIAL and write something in the 'Email' template 5. Run `misc/cronjobs/serialsClaims.pl --letter-code CLAIMSERIAL` and verify that it sends an email notification only for serials that were expected more than 5 days ago Rescued-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18783 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #168429|0 |1 is obsolete| | --- Comment #32 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 183794 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=183794&action=edit Bug 18783: DBIC Build -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18783 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18783 --- Comment #33 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- I've not tested this, I just keep rebasing it.. would be lovely to have someone more involved with this area give it a proper test and signoff. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18783 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA --- Comment #34 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- [FAIL] installer/data/mysql/kohastructure.sql FAIL tinyint_has_boolean_flag The new column vendor_edi_accounts.po_is_basketname is using TINYINT(1) as type but is not defined as boolean in the schema file (Koha/Schema/Result/VendorEdiAccount.pm), see the SQL12 coding guideline [PASS] koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt [PASS] koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt [FAIL] misc/cronjobs/serialsClaim.pl FAIL forbidden_patterns forbidden pattern: Use https:// instead of http:// for URLs (line 18) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18783 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #183793|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18783 --- Comment #35 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 211088 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211088&action=edit Bug 18783: Allow automatic claims for serials This patch adds a new script misc/cronjobs/claim_serials.pl which send email notification to all suppliers that have late or missing issues. This is configurable per subscription and is disabled by default. Test plan: 1. Create a new bookseller B1 with a delivery time of 5 days 2. Create a new daily subscription with bookseller B1 and enable automatic claims (new checkbox on the first page of subscription-add.pl) 3. Generate some late serials with an expected date in the past (some with more than 5 days in the past, some with less) 4. Create a notice for module "Claim serial issue" CLAIMSERIAL and write something in the 'Email' template 5. Run `misc/cronjobs/claim_serials.pl --letter-code CLAIMSERIAL` and verify that it sends an email notification only for serials that were expected more than 5 days ago Updated for current main: - The atomicupdate is named bug_18783.pl, adds the column as tinyint(1) like kohastructure.sql, and uses the Koha::Installer::Output helpers. - GetLateOrMissingIssues no longer selects serial.aqbooksellerid: the column only exists in the subscription table now, and the query failed. - claim_serials.pl no longer calls cronlogaction, which it did not import and which Koha::Script -cron already does, and uses https in its licence header. Rescued-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18783 --- Comment #36 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 211089 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211089&action=edit Bug 18783: Automated Schema Update -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18783 --- Comment #37 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 211090 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211090&action=edit Bug 18783: Add is_boolean to subscription.auto_claim_enabled Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18783 --- Comment #38 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 211091 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211091&action=edit Bug 18783: (follow-up) Set the claim notice and maximum claims in the staff interface claim_serials.pl needed a server administrator to give it the notice to send and the maximum number of claims on its command line. Like other scripts, it is now configured from the staff interface, in the Serials system preferences: * SerialsClaimLetter: the notice, of the "Claim serial issue" module, to send. The preferences editor gets a "claimissues-letters" source, to offer the email notices of that module in a dropdown. * SerialsMaxClaims: the number of claims after which an issue is not claimed any more, 0 for no limit. It is 3 by default. The script now uses Koha::Script->describe_options. Its --letter-code and --max-claims options are optional and take precedence over the preferences, so that command lines that give them keep working. It stops with a message that says which preference to set when there is no notice, and refuses a negative maximum. Its documentation describes how issues are chosen, and --man shows it. An example line, commented out as the script is opt-in, is added to crontab.example. To test: 1. Apply the patches 2. perl installer/data/mysql/updatedatabase.pl => Added system preference 'SerialsClaimLetter' and 'SerialsMaxClaims' 3. Create a notice of the module "Claim serial issue", email, code CLAIMSERIAL 4. Go to Administration > System preferences > Serials => In Notifications, a dropdown with CLAIMSERIAL, and a number set to 3 5. Choose CLAIMSERIAL, set the number to 2 and save 6. Run misc/cronjobs/claim_serials.pl --help, then --man => The options are described 7. Run misc/cronjobs/claim_serials.pl, with automatic claims enabled on a subscription with a late issue of a supplier that has a delivery time => The issue is claimed with CLAIMSERIAL, and not any more after 2 claims 8. Empty the notice preference and run the script again => It stops and says to set SerialsClaimLetter 9. Run it with --letter-code CLAIMSERIAL => It works whatever the preference 10. Sign off :-D Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18783 --- Comment #39 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 211092 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211092&action=edit Bug 18783: (follow-up) Add tests for claim_serials.pl The script had no tests. They run it against the database of the test, in a transaction, and replace the sending of the notices, to check what would be claimed and with which notice: * the notice comes from the preference, and --letter-code wins over it * the script stops when there is no notice, and for a negative maximum * only the late issues of the subscriptions with automatic claims enabled are claimed, once the delivery time of their supplier has passed, and not a supplier without delivery time * a claimed issue is not claimed again before the delivery time has passed * the maximum number of claims, from the preference or --max-claims, and 0 for no limit To test: 1. Apply the patches 2. prove t/db_dependent/cronjobs/claim_serials.t => SUCCESS: Tests pass! 3. Sign off :-D Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18783 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff --- Comment #40 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Thanks Lucas. This patch had not been tested for a long time, so I rebased it on current main, ran it, and brought it up to date. The code of the first patch is still Julian's, with what I had to change listed in its commit message. Your QA script failures: * The column is now tinyint(1) in kohastructure.sql and the atomicupdate, and is a boolean in the schema (is_boolean, in its own commit as usual). The vendor_edi_accounts.po_is_basketname failure was not about this bug: it came from the old "DBIC Build" patch, which had been generated from a different database. It is replaced by an "Automated Schema Update" commit that only changes the subscription table, and the boolean flag commit. * The licence header of the cron job used http://, it uses https:// now. Problems found by running it, both fixed in the first patch: * GetLateOrMissingIssues selected serial.aqbooksellerid. That column only exists in the subscription table now, so the query failed ("Unknown column"), which also broke t/db_dependent/Serials/Claims.t and the claims page of the staff interface. It is aqbooksellerid again. * The cron job died at once, as it called cronlogaction without importing it. Koha::Script -cron already does that logging, so the call is removed. Other changes to the first patch: it conflicted with main (the new preselect_issues_in_collections_table column is added in the same places), the atomicupdate is named bug_18783.pl as the others and uses the output helpers, and the script is renamed from serialsClaim.pl to claim_serials.pl, like the other recent scripts. New follow-up patches, so that the script no longer needs a server administrator to give it options: * The claim notice and the maximum number of claims are set in the Serials system preferences (SerialsClaimLetter, a dropdown of the email notices of the "Claim serial issue" module, and SerialsMaxClaims, 3 by default, 0 for no limit). The script uses Koha::Script->describe_options; --letter-code and --max-claims stay as optional options that win over the preferences, so existing command lines keep working. It stops, saying which preference to set, if there is no notice. There is also an example line in crontab.example. * t/db_dependent/cronjobs/claim_serials.t, as there was no test. It checks the notice used, which issues are claimed (automatic claims enabled on the subscription, delivery time of the supplier passed, not claimed again before it has passed again) and the maximum number of claims. To remember how it works: an issue that was claimed is claimed again, with the same notice, each time the delivery time of its supplier has passed since the last claim, until the maximum is reached. Settings per supplier, such as a different notice or delay for each claim, would be a separate enhancement. koha-qa is clean, except for the pod_coverage of C4/Serials.pm, which is about private subs that this bug does not touch. The test plans are in the commit messages. Setting back for testing. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18783 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #183794|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org