From: Owen Leonard <[email protected]>

When a fine is paid off the modification of the original
account line containing the fine gets its amount zeroed out
and a line is added saying "Payment,thanks." Both these
transactions happen at virtually the same time, so they
cannot be ordered one after the other based on the
timestamp.

This patch adds a one second delay bewteen the two steps,
and outputs the timestamp rather than the date of each
transaction so that it is unambiguous when each one
happened.

NOTE: This fix will only fix the sorting of future
transactions.

Signed-off-by: Nicole C. Engard <[email protected]>
---
 C4/Accounts.pm                                     |    1 +
 .../prog/en/modules/members/boraccount.tt          |    2 +-
 2 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/C4/Accounts.pm b/C4/Accounts.pm
index 2352e9e..b8b09a7 100644
--- a/C4/Accounts.pm
+++ b/C4/Accounts.pm
@@ -205,6 +205,7 @@ sub makepayment {
                     INTO accountlines (borrowernumber, accountno, date, 
amount, description, accounttype, amountoutstanding)
                     VALUES ( ?, ?, now(), ?, 'Payment,thanks', 'Pay', 0)"
             );
+        sleep 1;
         $ins->execute($borrowernumber, $nextaccntno, $payment);
         $ins->finish;
     }
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt 
b/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt
index c5941fd..9e46844 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt
@@ -43,7 +43,7 @@
   [% FOREACH account IN accounts %]
 
    [% IF ( loop.odd ) %]<tr>[% ELSE %]<tr class="highlight">[% END %]
-      <td>[% account.date %]</td>
+      <td>[% account.timestamp %]</td>
       <td>[% account.description %]&nbsp;[% IF ( account.itemnumber ) %]<a 
href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% 
account.biblionumber %]&amp;itemnumber=[% account.itemnumber %]">View 
item</a>&nbsp;[% END %][% account.title |html %]</td>
       <td>[% account.note %]</td>
       [% IF ( account.amountcredit ) %]<td class="credit">[% ELSE %]<td 
class="debit">[% END %][% account.amount %]</td>
-- 
1.7.2.3

_______________________________________________
Koha-patches mailing list
[email protected]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-patches
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to