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

(-)a/Koha/Account.pm (-1 / +4 lines)
Lines 429-434 $debit_type can be any of: Link Here
429
  - lost_item
429
  - lost_item
430
  - new_card
430
  - new_card
431
  - account
431
  - account
432
  - account_renew
432
  - sundry
433
  - sundry
433
  - processing
434
  - processing
434
  - rent
435
  - rent
Lines 696-701 our $offset_type = { Link Here
696
    'payment'          => 'Payment',
697
    'payment'          => 'Payment',
697
    'writeoff'         => 'Writeoff',
698
    'writeoff'         => 'Writeoff',
698
    'account'          => 'Account Fee',
699
    'account'          => 'Account Fee',
700
    'account_renew'    => 'Account Fee',
699
    'reserve'          => 'Reserve Fee',
701
    'reserve'          => 'Reserve Fee',
700
    'processing'       => 'Processing Fee',
702
    'processing'       => 'Processing Fee',
701
    'lost_item'        => 'Lost Item',
703
    'lost_item'        => 'Lost Item',
Lines 725-731 our $account_type_credit = { Link Here
725
=cut
727
=cut
726
728
727
our $account_type_debit = {
729
our $account_type_debit = {
728
    'account'          => 'A',
730
    'account'          => 'ACCOUNT',
731
    'account_renew'    => 'ACCOUNT_RENEW',
729
    'overdue'          => 'OVERDUE',
732
    'overdue'          => 'OVERDUE',
730
    'lost_item'        => 'LOST',
733
    'lost_item'        => 'LOST',
731
    'new_card'         => 'N',
734
    'new_card'         => 'N',
(-)a/Koha/Patron.pm (-6 / +9 lines)
Lines 231-237 sub store { Link Here
231
231
232
                $self = $self->SUPER::store;
232
                $self = $self->SUPER::store;
233
233
234
                $self->add_enrolment_fee_if_needed;
234
                $self->add_enrolment_fee_if_needed(0);
235
235
236
                logaction( "MEMBERS", "CREATE", $self->borrowernumber, "" )
236
                logaction( "MEMBERS", "CREATE", $self->borrowernumber, "" )
237
                  if C4::Context->preference("BorrowersLog");
237
                  if C4::Context->preference("BorrowersLog");
Lines 253-259 sub store { Link Here
253
                    and $self->category->categorycode ne
253
                    and $self->category->categorycode ne
254
                    $self_from_storage->category->categorycode )
254
                    $self_from_storage->category->categorycode )
255
                {
255
                {
256
                    $self->add_enrolment_fee_if_needed;
256
                    $self->add_enrolment_fee_if_needed(1);
257
                }
257
                }
258
258
259
                # Actionlogs
259
                # Actionlogs
Lines 716-722 sub renew_account { Link Here
716
    $self->date_renewed( dt_from_string() );
716
    $self->date_renewed( dt_from_string() );
717
    $self->store();
717
    $self->store();
718
718
719
    $self->add_enrolment_fee_if_needed;
719
    $self->add_enrolment_fee_if_needed(1);
720
720
721
    logaction( "MEMBERS", "RENEW", $self->borrowernumber, "Membership renewed" ) if C4::Context->preference("BorrowersLog");
721
    logaction( "MEMBERS", "RENEW", $self->borrowernumber, "Membership renewed" ) if C4::Context->preference("BorrowersLog");
722
    return dt_from_string( $expiry_date )->truncate( to => 'day' );
722
    return dt_from_string( $expiry_date )->truncate( to => 'day' );
Lines 840-862 sub article_requests_finished { Link Here
840
840
841
=head3 add_enrolment_fee_if_needed
841
=head3 add_enrolment_fee_if_needed
842
842
843
my $enrolment_fee = $patron->add_enrolment_fee_if_needed;
843
my $enrolment_fee = $patron->add_enrolment_fee_if_needed($renewal);
844
844
845
Add enrolment fee for a patron if needed.
845
Add enrolment fee for a patron if needed.
846
846
847
$renewal - boolean denoting whether this is an account renewal or not
848
847
=cut
849
=cut
848
850
849
sub add_enrolment_fee_if_needed {
851
sub add_enrolment_fee_if_needed {
850
    my ($self) = @_;
852
    my ($self, $renewal) = @_;
851
    my $enrolment_fee = $self->category->enrolmentfee;
853
    my $enrolment_fee = $self->category->enrolmentfee;
852
    if ( $enrolment_fee && $enrolment_fee > 0 ) {
854
    if ( $enrolment_fee && $enrolment_fee > 0 ) {
855
        my $type = $renewal ? 'account_renew' : 'account';
853
        $self->account->add_debit(
856
        $self->account->add_debit(
854
            {
857
            {
855
                amount     => $enrolment_fee,
858
                amount     => $enrolment_fee,
856
                user_id    => C4::Context->userenv ? C4::Context->userenv->{'number'} : undef,
859
                user_id    => C4::Context->userenv ? C4::Context->userenv->{'number'} : undef,
857
                interface  => C4::Context->interface,
860
                interface  => C4::Context->interface,
858
                library_id => C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef,
861
                library_id => C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef,
859
                type       => 'account'
862
                type       => $type
860
            }
863
            }
861
        );
864
        );
862
    }
865
    }
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc (-1 / +2 lines)
Lines 6-12 Link Here
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 'ACCOUNT'          -%]<span>Account creation fee
10
        [%- CASE 'ACCOUNT_RENEW'    -%]<span>Account renewal fee
10
        [%- CASE 'M'                -%]<span>Sundry
11
        [%- CASE 'M'                -%]<span>Sundry
11
        [%- CASE 'LOST'             -%]<span>Lost item
12
        [%- CASE 'LOST'             -%]<span>Lost item
12
        [%- CASE 'W'                -%]<span>Writeoff
13
        [%- CASE 'W'                -%]<span>Writeoff
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tt (-1 / +1 lines)
Lines 79-85 Link Here
79
    [% INCLUDE 'str/members-menu.inc' %]
79
    [% INCLUDE 'str/members-menu.inc' %]
80
    [% Asset.js("js/members-menu.js") | $raw %]
80
    [% Asset.js("js/members-menu.js") | $raw %]
81
    <script>
81
    <script>
82
        var type_fees = {'LOST':'','OVERDUE':'','A':'','N':'','M':''};
82
        var type_fees = {'LOST':'','OVERDUE':'','ACCOUNT':'','ACCOUNT_RENEW':'','N':'','M':''};
83
        [% FOREACH invoice_types_loo IN invoice_types_loop %]
83
        [% FOREACH invoice_types_loo IN invoice_types_loop %]
84
            type_fees['[% invoice_types_loo.authorised_value | html %]'] = "[% invoice_types_loo.lib | html %]";
84
            type_fees['[% invoice_types_loo.authorised_value | html %]'] = "[% invoice_types_loo.lib | html %]";
85
        [% END %]
85
        [% END %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/account-table.inc (-2 / +2 lines)
Lines 36-42 Link Here
36
                        [% CASE 'VOID' %]Voided
36
                        [% CASE 'VOID' %]Voided
37
                        [% CASE 'N' %]New card
37
                        [% CASE 'N' %]New card
38
                        [% CASE 'OVERDUE' %]Fine
38
                        [% CASE 'OVERDUE' %]Fine
39
                        [% CASE 'A' %]Account management fee
39
                        [% CASE 'ACCOUNT' %]Account creation fee
40
                        [% CASE 'ACCOUNT_RENEW' %]Account renewal fee
40
                        [% CASE 'M' %]Sundry
41
                        [% CASE 'M' %]Sundry
41
                        [% CASE 'LOST' %]Lost item
42
                        [% CASE 'LOST' %]Lost item
42
                        [% CASE 'W' %]Writeoff
43
                        [% CASE 'W' %]Writeoff
43
- 

Return to bug 6759