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

(-)a/C4/Reserves.pm (-7 / +8 lines)
Lines 379-386 sub CanItemBeReserved { Link Here
379
    # we retrieve rights
379
    # we retrieve rights
380
    if ( my $rights = GetHoldRule( $borrower->{'categorycode'}, $item->effective_itemtype, $branchcode ) ) {
380
    if ( my $rights = GetHoldRule( $borrower->{'categorycode'}, $item->effective_itemtype, $branchcode ) ) {
381
        $ruleitemtype     = $rights->{itemtype};
381
        $ruleitemtype     = $rights->{itemtype};
382
        $allowedreserves  = $rights->{reservesallowed};
382
        $allowedreserves  = $rights->{reservesallowed} // $allowedreserves;
383
        $holds_per_record = $rights->{holds_per_record};
383
        $holds_per_record = $rights->{holds_per_record} // $holds_per_record;
384
        $holds_per_day    = $rights->{holds_per_day};
384
        $holds_per_day    = $rights->{holds_per_day};
385
    }
385
    }
386
    else {
386
    else {
Lines 2216-2228 sub GetHoldRule { Link Here
2216
            }
2216
            }
2217
        }
2217
        }
2218
    );
2218
    );
2219
    return unless $reservesallowed;;
2220
2219
2221
    my $rules;
2220
    my $rules;
2222
    $rules->{reservesallowed} = $reservesallowed->rule_value;
2221
    if ( $reservesallowed ) {
2223
    $rules->{itemtype}        = $reservesallowed->itemtype;
2222
        $rules->{reservesallowed} = $reservesallowed->rule_value;
2224
    $rules->{categorycode}    = $reservesallowed->categorycode;
2223
        $rules->{itemtype}        = $reservesallowed->itemtype;
2225
    $rules->{branchcode}      = $reservesallowed->branchcode;
2224
        $rules->{categorycode}    = $reservesallowed->categorycode;
2225
        $rules->{branchcode}      = $reservesallowed->branchcode;
2226
    }
