Lines 99-121
sub new {
Link Here
|
99 |
$dexpiry and $dexpiry =~ s/-//g; # YYYYMMDD |
99 |
$dexpiry and $dexpiry =~ s/-//g; # YYYYMMDD |
100 |
|
100 |
|
101 |
# Get fines and add fines for guarantees (depends on preference NoIssuesChargeGuarantees) |
101 |
# Get fines and add fines for guarantees (depends on preference NoIssuesChargeGuarantees) |
102 |
my $patron_charge_limits = $patron->is_patron_inside_charge_limits( { patron => $patron } ); |
102 |
my $patron_charge_limits = $patron->is_patron_inside_charge_limits(); |
103 |
my $fines_amount = $patron_charge_limits->{noissuescharge}->{charge}; |
103 |
my $fines_amount = $patron_charge_limits->{noissuescharge}->{charge}; |
104 |
my $personal_fines_amount = $fines_amount; |
104 |
my $personal_fines_amount = $fines_amount; |
105 |
my $fee_limit = $patron_charge_limits->{noissuescharge}->{limit} || 5; |
105 |
my $fee_limit = $patron_charge_limits->{noissuescharge}->{limit} || 5; |
106 |
my $noissueschargeguarantorswithguarantees = $patron_charge_limits->{NoIssuesChargeGuarantorsWithGuarantees}->{limit}; |
106 |
my $noissueschargeguarantorswithguarantees = |
|
|
107 |
$patron_charge_limits->{NoIssuesChargeGuarantorsWithGuarantees}->{limit}; |
107 |
my $noissueschargeguarantees = $patron_charge_limits->{NoIssuesChargeGuarantees}->{limit}; |
108 |
my $noissueschargeguarantees = $patron_charge_limits->{NoIssuesChargeGuarantees}->{limit}; |
|
|
109 |
|
108 |
my $fines_msg = ""; |
110 |
my $fines_msg = ""; |
109 |
my $fine_blocked = 0; |
111 |
my $fine_blocked = 0; |
110 |
if( $patron_charge_limits->{noissuescharge}->{overlimit} ){ |
112 |
if ( $patron_charge_limits->{noissuescharge}->{overlimit} ) { |
111 |
$fine_blocked = 1; |
113 |
$fine_blocked = 1; |
112 |
$fines_msg .= " -- " . "Patron blocked by fines" if $fine_blocked; |
114 |
$fines_msg .= " -- " . "Patron blocked by fines" if $fine_blocked; |
113 |
} elsif ( $noissueschargeguarantorswithguarantees ) { |
115 |
} elsif ($noissueschargeguarantorswithguarantees) { |
114 |
$fines_amount = $patron_charge_limits->{NoIssuesChargeGuarantorsWithGuarantees}->{charge}; |
116 |
$fines_amount = $patron_charge_limits->{NoIssuesChargeGuarantorsWithGuarantees}->{charge}; |
115 |
$fine_blocked = $patron_charge_limits->{NoIssuesChargeGuarantorsWithGuarantees}->{overlimit}; |
117 |
$fine_blocked = $patron_charge_limits->{NoIssuesChargeGuarantorsWithGuarantees}->{overlimit}; |
116 |
$fines_msg .= " -- " . "Patron blocked by fines ($fines_amount) on related accounts" if $fine_blocked; |
118 |
$fines_msg .= " -- " . "Patron blocked by fines ($fines_amount) on related accounts" if $fine_blocked; |
117 |
} elsif ( $noissueschargeguarantees ) { |
119 |
} elsif ($noissueschargeguarantees) { |
118 |
if( $patron->guarantee_relationships->count ){ |
120 |
if ( $patron->guarantee_relationships->count ) { |
119 |
$fines_amount += $patron_charge_limits->{NoIssuesChargeGuarantees}->{charge}; |
121 |
$fines_amount += $patron_charge_limits->{NoIssuesChargeGuarantees}->{charge}; |
120 |
$fine_blocked = $patron_charge_limits->{NoIssuesChargeGuarantees}->{overlimit}; |
122 |
$fine_blocked = $patron_charge_limits->{NoIssuesChargeGuarantees}->{overlimit}; |
121 |
$fines_msg .= " -- " . "Patron blocked by fines ($fines_amount) on guaranteed accounts" if $fine_blocked; |
123 |
$fines_msg .= " -- " . "Patron blocked by fines ($fines_amount) on guaranteed accounts" if $fine_blocked; |