mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-25 20:46:48 +00:00
18 lines
445 B
Ruby
18 lines
445 B
Ruby
# frozen_string_literal: true
|
|
|
|
# EnterpriseFeeAdjustments represent a collection of enterprise fee adjustments
|
|
#
|
|
class EnterpriseFeeAdjustments
|
|
def initialize(adjustments)
|
|
@adjustments = adjustments
|
|
end
|
|
|
|
def total_additional_tax
|
|
@adjustments.sum { |enterprise_fee| enterprise_fee.additional_tax_total.to_f }
|
|
end
|
|
|
|
def total_included_tax
|
|
@adjustments.sum { |enterprise_fee| enterprise_fee.included_tax_total.to_f }
|
|
end
|
|
end
|