|
Lines 18-24
Link Here
|
| 18 |
use Modern::Perl; |
18 |
use Modern::Perl; |
| 19 |
use utf8; |
19 |
use utf8; |
| 20 |
|
20 |
|
| 21 |
use Test::More tests => 124; |
21 |
use Test::More tests => 125; |
| 22 |
use Test::MockModule; |
22 |
use Test::MockModule; |
| 23 |
|
23 |
|
| 24 |
use Data::Dumper; |
24 |
use Data::Dumper; |
|
Lines 3128-3149
subtest 'Koha::ItemType::calc_rental_charge_daily tests' => sub {
Link Here
|
| 3128 |
t::lib::Mocks::mock_preference('finesCalendar', 'ignoreCalendar'); |
3128 |
t::lib::Mocks::mock_preference('finesCalendar', 'ignoreCalendar'); |
| 3129 |
my $issue = AddIssue( $patron->unblessed, $item->barcode, $dt_to, undef, $dt_from ); |
3129 |
my $issue = AddIssue( $patron->unblessed, $item->barcode, $dt_to, undef, $dt_from ); |
| 3130 |
my $accountline = Koha::Account::Lines->find({ itemnumber => $item->id }); |
3130 |
my $accountline = Koha::Account::Lines->find({ itemnumber => $item->id }); |
| 3131 |
is( $accountline->amount, '7.000000', "Daily rental charge calulated correctly with finesCalendar = ignoreCalendar" ); |
3131 |
is( $accountline->amount, '7.000000', "Daily rental charge calculated correctly with finesCalendar = ignoreCalendar" ); |
| 3132 |
$accountline->delete(); |
3132 |
$accountline->delete(); |
| 3133 |
AddRenewal( $patron->id, $item->id, $library->id, $dt_to_renew, $dt_to ); |
3133 |
AddRenewal( $patron->id, $item->id, $library->id, $dt_to_renew, $dt_to ); |
| 3134 |
$accountline = Koha::Account::Lines->find({ itemnumber => $item->id }); |
3134 |
$accountline = Koha::Account::Lines->find({ itemnumber => $item->id }); |
| 3135 |
is( $accountline->amount, '6.000000', "Daily rental charge calulated correctly with finesCalendar = ignoreCalendar, for renewal" ); |
3135 |
is( $accountline->amount, '6.000000', "Daily rental charge calculated correctly with finesCalendar = ignoreCalendar, for renewal" ); |
| 3136 |
$accountline->delete(); |
3136 |
$accountline->delete(); |
| 3137 |
$issue->delete(); |
3137 |
$issue->delete(); |
| 3138 |
|
3138 |
|
| 3139 |
t::lib::Mocks::mock_preference('finesCalendar', 'noFinesWhenClosed'); |
3139 |
t::lib::Mocks::mock_preference('finesCalendar', 'noFinesWhenClosed'); |
| 3140 |
$issue = AddIssue( $patron->unblessed, $item->barcode, $dt_to, undef, $dt_from ); |
3140 |
$issue = AddIssue( $patron->unblessed, $item->barcode, $dt_to, undef, $dt_from ); |
| 3141 |
$accountline = Koha::Account::Lines->find({ itemnumber => $item->id }); |
3141 |
$accountline = Koha::Account::Lines->find({ itemnumber => $item->id }); |
| 3142 |
is( $accountline->amount, '7.000000', "Daily rental charge calulated correctly with finesCalendar = noFinesWhenClosed" ); |
3142 |
is( $accountline->amount, '7.000000', "Daily rental charge calculated correctly with finesCalendar = noFinesWhenClosed" ); |
| 3143 |
$accountline->delete(); |
3143 |
$accountline->delete(); |
| 3144 |
AddRenewal( $patron->id, $item->id, $library->id, $dt_to_renew, $dt_to ); |
3144 |
AddRenewal( $patron->id, $item->id, $library->id, $dt_to_renew, $dt_to ); |
| 3145 |
$accountline = Koha::Account::Lines->find({ itemnumber => $item->id }); |
3145 |
$accountline = Koha::Account::Lines->find({ itemnumber => $item->id }); |
| 3146 |
is( $accountline->amount, '6.000000', "Daily rental charge calulated correctly with finesCalendar = noFinesWhenClosed, for renewal" ); |
3146 |
is( $accountline->amount, '6.000000', "Daily rental charge calculated correctly with finesCalendar = noFinesWhenClosed, for renewal" ); |
| 3147 |
$accountline->delete(); |
3147 |
$accountline->delete(); |
| 3148 |
$issue->delete(); |
3148 |
$issue->delete(); |
| 3149 |
|
3149 |
|
|
Lines 3155-3165
subtest 'Koha::ItemType::calc_rental_charge_daily tests' => sub {
Link Here
|
| 3155 |
); |
3155 |
); |
| 3156 |
$issue = AddIssue( $patron->unblessed, $item->barcode, $dt_to, undef, $dt_from ); |
3156 |
$issue = AddIssue( $patron->unblessed, $item->barcode, $dt_to, undef, $dt_from ); |
| 3157 |
$accountline = Koha::Account::Lines->find({ itemnumber => $item->id }); |
3157 |
$accountline = Koha::Account::Lines->find({ itemnumber => $item->id }); |
| 3158 |
is( $accountline->amount, '6.000000', "Daily rental charge calulated correctly with finesCalendar = noFinesWhenClosed and closed Wednesdays" ); |
3158 |
is( $accountline->amount, '6.000000', "Daily rental charge calculated correctly with finesCalendar = noFinesWhenClosed and closed Wednesdays" ); |
| 3159 |
$accountline->delete(); |
3159 |
$accountline->delete(); |
| 3160 |
AddRenewal( $patron->id, $item->id, $library->id, $dt_to_renew, $dt_to ); |
3160 |
AddRenewal( $patron->id, $item->id, $library->id, $dt_to_renew, $dt_to ); |
| 3161 |
$accountline = Koha::Account::Lines->find({ itemnumber => $item->id }); |
3161 |
$accountline = Koha::Account::Lines->find({ itemnumber => $item->id }); |
| 3162 |
is( $accountline->amount, '5.000000', "Daily rental charge calulated correctly with finesCalendar = noFinesWhenClosed and closed Wednesdays, for renewal" ); |
3162 |
is( $accountline->amount, '5.000000', "Daily rental charge calculated correctly with finesCalendar = noFinesWhenClosed and closed Wednesdays, for renewal" ); |
| 3163 |
$accountline->delete(); |
3163 |
$accountline->delete(); |
| 3164 |
$issue->delete(); |
3164 |
$issue->delete(); |
| 3165 |
|
3165 |
|