use C4::Form::MessagingPreferences;
use List::MoreUtils qw/uniq/;
use C4::Members::Attributes qw(GetBorrowerAttributes);
+use Koha::Account::Lines;
use Koha::AuthorisedValues;
use Koha::CsvProfiles;
use Koha::Patron::Debarments qw(GetDebarments);
}
$data->{$_} = dt_from_string( $userdate );
}
-$data->{'IS_ADULT'} = ( $data->{'categorycode'} ne 'I' );
for (qw(gonenoaddress lost borrowernotes)) {
$data->{$_} and $template->param(flagged => 1) and last;
$data->{ "sex_".$data->{'sex'}."_p" } = 1 if defined $data->{sex};
-if ( $category_type eq 'C') {
+if ( $patron->is_child ) {
my $patron_categories = Koha::Patron::Categories->search_limited({ category_type => 'A' }, {order_by => ['categorycode']});
$template->param( 'CATCODE_MULTI' => 1) if $patron_categories->count > 1;
$template->param( 'catcode' => $patron_categories->next->categorycode ) if $patron_categories->count == 1;
Koha::Database->new()->schema()->resultset('Issue')
->count( { borrowernumber => \@relatives } );
-$template->param( adultborrower => 1 ) if ( $category_type eq 'A' || $category_type eq 'I' );
-
my %bor;
$bor{'borrowernumber'} = $borrowernumber;
my $library = Koha::Libraries->find( $data->{branchcode})->unblessed;
@{$data}{keys %$library} = values %$library; # merge in all branch columns # FIXME This is really ugly, we should pass the library instead
-my ( $total, $accts, $numaccts) = GetMemberAccountRecords( $borrowernumber );
-
# If printing a page, send the account informations to the template
-if ($print eq "page") {
- foreach my $accountline (@$accts) {
- $accountline->{amount} = sprintf '%.2f', $accountline->{amount};
- $accountline->{amountoutstanding} = sprintf '%.2f', $accountline->{amountoutstanding};
-
- if ($accountline->{accounttype} ne 'F' && $accountline->{accounttype} ne 'FU'){
- $accountline->{printtitle} = 1;
- }
- }
+if (defined $print and $print eq "page") {
+ my $accts = Koha::Account::Lines->search(
+ { borrowernumber => $patron->borrowernumber, amountoutstanding => { '>' => 0 } },
+ { order_by => { -desc => 'accountlines_id' } }
+ );
$template->param( accounts => $accts );
}
}
);
+if( $patron_messages->count > 0 ){
+ $template->param( patron_messages => $patron_messages );
+}
# Display the language description instead of the code
# Note that this is certainly wrong
my ( $subtag, $region ) = split '-', $patron->lang;
my $translated_language = C4::Languages::language_get_description( $subtag, $subtag, 'language' );
+my $total = $patron->account->balance;
$template->param(
patron => $patron,
translated_language => $translated_language,
totaldue_raw => $total,
overdues_exist => $overdues_exist,
StaffMember => $category_type eq 'S',
- is_child => $category_type eq 'C',
$category_type => 1, # [% IF ( I ) %] = institutional/organisation
samebranch => $samebranch,
quickslip => $quickslip,
PatronsPerPage => C4::Context->preference("PatronsPerPage") || 20,
relatives_issues_count => $relatives_issues_count,
relatives_borrowernumbers => \@relatives,
- patron_messages => $patron_messages,
);
output_html_with_http_headers $input, $cookie, $template->output;