Bugzilla – Attachment 75440 Details for
Bug 20780
EDI: Add support for 'AcqItemSetSubfieldsWhenReceived'
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20780 - Add handling for AcqItemSetSubfieldsWhenRecieved in EDI
Bug-20780---Add-handling-for-AcqItemSetSubfieldsWh.patch (text/plain), 2.39 KB, created by
Martin Renvoize (ashimema)
on 2018-05-18 16:34:18 UTC
(
hide
)
Description:
Bug 20780 - Add handling for AcqItemSetSubfieldsWhenRecieved in EDI
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2018-05-18 16:34:18 UTC
Size:
2.39 KB
patch
obsolete
>From 29d6d3e848bde92092a3fa1c6fa0d0f43d098fb0 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Fri, 18 May 2018 16:56:26 +0100 >Subject: [PATCH] Bug 20780 - Add handling for AcqItemSetSubfieldsWhenRecieved > in EDI > >--- > Koha/EDI.pm | 31 ++++++++++++++++++++++++++++++- > 1 file changed, 30 insertions(+), 1 deletion(-) > >diff --git a/Koha/EDI.pm b/Koha/EDI.pm >index fcf352c6f8..270a51a350 100644 >--- a/Koha/EDI.pm >+++ b/Koha/EDI.pm >@@ -30,7 +30,7 @@ use Koha::Database; > use C4::Acquisition qw( NewBasket CloseBasket ModOrder); > use C4::Suggestions qw( ModSuggestion ); > use C4::Items qw(AddItem); >-use C4::Biblio qw( AddBiblio TransformKohaToMarc GetMarcBiblio ); >+use C4::Biblio qw( AddBiblio TransformKohaToMarc GetMarcBiblio GetFrameworkCode GetMarcFromKohaField ); > use Koha::Edifact::Order; > use Koha::Edifact; > use Log::Log4perl; >@@ -378,6 +378,23 @@ sub receipt_items { > } > push @{ $branch_map{$b} }, $item; > } >+ >+ # Handling for 'AcqItemSetSubfieldsWhenReceived' >+ my @affects; >+ my $biblionumber; >+ my $itemfield; >+ if ( C4::Context->preference('AcqCreateItem') eq 'ordering' ) { >+ @affects = split q{\|}, >+ C4::Context->preference("AcqItemSetSubfieldsWhenReceived"); >+ if (@affects) { >+ $biblionumber = $schema->resultset('Aqorder')->find($ordernumber) >+ ->biblionumber->biblionumber; >+ my $frameworkcode = GetFrameworkCode($biblionumber); >+ ($itemfield) = GetMarcFromKohaField( 'items.itemnumber', >+ $frameworkcode ); >+ } >+ } >+ > my $gir_occurrence = 0; > while ( $gir_occurrence < $quantity ) { > my $branch = $inv_line->girfield( 'branch', $gir_occurrence ); >@@ -400,6 +417,18 @@ sub receipt_items { > } > } > >+ # Handling for 'AcqItemSetSubfieldsWhenReceived' >+ if (@affects) { >+ my $item_marc = C4::Items::GetMarcItem( $biblionumber, $item->itemnumber ); >+ for my $affect (@affects) { >+ my ( $sf, $v ) = split q{=}, $affect, 2; >+ foreach ( $item_marc->field($itemfield) ) { >+ $_->update( $sf => $v ); >+ } >+ } >+ C4::Items::ModItemFromMarc( $item_marc, $biblionumber, $item->itemnumber ); >+ } >+ > $item->update; > } > else { >-- >2.14.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 20780
:
75439
|
75440
|
81730
|
81731
|
93672
|
93673
|
93946
|
93947