Bugzilla – Attachment 51085 Details for
Bug 13321
Fix tax and prices calculation
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13321: Fix unitprice rounding
Bug-13321-Fix-unitprice-rounding.patch (text/plain), 2.17 KB, created by
Julian Maurice
on 2016-05-02 10:11:47 UTC
(
hide
)
Description:
Bug 13321: Fix unitprice rounding
Filename:
MIME Type:
Creator:
Julian Maurice
Created:
2016-05-02 10:11:47 UTC
Size:
2.17 KB
patch
obsolete
>From 56be814921f00b7edaa4cb8418871a8b98b142e0 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Tue, 13 Jan 2015 17:03:04 +0100 >Subject: [PATCH] Bug 13321: Fix unitprice rounding > >We need to display the rounded value, but insert the exact value. >The unit price can be change on receiving, so the input value can be >modified. >But if it's not, we must insert the exact (not rounded) unit price, >which is the ecost value. > >Signed-off-by: Laurence Rault <laurence.rault@biblibre.com> > >Signed-off-by: Francois Charbonnier <francois.charbonnier@inlibro.com> > >Signed-off-by: Sonia Bouis <sonia.bouis@univ-lyon3.fr> >--- > C4/Acquisition.pm | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > >diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm >index 4a46c55..39e394b 100644 >--- a/C4/Acquisition.pm >+++ b/C4/Acquisition.pm >@@ -2858,6 +2858,12 @@ sub populate_order_with_prices { > > if ($receiving) { > if ( $bookseller->{invoiceincgst} ) { >+ # Trick for unitprice. If the unit price rounded value is the same as the ecost rounded value >+ # we need to keep the exact ecost value >+ if ( Koha::Number::Price->new( $order->{unitprice} )->round == Koha::Number::Price->new( $order->{ecost_tax_included} )->round ) { >+ $order->{unitprice} = $order->{ecost_tax_included}; >+ } >+ > # The user entered the unit price tax included > $order->{unitprice_tax_included} = $order->{unitprice}; > >@@ -2865,6 +2871,12 @@ sub populate_order_with_prices { > $order->{unitprice_tax_excluded} = $order->{unitprice_tax_included} / ( 1 + $order->{tax_rate} ); > } > else { >+ # Trick for unitprice. If the unit price rounded value is the same as the ecost rounded value >+ # we need to keep the exact ecost value >+ if ( Koha::Number::Price->new( $order->{unitprice} )->round == Koha::Number::Price->new( $order->{ecost_tax_excluded} )->round ) { >+ $order->{unitprice} = $order->{ecost_tax_excluded}; >+ } >+ > # The user entered the unit price tax excluded > $order->{unitprice_tax_excluded} = $order->{unitprice}; > >-- >2.1.4
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 13321
:
33789
|
33790
|
33791
|
33792
|
33793
|
34432
|
35152
|
35165
|
47489
|
47490
|
47491
|
47492
|
47493
|
47494
|
48867
|
48868
|
48869
|
48870
|
48871
|
48872
|
51080
|
51081
|
51082
|
51083
|
51084
|
51085
|
51643
|
51644
|
51645
|
51646
|
51647
|
51648
|
51649
|
52046
|
55168
|
55415
|
55416
|
55417
|
55418
|
55419
|
55420
|
55421
|
55422
|
55423
|
55427
|
56408
|
56422
|
56423
|
56424
|
56425
|
56426
|
56427
|
56428
|
56429
|
56430
|
56431
|
56432
|
56898
|
56899
|
56900
|
56901
|
56902
|
56903
|
56904
|
56905
|
56906
|
56907
|
56908
|
56909
|
56930
|
56959