mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-30 06:31:16 +00:00
Update OrderTaxAdjustmentsFetcher
This commit is contained in:
@@ -22,7 +22,7 @@ class OrderTaxAdjustmentsFetcher
|
||||
def all
|
||||
Spree::Adjustment
|
||||
.with_tax
|
||||
.where(order_adjustments.or(line_item_adjustments))
|
||||
.where(order_adjustments.or(line_item_adjustments).or(shipment_adjustments))
|
||||
.order('created_at ASC')
|
||||
end
|
||||
|
||||
@@ -36,6 +36,11 @@ class OrderTaxAdjustmentsFetcher
|
||||
.and(table[:adjustable_type].eq('Spree::LineItem'))
|
||||
end
|
||||
|
||||
def shipment_adjustments
|
||||
table[:order_id].eq(order.id)
|
||||
.and(table[:adjustable_type].eq('Spree::Shipment'))
|
||||
end
|
||||
|
||||
def table
|
||||
@table ||= Spree::Adjustment.arel_table
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user