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

(-)a/Koha/Account.pm (-1 / +4 lines)
Lines 433-438 $debit_type can be any of: Link Here
433
  - lost_item
433
  - lost_item
434
  - new_card
434
  - new_card
435
  - account
435
  - account
436
  - account_renew
436
  - sundry
437
  - sundry
437
  - processing
438
  - processing
438
  - rent
439
  - rent
Lines 700-705 our $offset_type = { Link Here
700
    'payment'          => 'Payment',
701
    'payment'          => 'Payment',
701
    'writeoff'         => 'Writeoff',
702
    'writeoff'         => 'Writeoff',
702
    'account'          => 'Account Fee',
703
    'account'          => 'Account Fee',
704
    'account_renew'    => 'Account Fee',
703
    'reserve'          => 'Reserve Fee',
705
    'reserve'          => 'Reserve Fee',
704
    'processing'       => 'Processing Fee',
706
    'processing'       => 'Processing Fee',
705
    'lost_item'        => 'Lost Item',
707
    'lost_item'        => 'Lost Item',
Lines 729-735 our $account_type_credit = { Link Here
729
=cut
731
=cut
730
732
731
our $account_type_debit = {
733
our $account_type_debit = {
732
    'account'          => 'A',
734
    'account'          => 'ACCOUNT',
735
    'account_renew'    => 'ACCOUNT_RENEW',
733
    'overdue'          => 'OVERDUE',
736
    'overdue'          => 'OVERDUE',
734
    'lost_item'        => 'LOST',
737
    'lost_item'        => 'LOST',
735
    'new_card'         => 'N',
738
    'new_card'         => 'N',
(-)a/Koha/Patron.pm (-6 / +9 lines)
Lines 236-242 sub store { Link Here
236
236
237
                $self = $self->SUPER::store;
237
                $self = $self->SUPER::store;
238
238
239
                $self->add_enrolment_fee_if_needed;
239
                $self->add_enrolment_fee_if_needed(0);
240
240
241
                logaction( "MEMBERS", "CREATE", $self->borrowernumber, "" )
241
                logaction( "MEMBERS", "CREATE", $self->borrowernumber, "" )
242
                  if C4::Context->preference("BorrowersLog");
242
                  if C4::Context->preference("BorrowersLog");
Lines 258-264 sub store { Link Here
258
                    and $self->category->categorycode ne
258
                    and $self->category->categorycode ne
259
                    $self_from_storage->category->categorycode )
259
                    $self_from_storage->category->categorycode )
260
                {
260
                {
261
                    $self->add_enrolment_fee_if_needed;
261
                    $self->add_enrolment_fee_if_needed(1);
262
                }
262
                }
263
263
264
                # Actionlogs
264
                # Actionlogs
Lines 751-757 sub renew_account { Link Here
751
    $self->date_renewed( dt_from_string() );
751
    $self->date_renewed( dt_from_string() );
752
    $self->store();
752
    $self->store();
753
753
754
    $self->add_enrolment_fee_if_needed;
754
    $self->add_enrolment_fee_if_needed(1);
755
755
756
    logaction( "MEMBERS", "RENEW", $self->borrowernumber, "Membership renewed" ) if C4::Context->preference("BorrowersLog");
756
    logaction( "MEMBERS", "RENEW", $self->borrowernumber, "Membership renewed" ) if C4::Context->preference("BorrowersLog");
757
    return dt_from_string( $expiry_date )->truncate( to => 'day' );
757
    return dt_from_string( $expiry_date )->truncate( to => 'day' );
Lines 875-897 sub article_requests_finished { Link Here
875
875
876
=head3 add_enrolment_fee_if_needed
876
=head3 add_enrolment_fee_if_needed
877
877
878
my $enrolment_fee = $patron->add_enrolment_fee_if_needed;
878
my $enrolment_fee = $patron->add_enrolment_fee_if_needed($renewal);
879
879
880
Add enrolment fee for a patron if needed.
880
Add enrolment fee for a patron if needed.
881
881
882
$renewal - boolean denoting whether this is an account renewal or not
883
882
=cut
884
=cut
883
885
884
sub add_enrolment_fee_if_needed {
886
sub add_enrolment_fee_if_needed {
885
    my ($self) = @_;
887
    my ($self, $renewal) = @_;
886
    my $enrolment_fee = $self->category->enrolmentfee;
888
    my $enrolment_fee = $self->category->enrolmentfee;
887
    if ( $enrolment_fee && $enrolment_fee > 0 ) {
889
    if ( $enrolment_fee && $enrolment_fee > 0 ) {
890
        my $type = $renewal ? 'account_renew' : 'account';
888
        $self->account->add_debit(
891
        $self->account->add_debit(
889
            {
892
            {
890
                amount     => $enrolment_fee,
893
                amount     => $enrolment_fee,
891
                user_id    => C4::Context->userenv ? C4::Context->userenv->{'number'} : undef,
894
                user_id    => C4::Context->userenv ? C4::Context->userenv->{'number'} : undef,
892
                interface  => C4::Context->interface,
895
                interface  => C4::Context->interface,
893
                library_id => C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef,
896
                library_id => C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef,
894
                type       => 'account'
897
                type       => $type
895
            }
898
            }
896
        );
899
        );
897
    }
900
    }
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc (-1 / +2 lines)
Lines 3-9 Link Here
3
        [%- CASE 'Pay'              -%]<span>Payment
3
        [%- CASE 'Pay'              -%]<span>Payment
4
        [%- CASE 'N'                -%]<span>New card
4
        [%- CASE 'N'                -%]<span>New card
5
        [%- CASE 'OVERDUE'          -%]<span>Fine
5
        [%- CASE 'OVERDUE'          -%]<span>Fine
6
        [%- CASE 'A'                -%]<span>Account management fee
6
        [%- CASE 'ACCOUNT'          -%]<span>Account creation fee
7
        [%- CASE 'ACCOUNT_RENEW'    -%]<span>Account renewal fee
7
        [%- CASE 'M'                -%]<span>Sundry
8
        [%- CASE 'M'                -%]<span>Sundry
8
        [%- CASE 'LOST'             -%]<span>Lost item
9
        [%- CASE 'LOST'             -%]<span>Lost item
9
        [%- CASE 'W'                -%]<span>Writeoff
10
        [%- 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 162-168 Link Here
162
        [%- CASE 'VOID'             -%]<span>Voided
162
        [%- CASE 'VOID'             -%]<span>Voided
163
        [%- CASE 'N'                -%]<span>New card
163
        [%- CASE 'N'                -%]<span>New card
164
        [%- CASE 'OVERDUE'          -%]<span>Fine
164
        [%- CASE 'OVERDUE'          -%]<span>Fine
165
        [%- CASE 'A'                -%]<span>Account management fee
165
        [%- CASE 'ACCOUNT'          -%]<span>Account creation fee
166
        [%- CASE 'ACCOUNT_RENEW'    -%]<span>Account renewal fee
166
        [%- CASE 'M'                -%]<span>Sundry
167
        [%- CASE 'M'                -%]<span>Sundry
167
        [%- CASE 'LOST'             -%]<span>Lost item
168
        [%- CASE 'LOST'             -%]<span>Lost item
168
        [%- CASE 'W'                -%]<span>Writeoff
169
        [%- CASE 'W'                -%]<span>Writeoff
169
- 

Return to bug 6759