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

(-)a/C4/Circulation.pm (-11 / +7 lines)
Lines 1471-1485 sub AddIssue { Link Here
1471
            # If it costs to borrow this book, charge it to the patron's account.
1471
            # If it costs to borrow this book, charge it to the patron's account.
1472
            my ( $charge, $itemtype ) = GetIssuingCharges( $item_object->itemnumber, $borrower->{'borrowernumber'} );
1472
            my ( $charge, $itemtype ) = GetIssuingCharges( $item_object->itemnumber, $borrower->{'borrowernumber'} );
1473
            if ( $charge > 0 ) {
1473
            if ( $charge > 0 ) {
1474
                my $description = "Rental";
1474
                AddIssuingCharge( $issue, $charge, 'rent' );
1475
                AddIssuingCharge( $issue, $charge, $description );
1476
            }
1475
            }
1477
1476
1478
            my $itemtype_object = Koha::ItemTypes->find( $item_object->effective_itemtype );
1477
            my $itemtype_object = Koha::ItemTypes->find( $item_object->effective_itemtype );
1479
            if ( $itemtype_object ) {
1478
            if ( $itemtype_object ) {
1480
                my $accumulate_charge = $fees->accumulate_rentalcharge();
1479
                my $accumulate_charge = $fees->accumulate_rentalcharge();
1481
                if ( $accumulate_charge > 0 ) {
1480
                if ( $accumulate_charge > 0 ) {
1482
                    AddIssuingCharge( $issue, $accumulate_charge, 'Daily rental' ) if $accumulate_charge > 0;
1481
                    AddIssuingCharge( $issue, $accumulate_charge, 'rent_daily' ) if $accumulate_charge > 0;
1483
                    $charge += $accumulate_charge;
1482
                    $charge += $accumulate_charge;
1484
                    $item_unblessed->{charge} = $charge;
1483
                    $item_unblessed->{charge} = $charge;
1485
                }
1484
                }
Lines 2888-2895 sub AddRenewal { Link Here
2888
    # Charge a new rental fee, if applicable
2887
    # Charge a new rental fee, if applicable
2889
    my ( $charge, $type ) = GetIssuingCharges( $itemnumber, $borrowernumber );
2888
    my ( $charge, $type ) = GetIssuingCharges( $itemnumber, $borrowernumber );
2890
    if ( $charge > 0 ) {
2889
    if ( $charge > 0 ) {
2891
        my $description = "Renewal of Rental Item " . $biblio->title . " " .$item_object->barcode;
2890
        AddIssuingCharge($issue, $charge, 'rent_renewal');
2892
        AddIssuingCharge($issue, $charge, $description);
2893
    }
2891
    }
2894
2892
2895
    # Charge a new accumulate rental fee, if applicable
2893
    # Charge a new accumulate rental fee, if applicable
Lines 2897-2904 sub AddRenewal { Link Here
2897
    if ( $itemtype_object ) {
2895
    if ( $itemtype_object ) {
2898
        my $accumulate_charge = $fees->accumulate_rentalcharge();
2896
        my $accumulate_charge = $fees->accumulate_rentalcharge();
2899
        if ( $accumulate_charge > 0 ) {
2897
        if ( $accumulate_charge > 0 ) {
2900
            my $type_desc = "Renewal of Daily Rental Item " . $biblio->title . " $item_unblessed->{'barcode'}";
2898
            AddIssuingCharge( $issue, $accumulate_charge, 'rent_daily_renewal' )
2901
            AddIssuingCharge( $issue, $accumulate_charge, $type_desc )
2902
        }
2899
        }
2903
        $charge += $accumulate_charge;
2900
        $charge += $accumulate_charge;
2904
    }
2901
    }
Lines 3220-3231 sub _get_discount_from_rule { Link Here
3220
3217
3221
=head2 AddIssuingCharge
3218
=head2 AddIssuingCharge
3222
3219
3223
  &AddIssuingCharge( $checkout, $charge, [$description] )
3220
  &AddIssuingCharge( $checkout, $charge, $type )
3224
3221
3225
=cut
3222
=cut
3226
3223
3227
sub AddIssuingCharge {
3224
sub AddIssuingCharge {
3228
    my ( $checkout, $charge, $description ) = @_;
3225
    my ( $checkout, $charge, $type ) = @_;
3229
3226
3230
    # FIXME What if checkout does not exist?
3227
    # FIXME What if checkout does not exist?
3231
3228
Lines 3233-3244 sub AddIssuingCharge { Link Here
3233
    my $accountline = $account->add_debit(
3230
    my $accountline = $account->add_debit(
3234
        {
3231
        {
3235
            amount      => $charge,
3232
            amount      => $charge,
3236
            description => $description,
3237
            note        => undef,
3233
            note        => undef,
3238
            user_id     => C4::Context->userenv ? C4::Context->userenv->{'number'} : undef,
3234
            user_id     => C4::Context->userenv ? C4::Context->userenv->{'number'} : undef,
3239
            library_id  => C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef,
3235
            library_id  => C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef,
3240
            interface   => C4::Context->interface,
3236
            interface   => C4::Context->interface,
3241
            type        => 'rent',
3237
            type        => $type,
3242
            item_id     => $checkout->itemnumber,
3238
            item_id     => $checkout->itemnumber,
3243
            issue_id    => $checkout->issue_id,
3239
            issue_id    => $checkout->issue_id,
3244
        }
3240
        }
(-)a/Koha/Account.pm (-10 / +19 lines)
Lines 432-437 $debit_type can be any of: Link Here
432
  - sundry
432
  - sundry
433
  - processing
433
  - processing
434
  - rent
434
  - rent
435
  - rent_daily
436
  - rent_renewal
437
  - rent_daily_renewal
435
  - reserve
438
  - reserve
436
  - manual
439
  - manual
437
440
Lines 697-702 our $offset_type = { Link Here
697
    'processing'       => 'Processing Fee',
700
    'processing'       => 'Processing Fee',
698
    'lost_item'        => 'Lost Item',
701
    'lost_item'        => 'Lost Item',
699
    'rent'             => 'Rental Fee',
702
    'rent'             => 'Rental Fee',
703
    'rent_daily'       => 'Rental Fee',
704
    'rent_renew'       => 'Rental Fee',
705
    'rent_daily_renew' => 'Rental Fee',
700
    'overdue'          => 'OVERDUE',
706
    'overdue'          => 'OVERDUE',
701
    'manual_debit'     => 'Manual Debit',
707
    'manual_debit'     => 'Manual Debit',
702
    'hold_expired'     => 'Hold Expired'
708
    'hold_expired'     => 'Hold Expired'
Lines 719-734 our $account_type_credit = { Link Here
719
=cut
725
=cut
720
726
721
our $account_type_debit = {
727
our $account_type_debit = {
722
    'account'       => 'A',
728
    'account'          => 'A',
723
    'overdue'       => 'OVERDUE',
729
    'overdue'          => 'OVERDUE',
724
    'lost_item'     => 'LOST',
730
    'lost_item'        => 'LOST',
725
    'new_card'      => 'N',
731
    'new_card'         => 'N',
726
    'sundry'        => 'M',
732
    'sundry'           => 'M',
727
    'processing'    => 'PF',
733
    'processing'       => 'PF',
728
    'rent'          => 'Rent',
734
    'rent'             => 'RENT',
729
    'reserve'       => 'Res',
735
    'rent_daily'       => 'RENT_DAILY',
730
    'manual_debit'  => 'M',
736
    'rent_renew'       => 'RENT_RENEW',
731
    'hold_expired'  => 'HE'
737
    'rent_daily_renew' => 'RENT_DAILY_RENEW',
738
    'reserve'          => 'Res',
739
    'manual_debit'     => 'M',
740
    'hold_expired'     => 'HE'
732
};
741
};
733
742
734
=head1 AUTHORS
743
=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, thanks</span>
3
        [%- CASE 'Pay'              -%]<span>Payment, thanks</span>
4
        [%- CASE 'Pay00'       -%]<span>Payment, thanks (cash via SIP2)</span>
4
        [%- CASE 'Pay00'            -%]<span>Payment, thanks (cash via SIP2)</span>
5
        [%- CASE 'Pay01'       -%]<span>Payment, thanks (VISA via SIP2)</span>
5
        [%- CASE 'Pay01'            -%]<span>Payment, thanks (VISA via SIP2)</span>
6
        [%- CASE 'Pay02'       -%]<span>Payment, thanks (credit card via SIP2)</span>
6
        [%- CASE 'Pay02'            -%]<span>Payment, thanks (credit card via SIP2)</span>
7
        [%- CASE 'N'           -%]<span>New card</span>
7
        [%- CASE 'N'                -%]<span>New card</span>
8
        [%- CASE 'OVERDUE'     -%]<span>Fine[%- PROCESS account_status_description account=account -%]</span>
8
        [%- CASE 'OVERDUE'          -%]<span>Fine[%- PROCESS account_status_description account=account -%]</span>
9
        [%- CASE 'A'           -%]<span>Account management fee</span>
9
        [%- CASE 'A'                -%]<span>Account management fee</span>
10
        [%- CASE 'M'           -%]<span>Sundry</span>
10
        [%- CASE 'M'                -%]<span>Sundry</span>
11
        [%- CASE 'LOST'        -%]<span>Lost item[%- PROCESS account_status_description account=account -%]</span>
11
        [%- CASE 'LOST'             -%]<span>Lost item[%- PROCESS account_status_description account=account -%]</span>
12
        [%- CASE 'W'           -%]<span>Writeoff[%- PROCESS account_status_description account=account -%]</span>
12
        [%- CASE 'W'                -%]<span>Writeoff[%- PROCESS account_status_description account=account -%]</span>
13
        [%- CASE 'HE'          -%]<span>Hold waiting too long</span>
13
        [%- CASE 'HE'               -%]<span>Hold waiting too long</span>
14
        [%- CASE 'Rent'        -%]<span>Rental fee</span>
14
        [%- CASE 'RENT'             -%]<span>Rental fee</span>
15
        [%- CASE 'FOR'         -%]<span>Forgiven[%- PROCESS account_status_description account=account -%]</span>
15
        [%- CASE 'RENT_DAILY'       -%]<span>Daily rental fee</span>
16
        [%- CASE 'PF'          -%]<span>Lost item processing fee</span>
16
        [%- CASE 'RENT_RENEW'       -%]<span>Renewal of rental item</span>
17
        [%- CASE 'PAY'         -%]<span>Payment[%- PROCESS account_status_description account=account -%]</span>
17
        [%- CASE 'RENT_DAILY_RENEW' -%]<span>Rewewal of daily rental item</span>
18
        [%- CASE 'WO'          -%]<span>Writeoff[%- PROCESS account_status_description account=account -%]</span>
18
        [%- CASE 'FOR'              -%]<span>Forgiven[%- PROCESS account_status_description account=account -%]</span>
19
        [%- CASE 'C'           -%]<span>Credit[%- PROCESS account_status_description account=account -%]</span>
19
        [%- CASE 'PF'               -%]<span>Lost item processing fee</span>
20
        [%- CASE 'LOST_RETURN' -%]<span>Lost item fee refund[%- PROCESS account_status_description account=account -%]</span>
20
        [%- CASE 'PAY'              -%]<span>Payment[%- PROCESS account_status_description account=account -%]</span>
21
        [%- CASE 'Res'         -%]<span>Hold fee</span>
21
        [%- CASE 'WO'               -%]<span>Writeoff[%- PROCESS account_status_description account=account -%]</span>
22
        [%- CASE               -%][% account.accounttype | html %]
22
        [%- CASE 'C'                -%]<span>Credit[%- PROCESS account_status_description account=account -%]</span>
23
        [%- CASE 'LOST_RETURN'      -%]<span>Lost item fee refund[%- PROCESS account_status_description account=account -%]</span>
24
        [%- CASE 'Res'              -%]<span>Hold fee</span>
25
        [%- CASE                    -%][% account.accounttype | html %]
23
    [%- END -%]
26
    [%- END -%]
24
[%- END -%]
27
[%- END -%]
25
28
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/account-table.inc (-2 / +4 lines)
Lines 41-47 Link Here
41
                        [% CASE 'LOST' %]Lost item[%- PROCESS account_status_description account=account -%]
41
                        [% CASE 'LOST' %]Lost item[%- PROCESS account_status_description account=account -%]
42
                        [% CASE 'W' %]Writeoff[%- PROCESS account_status_description account=account -%]
42
                        [% CASE 'W' %]Writeoff[%- PROCESS account_status_description account=account -%]
43
                        [% CASE 'HE' %]Hold waiting too long
43
                        [% CASE 'HE' %]Hold waiting too long
44
                        [% CASE 'Rent' %]Rental fee
44
                        [% CASE 'RENT' %]Rental fee
45
                        [% CASE 'RENT_DAILY' %]Daily rental fee
46
                        [% CASE 'RENT_RENEW' %]Renewal of rental item
47
                        [% CASE 'RENT_DAILT_RENEW' %]Renewal of dailt rental item
45
                        [% CASE 'FOR' %]Forgiven[%- PROCESS account_status_description account=account -%]
48
                        [% CASE 'FOR' %]Forgiven[%- PROCESS account_status_description account=account -%]
46
                        [% CASE 'PF' %]Lost item processing fee
49
                        [% CASE 'PF' %]Lost item processing fee
47
                        [% CASE 'PAY' %]Payment[%- PROCESS account_status_description account=account -%]
50
                        [% CASE 'PAY' %]Payment[%- PROCESS account_status_description account=account -%]
48
- 

Return to bug 11573