Bug 20131: Inventory optional filters correct "For loan" addition
authorFridolin Somers <fridolin.somers@biblibre.com>
Fri, 2 Feb 2018 13:34:34 +0000 (14:34 +0100)
committerFridolin Somers <fridolin.somers@biblibre.com>
Wed, 17 Oct 2018 12:34:19 +0000 (14:34 +0200)
commit5febaef09f56059875a7bb4b0518903e41333d3a
tree9b276359f86651504263712f4a9ecd9142824ada
parent2755a664707b2111589aa0726f56eb7bb14a2fde
Bug 20131: Inventory optional filters correct "For loan" addition

In inventory, optional filters are build from authorize values categories used for items.notforloan, items.itemlost, items.withdrawn and items.damaged.

The bug is that description of value 0 is always "For loan".
This seems to be only for "notforloan".

Second bug is that if a description exists for "notforloan" value 0, it is not used.

This patch corrects by adding "For loan" only for "notforloan" authorized values and if there is no 0 value.
It changes the description added by code from "ignore" to a more unlikly user defined "__IGNORE__".

Test plan:
1) Make sure you have authorized values defined on items.notforloan, say "NFL" category, with at least a value and description but no 0 value
2) Make sure you have authorized values defined on items.itemlost, say "LOST" category, with 0 = "Not lost" and 1 = "Lost"
3) Go to inventory /cgi-bin/koha/tools/inventory.pl
4) Without patch you see "For loan" on both items.notforloan and items.itemlost
5) With patch you see "For loan" only in items.notforloan, you see for items.itemlost : "Not lost" and "Lost"
6) Create in authorized values category "NFL" a value 0 with description "Available"
7) Go to inventory /cgi-bin/koha/tools/inventory.pl
8) Without patch you see "For loan" in items.notforloan for value 0
9) With patch you see "Available" in items.notforloan for value 0

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 8d9284668c6de2d5fbfc4079a8b0516ba1645876)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit a9aa1bd1e43a871a813de1e2e97005567afa589c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt
tools/inventory.pl