fixed autoremove tax when discount & precision at receipt no report

This commit is contained in:
NyanLinHtut
2019-12-11 11:34:23 +06:30
parent 56ec8c83b2
commit 26edf23b46
2 changed files with 16 additions and 4 deletions

View File

@@ -8,7 +8,7 @@ module NumberFormattable
@precision = @number_formats.find? { |x| x.name.parameterize.underscore == 'precision'}.value.to_i rescue nil
end
if @precision.nil?
@print_settings = PrintSetting.get_precision_delimiter if !defined? @number_formats
@print_settings = PrintSetting.get_precision_delimiter if !defined? @print_settings
if @print_settings
@precision = @print_settings.precision.to_i
else
@@ -45,7 +45,7 @@ module NumberFormattable
options[:precision] = options[:precision] || precision
# options[:delimiter] = options[:delimiter] || delimiter
options[:strip_insignificant_zeros] = options[:strip_insignificant_zeros] || strip_insignificant_zeros
number = number.to_f.round(options[:precision])
if options[:precision] > 0