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

(-)a/misc/cronjobs/thirdparty/TalkingTech_itiva_outbound.pl (-15 / +27 lines)
Lines 53-59 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
my $skip_patrons_with_field_match;
57
57
58
# maps to convert I-tiva terms to Koha terms
58
# maps to convert I-tiva terms to Koha terms
59
my $type_module_map = {
59
my $type_module_map = {
Lines 69-84 my $type_notice_map = { Link Here
69
};
69
};
70
70
71
GetOptions(
71
GetOptions(
72
    'o|output:s'                 => \$outfile,
72
    'o|output:s'                   => \$outfile,
73
    'v'                          => \$verbose,
73
    'v'                            => \$verbose,
74
    'lang:s'                     => \$language,
74
    'lang:s'                       => \$language,
75
    'type:s'                     => \@types,
75
    'type:s'                       => \@types,
76
    'w|waiting-hold-day:s'       => \@holds_waiting_days_to_call,
76
    'w|waiting-hold-day:s'         => \@holds_waiting_days_to_call,
77
    'c|code|library-code:s'      => \$library_code,
77
    'c|code|library-code:s'        => \$library_code,
78
    's|skip-patrons-with-email'  => \$skip_patrons_with_email,
78
    's|skip-patrons-with-email'    => \$skip_patrons_with_email,
79
    'i|if-patron-field-equals:s' => \$if_patron_field_equals,
79
    'sf|skip-patrons-with-field:s' => \$skip_patrons_with_field_match,
80
    'pb|patron-branchcode:s'     => \$patron_branchcode,
80
    'pb|patron-branchcode:s'       => \$patron_branchcode,
81
    'h|help'                     => \$help,
81
    'h|help'                       => \$help,
82
);
82
);
83
83
84
$language = uc($language);
84
$language = uc($language);
Lines 104-111 if ( defined $outfile ) { Link Here
104
my $format = 'V';    # format for phone notifications
104
my $format = 'V';    # format for phone notifications
105
105
106
my ( $if_patron_field_equals_field, $if_patron_field_equals_value );
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 )
107
( $if_patron_field_equals_field, $if_patron_field_equals_value ) = split( /:/, $skip_patrons_with_field_match )
108
    if $if_patron_field_equals;
108
    if $skip_patrons_with_field_match;
109
109
110
foreach my $type (@types) {
110
foreach my $type (@types) {
111
    $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
Lines 130-136 foreach my $type (@types) { Link Here
130
        $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;
131
        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
132
        next
133
            if $if_patron_field_equals
133
            if $skip_patrons_with_field_match
134
            && $patrons->{ $issues->{borrowernumber} }->$if_patron_field_equals_field eq $if_patron_field_equals_value;
134
            && $patrons->{ $issues->{borrowernumber} }->$if_patron_field_equals_field eq $if_patron_field_equals_value;
135
135
136
        my $date_dt = dt_from_string ( $issues->{'date_due'} );
136
        my $date_dt = dt_from_string ( $issues->{'date_due'} );
Lines 226-231 consortium purposes and apply library specific settings, such as Link Here
226
prompts, to those notices.
226
prompts, to those notices.
227
This field can be blank if all messages are from a single library.
227
This field can be blank if all messages are from a single library.
228
228
229
=item B<--skip-patrons-with-email> B<-s>
230
231
OPTIONAL
232
233
Flag used to skip all patrons with a valid notice email address defined
234
235
=item B<--skip-patrons-with-field> B<-sf>
236
237
OPTIONAL
238
239
A colon delimited string with a field from the borrowers table and a value to match,
240
used to skip notice processing.  Example `sort1:SKIP`
241
229
=item B<--patron-branchcode> B<--pb>
242
=item B<--patron-branchcode> B<--pb>
230
243
231
OPTIONAL
244
OPTIONAL
232
- 

Return to bug 34854