|
Lines 679-685
subtest "C4::Accounts::chargelostitem tests" => sub {
Link Here
|
| 679 |
my $procfee; |
679 |
my $procfee; |
| 680 |
|
680 |
|
| 681 |
subtest "Bug 35612: chargelostitem records branch context in accountlines.branchcode" => sub { |
681 |
subtest "Bug 35612: chargelostitem records branch context in accountlines.branchcode" => sub { |
| 682 |
plan tests => 7; |
682 |
plan tests => 8; |
| 683 |
|
683 |
|
| 684 |
t::lib::Mocks::mock_preference( 'LostChargesControl', 'ItemHomeLibrary' ); |
684 |
t::lib::Mocks::mock_preference( 'LostChargesControl', 'ItemHomeLibrary' ); |
| 685 |
t::lib::Mocks::mock_preference( 'HomeOrHoldingBranch', 'homebranch' ); |
685 |
t::lib::Mocks::mock_preference( 'HomeOrHoldingBranch', 'homebranch' ); |
|
Lines 809-814
subtest "C4::Accounts::chargelostitem tests" => sub {
Link Here
|
| 809 |
1, |
809 |
1, |
| 810 |
"Dedupes LOST charges for same itemnumber + issue_id (no item_id regression)" |
810 |
"Dedupes LOST charges for same itemnumber + issue_id (no item_id regression)" |
| 811 |
); |
811 |
); |
|
|
812 |
|
| 813 |
# Test undefined LostChargesControl (should default to ItemHomeLibrary behavior) |
| 814 |
Koha::Account::Lines->search( |
| 815 |
{ borrowernumber => $patron->borrowernumber, itemnumber => $item->itemnumber, debit_type_code => 'LOST' } ) |
| 816 |
->delete; |
| 817 |
|
| 818 |
t::lib::Mocks::mock_preference( 'LostChargesControl', undef ); |
| 819 |
t::lib::Mocks::mock_preference( 'HomeOrHoldingBranch', 'homebranch' ); |
| 820 |
|
| 821 |
C4::Accounts::chargelostitem( |
| 822 |
$patron->borrowernumber, $item->itemnumber, 6.12, "Lost test undefined pref", |
| 823 |
{ issue_id => $issue_id } |
| 824 |
); |
| 825 |
|
| 826 |
$lost = Koha::Account::Lines->find( |
| 827 |
{ |
| 828 |
borrowernumber => $patron->borrowernumber, itemnumber => $item->itemnumber, debit_type_code => 'LOST', |
| 829 |
issue_id => $issue_id |
| 830 |
} |
| 831 |
); |
| 832 |
is( |
| 833 |
$lost->branchcode, $lib_home, |
| 834 |
"LOST uses item homebranch when LostChargesControl is undefined (defaults to ItemHomeLibrary)" |
| 835 |
); |
| 812 |
}; |
836 |
}; |
| 813 |
|
837 |
|
| 814 |
subtest "fee application tests" => sub { |
838 |
subtest "fee application tests" => sub { |
| 815 |
- |
|
|