|
Lines 25-47
use JSON qw( to_json );
Link Here
|
| 25 |
use Unicode::Normalize qw( NFKD ); |
25 |
use Unicode::Normalize qw( NFKD ); |
| 26 |
use Try::Tiny; |
26 |
use Try::Tiny; |
| 27 |
|
27 |
|
| 28 |
use C4::Context; |
|
|
| 29 |
use C4::Auth qw( checkpw_hash ); |
28 |
use C4::Auth qw( checkpw_hash ); |
|
|
29 |
use C4::Context; |
| 30 |
use C4::Letters qw( GetPreparedLetter EnqueueLetter SendQueuedMessages ); |
| 30 |
use C4::Log qw( logaction ); |
31 |
use C4::Log qw( logaction ); |
| 31 |
use Koha::Account; |
32 |
use Koha::Account; |
| 32 |
use Koha::ArticleRequests; |
33 |
use Koha::ArticleRequests; |
| 33 |
use C4::Letters qw( GetPreparedLetter EnqueueLetter SendQueuedMessages ); |
|
|
| 34 |
use Koha::AuthUtils; |
34 |
use Koha::AuthUtils; |
| 35 |
use Koha::Checkouts; |
35 |
use Koha::Checkouts; |
| 36 |
use Koha::CirculationRules; |
36 |
use Koha::CirculationRules; |
| 37 |
use Koha::Club::Enrollments; |
37 |
use Koha::Club::Enrollments; |
|
|
38 |
use Koha::CurbsidePickups; |
| 38 |
use Koha::Database; |
39 |
use Koha::Database; |
| 39 |
use Koha::DateUtils qw( dt_from_string ); |
40 |
use Koha::DateUtils qw( dt_from_string ); |
| 40 |
use Koha::Encryption; |
41 |
use Koha::Encryption; |
| 41 |
use Koha::Exceptions::Password; |
42 |
use Koha::Exceptions::Password; |
| 42 |
use Koha::Holds; |
43 |
use Koha::Holds; |
| 43 |
use Koha::CurbsidePickups; |
|
|
| 44 |
use Koha::Old::Checkouts; |
44 |
use Koha::Old::Checkouts; |
|
|
45 |
use Koha::OverdueRules; |
| 45 |
use Koha::Patron::Attributes; |
46 |
use Koha::Patron::Attributes; |
| 46 |
use Koha::Patron::Categories; |
47 |
use Koha::Patron::Categories; |
| 47 |
use Koha::Patron::Debarments; |
48 |
use Koha::Patron::Debarments; |
|
Lines 1058-1080
sub _get_overdue_debarred_delay {
Link Here
|
| 1058 |
my ($branchcode, $categorycode) = @_; |
1059 |
my ($branchcode, $categorycode) = @_; |
| 1059 |
my $dbh = C4::Context->dbh(); |
1060 |
my $dbh = C4::Context->dbh(); |
| 1060 |
|
1061 |
|
| 1061 |
my $query = "SELECT * FROM overduerules WHERE delay1 IS NOT NULL AND branchcode = ? AND categorycode = ?"; |
|
|
| 1062 |
|
| 1063 |
my $rqoverduerules = $dbh->prepare($query); |
| 1064 |
$rqoverduerules->execute($branchcode, $categorycode); |
| 1065 |
|
| 1066 |
# We get default rules if there is no rule for this branch |
1062 |
# We get default rules if there is no rule for this branch |
| 1067 |
if($rqoverduerules->rows == 0) { |
1063 |
my $rule = Koha::OverdueRules->find( |
| 1068 |
$query = "SELECT * FROM overduerules WHERE delay1 IS NOT NULL AND branchcode = '' AND categorycode = ?"; |
1064 |
{ |
| 1069 |
|
1065 |
branchcode => $branchcode, |
| 1070 |
$rqoverduerules = $dbh->prepare($query); |
1066 |
categorycode => $categorycode |
| 1071 |
$rqoverduerules->execute($categorycode); |
1067 |
} |
| 1072 |
} |
1068 |
) |
|
|
1069 |
|| Koha::OverdueRules->find( |
| 1070 |
{ |
| 1071 |
branchcode => q{}, |
| 1072 |
categorycode => $categorycode |
| 1073 |
} |
| 1074 |
); |
| 1073 |
|
1075 |
|
| 1074 |
while ( my $overdue_rules = $rqoverduerules->fetchrow_hashref ) { |
1076 |
if ( $rule ) { |
| 1075 |
return $overdue_rules->{"delay1"} if($overdue_rules->{"debarred1"}); |
1077 |
return $rule->delay1 if $rule->debarred1; |
| 1076 |
return $overdue_rules->{"delay2"} if($overdue_rules->{"debarred2"}); |
1078 |
return $rule->delay2 if $rule->debarred2; |
| 1077 |
return $overdue_rules->{"delay3"} if($overdue_rules->{"debarred3"}); |
1079 |
return $rule->delay3 if $rule->debarred3; |
| 1078 |
} |
1080 |
} |
| 1079 |
} |
1081 |
} |
| 1080 |
|
1082 |
|