Bug 19694 - Edited shipping cost in invoice doesn't save
Summary: Edited shipping cost in invoice doesn't save
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Acquisitions (show other bugs)
Version: master
Hardware: All All
: P5 - low major (vote)
Assignee: Jonathan Druart
QA Contact: Kyle M Hall
URL:
Whiteboard:
Keywords:
: 18793 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-11-27 11:33 UTC by Katrin Fischer
Modified: 2018-06-04 20:15 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 19694: Force scalar context for output_pref called with billingdate (1.57 KB, patch)
2017-12-19 18:12 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 19694: Force scalar context for output_pref called with billingdate (1.62 KB, patch)
2017-12-20 17:41 UTC, Jon Knight
Details | Diff | Splinter Review
Bug 19694: Force scalar context for output_pref called with billingdate (1.67 KB, patch)
2017-12-21 11:38 UTC, Kyle M Hall
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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