---- 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.
Created attachment 5881 [details] [review] Proposed fix 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.
Created attachment 5889 [details] [review] [SIGNED-OFF] Fix for Bug 2601 - Order fines by date and time 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 <nengard@bywatersolutions.com>
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.
Accountlines primary key was added by Bug 7671. Is this bug still valid? Marc
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.
(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.
How can this be Failed QA if the patch is obsoleted?
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
*** This bug has been marked as a duplicate of bug 16486 ***