Bugzilla – Attachment 157495 Details for
Bug 35114
Calculation around basket details and basketgroup not correct
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35114: Adjust logic around basket total calculation
Bug-35114-Adjust-logic-around-basket-total-calcula.patch (text/plain), 1.96 KB, created by
Thibaud Guillot (thibaud_g)
on 2023-10-20 08:16:39 UTC
(
hide
)
Description:
Bug 35114: Adjust logic around basket total calculation
Filename:
MIME Type:
Creator:
Thibaud Guillot (thibaud_g)
Created:
2023-10-20 08:16:39 UTC
Size:
1.96 KB
patch
obsolete
>From 544a70c91af4d401cd26143f659eaedfcc5c4938 Mon Sep 17 00:00:00 2001 >From: Thibaud Guillot <thibaud.guillot@biblibre.com> >Date: Fri, 20 Oct 2023 10:10:52 +0200 >Subject: [PATCH] Bug 35114: Adjust logic around basket total calculation > >Like in total basket.pl calculation we took the unitprice first than the >ecost to get the same total value between basketgroup and basket details > >Test plan : >1) Be sure to have basketgroup with any vendor (which must have a > discount rate to see ecost calculation) >2) Go to basket details and basketgroup overview to see the difference >3) Apply this basket and refresh pages to see now the same result >--- > acqui/basketgroup.pl | 11 ++++++++--- > 1 file changed, 8 insertions(+), 3 deletions(-) > >diff --git a/acqui/basketgroup.pl b/acqui/basketgroup.pl >index 38f7b6b44c..413baf772b 100755 >--- a/acqui/basketgroup.pl >+++ b/acqui/basketgroup.pl >@@ -77,9 +77,14 @@ sub BasketTotal { > for my $order (@orders){ > # FIXME The following is wrong > if ( $bookseller->listincgst ) { >- $total = $total + ( get_rounded_price($order->{ecost_tax_included}) * $order->{quantity} ); >- } else { >- $total = $total + ( get_rounded_price($order->{ecost_tax_excluded}) * $order->{quantity} ); >+ my $total_unitprice_tax_inc_rounded = get_rounded_price( $order->{unitprice_tax_included} ) * $order->{quantity}; >+ my $total_ecost_tax_inc_rounded = get_rounded_price( $order->{ecost_tax_included} ) * $order->{quantity}; >+ $total += $total_unitprice_tax_inc_rounded || $total_ecost_tax_inc_rounded; >+ } >+ else { >+ my $total_unitprice_tax_exc_rounded = get_rounded_price( $order->{unitprice_tax_excluded} ) * $order->{quantity}; >+ my $total_ecost_tax_exc_rounded = get_rounded_price( $order->{ecost_tax_excluded} ) * $order->{quantity}; >+ $total += $total_unitprice_tax_exc_rounded || $total_ecost_tax_exc_rounded; > } > } > return $total; >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 35114
:
157495
|
161066
|
161691
|
161799
|
161800
|
162060
|
172124