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

(-)a/C4/Accounts.pm (-1 / +1 lines)
Lines 108-114 sub chargelostitem { Link Here
108
                    user_id     => C4::Context->userenv ? C4::Context->userenv->{'number'} : undef,
108
                    user_id     => C4::Context->userenv ? C4::Context->userenv->{'number'} : undef,
109
                    interface   => C4::Context->interface,
109
                    interface   => C4::Context->interface,
110
                    library_id  => C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef,
110
                    library_id  => C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef,
111
                    type        => 'processing',
111
                    type        => 'PROCESSING',
112
                    item_id     => $itemnumber,
112
                    item_id     => $itemnumber,
113
                    issue_id    => $issue_id,
113
                    issue_id    => $issue_id,
114
                }
114
                }
(-)a/Koha/Account.pm (-3 / +3 lines)
Lines 451-457 $debit_type can be any of: Link Here
451
  - sundry
451
  - sundry
452
  - new_card
452
  - new_card
453
  - overdue
453
  - overdue
454
  - processing
454
  - PROCESSING
455
  - RENT
455
  - RENT
456
  - RENT_DAILY
456
  - RENT_DAILY
457
  - RENT_RENEW
457
  - RENT_RENEW
Lines 712-718 our $offset_type = { Link Here
712
    'account'          => 'Account Fee',
712
    'account'          => 'Account Fee',
713
    'account_renew'    => 'Account Fee',
713
    'account_renew'    => 'Account Fee',
714
    'RESERVE'          => 'Reserve Fee',
714
    'RESERVE'          => 'Reserve Fee',
715
    'processing'       => 'Processing Fee',
715
    'PROCESSING'       => 'Processing Fee',
716
    'lost_item'        => 'Lost Item',
716
    'lost_item'        => 'Lost Item',
717
    'RENT'             => 'Rental Fee',
717
    'RENT'             => 'Rental Fee',
718
    'RENT_DAILY'       => 'Rental Fee',
718
    'RENT_DAILY'       => 'Rental Fee',
Lines 747-753 our $account_type_debit = { Link Here
747
    'sundry'           => 'M',
747
    'sundry'           => 'M',
748
    'new_card'         => 'N',
748
    'new_card'         => 'N',
749
    'overdue'          => 'OVERDUE',
749
    'overdue'          => 'OVERDUE',
750
    'processing'       => 'PF',
750
    'PROCESSING'       => 'PROCESSING',
751
    'RENT'             => 'RENT',
751
    'RENT'             => 'RENT',
752
    'RENT_DAILY'       => 'RENT_DAILY',
752
    'RENT_DAILY'       => 'RENT_DAILY',
753
    'RENT_RENEW'       => 'RENT_RENEW',
753
    'RENT_RENEW'       => 'RENT_RENEW',
(-)a/installer/data/mysql/account_debit_types.sql (-1 / +1 lines)
Lines 6-12 INSERT INTO account_debit_types ( code, description, can_be_added_manually, defa Link Here
6
('M', 'Manual fee', 1, NULL, 0),
6
('M', 'Manual fee', 1, NULL, 0),
7
('N', 'New card fee', 1, NULL, 1),
7
('N', 'New card fee', 1, NULL, 1),
8
('OVERDUE', 'Overdue fine', 0, NULL, 1),
8
('OVERDUE', 'Overdue fine', 0, NULL, 1),
9
('PF', 'Lost item processing fee', 0, NULL, 1),
9
('PROCESSING', 'Lost item processing fee', 0, NULL, 1),
10
('RENT', 'Rental fee', 0, NULL, 1),
10
('RENT', 'Rental fee', 0, NULL, 1),
11
('RENT_DAILY', 'Daily rental fee', 0, NULL, 1),
11
('RENT_DAILY', 'Daily rental fee', 0, NULL, 1),
12
('RENT_RENEW', 'Renewal of rental item', 0, NULL, 1),
12
('RENT_RENEW', 'Renewal of rental item', 0, NULL, 1),
(-)a/installer/data/mysql/atomicupdate/bug_23049_debit.perl (-1 / +8 lines)
Lines 45-51 if ( CheckVersion($DBversion) ) { Link Here
45
              ('M', 'Manual fee', 1, NULL, 0),
45
              ('M', 'Manual fee', 1, NULL, 0),
46
              ('N', 'New card fee', 1, NULL, 1),
46
              ('N', 'New card fee', 1, NULL, 1),
47
              ('OVERDUE', 'Overdue fine', 0, NULL, 1),
47
              ('OVERDUE', 'Overdue fine', 0, NULL, 1),
48
              ('PF', 'Lost item processing fee', 0, NULL, 1),
48
              ('PROCESSING', 'Lost item processing fee', 0, NULL, 1),
49
              ('RENT', 'Rental fee', 0, NULL, 1),
49
              ('RENT', 'Rental fee', 0, NULL, 1),
50
              ('RENT_DAILY', 'Daily rental fee', 0, NULL, 1),
50
              ('RENT_DAILY', 'Daily rental fee', 0, NULL, 1),
51
              ('RENT_RENEW', 'Renewal of rental item', 0, NULL, 1),
51
              ('RENT_RENEW', 'Renewal of rental item', 0, NULL, 1),
Lines 61-66 if ( CheckVersion($DBversion) ) { Link Here
61
        }
61
        }
62
    );
62
    );
63
63
64
    # Update accountype 'PF' to 'PROCESSING'
65
    $dbh->do(
66
        qq{
67
          UPDATE accountlines SET accounttype = 'PROCESSING' WHERE accounttype = 'PF'
68
        }
69
    );
70
64
    # Moving MANUAL_INV to account_debit_types
71
    # Moving MANUAL_INV to account_debit_types
65
    $dbh->do(
72
    $dbh->do(
66
        qq{
73
        qq{
(-)a/installer/data/mysql/en/mandatory/account_debit_types.sql (-1 / +1 lines)
Lines 6-12 INSERT INTO account_debit_types ( code, description, can_be_added_manually, defa Link Here
6
('M', 'Manual fee', 1, NULL, 0),
6
('M', 'Manual fee', 1, NULL, 0),
7
('N', 'New card fee', 1, NULL, 1),
7
('N', 'New card fee', 1, NULL, 1),
8
('OVERDUE', 'Overdue fine', 0, NULL, 1),
8
('OVERDUE', 'Overdue fine', 0, NULL, 1),
9
('PF', 'Lost item processing fee', 0, NULL, 1),
9
('PROCESSING', 'Lost item processing fee', 0, NULL, 1),
10
('RENT', 'Rental fee', 0, NULL, 1),
10
('RENT', 'Rental fee', 0, NULL, 1),
11
('RENT_DAILY', 'Daily rental fee', 0, NULL, 1),
11
('RENT_DAILY', 'Daily rental fee', 0, NULL, 1),
12
('RENT_RENEW', 'Renewal of rental item', 0, NULL, 1),
12
('RENT_RENEW', 'Renewal of rental item', 0, NULL, 1),
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc (-1 / +1 lines)
Lines 20-26 Link Here
20
           [%- CASE 'M'                -%]Sundry
20
           [%- CASE 'M'                -%]Sundry
21
           [%- CASE 'N'                -%]New card
21
           [%- CASE 'N'                -%]New card
22
           [%- CASE 'OVERDUE'          -%]Fine
22
           [%- CASE 'OVERDUE'          -%]Fine
23
           [%- CASE 'PF'               -%]Lost item processing fee
23
           [%- CASE 'PROCESSING'       -%]Lost item processing fee
24
           [%- CASE 'RENT'             -%]Rental fee
24
           [%- CASE 'RENT'             -%]Rental fee
25
           [%- CASE 'RENT_DAILY'       -%]Daily rental fee
25
           [%- CASE 'RENT_DAILY'       -%]Daily rental fee
26
           [%- CASE 'RENT_RENEW'       -%]Renewal of rental item
26
           [%- CASE 'RENT_RENEW'       -%]Renewal of rental item
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/account-table.inc (-1 / +1 lines)
Lines 191-197 Link Here
191
           [%- CASE 'M'                -%]Sundry
191
           [%- CASE 'M'                -%]Sundry
192
           [%- CASE 'N'                -%]New card
192
           [%- CASE 'N'                -%]New card
193
           [%- CASE 'OVERDUE'          -%]Fine
193
           [%- CASE 'OVERDUE'          -%]Fine
194
           [%- CASE 'PF'               -%]Lost item processing fee
194
           [%- CASE 'PROCESSING'       -%]Lost item processing fee
195
           [%- CASE 'RENT'             -%]Rental fee
195
           [%- CASE 'RENT'             -%]Rental fee
196
           [%- CASE 'RENT_DAILY'       -%]Daily rental fee
196
           [%- CASE 'RENT_DAILY'       -%]Daily rental fee
197
           [%- CASE 'RENT_RENEW'       -%]Renewal of rental item
197
           [%- CASE 'RENT_RENEW'       -%]Renewal of rental item
(-)a/t/db_dependent/Accounts.t (-21 / +21 lines)
Lines 585-622 subtest "C4::Accounts::chargelostitem tests" => sub { Link Here
585
585
586
        C4::Accounts::chargelostitem( $cli_borrowernumber, $cli_itemnumber1, 0, "Perdedor");
586
        C4::Accounts::chargelostitem( $cli_borrowernumber, $cli_itemnumber1, 0, "Perdedor");
587
        $lostfine = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber1, debit_type_code => 'LOST' });
587
        $lostfine = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber1, debit_type_code => 'LOST' });
588
        $procfee  = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber1, debit_type_code => 'PF' });
588
        $procfee  = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber1, debit_type_code => 'PROCESSING' });
