This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def compute_order(order) | |
matched_line_items = order.line_items.select do |line_item| | |
line_item.product.tax_category == rate.tax_category | |
end | |
line_items_total = matched_line_items.sum(&:total) | |
round_to_two_places(line_items_total - ( line_items_total / (1 + rate.amount) ) ) | |
end | |
def compute_line_item(line_item) |
NewerOlder