Bug 17672

Summary: Items table should have a damaged_on column
Product: Koha Reporter: Nick Clemens <nick>
Component: Architecture, internals, and plumbingAssignee: Nick Clemens <nick>
Status: Signed Off --- QA Contact: Tomás Cohen Arazi <tomascohen>
Severity: enhancement    
Priority: P5 - low CC: charles.farmer, tomascohen
Version: master   
Hardware: All   
OS: All   
Whiteboard:
Change sponsored?: Sponsored Patch complexity: Small patch
Bot Control: --- When did the bot last check this:
Who signed the patch off: Text to go in the release notes:
Attachments: Bug 17672 - Items table should have a damaged_on column
Bug 17672 - Schema updates
[SIGNED-OFF] Bug 17672 - Items table should have a damaged_on column
[SIGNED-OFF] Bug 17672 - Schema updates
Bug 17672 - Items table should have a damaged_on column
Bug 17672 - Schema updates
Bug 17672 - Dumping Items.t expected tests from 12 to 13

Description Nick Clemens 2016-11-23 14:31:26 UTC
Mirroring the itemlost_on column it would be nice to have the ability to see when an item was marked damaged so libraries can track repairs and mending.
Comment 1 Nick Clemens 2017-07-19 13:15:58 UTC
Created attachment 65099 [details] [review]
Bug 17672 - Items table should have a damaged_on column

This patchset adds a 'damaged_on' column to store the date an item is
marked damaged, analogous to withdrawn_on and itemlost_on

To test:
1 - Apply patch
2 - Mark an item damaged via moredetail.pl (Items tab on left in
        details)
3 - Note the damaged on date apears below
4 - Unmark the item, the date is removed
5 - Go to the edit items screen (from top bar 'Edit->edit items')
6 - Mark item damaged - check db or moredetails.pl to see damaged_on
date
7 - Unmark item damaged - confirm date is removed
8 - prove t/db_dependent/Items.t
Comment 2 Nick Clemens 2017-07-19 13:16:01 UTC
Created attachment 65100 [details] [review]
Bug 17672 - Schema updates
Comment 3 Owen Leonard 2017-08-01 12:46:12 UTC
I haven't seen how withdrawn_on and itemlost_on behave, but I would think it could be useful to store the date the status was changed no matter what it changed to. Why not store the date if you're setting it to 0?
Comment 4 Nick Clemens 2017-08-07 12:21:16 UTC
(In reply to Owen Leonard from comment #3)
> I haven't seen how withdrawn_on and itemlost_on behave, but I would think it
> could be useful to store the date the status was changed no matter what it
> changed to. Why not store the date if you're setting it to 0?

I think this would be a change in behaviour - currently these or more like the onloan column - info if the criteria is met, blank otherwise. Changing this would impact reports etc. 

I do think it would be a good change, but should be on a new bug
Comment 5 Owen Leonard 2017-08-07 13:42:23 UTC
Created attachment 65551 [details] [review]
[SIGNED-OFF] Bug 17672 - Items table should have a damaged_on column

This patchset adds a 'damaged_on' column to store the date an item is
marked damaged, analogous to withdrawn_on and itemlost_on

To test:
1 - Apply patch
2 - Mark an item damaged via moredetail.pl (Items tab on left in
        details)
3 - Note the damaged on date apears below
4 - Unmark the item, the date is removed
5 - Go to the edit items screen (from top bar 'Edit->edit items')
6 - Mark item damaged - check db or moredetails.pl to see damaged_on
date
7 - Unmark item damaged - confirm date is removed
8 - prove t/db_dependent/Items.t

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 6 Owen Leonard 2017-08-07 13:42:25 UTC
Created attachment 65552 [details] [review]
[SIGNED-OFF] Bug 17672 - Schema updates

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 7 Charles Farmer 2017-11-03 20:17:15 UTC
Since we see the date at which the item was damaged on the moredetail.pl, should we also see this information in the header table of the additem.pl page along the status? Just pitching the idea out there.

Everything worked fine, though I had to bump up the number of tests from 12 to 13 in order to make it work on the current master.
Comment 8 Charles Farmer 2017-11-03 20:25:15 UTC
Created attachment 68937 [details] [review]
Bug 17672 - Items table should have a damaged_on column

This patchset adds a 'damaged_on' column to store the date an item is
marked damaged, analogous to withdrawn_on and itemlost_on

To test:
1 - Apply patch
2 - Mark an item damaged via moredetail.pl (Items tab on left in
        details)
3 - Note the damaged on date apears below
4 - Unmark the item, the date is removed
5 - Go to the edit items screen (from top bar 'Edit->edit items')
6 - Mark item damaged - check db or moredetails.pl to see damaged_on
date
7 - Unmark item damaged - confirm date is removed
8 - prove t/db_dependent/Items.t

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Charles Farmer <charles.farmer@inLibro.com>
Comment 9 Charles Farmer 2017-11-03 20:25:30 UTC
Created attachment 68938 [details] [review]
Bug 17672 - Schema updates

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Charles Farmer <charles.farmer@inLibro.com>
Comment 10 Charles Farmer 2017-11-03 20:25:36 UTC
Created attachment 68939 [details] [review]
Bug 17672 - Dumping Items.t expected tests from 12 to 13