|
Lines 1764-1770
subtest 'AddReturn + CumulativeRestrictionPeriods' => sub {
Link Here
|
| 1764 |
}; |
1764 |
}; |
| 1765 |
|
1765 |
|
| 1766 |
subtest 'AddReturn + suspension_chargeperiod' => sub { |
1766 |
subtest 'AddReturn + suspension_chargeperiod' => sub { |
| 1767 |
plan tests => 12; |
1767 |
plan tests => 14; |
| 1768 |
|
1768 |
|
| 1769 |
my $library = $builder->build( { source => 'Branch' } ); |
1769 |
my $library = $builder->build( { source => 'Branch' } ); |
| 1770 |
my $patron = $builder->build( { source => 'Borrower', value => { categorycode => $patron_category->{categorycode} } } ); |
1770 |
my $patron = $builder->build( { source => 'Borrower', value => { categorycode => $patron_category->{categorycode} } } ); |
|
Lines 1915-1920
subtest 'AddReturn + suspension_chargeperiod' => sub {
Link Here
|
| 1915 |
expiration_date => $expected_expiration_dt->clone->add( days => 1 ), |
1915 |
expiration_date => $expected_expiration_dt->clone->add( days => 1 ), |
| 1916 |
} |
1916 |
} |
| 1917 |
); |
1917 |
); |
|
|
1918 |
|
| 1919 |
test_debarment_on_checkout( |
| 1920 |
{ |
| 1921 |
item => $item_1, |
| 1922 |
library => $library, |
| 1923 |
patron => $patron, |
| 1924 |
return_date => dt_from_string->add(days => 5), |
| 1925 |
expiration_date => dt_from_string->add(days => 5 + (5 * 2 - 1) ), |
| 1926 |
} |
| 1927 |
); |
| 1918 |
}; |
1928 |
}; |
| 1919 |
|
1929 |
|
| 1920 |
subtest 'AddReturn | is_overdue' => sub { |
1930 |
subtest 'AddReturn | is_overdue' => sub { |
|
Lines 2261-2266
sub test_debarment_on_checkout {
Link Here
|
| 2261 |
my $library = $params->{library}; |
2271 |
my $library = $params->{library}; |
| 2262 |
my $patron = $params->{patron}; |
2272 |
my $patron = $params->{patron}; |
| 2263 |
my $due_date = $params->{due_date} || dt_from_string; |
2273 |
my $due_date = $params->{due_date} || dt_from_string; |
|
|
2274 |
my $return_date = $params->{return_date} || dt_from_string; |
| 2264 |
my $expected_expiration_date = $params->{expiration_date}; |
2275 |
my $expected_expiration_date = $params->{expiration_date}; |
| 2265 |
|
2276 |
|
| 2266 |
$expected_expiration_date = output_pref( |
2277 |
$expected_expiration_date = output_pref( |
|
Lines 2275-2281
sub test_debarment_on_checkout {
Link Here
|
| 2275 |
AddIssue( $patron, $item->{barcode}, $due_date ); |
2286 |
AddIssue( $patron, $item->{barcode}, $due_date ); |
| 2276 |
|
2287 |
|
| 2277 |
AddReturn( $item->{barcode}, $library->{branchcode}, |
2288 |
AddReturn( $item->{barcode}, $library->{branchcode}, |
| 2278 |
undef, undef, dt_from_string ); |
2289 |
undef, undef, $return_date ); |
| 2279 |
my $debarments = Koha::Patron::Debarments::GetDebarments( |
2290 |
my $debarments = Koha::Patron::Debarments::GetDebarments( |
| 2280 |
{ borrowernumber => $patron->{borrowernumber}, type => 'SUSPENSION' } ); |
2291 |
{ borrowernumber => $patron->{borrowernumber}, type => 'SUSPENSION' } ); |
| 2281 |
is( scalar(@$debarments), 1, 'Test at line ' . $line_number ); |
2292 |
is( scalar(@$debarments), 1, 'Test at line ' . $line_number ); |
| 2282 |
- |
|
|