From 38c954986473ea1392605ea059cccc726928a080 Mon Sep 17 00:00:00 2001 From: Colin Campbell Date: Mon, 10 Jul 2017 16:03:55 +0100 Subject: [PATCH] Bug 18267 Remove obsolete Edifact::Line price method The old price method duplicated the function of price_info as this was the only type of price field in quotes. The more specific field is now used and the old method is no longer called. Remove the obsolete code Add comment documenting the allowed values in the Edifact PRI segment Signed-off-by: Kyle M Hall --- Koha/Edifact/Line.pm | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/Koha/Edifact/Line.pm b/Koha/Edifact/Line.pm index 213cd39..05abfee 100644 --- a/Koha/Edifact/Line.pm +++ b/Koha/Edifact/Line.pm @@ -139,10 +139,6 @@ sub _parse_lines { $d->{monetary_amount} = $s->elem( 0, 1 ); } - elsif ( $s->tag eq 'PRI' ) { - - $d->{price} = $s->elem( 0, 1 ); - } elsif ( $s->tag eq 'RFF' ) { my $qualifier = $s->elem( 0, 0 ); if ( $qualifier eq 'QLI' ) { # Suppliers unique quotation reference @@ -379,11 +375,6 @@ sub quantity { return $self->{quantity}; } -sub price { - my $self = shift; - return $self->{price}; -} - sub reference { my $self = shift; return $self->{reference}; @@ -747,6 +738,12 @@ sub amt_lineitem { sub pri_price { my ( $self, $price_qualifier ) = @_; + # In practice qualifier is AAE in the quote and AAA & AAB in invoices + # but the following are defined + # AAA calculation price net (unit price excl tax but incl any allowances or charges) + # AAB calculation price gross (unit price excl all taxes, allowances and charges ) + # AAE information price (incl tax but excl allowances or charges ) + # AAF information price (including all taxes, allowances or charges) foreach my $s ( @{ $self->{segs} } ) { if ( $s->tag eq 'PRI' && $s->elem( 0, 0 ) eq $price_qualifier ) { return { -- 2.10.2