Bugzilla – Attachment 56427 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.21 KB, created by
Koha Team University Lyon 3
on 2016-10-13 15:41:24 UTC
(
hide
)
Description:
Bug 13321: Fix unitprice rounding
Filename:
MIME Type:
Creator:
Koha Team University Lyon 3
Created:
2016-10-13 15:41:24 UTC
Size:
2.21 KB
patch
obsolete
>From b5e865402e35d9d534a7f621a036adae56d7a1ac 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> >Signed-off-by: Sonia Bouis <koha@univ-lyon3.fr> >--- > C4/Acquisition.pm | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > >diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm >index 31af6e5..2a8a85c 100644 >--- a/C4/Acquisition.pm >+++ b/C4/Acquisition.pm >@@ -2878,6 +2878,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}; > >@@ -2885,6 +2891,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