Bugzilla – Attachment 173825 Details for
Bug 34355
Automated MARC record ordering process
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34355: (QA follow-up) Respect AcqCreateItem syspref
Bug-34355-QA-follow-up-Respect-AcqCreateItem-syspr.patch (text/plain), 7.70 KB, created by
Matt Blenkinsop
on 2024-10-31 16:59:44 UTC
(
hide
)
Description:
Bug 34355: (QA follow-up) Respect AcqCreateItem syspref
Filename:
MIME Type:
Creator:
Matt Blenkinsop
Created:
2024-10-31 16:59:44 UTC
Size:
7.70 KB
patch
obsolete
>From 59acc071ee573ee8a3281c09e8b8a83bb435c01b Mon Sep 17 00:00:00 2001 >From: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> >Date: Thu, 31 Oct 2024 16:59:05 +0000 >Subject: [PATCH] Bug 34355: (QA follow-up) Respect AcqCreateItem syspref > >--- > Koha/MarcOrder.pm | 82 +++++++++++++------------- > misc/cronjobs/marc_ordering_process.pl | 2 +- > 2 files changed, 42 insertions(+), 42 deletions(-) > >diff --git a/Koha/MarcOrder.pm b/Koha/MarcOrder.pm >index c043727ba71..84ac5345443 100644 >--- a/Koha/MarcOrder.pm >+++ b/Koha/MarcOrder.pm >@@ -869,7 +869,8 @@ sub parse_input_into_order_line_fields { > my @enumchrons = $fields->{enumchrons} ? @{ $fields->{enumchrons} } : (); > my @budget_codes = $fields->{budget_codes} ? @{ $fields->{budget_codes} } : (); > my $c_quantity = $fields->{c_quantity}; >- my $c_budget_code = $fields->{c_budget_code}; >+ my $c_budget = GetBudgetByCode( $fields->{c_budget_code} ); >+ my $c_budget_code = $c_budget->{budget_id}; > my $c_discount = $fields->{c_discount}; > my $c_sort1 = $fields->{c_sort1}; > my $c_sort2 = $fields->{c_sort2}; >@@ -919,18 +920,15 @@ sub parse_input_into_order_line_fields { > c_replacement_price => $c_replacement_price, > c_price => $c_price, > marcrecord => $marcrecord, >+ tags => $fields->{tags}, >+ subfields => $fields->{subfields}, >+ field_values => $fields->{field_values}, >+ serials => $fields->{serials}, >+ order_vendornote => $fields->{order_vendornote}, >+ order_internalnote => $fields->{order_internalnote}, >+ all_currency => $fields->{all_currency}, > }; > >- if ($client) { >- $order_line_fields->{tags} = $fields->{tags}; >- $order_line_fields->{subfields} = $fields->{subfields}; >- $order_line_fields->{field_values} = $fields->{field_values}; >- $order_line_fields->{serials} = $fields->{serials}; >- $order_line_fields->{order_vendornote} = $fields->{order_vendornote}; >- $order_line_fields->{order_internalnote} = $fields->{order_internalnote}; >- $order_line_fields->{all_currency} = $fields->{all_currency}; >- } >- > return $order_line_fields; > } > >@@ -962,30 +960,32 @@ sub create_items_and_generate_order_hash { > my $itemcreation = 0; > my @itemnumbers; > >- for ( my $i = 0 ; $i < $loop_limit ; $i++ ) { >- $itemcreation = 1; >- my $item = Koha::Item->new( >- { >- biblionumber => $fields->{biblionumber}, >- homebranch => @{ $fields->{homebranch} }[$i], >- holdingbranch => @{ $fields->{holdingbranch} }[$i], >- itemnotes_nonpublic => @{ $fields->{itemnotes_nonpublic} }[$i], >- itemnotes => @{ $fields->{itemnotes} }[$i], >- location => @{ $fields->{location} }[$i], >- ccode => @{ $fields->{ccode} }[$i], >- itype => @{ $fields->{itype} }[$i], >- notforloan => @{ $fields->{notforloan} }[$i], >- uri => @{ $fields->{uri} }[$i], >- copynumber => @{ $fields->{copynumber} }[$i], >- price => @{ $fields->{price} }[$i], >- replacementprice => @{ $fields->{replacementprice} }[$i], >- itemcallnumber => @{ $fields->{itemcallnumber} }[$i], >- coded_location_qualifier => @{ $fields->{coded_location_qualifier} }[$i], >- barcode => @{ $fields->{barcode} }[$i], >- enumchron => @{ $fields->{enumchron} }[$i], >- } >- )->store; >- push( @itemnumbers, $item->itemnumber ); >+ if( C4::Context->preference('AcqCreateItem') ne 'cataloguing' ) { >+ for ( my $i = 0 ; $i < $loop_limit ; $i++ ) { >+ $itemcreation = 1; >+ my $item = Koha::Item->new( >+ { >+ biblionumber => $fields->{biblionumber}, >+ homebranch => @{ $fields->{homebranch} }[$i], >+ holdingbranch => @{ $fields->{holdingbranch} }[$i], >+ itemnotes_nonpublic => @{ $fields->{itemnotes_nonpublic} }[$i], >+ itemnotes => @{ $fields->{itemnotes} }[$i], >+ location => @{ $fields->{location} }[$i], >+ ccode => @{ $fields->{ccode} }[$i], >+ itype => @{ $fields->{itype} }[$i], >+ notforloan => @{ $fields->{notforloan} }[$i], >+ uri => @{ $fields->{uri} }[$i], >+ copynumber => @{ $fields->{copynumber} }[$i], >+ price => @{ $fields->{price} }[$i], >+ replacementprice => @{ $fields->{replacementprice} }[$i], >+ itemcallnumber => @{ $fields->{itemcallnumber} }[$i], >+ coded_location_qualifier => @{ $fields->{coded_location_qualifier} }[$i], >+ barcode => @{ $fields->{barcode} }[$i], >+ enumchron => @{ $fields->{enumchron} }[$i], >+ } >+ )->store; >+ push( @itemnumbers, $item->itemnumber ); >+ } > } > > if ( $itemcreation == 1 ) { >@@ -1106,12 +1106,12 @@ sub create_items_and_generate_order_hash { > $order->store; > > my $basket = Koha::Acquisition::Baskets->find($basket_id); >- if ( $basket->effective_create_items eq 'ordering' && !$basket->is_standing ) { >- my @tags = @{ $fields->{tags} }; >- my @subfields = @{ $fields->{subfields} }; >- my @field_values = @{ $fields->{field_values} }; >- my @serials = @{ $fields->{serials} }; >- my $xml = TransformHtmlToXml( \@tags, \@subfields, \@field_values ); >+ if ( C4::Context->preference('AcqCreateItem') ne 'cataloguing' && $basket->effective_create_items eq 'ordering' && !$basket->is_standing ) { >+ my $tags = $fields->{tags} || []; >+ my $subfields = $fields->{subfields} || []; >+ my $field_values = $fields->{field_values} || []; >+ my $serials = $fields->{serials} || []; >+ my $xml = TransformHtmlToXml( $tags, $subfields, $field_values ); > my $record = MARC::Record::new_from_xml( $xml, 'UTF-8' ); > for ( my $qtyloop = 1 ; $qtyloop <= $fields->{c_quantity} ; $qtyloop++ ) { > my ( $biblionumber, undef, $itemnumber ) = >diff --git a/misc/cronjobs/marc_ordering_process.pl b/misc/cronjobs/marc_ordering_process.pl >index afe41c8c7d3..ac2e6006d06 100755 >--- a/misc/cronjobs/marc_ordering_process.pl >+++ b/misc/cronjobs/marc_ordering_process.pl >@@ -132,7 +132,7 @@ foreach my $acct (@accounts) { > } else { > mkdir "$working_dir/archive" unless -d "$working_dir/archive"; > say sprintf "Moving file to archive: %s", $filename if $verbose; >- move( $full_path, "$working_dir/archive/$filename" ); >+ # move( $full_path, "$working_dir/archive/$filename" ); > } > } else { > say sprintf "Error processing file: %s", $filename if $verbose; >-- >2.39.3 (Apple Git-146)
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 34355
:
154705
|
154706
|
154707
|
154708
|
154709
|
154710
|
157092
|
157093
|
157094
|
157095
|
157096
|
157097
|
157098
|
157099
|
157100
|
160858
|
160859
|
160860
|
160861
|
160862
|
160863
|
160864
|
160865
|
160866
|
160867
|
160868
|
160869
|
160870
|
160871
|
160872
|
160873
|
160874
|
160875
|
169896
|
169897
|
169898
|
169899
|
169900
|
169901
|
169902
|
169903
|
169904
|
170395
|
170401
|
170402
|
170403
|
170404
|
170405
|
170406
|
170407
|
170408
|
170409
|
173054
|
173055
|
173056
|
173057
|
173058
|
173059
|
173060
|
173061
|
173062
|
173063
|
173064
|
173065
|
173066
|
173709
|
173805
|
173806
|
173809
|
173824
|
173825
|
173993
|
173994
|
173995
|
173996
|
173997
|
173998
|
173999
|
174000
|
174001
|
174002
|
174003
|
174004
|
174005
|
174006
|
174007
|
174008
|
174009
|
174010
|
174362
|
174363
|
174364
|
174365
|
174366
|
174367
|
174368
|
174369
|
174370
|
174371
|
174372
|
174373
|
174374
|
174375
|
174376
|
174377
|
174378
|
174379
|
174380
|
174382
|
174383