From a2f336fe1e10aa27b27a2465f611c17befff3a95 Mon Sep 17 00:00:00 2001 From: Colin Campbell Date: Thu, 25 Feb 2021 10:59:24 +0000 Subject: [PATCH] Bug 27793: Store FTX free text in vendor note This is important for proquest ordering to distinguish types of material. FTX segment from quote is stored as vendor note. Contents of vendornote are included in the order FTX segment. Signed-off-by: Kyle M Hall --- Koha/EDI.pm | 6 ++++-- Koha/Edifact/Order.pm | 13 ++++++++----- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/Koha/EDI.pm b/Koha/EDI.pm index 2de2b8bf08..da7ce85fd0 100644 --- a/Koha/EDI.pm +++ b/Koha/EDI.pm @@ -685,7 +685,7 @@ sub quote_item { quantity => $order_quantity, quantityreceived => 0, order_vendornote => q{}, - order_internalnote => $order_note, + order_internalnote => q{}, replacementprice => $price, rrp_tax_included => $price, rrp_tax_excluded => $price, @@ -724,7 +724,9 @@ sub quote_item { $txt .= $si; ++$occ; } - $order_hash->{order_vendornote} = $txt; + } + if ($order_note) { + $order_hash->{order_vendornote} = $order_note; } if ( $item->internal_notes() ) { diff --git a/Koha/Edifact/Order.pm b/Koha/Edifact/Order.pm index b5434872ae..e501461407 100644 --- a/Koha/Edifact/Order.pm +++ b/Koha/Edifact/Order.pm @@ -404,9 +404,6 @@ sub order_line { } my $budget = GetBudget( $orderline->budget_id ); my $ol_fields = { budget_code => $budget->{budget_code}, }; - if ( $orderline->order_vendornote ) { - $ol_fields->{servicing_instruction} = $orderline->order_vendornote; - } my $item_fields = []; for my $item (@items) { push @{$item_fields}, @@ -428,8 +425,14 @@ sub order_line { # TBD what if #items exceeds quantity - # FTX free text for current orderline TBD - # dont really have a special instructions field to encode here + # FTX free text for current orderline + # Pass vendor note in FTX free text segment + if ( $orderline->order_vendornote ) { + my $ftx = 'FTX+LIN+++'; + $ftx .= $orderline->order_vendornote; + $ftx .= $seg_terminator; + $self->add_seg($ftx); + } # Encode notes here # PRI-CUX-DTM unit price on which order is placed : optional # Coutts read this as 0.00 if not present -- 2.24.1 (Apple Git-126)