589
        ok( !$lostfine, "No lost fine if no replacementcost or default when pref off");
589
        ok( !$lostfine, "No lost fine if no replacementcost or default when pref off");
590
        ok( !$procfee,  "No processing fee if no processing fee");
590
        ok( !$procfee,  "No processing fee if no processing fee");
591
        C4::Accounts::chargelostitem( $cli_borrowernumber, $cli_itemnumber1, 6.12, "Perdedor");
591
        C4::Accounts::chargelostitem( $cli_borrowernumber, $cli_itemnumber1, 6.12, "Perdedor");
592
        $lostfine = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber1, debit_type_code => 'LOST' });
592
        $lostfine = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber1, debit_type_code => 'LOST' });
593
        $procfee  = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber1, debit_type_code => 'PF' });
593
        $procfee  = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber1, debit_type_code => 'PROCESSING' });
594
        ok( $lostfine->amount == 6.12, "Lost fine equals replacementcost when pref off and no default set");
594
        ok( $lostfine->amount == 6.12, "Lost fine equals replacementcost when pref off and no default set");
595
        ok( !$procfee,  "No processing fee if no processing fee");
595
        ok( !$procfee,  "No processing fee if no processing fee");
596
        $lostfine->delete();
596
        $lostfine->delete();
