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

(-)a/C4/Circulation.pm (-11 / +7 lines)
Lines 1470-1484 sub AddIssue { Link Here
1470
            # If it costs to borrow this book, charge it to the patron's account.
1470
            # If it costs to borrow this book, charge it to the patron's account.
1471
            my ( $charge, $itemtype ) = GetIssuingCharges( $item_object->itemnumber, $borrower->{'borrowernumber'} );
1471
            my ( $charge, $itemtype ) = GetIssuingCharges( $item_object->itemnumber, $borrower->{'borrowernumber'} );
1472
            if ( $charge > 0 ) {
1472
            if ( $charge > 0 ) {
1473
                my $description = "Rental";
1473
                AddIssuingCharge( $issue, $charge, 'rent' );
1474
                AddIssuingCharge( $issue, $charge, $description );
1475
            }
1474
            }
1476
1475
1477
            my $itemtype_object = Koha::ItemTypes->find( $item_object->effective_itemtype );
1476
            my $itemtype_object = Koha::ItemTypes->find( $item_object->effective_itemtype );
1478
            if ( $itemtype_object ) {
1477
            if ( $itemtype_object ) {
1479
                my $accumulate_charge = $fees->accumulate_rentalcharge();
1478
                my $accumulate_charge = $fees->accumulate_rentalcharge();
1480
                if ( $accumulate_charge > 0 ) {
1479
                if ( $accumulate_charge > 0 ) {
1481
                    AddIssuingCharge( $issue, $accumulate_charge, 'Daily rental' ) if $accumulate_charge > 0;
1480
                    AddIssuingCharge( $issue, $accumulate_charge, 'rent_daily' ) if $accumulate_charge > 0;
1482
                    $charge += $accumulate_charge;
1481
                    $charge += $accumulate_charge;
1483
                    $item_unblessed->{charge} = $charge;
1482
                    $item_unblessed->{charge} = $charge;
1484
                }
1483
                }
Lines 2912-2919 sub AddRenewal { Link Here
2912
    # Charge a new rental fee, if applicable
2911
    # Charge a new rental fee, if applicable
2913
    my ( $charge, $type ) = GetIssuingCharges( $itemnumber, $borrowernumber );
2912
    my ( $charge, $type ) = GetIssuingCharges( $itemnumber, $borrowernumber );
2914
    if ( $charge > 0 ) {
2913
    if ( $charge > 0 ) {
2915
        my $description = "Renewal of Rental Item " . $biblio->title . " " .$item_object->barcode;
2914
        AddIssuingCharge($issue, $charge, 'rent_renew');
2916
        AddIssuingCharge($issue, $charge, $description);
2917
    }
2915
    }
2918
2916
2919
    # Charge a new accumulate rental fee, if applicable
2917
    # Charge a new accumulate rental fee, if applicable
Lines 2921-2928 sub AddRenewal { Link Here
2921
    if ( $itemtype_object ) {
2919
    if ( $itemtype_object ) {
2922
        my $accumulate_charge = $fees->accumulate_rentalcharge();
2920
        my $accumulate_charge = $fees->accumulate_rentalcharge();
2923
        if ( $accumulate_charge > 0 ) {
2921
        if ( $accumulate_charge > 0 ) {
2924
            my $type_desc = "Renewal of Daily Rental Item " . $biblio->title . " $item_unblessed->{'barcode'}";
2922
            AddIssuingCharge( $issue, $accumulate_charge, 'rent_daily_renew' )
2925
            AddIssuingCharge( $issue, $accumulate_charge, $type_desc )
2926
        }
2923
        }
2927
        $charge += $accumulate_charge;
2924
        $charge += $accumulate_charge;
2928
    }
2925
    }
Lines 3244-3255 sub _get_discount_from_rule { Link Here
3244
3241
3245
=head2 AddIssuingCharge
3242
=head2 AddIssuingCharge
3246
3243
3247
  &AddIssuingCharge( $checkout, $charge, [$description] )
3244
  &AddIssuingCharge( $checkout, $charge, $type )
3248
3245
3249
=cut
3246
=cut
3250
3247
3251
sub AddIssuingCharge {
3248
sub AddIssuingCharge {
3252
    my ( $checkout, $charge, $description ) = @_;
3249
    my ( $checkout, $charge, $type ) = @_;
3253
3250
3254
    # FIXME What if checkout does not exist?
3251
    # FIXME What if checkout does not exist?
3255
3252
Lines 3257-3268 sub AddIssuingCharge { Link Here
3257
    my $accountline = $account->add_debit(
3254
    my $accountline = $account->add_debit(
3258
        {
3255
        {
3259
            amount      => $charge,
3256
            amount      => $charge,
3260
            description => $description,
3261
            note        => undef,
3257
            note        => undef,
3262
            user_id     => C4::Context->userenv ? C4::Context->userenv->{'number'} : undef,
3258
            user_id     => C4::Context->userenv ? C4::Context->userenv->{'number'} : undef,
3263
            library_id  => C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef,
3259
            library_id  => C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef,
3264
            interface   => C4::Context->interface,
3260
            interface   => C4::Context->interface,
3265
            type        => 'rent',
3261
            type        => $type,
3266
            item_id     => $checkout->itemnumber,
3262
            item_id     => $checkout->itemnumber,
3267
            issue_id    => $checkout->issue_id,
3263
            issue_id    => $checkout->issue_id,
3268
        }
3264
        }
(-)a/Koha/Account.pm (-10 / +19 lines)
Lines 444-449 $debit_type can be any of: Link Here
444
  - sundry
444
  - sundry
445
  - processing
445
  - processing
446
  - rent
446
  - rent
447
  - rent_daily
448
  - rent_renewal
449
  - rent_daily_renewal
447
  - reserve
450
  - reserve
448
  - manual
451
  - manual
449
452
Lines 709-714 our $offset_type = { Link Here
709
    'processing'       => 'Processing Fee',
712
    'processing'       => 'Processing Fee',
710
    'lost_item'        => 'Lost Item',
713
    'lost_item'        => 'Lost Item',
711
    'rent'             => 'Rental Fee',
714
    'rent'             => 'Rental Fee',
715
    'rent_daily'       => 'Rental Fee',
716
    'rent_renew'       => 'Rental Fee',
717
    'rent_daily_renew' => 'Rental Fee',
712
    'overdue'          => 'OVERDUE',
718
    'overdue'          => 'OVERDUE',
713
    'manual_debit'     => 'Manual Debit',
719
    'manual_debit'     => 'Manual Debit',
714
    'hold_expired'     => 'Hold Expired'
720
    'hold_expired'     => 'Hold Expired'
Lines 731-746 our $account_type_credit = { Link Here
731
=cut
737
=cut
732
738
733
our $account_type_debit = {
739
our $account_type_debit = {
734
    'account'       => 'A',
740
    'account'          => 'A',
735
    'overdue'       => 'OVERDUE',
741
    'overdue'          => 'OVERDUE',
736
    'lost_item'     => 'LOST',
742
    'lost_item'        => 'LOST',
737
    'new_card'      => 'N',
743
    'new_card'         => 'N',
738
    'sundry'        => 'M',
744
    'sundry'           => 'M',
739
    'processing'    => 'PF',
745
    'processing'       => 'PF',
740
    'rent'          => 'Rent',
746
    'rent'             => 'RENT',
741
    'reserve'       => 'Res',
747
    'rent_daily'       => 'RENT_DAILY',
742
    'manual_debit'  => 'M',
748
    'rent_renew'       => 'RENT_RENEW',
743
    'hold_expired'  => 'HE'
749
    'rent_daily_renew' => 'RENT_DAILY_RENEW',
750
    'reserve'          => 'Res',
751
    'manual_debit'     => 'M',
752
    'hold_expired'     => 'HE'
744
};
753
};
745
754
746
=head1 AUTHORS
755
=head1 AUTHORS
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc (-20 / +23 lines)
Lines 1-25 Link Here
1
[%- BLOCK account_type_description -%]
1
[%- BLOCK account_type_description -%]
2
    [%- SWITCH account.accounttype -%]
2
    [%- SWITCH account.accounttype -%]
3
        [%- CASE 'Pay'         -%]<span>Payment
3
        [%- CASE 'Pay'              -%]<span>Payment
4
        [%- CASE 'Pay00'       -%]<span>Payment (cash via SIP2)
4
        [%- CASE 'Pay00'            -%]<span>Payment (cash via SIP2)
5
        [%- CASE 'Pay01'       -%]<span>Payment (VISA via SIP2)
5
        [%- CASE 'Pay01'            -%]<span>Payment (VISA via SIP2)
6
        [%- CASE 'Pay02'       -%]<span>Payment (credit card via SIP2)
6
        [%- CASE 'Pay02'            -%]<span>Payment (credit card via SIP2)
7
        [%- CASE 'N'           -%]<span>New card
7
        [%- CASE 'N'                -%]<span>New card
8
        [%- CASE 'OVERDUE'     -%]<span>Fine
8
        [%- CASE 'OVERDUE'          -%]<span>Fine
9
        [%- CASE 'A'           -%]<span>Account management fee
9
        [%- CASE 'A'                -%]<span>Account management fee
10
        [%- CASE 'M'           -%]<span>Sundry
10
        [%- CASE 'M'                -%]<span>Sundry
11
        [%- CASE 'LOST'        -%]<span>Lost item
11
        [%- CASE 'LOST'             -%]<span>Lost item
12
        [%- CASE 'W'           -%]<span>Writeoff
12
        [%- CASE 'W'                -%]<span>Writeoff
13
        [%- CASE 'HE'          -%]<span>Hold waiting too long
13
        [%- CASE 'HE'               -%]<span>Hold waiting too long
14
        [%- CASE 'Rent'        -%]<span>Rental fee
14
        [%- CASE 'RENT'             -%]<span>Rental fee
15
        [%- CASE 'FOR'         -%]<span>Forgiven
15
        [%- CASE 'RENT_DAILY'       -%]<span>Daily rental fee
16
        [%- CASE 'PF'          -%]<span>Lost item processing fee
16
        [%- CASE 'RENT_RENEW'       -%]<span>Renewal of rental item
17
        [%- CASE 'PAY'         -%]<span>Payment
17
        [%- CASE 'RENT_DAILY_RENEW' -%]<span>Rewewal of daily rental item
18
        [%- CASE 'WO'          -%]<span>Writeoff
18
        [%- CASE 'FOR'              -%]<span>Forgiven
19
        [%- CASE 'C'           -%]<span>Credit
19
        [%- CASE 'PF'               -%]<span>Lost item processing fee
20
        [%- CASE 'LOST_RETURN' -%]<span>Lost item fee refund
20
        [%- CASE 'PAY'              -%]<span>Payment
21
        [%- CASE 'Res'         -%]<span>Hold fee
21
        [%- CASE 'WO'               -%]<span>Writeoff
22
        [%- CASE               -%]<span>[% account.accounttype | html %]
22
        [%- CASE 'C'                -%]<span>Credit
23
        [%- CASE 'LOST_RETURN'      -%]<span>Lost item fee refund
24
        [%- CASE 'Res'              -%]<span>Hold fee
25
        [%- CASE                    -%][% account.accounttype | html %]
23
    [%- END -%]
26
    [%- END -%]
24
    [%- PROCESS account_status_description account=account -%]</span>
27
    [%- PROCESS account_status_description account=account -%]</span>
25
[%- END -%]
28
[%- END -%]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/account-table.inc (-22 / +24 lines)
Lines 118-144 Link Here
118
118
119
[%- BLOCK account_type_description -%]
119
[%- BLOCK account_type_description -%]
120
    [%- SWITCH account.accounttype -%]
120
    [%- SWITCH account.accounttype -%]
121
        [%- CASE 'Pay'     -%]<span>Payment
121
        [%- CASE 'Pay'              -%]<span>Payment
122
        [%- CASE 'Pay00'   -%]<span>Payment (cash via SIP2)
122
        [%- CASE 'Pay00'            -%]<span>Payment (cash via SIP2)
123
        [%- CASE 'Pay01'   -%]<span>Payment (VISA via SIP2)
123
        [%- CASE 'Pay01'            -%]<span>Payment (VISA via SIP2)
124
        [%- CASE 'Pay02'   -%]<span>Payment (credit card via SIP2)
124
        [%- CASE 'Pay02'            -%]<span>Payment (credit card via SIP2)
125
        [%- CASE 'N'       -%]<span>New card
125
        [%- CASE 'VOID'             -%]<span>Voided
126
        [%- CASE 'OVERDUE' -%]<span>Fine
126
        [%- CASE 'N'                -%]<span>New card
127
        [%- CASE 'A'       -%]<span>Account management fee
127
        [%- CASE 'OVERDUE'          -%]<span>Fine
128
        [%- CASE 'M'       -%]<span>Sundry
128
        [%- CASE 'A'                -%]<span>Account management fee
129
        [%- CASE 'LOST'    -%]<span>Lost item
129
        [%- CASE 'M'                -%]<span>Sundry
130
        [%- CASE 'W'       -%]<span>Writeoff
130
        [%- CASE 'LOST'             -%]<span>Lost item
131
        [%- CASE 'HE'      -%]<span>Hold waiting too long
131
        [%- CASE 'W'                -%]<span>Writeoff
132
        [%- CASE 'Rent'    -%]<span>Rental fee
132
        [%- CASE 'HE'               -%]<span>Hold waiting too long
133
        [%- CASE 'FOR'     -%]<span>Forgiven
133
        [%- CASE 'RENT'             -%]<span>Rental fee
134
        [%- CASE 'LR'      -%]<span>Lost item fee refund
134
        [%- CASE 'RENT_DAILY'       -%]<span>Daily rental fee
135
        [%- CASE 'PF'      -%]<span>Lost item processing fee
135
        [%- CASE 'RENT_RENEW'       -%]<span>Renewal of rental item
136
        [%- CASE 'PAY'     -%]<span>Payment
136
        [%- CASE 'RENT_DAILT_RENEW' -%]<span>Renewal of dailt rental item
137
        [%- CASE 'WO'      -%]<span>Writeoff
137
        [%- CASE 'FOR'              -%]<span>Forgiven
138
        [%- CASE 'C'       -%]<span>Credit
138
        [%- CASE 'PF'               -%]<span>Lost item processing fee
139
        [%- CASE 'CR'      -%]<span>Credit
139
        [%- CASE 'PAY'              -%]<span>Payment
140
        [%- CASE 'Res'     -%]<span>Hold fee
140
        [%- CASE 'WO'               -%]<span>Writeoff
141
        [%- CASE           -%]<span>[% account.accounttype | html %]
141
        [%- CASE 'C'                -%]<span>Credit
142
        [%- CASE 'LOST_RETURN'      -%]<span>Lost item fee refund
143
        [%- CASE 'Res'              -%]<span>Hold fee
144
        [%- CASE                    -%]<span>[% account.accounttype | html %]
142
    [%- END -%]
145
    [%- END -%]
143
    [%- PROCESS account_status_description account=account -%]</span>
146
    [%- PROCESS account_status_description account=account -%]</span>
144
[%- END -%]
147
[%- END -%]
145
- 

Return to bug 11573