diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt index 317a8d3683..68bbacf433 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt @@ -251,87 +251,108 @@
-
- [% IF ( issues_count ) %] - - - - - - - - - - - [% UNLESS ( nofines ) %] - - [% END %] - - - - [% FOREACH ISSUE IN ISSUES %] - - - - - [% IF ( ISSUE.overdue ) %] - - [% ELSE %] - - [% END %] - + + + [% FOREACH ISSUE IN ISSUES %] + + + + + [% IF ( ISSUE.overdue ) %] + + [% ELSE %] + + [% END %] + + [% UNLESS ( nofines ) %] + + [% END %] + + [% END # / FOREACH ISSUE %] + +
Checkouts for [% borrowername | html %] ([% issues_count | html %] total)
Checked out onTitleCall no.DueRenewFines
[% ISSUE.issuedate | html %] - [% UNLESS ( noitemlinks ) %] - [% ISSUE.title | html %] - [% ELSE %] - [% ISSUE.title | html %] - [% END %] - [% IF ( newissues.match(ISSUE.barcode)) %] - NEW - [% END %] - [% ISSUE.author | html %] - ([% ISSUE.barcode | html %]) - [% ISSUE.itemcallnumber | html %][% ISSUE.date_due | $KohaDates as_due_date => 1 %][% ISSUE.date_due | $KohaDates as_due_date => 1 %] -
- - - - [% IF ISSUE.can_be_renewed %] - - - [% UNLESS ( ISSUE.renew ) %] - - [% ELSE %] - - [% END %] - [% ELSE %] - [% IF ISSUE.renew_error == 'auto_renew' OR ISSUE.renew_error == 'auto_too_soon' %] - This item has been scheduled for automatic renewal and cannot be renewed - [% ELSIF ISSUE.renew_error == 'onsite_checkout' %] - This is a on-site checkout, it cannot be renewed. - [% ELSE %] - No renewals allowed - [% END %] - [% IF Koha.Preference('AllowSelfCheckReturns') %] - - - - [% END %] +
+ +
+
+
+ [% IF ( issues_count ) %] + + + + + + + + + + + [% UNLESS ( nofines ) %] + [% END %] - - - [% UNLESS ( nofines ) %] - - [% END %] - - [% END # / FOREACH ISSUE %] - -
Checkouts for [% borrowername | html %] ([% issues_count | html %] total)
Checked out onTitleCall no.DueRenewFines - [% IF ( ISSUE.charges ) %]Yes[% ELSE %]No[% END %] -
- [% ELSE %] -

You currently have nothing checked out.

- [% END # / IF issues_count %] -
+
[% ISSUE.issuedate | html %] + [% UNLESS ( noitemlinks ) %] + [% ISSUE.title | html %] + [% ELSE %] + [% ISSUE.title | html %] + [% END %] + [% IF ( newissues.match(ISSUE.barcode)) %] + NEW + [% END %] + [% ISSUE.author | html %] + ([% ISSUE.barcode | html %]) + [% ISSUE.itemcallnumber | html %][% ISSUE.date_due | $KohaDates as_due_date => 1 %][% ISSUE.date_due | $KohaDates as_due_date => 1 %] +
+ + + + [% IF ISSUE.can_be_renewed %] + + + [% UNLESS ( ISSUE.renew ) %] + + [% ELSE %] + + [% END %] + [% ELSE %] + [% IF ISSUE.renew_error == 'auto_renew' OR ISSUE.renew_error == 'auto_too_soon' %] + This item has been scheduled for automatic renewal and cannot be renewed + [% ELSIF ISSUE.renew_error == 'onsite_checkout' %] + This is a on-site checkout, it cannot be renewed. + [% ELSE %] + No renewals allowed + [% END %] + [% IF Koha.Preference('AllowSelfCheckReturns') %] + + + + [% END %] + [% END %] +
+
+ [% IF ( ISSUE.charges ) %]Yes[% ELSE %]No[% END %] +
+ [% ELSE %] +

You currently have nothing checked out.

+ [% END # / IF issues_count %] +
+
+
+ [% IF HOLDS.count > 0 %] + [% PROCESS 'holds-table.inc' HOLDS = HOLDS, SuspendHoldsOpac = SuspendHoldsOpac, showpriority = showpriority, AutoResumeSuspendedHolds = AutoResumeSuspendedHolds, onlyinfo = 'true' %] + [% ELSE %] +

You currently have no pending holds.

+ [% END %] +
+
+ [% PROCESS 'account-table.inc' %] +
+
+
[% ELSE # IF validuser %]
diff --git a/opac/sco/sco-main.pl b/opac/sco/sco-main.pl index 9ec86422c0..458e52e57c 100755 --- a/opac/sco/sco-main.pl +++ b/opac/sco/sco-main.pl @@ -272,17 +272,52 @@ if ($borrower) { push @checkouts, $checkout; } + my $show_priority; + for ( C4::Context->preference("OPACShowHoldQueueDetails") ) { + m/priority/ and $show_priority = 1; + } + + my $patron = Koha::Patrons->find( $borrower->{borrowernumber} ); + my $total = $patron->account->balance; + my $accts = Koha::Account::Lines->search( + { borrowernumber => $borrower->{borrowernumber} }, + { order_by => { -desc => 'accountlines_id' } } + ); + + my @accountlines; + while ( my $line = $accts->next ) { + my $accountline = $line->unblessed; + $accountline->{'amount'} = sprintf( "%.2f", $accountline->{'amount'} || '0.00'); + if ( $accountline->{'amount'} >= 0 ) { + $accountline->{'amountcredit'} = 1; + } + $accountline->{'amountoutstanding'} = + sprintf( "%.2f", $accountline->{'amountoutstanding'} || '0.00' ); + if ( $accountline->{'amountoutstanding'} >= 0 ) { + $accountline->{'amountoutstandingcredit'} = 1; + } + push @accountlines, $accountline; + } + + my $holds = $patron->holds; + $template->param( validuser => 1, borrowername => $borrowername, issues_count => scalar(@checkouts), ISSUES => \@checkouts, + HOLDS => $holds, newissues => join(',',@newissueslist), patronid => $patronid, patronlogin => $patronlogin, patronpw => $patronpw, noitemlinks => 1 , borrowernumber => $borrower->{'borrowernumber'}, + SuspendHoldsOpac => C4::Context->preference('SuspendHoldsOpac'), + AutoResumeSuspendedHolds => C4::Context->preference('AutoResumeSuspendedHolds'), + showpriority => $show_priority, + ACCOUNT_LINES => \@accountlines, + total => sprintf( "%.2f", $total ), ); my $patron_messages = Koha::Patron::Messages->search(