Bugzilla – Attachment 7782 Details for
Bug 7420
Add max fines to circulation matrix
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
follow-up patch
0001-bug_7420-code-reindent-and-comment.patch (text/plain), 2.20 KB, created by
Srdjan Jankovic
on 2012-02-21 04:13:57 UTC
(
hide
)
Description:
follow-up patch
Filename:
MIME Type:
Creator:
Srdjan Jankovic
Created:
2012-02-21 04:13:57 UTC
Size:
2.20 KB
patch
obsolete
>From 99a053551c94e6fbb2c4c8ae875165e67e45807f Mon Sep 17 00:00:00 2001 >From: Srdjan Jankovic <srdjan@catalyst.net.nz> >Date: Tue, 21 Feb 2012 17:10:26 +1300 >Subject: [PATCH] bug_7420: code reindent and comment > >--- > C4/Overdues.pm | 34 +++++++++++++++++++--------------- > 1 files changed, 19 insertions(+), 15 deletions(-) > >diff --git a/C4/Overdues.pm b/C4/Overdues.pm >index 03192c0..0f7914c 100644 >--- a/C4/Overdues.pm >+++ b/C4/Overdues.pm >@@ -515,25 +515,29 @@ sub UpdateFine { > my $data; > my $total_amount_other = 0.00; > my $due_qr = qr/$due/; >+ # Cycle through the fines and >+ # - find line that relates to the requested $itemnum >+ # - accumulate fines for other items >+ # so we can update $itemnum fine taking in account fine caps > while (my $rec = $sth->fetchrow_hashref) { >- if ($rec->{itemnumber} == $itemnum && $rec->{description} =~ /$due_qr/) { >- if ($data) { >- warn "Not a unique accountlines record for item $itemnum borrower $borrowernumber"; >- } else { >- $data = $rec; >- next; >+ if ($rec->{itemnumber} == $itemnum && $rec->{description} =~ /$due_qr/) { >+ if ($data) { >+ warn "Not a unique accountlines record for item $itemnum borrower $borrowernumber"; >+ } else { >+ $data = $rec; >+ next; >+ } > } >- } >- $total_amount_other += $rec->{'amount'}; >+ $total_amount_other += $rec->{'amount'}; > } > if (my $maxfine = C4::Context->preference('MaxFine')) { >- if ($total_amount_other + $amount > $maxfine) { >- my $new_amount = $maxfine - $total_amount_other; >- warn "Reducing fine for item $itemnum borrower $borrowernumber from $amount to $new_amount - MaxFine reached"; >- return if $new_amount <= 0.00; >- >- $amount = $new_amount; >- } >+ if ($total_amount_other + $amount > $maxfine) { >+ my $new_amount = $maxfine - $total_amount_other; >+ warn "Reducing fine for item $itemnum borrower $borrowernumber from $amount to $new_amount - MaxFine reached"; >+ return if $new_amount <= 0.00; >+ >+ $amount = $new_amount; >+ } > } > > if ( $data ) { >-- >1.6.5 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 7420
:
7106
|
7287
|
7487
|
7489
|
7491
|
7782
|
8327
|
8748
|
8749
|
9469
|
9853
|
10772
|
11083