@@ -, +, @@ --- 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(-) --- a/Koha/Edifact/Order.pm +++ a/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 { --- a/admin/edi_accounts.pl +++ a/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 ); --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/edi_accounts.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/edi_accounts.tt @@ -185,6 +185,27 @@ EDI accounts › Administration › Koha +
  • + + +
  • [% IF account.quotes_enabled %] @@ -284,6 +305,7 @@ EDI accounts › Administration › Koha Upload directory Qualifier SAN + Standard Quotes Orders Invoices @@ -311,6 +333,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 %] --