View | Details | Raw Unified | Return to bug 30135
Collapse All | Expand All

(-)a/Koha/EDI.pm (-7 / +10 lines)
Lines 869-876 sub quote_item { Link Here
869
                    my $new_item = {
869
                    my $new_item = {
870
                        itype =>
870
                        itype =>
871
                          $item->girfield( 'stock_category', $occurrence ),
871
                          $item->girfield( 'stock_category', $occurrence ),
872
                        location =>
873
                          $item->girfield( 'collection_code', $occurrence ),
874
                        itemcallnumber =>
872
                        itemcallnumber =>
875
                          $item->girfield( 'shelfmark', $occurrence )
873
                          $item->girfield( 'shelfmark', $occurrence )
876
                          || $item->girfield( 'classification', $occurrence )
874
                          || $item->girfield( 'classification', $occurrence )
Lines 879-889 sub quote_item { Link Here
879
                          $item->girfield( 'branch', $occurrence ),
877
                          $item->girfield( 'branch', $occurrence ),
880
                        homebranch => $item->girfield( 'branch', $occurrence ),
878
                        homebranch => $item->girfield( 'branch', $occurrence ),
881
                    };
879
                    };
880
881
                    my $lsq_field = C4::Context->preference('EdifactLSQ');
882
                    $new_item->{$lsq_field} = $item->girfield( 'sequence_code', $occurrence );
883
882
                    if ( $new_item->{itype} ) {
884
                    if ( $new_item->{itype} ) {
883
                        $item_hash->{itype} = $new_item->{itype};
885
                        $item_hash->{itype} = $new_item->{itype};
884
                    }
886
                    }
885
                    if ( $new_item->{location} ) {
887
                    if ( $new_item->{$lsq_field} ) {
886
                        $item_hash->{location} = $new_item->{location};
888
                        $item_hash->{$lsq_field} = $new_item->{$lsq_field};
887
                    }
889
                    }
888
                    if ( $new_item->{itemcallnumber} ) {
890
                    if ( $new_item->{itemcallnumber} ) {
889
                        $item_hash->{itemcallnumber} =
891
                        $item_hash->{itemcallnumber} =
Lines 957-964 sub quote_item { Link Here
957
                        replacementprice => $price,
959
                        replacementprice => $price,
958
                        itype =>
960
                        itype =>
959
                          $item->girfield( 'stock_category', $occurrence ),
961
                          $item->girfield( 'stock_category', $occurrence ),
960
                        location =>
961
                          $item->girfield( 'collection_code', $occurrence ),
962
                        itemcallnumber =>
962
                        itemcallnumber =>
963
                          $item->girfield( 'shelfmark', $occurrence )
963
                          $item->girfield( 'shelfmark', $occurrence )
964
                          || $item->girfield( 'classification', $occurrence )
964
                          || $item->girfield( 'classification', $occurrence )
Lines 967-972 sub quote_item { Link Here
967
                          $item->girfield( 'branch', $occurrence ),
967
                          $item->girfield( 'branch', $occurrence ),
968
                        homebranch => $item->girfield( 'branch', $occurrence ),
968
                        homebranch => $item->girfield( 'branch', $occurrence ),
969
                    };
969
                    };
970
                    my $lsq_field = C4::Context->preference('EdifactLSQ');
971
                    $new_item->{$lsq_field} = $item->girfield( 'sequence_code', $occurrence );
970
                    $new_item->{biblionumber} = $bib->{biblionumber};
972
                    $new_item->{biblionumber} = $bib->{biblionumber};
971
                    $new_item->{biblioitemnumber} = $bib->{biblioitemnumber};
973
                    $new_item->{biblioitemnumber} = $bib->{biblioitemnumber};
972
                    my $kitem = Koha::Item->new( $new_item )->store;
974
                    my $kitem = Koha::Item->new( $new_item )->store;
Lines 1173-1179 sub _create_item_from_quote { Link Here
1173
    $item_hash->{booksellerid} = $quote->vendor_id;
1175
    $item_hash->{booksellerid} = $quote->vendor_id;
1174
    $item_hash->{price}        = $item_hash->{replacementprice} = $item->price;
1176
    $item_hash->{price}        = $item_hash->{replacementprice} = $item->price;
1175
    $item_hash->{itype}        = $item->girfield('stock_category');
1177
    $item_hash->{itype}        = $item->girfield('stock_category');
1176
    $item_hash->{location}     = $item->girfield('collection_code');
1178
    my $lsq_field = C4::Context->preference('EdifactLSQ');
1179
    $item_hash->{$lsq_field}     = $item->girfield('sequence_code');
1177
1180
1178
    my $note = {};
1181
    my $note = {};
1179
1182
(-)a/Koha/Edifact/Line.pm (-1 / +1 lines)
Lines 686-692 sub extract_gir { Link Here
686
        LQT => 'part_order_quantity',
686
        LQT => 'part_order_quantity',
687
        LRS => 'record_sublocation',
687
        LRS => 'record_sublocation',
688
        LSM => 'shelfmark',
688
        LSM => 'shelfmark',
689
        LSQ => 'collection_code',
689
        LSQ => 'sequence_code',
690
        LST => 'stock_category',
690
        LST => 'stock_category',
691
        LSZ => 'size_code',
691
        LSZ => 'size_code',
692
        LVC => 'coded_servicing_instruction',
692
        LVC => 'coded_servicing_instruction',
(-)a/Koha/Edifact/Order.pm (-5 / +7 lines)
Lines 381-397 sub order_line { Link Here
381
    # DTM Optional date constraints on delivery
381
    # DTM Optional date constraints on delivery
382
    #     we dont currently support this in koha
382
    #     we dont currently support this in koha
383
    # GIR copy-related data
383
    # GIR copy-related data
384
    my $lsq_field = C4::Context->preference('EdifactLSQ');
384
    my @items;
385
    my @items;
385
    if ( $basket->effective_create_items eq 'ordering' ) {
386
    if ( $basket->effective_create_items eq 'ordering' ) {
386
        my @linked_itemnumbers = $orderline->aqorders_items;
387
387
388
        my @linked_itemnumbers = $orderline->aqorders_items;
388
        foreach my $item (@linked_itemnumbers) {
389
        foreach my $item (@linked_itemnumbers) {
389
            my $i_obj = $schema->resultset('Item')->find( $item->itemnumber );
390
            my $i_obj = $schema->resultset('Item')->find( $item->itemnumber );
390
            if ( defined $i_obj ) {
391
            if ( defined $i_obj ) {
391
                push @items, {
392
                push @items, {
392
                    branchcode     => $i_obj->get_column('homebranch'),
393
                    branchcode     => $i_obj->get_column('homebranch'),
393
                    itype          => $i_obj->effective_itemtype,
394
                    itype          => $i_obj->effective_itemtype,
394
                    location       => $i_obj->location,
395
                    $lsq_field     => $i_obj->$lsq_field,
395
                    itemcallnumber => $i_obj->itemcallnumber,
396
                    itemcallnumber => $i_obj->itemcallnumber,
396
                };
397
                };
397
            }
398
            }
Lines 419-425 sub order_line { Link Here
419
          {
420
          {
420
            branchcode     => $item->{branchcode},
421
            branchcode     => $item->{branchcode},
421
            itype          => $item->{itype},
422
            itype          => $item->{itype},
422
            location       => $item->{location},
423
            $lsq_field     => $item->{$lsq_field},
423
            itemcallnumber => $item->{itemcallnumber},
424
            itemcallnumber => $item->{itemcallnumber},
424
          };
425
          };
425
    }
426
    }
Lines 551-556 sub gir_segments { Link Here
551
    my $budget_code = $orderfields->{budget_code};
552
    my $budget_code = $orderfields->{budget_code};
552
    my @segments;
553
    my @segments;
553
    my $sequence_no = 1;
554
    my $sequence_no = 1;
555
    my $lsq_field = C4::Context->preference('EdifactLSQ');
554
    foreach my $item (@onorderitems) {
556
    foreach my $item (@onorderitems) {
555
        my $elements_added = 0;
557
        my $elements_added = 0;
556
        my @gir_elements;
558
        my @gir_elements;
Lines 566-574 sub gir_segments { Link Here
566
            push @gir_elements,
568
            push @gir_elements,
567
              { identity_number => 'LST', data => $item->{itype} };
569
              { identity_number => 'LST', data => $item->{itype} };
568
        }
570
        }
569
        if ( $item->{location} ) {
571
        if ( $item->{$lsq_field} ) {
570
            push @gir_elements,
572
            push @gir_elements,
571
              { identity_number => 'LSQ', data => $item->{location} };
573
              { identity_number => 'LSQ', data => $item->{$lsq_field} };
572
        }
574
        }
573
        if ( $item->{itemcallnumber} ) {
575
        if ( $item->{itemcallnumber} ) {
574
            push @gir_elements,
576
            push @gir_elements,
(-)a/installer/data/mysql/atomicupdate/bug_30135.pl (+14 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number => "30135",
5
    description => "Add EdifactLSQ mapping system preference",
6
    up => sub {
7
        my ($args) = @_;
8
        my ($dbh, $out) = @$args{qw(dbh out)};
9
        $dbh->do(q{
10
            INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES
11
            ('EdifactLSQ', 'location', 'location|ccode', "Map EDI sequence code (GIR+LSQ) to Koha Item field', 'Choice')
12
        });
13
    },
14
};
(-)a/installer/data/mysql/mandatory/sysprefs.sql (+1 lines)
Lines 187-192 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
187
('DumpTemplateVarsOpac',  '0', NULL ,  'If enabled, dump all Template Toolkit variable to a comment in the html source for the opac.',  'YesNo'),
187
('DumpTemplateVarsOpac',  '0', NULL ,  'If enabled, dump all Template Toolkit variable to a comment in the html source for the opac.',  'YesNo'),
188
('EasyAnalyticalRecords','0','','If on, display in the catalogue screens tools to easily setup analytical record relationships','YesNo'),
188
('EasyAnalyticalRecords','0','','If on, display in the catalogue screens tools to easily setup analytical record relationships','YesNo'),
189
('EdifactInvoiceImport', 'automatic', 'automatic|manual', "If on, don't auto-import EDI invoices, just keep them in the database with the status 'new'", 'Choice'),
189
('EdifactInvoiceImport', 'automatic', 'automatic|manual', "If on, don't auto-import EDI invoices, just keep them in the database with the status 'new'", 'Choice'),
190
('EdifactLSQ', 'location', 'location|ccode', "Map EDI sequence code (GIR+LSQ) to Koha Item field', 'Choice'),
190
('ElasticsearchIndexStatus_authorities', '0', 'Authorities index status', NULL, NULL),
191
('ElasticsearchIndexStatus_authorities', '0', 'Authorities index status', NULL, NULL),
191
('ElasticsearchIndexStatus_biblios', '0', 'Biblios index status', NULL, NULL),
192
('ElasticsearchIndexStatus_biblios', '0', 'Biblios index status', NULL, NULL),
192
('ElasticsearchMARCFormat', 'ISO2709', 'ISO2709|ARRAY', 'Elasticsearch MARC format. ISO2709 format is recommended as it is faster and takes less space, whereas array is searchable.', 'Choice'),
193
('ElasticsearchMARCFormat', 'ISO2709', 'ISO2709|ARRAY', 'Elasticsearch MARC format. ISO2709 format is recommended as it is faster and takes less space, whereas array is searchable.', 'Choice'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/acquisitions.pref (-1 / +8 lines)
Lines 130-132 Acquisitions: Link Here
130
                automatic: "Do"
130
                automatic: "Do"
131
                manual: "Don't"
131
                manual: "Don't"
132
            - " automatically import EDIFACT invoice message files when they are downloaded."
132
            - " automatically import EDIFACT invoice message files when they are downloaded."
133
- 
133
        -
134
            - "Map sequence code (GIR:LSQ) field to Koha item "
135
            - pref: EdifactLSQ
136
              default: location
137
              choices:
138
                location: "location"
139
                ccode: "ccode"
140
            - " field."

Return to bug 30135