Lines 18-25
Link Here
|
18 |
# You should have received a copy of the GNU General Public License |
18 |
# You should have received a copy of the GNU General Public License |
19 |
# along with Koha; if not, see <http://www.gnu.org/licenses>. |
19 |
# along with Koha; if not, see <http://www.gnu.org/licenses>. |
20 |
|
20 |
|
21 |
use strict; |
21 |
use Modern::Perl; |
22 |
use warnings; |
|
|
23 |
|
22 |
|
24 |
BEGIN { |
23 |
BEGIN { |
25 |
|
24 |
|
Lines 32-47
BEGIN {
Link Here
|
32 |
use Getopt::Long; |
31 |
use Getopt::Long; |
33 |
use Pod::Usage; |
32 |
use Pod::Usage; |
34 |
use Text::CSV_XS; |
33 |
use Text::CSV_XS; |
35 |
use Locale::Currency::Format 1.28; |
|
|
36 |
use Encode; |
37 |
use DateTime; |
34 |
use DateTime; |
38 |
use DateTime::Duration; |
35 |
use DateTime::Duration; |
39 |
|
36 |
|
40 |
use C4::Context; |
37 |
use C4::Context; |
41 |
use C4::Debug; |
|
|
42 |
use C4::Letters; |
38 |
use C4::Letters; |
43 |
use C4::Overdues qw(GetFine GetOverdueMessageTransportTypes parse_overdues_letter); |
39 |
use C4::Overdues qw(GetFine GetOverdueMessageTransportTypes parse_overdues_letter); |
44 |
use C4::Budgets qw(GetCurrency); |
|
|
45 |
use C4::Log; |
40 |
use C4::Log; |
46 |
use Koha::Borrower::Debarments qw(AddUniqueDebarment); |
41 |
use Koha::Borrower::Debarments qw(AddUniqueDebarment); |
47 |
use Koha::DateUtils; |
42 |
use Koha::DateUtils; |
Lines 61-66
overdue_notices.pl
Link Here
|
61 |
Options: |
56 |
Options: |
62 |
-help brief help message |
57 |
-help brief help message |
63 |
-man full documentation |
58 |
-man full documentation |
|
|
59 |
-v verbose |
64 |
-n No email will be sent |
60 |
-n No email will be sent |
65 |
-max <days> maximum days overdue to deal with |
61 |
-max <days> maximum days overdue to deal with |
66 |
-library <branchname> only deal with overdues from this library (repeatable : several libraries can be given) |
62 |
-library <branchname> only deal with overdues from this library (repeatable : several libraries can be given) |
Lines 70-75
overdue_notices.pl
Link Here
|
70 |
-itemscontent <list of fields> item information in templates |
66 |
-itemscontent <list of fields> item information in templates |
71 |
-borcat <categorycode> category code that must be included |
67 |
-borcat <categorycode> category code that must be included |
72 |
-borcatout <categorycode> category code that must be excluded |
68 |
-borcatout <categorycode> category code that must be excluded |
|
|
69 |
-t only include triggered overdues |
70 |
-list-all list all overdues |
71 |
-date <yyyy-mm-dd> emulate overdues run for this date |
73 |
-email <email_type> type of email that will be used. Can be 'email', 'emailpro' or 'B_email'. Repeatable. |
72 |
-email <email_type> type of email that will be used. Can be 'email', 'emailpro' or 'B_email'. Repeatable. |
74 |
|
73 |
|
75 |
=head1 OPTIONS |
74 |
=head1 OPTIONS |
Lines 141-151
issues tables.
Link Here
|
141 |
|
140 |
|
142 |
=item B<-borcat> |
141 |
=item B<-borcat> |
143 |
|
142 |
|
144 |
Repetable field, that permit to select only few of patrons categories. |
143 |
Repeatable field, that permits to select only some patron categories. |
145 |
|
144 |
|
146 |
=item B<-borcatout> |
145 |
=item B<-borcatout> |
147 |
|
146 |
|
148 |
Repetable field, permis to exclude some patrons categories. |
147 |
Repeatable field, that permits to exclude some patron categories. |
149 |
|
148 |
|
150 |
=item B<-t> | B<--triggered> |
149 |
=item B<-t> | B<--triggered> |
151 |
|
150 |
|
Lines 250-256
administrator email address.
Link Here
|
250 |
=head1 USAGE EXAMPLES |
249 |
=head1 USAGE EXAMPLES |
251 |
|
250 |
|
252 |
C<overdue_notices.pl> - In this most basic usage, with no command line |
251 |
C<overdue_notices.pl> - In this most basic usage, with no command line |
253 |
arguments, all libraries are procesed individually, and notices are |
252 |
arguments, all libraries are processed individually, and notices are |
254 |
prepared for all patrons with overdue items for whom we have email |
253 |
prepared for all patrons with overdue items for whom we have email |
255 |
addresses. Messages for those patrons for whom we have no email |
254 |
addresses. Messages for those patrons for whom we have no email |
256 |
address are sent in a single attachment to the library administrator's |
255 |
address are sent in a single attachment to the library administrator's |
Lines 447-453
foreach my $branchcode (@branches) {
Link Here
|
447 |
$verbose and warn sprintf "branchcode : '%s' using %s\n", $branchcode, $admin_email_address; |
446 |
$verbose and warn sprintf "branchcode : '%s' using %s\n", $branchcode, $admin_email_address; |
448 |
|
447 |
|
449 |
my $sth2 = $dbh->prepare( <<"END_SQL" ); |
448 |
my $sth2 = $dbh->prepare( <<"END_SQL" ); |
450 |
SELECT biblio.*, items.*, issues.*, biblioitems.itemtype, TO_DAYS($date)-TO_DAYS(date_due) AS days_overdue, branchname |
449 |
SELECT biblio.*, items.*, issues.*, biblioitems.itemtype, branchname |
451 |
FROM issues,items,biblio, biblioitems, branches b |
450 |
FROM issues,items,biblio, biblioitems, branches b |
452 |
WHERE items.itemnumber=issues.itemnumber |
451 |
WHERE items.itemnumber=issues.itemnumber |
453 |
AND biblio.biblionumber = items.biblionumber |
452 |
AND biblio.biblionumber = items.biblionumber |
454 |
- |
|
|