View | Details | Raw Unified | Return to bug 39887
Collapse All | Expand All

(-)a/misc/cronjobs/overdue_notices.pl (-16 / +46 lines)
Lines 52-58 overdue_notices.pl Link Here
52
 Options:
52
 Options:
53
   --help                          Brief help message.
53
   --help                          Brief help message.
54
   --man                           Full documentation.
54
   --man                           Full documentation.
55
   --verbose | -v                  Verbose mode. Can be repeated for increased output
55
   --verbose | -v                  Verbose mode. Can be repeated for increased output.
56
   --nomail | -n                   No email will be sent.
56
   --nomail | -n                   No email will be sent.
57
   --max          <days>           Maximum days overdue to deal with.
57
   --max          <days>           Maximum days overdue to deal with.
58
   --library      <branchcode>     Only deal with overdues from this library.
58
   --library      <branchcode>     Only deal with overdues from this library.
Lines 89-95 Prints the manual page and exits. Link Here
89
89
90
Verbose. Without this flag set, only fatal errors are reported.
90
Verbose. Without this flag set, only fatal errors are reported.
91
A single 'v' will report info on branches, letter codes, and patrons.
91
A single 'v' will report info on branches, letter codes, and patrons.
92
A second 'v' will report The SQL code used to search for triggered patrons.
92
A second 'v' will report the SQL code used to search for triggered patrons.
93
93
94
=item B<-n> | B<--nomail>
94
=item B<-n> | B<--nomail>
95
95
Lines 107-125 any CSV files. Defaults to 90 to match F<longoverdues.pl>. Link Here
107
107
108
=item B<--library>
108
=item B<--library>
109
109
110
select overdues for one specific library. Use the value in the
110
Select overdues for one specific library. Use the value in the
111
branches.branchcode table. This option can be repeated in order 
111
branches.branchcode table. This option can be repeated in order 
112
to select overdues for a group of libraries.
112
to select overdues for a group of libraries.
113
113
114
=item B<--csv>
114
=item B<--csv>
115
115
116
Produces CSV data. if -n (no mail) flag is set, then this CSV data is
116
Produces CSV data. If -n (no mail) flag is set, then this CSV data is
117
sent to standard out or to a filename if provided. Otherwise, only
117
sent to standard out or to a filename if provided. Otherwise, only
118
overdues that could not be emailed are sent in CSV format to the admin.
118
overdues that could not be emailed are sent in CSV format to the admin.
119
119
120
=item B<--html>
120
=item B<--html>
121
121
122
Produces html data. If patron does not have an email address or
122
Produces HTML data. If patron does not have an email address or
123
-n (no mail) flag is set, an HTML file is generated in the specified
123
-n (no mail) flag is set, an HTML file is generated in the specified
124
directory. This can be downloaded or further processed by library staff.
124
directory. This can be downloaded or further processed by library staff.
125
The file will be called notices-YYYY-MM-DD.html and placed in the directory
125
The file will be called notices-YYYY-MM-DD.html and placed in the directory
Lines 135-154 specified. Link Here
135
135
136
=item B<--itemscontent>
136
=item B<--itemscontent>
137
137
138
comma separated list of fields that get substituted into templates in
138
Comma separated list of fields that get substituted into templates in
139
places of the E<lt>E<lt>items.contentE<gt>E<gt> placeholder. This
139
places of the E<lt>E<lt>items.contentE<gt>E<gt> placeholder. This
140
defaults to due date,title,barcode,author
140
defaults to due date,title,barcode,author,itemnumber
141
141
142
Other possible values come from fields in the biblios, items and
142
Other possible values come from fields in the biblios, items and
143
issues tables.
143
issues tables.
144
144
145
=item B<--borcat>
145
=item B<--borcat>
146
146
147
Repeatable field, that permits to select only some patron categories.
147
Repeatable field that permits selecting only specific patron categories.
148
For example, --borcat STUDENT --borcat FACULTY would only process overdues
149
for patrons in the STUDENT and FACULTY categories.
148
150
149
=item B<--borcatout>
151
=item B<--borcatout>
150
152
151
Repeatable field, that permits to exclude some patron categories.
153
Repeatable field that permits excluding specific patron categories.
154
For example, --borcatout STAFF would skip processing overdues for
155
patrons in the STAFF category.
152
156
153
=item B<-t> | B<--triggered>
157
=item B<-t> | B<--triggered>
154
158
Lines 157-163 an item is overdue by the number of days defined in a notice trigger. Link Here
157
161
158
By default, a notice is sent each time the script runs, which is suitable for 
162
By default, a notice is sent each time the script runs, which is suitable for 
159
less frequent run cron script, but requires syncing notice triggers with 
163
less frequent run cron script, but requires syncing notice triggers with 
160
the  cron schedule to ensure proper behavior.
164
the cron schedule to ensure proper behavior.
161
Add the --triggered option for daily cron, at the risk of no notice 
165
Add the --triggered option for daily cron, at the risk of no notice 
162
being generated if the cron fails to run on time.
166
being generated if the cron fails to run on time.
163
167
Lines 165-172 being generated if the cron fails to run on time. Link Here
165
169
166
This option makes the script run in test mode.
170
This option makes the script run in test mode.
167
171
168
In test mode, the script won't make any changes on the DB. This is useful
172
In test mode, the script won't make any changes to the database. This is useful
169
for debugging configuration.
173
for debugging configuration and testing notice generation without affecting
174
production data.
170
175
171
=item B<--list-all>
176
=item B<--list-all>
172
177
Lines 176-193 Choose --list-all to include all overdue items in the list (limited by B<--max> Link Here
176
181
177
=item B<--date>
182
=item B<--date>
178
183
179
use it in order to send overdues on a specific date and not Now. Format: YYYY-MM-DD.
184
Use it in order to send overdues on a specific date and not Now. Format: YYYY-MM-DD.
185
186
This allows running the script for a different date than the current one,
187
which can be helpful for testing, or for running overdues that should have
188
been sent earlier.
180
189
181
=item B<--email>
190
=item B<--email>
182
191
183
Allows to specify which type of email will be used. Can be email, emailpro or B_email. Repeatable.
192
Allows to specify which type of email will be used. Can be email, emailpro or B_email. Repeatable.
184
193
194
This determines which email address field from the borrowers table will be used
195
for notification. If multiple types are specified, the script will try all of them
196
in the order provided until it finds a valid address.
197
198
If this parameter is not specified, the script will fall back to using Koha::Patron->notice_email_address,
199
which respects the patron's preferences and Koha system settings.
200
185
=item B<--frombranch>
201
=item B<--frombranch>
186
202
187
Organize overdue notices either by checkout library (item-issuebranch) or item home library (item-homebranch)  or patron home library (patron-homebranch).
203
Organize overdue notices either by checkout library (item-issuebranch) or item home library (item-homebranch) or patron home library (patron-homebranch).
188
This option is only used, if the OverdueNoticeFrom system preference is set to use 'command-line option'.
204
This option is only used if the OverdueNoticeFrom system preference is set to use 'command-line option'.
189
Defaults to checkout library (item-issuebranch).
205
Defaults to checkout library (item-issuebranch).
190
206
207
This setting affects which branch is considered the "source" of the notice, which
208
in turn affects various aspects of the notice, including the content, branding,
209
and from email address.
210
191
=back
211
=back
192
212
193
=head1 DESCRIPTION
213
=head1 DESCRIPTION
Lines 280-285 items. Link Here
280
C<overdue_notices.pl --library MAIN max 14> - prepare notices of
300
C<overdue_notices.pl --library MAIN max 14> - prepare notices of
281
overdues in the last 2 weeks for the MAIN library.
301
overdues in the last 2 weeks for the MAIN library.
282
302
303
C<overdue_notices.pl --triggered --date 2023-05-01> - Run the script as if it
304
were May 1, 2023, and send only notices for items that are exactly at the trigger 
305
point (rather than within the trigger range).
306
307
C<overdue_notices.pl --borcat STUDENT --email email --email B_email> - Only send
308
notices to patrons in the STUDENT category, trying both primary and alternate email 
309
addresses.
310
311
C<overdue_notices.pl --html /tmp/notices> - Generate HTML files for patrons without
312
email addresses in the /tmp/notices directory.
313
283
=head1 SEE ALSO
314
=head1 SEE ALSO
284
315
285
The F<misc/cronjobs/advance_notices.pl> program allows you to send
316
The F<misc/cronjobs/advance_notices.pl> program allows you to send
286
- 

Return to bug 39887