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

(-)a/Koha/EDI.pm (-24 / +24 lines)
Lines 346-357 sub receipt_items { Link Here
346
        }
346
        }
347
        push @{ $branch_map{$b} }, $item;
347
        push @{ $branch_map{$b} }, $item;
348
    }
348
    }
349
    my $gir_occurence = 0;
349
    my $gir_occurrence = 0;
350
    while ( $gir_occurence < $quantity ) {
350
    while ( $gir_occurrence < $quantity ) {
351
        my $branch = $inv_line->girfield( 'branch', $gir_occurence );
351
        my $branch = $inv_line->girfield( 'branch', $gir_occurrence );
352
        my $item = shift @{ $branch_map{$branch} };
352
        my $item = shift @{ $branch_map{$branch} };
353
        if ($item) {
353
        if ($item) {
354
            my $barcode = $inv_line->girfield( 'barcode', $gir_occurence );
354
            my $barcode = $inv_line->girfield( 'barcode', $gir_occurrence );
355
            if ( $barcode && !$item->barcode ) {
355
            if ( $barcode && !$item->barcode ) {
356
                my $rs = $schema->resultset('Item')->search(
356
                my $rs = $schema->resultset('Item')->search(
357
                    {
357
                    {
Lines 373-379 sub receipt_items { Link Here
373
        else {
373
        else {
374
            $logger->warn("Unmatched item at branch:$branch");
374
            $logger->warn("Unmatched item at branch:$branch");
375
        }
375
        }
376
        ++$gir_occurence;
376
        ++$gir_occurrence;
377
    }
377
    }
378
    return;
378
    return;
379
379
Lines 657-676 sub quote_item { Link Here
657
    }
657
    }
658
658
659
    if ( $order_quantity == 1 && $item->quantity > 1 ) {
659
    if ( $order_quantity == 1 && $item->quantity > 1 ) {
660
        my $occurence = 1;    # occ zero already added
660
        my $occurrence = 1;    # occ zero already added
661
        while ( $occurence < $item->quantity ) {
661
        while ( $occurrence < $item->quantity ) {
662
662
663
            # check budget code
663
            # check budget code
664
            $budget = _get_budget( $schema,
664
            $budget = _get_budget( $schema,
665
                $item->girfield( 'fund_allocation', $occurence ) );
665
                $item->girfield( 'fund_allocation', $occurrence ) );
666
666
667
            if ( !$budget ) {
667
            if ( !$budget ) {
668
                my $bad_budget =
668
                my $bad_budget =
669
                  $item->girfield( 'fund_allocation', $occurence );
669
                  $item->girfield( 'fund_allocation', $occurrence );
670
                carp 'Skipping line with no budget info';
670
                carp 'Skipping line with no budget info';
671
                $logger->trace(
671
                $logger->trace(
672
                    "girfield skipped for invalid budget:$bad_budget");
672
                    "girfield skipped for invalid budget:$bad_budget");
673
                ++$occurence;    ## lets look at the next one not this one again
673
                ++$occurrence;    ## lets look at the next one not this one again
674
                next;
674
                next;
675
            }
675
            }
676
676
Lines 703-718 sub quote_item { Link Here
703
                    }
703
                    }
704
                    my $new_item = {
704
                    my $new_item = {
705
                        itype =>
705
                        itype =>
706
                          $item->girfield( 'stock_category', $occurence ),
706
                          $item->girfield( 'stock_category', $occurrence ),
707
                        location =>
707
                        location =>
708
                          $item->girfield( 'collection_code', $occurence ),
708
                          $item->girfield( 'collection_code', $occurrence ),
709
                        itemcallnumber =>
709
                        itemcallnumber =>
710
                          $item->girfield( 'shelfmark', $occurence )
710
                          $item->girfield( 'shelfmark', $occurrence )
711
                          || $item->girfield( 'classification', $occurence )
711
                          || $item->girfield( 'classification', $occurrence )
712
                          || title_level_class($item),
712
                          || title_level_class($item),
713
                        holdingbranch =>
713
                        holdingbranch =>
714
                          $item->girfield( 'branch', $occurence ),
714
                          $item->girfield( 'branch', $occurrence ),
715
                        homebranch => $item->girfield( 'branch', $occurence ),
715
                        homebranch => $item->girfield( 'branch', $occurrence ),
716
                    };
716
                    };
717
                    if ( $new_item->{itype} ) {
717
                    if ( $new_item->{itype} ) {
718
                        $item_hash->{itype} = $new_item->{itype};
718
                        $item_hash->{itype} = $new_item->{itype};
Lines 744-750 sub quote_item { Link Here
744
                    );
744
                    );
745
                }
745
                }
746
746
747
                ++$occurence;
747
                ++$occurrence;
748
            }
748
            }
749
749
750
            # increment quantity in orderline for EXISTING budget in $budgets
750
            # increment quantity in orderline for EXISTING budget in $budgets
Lines 772-787 sub quote_item { Link Here
772
                        price            => $item->price,
772
                        price            => $item->price,
773
                        replacementprice => $item->price,
773
                        replacementprice => $item->price,
774
                        itype =>
774
                        itype =>
775
                          $item->girfield( 'stock_category', $occurence ),
775
                          $item->girfield( 'stock_category', $occurrence ),
776
                        location =>
776
                        location =>
777
                          $item->girfield( 'collection_code', $occurence ),
777
                          $item->girfield( 'collection_code', $occurrence ),
778
                        itemcallnumber =>
778
                        itemcallnumber =>
779
                          $item->girfield( 'shelfmark', $occurence )
779
                          $item->girfield( 'shelfmark', $occurrence )
780
                          || $item->girfield( 'classification', $occurence )
780
                          || $item->girfield( 'classification', $occurrence )
781
                          || $item_hash->{itemcallnumber},
781
                          || $item_hash->{itemcallnumber},
782
                        holdingbranch =>
782
                        holdingbranch =>
783
                          $item->girfield( 'branch', $occurence ),
783
                          $item->girfield( 'branch', $occurrence ),
784
                        homebranch => $item->girfield( 'branch', $occurence ),
784
                        homebranch => $item->girfield( 'branch', $occurrence ),
785
                    };
785
                    };
786
                    my $itemnumber;
786
                    my $itemnumber;
787
                    ( undef, undef, $itemnumber ) =
787
                    ( undef, undef, $itemnumber ) =
Lines 795-801 sub quote_item { Link Here
795
                    );
795
                    );
796
                }
796
                }
797
797
798
                ++$occurence;
798
                ++$occurrence;
799
            }
799
            }
800
        }
800
        }
