Update OrderTaxAdjustmentsFetcher

This commit is contained in:
Matt-Yorkley
2021-02-10 20:13:57 +00:00
parent 02fb2c6a55
commit 80aefa8e73
2 changed files with 7 additions and 2 deletions

View File

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