Bug 15408 - Timestamp on funds not updated when you duplicate a budget
Summary: Timestamp on funds not updated when you duplicate a budget
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Acquisitions (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor (vote)
Assignee: Baptiste
QA Contact: Testopia
URL:
Keywords:
Depends on: 19826
Blocks:
  Show dependency treegraph
 
Reported: 2015-12-22 14:57 UTC by Sophie MEYNIEUX
Modified: 2019-10-14 19:57 UTC (History)
9 users (show)

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


Attachments
Bug 15408 : deleted the timestamp so that the database gives a new one (897 bytes, patch)
2017-02-03 15:20 UTC, Baptiste
Details | Diff | Splinter Review
Bug 15408 : deleted the timestamp so that the database gives a new one (919 bytes, patch)
2017-02-03 15:23 UTC, Baptiste
Details | Diff | Splinter Review
Bug 15408 : deleted the timestamp so that the database gives a new one (972 bytes, patch)
2017-02-03 16:44 UTC, Mark Tompsett
Details | Diff | Splinter Review
Added unit tests to patch (1.61 KB, patch)
2017-02-07 09:54 UTC, Baptiste
Details | Diff | Splinter Review
Modified to run properly the QA tests (1.57 KB, patch)
2017-02-15 08:46 UTC, Baptiste
Details | Diff | Splinter Review
Bug 15408 : deleted the timestamp so that the database gives a new one (919 bytes, patch)
2017-02-16 13:26 UTC, Baptiste
Details | Diff | Splinter Review
Added unit tests to patch (1.61 KB, patch)
2017-02-16 13:26 UTC, Baptiste
Details | Diff | Splinter Review
Modified to run properly the QA tests (1.57 KB, patch)
2017-02-16 13:26 UTC, Baptiste
Details | Diff | Splinter Review
[SIGNED OFF] Bug 15408 : deleted the timestamp so that the database gives a new one (990 bytes, patch)
2017-05-02 19:36 UTC, Katrin Fischer
Details | Diff | Splinter Review
[SIGNED OFF] Added unit tests to patch (1.68 KB, patch)
2017-05-02 19:36 UTC, Katrin Fischer
Details | Diff | Splinter Review
[SIGNED OFF] Modified to run properly the QA tests (1.64 KB, patch)
2017-05-02 19:36 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 15408 : deleted the timestamp so that the database gives a new one (1.01 KB, patch)
2017-07-21 13:11 UTC, Nick Clemens
Details | Diff | Splinter Review
Added unit tests to patch (1.72 KB, patch)
2017-07-21 13:11 UTC, Nick Clemens
Details | Diff | Splinter Review
Modified to run properly the QA tests (1.68 KB, patch)
2017-07-21 13:11 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 15408 : deleted the timestamp so that the database gives a new one (1.01 KB, patch)
2018-08-07 13:47 UTC, Nick Clemens
Details | Diff | Splinter Review
Added unit tests to patch (1.71 KB, patch)
2018-08-07 13:47 UTC, Nick Clemens
Details | Diff | Splinter Review
Modified to run properly the QA tests (1.68 KB, patch)
2018-08-07 13:47 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 15408: Fix tests to fail without patch (1.91 KB, patch)
2018-08-07 13:47 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 15408: Remove timestamp when cloning a fund (2.65 KB, patch)
2018-08-07 19:09 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 15408: Fix tests to fail without patch (1.99 KB, patch)
2018-08-07 19:09 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 15408: Remove fund's timestamp when cloning a budget (2.66 KB, patch)
2018-08-07 19:10 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 15408: Fix tests to fail without patch (1.99 KB, patch)
2018-08-07 19:10 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Sophie MEYNIEUX 2015-12-22 14:57:45 UTC
When you duplicate a budget from an existing one, the timestamp is copied from the existing budget rather than set to the time of creation.
Comment 1 Baptiste 2017-02-03 15:20:11 UTC
Created attachment 59886 [details] [review]
Bug 15408 : deleted the timestamp so that the database gives a new one

To duplicate the budget, the function CloneBudgetHierarchy create a new budget
from the old without the parameter timestamp, so that the database generates a
new one.
Comment 2 Baptiste 2017-02-03 15:23:23 UTC
Created attachment 59887 [details] [review]
Bug 15408 : deleted the timestamp so that the database gives a new one

To duplicate the budget, the function CloneBudgetHierarchy create a new budget
from the old without the parameter timestamp, so that the database generates a
new one.
Comment 3 Mark Tompsett 2017-02-03 16:44:05 UTC
Created attachment 59890 [details] [review]
Bug 15408 : deleted the timestamp so that the database gives a new one

To duplicate the budget, the function CloneBudgetHierarchy create a new budget
from the old without the parameter timestamp, so that the database generates a
new one.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Comment 4 Baptiste 2017-02-07 09:54:44 UTC
Created attachment 59974 [details] [review]
Added unit tests to patch
Comment 5 Jonathan Druart 2017-02-14 09:12:29 UTC
Hi Baptiste,
You must run the QA scripts on your patches before submitting them: https://wiki.koha-community.org/wiki/QA_Test_Tools

Regarding first patch:
- Indentation is 4 spaces, not tabs.

Second patch:
- It contains debug statements (warn)
- is (and other Test::More subroutines) must be called with the description of the test.
Comment 6 Baptiste 2017-02-15 08:46:54 UTC
Created attachment 60244 [details] [review]
Modified to run properly the QA tests
Comment 7 Baptiste 2017-02-16 13:26:12 UTC
Created attachment 60337 [details] [review]
Bug 15408 : deleted the timestamp so that the database gives a new one

To duplicate the budget, the function CloneBudgetHierarchy create a new budget
from the old without the parameter timestamp, so that the database generates a
new one.
Comment 8 Baptiste 2017-02-16 13:26:21 UTC
Created attachment 60338 [details] [review]
Added unit tests to patch
Comment 9 Baptiste 2017-02-16 13:26:29 UTC
Created attachment 60339 [details] [review]
Modified to run properly the QA tests
Comment 10 Aleisha Amohia 2017-03-30 02:49:49 UTC
All tests pass but a new timestamp is still not being generated. Setting to Failed QA.
Comment 11 Baptiste 2017-03-30 08:14:04 UTC
Hi,
Working on mine, did you follow a testplan like this one ? And I'm surprized about all tests being fine, because the test about budget is supposed to be false : checkout all file except test 

1 - go on mysql "select * from aqbudgets \G"
2 - duplicate a budget
3 - "select * from aqbudgets \G" => new budgets should have the same timestamp as the others
4 - apply patch
5 - "select * from aqbudgets \G" => new budget have new timestamp

Errors I think you can have done testing my patch:
- look at aqbudgetperiods
- look at the date of creation or enddate and not timestamp
Comment 12 Katrin Fischer 2017-05-02 19:36:40 UTC
Created attachment 62985 [details] [review]
[SIGNED OFF] Bug 15408 : deleted the timestamp so that the database gives a new one

To duplicate the budget, the function CloneBudgetHierarchy create a new budget
from the old without the parameter timestamp, so that the database generates a
new one.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 13 Katrin Fischer 2017-05-02 19:36:44 UTC
Created attachment 62986 [details] [review]
[SIGNED OFF] Added unit tests to patch

https://bugs.koha-community.org/show_bug.cgi?id=15408

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 14 Katrin Fischer 2017-05-02 19:36:47 UTC
Created attachment 62987 [details] [review]
[SIGNED OFF] Modified to run properly the QA tests

https://bugs.koha-community.org/show_bug.cgi?id=15408

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 15 Nick Clemens 2017-07-21 13:11:11 UTC
Created attachment 65181 [details] [review]
Bug 15408 : deleted the timestamp so that the database gives a new one

To duplicate the budget, the function CloneBudgetHierarchy create a new budget
from the old without the parameter timestamp, so that the database generates a
new one.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 16 Nick Clemens 2017-07-21 13:11:14 UTC
Created attachment 65182 [details] [review]
Added unit tests to patch

https://bugs.koha-community.org/show_bug.cgi?id=15408

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 17 Nick Clemens 2017-07-21 13:11:18 UTC
Created attachment 65183 [details] [review]
Modified to run properly the QA tests

https://bugs.koha-community.org/show_bug.cgi?id=15408

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 18 Jonathan Druart 2017-07-24 18:01:25 UTC
Tests pass without the delete statement.
Comment 19 Victor Grousset/tuxayo 2018-02-08 13:37:12 UTC
Baptiste doesn't work anymore at BibLibre.
Unassigning to avoid signaling that this bug is still being supervized. Which could wrongly discourage someone to continue the work.
Comment 20 Nick Clemens 2018-08-07 13:47:02 UTC
Created attachment 77524 [details] [review]
Bug 15408 : deleted the timestamp so that the database gives a new one

To duplicate the budget, the function CloneBudgetHierarchy create a new budget
from the old without the parameter timestamp, so that the database generates a
new one.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 21 Nick Clemens 2018-08-07 13:47:07 UTC
Created attachment 77525 [details] [review]
Added unit tests to patch

https://bugs.koha-community.org/show_bug.cgi?id=15408

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 22 Nick Clemens 2018-08-07 13:47:11 UTC
Created attachment 77526 [details] [review]
Modified to run properly the QA tests

https://bugs.koha-community.org/show_bug.cgi?id=15408

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 23 Nick Clemens 2018-08-07 13:47:15 UTC
Created attachment 77527 [details] [review]
Bug 15408: Fix tests to fail without patch

We set all the timestamps to a specified date and ensure the new budgets
don't have this date
Comment 24 Jonathan Druart 2018-08-07 19:09:09 UTC
Created attachment 77539 [details] [review]
Bug 15408: Remove timestamp when cloning a fund

To duplicate the budget, the function CloneBudgetHierarchy create a new budget
from the old without the parameter timestamp, so that the database generates a
new one.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Added unit tests to patch

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Modified to run properly the QA tests

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 25 Jonathan Druart 2018-08-07 19:09:14 UTC
Created attachment 77540 [details] [review]
Bug 15408: Fix tests to fail without patch

We set all the timestamps to a specified date and ensure the new budgets
don't have this date

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 26 Jonathan Druart 2018-08-07 19:10:12 UTC
Created attachment 77541 [details] [review]
Bug 15408: Remove fund's timestamp when cloning a budget

To duplicate the budget, the function CloneBudgetHierarchy create a new budget
from the old without the parameter timestamp, so that the database generates a
new one.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Added unit tests to patch

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Modified to run properly the QA tests

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 27 Jonathan Druart 2018-08-07 19:10:16 UTC
Created attachment 77542 [details] [review]
Bug 15408: Fix tests to fail without patch

We set all the timestamps to a specified date and ensure the new budgets
don't have this date

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 28 Jonathan Druart 2018-08-07 19:11:00 UTC
I have squashed the first patches to clean the history (warn, indentation and commit messages).
Comment 29 Nick Clemens 2018-08-22 14:59:14 UTC
Awesome work all!

Pushed to master for 18.11
Comment 30 Martin Renvoize 2018-08-24 12:10:22 UTC
Pushed to 18.05.x for 18.05.03
Comment 31 Fridolin Somers 2018-09-21 13:57:45 UTC
Depends on Bug 19826 not in 17.11.x