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

(-)a/Koha/Account.pm (-16 / +4 lines)
Lines 28-33 use C4::Letters; Link Here
28
use C4::Log qw( logaction );
28
use C4::Log qw( logaction );
29
use C4::Stats qw( UpdateStats );
29
use C4::Stats qw( UpdateStats );
30
use C4::Overdues qw(GetFine);
30
use C4::Overdues qw(GetFine);
31
use C4::Context;
31
32
32
use Koha::Patrons;
33
use Koha::Patrons;
33
use Koha::Account::Lines;
34
use Koha::Account::Lines;
Lines 702-732 my $non_issues_charges = $self->non_issues_charges Link Here
702
703
703
Calculates amount immediately owing by the patron - non-issue charges.
704
Calculates amount immediately owing by the patron - non-issue charges.
704
705
705
Charges exempt from non-issue are:
706
Charges can be set as exempt from non-issue by editing the debit type in the Debit Types area of System Preferences.
706
* Res (holds) if HoldsInNoissuesCharge syspref is set to false
707
* Rent (rental) if RentalsInNoissuesCharge syspref is set to false
708
* Manual invoices if ManInvInNoissuesCharge syspref is set to false
709
707
710
=cut
708
=cut
711
709
712
sub non_issues_charges {
710
sub non_issues_charges {
713
    my ($self) = @_;
711
    my ($self) = @_;
714
712
715
    #NOTE: With bug 23049 these preferences could be moved to being attached
713
    my @blocking_debit_types = Koha::Account::DebitTypes->search({ restricts_checkouts => 1 }, { columns => 'code' })->get_column('code');
716
    #to individual debit types to give more flexability and specificity.
717
    my @not_fines;
718
    push @not_fines, 'RESERVE'
719
      unless C4::Context->preference('HoldsInNoissuesCharge');
720
    push @not_fines, ( 'RENT', 'RENT_DAILY', 'RENT_RENEW', 'RENT_DAILY_RENEW' )
721
      unless C4::Context->preference('RentalsInNoissuesCharge');
722
    unless ( C4::Context->preference('ManInvInNoissuesCharge') ) {
723
        my @man_inv = Koha::Account::DebitTypes->search({ is_system => 0 })->get_column('code');
724
        push @not_fines, @man_inv;
725
    }
726
714
727
    return $self->lines->search(
715
    return $self->lines->search(
728
        {
716
        {
729
            debit_type_code => { -not_in => \@not_fines }
717
            debit_type_code => { -in => \@blocking_debit_types }
730
        },
718
        },
731
    )->total_outstanding;
719
    )->total_outstanding;
732
}
720
}
(-)a/admin/debit_types.pl (+2 lines)
Lines 77-82 elsif ( $op eq 'add_validate' ) { Link Here
77
    my $can_be_invoiced = $input->param('can_be_invoiced') || 0;
77
    my $can_be_invoiced = $input->param('can_be_invoiced') || 0;
78
    my $can_be_sold = $input->param('can_be_sold') || 0;
78
    my $can_be_sold = $input->param('can_be_sold') || 0;
79
    my $default_amount        = $input->param('default_amount') || undef;
79
    my $default_amount        = $input->param('default_amount') || undef;
80
    my $restricts_checkouts = $input->param('restricts_checkouts') || 0;
80
    my @branches = grep { $_ ne q{} } $input->multi_param('branches');
81
    my @branches = grep { $_ ne q{} } $input->multi_param('branches');
81
82
82
    if ( not defined $debit_type ) {
83
    if ( not defined $debit_type ) {
Lines 86-91 elsif ( $op eq 'add_validate' ) { Link Here
86
    $debit_type->can_be_invoiced($can_be_invoiced);
87
    $debit_type->can_be_invoiced($can_be_invoiced);
87
    $debit_type->can_be_sold($can_be_sold);
88
    $debit_type->can_be_sold($can_be_sold);
88
    $debit_type->default_amount($default_amount);
89
    $debit_type->default_amount($default_amount);
90
    $debit_type->restricts_checkouts($restricts_checkouts);
89
91
90
    try {
92
    try {
91
        $debit_type->store;
93
        $debit_type->store;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/debit_types.tt (-2 / +17 lines)
Lines 122-127 Link Here
122
                                        <input type="checkbox" name="can_be_sold" id="can_be_sold" value="1" />
122
                                        <input type="checkbox" name="can_be_sold" id="can_be_sold" value="1" />
123
                                    [% END %]
123
                                    [% END %]
124
                                </li>
124
                                </li>
125
                                <li>
126
                                    <label for="restricts_checkouts">Included in noissuescharge? </label>
127
                                    [% IF debit_type.restricts_checkouts %]
128
                                        <input type="checkbox" name="restricts_checkouts" id="restricts_checkouts" checked="checked" value="1" />
129
                                    [% ELSE %]
130
                                        <input type="checkbox" name="restricts_checkouts" id="restricts_checkouts" value="1" />
131
                                    [% END %]
132
                                </li>
125
                                <li>
133
                                <li>
126
                                    <label for="branches">Libraries limitation: </label>
134
                                    <label for="branches">Libraries limitation: </label>
127
                                    <select id="branches" name="branches" multiple size="10">
135
                                    <select id="branches" name="branches" multiple size="10">
Lines 163-168 Link Here
163
                                    <th>Default amount</th>
171
                                    <th>Default amount</th>
164
                                    <th>Available for</th>
172
                                    <th>Available for</th>
165
                                    <th>Library limitations</th>
173
                                    <th>Library limitations</th>
174
                                    <th>No issues charge</th>
166
                                    <th class="noExport">Actions</th>
175
                                    <th class="noExport">Actions</th>
167
                                </thead>
176
                                </thead>
168
                                <tbody>
177
                                <tbody>
Lines 201-208 Link Here
201
                                                <span>No limitation</span>
210
                                                <span>No limitation</span>
202
                                            [% END %]
211
                                            [% END %]
203
                                        </td>
212
                                        </td>
213
                                        <td>
214
                                            [% IF debit_type.restricts_checkouts %]
215
                                                <span>Included</span>
216
                                            [% ELSE %]
217
                                                <span>Not Included</span>
218
                                            [% END %]
219
                                        </td>
204
                                        <td class="actions">
220
                                        <td class="actions">
205
                                            [% IF !debit_type.is_system && !debit_type.archived %]
221
                                            [% IF !debit_type.archived %]
206
                                            <a class="btn btn-default btn-xs" href="/cgi-bin/koha/admin/debit_types.pl?op=add_form&amp;code=[% debit_type.code | uri %]&type=debit"><i class="fa fa-pencil"></i> Edit</a>
222
                                            <a class="btn btn-default btn-xs" href="/cgi-bin/koha/admin/debit_types.pl?op=add_form&amp;code=[% debit_type.code | uri %]&type=debit"><i class="fa fa-pencil"></i> Edit</a>
207
                                            <a class="btn btn-default btn-xs" href="/cgi-bin/koha/admin/debit_types.pl?op=archive&amp;code=[% debit_type.code | uri %]"><i class="fa fa-archive"></i> Archive</a>
223
                                            <a class="btn btn-default btn-xs" href="/cgi-bin/koha/admin/debit_types.pl?op=archive&amp;code=[% debit_type.code | uri %]"><i class="fa fa-archive"></i> Archive</a>
208
                                            [% ELSIF debit_type.archived %]
224
                                            [% ELSIF debit_type.archived %]
209
- 

Return to bug 32450