mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-04 22:16:08 +00:00
Fix Rubocop issues
This commit is contained in:
@@ -18,7 +18,9 @@ module CheckoutHelper
|
||||
enterprise_fee_adjustments = adjustments.select { |a| a.originator_type == 'EnterpriseFee' && a.source_type != 'Spree::LineItem' }
|
||||
adjustments.reject! { |a| a.originator_type == 'EnterpriseFee' && a.source_type != 'Spree::LineItem' }
|
||||
unless exclude.include? :admin_and_handling
|
||||
adjustments << Spree::Adjustment.new(label: I18n.t(:orders_form_admin), amount: enterprise_fee_adjustments.sum(:amount))
|
||||
adjustments << Spree::Adjustment.new(
|
||||
label: I18n.t(:orders_form_admin), amount: enterprise_fee_adjustments.sum(:amount)
|
||||
)
|
||||
end
|
||||
|
||||
adjustments
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class ConfirmOrderJob < ActiveJob::Base
|
||||
def perform(order_id)
|
||||
Spree::OrderMailer.confirm_email_for_customer(order_id).deliver
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
# Delivers an email with a report of the order cycle to each of its suppliers
|
||||
class OrderCycleNotificationJob < ActiveJob::Base
|
||||
def perform(order_cycle_id)
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class WelcomeEnterpriseJob < ActiveJob::Base
|
||||
def perform(enterprise_id)
|
||||
enterprise = Enterprise.find enterprise_id
|
||||
|
||||
@@ -106,8 +106,22 @@ module OpenFoodNetwork
|
||||
proc { |orders| orders.sum(:item_total) },
|
||||
proc { |orders| orders.sum(&:ship_total) },
|
||||
proc { |orders| orders.sum(:total) },
|
||||
proc { |orders| orders.sum { |o| o.payments.select { |payment| payment.completed? && (payment.payment_method.name.to_s.include? "EFT") }.sum(:amount) } },
|
||||
proc { |orders| orders.sum { |o| o.payments.select { |payment| payment.completed? && (payment.payment_method.name.to_s.include? "PayPal") }.sum(:amount) } },
|
||||
proc { |orders|
|
||||
orders.sum { |o|
|
||||
o.payments.select { |payment|
|
||||
payment.completed? &&
|
||||
(payment.payment_method.name.to_s.include? "EFT")
|
||||
} .sum(:amount)
|
||||
}
|
||||
},
|
||||
proc { |orders|
|
||||
orders.sum { |o|
|
||||
o.payments.select { |payment|
|
||||
payment.completed? &&
|
||||
(payment.payment_method.name.to_s.include? "PayPal")
|
||||
} .sum(:amount)
|
||||
}
|
||||
},
|
||||
proc { |orders| orders.sum(&:outstanding_balance) }]
|
||||
else
|
||||
[proc { |payments| payments.first.order.payment_state },
|
||||
|
||||
Reference in New Issue
Block a user