2226
2227
2227
    my $holds_per_x_rules = Koha::CirculationRules->get_effective_rules(
2228
    my $holds_per_x_rules = Koha::CirculationRules->get_effective_rules(
2228
        {
2229
        {
(-)a/t/db_dependent/Circulation.t (-7 / +5 lines)
Lines 3358-3364 subtest 'ProcessOfflinePayment() tests' => sub { Link Here
3358
};
3358
};
3359
3359
3360
subtest 'Incremented fee tests' => sub {
3360
subtest 'Incremented fee tests' => sub {
3361
    plan tests => 20;
3361
    plan tests => 19;
3362
3362
3363
    my $dt = dt_from_string();
3363
    my $dt = dt_from_string();
3364
    Time::Fake->offset( $dt->epoch );
3364
    Time::Fake->offset( $dt->epoch );
Lines 3486-3501 subtest 'Incremented fee tests' => sub { Link Here
3486
        'Rental charge reset and retreived correctly' );
3486
        'Rental charge reset and retreived correctly' );
3487
3487
3488
    # Hourly
3488
    # Hourly
3489
    my $issuingrule = Koha::IssuingRules->get_effective_issuing_rule(
3489
    Koha::CirculationRules->set_rule(
3490
        {
3490
        {
3491
            categorycode => $patron->categorycode,
3491
            categorycode => $patron->categorycode,
3492
            itemtype     => $itemtype->id,
3492
            itemtype     => $itemtype->id,
3493
            branchcode   => $library->id
3493
            branchcode   => $library->id,
3494
            rule_name    => 'lengthunit',
3495
            rule_value   => 'hours',
3494
        }
3496
        }
3495
    );
3497
    );
3496
    $issuingrule->lengthunit('hours')->store();
3497
    is( $issuingrule->lengthunit, 'hours',
3498
        'Issuingrule updated and retrieved correctly' );
3499
3498
3500
    $itemtype->rentalcharge_hourly('0.25')->store();
3499
    $itemtype->rentalcharge_hourly('0.25')->store();
3501
    is( $itemtype->rentalcharge_hourly,
3500
    is( $itemtype->rentalcharge_hourly,
Lines 3545-3551 subtest 'Incremented fee tests' => sub { Link Here
3545
        "Hourly rental charge calculated correctly with finesCalendar = noFinesWhenClosed, for renewal (312h - 168h - 0h * 0.25u)" );
3544
        "Hourly rental charge calculated correctly with finesCalendar = noFinesWhenClosed, for renewal (312h - 168h - 0h * 0.25u)" );
3546
    $accountline->delete();
3545
    $accountline->delete();
3547
    $issue->delete();
3546
    $issue->delete();
3548
    $issuingrule->lengthunit('days')->store();
3549
    Time::Fake->reset;
3547
    Time::Fake->reset;
3550
};
3548
};
3551
3549
(-)a/t/db_dependent/Circulation/CalcDateDue.t (-10 / +15 lines)
Lines 157-178 $calendar->delete_holiday( Link Here
157
157
158
# Now we test it does the right thing if the loan and renewal periods
158
# Now we test it does the right thing if the loan and renewal periods
159
# are a multiple of 7 days
159
# are a multiple of 7 days
160
my $dayweek_categorycode = 'C';
160
my $dayweek_categorycode = 'K';
161
my $dayweek_itemtype = 'MX';
161
my $dayweek_itemtype = 'MX';
162
my $dayweek_branchcode = 'FPL';
162
my $dayweek_branchcode = 'FPL';
163
my $dayweek_issuelength = 14;
163
my $dayweek_issuelength = 14;
164
my $dayweek_renewalperiod = 7;
164
my $dayweek_renewalperiod = 7;
165
my $dayweek_lengthunit = 'days';
165
my $dayweek_lengthunit = 'days';
166
166
167
Koha::Database->schema->resultset('Issuingrule')->create({
167
Koha::CirculationRules->set_rules(
168
  categorycode  => $dayweek_categorycode,
168
    {
169
  itemtype      => $dayweek_itemtype,
169
        categorycode => $dayweek_categorycode,
170
  branchcode    => $dayweek_branchcode,
170
        itemtype     => $dayweek_itemtype,
171
  issuelength   => $dayweek_issuelength,
171
        branchcode   => $dayweek_branchcode,
172
  renewalperiod => $dayweek_renewalperiod,
172
        rules        => {
173
  lengthunit    => $dayweek_lengthunit,
173
            issuelength   => $dayweek_issuelength,
174
});
174
            renewalperiod => $dayweek_renewalperiod,
175
my $dayweek_borrower = {categorycode => 'C', dateexpiry => $dateexpiry};
175
            lengthunit    => $dayweek_lengthunit,
176
        }
177
    }
178
);
179
180
my $dayweek_borrower = {categorycode => 'K', dateexpiry => $dateexpiry};
176
181
177
# For issues...
182
# For issues...
178
$start_date = DateTime->new({year => 2013, month => 2, day => 9});
183
$start_date = DateTime->new({year => 2013, month => 2, day => 9});
(-)a/t/db_dependent/Circulation/IssuingRules/maxsuspensiondays.t (-14 / +10 lines)
Lines 109-122 is( Link Here
109
DelDebarment( $debarments->[0]->{borrower_debarment_id} );
109
DelDebarment( $debarments->[0]->{borrower_debarment_id} );
110
110
111
subtest "suspension_chargeperiod" => sub {
111
subtest "suspension_chargeperiod" => sub {
112
    Koha::IssuingRules->search->delete;
112
    Koha::CirculationRules->set_rules(
113
    $builder->build(
114
        {
113
        {
115
            source => 'Issuingrule',
114
            categorycode => undef,
116
            value  => {
115
            itemtype     => undef,
117
                categorycode => '*',
116
            branchcode   => undef,
118
                itemtype     => '*',
117
            rules        => {
119
                branchcode   => '*',
120
                firstremind  => 0,
118
                firstremind  => 0,
121
                finedays     => 7,
119
                finedays     => 7,
122
                lengthunit   => 'days',
120
                lengthunit   => 'days',
Lines 137-150 subtest "suspension_chargeperiod" => sub { Link Here
137
};
135
};
138
136
139
subtest "maxsuspensiondays" => sub {
137
subtest "maxsuspensiondays" => sub {
140
    Koha::IssuingRules->search->delete;
138
    Koha::CirculationRules->set_rules(
141
    $builder->build(
142
        {
139
        {
143
            source => 'Issuingrule',
140
            categorycode => undef,
144
            value  => {
141
            itemtype     => undef,
145
                categorycode => '*',
142
            branchcode   => undef,
146
                itemtype     => '*',
143
            rules        => {
147
                branchcode   => '*',
148
                firstremind  => 0,
144
                firstremind  => 0,
149
                finedays     => 15,
145
                finedays     => 15,
150
                lengthunit   => 'days',
146
                lengthunit   => 'days',
(-)a/t/db_dependent/Circulation/ReturnClaims.t (-7 / +6 lines)
Lines 46-61 my $schema = Koha::Database->schema; Link Here
46
$schema->storage->txn_begin;
46
$schema->storage->txn_begin;
47
47
48
my $builder = t::lib::TestBuilder->new();
48
my $builder = t::lib::TestBuilder->new();
49
Koha::IssuingRules->search->delete;
49
Koha::CirculationRules->set_rule(
50
my $rule = Koha::IssuingRule->new(
51
    {
50
    {
52
        categorycode => '*',
51
        branchcode   => undef,
53
        itemtype     => '*',
52
        categorycode => undef,
54
        branchcode   => '*',
53
        itemtype     => undef,
55
        issuelength  => 1,
54
        rule_name    => 'issuelength',
55
        rule_value   => 1
56
    }
56
    }
57
);
57
);
58
$rule->store();
59
58
60
$branch = $builder->build( { source => 'Branch' } )->{branchcode};
59
$branch = $builder->build( { source => 'Branch' } )->{branchcode};
61
60
(-)a/t/db_dependent/Holds.t (-53 / +20 lines)
Lines 458-464 subtest 'Test max_holds per library/patron category' => sub { Link Here
458
    plan tests => 6;
458
    plan tests => 6;
459
459
460
    $dbh->do('DELETE FROM reserves');
460
    $dbh->do('DELETE FROM reserves');
461
    $dbh->do('DELETE FROM circulation_rules');
462
461
463
    $biblio = $builder->build_sample_biblio;
462
    $biblio = $builder->build_sample_biblio;
464
    ( $item_bibnum, $item_bibitemnum, $itemnumber ) =
463
    ( $item_bibnum, $item_bibitemnum, $itemnumber ) =
Lines 586-593 subtest 'CanItemBeReserved / holds_per_day tests' => sub { Link Here
586
585
587
    Koha::Holds->search->delete;
586
    Koha::Holds->search->delete;
588
    $dbh->do('DELETE FROM issues');
587
    $dbh->do('DELETE FROM issues');
589
    $dbh->do('DELETE FROM issuingrules');
590
    $dbh->do('DELETE FROM circulation_rules');
591
    Koha::Items->search->delete;
588
    Koha::Items->search->delete;
592
    Koha::Biblios->search->delete;
589
    Koha::Biblios->search->delete;
593
590
Lines 753-766 subtest 'CanItemBeReserved / branch_not_in_hold_group' => sub { Link Here
753
    # Cleanup database
750
    # Cleanup database
754
    Koha::Holds->search->delete;
751
    Koha::Holds->search->delete;
755
    $dbh->do('DELETE FROM issues');
752
    $dbh->do('DELETE FROM issues');
756
    $dbh->do('DELETE FROM issuingrules');
753
    Koha::CirculationRules->set_rule(
757
    $dbh->do(
754
        {
758
        q{INSERT INTO issuingrules (categorycode, branchcode, itemtype, reservesallowed)
755
            branchcode   => undef,
759
        VALUES (?, ?, ?, ?)},
756
            categorycode => undef,
760
        {},
757
            itemtype     => undef,
761
        '*', '*', '*', 25
758
            rule_name    => 'reservesallowed',
759
            rule_value   => 25,
760
        }
762
    );
761
    );
763
    $dbh->do('DELETE FROM circulation_rules');
764
762
765
    Koha::Items->search->delete;
763
    Koha::Items->search->delete;
766
    Koha::Biblios->search->delete;
764
    Koha::Biblios->search->delete;
Lines 818-824 subtest 'CanItemBeReserved / branch_not_in_hold_group' => sub { Link Here
818
        {
816
        {
819
            branchcode => undef,
817
            branchcode => undef,
820
            itemtype   => undef,
818
            itemtype   => undef,
821
            categorycode => undef,
822
            rules => {
819
            rules => {
823
                holdallowed => 3,
820
                holdallowed => 3,
824
                hold_fulfillment_policy => 'any',
821
                hold_fulfillment_policy => 'any',
Lines 841-855 subtest 'CanItemBeReserved / branch_not_in_hold_group' => sub { Link Here
841
        'Patron cannot place hold because patron\'s home library is not part of hold group'
838
        'Patron cannot place hold because patron\'s home library is not part of hold group'
842
    );
839
    );
843
840
844
    # Cleanup default_cirt_rules
845
    $dbh->do('DELETE FROM circulation_rules');
846
847
    # Insert default circ rule to "any" for library 2
841
    # Insert default circ rule to "any" for library 2
848
    Koha::CirculationRules->set_rules(
842
    Koha::CirculationRules->set_rules(
849
        {
843
        {
850
            branchcode => $library2->branchcode,
844
            branchcode => $library2->branchcode,
851
            itemtype   => undef,
845
            itemtype   => undef,
852
            categorycode => undef,
853
            rules => {
846
            rules => {
854
                holdallowed => 2,
847
                holdallowed => 2,
855
                hold_fulfillment_policy => 'any',
848
                hold_fulfillment_policy => 'any',
Lines 870-876 subtest 'CanItemBeReserved / branch_not_in_hold_group' => sub { Link Here
870
        {
863
        {
871
            branchcode => $library2->branchcode,
864
            branchcode => $library2->branchcode,
872
            itemtype   => undef,
865
            itemtype   => undef,
873
            categorycode => undef,
874
            rules => {
866
            rules => {
875
                holdallowed => 3,
867
                holdallowed => 3,
876
                hold_fulfillment_policy => 'any',
868
                hold_fulfillment_policy => 'any',
Lines 886-900 subtest 'CanItemBeReserved / branch_not_in_hold_group' => sub { Link Here
886
        'Patron cannot place hold if holdallowed is set to "hold group" for library 2'
878
        'Patron cannot place hold if holdallowed is set to "hold group" for library 2'
887
    );
879
    );
888
880
889
    # Cleanup default_branch_cirt_rules
890
    $dbh->do('DELETE FROM circulation_rules');
891
892
    # Insert default item rule to "any" for itemtype 2
881
    # Insert default item rule to "any" for itemtype 2
893
    Koha::CirculationRules->set_rules(
882
    Koha::CirculationRules->set_rules(
894
        {
883
        {
895
            branchcode => undef,
884
            branchcode => $library2->branchcode,
896
            itemtype   => $itemtype2->itemtype,
885
            itemtype   => $itemtype2->itemtype,
897
            categorycode => undef,
898
            rules => {
886
            rules => {
899
                holdallowed => 2,
887
                holdallowed => 2,
900
                hold_fulfillment_policy => 'any',
888
                hold_fulfillment_policy => 'any',
Lines 913-921 subtest 'CanItemBeReserved / branch_not_in_hold_group' => sub { Link Here
913
    # Update default item rule to "hold group" for itemtype 2
901
    # Update default item rule to "hold group" for itemtype 2
914
    Koha::CirculationRules->set_rules(
902
    Koha::CirculationRules->set_rules(
915
        {
903
        {
916
            branchcode => undef,
904
            branchcode => $library2->branchcode,
917
            itemtype   => $itemtype2->itemtype,
905
            itemtype   => $itemtype2->itemtype,
918
            categorycode => undef,
919
            rules => {
906
            rules => {
920
                holdallowed => 3,
907
                holdallowed => 3,
921
                hold_fulfillment_policy => 'any',
908
                hold_fulfillment_policy => 'any',
Lines 931-945 subtest 'CanItemBeReserved / branch_not_in_hold_group' => sub { Link Here
931
        'Patron cannot place hold if holdallowed is set to "hold group" for itemtype 2'
918
        'Patron cannot place hold if holdallowed is set to "hold group" for itemtype 2'
932
    );
919
    );
933
920
934
    # Cleanup default_branch_item_rules
935
    $dbh->do('DELETE FROM circulation_rules');
936
937
    # Insert branch item rule to "any" for itemtype 2 and library 2
921
    # Insert branch item rule to "any" for itemtype 2 and library 2
938
    Koha::CirculationRules->set_rules(
922
    Koha::CirculationRules->set_rules(
939
        {
923
        {
940
            branchcode => $library2->branchcode,
924
            branchcode => $library2->branchcode,
941
            itemtype   => $itemtype2->itemtype,
925
            itemtype   => $itemtype2->itemtype,
942
            categorycode => undef,
943
            rules => {
926
            rules => {
944
                holdallowed => 2,
927
                holdallowed => 2,
945
                hold_fulfillment_policy => 'any',
928
                hold_fulfillment_policy => 'any',
Lines 960-966 subtest 'CanItemBeReserved / branch_not_in_hold_group' => sub { Link Here
960
        {
943
        {
961
            branchcode => $library2->branchcode,
944
            branchcode => $library2->branchcode,
962
            itemtype   => $itemtype2->itemtype,
945
            itemtype   => $itemtype2->itemtype,
963
            categorycode => undef,
964
            rules => {
946
            rules => {
965
                holdallowed => 3,
947
                holdallowed => 3,
966
                hold_fulfillment_policy => 'any',
948
                hold_fulfillment_policy => 'any',
Lines 988-1001 subtest 'CanItemBeReserved / pickup_not_in_hold_group' => sub { Link Here
988
    # Cleanup database
970
    # Cleanup database
989
    Koha::Holds->search->delete;
971
    Koha::Holds->search->delete;
990
    $dbh->do('DELETE FROM issues');
972
    $dbh->do('DELETE FROM issues');
991
    $dbh->do('DELETE FROM issuingrules');
973
    Koha::CirculationRules->set_rule(
992
    $dbh->do(
974
        {
993
        q{INSERT INTO issuingrules (categorycode, branchcode, itemtype, reservesallowed)
975
            branchcode   => undef,
994
        VALUES (?, ?, ?, ?)},
976
            categorycode => undef,
995
        {},
977
            itemtype     => undef,
996
        '*', '*', '*', 25
978
            rule_name    => 'reservesallowed',
979
            rule_value   => 25,
980
        }
997
    );
981
    );
998
    $dbh->do('DELETE FROM circulation_rules');
999
982
1000
    Koha::Items->search->delete;
983
    Koha::Items->search->delete;
1001
    Koha::Biblios->search->delete;
984
    Koha::Biblios->search->delete;
Lines 1053-1059 subtest 'CanItemBeReserved / pickup_not_in_hold_group' => sub { Link Here
1053
        {
1036
        {
1054
            branchcode => undef,
1037
            branchcode => undef,
1055
            itemtype   => undef,
1038
            itemtype   => undef,
1056
            categorycode => undef,
1057
            rules => {
1039
            rules => {
1058
                holdallowed => 2,
1040
                holdallowed => 2,
1059
                hold_fulfillment_policy => 'holdgroup',
1041
                hold_fulfillment_policy => 'holdgroup',
Lines 1076-1090 subtest 'CanItemBeReserved / pickup_not_in_hold_group' => sub { Link Here
1076
        'Patron cannot place hold because pickup location is not part of hold group'
1058
        'Patron cannot place hold because pickup location is not part of hold group'
1077
    );
1059
    );
1078
1060
1079
    # Cleanup default_cirt_rules
1080
    $dbh->do('DELETE FROM circulation_rules');
1081
1082
    # Insert default circ rule to "any" for library 2
1061
    # Insert default circ rule to "any" for library 2
1083
    Koha::CirculationRules->set_rules(
1062
    Koha::CirculationRules->set_rules(
1084
        {
1063
        {
1085
            branchcode => $library2->branchcode,
1064
            branchcode => $library2->branchcode,
1086
            itemtype   => undef,
1065
            itemtype   => undef,
1087
            categorycode => undef,
1088
            rules => {
1066
            rules => {
1089
                holdallowed => 2,
1067
                holdallowed => 2,
1090
                hold_fulfillment_policy => 'any',
1068
                hold_fulfillment_policy => 'any',
Lines 1105-1111 subtest 'CanItemBeReserved / pickup_not_in_hold_group' => sub { Link Here
1105
        {
1083
        {
1106
            branchcode => $library2->branchcode,
1084
            branchcode => $library2->branchcode,
1107
            itemtype   => undef,
1085
            itemtype   => undef,
1108
            categorycode => undef,
1109
            rules => {
1086
            rules => {
1110
                holdallowed => 2,
1087
                holdallowed => 2,
1111
                hold_fulfillment_policy => 'holdgroup',
1088
                hold_fulfillment_policy => 'holdgroup',
Lines 1121-1135 subtest 'CanItemBeReserved / pickup_not_in_hold_group' => sub { Link Here
1121
        'Patron cannot place hold if hold_fulfillment_policy is set to "hold group" for library 2'
1098
        'Patron cannot place hold if hold_fulfillment_policy is set to "hold group" for library 2'
1122
    );
1099
    );
1123
1100
1124
    # Cleanup default_branch_cirt_rules
1125
    $dbh->do('DELETE FROM circulation_rules');
1126
1127
    # Insert default item rule to "any" for itemtype 2
1101
    # Insert default item rule to "any" for itemtype 2
1128
    Koha::CirculationRules->set_rules(
1102
    Koha::CirculationRules->set_rules(
1129
        {
1103
        {
1130
            branchcode => undef,
1104
            branchcode => $library2->branchcode,
1131
            itemtype   => $itemtype2->itemtype,
1105
            itemtype   => $itemtype2->itemtype,
1132
            categorycode => undef,
1133
            rules => {
1106
            rules => {
1134
                holdallowed => 2,
1107
                holdallowed => 2,
1135
                hold_fulfillment_policy => 'any',
1108
                hold_fulfillment_policy => 'any',
Lines 1148-1156 subtest 'CanItemBeReserved / pickup_not_in_hold_group' => sub { Link Here
1148
    # Update default item rule to "hold group" for itemtype 2
1121
    # Update default item rule to "hold group" for itemtype 2
1149
    Koha::CirculationRules->set_rules(
1122
    Koha::CirculationRules->set_rules(
1150
        {
1123
        {
1151
            branchcode => undef,
1124
            branchcode => $library2->branchcode,
1152
            itemtype   => $itemtype2->itemtype,
1125
            itemtype   => $itemtype2->itemtype,
1153
            categorycode => undef,
1154
            rules => {
1126
            rules => {
1155
                holdallowed => 2,
1127
                holdallowed => 2,
1156
                hold_fulfillment_policy => 'holdgroup',
1128
                hold_fulfillment_policy => 'holdgroup',
Lines 1166-1180 subtest 'CanItemBeReserved / pickup_not_in_hold_group' => sub { Link Here
1166
        'Patron cannot place hold if hold_fulfillment_policy is set to "hold group" for itemtype 2'
1138
        'Patron cannot place hold if hold_fulfillment_policy is set to "hold group" for itemtype 2'
1167
    );
1139
    );
1168
1140
1169
    # Cleanup default_branch_item_rules
1170
    $dbh->do('DELETE FROM circulation_rules');
1171
1172
    # Insert branch item rule to "any" for itemtype 2 and library 2
1141
    # Insert branch item rule to "any" for itemtype 2 and library 2
1173
    Koha::CirculationRules->set_rules(
1142
    Koha::CirculationRules->set_rules(
1174
        {
1143
        {
1175
            branchcode => $library2->branchcode,
1144
            branchcode => $library2->branchcode,
1176
            itemtype   => $itemtype2->itemtype,
1145
            itemtype   => $itemtype2->itemtype,
1177
            categorycode => undef,
1178
            rules => {
1146
            rules => {
1179
                holdallowed => 2,
1147
                holdallowed => 2,
1180
                hold_fulfillment_policy => 'any',
1148
                hold_fulfillment_policy => 'any',
Lines 1195-1201 subtest 'CanItemBeReserved / pickup_not_in_hold_group' => sub { Link Here
1195
        {
1163
        {
1196
            branchcode => $library2->branchcode,
1164
            branchcode => $library2->branchcode,
1197
            itemtype   => $itemtype2->itemtype,
1165
            itemtype   => $itemtype2->itemtype,
1198
            categorycode => undef,
1199
            rules => {
1166
            rules => {
1200
                holdallowed => 2,
1167
                holdallowed => 2,
1201
                hold_fulfillment_policy => 'holdgroup',
1168
                hold_fulfillment_policy => 'holdgroup',
(-)a/t/db_dependent/Holds/DisallowHoldIfItemsAvailable.t (-1 lines)
Lines 239-245 sub set_holdallowed_rule { Link Here
239
    Koha::CirculationRules->set_rules(
239
    Koha::CirculationRules->set_rules(
240
        {
240
        {
241
            branchcode   => $branchcode || undef,
241
            branchcode   => $branchcode || undef,
242
            categorycode => undef,
243
            itemtype     => undef,
242
            itemtype     => undef,
244
            rules        => {
243
            rules        => {
245
                holdallowed              => $holdallowed,
244
                holdallowed              => $holdallowed,
(-)a/t/db_dependent/Koha/Charges/Fees.t (-6 / +7 lines)
Lines 364-378 subtest 'accumulate_rentalcharge tests' => sub { Link Here
364
    );
364
    );
365
365
366
    # Hourly tests
366
    # Hourly tests
367
    my $issuingrule = Koha::IssuingRules->get_effective_issuing_rule(
367
    Koha::CirculationRules->set_rules({
368
        {
369
            categorycode => $patron->categorycode,
368
            categorycode => $patron->categorycode,
370
            itemtype     => $itemtype->id,
369
            itemtype     => $itemtype->id,
371
            branchcode   => $library->id
370
            branchcode   => $library->id,
371
            rules => {
372
                lengthunit => 'hours',
373
            }
372
        }
374
        }
375
373
    );
376
    );
374
    $issuingrule->lengthunit('hours');
377
375
    $issuingrule->store();
376
    $itemtype->rentalcharge_hourly("0.25");
378
    $itemtype->rentalcharge_hourly("0.25");
377
    $itemtype->store();
379
    $itemtype->store();
378
380
379
- 

Return to bug 18936