|
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-734
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 @fines; |
| 716 |
#to individual debit types to give more flexability and specificity. |
714 |
my $dbh=C4::Context->dbh; |
| 717 |
my @not_fines; |
715 |
my $sth = $dbh->prepare("SELECT code FROM account_debit_types WHERE no_issues_charge = 1"); |
| 718 |
push @not_fines, 'RESERVE' |
716 |
$sth->execute; |
| 719 |
unless C4::Context->preference('HoldsInNoissuesCharge'); |
717 |
while (my $code = $sth->fetchrow_array) { |
| 720 |
push @not_fines, ( 'RENT', 'RENT_DAILY', 'RENT_RENEW', 'RENT_DAILY_RENEW' ) |
718 |
push @fines, $code; |
| 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 |
} |
719 |
} |
| 726 |
|
720 |
|
| 727 |
return $self->lines->search( |
721 |
return $self->lines->search( |
| 728 |
{ |
722 |
{ |
| 729 |
debit_type_code => { -not_in => \@not_fines } |
723 |
debit_type_code => { -in => \@fines } |
| 730 |
}, |
724 |
}, |
| 731 |
)->total_outstanding; |
725 |
)->total_outstanding; |
|
|
726 |
|
| 732 |
} |
727 |
} |
| 733 |
|
728 |
|
| 734 |
=head3 lines |
729 |
=head3 lines |