Bugzilla – Attachment 93672 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.46 KB, created by
Brendan Gallagher
on 2019-10-04 07:54:19 UTC
(
hide
)
Description:
Bug 20780 - Add handling for AcqItemSetSubfieldsWhenRecieved in EDI
Filename:
MIME Type:
Creator:
Brendan Gallagher
Created:
2019-10-04 07:54:19 UTC
Size:
2.46 KB
patch
obsolete
>From b57a55af798704f02d1db03ff8b73d18136a7dcf 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 > >Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com> >--- > Koha/EDI.pm | 31 ++++++++++++++++++++++++++++++- > 1 file changed, 30 insertions(+), 1 deletion(-) > >diff --git a/Koha/EDI.pm b/Koha/EDI.pm >index 4e730de286..423627e733 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; >@@ -388,6 +388,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 ); >@@ -410,6 +427,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.11.0
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