Lines 53-58
my $help;
Link Here
|
53 |
my $outfile; |
53 |
my $outfile; |
54 |
my $skip_patrons_with_email; |
54 |
my $skip_patrons_with_email; |
55 |
my $patron_branchcode; |
55 |
my $patron_branchcode; |
|
|
56 |
my $if_patron_field_equals; |
56 |
|
57 |
|
57 |
# maps to convert I-tiva terms to Koha terms |
58 |
# maps to convert I-tiva terms to Koha terms |
58 |
my $type_module_map = { |
59 |
my $type_module_map = { |
Lines 68-82
my $type_notice_map = {
Link Here
|
68 |
}; |
69 |
}; |
69 |
|
70 |
|
70 |
GetOptions( |
71 |
GetOptions( |
71 |
'o|output:s' => \$outfile, |
72 |
'o|output:s' => \$outfile, |
72 |
'v' => \$verbose, |
73 |
'v' => \$verbose, |
73 |
'lang:s' => \$language, |
74 |
'lang:s' => \$language, |
74 |
'type:s' => \@types, |
75 |
'type:s' => \@types, |
75 |
'w|waiting-hold-day:s' => \@holds_waiting_days_to_call, |
76 |
'w|waiting-hold-day:s' => \@holds_waiting_days_to_call, |
76 |
'c|code|library-code:s' => \$library_code, |
77 |
'c|code|library-code:s' => \$library_code, |
77 |
's|skip-patrons-with-email' => \$skip_patrons_with_email, |
78 |
's|skip-patrons-with-email' => \$skip_patrons_with_email, |
78 |
'pb|patron-branchcode:s' => \$patron_branchcode, |
79 |
'i|if-patron-field-equals:s' => \$if_patron_field_equals, |
79 |
'h|help' => \$help, |
80 |
'pb|patron-branchcode:s' => \$patron_branchcode, |
|
|
81 |
'h|help' => \$help, |
80 |
); |
82 |
); |
81 |
|
83 |
|
82 |
$language = uc($language); |
84 |
$language = uc($language); |
Lines 101-106
if ( defined $outfile ) {
Link Here
|
101 |
|
103 |
|
102 |
my $format = 'V'; # format for phone notifications |
104 |
my $format = 'V'; # format for phone notifications |
103 |
|
105 |
|
|
|
106 |
my ( $if_patron_field_equals_field, $if_patron_field_equals_value ); |
107 |
( $if_patron_field_equals_field, $if_patron_field_equals_value ) = split( /:/, $if_patron_field_equals ) |
108 |
if $if_patron_field_equals; |
109 |
|
104 |
foreach my $type (@types) { |
110 |
foreach my $type (@types) { |
105 |
$type = uc($type); #just in case lower or mixed-case was supplied |
111 |
$type = uc($type); #just in case lower or mixed-case was supplied |
106 |
my $module = $type_module_map->{$type}; #since the module is required to get the letter |
112 |
my $module = $type_module_map->{$type}; #since the module is required to get the letter |
Lines 122-128
foreach my $type (@types) {
Link Here
|
122 |
my $patrons; |
128 |
my $patrons; |
123 |
foreach my $issues (@loop) { |
129 |
foreach my $issues (@loop) { |
124 |
$patrons->{$issues->{borrowernumber}} ||= Koha::Patrons->find( $issues->{borrowernumber} ) if $skip_patrons_with_email; |
130 |
$patrons->{$issues->{borrowernumber}} ||= Koha::Patrons->find( $issues->{borrowernumber} ) if $skip_patrons_with_email; |
125 |
next if $skip_patrons_with_email && $patrons->{$issues->{borrowernumber}}->notice_email_address; |
131 |
next if $skip_patrons_with_email && $patrons->{ $issues->{borrowernumber} }->notice_email_address; |
|
|
132 |
next |
133 |
if $if_patron_field_equals |
134 |
&& $patrons->{ $issues->{borrowernumber} }->$if_patron_field_equals_field eq $if_patron_field_equals_value; |
126 |
|
135 |
|
127 |
my $date_dt = dt_from_string ( $issues->{'date_due'} ); |
136 |
my $date_dt = dt_from_string ( $issues->{'date_due'} ); |
128 |
my $due_date = output_pref( { dt => $date_dt, dateonly => 1, dateformat =>'metric' } ); |
137 |
my $due_date = output_pref( { dt => $date_dt, dateonly => 1, dateformat =>'metric' } ); |
129 |
- |
|
|