Bugzilla – Attachment 161466 Details for
Bug 35892
Fallback to GetMarcPrice in addorderiso2907 no longer works
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35892: Populate order price using GetMarcPrice if no price specified
Bug-35892-Populate-order-price-using-GetMarcPrice-.patch (text/plain), 3.52 KB, created by
Nick Clemens (kidclamp)
on 2024-01-25 20:07:35 UTC
(
hide
)
Description:
Bug 35892: Populate order price using GetMarcPrice if no price specified
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2024-01-25 20:07:35 UTC
Size:
3.52 KB
patch
obsolete
>From 31b73591355e922efb858844dae85a2e4d46295d Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 25 Jan 2024 19:03:00 +0000 >Subject: [PATCH] Bug 35892: Populate order price using GetMarcPrice if no > price specified > >Previously this happened after the fact, automagically, if no price was included in the order record. We should >rather load the Marc price into the order form if we don't have a price form the '...ToOrder' system preferences > >To test: > >Setup -- Set systempreferences below > >MarcFieldsToOrder: >price: 949$g >quantity: 949$k >budget_code: 949$l >discount: 949$m >sort1: 949$n >sort2: 949$q > >MarcItemFieldsToOrder: >homebranch: 949$a >holdingbranch: 949$b >itype: 949$y >nonpublic_note: 949$x >public_note: 949$z >loc: 949$c >ccode: 949$8 >notforloan: 949$7 >uri: 949$u >copyno: 949$t >replacementprice: 949$v >itemcallnumber: 949$o >quantity: 949$k >budget_code: 949$l > >Stage the attached bib-303.marcxml file >Add to basket from the staged file >Note that item prices are populated as '6.50' from 949$g >Cancel >Update MarcFieldsToOrder and map price to "020$c" >Add to basket from the staged file >Note the price is not populated, because 020$c contains a dollar sign >Cancel >Apply patch, restart all >Add to basket from the staged file >Note the price is now correctly populated from fallback to GetMarcPrice > >Note: GetMarcPrice does some automatic munging, that's why 020$c on it's own doesn't work - this could be done to fields in MarcFieldsToOrder/MarcItemFieldsToOrder but this would be an enhancement. >This bug simply restores the previous behavious, but does it on the front end and is more obvious to the user >--- > acqui/addorderiso2709.pl | 7 +++---- > 1 file changed, 3 insertions(+), 4 deletions(-) > >diff --git a/acqui/addorderiso2709.pl b/acqui/addorderiso2709.pl >index 68fd5caa223..1db085613d3 100755 >--- a/acqui/addorderiso2709.pl >+++ b/acqui/addorderiso2709.pl >@@ -26,6 +26,7 @@ use CGI qw ( -utf8 ); > use YAML::XS; > use List::MoreUtils; > use Encode; >+use Scalar::Util qw( looks_like_number ); > > use C4::Context; > use C4::Auth qw( get_template_and_user ); >@@ -168,9 +169,7 @@ if ($op eq ""){ > 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') ); >- >+ my $c_price = $input->param( 'price_' . $import_record->import_record_id ); > # Insert the biblio, or find it through matcher > if ( $biblionumber ) { # If matched during staging we can continue > $import_record->status('imported')->store; >@@ -501,7 +500,7 @@ sub import_biblios_list { > my $marcrecord = $import_record->get_marc_record || die "couldn't translate marc information"; > > my $infos = get_infos_syspref('MarcFieldsToOrder', $marcrecord, ['price', 'quantity', 'budget_code', 'discount', 'sort1', 'sort2','replacementprice']); >- my $price = $infos->{price}; >+ my $price = looks_like_number($infos->{price}) ? $infos->{price} : GetMarcPrice( $marcrecord, C4::Context->preference('marcflavour') ); > my $replacementprice = $infos->{replacementprice}; > my $quantity = $infos->{quantity}; > my $budget_code = $infos->{budget_code}; >-- >2.30.2
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 35892
:
161466
|
161467
|
161468
|
162643