Bug 17668: Fix typo in parcel.pl - listinct vs listincgst

This typo has been introduced by
  commit eed14b080d
    Bug 13001: Refactor VAT and price calculation - parcel page
So before the tax rewrite (13321, 13323).
It sounded weird to me that testers did not catch the bug on this page.

To understand the logic:
Conditions are listincgst, invoiceincgst
Conditions | Before this patch |  If we fix the typo  | After this patch
 0     0   |    excluded       |    excluded          |   excluded
 0     1   |    included       |    included          |   included
 1     0   |    excluded       |    excluded          |   excluded
 1     1   |    included       |    included          |   included

Test plan:
Create 4 vendors with the difference combinations
Create a basket, add an order (with a tax) and receive it
Confirm that the different values displayed on the parcel page are correct

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 3e112f3837)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
This commit is contained in:
Jonathan Druart 2016-11-22 15:28:04 +00:00 committed by Katrin Fischer
parent a5ce343c9d
commit c6b0b9cf1b
1 changed files with 7 additions and 11 deletions

View File

@ -124,17 +124,15 @@ my $subtotal_for_funds;
for my $order ( @orders ) {
$order->{'unitprice'} += 0;
if ( $bookseller->{listincgst} and not $bookseller->{invoiceincgst} ) {
if ( $bookseller->{invoiceincgst} ) {
$order->{ecost} = $order->{ecost_tax_included};
$order->{unitprice} = $order->{unitprice_tax_included};
}
else {
$order->{ecost} = $order->{ecost_tax_excluded};
$order->{unitprice} = $order->{unitprice_tax_excluded};
}
elsif ( not $bookseller->{listinct} and $bookseller->{invoiceincgst} ) {
$order->{ecost} = $order->{ecost_tax_included};
$order->{unitprice} = $order->{unitprice_tax_included};
} else {
$order->{ecost} = $order->{ecost_tax_excluded};
$order->{unitprice} = $order->{unitprice_tax_excluded};
}
$order->{total} = $order->{unitprice} * $order->{quantity};
my %line = %{ $order };
@ -224,9 +222,7 @@ unless( defined $invoice->{closedate} ) {
for (my $i = 0 ; $i < $countpendings ; $i++) {
my $order = $pendingorders->[$i];
if ( $bookseller->{listincgst} and not $bookseller->{invoiceincgst} ) {
$order->{ecost} = $order->{ecost_tax_excluded};
} elsif ( not $bookseller->{listinct} and $bookseller->{invoiceincgst} ) {
if ( $bookseller->{invoiceincgst} ) {
$order->{ecost} = $order->{ecost_tax_included};
} else {
$order->{ecost} = $order->{ecost_tax_excluded};