Bug 2601 - Order fines by date and time
Summary: Order fines by date and time
Status: RESOLVED DUPLICATE of bug 16486
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Kyle M Hall
QA Contact: Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-11 11:01 UTC by Nicole C. Engard
Modified: 2019-03-14 23:46 UTC (History)
8 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
fines (33.01 KB, image/png)
2008-09-11 11:01 UTC, Chris Cormack
Details
Proposed fix (2.33 KB, patch)
2011-10-13 19:52 UTC, Owen Leonard
Details | Diff | Splinter Review
[SIGNED-OFF] Fix for Bug 2601 - Order fines by date and time (2.37 KB, patch)
2011-10-14 13:27 UTC, Nicole C. Engard
Details | Diff | Splinter Review
fines out of order (121.31 KB, image/jpeg)
2013-04-01 18:53 UTC, Nicole C. Engard
Details

Note You need to log in before you can comment on or make changes to this bug.
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 ***