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 2906-2913 sub AddRenewal { Link Here
2906
    # Charge a new rental fee, if applicable
2905
    # Charge a new rental fee, if applicable
2907
    my ( $charge, $type ) = GetIssuingCharges( $itemnumber, $borrowernumber );
2906
    my ( $charge, $type ) = GetIssuingCharges( $itemnumber, $borrowernumber );
2908
    if ( $charge > 0 ) {
2907
    if ( $charge > 0 ) {
2909
        my $description = "Renewal of Rental Item " . $biblio->title . " " .$item_object->barcode;
2908
        AddIssuingCharge($issue, $charge, 'rent_renew');
2910
        AddIssuingCharge($issue, $charge, $description);
2911
    }
2909
    }
2912
2910
2913
    # Charge a new accumulate rental fee, if applicable
2911
    # Charge a new accumulate rental fee, if applicable
Lines 2915-2922 sub AddRenewal { Link Here
2915
    if ( $itemtype_object ) {
2913
    if ( $itemtype_object ) {
2916
        my $accumulate_charge = $fees->accumulate_rentalcharge();
2914
        my $accumulate_charge = $fees->accumulate_rentalcharge();
2917
        if ( $accumulate_charge > 0 ) {
2915
        if ( $accumulate_charge > 0 ) {
2918
            my $type_desc = "Renewal of Daily Rental Item " . $biblio->title . " $item_unblessed->{'barcode'}";
2916
            AddIssuingCharge( $issue, $accumulate_charge, 'rent_daily_renew' )
2919
            AddIssuingCharge( $issue, $accumulate_charge, $type_desc )
2920
        }
2917
        }
2921
        $charge += $accumulate_charge;
2918
        $charge += $accumulate_charge;
2922
    }
2919
    }
Lines 3238-3249 sub _get_discount_from_rule { Link Here
3238
3235
3239
=head2 AddIssuingCharge
3236
=head2 AddIssuingCharge
3240
3237
3241
  &AddIssuingCharge( $checkout, $charge, [$description] )
3238
  &AddIssuingCharge( $checkout, $charge, $type )
3242
3239
3243
=cut
3240
=cut
3244
3241
3245
sub AddIssuingCharge {
3242
sub AddIssuingCharge {
3246
    my ( $checkout, $charge, $description ) = @_;
3243
    my ( $checkout, $charge, $type ) = @_;
3247
3244
3248
    # FIXME What if checkout does not exist?
3245
    # FIXME What if checkout does not exist?
3249
3246
Lines 3251-3262 sub AddIssuingCharge { Link Here
3251
    my $accountline = $account->add_debit(
3248
    my $accountline = $account->add_debit(
3252
        {
3249
        {
3253
            amount      => $charge,
3250
            amount      => $charge,
3254
            description => $description,
3255
            note        => undef,
3251
            note        => undef,
3256
            user_id     => C4::Context->userenv ? C4::Context->userenv->{'number'} : undef,
3252
            user_id     => C4::Context->userenv ? C4::Context->userenv->{'number'} : undef,
3257
            library_id  => C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef,
3253
            library_id  => C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef,
3258
            interface   => C4::Context->interface,
3254
            interface   => C4::Context->interface,
3259
            type        => 'rent',
3255
            type        => $type,
3260
            item_id     => $checkout->itemnumber,
3256
            item_id     => $checkout->itemnumber,
3261
            issue_id    => $checkout->issue_id,
3257
            issue_id    => $checkout->issue_id,
3262
        }
3258
        }
(-)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
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 (-2 / +5 lines)
Lines 41-47 Link Here
41
                        [% CASE 'LOST' %]Lost item
41
                        [% CASE 'LOST' %]Lost item
42
                        [% CASE 'W' %]Writeoff
42
                        [% CASE 'W' %]Writeoff
43
                        [% CASE 'HE' %]Hold waiting too long
43
                        [% CASE 'HE' %]Hold waiting too long
44
                        [% CASE 'Rent' %]Rental fee
44
45
                        [% CASE 'RENT' %]Rental fee
46
                        [% CASE 'RENT_DAILY' %]Daily rental fee
47
                        [% CASE 'RENT_RENEW' %]Renewal of rental item
48
                        [% CASE 'RENT_DAILT_RENEW' %]Renewal of dailt rental item
45
                        [% CASE 'FOR' %]Forgiven
49
                        [% CASE 'FOR' %]Forgiven
46
                        [% CASE 'PF' %]Lost item processing fee
50
                        [% CASE 'PF' %]Lost item processing fee
47
                        [% CASE 'PAY' %]Payment
51
                        [% CASE 'PAY' %]Payment
48
- 

Return to bug 11573