597
597
598
        C4::Accounts::chargelostitem( $cli_borrowernumber, $cli_itemnumber2, 0, "Perdedor");
598
        C4::Accounts::chargelostitem( $cli_borrowernumber, $cli_itemnumber2, 0, "Perdedor");
599
        $lostfine = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber2, debit_type_code => 'LOST' });
599
        $lostfine = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber2, debit_type_code => 'LOST' });
600
        $procfee  = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber2, debit_type_code => 'PF' });
600
        $procfee  = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber2, debit_type_code => 'PROCESSING' });
601
        ok( !$lostfine, "No lost fine if no replacementcost but default set when pref off");
601
        ok( !$lostfine, "No lost fine if no replacementcost but default set when pref off");
602
        ok( !$procfee,  "No processing fee if no processing fee");
602
        ok( !$procfee,  "No processing fee if no processing fee");
603
        C4::Accounts::chargelostitem( $cli_borrowernumber, $cli_itemnumber2, 6.12, "Perdedor");
603
        C4::Accounts::chargelostitem( $cli_borrowernumber, $cli_itemnumber2, 6.12, "Perdedor");
604
        $lostfine = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber2, debit_type_code => 'LOST' });
604
        $lostfine = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber2, debit_type_code => 'LOST' });
605
        $procfee  = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber2, debit_type_code => 'PF' });
605
        $procfee  = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber2, debit_type_code => 'PROCESSING' });
606
        ok( $lostfine->amount == 6.12 , "Lost fine equals replacementcost when pref off and default set");
606
        ok( $lostfine->amount == 6.12 , "Lost fine equals replacementcost when pref off and default set");
607
        ok( !$procfee,  "No processing fee if no processing fee");
607
        ok( !$procfee,  "No processing fee if no processing fee");
608
        $lostfine->delete();
608
        $lostfine->delete();
609
609
610
        C4::Accounts::chargelostitem( $cli_borrowernumber, $cli_itemnumber3, 0, "Perdedor");
610
        C4::Accounts::chargelostitem( $cli_borrowernumber, $cli_itemnumber3, 0, "Perdedor");
611
        $lostfine = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber3, debit_type_code => 'LOST' });
611
        $lostfine = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber3, debit_type_code => 'LOST' });
612
        $procfee  = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber3, debit_type_code => 'PF' });
612
        $procfee  = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber3, debit_type_code => 'PROCESSING' });
613
        ok( !$lostfine, "No lost fine if no replacementcost and no default set when pref off");
613
        ok( !$lostfine, "No lost fine if no replacementcost and no default set when pref off");
614
        ok( $procfee->amount == 8.16,  "Processing fee if processing fee");
614
        ok( $procfee->amount == 8.16,  "Processing fee if processing fee");
615
        is( $procfee->issue_id, $cli_issue_id_3, "Processing fee issue id is correct" );
615
        is( $procfee->issue_id, $cli_issue_id_3, "Processing fee issue id is correct" );
616
        $procfee->delete();
616
        $procfee->delete();
617
        C4::Accounts::chargelostitem( $cli_borrowernumber, $cli_itemnumber3, 6.12, "Perdedor");
617
        C4::Accounts::chargelostitem( $cli_borrowernumber, $cli_itemnumber3, 6.12, "Perdedor");
618
        $lostfine = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber3, debit_type_code => 'LOST' });
618
        $lostfine = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber3, debit_type_code => 'LOST' });
619
        $procfee  = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber3, debit_type_code => 'PF' });
619
        $procfee  = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber3, debit_type_code => 'PROCESSING' });
620
        ok( $lostfine->amount == 6.12 , "Lost fine equals replacementcost when pref off and no default set");
620
        ok( $lostfine->amount == 6.12 , "Lost fine equals replacementcost when pref off and no default set");
621
        ok( $procfee->amount == 8.16,  "Processing fee if processing fee");
621
        ok( $procfee->amount == 8.16,  "Processing fee if processing fee");
622
        is( $procfee->issue_id, $cli_issue_id_3, "Processing fee issue id is correct" );
622
        is( $procfee->issue_id, $cli_issue_id_3, "Processing fee issue id is correct" );
Lines 625-638 subtest "C4::Accounts::chargelostitem tests" => sub { Link Here
625
625
626
        C4::Accounts::chargelostitem( $cli_borrowernumber, $cli_itemnumber4, 0, "Perdedor");
626
        C4::Accounts::chargelostitem( $cli_borrowernumber, $cli_itemnumber4, 0, "Perdedor");
627
        $lostfine = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber4, debit_type_code => 'LOST' });
627
        $lostfine = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber4, debit_type_code => 'LOST' });
628
        $procfee  = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber4, debit_type_code => 'PF' });
628
        $procfee  = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber4, debit_type_code => 'PROCESSING' });
629
        ok( !$lostfine, "No lost fine if no replacementcost but default set when pref off");
629
        ok( !$lostfine, "No lost fine if no replacementcost but default set when pref off");
630
        ok( $procfee->amount == 2.04,  "Processing fee if processing fee");
630
        ok( $procfee->amount == 2.04,  "Processing fee if processing fee");
631
        is( $procfee->issue_id, $cli_issue_id_4, "Processing fee issue id is correct" );
631
        is( $procfee->issue_id, $cli_issue_id_4, "Processing fee issue id is correct" );
