You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
discount_rate if present is a string and needs to be converted to a float when calculating line_amount in a LineItem:
class LineItem < Base
def line_amount(summary_only = false)
return attributes[:line_amount] if summary_only || @line_amount_set
if quantity && unit_amount
total = quantity * unit_amount
if discount_rate
# CHANGE: discount_rate.to_f
BigDecimal((total * ((100 - discount_rate.to_f) / 100)).to_s).round(2)
else
BigDecimal(total.to_s).round(2)
end
end
end
end
The text was updated successfully, but these errors were encountered:
discount_rate if present is a string and needs to be converted to a float when calculating line_amount in a LineItem:
The text was updated successfully, but these errors were encountered: