for @{$po->provider->edi_default->attr_set->attr_maps}
}
- $compiled{buyer_code} =
- $compiled{edi_attrs}->{BUYER_ID_INCLUDE_VENDCODE} ? # B&T
- $compiled{vendor_san}.' '.$po->provider->edi_default->vendcode :
- $po->provider->edi_default->vendacct;
+ $compiled{buyer_code} = $po->provider->edi_default->vendacct;
+
+ $compiled{buyer_code} = # B&T
+ $compiled{vendor_san}.' '.$po->provider->edi_default->vendcode
+ if $compiled{edi_attrs}->{BUYER_ID_INCLUDE_VENDCODE};
+
+ $compiled{buyer_code} = $po->provider->edi_default->vendcode
+ if $compiled{edi_attrs}->{BUYER_ID_ONLY_VENDCODE}; # MLS
push(@{$compiled{lineitems}},
$self->compile_li($_)) for @{$po->lineitems};
# IMD fields should only display the +::: when a value is present
sub IMD {
my ($self, $code, $value) = @_;
+
+ $value = ' ' if (
+ $value eq '' &&
+ $self->{compiled}->{edi_attrs}->{INCLUDE_EMPTY_IMD_VALUES}
+ );
+
if ($value) {
my $s = '';
for my $part ($value =~ m/.{1,70}/g) {
DTM+137:$date:102'
EDI
- $edi .= "NAD+BY+$c{org_unit_san}::31B'\n"
- unless $self->{compiled}->{edi_attrs}->{BUYER_ID_INCLUDE_VENDCODE};
+ $edi .= "NAD+BY+$c{org_unit_san}::31B'\n" unless (
+ $self->{compiled}->{edi_attrs}->{BUYER_ID_ONLY_VENDCODE} ||
+ $self->{compiled}->{edi_attrs}->{BUYER_ID_INCLUDE_VENDCODE}
+ );
$edi .= <<EDI;
NAD+BY+$c{buyer_code}::91'
('BUYER_ID_INCLUDE_VENDCODE',
oils_i18n_gettext('BUYER_ID_INCLUDE_VENDCODE',
'Buyer ID Qualifier Includes Vendcode', 'aea', 'label')),
+ ('BUYER_ID_ONLY_VENDCODE',
+ oils_i18n_gettext('BUYER_ID_ONLY_VENDCODE',
+ 'Buyer ID Qualifier Only Contains Vendcode', 'aea', 'label')),
('INCLUDE_BIB_EDITION',
oils_i18n_gettext('INCLUDE_BIB_EDITION',
'Order Lineitems Include Edition Info', 'aea', 'label')),
('COPY_SPEC_CODES',
oils_i18n_gettext('COPY_SPEC_CODES',
'Order Lineitem Notes Include Copy Spec Codes', 'aea', 'label')),
+ ('INCLUDE_EMPTY_IMD_VALUES',
+ oils_i18n_gettext('INCLUDE_EMPTY_IMD_VALUES',
+ 'Lineitem Title, Author, etc. Fields Are Present Even if Empty', 'aea', 'label')),
('INCLUDE_EMPTY_LI_NOTE',
oils_i18n_gettext('INCLUDE_EMPTY_LI_NOTE',
'Order Lineitem Notes Always Present (Even if Empty)', 'aea', 'label')),
INSERT INTO acq.edi_attr_set (id, label) VALUES (4, 'Midwest Tape Default');
INSERT INTO acq.edi_attr_set (id, label) VALUES (5, 'ULS Default');
INSERT INTO acq.edi_attr_set (id, label) VALUES (6, 'Recorded Books Default');
+INSERT INTO acq.edi_attr_set (id, label) VALUES (7, 'Midwest Library Service');
-- carve out space for mucho defaults
SELECT SETVAL('acq.edi_attr_set_id_seq'::TEXT, 1000);
(6, 'INCLUDE_COLLECTION_CODE'),
(6, 'INCLUDE_OWNING_LIB'),
(6, 'INCLUDE_QUANTITY'),
- (6, 'INCLUDE_BIB_PAGINATION')
+ (6, 'INCLUDE_BIB_PAGINATION'),
+
+ -- Midwest Library Service
+ (7, 'INCLUDE_BIB_AUTHOR'),
+ (7, 'INCLUDE_BIB_EDITION'),
+ (7, 'BUYER_ID_ONLY_VENDCODE'),
+ (7, 'INCLUDE_EMPTY_IMD_VALUES')
+
;
('BUYER_ID_INCLUDE_VENDCODE',
oils_i18n_gettext('BUYER_ID_INCLUDE_VENDCODE',
'Buyer ID Qualifier Includes Vendcode', 'aea', 'label')),
+ ('BUYER_ID_ONLY_VENDCODE',
+ oils_i18n_gettext('BUYER_ID_ONLY_VENDCODE',
+ 'Buyer ID Qualifier Only Contains Vendcode', 'aea', 'label')),
('INCLUDE_BIB_EDITION',
oils_i18n_gettext('INCLUDE_BIB_EDITION',
'Order Lineitems Include Edition Info', 'aea', 'label')),
('COPY_SPEC_CODES',
oils_i18n_gettext('COPY_SPEC_CODES',
'Order Lineitem Notes Include Copy Spec Codes', 'aea', 'label')),
+ ('INCLUDE_EMPTY_IMD_VALUES',
+ oils_i18n_gettext('INCLUDE_EMPTY_IMD_VALUES',
+ 'Lineitem Title, Author, etc. Fields Are Present Even if Empty', 'aea', 'label')),
('INCLUDE_EMPTY_LI_NOTE',
oils_i18n_gettext('INCLUDE_EMPTY_LI_NOTE',
'Order Lineitem Notes Always Present (Even if Empty)', 'aea', 'label')),
INSERT INTO acq.edi_attr_set (id, label) VALUES (4, 'Midwest Tape Default');
INSERT INTO acq.edi_attr_set (id, label) VALUES (5, 'ULS Default');
INSERT INTO acq.edi_attr_set (id, label) VALUES (6, 'Recorded Books Default');
+INSERT INTO acq.edi_attr_set (id, label) VALUES (7, 'Midwest Library Service');
-- carve out space for mucho defaults
SELECT SETVAL('acq.edi_attr_set_id_seq'::TEXT, 1000);
(6, 'INCLUDE_COLLECTION_CODE'),
(6, 'INCLUDE_OWNING_LIB'),
(6, 'INCLUDE_QUANTITY'),
- (6, 'INCLUDE_BIB_PAGINATION')
+ (6, 'INCLUDE_BIB_PAGINATION'),
+
+ -- Midwest Library Service
+ (7, 'INCLUDE_BIB_AUTHOR'),
+ (7, 'INCLUDE_BIB_EDITION'),
+ (7, 'BUYER_ID_ONLY_VENDCODE'),
+ (7, 'INCLUDE_EMPTY_IMD_VALUES')
;