632
        $procfee->delete();
632
        $procfee->delete();
633
        C4::Accounts::chargelostitem( $cli_borrowernumber, $cli_itemnumber4, 6.12, "Perdedor");
633
        C4::Accounts::chargelostitem( $cli_borrowernumber, $cli_itemnumber4, 6.12, "Perdedor");
634
        $lostfine = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber4, debit_type_code => 'LOST' });
634
        $lostfine = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber4, debit_type_code => 'LOST' });
635
        $procfee  = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber4, debit_type_code => 'PF' });
635
        $procfee  = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber4, debit_type_code => 'PROCESSING' });
636
        ok( $lostfine->amount == 6.12 , "Lost fine equals replacementcost when pref off and default set");
636
        ok( $lostfine->amount == 6.12 , "Lost fine equals replacementcost when pref off and default set");
637
        ok( $procfee->amount == 2.04,  "Processing fee if processing fee");
637
        ok( $procfee->amount == 2.04,  "Processing fee if processing fee");
638
        is( $procfee->issue_id, $cli_issue_id_4, "Processing fee issue id is correct" );
638
        is( $procfee->issue_id, $cli_issue_id_4, "Processing fee issue id is correct" );
Lines 643-686 subtest "C4::Accounts::chargelostitem tests" => sub { Link Here
643
643
644
        C4::Accounts::chargelostitem( $cli_borrowernumber, $cli_itemnumber1, 0, "Perdedor");
644
        C4::Accounts::chargelostitem( $cli_borrowernumber, $cli_itemnumber1, 0, "Perdedor");
645
        $lostfine = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber1, debit_type_code => 'LOST' });
645
        $lostfine = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber1, debit_type_code => 'LOST' });
646
        $procfee  = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber1, debit_type_code => 'PF' });
646
        $procfee  = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber1, debit_type_code => 'PROCESSING' });
647
        ok( !$lostfine, "No lost fine if no replacementcost or default when pref on");
647
        ok( !$lostfine, "No lost fine if no replacementcost or default when pref on");
648
        ok( !$procfee,  "No processing fee if no processing fee");
648
        ok( !$procfee,  "No processing fee if no processing fee");
649
        C4::Accounts::chargelostitem( $cli_borrowernumber, $cli_itemnumber1, 6.12, "Perdedor");
649
        C4::Accounts::chargelostitem( $cli_borrowernumber, $cli_itemnumber1, 6.12, "Perdedor");
650
        $lostfine = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber1, debit_type_code => 'LOST' });
650
        $lostfine = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber1, debit_type_code => 'LOST' });
651
        $procfee  = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber1, debit_type_code => 'PF' });
651
        $procfee  = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber1, debit_type_code => 'PROCESSING' });
652
        is( $lostfine->amount, "6.120000", "Lost fine equals replacementcost when pref on and no default set");
652
        is( $lostfine->amount, "6.120000", "Lost fine equals replacementcost when pref on and no default set");
653
        ok( !$procfee,  "No processing fee if no processing fee");
653
        ok( !$procfee,  "No processing fee if no processing fee");
654
654
655
        C4::Accounts::chargelostitem( $cli_borrowernumber, $cli_itemnumber2, 0, "Perdedor");
655
        C4::Accounts::chargelostitem( $cli_borrowernumber, $cli_itemnumber2, 0, "Perdedor");
656
        $lostfine = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber2, debit_type_code => 'LOST' });
656
        $lostfine = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber2, debit_type_code => 'LOST' });
657
        $procfee  = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber2, debit_type_code => 'PF' });
657
        $procfee  = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber2, debit_type_code => 'PROCESSING' });
658
        is( $lostfine->amount(), "16.320000", "Lost fine is default if no replacementcost but default set when pref on");
658
        is( $lostfine->amount(), "16.320000", "Lost fine is default if no replacementcost but default set when pref on");
659
        ok( !$procfee,  "No processing fee if no processing fee");
659
        ok( !$procfee,  "No processing fee if no processing fee");
660
        $lostfine->delete();
660
        $lostfine->delete();
661
        C4::Accounts::chargelostitem( $cli_borrowernumber, $cli_itemnumber2, 6.12, "Perdedor");
661
        C4::Accounts::chargelostitem( $cli_borrowernumber, $cli_itemnumber2, 6.12, "Perdedor");
662
        $lostfine = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber2, debit_type_code => 'LOST' });
662
        $lostfine = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber2, debit_type_code => 'LOST' });
663
        $procfee  = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber2, debit_type_code => 'PF' });
663
        $procfee  = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber2, debit_type_code => 'PROCESSING' });
664
        is( $lostfine->amount, "6.120000" , "Lost fine equals replacementcost when pref on and default set");
664
        is( $lostfine->amount, "6.120000" , "Lost fine equals replacementcost when pref on and default set");
665
        ok( !$procfee,  "No processing fee if no processing fee");
665
        ok( !$procfee,  "No processing fee if no processing fee");
666
666
667
        C4::Accounts::chargelostitem( $cli_borrowernumber, $cli_itemnumber3, 0, "Perdedor");
667
        C4::Accounts::chargelostitem( $cli_borrowernumber, $cli_itemnumber3, 0, "Perdedor");
668
        $lostfine = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber3, debit_type_code => 'LOST' });
668
        $lostfine = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber3, debit_type_code => 'LOST' });
669
        $procfee  = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber3, debit_type_code => 'PF' });
