Bug 19694

Summary: Edited shipping cost in invoice doesn't save
Product: Koha Reporter: Katrin Fischer <katrin.fischer>
Component: AcquisitionsAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Kyle M Hall <kyle>
Severity: major    
Priority: P5 - low CC: fridolin.somers, jonathan.druart, jzairo, kyle, nick
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Bug 19694: Force scalar context for output_pref called with billingdate
Bug 19694: Force scalar context for output_pref called with billingdate
Bug 19694: Force scalar context for output_pref called with billingdate

Description Katrin Fischer 2017-11-27 11:33:49 UTC
If you change the shipping cost in an existing invoice, the page reloads on saving and gives you a success message, but the amount stays the same.

Tested so far in 16.11.13 and 3.22.18.

To test:
- Search for an existing invoice
- Show details
- Changing shipping cost
- Save
- Verify the old amount is still shown, although there is a success message on top
Comment 1 Jonathan Druart 2017-12-19 18:12:37 UTC
Created attachment 69922 [details] [review]
Bug 19694: Force scalar context for output_pref called with billingdate

If no string is passed to output_pref, it needs to be called in scalar
context (to avoid a shift in the hash elements).
Here we have billingdate that is not defined yet (NULL)

Test plan:
- Search for an existing invoice
- Show details
- Changing shipping cost
- Save
- Verify the new amount is shown
Comment 2 Jonathan Druart 2017-12-19 18:18:07 UTC
And it has the side-effect to set billingdate to 0000-00-00
Comment 3 Jonathan Druart 2017-12-19 18:18:38 UTC
The logs displayed:
Odd number of elements in hash assignment at /home/vagrant/kohaclone/C4/Acquisition.pm line 2773.
Comment 4 Jon Knight 2017-12-20 17:41:50 UTC
Created attachment 69962 [details] [review]
Bug 19694: Force scalar context for output_pref called with billingdate

If no string is passed to output_pref, it needs to be called in scalar
context (to avoid a shift in the hash elements).
Here we have billingdate that is not defined yet (NULL)

Test plan:
- Search for an existing invoice
- Show details
- Changing shipping cost
- Save
- Verify the new amount is shown

Signed-off-by: Jon Knight <J.P.Knight@lboro.ac.uk>
Comment 5 Kyle M Hall 2017-12-21 11:38:00 UTC
Created attachment 70001 [details] [review]
Bug 19694: Force scalar context for output_pref called with billingdate

If no string is passed to output_pref, it needs to be called in scalar
context (to avoid a shift in the hash elements).
Here we have billingdate that is not defined yet (NULL)

Test plan:
- Search for an existing invoice
- Show details
- Changing shipping cost
- Save
- Verify the new amount is shown

Signed-off-by: Jon Knight <J.P.Knight@lboro.ac.uk>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 6 Jonathan Druart 2017-12-21 16:24:30 UTC
Pushed to master for 18.05, thanks to everybody involved!
Comment 7 Jessie Zairo 2018-01-08 17:14:52 UTC
*** Bug 18793 has been marked as a duplicate of this bug. ***
Comment 8 Nick Clemens 2018-01-15 13:20:09 UTC
Awesome work all! Pushed to stable for 17.11.02
Comment 9 Fridolin Somers 2018-01-15 15:46:38 UTC
Pushed to 17.05.x for v17.05.08