Skip to content

Commit

Permalink
Add ability to store and transmit Buyer SAN for a given Library EAN i…
Browse files Browse the repository at this point in the history
…n the Library EAN description
  • Loading branch information
John Doe committed Jan 18, 2024
1 parent e920d86 commit 9f25d11
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Koha/Plugin/Com/ByWaterSolutions/EdifactEnhanced.pm
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,7 @@ sub configure {
buyer_san => $self->retrieve_data('buyer_san'),
buyer_san_use_username => $self->retrieve_data('buyer_san_use_username'),
buyer_san_use_library_ean_split_first_part => $self->retrieve_data('buyer_san_use_library_ean_split_first_part'),
buyer_san_extract_from_library_ean_description => $self->retrieve_data('buyer_san_extract_from_library_ean_description'),
gir_mapping => $self->retrieve_data('gir_mapping'),
gir_value_replacements_map => $self->retrieve_data('gir_value_replacements_map'),
gir_disable => $self->retrieve_data('gir_disable'),
Expand Down Expand Up @@ -604,6 +605,7 @@ sub configure {
buyer_san => $cgi->param('buyer_san') || q{},
buyer_san_use_username => $cgi->param('buyer_san_use_username') ? 1 : 0,
buyer_san_use_library_ean_split_first_part => $cgi->param('buyer_san_use_library_ean_split_first_part') ? 1 : 0,
buyer_san_extract_from_library_ean_description => $cgi->param('buyer_san_extract_from_library_ean_description') ? 1 : 0,
gir_mapping => $cgi->param('gir_mapping') || q{},
gir_value_replacements_map => $cgi->param('gir_value_replacements_map') || q{},
split_gir => $cgi->param('split_gir') || '0',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,16 @@ sub interchange_header {
# Interchange Sender

# If plugin is set to send Buyer SAN in header *and* the vendor username as buyer SAN is set, send that
if ( $self->{plugin}->retrieve_data('buyer_san_in_header') && $self->{plugin}->retrieve_data('buyer_san_use_username') ) {
# If plugin is set to send Buyer SAN in header *and* the buyer sand should come from the library ean description
if ( $self->{plugin}->retrieve_data('buyer_san_in_header') && $self->{plugin}->retrieve_data('buyer_san_extract_from_library_ean_description') ) {
$self->{sender}->description =~ m/SAN:{(.*)}/;
my $ean = $1;
$hdr .= _interchange_sr_identifier(
$ean,
$self->{plugin}->retrieve_data('buyer_id_code_qualifier')
); # interchange sender
# If plugin is set to send Buyer SAN in header *and* the vendor username as buyer SAN is set, send that
} elsif ( $self->{plugin}->retrieve_data('buyer_san_in_header') && $self->{plugin}->retrieve_data('buyer_san_use_username') ) {
$hdr .= _interchange_sr_identifier(
$self->{recipient}->username,
$self->{plugin}->retrieve_data('buyer_id_code_qualifier')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,14 @@ function check_if_buyer_san_use_library_ean_split_first_part() {
</li>
<li>
<input type="checkbox" name="buyer_san_use_library_ean_split_first_part" id="buyer_san_use_library_ean_split_first_part" [% IF buyer_san_use_library_ean_split_first_part %]checked="checked"[% END %] />
<span class="hint">Split the Library EAN on spaces and use the left-most part. Works for value in header only, not implemented for use in NAD+BY.</span>
<span class="hint">Split the Library EAN on spaces and use the left-most part. Works for value in header only, not implemented for use in NAD+BY.</span>
<label for="buyer_san_use_library_ean_split_first_part">Use split Library EAN</span>
</li>
<li>
<input type="checkbox" name="buyer_san_extract_from_library_ean_description" id="buyer_san_extract_from_library_ean_description" [% IF buyer_san_extract_from_library_ean_description %]checked="checked"[% END %] />
<span class="hint">Extract the Buyer SAN from the Library EAN description in the form "SAN:{123456789}"</span>
<label for="buyer_san_extract_from_library_ean_description">Extract from Library EAN</span>
</li>

<fieldset class="rows">
<legend>Fields to send in</legend>
Expand Down

0 comments on commit 9f25d11

Please sign in to comment.