669
        $procfee  = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber3, debit_type_code => 'PROCESSING' });
670
        ok( !$lostfine, "No lost fine if no replacementcost and default not set when pref on");
670
        ok( !$lostfine, "No lost fine if no replacementcost and default not set when pref on");
671
        is( $procfee->amount, "8.160000",  "Processing fee if processing fee");
671
        is( $procfee->amount, "8.160000",  "Processing fee if processing fee");
672
        is( $procfee->issue_id, $cli_issue_id_3, "Processing fee issue id is correct" );
672
        is( $procfee->issue_id, $cli_issue_id_3, "Processing fee issue id is correct" );
673
        $procfee->delete();
673
        $procfee->delete();
674
        C4::Accounts::chargelostitem( $cli_borrowernumber, $cli_itemnumber3, 6.12, "Perdedor");
674
        C4::Accounts::chargelostitem( $cli_borrowernumber, $cli_itemnumber3, 6.12, "Perdedor");
675
        $lostfine = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber3, debit_type_code => 'LOST' });
675
        $lostfine = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber3, debit_type_code => 'LOST' });
676
        $procfee  = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber3, debit_type_code => 'PF' });
676
        $procfee  = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber3, debit_type_code => 'PROCESSING' });
677
        is( $lostfine->amount, "6.120000", "Lost fine equals replacementcost when pref on and no default set");
677
        is( $lostfine->amount, "6.120000", "Lost fine equals replacementcost when pref on and no default set");
678
        is( $procfee->amount, "8.160000",  "Processing fee if processing fee");
678
        is( $procfee->amount, "8.160000",  "Processing fee if processing fee");
679
        is( $procfee->issue_id, $cli_issue_id_3, "Processing fee issue id is correct" );
679
        is( $procfee->issue_id, $cli_issue_id_3, "Processing fee issue id is correct" );
680
680
681
        C4::Accounts::chargelostitem( $cli_borrowernumber, $cli_itemnumber4, 0, "Perdedor");
681
        C4::Accounts::chargelostitem( $cli_borrowernumber, $cli_itemnumber4, 0, "Perdedor");
682
        $lostfine = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber4, debit_type_code => 'LOST' });
682
        $lostfine = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber4, debit_type_code => 'LOST' });
683
        $procfee  = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber4, debit_type_code => 'PF' });
683
        $procfee  = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber4, debit_type_code => 'PROCESSING' });
684
        is( $lostfine->amount, "4.080000", "Lost fine is default if no replacementcost but default set when pref on");
684
        is( $lostfine->amount, "4.080000", "Lost fine is default if no replacementcost but default set when pref on");
685
        is( $procfee->amount, "2.040000",  "Processing fee if processing fee");
685
        is( $procfee->amount, "2.040000",  "Processing fee if processing fee");
686
        is( $procfee->issue_id, $cli_issue_id_4, "Processing fee issue id is correct" );
686
        is( $procfee->issue_id, $cli_issue_id_4, "Processing fee issue id is correct" );
Lines 688-707 subtest "C4::Accounts::chargelostitem tests" => sub { Link Here
688
        $procfee->delete();
688
        $procfee->delete();
689
        C4::Accounts::chargelostitem( $cli_borrowernumber, $cli_itemnumber4, 6.12, "Perdedor");
689
        C4::Accounts::chargelostitem( $cli_borrowernumber, $cli_itemnumber4, 6.12, "Perdedor");
690
        $lostfine = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber4, debit_type_code => 'LOST' });
690
        $lostfine = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber4, debit_type_code => 'LOST' });
691
        $procfee  = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber4, debit_type_code => 'PF' });
691
        $procfee  = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber4, debit_type_code => 'PROCESSING' });
692
        is( $lostfine->amount, "6.120000", "Lost fine equals replacementcost when pref on and default set");
692
        is( $lostfine->amount, "6.120000", "Lost fine equals replacementcost when pref on and default set");
693
        is( $procfee->amount, "2.040000",  "Processing fee if processing fee");
693
        is( $procfee->amount, "2.040000",  "Processing fee if processing fee");
694
        is( $procfee->issue_id, $cli_issue_id_4, "Processing fee issue id is correct" );
694
        is( $procfee->issue_id, $cli_issue_id_4, "Processing fee issue id is correct" );
695
        C4::Accounts::chargelostitem( $cli_borrowernumber, $cli_itemnumber4, 6.12, "Perdedor");
695
        C4::Accounts::chargelostitem( $cli_borrowernumber, $cli_itemnumber4, 6.12, "Perdedor");
696
        my $lostfines = Koha::Account::Lines->search({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber4, debit_type_code => 'LOST' });
696
        my $lostfines = Koha::Account::Lines->search({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber4, debit_type_code => 'LOST' });
697
        my $procfees  = Koha::Account::Lines->search({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber4, debit_type_code => 'PF' });
697
        my $procfees  = Koha::Account::Lines->search({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber4, debit_type_code => 'PROCESSING' });
698
        ok( $lostfines->count == 1 , "Lost fine cannot be double charged for the same issue_id");
698
        ok( $lostfines->count == 1 , "Lost fine cannot be double charged for the same issue_id");
699
        ok( $procfees->count == 1,  "Processing fee cannot be double charged for the same issue_id");
699
        ok( $procfees->count == 1,  "Processing fee cannot be double charged for the same issue_id");
700
        MarkIssueReturned($cli_borrowernumber, $cli_itemnumber4);
