Bug 6894 - Default currency on Acquisitions suggestion form
Summary: Default currency on Acquisitions suggestion form
Alias: None
Product: Koha
Classification: Unclassified
Component: Acquisitions (show other bugs)
Version: 3.6
Hardware: All All
: PATCH-Sent (DO NOT USE) normal (vote)
Assignee: Katrin Fischer
QA Contact: Marcel de Rooy
Depends on:
Reported: 2011-09-21 06:24 UTC by Katrin Fischer
Modified: 2012-10-25 23:09 UTC (History)
3 users (show)

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

Bug 6894: Order from suggestion defaulting to wrong currency (2.02 KB, patch)
2011-10-25 15:44 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 6894: Order from suggestion defaulting to wrong currency (2.25 KB, patch)
2011-10-28 17:09 UTC, Liz Rea
Details | Diff | Splinter Review
Bug 6894: Order from suggestion defaulting to wrong currency (2.38 KB, patch)
2011-11-27 15:45 UTC, Jared Camins-Esakov
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2011-09-21 06:24:15 UTC
To reproduce:

1) Create vendor, check currency setting to be not the first one in your list of currencies
2) Create suggestion
3) Create basket
4) Order from suggestoin

In 4) currency selected should be the first in your currency list, not the active currency or currency selected for the vendor.

For other ordering options this works correctly.
Comment 1 Katrin Fischer 2011-10-25 15:44:51 UTC Comment hidden (obsolete)
Comment 2 Liz Rea 2011-10-28 17:09:07 UTC Comment hidden (obsolete)
Comment 3 Marcel de Rooy 2011-11-23 14:01:10 UTC
QA Comment
This bugreport handles the currency on the suggestion form only; the comment made me look to order from suggestion too. But that part is not touched by the patch.
The currency correctly defaults to active currency if no currency was passed via CGI object. ($$suggestion_ref takes its values from input->Vars.)
Code looks good.
Marking it as Passed QA.
Comment 4 Paul Poulain 2011-11-24 14:59:37 UTC
mmm... can't reproduce the step 2 (2) Editing a suggestion created in OPAC will default to active currency.)

Here is my database content:
portable kohacommunity>select * from suggestions WHERE suggestionid=2\G
*************************** 1. row ***************************
   suggestionid: 2
    suggestedby: 1
  suggesteddate: 2011-10-26
      managedby: 1
    manageddate: 2011-11-24
     acceptedby: 1
   accepteddate: 2011-10-26
     rejectedby: NULL
   rejecteddate: NULL
         STATUS: ASKED
          title: suggestion 6880
  copyrightdate: 0
           date: 2011-11-24 15:57:27
     volumedesc: NULL
publicationyear: 0
 mailoverseeing: 0
   biblionumber: NULL
         reason: blablabla
       budgetid: NULL
     branchcode: ANNEXE
       quantity: NULL
       currency: NULL  <<<<<<<<<<<<<<<<<<<<<<<<<<<
          price: NULL
          total: NULL
1 row in set (0.00 sec)

portable kohacommunity>SELECT * FROM currency;
| currency | symbol | timestamp           | rate    | active |
| AA       | AA     | 2011-11-16 17:45:33 | 2.00000 |      0 |
| EURO     | �      | 2011-08-03 13:36:12 | 1.00000 |      1 |
| YEN      | Y      | 2011-10-20 11:09:14 | 0.06500 |      0 |

If I try to modify suggestion 2, the currency is defaulted to AA (should be EURO)

Otherwise, works fine. Katrin or someone else, an idea ?
Comment 5 Katrin Fischer 2011-11-27 15:31:01 UTC
Ignore the Description. At first I thought this problem was happening on the order form and figured out later, that my wrong currencies happened during accpeting the suggestions.

I retested 2)
- CAD is the first currency in my currency table
- EUR is the second currency, also the active currency
- I created a suggestion in OPAC
- I opened that suggestion in the suggestions module
- the pull down for currencies showed EUR as preselected currency

Comment on 4)
- create suggeston in OPAC
- accept suggestion from the list(!) only changing the status to accepted. Currency in the database will still be NULL after that.
Comment 6 Jared Camins-Esakov 2011-11-27 15:45:29 UTC
Created attachment 6435 [details] [review]
Bug 6894: Order from suggestion defaulting to wrong currency

This problem turned out to be a bit different, than I initally thought.

This patch fixes the currency selections for new orders created in staff.
Before this patch, the first currency in the list was selected instead
of the active currency. So you needed to change it explicitly.

After patch it should work like this:

1) Suggestion created in OPAC - currency defaults to NULL in database
2) Editing a suggestion created in OPAC will default to active currency.
3) Creating a new suggestion in staff will default to active currency.
4) When ordering, the currency will default to the vendor currency, if no
currency is set in the suggestion. (still happens, when suggestions are accepted
in batch from the list.

I hope this is right - comments and testing appreciated.

Signed-off-by: Liz Rea <lrea@nekls.org>
Verified that in the above places, active currency was displayed or selected. Tested both suggestions entered from the OPAC and from the intranet.

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Verified the existence of the bug, and that the fix works as advertised.
Comment 7 Jared Camins-Esakov 2011-11-27 15:47:42 UTC

I can confirm the bug, and the patch works to fix it for me, as well.

Comment 8 Paul Poulain 2011-11-28 11:21:20 UTC
patch pushed, please test
Comment 9 Katrin Fischer 2011-12-01 06:40:53 UTC
Works on current HEAD.