mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-06 22:36:07 +00:00
fix linting errors
This commit is contained in:
@@ -2,20 +2,19 @@
|
||||
|
||||
class Invoice
|
||||
class DataPresenter
|
||||
class Adjustable < Invoice::DataPresenter::Base
|
||||
class Adjustable < Invoice::DataPresenter::Base
|
||||
attributes :id, :type, :currency, :included_tax_total, :additional_tax_total, :amount
|
||||
|
||||
def display_taxes(display_zero: false)
|
||||
if included_tax_total.positive?
|
||||
amount = Spree::Money.new(included_tax_total, currency: currency)
|
||||
I18n.t(:tax_amount_included, amount: amount)
|
||||
amount = Spree::Money.new(included_tax_total, currency:)
|
||||
I18n.t(:tax_amount_included, amount:)
|
||||
elsif additional_tax_total.positive?
|
||||
Spree::Money.new(additional_tax_total, currency: currency)
|
||||
Spree::Money.new(additional_tax_total, currency:)
|
||||
elsif display_zero
|
||||
Spree::Money.new(0.00, currency: currency)
|
||||
Spree::Money.new(0.00, currency:)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -20,7 +20,7 @@ class Invoice
|
||||
|
||||
instance_variable_set("@#{attribute}",
|
||||
Invoice::DataPresenter.const_get(
|
||||
class_name.present? ? class_name : attribute.to_s.classify
|
||||
class_name.presence || attribute.to_s.classify
|
||||
).new(data&.[](attribute)))
|
||||
end
|
||||
end
|
||||
|
||||
@@ -122,7 +122,6 @@ describe '
|
||||
expect(page).to have_content 'description2'
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
shared_examples "Check display on each invoice: legacy and alternative" do |alternative_invoice|
|
||||
let!(:completed_order) do
|
||||
|
||||
Reference in New Issue
Block a user