700
        MarkIssueReturned($cli_borrowernumber, $cli_itemnumber4);
701
        $cli_issue_id_4X = $builder->build({ source => 'Issue', value => { borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber4 } })->{issue_id};
701
        $cli_issue_id_4X = $builder->build({ source => 'Issue', value => { borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber4 } })->{issue_id};
702
        C4::Accounts::chargelostitem( $cli_borrowernumber, $cli_itemnumber4, 6.12, "Perdedor");
702
        C4::Accounts::chargelostitem( $cli_borrowernumber, $cli_itemnumber4, 6.12, "Perdedor");
703
        $lostfines = Koha::Account::Lines->search({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber4, debit_type_code => 'LOST' });
703
        $lostfines = Koha::Account::Lines->search({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber4, debit_type_code => 'LOST' });
704
        $procfees  = Koha::Account::Lines->search({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber4, debit_type_code => 'PF' });
704
        $procfees  = Koha::Account::Lines->search({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber4, debit_type_code => 'PROCESSING' });
705
        ok( $lostfines->count == 2 , "Lost fine can be charged twice for the same item if they are distinct issue_id's");
705
        ok( $lostfines->count == 2 , "Lost fine can be charged twice for the same item if they are distinct issue_id's");
706
        ok( $procfees->count == 2,  "Processing fee can be charged twice for the same item if they are distinct issue_id's");
706
        ok( $procfees->count == 2,  "Processing fee can be charged twice for the same item if they are distinct issue_id's");
707
        $lostfines->delete();
707
        $lostfines->delete();
Lines 724-730 subtest "C4::Accounts::chargelostitem tests" => sub { Link Here
724
        is($lostfine->branchcode, $branchcode, "Lost fine branchcode set correctly");
724
        is($lostfine->branchcode, $branchcode, "Lost fine branchcode set correctly");
725
725
726
        # Processing Fee
726
        # Processing Fee
727
        $procfee  = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber4, debit_type_code => 'PF' });
727
        $procfee  = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber4, debit_type_code => 'PROCESSING' });
728
        ok($procfee, "Processing fee created");
728
        ok($procfee, "Processing fee created");
729
        is($procfee->manager_id, $staff_id, "Processing fee manager_id set correctly");
729
        is($procfee->manager_id, $staff_id, "Processing fee manager_id set correctly");
730
        is($procfee->issue_id, $cli_issue_id_4X, "Processing fee issue_id set correctly");
730
        is($procfee->issue_id, $cli_issue_id_4X, "Processing fee issue_id set correctly");
Lines 743-749 subtest "C4::Accounts::chargelostitem tests" => sub { Link Here
743
        t::lib::Mocks::mock_preference( 'FinesLog', 0 );
743
        t::lib::Mocks::mock_preference( 'FinesLog', 0 );
744
        C4::Accounts::chargelostitem( $cli_borrowernumber, $cli_itemnumber4, 0, "Perdedor");
744
        C4::Accounts::chargelostitem( $cli_borrowernumber, $cli_itemnumber4, 0, "Perdedor");
745
        $lostfine = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber4, debit_type_code => 'LOST' });
745
        $lostfine = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber4, debit_type_code => 'LOST' });
746
        $procfee  = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber4, debit_type_code => 'PF' });
746
        $procfee  = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber4, debit_type_code => 'PROCESSING' });
747
        is( $schema->resultset('ActionLog')->count(), $action_logs + 0, 'No logs were added' );
747
        is( $schema->resultset('ActionLog')->count(), $action_logs + 0, 'No logs were added' );
748
        $lostfine->delete();
748
        $lostfine->delete();
749
        $procfee->delete();
749
        $procfee->delete();
Lines 751-757 subtest "C4::Accounts::chargelostitem tests" => sub { Link Here
751
        t::lib::Mocks::mock_preference( 'FinesLog', 1 );
751
        t::lib::Mocks::mock_preference( 'FinesLog', 1 );
752
        C4::Accounts::chargelostitem( $cli_borrowernumber, $cli_itemnumber4, 0, "Perdedor");
752
        C4::Accounts::chargelostitem( $cli_borrowernumber, $cli_itemnumber4, 0, "Perdedor");
753
        $lostfine = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber4, debit_type_code => 'LOST' });
753
        $lostfine = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber4, debit_type_code => 'LOST' });
754
        $procfee  = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber4, debit_type_code => 'PF' });
754
        $procfee  = Koha::Account::Lines->find({ borrowernumber => $cli_borrowernumber, itemnumber => $cli_itemnumber4, debit_type_code => 'PROCESSING' });
755
        is( $schema->resultset('ActionLog')->count(), $action_logs + 2, 'Logs were added' );
755
        is( $schema->resultset('ActionLog')->count(), $action_logs + 2, 'Logs were added' );
756
        $lostfine->delete();
756
        $lostfine->delete();
757
        $procfee->delete();
757
        $procfee->delete();
