From 28eb6db0d1718d356d9e99c77c5519774496f607 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Wed, 16 Mar 2016 18:00:20 +0000 Subject: [PATCH] Bug 14577 [QA Followup] Signed-off-by: Jonathan Druart Signed-off-by: Kyle M Hall --- C4/Circulation.pm | 6 +++--- C4/Members.pm | 2 +- .../prog/en/modules/circ/circulation.tt | 3 ++- .../circ/circulation_batch_checkouts.tt | 11 ++++++++++- t/db_dependent/Patron.t | 19 +------------------ 5 files changed, 17 insertions(+), 24 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 811cc98a99..fc003bea6f 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -863,11 +863,11 @@ sub CanBookBeIssued { } if ( $guarantees_non_issues_charges > $no_issues_charge_guarantees && !$inprocess && !$allowfineoverride) { - $issuingimpossible{DEBT_GUARANTEES} = sprintf( "%.2f", $guarantees_non_issues_charges ); + $issuingimpossible{DEBT_GUARANTEES} = $guarantees_non_issues_charges; } elsif ( $guarantees_non_issues_charges > $no_issues_charge_guarantees && !$inprocess && $allowfineoverride) { - $needsconfirmation{DEBT_GUARANTEES} = sprintf( "%.2f", $guarantees_non_issues_charges ); + $needsconfirmation{DEBT_GUARANTEES} = $guarantees_non_issues_charges; } elsif ( $allfinesneedoverride && $guarantees_non_issues_charges > 0 && $guarantees_non_issues_charges <= $no_issues_charge_guarantees && !$inprocess ) { - $needsconfirmation{DEBT_GUARANTEES} = sprintf( "%.2f", $guarantees_non_issues_charges ); + $needsconfirmation{DEBT_GUARANTEES} = $guarantees_non_issues_charges; } } diff --git a/C4/Members.pm b/C4/Members.pm index a3e1377014..7ad7689b7f 100644 --- a/C4/Members.pm +++ b/C4/Members.pm @@ -343,7 +343,7 @@ sub patronflags { if ( $guarantees_non_issues_charges > $no_issues_charge_guarantees ) { my %flaginfo; $flaginfo{'message'} = sprintf 'patron guarantees owe %.02f', $guarantees_non_issues_charges; - $flaginfo{'amount'} = sprintf "%.02f", $guarantees_non_issues_charges; + $flaginfo{'amount'} = $guarantees_non_issues_charges; $flaginfo{'noissues'} = 1 unless C4::Context->preference("allowfineoverride"); $flags{'CHARGES_GUARANTEES'} = \%flaginfo; } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt index bfedf5c8a9..4eaff32aba 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -3,6 +3,7 @@ [% USE KohaDates %] [% USE ColumnsSettings %] [% USE ItemTypes %] +[% USE Price %] [% IF Koha.Preference('ExportRemoveFields') OR Koha.Preference('ExportWithCsvProfile') %] [% SET exports_enabled = 1 %] [% END %] @@ -236,7 +237,7 @@ $(document).ready(function() { [% END %] [% IF ( DEBT_GUARANTEES ) %] -
  • The patron's guarantees collectively have a debt of [% DEBT_GUARANTEES %].
  • +
  • The patron's guarantees collectively have a debt of [% DEBT_GUARANTEES | $Price %].
  • [% END %] [% IF ( RENTALCHARGE && RENTALCHARGE > 0 ) %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation_batch_checkouts.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation_batch_checkouts.tt index eadeb1d8f1..1cbe06d1d0 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation_batch_checkouts.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation_batch_checkouts.tt @@ -1,5 +1,6 @@ [% USE Branches %] [% USE KohaDates %] +[% USE Price %] [% IF ( export_remove_fields OR export_with_csv_profile ) %] [% SET exports_enabled = 1 %] [% END %] @@ -66,7 +67,15 @@ $(document).ready(function() {
    Cannot check out! [% IF charges_is_blocker %] - Checkouts are BLOCKED because fine balance is OVER THE LIMIT. + Checkouts are BLOCKED because fine balance is OVER THE LIMIT. + [% END %] + [% IF charges_guarantees_is_blocker %] +
  • + Fees & Charges: Patron's guarantees collectively owe [% chargesamount_guarantees | $Price %]. +
  • +
  • + Checkouts are BLOCKED because fine balance is OVER THE LIMIT. +
  • [% END %]
    [% ELSIF borrower and not checkout_infos %] diff --git a/t/db_dependent/Patron.t b/t/db_dependent/Patron.t index 01400131cc..11c57fed13 100755 --- a/t/db_dependent/Patron.t +++ b/t/db_dependent/Patron.t @@ -17,7 +17,7 @@ use Modern::Perl; -use Test::More tests => 15; +use Test::More tests => 13; use Test::Warn; use C4::Context; @@ -44,23 +44,6 @@ $object->surname("Test Surname"); $object->store(); is( $object->in_storage, 1, "Object is now stored" ); -my $guarantee1 = Koha::Patron->new( - { - categorycode => $categorycode, - branchcode => $branchcode, - guarantorid => $object->id - } -)->store(); -my $guarantee2 = Koha::Patron->new( - { - categorycode => $categorycode, - branchcode => $branchcode, - guarantorid => $object->id - } -)->store(); -my @guarantees = $object->guarantees(); -is( $guarantees[0]->id, $guarantee1->id, "First guarantee matchs" ); -is( $guarantees[1]->id, $guarantee2->id, "Second guarantee matchs" ); my $borrowernumber = $object->borrowernumber; -- 2.39.5