Bugzilla – Attachment 78039 Details for
Bug 20014
When adding to basket from a staged file item budgets are selected by matching on code, not id
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20014: Preselect item budget based on id not code
Bug-20014-Preselect-item-budget-based-on-id-not-co.patch (text/plain), 3.53 KB, created by
Chris Cormack
on 2018-08-21 10:08:29 UTC
(
hide
)
Description:
Bug 20014: Preselect item budget based on id not code
Filename:
MIME Type:
Creator:
Chris Cormack
Created:
2018-08-21 10:08:29 UTC
Size:
3.53 KB
patch
obsolete
>From 862fa6a2a777ed32d1d3b8c4926b3f6e22b5b0ab Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Wed, 17 Jan 2018 19:50:31 +0000 >Subject: [PATCH] Bug 20014: Preselect item budget based on id not code > >To test: >1 - Have the same fund code in two budgets >2 - Have budget code defined in MarcItemFieldsToOrder >3 - Stage a file with some order items as defined above >4 - Inspect the fuinds drop down in the item, notice two lines are >marked selected >5 - Apply patch >6 - Repeat >7 - Only one field should be selected, with a preference for active >budget > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> >--- > acqui/addorderiso2709.pl | 9 ++++++++- > .../prog/en/modules/acqui/addorderiso2709.tt | 2 +- > 2 files changed, 9 insertions(+), 2 deletions(-) > >diff --git a/acqui/addorderiso2709.pl b/acqui/addorderiso2709.pl >index 3ce7e1e133..db0c66bdc7 100755 >--- a/acqui/addorderiso2709.pl >+++ b/acqui/addorderiso2709.pl >@@ -544,6 +544,13 @@ sub import_biblios_list { > my $item_copyno = $iteminfos->{copyno}; > my $item_quantity = $iteminfos->{quantity} || 1; > my $item_budget_code = $iteminfos->{budget_code}; >+ my $item_budget_id; >+ if ( $iteminfos->{budget_code} ) { >+ my $item_budget = GetBudgetByCode( $iteminfos->{budget_code} ); >+ if ( $item_budget ) { >+ $item_budget_id = $item_budget->{budget_id}; >+ } >+ } > my $item_price = $iteminfos->{price}; > my $item_replacement_price = $iteminfos->{replacementprice}; > my $item_callnumber = $iteminfos->{itemcallnumber}; >@@ -564,7 +571,7 @@ sub import_biblios_list { > 'uri' => $item_uri, > 'copyno' => $item_copyno, > 'quantity' => $item_quantity, >- 'budget_code' => $item_budget_code || $budget_code, >+ 'budget_id' => $item_budget_id || $budget_id, > 'itemprice' => $item_price || $price, > 'replacementprice' => $item_replacement_price, > 'itemcallnumber' => $item_callnumber, >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt >index 7911662d7e..818eb2852e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt >@@ -227,7 +227,7 @@ > <li><label for="budget_code_item_[% item.item_id | html %]">budget_code</label><select id="budget_code_item_[% item.item_id | html %]" name="budget_code_[% item.biblio_count | html %]"> > <option value="">Select a fund</option> > [% FOREACH budget_loo IN budget_loop %] >- [% IF ( budget_loo.b_code ) == ( item.budget_code ) %]<option value="[% budget_loo.b_id | html %]" selected="selected">[% budget_loo.b_txt | html %]</option> >+ [% IF ( budget_loo.b_id ) == ( item.budget_id ) %]<option value="[% budget_loo.b_id | html %]" selected="selected">[% budget_loo.b_txt | html %]</option> > [% ELSE %]<option value="[% budget_loo.b_id | html %]">[% budget_loo.b_txt | html %]</option> > [% END %] > [% END %] >-- >2.18.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 20014
:
70638
|
76113
|
76114
|
76115
|
77872
| 78039