From de80e6d5bf8dd8eca9f6b26adea46e956ce93542 Mon Sep 17 00:00:00 2001 From: Rohan Mitchell Date: Thu, 15 Oct 2015 09:58:22 +1100 Subject: [PATCH] Find adjustments for billable periods --- app/models/spree/adjustment_decorator.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/models/spree/adjustment_decorator.rb b/app/models/spree/adjustment_decorator.rb index a8272acb0f..d27b5d760b 100644 --- a/app/models/spree/adjustment_decorator.rb +++ b/app/models/spree/adjustment_decorator.rb @@ -6,6 +6,7 @@ module Spree has_one :metadata, class_name: 'AdjustmentMetadata' scope :enterprise_fee, where(originator_type: 'EnterpriseFee') + scope :billable_period, where(source_type: 'BillablePeriod') scope :included_tax, where(originator_type: 'Spree::TaxRate', adjustable_type: 'Spree::LineItem') scope :with_tax, where('spree_adjustments.included_tax > 0') scope :without_tax, where('spree_adjustments.included_tax = 0')