Business-Edifact-Interchange

 view release on metacpan or  search on metacpan

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

    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

t/parseinvoice2.t  view on Meta::CPAN


cmp_ok( $invoicelines->[1]->{price}->[0]->{qualifier},
    'eq', 'AAE', 'information price qualifier returned' );

cmp_ok( $invoicelines->[1]->{price}->[0]->{price},
    '==', 3.99, 'correct value for information price returned' );

cmp_ok( $invoicelines->[1]->{item_allowance_or_charge}->[0]->{service_code},
    'eq', 'DI', 'discount applicable returned' );

cmp_ok( $invoicelines->[1]->{item_allowance_or_charge}->[0]->{percentage},
    '==', 10, 'discount at 10 per cent returned' );

my $tax = $invoicelines->[1]->{tax}->[0];

cmp_ok( $tax->{function_code}, '==', 7, 'tax functon TAX returned' );

cmp_ok( $tax->{type_code}, 'eq', 'VAT', 'tax type retrieved as VAT' );

cmp_ok( $tax->{category_code}, 'eq', 'Z', 'tax retrieved as zero rated' );



( run in 0.458 second using v1.01-cache-2.11-cpan-709fd43a63f )