Add the ability to do inventory by collection code as well.
I think that this should actually be fairly straightforward. I should have a patch for this tomorrow...
Created attachment 40209 [details] [review] Bug 14393 - Add collection code filter to inventory This patch adds the ability to do inventory by collection. _TEST PLAN_ Before applying: 1) Go to "Tools > Inventory/stocktaking" 2) Note that there is no "Collection code:" option Optionally: 2b) You can create a Barcode file with a single barcode 2c) Don't select anything from "Select items you want to check" (or filter if you know how to filter to make it faster... doesn't matter) 2d) Click "Submit" at the bottom of the screen 2e) Note that there is no "Collection code" column in the screen output or CSV output (ie with/without the "Export to CSV file" box ticked before submitting) Apply the patch. After applying: 3) Note that there is a "Collection code" filter on the main inventory screen 4) Create a Barcode file with a single barcode for an item with a collection and upload it using the "Choose file" button. 5) Select that item's collection code from the "Collection code" filter 6) Click "Submit" 7) Note that the screen output and the CSV output contains a "Collection code" column (ie with/without the "Export to CSV file" box ticked before submitting)
Created attachment 40255 [details] [review] [Signed-off] Bug 14393 - Add collection code filter to inventory This patch adds the ability to do inventory by collection. _TEST PLAN_ Before applying: 1) Go to "Tools > Inventory/stocktaking" 2) Note that there is no "Collection code:" option Optionally: 2b) You can create a Barcode file with a single barcode 2c) Don't select anything from "Select items you want to check" (or filter if you know how to filter to make it faster... doesn't matter) 2d) Click "Submit" at the bottom of the screen 2e) Note that there is no "Collection code" column in the screen output or CSV output (ie with/without the "Export to CSV file" box ticked before submitting) Apply the patch. After applying: 3) Note that there is a "Collection code" filter on the main inventory screen 4) Create a Barcode file with a single barcode for an item with a collection and upload it using the "Choose file" button. 5) Select that item's collection code from the "Collection code" filter 6) Click "Submit" 7) Note that the screen output and the CSV output contains a "Collection code" column (ie with/without the "Export to CSV file" box ticked before submitting) Followed test plan. Works as expected. Signed-off-by: Marc Véron <veron@veron.ch>
David, In my dev installation, items.ccode is not mapped. Which makes the dropdown list populated with all my authorized values :) You certainly need to care about the value of AdvancedSearchTypes, you will have to propose item type too. Marked as Failed QA.
(In reply to Jonathan Druart from comment #4) > David, > > In my dev installation, items.ccode is not mapped. > Which makes the dropdown list populated with all my authorized values :) > You certainly need to care about the value of AdvancedSearchTypes, you will > have to propose item type too. > > Marked as Failed QA. I'm not sure what you mean by "You certainly need to care about the value of AdvancedSearchTypes, you will have to propose item type too". Could you clarify? I'll look into the problem with the mapping in the meantime though :)
(In reply to David Cook from comment #5) > (In reply to Jonathan Druart from comment #4) > > David, > > > > In my dev installation, items.ccode is not mapped. > > Which makes the dropdown list populated with all my authorized values :) > > You certainly need to care about the value of AdvancedSearchTypes, you will > > have to propose item type too. > > > > Marked as Failed QA. > > I'm not sure what you mean by "You certainly need to care about the value of > AdvancedSearchTypes, you will have to propose item type too". Could you > clarify? Some libraries don't use this ccode value, it's the case in my installation. I this case, the dropdown list is wrongly populated with all authorized values!
(In reply to Jonathan Druart from comment #6) > Some libraries don't use this ccode value, it's the case in my installation. > I this case, the dropdown list is wrongly populated with all authorized > values! Cool beans. I'll look into it :)
Created attachment 40958 [details] [review] Bug 14393 - Add collection code filter to inventory This patch adds the ability to do inventory by collection. _TEST PLAN_ Before applying: 1) Go to "Tools > Inventory/stocktaking" 2) Note that there is no "Collection code:" option Optionally: 2b) You can create a Barcode file with a single barcode 2c) Don't select anything from "Select items you want to check" (or filter if you know how to filter to make it faster... doesn't matter) 2d) Click "Submit" at the bottom of the screen 2e) Note that there is no "Collection code" column in the screen output or CSV output (ie with/without the "Export to CSV file" box ticked before submitting) Apply the patch. After applying: 3) Note that there is a "Collection code" filter on the main inventory screen 4) Create a Barcode file with a single barcode for an item with a collection and upload it using the "Choose file" button. 5) Select that item's collection code from the "Collection code" filter 6) Click "Submit" 7) Note that the screen output and the CSV output contains a "Collection code" column (ie with/without the "Export to CSV file" box ticked before submitting)
(In reply to Jonathan Druart from comment #6) > Some libraries don't use this ccode value, it's the case in my installation. > I this case, the dropdown list is wrongly populated with all authorized > values! Could you give that a look? That should be a lot better now... thanks for looking at this bug!
> Could you give that a look? That should be a lot better now... thanks for > looking at this bug! Comment 6 is solved. When items.ccode isn't linked to a populated AV list, the collection code selection list isn't displayed in Inventory. I see that in the inventory result table, there is a new columun 'Collection code' which is displayed even when there isn't CCODE AV. Do you think there is a way to display or not this column?
Created attachment 44772 [details] [review] Bug 14393 - Add collection code filter to inventory This patch adds the ability to do inventory by collection. _TEST PLAN_ Before applying: 1) Go to "Tools > Inventory/stocktaking" 2) Note that there is no "Collection code:" option Optionally: 2b) You can create a Barcode file with a single barcode 2c) Don't select anything from "Select items you want to check" (or filter if you know how to filter to make it faster... doesn't matter) 2d) Click "Submit" at the bottom of the screen 2e) Note that there is no "Collection code" column in the screen output or CSV output (ie with/without the "Export to CSV file" box ticked before submitting) Apply the patch. After applying: 3) Note that there is a "Collection code" filter on the main inventory screen 4) Create a Barcode file with a single barcode for an item with a collection and upload it using the "Choose file" button. 5) Select that item's collection code from the "Collection code" filter 6) Click "Submit" 7) Note that the screen output and the CSV output contains a "Collection code" column (ie with/without the "Export to CSV file" box ticked before submitting) Note: Collection code isn't displayed on Inventory filter & result if ccode isn't used in items. Signed-off-by: Frederic Demians <f.demians@tamil.fr>
(In reply to Frédéric Demians from comment #10) > I see that in the inventory result table, there is a new columun 'Collection > code' which is displayed even when there isn't CCODE AV. Do you think there > is a way to display or not this column? Forget this. I've added a [% IF %] in your patch that I've signed off in order to not display this column when unnecessary.
Comment on attachment 44772 [details] [review] Bug 14393 - Add collection code filter to inventory Review of attachment 44772 [details] [review]: ----------------------------------------------------------------- ::: tools/inventory.pl @@ +95,5 @@ > } > push @authorised_value_list,@$data; > } > + > + my $collection_authorised_value = C4::Koha::GetAuthValCode("items.ccode", $fwkcode); Does it really necessary to check all frameworks? Isn't be enough to get the default one?
(In reply to Frédéric Demians from comment #12) > Forget this. I've added a [% IF %] in your patch that I've signed off in > order to not display this column when unnecessary. Cheers, Frédéric :)
Comment on attachment 44772 [details] [review] Bug 14393 - Add collection code filter to inventory Review of attachment 44772 [details] [review]: ----------------------------------------------------------------- ::: tools/inventory.pl @@ +95,5 @@ > } > push @authorised_value_list,@$data; > } > + > + my $collection_authorised_value = C4::Koha::GetAuthValCode("items.ccode", $fwkcode); In practice, it might be enough to get the default one, but in theory you could use different authorized value categories than "CCODE" for "item.ccode" depending on the framework of the biblio to which an item is attached. Originally, I just used the default framework, but then realized that it wasn't necessarily comprehensive enough. In practice, I don't know if anyone would map multiple categories to "item.ccode", but it is theoretically possible. You might only allow certain collections for a certain framework. Framework A might use "CCODE" which refers to textual collections while Framework B might use "CCODE2"which refers to audiovisual collections. That would probably be madness, but it's possible madness.
^ that last comment was for Jonathan. Perhaps I should've just replied to the comment rather than on the splinter review...
You are right, it's theoretically possible... but in my opinoin not recommendable. Think about features like item batch editing or any search form/report that offers you a list of collections. It will cause lots of inconvenience if someone does that. I think we don't need to cover this possibility.
(In reply to Katrin Fischer from comment #17) > You are right, it's theoretically possible... but in my opinoin not > recommendable. Think about features like item batch editing or any search > form/report that offers you a list of collections. It will cause lots of > inconvenience if someone does that. I think we don't need to cover this > possibility. Ok. I'm fine with that. I was mostly just following the pattern that already existed in the script. Other things than collection code do this same check. Should a follow-up remove this "all framework checking" for all criteria?
(In reply to David Cook from comment #18) > (In reply to Katrin Fischer from comment #17) > > You are right, it's theoretically possible... but in my opinoin not > > recommendable. Think about features like item batch editing or any search > > form/report that offers you a list of collections. It will cause lots of > > inconvenience if someone does that. I think we don't need to cover this > > possibility. > > Ok. I'm fine with that. I was mostly just following the pattern that already > existed in the script. Other things than collection code do this same check. > Should a follow-up remove this "all framework checking" for all criteria? I would prefer to keep it, to avoid undesired side-effects.
(In reply to Jonathan Druart from comment #19) > I would prefer to keep it, to avoid undesired side-effects. That also seems reasonable. I'm happy to go with whatever QA decides in the end.
Merging seems to fail because of HTML filters and whatnot, pretty expected from a 2015 patch.
(In reply to Charles Farmer from comment #21) > Merging seems to fail because of HTML filters and whatnot, pretty expected > from a 2015 patch. Thanks for checking, Charles. Looks like the patch is 9474 commits behind master. Let me try rebasing it. Not a trivial rebase at a glance. Will have to look at this more some other time.
I think I've recently ported this to 19.11, so I'll have another look at this soon.
David- Glad to hear this is still moving forward! We have a library interested in this feature. Let us know how we can help with testing/signoffs/QA etc! Thanks joy (In reply to David Cook from comment #23) > I think I've recently ported this to 19.11, so I'll have another look at > this soon.
Hello, what a beautiful idea for a patch! As a librarian, it would make my inventory experience a thousand times better. I am willing to learn whatever coding and conventions necessary, and make friends with every developer on this site, in order to learn how to implement this. It's my first post and first bug and I am cheering you all on.
Created attachment 131025 [details] [review] Bug 14393 - Add collection code filter to inventory This patch adds the ability to do inventory by collection. _TEST PLAN_ Before applying: 1) Go to "Tools > Inventory/stocktaking" 2) Note that there is no "Collection code:" option Optionally: 2b) You can create a Barcode file with a single barcode 2c) Don't select anything from "Select items you want to check" (or filter if you know how to filter to make it faster... doesn't matter) 2d) Click "Submit" at the bottom of the screen 2e) Note that there is no "Collection code" column in the screen output or CSV output (ie with/without the "Export to CSV file" box ticked before submitting) Apply the patch. After applying: 3) Note that there is a "Collection code" filter on the main inventory screen 4) Create a Barcode file with a single barcode for an item with a collection and upload it using the "Choose file" button. 5) Select that item's collection code from the "Collection code" filter 6) Click "Submit" 7) Note that the screen output and the CSV output contains a "Collection code" column (ie with/without the "Export to CSV file" box ticked before submitting)
Created attachment 131627 [details] [review] Bug 14393 - Add collection code filter to inventory This patch adds the ability to do inventory by collection. _TEST PLAN_ Before applying: 1) Go to "Tools > Inventory/stocktaking" 2) Note that there is no "Collection code:" option Optionally: 2b) You can create a Barcode file with a single barcode 2c) Don't select anything from "Select items you want to check" (or filter if you know how to filter to make it faster... doesn't matter) 2d) Click "Submit" at the bottom of the screen 2e) Note that there is no "Collection code" column in the screen output or CSV output (ie with/without the "Export to CSV file" box ticked before submitting) Apply the patch. After applying: 3) Note that there is a "Collection code" filter on the main inventory screen 4) Create a Barcode file with a single barcode for an item with a collection and upload it using the "Choose file" button. 5) Select that item's collection code from the "Collection code" filter 6) Click "Submit" 7) Note that the screen output and the CSV output contains a "Collection code" column (ie with/without the "Export to CSV file" box ticked before submitting) Signed-off-by: Jessica <jzairo@bywatersolutions.com>
Created attachment 131628 [details] [review] Bug 14393 - Add collection code filter to inventory This patch adds the ability to do inventory by collection. _TEST PLAN_ Before applying: 1) Go to "Tools > Inventory/stocktaking" 2) Note that there is no "Collection code:" option Optionally: 2b) You can create a Barcode file with a single barcode 2c) Don't select anything from "Select items you want to check" (or filter if you know how to filter to make it faster... doesn't matter) 2d) Click "Submit" at the bottom of the screen 2e) Note that there is no "Collection code" column in the screen output or CSV output (ie with/without the "Export to CSV file" box ticked before submitting) Apply the patch. After applying: 3) Note that there is a "Collection code" filter on the main inventory screen 4) Create a Barcode file with a single barcode for an item with a collection and upload it using the "Choose file" button. 5) Select that item's collection code from the "Collection code" filter 6) Click "Submit" 7) Note that the screen output and the CSV output contains a "Collection code" column (ie with/without the "Export to CSV file" box ticked before submitting) Signed-off-by: kelly mcelligott <kpmcelligott@gmail.com>
Created attachment 132791 [details] [review] Bug 14393: Add collection code filter to inventory This patch adds the ability to do inventory by collection. _TEST PLAN_ Before applying: 1) Go to "Tools > Inventory/stocktaking" 2) Note that there is no "Collection code:" option Optionally: 2b) You can create a Barcode file with a single barcode 2c) Don't select anything from "Select items you want to check" (or filter if you know how to filter to make it faster... doesn't matter) 2d) Click "Submit" at the bottom of the screen 2e) Note that there is no "Collection code" column in the screen output or CSV output (ie with/without the "Export to CSV file" box ticked before submitting) Apply the patch. After applying: 3) Note that there is a "Collection code" filter on the main inventory screen 4) Create a Barcode file with a single barcode for an item with a collection and upload it using the "Choose file" button. 5) Select that item's collection code from the "Collection code" filter 6) Click "Submit" 7) Note that the screen output and the CSV output contains a "Collection code" column (ie with/without the "Export to CSV file" box ticked before submitting) Signed-off-by: kelly mcelligott <kpmcelligott@gmail.com>
Created attachment 132792 [details] [review] Bug 14393: (QA follow-up) Add template filters Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
There is actually no unit test for other filters so its OK. We should work on more tests for inventory, and move code from pl to a module.
Pushed to master for 22.05, thanks to everybody involved [U+1F984]