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:
Matt-Yorkley
2021-04-15 13:05:01 +01:00
parent 50da77c6db
commit 206d9e06ea
2 changed files with 29 additions and 7 deletions

View File

@@ -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