mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Fix enterprise fee calculation. The adjustment.source value of the fee is now allowing the inheritance of the tax category from line items
This commit is contained in:
@@ -20,6 +20,12 @@ module OpenFoodNetwork
|
||||
|
||||
def create_enterprise_fee_adjustment(label, target, calculable)
|
||||
adjustment = enterprise_fee.create_adjustment(label, target, calculable, true)
|
||||
|
||||
# This is necessary when source is a line_item
|
||||
# probably because the association order.adjustments contains "inverse_of :source"
|
||||
# which overrides the value (the line item) set in calculated_adjustment.create_adjustment
|
||||
adjustment.source = calculable
|
||||
adjustment
|
||||
end
|
||||
|
||||
def line_item_adjustment_label
|
||||
|
||||
Reference in New Issue
Block a user