Bug 2601

Summary: Order fines by date and time
Product: Koha Reporter: Nicole C. Engard <nengard>
Component: CirculationAssignee: Kyle M Hall <kyle.m.hall>
Status: RESOLVED DUPLICATE QA Contact: Bugs List <koha-bugs>
Severity: enhancement    
Priority: P5 - low CC: aleisha, helpdesk, katrin.fischer, koha.sekjal, marjorie.barry-vila, mtompset, oleonard, veron
Version: master   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: fines
Proposed fix
[SIGNED-OFF] Fix for Bug 2601 - Order fines by date and time
fines out of order

Description Chris Cormack 2010-05-21 00:53:20 UTC


---- Reported by nengard@gmail.com 2008-09-11 11:01:39 ----

When handling fines can they be ordered by date and time?  right now it's only by date - but the fine is appearing before the payment on the same day.

See attachment where the payment appears before the fine.



---- Additional Comments From nengard@gmail.com 2008-09-11 11:01:58 ----

Created an attachment
fines





---- Additional Comments From nengard@gmail.com 2009-09-06 12:56:01 ----

I looked at the db and it looks like the date and the time are stored, so this should just be a matter of changing the way the data is pulled out of the table.  


--------------+
| borrowernumber | accountno | itemnumber | date       | amount    | description                        | dispute | accounttype | amountoutstanding | lastincrement | timestamp           | notify_id | notify_level |
+----------------+-----------+------------+------------+-----------+------------------------------------+---------+-------------+-------------------+---------------+---------------------+-----------+--------------+
|             51 |         1 |       NULL | 2009-09-05 |  5.000000 | account fee Account Management fee | NULL    | A           |          0.000000 |          NULL | 2009-09-05 01:55:38 |         1 |            0 | 
|             51 |         2 |       NULL | 2009-09-05 | -2.000000 | partial paid                       | NULL    | C           |         -2.000000 |          NULL | 2009-09-05 01:55:00 |         0 |            0 | 
|             51 |         3 |       NULL | 2009-09-05 | -5.000000 | Payment,thanks -                   | NULL    | Pay         |          0.000000 |          NULL | 2009-09-05 01:55:38 |         0 |            0 | 
|             51 |         4 |       NULL | 2009-09-05 |  4.000000 |  Lost Item                         | NULL    | L           |          0.000000 |          NULL | 2009-09-05 01:56:03 |         1 |            0 | 
|             51 |         5 |       NULL | 2009-09-05 |  4.000000 | Writeoff                           | NULL    | W           |              NULL |          NULL | 2009-09-05 01:56:03 |         0 |            0 | 
+----------------+-----------+------------+------------+-----------+------------------------------------+---------+-------------+-------------------+---------------+---------------------+-----------+--------------+



--- Bug imported by chris@bigballofwax.co.nz 2010-05-21 00:53 UTC  ---

This bug was previously known as _bug_ 2601 at http://bugs.koha.org/cgi-bin/bugzilla3/show_bug.cgi?id=2601
Imported an attachment (id=757)

Actual time not defined. Setting to 0.0
CC member bchurch@ptfs.com does not have an account here
The original submitter of attachment 757 [details] is unknown.
   Reassigning to the person who moved it here: chris@bigballofwax.co.nz.

Comment 1 Owen Leonard 2011-10-13 19:52:25 UTC Comment hidden (obsolete)
Comment 2 Nicole C. Engard 2011-10-14 13:27:55 UTC Comment hidden (obsolete)
Comment 3 Ian Walls 2011-10-19 17:06:43 UTC
I disagree with adding a 1 second performance delay to fines payment just to improve sorting.  C4::Accounts needs to be rewritten, anyway, and the addition of an accountlines primary key could resolve this in a more efficient manner.

I'm going to mark this as Failed QA, but I recognize this is only my opinion on the matter.  I'm open to debate on the subject, and will relent if the community feels this kind of performance hit is justifiable.
Comment 4 Marc VĂ©ron 2012-09-22 19:07:01 UTC
Accountlines primary key was added by Bug 7671.

Is this bug still valid?

Marc
Comment 5 Nicole C. Engard 2013-04-01 18:53:05 UTC
Created attachment 17109 [details]
fines out of order

Things are still sorted strangely - it's not the order in which the actions took place.  I numbered them in purple to show what order I entered them in.
Comment 6 Sven Coenye 2014-06-24 19:53:45 UTC
(In reply to Nicole C. Engard from comment #5)
> Created attachment 17109 [details]
> fines out of order
> 
> Things are still sorted strangely - it's not the order in which the actions
> took place.  I numbered them in purple to show what order I entered them in.

I realize I'm a bit late to this (and new to KOHA), but the accountno field in the accountlines table monotonically increases per patron/borrower for each transaction injected into the table. It can be used to sort the transactions in proper order without much of a performance hit.

If this was not the proper avenue to post this, please point me in the right direction.
Comment 7 Mark Tompsett 2015-10-19 14:22:26 UTC
How can this be Failed QA if the patch is obsoleted?
Comment 8 Aleisha Amohia 2018-01-16 23:17:15 UTC
I think this would be fixed by the patch from Bug 16486, which adds the timestamp as a column to fines tables, so it could be sorted on
Comment 9 Katrin Fischer 2019-03-14 23:46:44 UTC

*** This bug has been marked as a duplicate of bug 16486 ***