Bugzilla – Attachment 75439 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), 1.98 KB, created by
Martin Renvoize (ashimema)
on 2018-05-18 15:57:17 UTC
(
hide
)
Description:
Bug 20780 - Add handling for AcqItemSetSubfieldsWhenRecieved in EDI
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2018-05-18 15:57:17 UTC
Size:
1.98 KB
patch
obsolete
>From f496a51006f8ae0311b846dbb193bbd6ff61fda0 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 | 29 +++++++++++++++++++++++++++++ > 1 file changed, 29 insertions(+) > >diff --git a/Koha/EDI.pm b/Koha/EDI.pm >index fcf352c6f8..bb1c9eb242 100644 >--- a/Koha/EDI.pm >+++ b/Koha/EDI.pm >@@ -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