Business-Edifact-Interchange

 view release on metacpan or  search on metacpan

lib/Business/Edifact/Message.pm  view on Meta::CPAN

        price                => $data_arr->[0]->[1],
        price_type           => $data_arr->[0]->[2],
        price_type_qualifier => $data_arr->[0]->[3],
    };
    return;
}

=head2 handle_uns

=cut

sub handle_uns {
    my ( $self, $data_arr ) = @_;
    $self->{segment_group} = -1;    # summary does not have a seg group
    $self->clear_item_flags();
    return;
}

=head2 handle_cnt

=cut

sub handle_cnt {
    my ( $self, $data_arr ) = @_;
    if ( $data_arr->[0]->[0] == 2 ) {
        $self->{summary_count} = $data_arr->[0]->[1];
    }
    return;
}

=head2 handle_ftx

=cut

sub handle_ftx {
    my ( $self, $data_arr ) = @_;
    my $text_field = {
        qualifier => $data_arr->[0]->[0],
        function  => $data_arr->[1]->[0],
        reference => $data_arr->[2],
    };
    if ( $data_arr->[3] ) {
        $text_field->{text} = join q{ }, @{ $data_arr->[3] };
    }
    if ( @{ $self->{lines} } ) {    # at the lineitem level
        $self->{lines}->[-1]->{free_text} = $text_field;
    }
    else {
        push @{ $self->{free_text} }, $text_field;
    }
    return;
}

=head2 handle_pcd

=cut

sub handle_pcd {
    my ( $self, $data_arr ) = @_;
    if ( $self->{item_alc_flag} ) {
        $self->{lines}->[-1]->{item_allowance_or_charge}->[-1]->{percentage} =
          $data_arr->[0]->[1];
        delete $self->{item_alc_flag};
    }
    return;

}

=head2 clear_item_flags

 clear flags at start of new item or summary

=cut

sub clear_item_flags {
    my $self = shift;
    delete $self->{item_locqty_flag};
    delete $self->{item_alc_flag};
    return;
}

=head1 AUTHOR

Colin Campbell, C<< <colinsc@cpan.org> >>

=head1 BUGS

Please report any bugs or feature requests to C<bug-edifact-interchange at rt.cpan.org>, or through
the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Business-Edifact-Interchange>.  I will be notified, and then you'll
automatically be notified of progress on your bug as I make changes.




=head1 SUPPORT

You can find documentation for this module with the perldoc command.

    perldoc Business::Edifact::Message


=head1 ACKNOWLEDGEMENTS


=head1 LICENSE AND COPYRIGHT

Copyright 2011-2014 Colin Campbell.

This program is free software; you can redistribute it and/or modify it
under the terms of either: the GNU General Public License as published
by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.


=cut

1;



( run in 1.170 second using v1.01-cache-2.11-cpan-39bf76dae61 )