mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-14 23:47:48 +00:00
Reinstate old logic for adjustments controller
Certain types of adjustments (eg enterprise fees) cannot really be changed arbitrarily; when the order is saved and "recalculated" the values will be reset. The adjustments are still shown in the main order edit tab, but are not editable in the adjustments tab.
This commit is contained in:
@@ -18,7 +18,12 @@ module Spree
|
||||
end
|
||||
|
||||
def collection
|
||||
parent.all_adjustments.eligible
|
||||
order_adjustments = parent.adjustments.where.not(originator_type: 'EnterpriseFee')
|
||||
admin_adjustments = parent.adjustments.admin
|
||||
payment_fees = parent.all_adjustments.payment_fee.eligible
|
||||
shipping_fees = parent.all_adjustments.shipping
|
||||
|
||||
order_adjustments.or(admin_adjustments) | payment_fees.or(shipping_fees)
|
||||
end
|
||||
|
||||
def find_resource
|
||||
|
||||
Reference in New Issue
Block a user