|
Lines 156-162
my $itemtype = $builder->build(
Link Here
|
| 156 |
rentalcharge => 0, |
156 |
rentalcharge => 0, |
| 157 |
rentalcharge_daily => 0, |
157 |
rentalcharge_daily => 0, |
| 158 |
defaultreplacecost => undef, |
158 |
defaultreplacecost => undef, |
| 159 |
processfee => undef |
|
|
| 160 |
} |
159 |
} |
| 161 |
} |
160 |
} |
| 162 |
)->{itemtype}; |
161 |
)->{itemtype}; |
|
Lines 1185-1191
subtest "CanBookBeRenewed tests" => sub {
Link Here
|
| 1185 |
); |
1184 |
); |
| 1186 |
|
1185 |
|
| 1187 |
my $ten_days_before = dt_from_string->add( days => -10 ); |
1186 |
my $ten_days_before = dt_from_string->add( days => -10 ); |
| 1188 |
my $ten_days_ahead = dt_from_string->add( days => 10 ); |
1187 |
my $ten_days_ahead = dt_from_string->add( days => 10 ); |
| 1189 |
my $issue = AddIssue( |
1188 |
my $issue = AddIssue( |
| 1190 |
$renewing_borrower_obj, $item_to_auto_renew->barcode, $ten_days_ahead, undef, $ten_days_before, |
1189 |
$renewing_borrower_obj, $item_to_auto_renew->barcode, $ten_days_ahead, undef, $ten_days_before, |
| 1191 |
undef, { auto_renew => 1 } |
1190 |
undef, { auto_renew => 1 } |
|
Lines 1335-1341
subtest "CanBookBeRenewed tests" => sub {
Link Here
|
| 1335 |
); |
1334 |
); |
| 1336 |
|
1335 |
|
| 1337 |
my $ten_days_before = dt_from_string->add( days => -10 ); |
1336 |
my $ten_days_before = dt_from_string->add( days => -10 ); |
| 1338 |
my $ten_days_ahead = dt_from_string->add( days => 10 ); |
1337 |
my $ten_days_ahead = dt_from_string->add( days => 10 ); |
| 1339 |
my $issue = AddIssue( |
1338 |
my $issue = AddIssue( |
| 1340 |
$renewing_borrower_obj, $item_to_auto_renew->barcode, $ten_days_ahead, undef, $ten_days_before, |
1339 |
$renewing_borrower_obj, $item_to_auto_renew->barcode, $ten_days_ahead, undef, $ten_days_before, |
| 1341 |
undef, { auto_renew => 1 } |
1340 |
undef, { auto_renew => 1 } |
|
Lines 1445-1451
subtest "CanBookBeRenewed tests" => sub {
Link Here
|
| 1445 |
); |
1444 |
); |
| 1446 |
|
1445 |
|
| 1447 |
my $ten_days_before = dt_from_string->add( days => -10 ); |
1446 |
my $ten_days_before = dt_from_string->add( days => -10 ); |
| 1448 |
my $ten_days_ahead = dt_from_string->add( days => 10 ); |
1447 |
my $ten_days_ahead = dt_from_string->add( days => 10 ); |
| 1449 |
|
1448 |
|
| 1450 |
# Patron is expired and BlockExpiredPatronOpacActions='' |
1449 |
# Patron is expired and BlockExpiredPatronOpacActions='' |
| 1451 |
# => auto renew is allowed |
1450 |
# => auto renew is allowed |
|
Lines 1497-1503
subtest "CanBookBeRenewed tests" => sub {
Link Here
|
| 1497 |
); |
1496 |
); |
| 1498 |
|
1497 |
|
| 1499 |
my $ten_days_before = dt_from_string->add( days => -10 ); |
1498 |
my $ten_days_before = dt_from_string->add( days => -10 ); |
| 1500 |
my $ten_days_ahead = dt_from_string->add( days => 10 ); |
1499 |
my $ten_days_ahead = dt_from_string->add( days => 10 ); |
| 1501 |
my $issue = AddIssue( |
1500 |
my $issue = AddIssue( |
| 1502 |
$renewing_borrower_obj, $item_to_auto_renew->barcode, $ten_days_ahead, undef, $ten_days_before, |
1501 |
$renewing_borrower_obj, $item_to_auto_renew->barcode, $ten_days_ahead, undef, $ten_days_before, |
| 1503 |
undef, { auto_renew => 1 } |
1502 |
undef, { auto_renew => 1 } |
|
Lines 1618-1624
subtest "CanBookBeRenewed tests" => sub {
Link Here
|
| 1618 |
); |
1617 |
); |
| 1619 |
|
1618 |
|
| 1620 |
my $ten_days_before = dt_from_string->add( days => -10 ); |
1619 |
my $ten_days_before = dt_from_string->add( days => -10 ); |
| 1621 |
my $ten_days_ahead = dt_from_string->add( days => 10 ); |
1620 |
my $ten_days_ahead = dt_from_string->add( days => 10 ); |
| 1622 |
my $issue = AddIssue( |
1621 |
my $issue = AddIssue( |
| 1623 |
$renewing_borrower_obj, $item_to_auto_renew->barcode, $ten_days_ahead, undef, $ten_days_before, |
1622 |
$renewing_borrower_obj, $item_to_auto_renew->barcode, $ten_days_ahead, undef, $ten_days_before, |
| 1624 |
undef, { auto_renew => 1 } |
1623 |
undef, { auto_renew => 1 } |
|
Lines 2020-2026
subtest "GetUpcomingDueIssues" => sub {
Link Here
|
| 2020 |
my $a_borrower = Koha::Patrons->find($a_borrower_borrowernumber); |
2019 |
my $a_borrower = Koha::Patrons->find($a_borrower_borrowernumber); |
| 2021 |
|
2020 |
|
| 2022 |
my $yesterday = DateTime->today( time_zone => C4::Context->tz() )->add( days => -1 ); |
2021 |
my $yesterday = DateTime->today( time_zone => C4::Context->tz() )->add( days => -1 ); |
| 2023 |
my $two_days_ahead = DateTime->today( time_zone => C4::Context->tz() )->add( days => 2 ); |
2022 |
my $two_days_ahead = DateTime->today( time_zone => C4::Context->tz() )->add( days => 2 ); |
| 2024 |
my $today = DateTime->today( time_zone => C4::Context->tz() ); |
2023 |
my $today = DateTime->today( time_zone => C4::Context->tz() ); |
| 2025 |
|
2024 |
|
| 2026 |
my $issue = AddIssue( $a_borrower, $item_1->barcode, $yesterday ); |
2025 |
my $issue = AddIssue( $a_borrower, $item_1->barcode, $yesterday ); |
|
Lines 3932-3938
subtest 'AddReturn | is_overdue' => sub {
Link Here
|
| 3932 |
is( $line->status, 'RETURNED', "Overdue fine is fixed" ); |
3931 |
is( $line->status, 'RETURNED', "Overdue fine is fixed" ); |
| 3933 |
$line = $lines->next; |
3932 |
$line = $lines->next; |
| 3934 |
is( $line->amount + 0, -2, "Original payment amount remains as 2" ); |
3933 |
is( $line->amount + 0, -2, "Original payment amount remains as 2" ); |
| 3935 |
is( $line->amountoutstanding + 0, 0, "Original payment remains applied" ); |
3934 |
is( $line->amountoutstanding + 0, 0, "Original payment remains applied" ); |
| 3936 |
$line = $lines->next; |
3935 |
$line = $lines->next; |
| 3937 |
is( $line->amount + 0, -1, "Refund amount correctly set to 1" ); |
3936 |
is( $line->amount + 0, -1, "Refund amount correctly set to 1" ); |
| 3938 |
is( $line->amountoutstanding + 0, -1, "Refund amount outstanding unspent" ); |
3937 |
is( $line->amountoutstanding + 0, -1, "Refund amount outstanding unspent" ); |
|
Lines 4886-4892
subtest '_FixOverduesOnReturn' => sub {
Link Here
|
| 4886 |
my $credit = $offset->credit; |
4885 |
my $credit = $offset->credit; |
| 4887 |
is( ref $credit, "Koha::Account::Line", "Found matching credit for fine forgiveness" ); |
4886 |
is( ref $credit, "Koha::Account::Line", "Found matching credit for fine forgiveness" ); |
| 4888 |
is( $credit->amount + 0, -99, "Credit amount is set correctly" ); |
4887 |
is( $credit->amount + 0, -99, "Credit amount is set correctly" ); |
| 4889 |
is( $credit->amountoutstanding + 0, 0, "Credit amountoutstanding is correctly set to 0" ); |
4888 |
is( $credit->amountoutstanding + 0, 0, "Credit amountoutstanding is correctly set to 0" ); |
| 4890 |
|
4889 |
|
| 4891 |
# Bug 25417 - Only forgive fines where there is an amount outstanding to forgive |
4890 |
# Bug 25417 - Only forgive fines where there is an amount outstanding to forgive |
| 4892 |
$accountline->set( |
4891 |
$accountline->set( |
|
Lines 7637-7643
subtest 'NoRefundOnLostFinesPaidAge' => sub {
Link Here
|
| 7637 |
{ |
7636 |
{ |
| 7638 |
borrowernumber => $patron->id, |
7637 |
borrowernumber => $patron->id, |
| 7639 |
date => '1970-01-01 14:00:01', |
7638 |
date => '1970-01-01 14:00:01', |
| 7640 |
amountoutstanding => 0, |
7639 |
amountoutstanding => 0, |
| 7641 |
amount => -5, |
7640 |
amount => -5, |
| 7642 |
interface => 'commandline', |
7641 |
interface => 'commandline', |
| 7643 |
credit_type_code => 'PAYMENT' |
7642 |
credit_type_code => 'PAYMENT' |
|
Lines 7693-7699
subtest 'NoRefundOnLostFinesPaidAge' => sub {
Link Here
|
| 7693 |
borrowernumber => $patron2->id, |
7692 |
borrowernumber => $patron2->id, |
| 7694 |
date => '1970-01-01 14:00:01', |
7693 |
date => '1970-01-01 14:00:01', |
| 7695 |
amount => -5, |
7694 |
amount => -5, |
| 7696 |
amountoutstanding => 0, |
7695 |
amountoutstanding => 0, |
| 7697 |
interface => 'commandline', |
7696 |
interface => 'commandline', |
| 7698 |
credit_type_code => 'PAYMENT' |
7697 |
credit_type_code => 'PAYMENT' |
| 7699 |
} |
7698 |
} |