From 81dad7f7d0d876f556c3d956fe3c399d130d69b3 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Mon, 21 Feb 2022 16:25:24 +0000 Subject: [PATCH] Bug 30130: Use new standard field in account definition This patch uses the new 'standard' field to in the edifact account configuration area to allow setting the message standard as either 'EDItEUR' or 'BiC'. This just replaces the currently hard coded hash of SAN's in Koha::Edifact::Order to distinguish between the two standards instead of requireing a bug submission per vender san we identify to be a BiC type vendor. Signed-off-by: Katrin Fischer Signed-off-by: Nick Clemens --- Koha/Edifact/Order.pm | 20 +++++----------- admin/edi_accounts.pl | 4 +++- .../prog/en/modules/admin/edi_accounts.tt | 23 +++++++++++++++++++ 3 files changed, 32 insertions(+), 15 deletions(-) diff --git a/Koha/Edifact/Order.pm b/Koha/Edifact/Order.pm index f21a7a8b76..548c62c429 100644 --- a/Koha/Edifact/Order.pm +++ b/Koha/Edifact/Order.pm @@ -263,7 +263,7 @@ sub order_msg_header { push @header, beginning_of_message( $self->{basket}->basketno, - $self->{recipient}->san, + $self->{recipient}->standard, $self->{is_response} ); @@ -297,29 +297,21 @@ sub order_msg_header { sub beginning_of_message { my $basketno = shift; - my $supplier_san = shift; + my $standard = shift; my $response = shift; my $document_message_no = sprintf '%011d', $basketno; - # Peters & Bolinda use the BIC recommendation to use 22V a code not in Edifact - # If the order is in response to a quote - my %bic_sans = ( - '5013546025065' => 'Peters', - '9377779308820' => 'Bolinda', - ); - # my $message_function = 9; # original 7 = retransmission # message_code values - # 220 prder + # 220 order # 224 rush order # 228 sample order :: order for approval / inspection copies # 22C continuation order for volumes in a set etc. # my $message_code = '220'; - if ( exists $bic_sans{$supplier_san} && $response ) { - return "BGM+22V+$document_message_no+9$seg_terminator"; - } - return "BGM+220+$document_message_no+9$seg_terminator"; + # If the order is in response to a quote and we're dealing with a BIC supplier + my $code = ( $response && ( $standard eq 'BIC' ) ) ? '22V' : '220'; + return "BGM+$code+$document_message_no+9$seg_terminator"; } sub name_and_address { diff --git a/admin/edi_accounts.pl b/admin/edi_accounts.pl index 293f7ef666..9f1be0bf20 100755 --- a/admin/edi_accounts.pl +++ b/admin/edi_accounts.pl @@ -76,6 +76,7 @@ else { upload_directory => scalar $input->param('upload_directory'), download_directory => scalar $input->param('download_directory'), san => scalar $input->param('san'), + standard => scalar $input->param('standard'), transport => scalar $input->param('transport'), quotes_enabled => $input->param('quotes_enabled') ? 1 : 0, invoices_enabled => $input->param('invoices_enabled') ? 1 : 0, @@ -133,7 +134,8 @@ $template->param( code => '92', description => 'Assigned by buyer', }, - ] + ], + standards => [ 'BIC', 'EUR' ] ); output_html_with_http_headers( $input, $cookie, $template->output ); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/edi_accounts.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/edi_accounts.tt index e2da7795ba..6c0955ed05 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/edi_accounts.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/edi_accounts.tt @@ -193,6 +193,27 @@ EDI accounts › Administration › Koha +
  • + + +
  • [% IF account.quotes_enabled %] @@ -292,6 +313,7 @@ EDI accounts › Administration › Koha Upload directory Qualifier SAN + Standard Quotes Orders Invoices @@ -319,6 +341,7 @@ EDI accounts › Administration › Koha ([% account.id_code_qualifier | html %]) [% account.san | html %] + [% IF account.standard == 'BIC' %]BiC[% ELSE %]EDItEUR[% END %] [% IF account.quotes_enabled %] Yes [% ELSE %] -- 2.30.2