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

(-)a/C4/Accounts.pm (-1 / +6 lines)
Lines 230-239 sub manualinvoice { Link Here
230
        }
230
        }
231
    )->store();
231
    )->store();
232
232
233
    my $offset_type =
234
        $type eq 'L'  ? 'Lost Item'
235
      : $type eq 'PF' ? 'Processing Fee'
236
      :                 'Manual Debit';
237
233
    my $account_offset = Koha::Account::Offset->new(
238
    my $account_offset = Koha::Account::Offset->new(
234
        {
239
        {
235
            debit_id => $accountline->id,
240
            debit_id => $accountline->id,
236
            type     => 'Manual Debit',
241
            type     => $offset_type,
237
            amount   => $amount,
242
            amount   => $amount,
238
        }
243
        }
239
    )->store();
244
    )->store();
(-)a/installer/data/mysql/account_offset_types.sql (+1 lines)
Lines 2-7 INSERT INTO account_offset_types ( type ) VALUES Link Here
2
('Writeoff'),
2
('Writeoff'),
3
('Payment'),
3
('Payment'),
4
('Lost Item'),
4
('Lost Item'),
5
('Processing Fee'),
5
('Manual Debit'),
6
('Manual Debit'),
6
('Reverse Payment'),
7
('Reverse Payment'),
7
('Forgiven'),
8
('Forgiven'),
(-)a/installer/data/mysql/atomicupdate/processing_fee.sql (+1 lines)
Line 0 Link Here
1
INSERT IGNORE INTO account_offset_types ( type ) VALUES ( 'Processing Fee' );
(-)a/t/db_dependent/Circulation/Chargelostitem.t (-2 / +8 lines)
Lines 2-8 Link Here
2
2
3
use Modern::Perl;
3
use Modern::Perl;
4
4
5
use Test::More tests => 4;
5
use Test::More tests => 6;
6
use Test::MockModule;
6
use Test::MockModule;
7
use t::lib::Mocks;
7
use t::lib::Mocks;
8
use t::lib::TestBuilder;
8
use t::lib::TestBuilder;
Lines 62-67 AddIssue($borrower, '0101'); Link Here
62
AddIssue($borrower, '0203');
62
AddIssue($borrower, '0203');
63
63
64
# Begin tests...
64
# Begin tests...
65
Koha::Account::Offsets->delete();
65
my $issue = Koha::Checkouts->search( { borrowernumber => $borrowernumber } )->next()->unblessed();
66
my $issue = Koha::Checkouts->search( { borrowernumber => $borrowernumber } )->next()->unblessed();
66
C4::Accounts::chargelostitem( $borrowernumber, $issue->{itemnumber}, '1.00');
67
C4::Accounts::chargelostitem( $borrowernumber, $issue->{itemnumber}, '1.00');
67
68
Lines 70-72 my $accountline = Koha::Account::Lines->search( { borrowernumber => $borrowernum Link Here
70
is( int($accountline->amount), $itemtype->{processfee}, "The accountline amount should be precessfee value " );
71
is( int($accountline->amount), $itemtype->{processfee}, "The accountline amount should be precessfee value " );
71
is( $accountline->itemnumber, $itemnumber1, "The accountline itemnumber should the linked with barcode '0101'" );
72
is( $accountline->itemnumber, $itemnumber1, "The accountline itemnumber should the linked with barcode '0101'" );
72
is( $accountline->note, C4::Context->preference("ProcessingFeeNote"), "The accountline description should be 'test'" );
73
is( $accountline->note, C4::Context->preference("ProcessingFeeNote"), "The accountline description should be 'test'" );
73
- 
74
75
my $lost_ao = Koha::Account::Offsets->single( { type => 'Lost Item' } );
76
ok( $lost_ao, 'Account offset of type "Lost Item" created' );
77
78
my $processing_fee_ao = Koha::Account::Offsets->single( { type => 'Processing Fee' } );
79
ok( $processing_fee_ao, 'Account offset of type "Processing Fee" created' );

Return to bug 12768