Bug 33003 - Show the vendor type description on vendor detail page when AV is used
Summary: Show the vendor type description on vendor detail page when AV is used
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Acquisitions (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor (vote)
Assignee: Katrin Fischer
QA Contact: Testopia
URL:
Keywords:
Depends on: 31017
Blocks:
  Show dependency treegraph
 
Reported: 2023-02-17 21:01 UTC by Caroline Cyr La Rose
Modified: 2023-10-14 12:27 UTC (History)
1 user (show)

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


Attachments
Bug 33003: Show the vendor type on vendor detail page (2.60 KB, patch)
2023-02-18 10:29 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 33003: Show the vendor type on vendor detail page (2.54 KB, patch)
2023-02-18 10:34 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 33003: Show the vendor type on vendor detail page (2.59 KB, patch)
2023-02-18 15:09 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 33003: Show the vendor type on vendor detail page (2.66 KB, patch)
2023-02-20 14:14 UTC, Caroline Cyr La Rose
Details | Diff | Splinter Review
Bug 33003: Show the vendor type on vendor detail page (2.66 KB, patch)
2023-02-23 10:06 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 33003: Show the vendor type on vendor detail page (2.74 KB, patch)
2023-02-23 10:50 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 Caroline Cyr La Rose 2023-02-17 21:01:06 UTC
Bug 31017 added a new vendor type field, where we can either enter a free text or add authorized values in the VENDOR_TYPE category to get a drop-down menu.

When using the authorized values, we should show the authorized value description in supplier.pl.

To test:
1. Add at least one authorized value in VENDOR_TYPE
   1.1. Go to Administration > Authorized values
   1.2. Search for VENDOR_TYPE
   1.3. Click 'Add'
   1.4. Fill out the form
        - Authorized value: BOOK
        - Description: Print books
   1.5. Click 'Save'
2. Add a new vendor
   2.1. Go to Acquisitions
   2.2. Click 'New vendor'
   2.3. Fill out the form
        - Name: ABC Bookstore
        - Vendor type: Print books
   2.4. Click 'Save'
3. Go to the vendor page
   3.1. Click on the vendor name
   --> The value in "Type" is BOOK, it should be "Print books"
Comment 1 Katrin Fischer 2023-02-18 10:29:59 UTC
Created attachment 146910 [details] [review]
Bug 33003: Show the vendor type on vendor detail page

When using an authorised value VENDOR_TYPE for the
vendor type, we should show the AV description
everywhere instead of the code. It already works on
the vendor search, but not on the vendor detail page.
With this patch it will also work there.

To test:
1. Add at least one authorized value in VENDOR_TYPE
   1.1. Go to Administration > Authorized values
   1.2. Search for VENDOR_TYPE
   1.3. Click 'Add'
   1.4. Fill out the form
        - Authorized value: BOOK
        - Description: Print books
   1.5. Click 'Save'
2. Add a new vendor
   2.1. Go to Acquisitions
   2.2. Click 'New vendor'
   2.3. Fill out the form
        - Name: ABC Bookstore
        - Vendor type: Print books
   2.4. Click 'Save'
3. Go to the vendor page
   3.1. Click on the vendor name
   --> The value in "Type" is BOOK, it should be "Print books"
4. Apply patch
   4.1. Repeat test, now it should show the description

https://bugs.koha-community.org/show_bug.cgi?id=33002
Comment 2 Katrin Fischer 2023-02-18 10:34:23 UTC
Created attachment 146911 [details] [review]
Bug 33003: Show the vendor type on vendor detail page

When using an authorised value VENDOR_TYPE for the
vendor type, we should show the AV description
everywhere instead of the code. It already works on
the vendor search, but not on the vendor detail page.
With this patch it will also work there.

To test:
1. Add at least one authorized value in VENDOR_TYPE
   1.1. Go to Administration > Authorized values
   1.2. Search for VENDOR_TYPE
   1.3. Click 'Add'
   1.4. Fill out the form
        - Authorized value: BOOK
        - Description: Print books
   1.5. Click 'Save'
2. Add a new vendor
   2.1. Go to Acquisitions
   2.2. Click 'New vendor'
   2.3. Fill out the form
        - Name: ABC Bookstore
        - Vendor type: Print books
   2.4. Click 'Save'
3. Go to the vendor page
   3.1. Click on the vendor name
   --> The value in "Type" is BOOK, it should be "Print books"
4. Apply patch
   4.1. Repeat test, now it should show the description
Comment 3 Owen Leonard 2023-02-18 15:09:51 UTC
Created attachment 146920 [details] [review]
Bug 33003: Show the vendor type on vendor detail page

When using an authorised value VENDOR_TYPE for the
vendor type, we should show the AV description
everywhere instead of the code. It already works on
the vendor search, but not on the vendor detail page.
With this patch it will also work there.

To test:
1. Add at least one authorized value in VENDOR_TYPE
   1.1. Go to Administration > Authorized values
   1.2. Search for VENDOR_TYPE
   1.3. Click 'Add'
   1.4. Fill out the form
        - Authorized value: BOOK
        - Description: Print books
   1.5. Click 'Save'
2. Add a new vendor
   2.1. Go to Acquisitions
   2.2. Click 'New vendor'
   2.3. Fill out the form
        - Name: ABC Bookstore
        - Vendor type: Print books
   2.4. Click 'Save'
3. Go to the vendor page
   3.1. Click on the vendor name
   --> The value in "Type" is BOOK, it should be "Print books"
4. Apply patch
   4.1. Repeat test, now it should show the description

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 4 Caroline Cyr La Rose 2023-02-20 14:14:20 UTC
Created attachment 146958 [details] [review]
Bug 33003: Show the vendor type on vendor detail page

When using an authorised value VENDOR_TYPE for the
vendor type, we should show the AV description
everywhere instead of the code. It already works on
the vendor search, but not on the vendor detail page.
With this patch it will also work there.

To test:
1. Add at least one authorized value in VENDOR_TYPE
   1.1. Go to Administration > Authorized values
   1.2. Search for VENDOR_TYPE
   1.3. Click 'Add'
   1.4. Fill out the form
        - Authorized value: BOOK
        - Description: Print books
   1.5. Click 'Save'
2. Add a new vendor
   2.1. Go to Acquisitions
   2.2. Click 'New vendor'
   2.3. Fill out the form
        - Name: ABC Bookstore
        - Vendor type: Print books
   2.4. Click 'Save'
3. Go to the vendor page
   3.1. Click on the vendor name
   --> The value in "Type" is BOOK, it should be "Print books"
4. Apply patch
   4.1. Repeat test, now it should show the description

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Comment 5 Caroline Cyr La Rose 2023-02-20 14:16:53 UTC
Thanks Katrin!
Comment 6 Jonathan Druart 2023-02-23 09:33:19 UTC
Should not we fallback to the original value of the AV does not exist?

To recreate:
Don't have VENDOR_TYPE
Add a type (free text)
Add the av category + create some values
Edit the vendor, save
=> You lost the original value.
Comment 7 Jonathan Druart 2023-02-23 09:33:41 UTC
(In reply to Jonathan Druart from comment #6)
> Should not we fallback to the original value of the AV does not exist?

*if* the AV does not exist
Comment 8 Katrin Fischer 2023-02-23 09:43:59 UTC
(In reply to Jonathan Druart from comment #6)
> Should not we fallback to the original value of the AV does not exist?
> 
> To recreate:
> Don't have VENDOR_TYPE
> Add a type (free text)
> Add the av category + create some values
> Edit the vendor, save
> => You lost the original value.

This is a known data loss issue we struggle in some places with, but it's not reason to fail this patch :)

* This is a display fix, it doesn't touch the pull down/edit page at all.
* The same code is used in the result list already.
* If you have no matching AV entry, the code will display, so it works for both types: libraries using the AV and the ones not using it.
* The category will be added as system_internal in bug 33004, so ALL will have it an cannot get rid of it.
Comment 9 Jonathan Druart 2023-02-23 10:06:29 UTC
Created attachment 147212 [details] [review]
Bug 33003: Show the vendor type on vendor detail page

When using an authorised value VENDOR_TYPE for the
vendor type, we should show the AV description
everywhere instead of the code. It already works on
the vendor search, but not on the vendor detail page.
With this patch it will also work there.

To test:
1. Add at least one authorized value in VENDOR_TYPE
   1.1. Go to Administration > Authorized values
   1.2. Search for VENDOR_TYPE
   1.3. Click 'Add'
   1.4. Fill out the form
        - Authorized value: BOOK
        - Description: Print books
   1.5. Click 'Save'
2. Add a new vendor
   2.1. Go to Acquisitions
   2.2. Click 'New vendor'
   2.3. Fill out the form
        - Name: ABC Bookstore
        - Vendor type: Print books
   2.4. Click 'Save'
3. Go to the vendor page
   3.1. Click on the vendor name
   --> The value in "Type" is BOOK, it should be "Print books"
4. Apply patch
   4.1. Repeat test, now it should show the description

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Comment 10 Jonathan Druart 2023-02-23 10:07:02 UTC
Indeed, only for display. I hit the problem when editing the vendor. We should not have pushed the feature without some AVs...
Comment 11 Jonathan Druart 2023-02-23 10:50:13 UTC
Created attachment 147222 [details] [review]
Bug 33003: Show the vendor type on vendor detail page

When using an authorised value VENDOR_TYPE for the
vendor type, we should show the AV description
everywhere instead of the code. It already works on
the vendor search, but not on the vendor detail page.
With this patch it will also work there.

To test:
1. Add at least one authorized value in VENDOR_TYPE
   1.1. Go to Administration > Authorized values
   1.2. Search for VENDOR_TYPE
   1.3. Click 'Add'
   1.4. Fill out the form
        - Authorized value: BOOK
        - Description: Print books
   1.5. Click 'Save'
2. Add a new vendor
   2.1. Go to Acquisitions
   2.2. Click 'New vendor'
   2.3. Fill out the form
        - Name: ABC Bookstore
        - Vendor type: Print books
   2.4. Click 'Save'
3. Go to the vendor page
   3.1. Click on the vendor name
   --> The value in "Type" is BOOK, it should be "Print books"
4. Apply patch
   4.1. Repeat test, now it should show the description

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 12 Tomás Cohen Arazi 2023-03-02 12:39:39 UTC
Pushed to master for 23.05.

Nice work everyone, thanks!
Comment 13 Jonathan Druart 2023-09-20 07:43:27 UTC
There are extra spaces: https://snipboard.io/M90DXR.jpg