(-)a/t/db_dependent/Circulation.t (-17 / +16 lines)
Lines 2124-2136 subtest '_FixAccountForLostAndReturned' => sub { Link Here
2124
        LostItem( $item->itemnumber, 1 );
2124
        LostItem( $item->itemnumber, 1 );
2125
2125
2126
        my $processing_fee_lines = Koha::Account::Lines->search(
2126
        my $processing_fee_lines = Koha::Account::Lines->search(
2127
            { borrowernumber => $patron->id, itemnumber => $item->itemnumber, debit_type_code => 'PF' } );
2127
            { borrowernumber => $patron->id, itemnumber => $item->itemnumber, debit_type_code => 'PROCESSING' } );
2128
        is( $processing_fee_lines->count, 1, 'Only one processing fee produced' );
2128
        is( $processing_fee_lines->count, 1, 'Only one processing fee produced' );
2129
        my $processing_fee_line = $processing_fee_lines->next;
2129
        my $processing_fee_line = $processing_fee_lines->next;
2130
        is( $processing_fee_line->amount + 0,
2130
        is( $processing_fee_line->amount + 0,
2131
            $processfee_amount, 'The right PF amount is generated' );
2131
            $processfee_amount, 'The right PROCESSING amount is generated' );
2132
        is( $processing_fee_line->amountoutstanding + 0,
2132
        is( $processing_fee_line->amountoutstanding + 0,
2133
            $processfee_amount, 'The right PF amountoutstanding is generated' );
2133
            $processfee_amount, 'The right PROCESSING amountoutstanding is generated' );
2134
2134
2135
        my $lost_fee_lines = Koha::Account::Lines->search(
2135
        my $lost_fee_lines = Koha::Account::Lines->search(
2136
            { borrowernumber => $patron->id, itemnumber => $item->itemnumber, debit_type_code => 'LOST' } );
2136
            { borrowernumber => $patron->id, itemnumber => $item->itemnumber, debit_type_code => 'LOST' } );
Lines 2188-2200 subtest '_FixAccountForLostAndReturned' => sub { Link Here
2188
        LostItem( $item->itemnumber, 1 );
2188
        LostItem( $item->itemnumber, 1 );
2189
2189
2190
        my $processing_fee_lines = Koha::Account::Lines->search(
2190
        my $processing_fee_lines = Koha::Account::Lines->search(
2191
            { borrowernumber => $patron->id, itemnumber => $item->itemnumber, debit_type_code => 'PF' } );
2191
            { borrowernumber => $patron->id, itemnumber => $item->itemnumber, debit_type_code => 'PROCESSING' } );
2192
        is( $processing_fee_lines->count, 1, 'Only one processing fee produced' );
2192
        is( $processing_fee_lines->count, 1, 'Only one processing fee produced' );
2193
        my $processing_fee_line = $processing_fee_lines->next;
2193
        my $processing_fee_line = $processing_fee_lines->next;
2194
        is( $processing_fee_line->amount + 0,
2194
        is( $processing_fee_line->amount + 0,
2195
            $processfee_amount, 'The right PF amount is generated' );
2195
            $processfee_amount, 'The right PROCESSING amount is generated' );
2196
        is( $processing_fee_line->amountoutstanding + 0,
2196
        is( $processing_fee_line->amountoutstanding + 0,
2197
            $processfee_amount, 'The right PF amountoutstanding is generated' );
2197
            $processfee_amount, 'The right PROCESSING amountoutstanding is generated' );
2198
2198
2199
        my $lost_fee_lines = Koha::Account::Lines->search(
2199
        my $lost_fee_lines = Koha::Account::Lines->search(
2200
            { borrowernumber => $patron->id, itemnumber => $item->itemnumber, debit_type_code => 'LOST' } );
2200
            { borrowernumber => $patron->id, itemnumber => $item->itemnumber, debit_type_code => 'LOST' } );
Lines 2258-2270 subtest '_FixAccountForLostAndReturned' => sub { Link Here
2258
        LostItem( $item->itemnumber, 1 );
2258
        LostItem( $item->itemnumber, 1 );
2259
2259
2260
        my $processing_fee_lines = Koha::Account::Lines->search(
2260
        my $processing_fee_lines = Koha::Account::Lines->search(
2261
            { borrowernumber => $patron->id, itemnumber => $item->itemnumber, debit_type_code => 'PF' } );
2261
            { borrowernumber => $patron->id, itemnumber => $item->itemnumber, debit_type_code => 'PROCESSING' } );
2262
        is( $processing_fee_lines->count, 1, 'Only one processing fee produced' );
2262
        is( $processing_fee_lines->count, 1, 'Only one processing fee produced' );
2263
        my $processing_fee_line = $processing_fee_lines->next;
2263
        my $processing_fee_line = $processing_fee_lines->next;
2264
        is( $processing_fee_line->amount + 0,
2264
        is( $processing_fee_line->amount + 0,
2265
            $processfee_amount, 'The right PF amount is generated' );
2265
            $processfee_amount, 'The right PROCESSING amount is generated' );
2266
        is( $processing_fee_line->amountoutstanding + 0,
2266
        is( $processing_fee_line->amountoutstanding + 0,
2267
            $processfee_amount, 'The right PF amountoutstanding is generated' );
2267
            $processfee_amount, 'The right PROCESSING amountoutstanding is generated' );
2268
2268
2269
        my $lost_fee_lines = Koha::Account::Lines->search(
2269
        my $lost_fee_lines = Koha::Account::Lines->search(
2270
            { borrowernumber => $patron->id, itemnumber => $item->itemnumber, debit_type_code => 'LOST' } );
2270
            { borrowernumber => $patron->id, itemnumber => $item->itemnumber, debit_type_code => 'LOST' } );
Lines 2311-2323 subtest '_FixAccountForLostAndReturned' => sub { Link Here
2311
        LostItem( $item->itemnumber, 1 );
2311
        LostItem( $item->itemnumber, 1 );
2312
2312
2313
        my $processing_fee_lines = Koha::Account::Lines->search(
2313
        my $processing_fee_lines = Koha::Account::Lines->search(
2314
            { borrowernumber => $patron->id, itemnumber => $item->itemnumber, debit_type_code => 'PF' } );
2314
            { borrowernumber => $patron->id, itemnumber => $item->itemnumber, debit_type_code => 'PROCESSING' } );
2315
        is( $processing_fee_lines->count, 1, 'Only one processing fee produced' );
2315
        is( $processing_fee_lines->count, 1, 'Only one processing fee produced' );
2316
        my $processing_fee_line = $processing_fee_lines->next;
2316
        my $processing_fee_line = $processing_fee_lines->next;
2317
        is( $processing_fee_line->amount + 0,
2317
        is( $processing_fee_line->amount + 0,
2318
            $processfee_amount, 'The right PF amount is generated' );
2318
            $processfee_amount, 'The right PROCESSING amount is generated' );
2319
        is( $processing_fee_line->amountoutstanding + 0,
2319
        is( $processing_fee_line->amountoutstanding + 0,
2320
            $processfee_amount, 'The right PF amountoutstanding is generated' );
2320
            $processfee_amount, 'The right PROCESSING amountoutstanding is generated' );
2321
2321
2322
        my $lost_fee_lines = Koha::Account::Lines->search(
2322
        my $lost_fee_lines = Koha::Account::Lines->search(
2323
            { borrowernumber => $patron->id, itemnumber => $item->itemnumber, debit_type_code => 'LOST' } );
2323
            { borrowernumber => $patron->id, itemnumber => $item->itemnumber, debit_type_code => 'LOST' } );
Lines 2328-2334 subtest '_FixAccountForLostAndReturned' => sub { Link Here
2328
            $replacement_amount, 'The right LOST amountountstanding is generated' );
2328
            $replacement_amount, 'The right LOST amountountstanding is generated' );
2329
2329
2330
        my $account = $patron->account;
2330
        my $account = $patron->account;
2331
        is( $account->balance, $processfee_amount + $replacement_amount, 'Balance is PF + L' );
2331
        is( $account->balance, $processfee_amount + $replacement_amount, 'Balance is PROCESSING + L' );
2332
2332
2333
        # Partially pay fee
2333
        # Partially pay fee
2334
        my $payment_amount = 27;
2334
        my $payment_amount = 27;
Lines 2363-2369 subtest '_FixAccountForLostAndReturned' => sub { Link Here
2363
        my $credit_return_id = C4::Circulation::_FixAccountForLostAndReturned( $item->itemnumber, $patron->id );
2363
        my $credit_return_id = C4::Circulation::_FixAccountForLostAndReturned( $item->itemnumber, $patron->id );
2364
        my $credit_return = Koha::Account::Lines->find($credit_return_id);
2364
        my $credit_return = Koha::Account::Lines->find($credit_return_id);
2365
2365
2366
        is( $account->balance, $processfee_amount - $payment_amount, 'Balance is PF - payment (LOST_RETURN)' );
2366
        is( $account->balance, $processfee_amount - $payment_amount, 'Balance is PROCESSING - payment (LOST_RETURN)' );
2367
2367
2368
        $lost_fee_line->discard_changes;
2368
        $lost_fee_line->discard_changes;
2369
        is( $lost_fee_line->amountoutstanding + 0, 0, 'Lost fee has no outstanding amount' );
2369
        is( $lost_fee_line->amountoutstanding + 0, 0, 'Lost fee has no outstanding amount' );
Lines 2383-2389 subtest '_FixAccountForLostAndReturned' => sub { Link Here
2383
2383
2384
        is( $account->balance,
2384
        is( $account->balance,
2385
            $processfee_amount - $payment_amount,
2385
            $processfee_amount - $payment_amount,
2386
            'The patron balance is the difference between the PF and the credit'
2386
            'The patron balance is the difference between the PROCESSING and the credit'
2387
        );
2387
        );
2388
    };
2388
    };
2389
2389
Lines 2459-2465 subtest '_FixAccountForLostAndReturned' => sub { Link Here
2459
        my $credit_return_id = C4::Circulation::_FixAccountForLostAndReturned( $item_id, $patron->id );
2459
        my $credit_return_id = C4::Circulation::_FixAccountForLostAndReturned( $item_id, $patron->id );
2460
        my $credit_return = Koha::Account::Lines->find($credit_return_id);
2460
        my $credit_return = Koha::Account::Lines->find($credit_return_id);
2461
2461
2462
        is( $account->balance, $manual_debit_amount - $payment_amount, 'Balance is PF - payment (LOST_RETURN)' );
2462
        is( $account->balance, $manual_debit_amount - $payment_amount, 'Balance is PROCESSING - payment (LOST_RETURN)' );
2463
2463
2464
        my $manual_debit = Koha::Account::Lines->search({ borrowernumber => $patron->id, debit_type_code => 'OVERDUE', status => 'UNRETURNED' })->next;
2464
        my $manual_debit = Koha::Account::Lines->search({ borrowernumber => $patron->id, debit_type_code => 'OVERDUE', status => 'UNRETURNED' })->next;
2465
        is( $manual_debit->amountoutstanding + 0, $manual_debit_amount - $payment_amount, 'reconcile_balance was called' );
2465
        is( $manual_debit->amountoutstanding + 0, $manual_debit_amount - $payment_amount, 'reconcile_balance was called' );
2466
- 

Return to bug 23049