Bug 11867: (follow-up) Change the sql query in order to win beauty prices
[koha_fer] / opac / sco / sco-main.pl
index f857b6a..14f74b5 100755 (executable)
@@ -111,6 +111,10 @@ if (C4::Context->preference('SelfCheckoutByLogin') && !$patronid) {
 }
 my $borrower = GetMemberDetails(undef,$patronid);
 
+my $currencySymbol = "";
+if ( defined C4::Budgets->GetCurrency() ) {
+    $currencySymbol = C4::Budgets->GetCurrency()->{symbol};
+}
 
 my $branch = $issuer->{branchcode};
 my $confirm_required = 0;
@@ -154,7 +158,7 @@ elsif ( $op eq "checkout" ) {
             hide_main                 => 1,
         );
         if ($issue_error eq 'DEBT') {
-            $template->param(amount => C4::Budgets->GetCurrency()->{symbol}.$impossible->{DEBT});
+            $template->param(amount => $currencySymbol.$impossible->{DEBT});
         }
         #warn "issue_error: " . $issue_error ;
         if ( $issue_error eq "NO_MORE_RENEWALS" ) {
@@ -187,7 +191,7 @@ elsif ( $op eq "checkout" ) {
             hide_main                 => 1,
         );
         if ($issue_error eq 'DEBT') {
-            $template->param(amount => C4::Budgets->GetCurrency()->{symbol}.$needconfirm->{DEBT});
+            $template->param(amount => $currencySymbol.$needconfirm->{DEBT});
         }
     } else {
         if ( $confirmed || $issuenoconfirm ) {    # we'll want to call getpatroninfo again to get updated issues.
@@ -245,10 +249,10 @@ if ($borrower->{cardnumber}) {
     $template->param(
         inputfocus => $inputfocus,
         nofines => 1,
-        "dateformat_" . C4::Context->preference('dateformat') => 1,
+
     );
     if (C4::Context->preference('ShowPatronImageInWebBasedSelfCheck')) {
-        my ($image, $dberror) = GetPatronImage($borrower->{cardnumber});
+        my ($image, $dberror) = GetPatronImage($borrower->{borrowernumber});
         if ($image) {
             $template->param(
                 display_patron_image => 1,
@@ -263,4 +267,9 @@ if ($borrower->{cardnumber}) {
     );
 }
 
-output_html_with_http_headers $query, $cookie, $template->output;
+$template->param(
+    SCOUserJS  => C4::Context->preference('SCOUserJS'),
+    SCOUserCSS => C4::Context->preference('SCOUserCSS'),
+);
+
+output_html_with_http_headers $query, $cookie, $template->output, undef, { force_no_caching => 1 };