LP#1513872 support copy barcode GIR+LAC field
authorBill Erickson <berickxx@gmail.com>
Wed, 2 Nov 2016 19:16:13 +0000 (15:16 -0400)
committerBill Erickson <berickxx@gmail.com>
Wed, 2 Nov 2016 19:16:13 +0000 (15:16 -0400)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/perlmods/lib/OpenILS/Utils/EDIWriter.pm
Open-ILS/src/sql/Pg/950.data.seed-values.sql
Open-ILS/src/sql/Pg/upgrade/YYYY.data.edi_attr_set.sql

index 412cb8c..613693a 100644 (file)
@@ -288,6 +288,8 @@ sub compile_copy {
     my $owning_lib = $copy->owning_lib ? $copy->owning_lib->shortname : '';
     my $location = $copy->location ? $copy->location->name : '';
     my $collection_code = $copy->collection_code || '';
+    my $barcode = $copy->barcode || '';
+
    
     # When an ACQ copy links to a real copy (acp), treat the real
     # copy as authoritative for certain fields.
@@ -311,6 +313,7 @@ sub compile_copy {
                 ($call_number eq $e_copy->{call_number}) &&
                 ($owning_lib eq $e_copy->{owning_lib}) &&
                 ($location eq $e_copy->{location}) &&
+                ($barcode eq $e_copy->{barcode}) &&
                 ($collection_code eq $e_copy->{collection_code})
             ) {
                 $e_copy->{quantity}++;
@@ -331,6 +334,7 @@ sub compile_copy {
         call_number => $self->escape_edi($call_number),
         owning_lib => $self->escape_edi($owning_lib),
         location => $self->escape_edi($location),
+        barcode => $self->escape_edi($barcode),
         collection_code => $self->escape_edi($collection_code),
         copy_id => $copy->id, # for INCLUDE_COPY_ID
         quantity => 1
@@ -512,6 +516,9 @@ my @gir_fields = (
         field => 'location', 
         attr => 'INCLUDE_LOCATION',
         empty_attr => 'INCLUDE_EMPTY_LOCATION'},
+    {   code => 'LAC',
+        field => 'barcode',
+        attr => 'INCLUDE_ITEM_BARCODE'},
     {   code => 'LQT', 
         field => 'quantity', 
         attr => 'INCLUDE_QUANTITY'}
index 2cd85c6..20ceaa9 100644 (file)
@@ -16481,6 +16481,9 @@ INSERT INTO acq.edi_attr (key, label) VALUES
     ('INCLUDE_ITEM_TYPE', 
         oils_i18n_gettext('INCLUDE_ITEM_TYPE', 
         'Orders Include Copy Item Types', 'aea', 'label')),
+    ('INCLUDE_ITEM_BARCODE',
+        oils_i18n_gettext('INCLUDE_ITEM_BARCODE',
+        'Orders Include Copy Barcodes', 'aea', 'label')),
     ('INCLUDE_LOCATION', 
         oils_i18n_gettext('INCLUDE_LOCATION', 
         'Orders Include Copy Locations', 'aea', 'label')),
index d1a5d26..7bb42f6 100644 (file)
@@ -18,6 +18,9 @@ INSERT INTO acq.edi_attr (key, label) VALUES
     ('INCLUDE_ITEM_TYPE', 
         oils_i18n_gettext('INCLUDE_ITEM_TYPE', 
         'Orders Include Copy Item Types', 'aea', 'label')),
+    ('INCLUDE_ITEM_BARCODE',
+        oils_i18n_gettext('INCLUDE_ITEM_BARCODE',
+        'Orders Include Copy Barcodes', 'aea', 'label')),
     ('INCLUDE_LOCATION', 
         oils_i18n_gettext('INCLUDE_LOCATION', 
         'Orders Include Copy Locations', 'aea', 'label')),