801
    }
801
    }
(-)a/Koha/Edifact/Line.pm (-2 / +2 lines)
Lines 453-459 sub coded_substitute_text { Link Here
453
453
454
# This will take a standard code as returned
454
# This will take a standard code as returned
455
# by (orderline|substitue)-free_text (FTX seg LIN)
455
# by (orderline|substitue)-free_text (FTX seg LIN)
456
# and expand it useing EditEUR code list 8B
456
# and expand it using EditEUR code list 8B
457
sub translate_8B {
457
sub translate_8B {
458
    my ($code) = @_;
458
    my ($code) = @_;
459
459
Lines 635-641 sub girfield { Link Here
635
    my ( $self, $field, $occ ) = @_;
635
    my ( $self, $field, $occ ) = @_;
636
    if ( $self->number_of_girs ) {
636
    if ( $self->number_of_girs ) {
637
637
638
        # defaults to occurence 0 returns undef if occ requested > occs
638
        # defaults to occurrence 0 returns undef if occ requested > occs
639
        if ( defined $occ && $occ >= @{ $self->{GIR} } ) {
639
        if ( defined $occ && $occ >= @{ $self->{GIR} } ) {
640
            return;
640
            return;
641
        }
641
        }
(-)a/Koha/Edifact/Order.pm (-3 / +3 lines)
Lines 127-133 sub interchange_header { Link Here
127
127
128
    # syntax identifier
128
    # syntax identifier
129
    my $hdr =
129
    my $hdr =
130
      'UNB+UNOC:3';    # controling agency character set syntax version number
130
      'UNB+UNOC:3';    # controlling agency character set syntax version number
131
                       # Interchange Sender
131
                       # Interchange Sender
132
    $hdr .= _interchange_sr_identifier( $self->{sender}->ean,
132
    $hdr .= _interchange_sr_identifier( $self->{sender}->ean,
133
        $self->{sender}->id_code_qualifier );    # interchange sender
133
        $self->{sender}->id_code_qualifier );    # interchange sender
Lines 714-720 Make handling of GIR segments more customizable Link Here
714
714
715
=head2 trailing_service_segments
715
=head2 trailing_service_segments
716
716
717
   Include the service segments occuring at the end of the message
717
   Include the service segments occurring at the end of the message
718
718
=head2 interchange_control_reference
719
=head2 interchange_control_reference
719
720
720
   Returns the unique interchange control reference as a 14 digit number
721
   Returns the unique interchange control reference as a 14 digit number
721
- 

Return to bug 7736