Bug 15076

Summary: Remove file misc/maintenance/fix_accountlines_date.pl
Product: Koha Reporter: Marc Véron <veron>
Component: Architecture, internals, and plumbingAssignee: Galen Charlton <gmcharlt>
Status: CLOSED WONTFIX QA Contact: Testopia <testopia>
Severity: trivial    
Priority: P5 - low CC: jonathan.druart, jweaver, katrin.fischer, kyle
Version: Main   
Hardware: All   
OS: All   
See Also: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14870
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13104
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12188
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15310
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15312
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Bug 15076: Remove file misc/maintenance/fix_accountlines_date.pl

Description Marc Véron 2015-10-29 07:54:34 UTC
The file misc/maintenance/fix_accountlines_date.pl seems to be a file used for an update, could it be obsolete?

If yes, it can be removed.

See discussion on Bug 14998
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14998#c5
Comment 1 Katrin Fischer 2015-10-29 08:18:39 UTC
I am not sure about removing it - it might still be useful for people updating from really old versions or something like that. Can we find out more about the context of when this was added?
Comment 2 Jonathan Druart 2015-11-11 08:22:48 UTC
commit bf4a39d7ce3d7618d6afe1cec6cc5d5b55885abe
Author: Jesse Weaver <jesse.weaver@liblime.com>
Date:   Mon Jul 14 12:15:14 2008 -0500
    new script to fix date code in accountlines
Comment 3 Kyle M Hall 2015-11-18 11:27:58 UTC
I'd be inclined to remove it at this point.
Comment 4 Marc Véron 2015-11-18 13:12:49 UTC
Created attachment 44955 [details] [review]
Bug 15076: Remove file misc/maintenance/fix_accountlines_date.pl

This patch removes the file misc/maintenance/fix_accountlines_date.pl

To test:
- Verify that the file is removed.
Comment 5 Marc Véron 2015-11-18 13:17:33 UTC
Independently on removal, the file does no longer block 14870, moved from "Blocks" to "See also"
Comment 6 Galen Charlton 2015-12-01 13:53:44 UTC
Because overdue fines include title and original due date in the description, and because UpdateFine matches on the due date in the description when finding an existing account line to update... this script would still be a useful thing to run if ever a library decides to change the dateformat system preference.

Of course, changing the dateformat is not a common decision.

My vote: keep this script until such time as Koha no longer relies on matching dates in the description to find accountlines to update when adjusting an overdue fine.
Comment 7 Marc Véron 2015-12-01 14:22:53 UTC
(In reply to Galen Charlton from comment #6)
> Because overdue fines include title and original due date in the
> description, and because UpdateFine matches on the due date in the
> description when finding an existing account line to update... this script
> would still be a useful thing to run if ever a library decides to change the
> dateformat system preference.
> 
> Of course, changing the dateformat is not a common decision.
> 
> My vote: keep this script until such time as Koha no longer relies on
> matching dates in the description to find accountlines to update when
> adjusting an overdue fine.

Hi Galen,

So I think we would have to make this bug dependent of a bug that resolves the issue. Is there a bug about the issue regarding matching dates? 

I only found:

Bug 13104 - Changing date or time format on a production server will create duplicate fines! 
(It adds the note about duplicate fines to the syspref 'dateformat')

Bug 12188 - fines duplicated after changing dateformat
(Resolved - duplicate of 13104)

I tried to find out where in the code the duplication happens, but I had no success. Any hint is welcome.
Comment 8 Katrin Fischer 2015-12-02 23:15:01 UTC
I think it happens when the system has to decide wether to update an existing fine or to add a new fine. Take a look at the UpdateFines routine:

http://git.koha-community.org/gitweb/?p=koha.git;a=blob;f=C4/Overdues.pm;hb=3dfb6252faf6abec64cfc50a090aa0ce7d272115#l537

I think this isn't easy to fix/change right now.
Comment 9 Katrin Fischer 2015-12-02 23:16:48 UTC
(In reply to Marc Véron from comment #7)
> (In reply to Galen Charlton from comment #6)

> > Of course, changing the dateformat is not a common decision.

We just introduced a new dateformat (DD.MM.YYYY), so I think some switching will happen soon, at least for installations in some areas :)