Bugzilla – Attachment 158565 Details for
Bug 35254
Adding files to basket from a staged file uses wrong inputs for order information when not all records are selected
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35254: Add import_record_id to order inputs
Bug-35254-Add-importrecordid-to-order-inputs.patch (text/plain), 10.79 KB, created by
Victor Grousset/tuxayo
on 2023-11-06 20:55:58 UTC
(
hide
)
Description:
Bug 35254: Add import_record_id to order inputs
Filename:
MIME Type:
Creator:
Victor Grousset/tuxayo
Created:
2023-11-06 20:55:58 UTC
Size:
10.79 KB
patch
obsolete
>From d7aa94cf78d0e9f5da4f2b7c1f54e508321b9361 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Fri, 3 Nov 2023 20:10:01 +0000 >Subject: [PATCH] Bug 35254: Add import_record_id to order inputs > >This patch follows the logic of bug 32166 and adds specific inputs for each order to avoid any misalignment when some records are not imported > >To test: >1 - Find a vendor in acquisitions >2 - Create or find an open basket >3 - Add to basket form a new file >4 - Stage file and add to basket >5 - Select the second record in the list >6 - Enter price info >7 - Save (don't forget, you need to set item type in the second tab) >8 - The order has no price info! >9 - Apply patch >10 - Repeat 3-7 above, staging file fresh >11 - Confirm order has correct prices >12 - Test with a file with many records >13 - Confirm any combination of choosing/skipping records works as expected > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> >--- > acqui/addorderiso2709.pl | 28 +++++++++---------- > .../prog/en/modules/acqui/addorderiso2709.tt | 14 +++++----- > 2 files changed, 21 insertions(+), 21 deletions(-) > >diff --git a/acqui/addorderiso2709.pl b/acqui/addorderiso2709.pl >index f90f3da3d3..e79a0ae447 100755 >--- a/acqui/addorderiso2709.pl >+++ b/acqui/addorderiso2709.pl >@@ -144,13 +144,6 @@ if ($op eq ""){ > my $duplinbatch; > my $imported = 0; > my @import_record_id_selected = $input->multi_param("import_record_id"); >- my @quantities = $input->multi_param('quantity'); >- my @prices = $input->multi_param('price'); >- my @orderreplacementprices = $input->multi_param('replacementprice'); >- my @budgets_id = $input->multi_param('budget_id'); >- my @discount = $input->multi_param('discount'); >- my @sort1 = $input->multi_param('sort1'); >- my @sort2 = $input->multi_param('sort2'); > my $matcher_id = $input->param('matcher_id'); > my $active_currency = Koha::Acquisition::Currencies->get_active; > my $biblio_count = 0; >@@ -163,13 +156,20 @@ if ($op eq ""){ > my $matches = $import_record->get_import_record_matches({ chosen => 1 }); > my $match = $matches->count ? $matches->next : undef; > my $biblionumber = $match ? $match->candidate_match_id : 0; >- my $c_quantity = shift( @quantities ) || GetMarcQuantity($marcrecord, C4::Context->preference('marcflavour') ) || 1; >- my $c_budget_id = shift( @budgets_id ) || $input->param('all_budget_id') || $budget_id; >- my $c_discount = shift ( @discount); >- my $c_sort1 = shift( @sort1 ) || $input->param('all_sort1') || ''; >- my $c_sort2 = shift( @sort2 ) || $input->param('all_sort2') || ''; >- my $c_replacement_price = shift( @orderreplacementprices ); >- my $c_price = shift( @prices ) || GetMarcPrice($marcrecord, C4::Context->preference('marcflavour')); >+ my $c_quantity = >+ $input->param( 'quantity_' . $import_record->import_record_id ) >+ || GetMarcQuantity( $marcrecord, C4::Context->preference('marcflavour') ) >+ || 1; >+ my $c_budget_id = >+ $input->param( 'budget_id_' . $import_record->import_record_id ) >+ || $input->param('all_budget_id') >+ || $budget_id; >+ my $c_discount = $input->param( 'discount_' . $import_record->import_record_id ); >+ my $c_sort1 = $input->param( 'sort1_' . $import_record->import_record_id ) || $input->param('all_sort1') || ''; >+ my $c_sort2 = $input->param( 'sort2_' . $import_record->import_record_id ) || $input->param('all_sort2') || ''; >+ my $c_replacement_price = $input->param( 'replacementprice_' . $import_record->import_record_id ); >+ my $c_price = $input->param( 'price_' . $import_record->import_record_id ) >+ || GetMarcPrice( $marcrecord, C4::Context->preference('marcflavour') ); > > # Insert the biblio, or find it through matcher > if ( $biblionumber ) { # If matched during staging we can continue >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 84e22d4f01..35692ee15e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt >@@ -188,20 +188,20 @@ > </li> > <li class="quantity"> > <label for="quantity_record_[% biblio.import_record_id | html %]" class="required">Quantity: </label> >- <input id="quantity_record_[% biblio.import_record_id | html %]" type="text" pattern="[0-9]+" value="[% biblio.quantity.length ? biblio.quantity : 1 | html %]" name="quantity" /> >+ <input id="quantity_record_[% biblio.import_record_id | html %]" type="text" pattern="[0-9]+" value="[% biblio.quantity.length ? biblio.quantity : 1 | html %]" name="quantity_[% biblio.import_record_id | html %]" /> > <span class="required">Required</span> > </li> > <li class="price"> > <label for="price_record_[% biblio.import_record_id | html %]">Price: </label> >- <input id="price_record_[% biblio.import_record_id | html %]" class="decimal" type="text" value="[% biblio.price | $Price on_editing => 1 %]" name="price" /> >+ <input id="price_record_[% biblio.import_record_id | html %]" class="decimal" type="text" value="[% biblio.price | $Price on_editing => 1 %]" name="price_[% biblio.import_record_id | html %]" /> > </li> > <li class="replacementprice"> > <label for="replacementprice_record_[% biblio.import_record_id | html %]">Replacement price: </label> >- <input id="replacementprice_record_[% biblio.import_record_id | html %]" class="decimal" type="text" value="[% biblio.replacementprice | $Price on_editing => 1 %]" name="replacementprice" /> >+ <input id="replacementprice_record_[% biblio.import_record_id | html %]" class="decimal" type="text" value="[% biblio.replacementprice | $Price on_editing => 1 %]" name="replacementprice_[% biblio.import_record_id | html %]" /> > </li> > <li class="discount"> > <label for="discount_record_[% biblio.import_record_id | html %]">Discount: </label> >- <input id="discount_record_[% biblio.import_record_id | html %]" type="text" value="[% biblio.discount | html %]" name="discount" size="6" /> % >+ <input id="discount_record_[% biblio.import_record_id | html %]" type="text" value="[% biblio.discount | html %]" name="discount_[% biblio.import_record_id | html %]" size="6" /> % > <div class="hint">If empty, discount rate from vendor will be used</div> > </li> > <li class="fund"> >@@ -210,7 +210,7 @@ > <input type="hidden" size="20" name="budget_id" value="[% budget_id | html %]" />[% Budget_name | html %] > [% ELSE %] > <label for="fund_record_[% biblio.import_record_id | html %]">Fund: </label> >- <select id="fund_record_[% biblio.import_record_id | html %]" name="budget_id"> >+ <select id="fund_record_[% biblio.import_record_id | html %]" name="budget_id_[% biblio.import_record_id | html %]"> > <option value="">Select a fund (will use default if set)</option> > [% FOREACH budget IN budget_loop %] > [% IF ( budget.b_id == biblio.budget_id ) %] >@@ -231,11 +231,11 @@ > </li> > <li class="sort1"> > <label for="sort1_record_[% biblio.import_record_id | html %]">Statistic 1: </label> >- <input id="sort1_record_[% biblio.import_record_id | html %]" type="text" size="20" name="sort1" value="[% biblio.sort1 | html %]" /> >+ <input id="sort1_record_[% biblio.import_record_id | html %]" type="text" size="20" name="sort1_[% biblio.import_record_id | html %]" value="[% biblio.sort1 | html %]" /> > </li> > <li class="sort2"> > <label for="sort2_record_[% biblio.import_record_id | html %]">Statistic 2: </label> >- <input id="sort2_record_[% biblio.import_record_id | html %]" type="text" size="20" name="sort2" value="[% biblio.sort2 | html %]" /> >+ <input id="sort2_record_[% biblio.import_record_id | html %]" type="text" size="20" name="sort2_[% biblio.import_record_id | html %]" value="[% biblio.sort2 | html %]" /> > </li> > </ol> > [% IF ( biblio.iteminfos.size ) %] >-- >2.42.1
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 35254
:
158366
|
158374
| 158565 |
159713