Lines 2011-2017
returns the correct SQL routine based on OrderPriceRounding system preference.
Link Here
|
2011 |
=cut |
2011 |
=cut |
2012 |
|
2012 |
|
2013 |
sub _get_rounding_sql { |
2013 |
sub _get_rounding_sql { |
2014 |
my $round_string = @_; |
2014 |
my ( $round_string ) = @_; |
2015 |
my $rounding_pref = C4::Context->preference('OrderPriceRounding'); |
2015 |
my $rounding_pref = C4::Context->preference('OrderPriceRounding'); |
2016 |
if ( $rounding_pref eq "nearest_cent" ) { return ("CAST($round_string*100 AS INTEGER)/100"); } |
2016 |
if ( $rounding_pref eq "nearest_cent" ) { return ("CAST($round_string*100 AS INTEGER)/100"); } |
2017 |
else { return ("$round_string"); } |
2017 |
else { return ("$round_string"); } |
Lines 2026-2032
returns a price rounded as specified in OrderPriceRounding system preference.
Link Here
|
2026 |
=cut |
2026 |
=cut |
2027 |
|
2027 |
|
2028 |
sub get_rounded_price { |
2028 |
sub get_rounded_price { |
2029 |
my $price = @_; |
2029 |
my ( $price ) = @_; |
2030 |
my $rounding_pref = C4::Context->preference('OrderPriceRounding'); |
2030 |
my $rounding_pref = C4::Context->preference('OrderPriceRounding'); |
2031 |
if( $rounding_pref eq 'nearest_cent' ) { return Koha::Number::Price->new( $price )->format(); } |
2031 |
if( $rounding_pref eq 'nearest_cent' ) { return Koha::Number::Price->new( $price )->format(); } |
2032 |
else { return $price; } |
2032 |
else { return $price; } |
2033 |
- |
|
|