Lines 341-356
if ( $op eq 'list' ) {
Link Here
|
341 |
push @books_loop, $line; |
341 |
push @books_loop, $line; |
342 |
|
342 |
|
343 |
$foot{$$line{tax_rate}}{tax_rate} = $$line{tax_rate}; |
343 |
$foot{$$line{tax_rate}}{tax_rate} = $$line{tax_rate}; |
344 |
$foot{$$line{tax_rate}}{tax_value} += get_rounded_price($$line{tax_value}); |
344 |
$foot{$$line{tax_rate}}{tax_value} += $$line{tax_value}; |
345 |
$total_tax_value += $$line{tax_value}; |
345 |
$total_tax_value += $$line{tax_value}; |
346 |
$foot{$$line{tax_rate}}{quantity} += get_rounded_price($$line{quantity}); |
346 |
$foot{$$line{tax_rate}}{quantity} += $$line{quantity}; |
347 |
$total_quantity += $$line{quantity}; |
347 |
$total_quantity += $$line{quantity}; |
348 |
$foot{$$line{tax_rate}}{total_tax_excluded} += $$line{total_tax_excluded}; |
348 |
$foot{$$line{tax_rate}}{total_tax_excluded} += $$line{sum_total_tax_excluded}; |
349 |
$total_tax_excluded += $$line{total_tax_excluded}; |
349 |
$total_tax_excluded += $$line{sum_total_tax_excluded}; |
350 |
$foot{$$line{tax_rate}}{total_tax_included} += $$line{total_tax_included}; |
350 |
$foot{$$line{tax_rate}}{total_tax_included} += $$line{sum_total_tax_included}; |
351 |
$total_tax_included += $$line{total_tax_included}; |
351 |
$total_tax_included += $$line{sum_total_tax_included}; |
352 |
} |
352 |
} |
353 |
|
353 |
|
|
|
354 |
foreach my $tax_rate (keys %foot) { |
355 |
$foot{$tax_rate}{total_tax_excluded} = get_rounded_price($foot{$tax_rate}{total_tax_excluded}); |
356 |
$foot{$tax_rate}{total_tax_included} = get_rounded_price($foot{$tax_rate}{total_tax_included}); |
357 |
} |
358 |
|
359 |
|
354 |
push @book_foot_loop, map {$_} values %foot; |
360 |
push @book_foot_loop, map {$_} values %foot; |
355 |
|
361 |
|
356 |
# Get cancelled orders |
362 |
# Get cancelled orders |
Lines 408-416
if ( $op eq 'list' ) {
Link Here
|
408 |
book_foot_loop => \@book_foot_loop, |
414 |
book_foot_loop => \@book_foot_loop, |
409 |
cancelledorders_loop => \@cancelledorders_loop, |
415 |
cancelledorders_loop => \@cancelledorders_loop, |
410 |
total_quantity => $total_quantity, |
416 |
total_quantity => $total_quantity, |
411 |
total_tax_excluded => $total_tax_excluded, |
417 |
total_tax_excluded => get_rounded_price($total_tax_excluded), |
412 |
total_tax_included => $total_tax_included, |
418 |
total_tax_included => get_rounded_price($total_tax_included), |
413 |
total_tax_value => $total_tax_value, |
419 |
total_tax_value => get_rounded_price($total_tax_value), |
414 |
currency => $active_currency->currency, |
420 |
currency => $active_currency->currency, |
415 |
listincgst => $bookseller->listincgst, |
421 |
listincgst => $bookseller->listincgst, |
416 |
basketgroups => $basketgroups, |
422 |
basketgroups => $basketgroups, |
Lines 454-463
sub get_order_infos {
Link Here
|
454 |
# If we have an actual cost that should be the total, otherwise use the ecost |
460 |
# If we have an actual cost that should be the total, otherwise use the ecost |
455 |
$line{unitprice_tax_included} += 0; |
461 |
$line{unitprice_tax_included} += 0; |
456 |
$line{unitprice_tax_excluded} += 0; |
462 |
$line{unitprice_tax_excluded} += 0; |
457 |
my $cost_tax_included = $line{unitprice_tax_included} || $line{ecost_tax_included}; |
463 |
$line{total_tax_included} = get_rounded_price($line{ecost_tax_included} * $line{quantity}); |
458 |
my $cost_tax_excluded = $line{unitprice_tax_excluded} || $line{ecost_tax_excluded}; |
464 |
$line{total_tax_excluded} = get_rounded_price($line{ecost_tax_excluded} * $line{quantity}); |
459 |
$line{total_tax_included} = get_rounded_price($cost_tax_included) * $line{quantity}; |
465 |
$line{sum_total_tax_included} = $line{ecost_tax_included} * $line{quantity}; |
460 |
$line{total_tax_excluded} = get_rounded_price($cost_tax_excluded) * $line{quantity}; |
466 |
$line{sum_total_tax_excluded} = $line{ecost_tax_excluded} * $line{quantity}; |
461 |
$line{tax_value} = $line{tax_value_on_ordering}; |
467 |
$line{tax_value} = $line{tax_value_on_ordering}; |
462 |
$line{tax_rate} = $line{tax_rate_on_ordering}; |
468 |
$line{tax_rate} = $line{tax_rate_on_ordering}; |
463 |
|
469 |
|