Bug 19271

Summary: Ordered/Spent lists should display vendor name, not vendor code
Product: Koha Reporter: Katrin Fischer <katrin.fischer>
Component: AcquisitionsAssignee: Katrin Fischer <katrin.fischer>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: trivial    
Priority: P5 - low CC: caroline.cyr-la-rose, fridolin.somers, jonathan.druart, martin.renvoize, nick
Version: master   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Bug 19271: Show vendor name and format prices on ordered/spent lists
Bug 19271: Show vendor name and format prices on ordered/spent lists
Bug 19271: Show vendor name on ordered/spent lists
Bug 19271: Format prices on ordered/spent lists
Bug 19271: Show vendor name on ordered/spent lists

Description Katrin Fischer 2017-09-07 10:58:35 UTC
The list of ordered and spent amounts for each fund shows only the vendor's internal number instead of the vendor name. This makes the list less useful, especially for printing or exporting.

Koha should show the vendor names instead of the numbers.
Comment 1 Katrin Fischer 2018-08-10 17:19:59 UTC Comment hidden (obsolete)
Comment 2 Caroline Cyr La Rose 2018-09-16 18:15:10 UTC
I get conflicts when trying to apply the patch

koha-tmpl/intranet-tmpl/prog/en/modules/acqui/ordered.tt
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/spent.tt
Comment 3 Chris Cormack 2018-09-16 18:45:56 UTC
Created attachment 78979 [details] [review]
Bug 19271: Show vendor name and format prices on ordered/spent lists

Improvements to the display of lists of ordered and received orders:
- Format prices according to CurrencyFormat system preference
- Show the vendor's name instead of the internal number

To test:
- Make sure you have some pending and received orders
- Access the Spent and Ordered pages by clicking on the
  amount ordered or spent on the acq start page
- Verify that
  - All price information is shown according to CurrencyFormat
  - Vendor name shows
Comment 4 Caroline Cyr La Rose 2018-09-16 18:48:19 UTC
Everything works fine now. The names of the vendors appear!

:)
Comment 5 Jonathan Druart 2018-09-16 21:44:21 UTC
I would not format the prices in the same patch/bug report, I am expecting regressions here: sum of round numbers (sprintf %.2f) vs round of sum (if it makes sense...)
Comment 6 Katrin Fischer 2018-09-21 19:36:04 UTC
(In reply to Jonathan Druart from comment #5)
> I would not format the prices in the same patch/bug report, I am expecting
> regressions here: sum of round numbers (sprintf %.2f) vs round of sum (if it
> makes sense...)

Sorry, I don't understand. Can you explain? It seems to be the same change as in other places?
Comment 7 Jonathan Druart 2018-09-21 19:52:43 UTC
use Modern::Perl;
my $x = 12.344;
my $y = 67.213;
say sprintf("%.2f", $x)+sprintf("%.2f", $y);
say sprintf("%.2f", $x+$y);'

79.55
79.56
Comment 8 Martin Renvoize 2018-09-27 08:12:12 UTC
Man that's upsetting, but I have to agree with Jonathan here..  the totals shouldn't really be calculated in this script in my opinion.  But because they are, we can't make this change here.

Could we perhaps split into two bugs please Katrin?
Comment 9 Martin Renvoize 2018-09-27 08:13:45 UTC
Marking as Failed QA as now two of us agree that this change could have negative effects on calculations.
Comment 10 Katrin Fischer 2018-09-27 10:29:46 UTC
What about keeping the format statements in the .pl file and still use the Price filter?
Comment 11 Martin Renvoize 2018-09-27 11:47:29 UTC
Created attachment 79482 [details] [review]
Bug 19271: Show vendor name on ordered/spent lists

 Improvements to the display of lists of ordered and received orders:
 - Show the vendor's name instead of the internal number

 To test:
 - Make sure you have some pending and received orders
 - Access the Spent and Ordered pages by clicking on the
   amount ordered or spent on the acq start page
   - Verify that
     - Vendor name shows

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 12 Martin Renvoize 2018-09-27 11:47:32 UTC
Created attachment 79483 [details] [review]
Bug 19271: Format prices on ordered/spent lists

 Improvements to the display of lists of ordered and received orders:
 - Format prices according to CurrencyFormat system preference

 To test:
 - Make sure you have some pending and received orders
 - Access the Spent and Ordered pages by clicking on the
   amount ordered or spent on the acq start page
   - Verify that
     - All price information is shown according to CurrencyFormat

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 13 Martin Renvoize 2018-09-27 11:48:58 UTC
Right.. I've split the patch in two.. left the accreditation with Katrin as the original author and signed off the first patch.. I'll now create a second bug and move the second patch over there.
Comment 14 Martin Renvoize 2018-09-27 11:54:54 UTC
Second patch moved to bug 21427 unblocking this bug.  Setting to Signed off
Comment 15 Jonathan Druart 2018-09-29 15:19:59 UTC
Created attachment 79613 [details] [review]
Bug 19271: Show vendor name on ordered/spent lists

Improvements to the display of lists of ordered and received orders:
 - Show the vendor's name instead of the internal number

 To test:
 - Make sure you have some pending and received orders
 - Access the Spent and Ordered pages by clicking on the
   amount ordered or spent on the acq start page
   - Verify that
     - Vendor name shows

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 16 Nick Clemens 2018-10-01 16:43:42 UTC
Awesome work all!

Pushed to master for 18.11
Comment 17 Fridolin Somers 2018-10-11 13:16:14 UTC
Pushed to 18.05.x for 18.05.05
Comment 18 Fridolin Somers 2018-10-11 13:16:45 UTC
Pushed to 17.11.x for 17.11.11