Class: Liquid::OrderDrop

Inherits:
Drop
  • Object
show all
Includes:
Memery
Defined in:
app/models/liquid/order_drop.rb

Overview

Helper class scoped to Liquid.

Instance Attribute Summary collapse

Delegated Instance Attributes collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(order) ⇒ OrderDrop

Returns a new instance of OrderDrop.



28
29
30
# File 'app/models/liquid/order_drop.rb', line 28

def initialize(order)
  @order = order
end

Instance Attribute Details

#orderObject (readonly)

Returns the value of attribute order.



7
8
9
# File 'app/models/liquid/order_drop.rb', line 7

def order
  @order
end

Class Method Details

.address_attributes_to_string(address_attrs) ⇒ Object

CLASS METHODS #



295
296
297
298
299
# File 'app/models/liquid/order_drop.rb', line 295

def self.address_attributes_to_string(address_attrs)
  addr_arr = [address_attrs['name'], address_attrs['attention_name']]
  addr_arr += address_attrs['address'].to_array(include_recipient: false) if address_attrs['address']
  addr_arr.uniq.join('<br>')
end

.deliveries_to_formatted_hash(deliveries) ⇒ Object



301
302
303
# File 'app/models/liquid/order_drop.rb', line 301

def self.deliveries_to_formatted_hash(deliveries)
  deliveries.to_h { |d| [delivery_to_string(d, deliveries.size), formatted_line_items_grouped(d.line_items.parents_only.goods)] }
end

.delivery_to_string(d, total_count) ⇒ Object



311
312
313
# File 'app/models/liquid/order_drop.rb', line 311

def self.delivery_to_string(d, total_count)
  "#{d.name(true)} of #{total_count}"
end

.formatted_line_items_grouped(line_items) ⇒ Object



315
316
317
318
319
320
321
322
323
324
325
326
327
# File 'app/models/liquid/order_drop.rb', line 315

def self.formatted_line_items_grouped(line_items)
  lines_by_category = {}
  line_items.group_by(&:category_name).each do |category, line_items_grouped_by_category|
    lines_by_category[category] = []
    line_items_grouped_by_category.group_by(&:serial_number_id).each do |_serial_number_id, line_items_grouped_by_serial_number|
      line_items_grouped_by_serial_number.group_by(&:item_id).each do |_item_id, line_items_grouped_by_item|
        count = line_items_grouped_by_item.sum(&:quantity)
        lines_by_category[category] << line_item_to_string(line_items_grouped_by_item.first, count)
      end
    end
  end
  lines_by_category
end

.line_item_to_string(li, count) ⇒ Object



305
306
307
308
309
# File 'app/models/liquid/order_drop.rb', line 305

def self.line_item_to_string(li, count)
  line_items_text = "#{count} of #{li.name} [#{li.sku}]"
  line_items_text += ", serial number: #{li.serial_number}" if li.serial_number.present?
  line_items_text
end

Instance Method Details

#abandoned_cart_urlObject



283
284
285
286
287
288
289
# File 'app/models/liquid/order_drop.rb', line 283

def abandoned_cart_url
  return UrlHelper.instance.my_cart_url(host: "https://#{WEB_HOSTNAME}") if customer..nil?

  customer..(
    UrlHelper.instance.retrieve_my_cart_url(host: "https://#{WEB_HOSTNAME}")
  )
end

#all_line_itemsObject



50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'app/models/liquid/order_drop.rb', line 50

def all_line_items
  parent_lis = order.line_items.parents_only.non_shipping.includes(item: :primary_product_line).to_a
  pls = parent_lis.filter_map { |li| li.item&.primary_product_line }.uniq(&:id)
  if pls.any?
    paths = ProductLine.canonical_paths_for(pls)
    pls.each { |pl| pl.instance_variable_set(:@canonical_path, paths[pl.id]) }
  end

  parent_lis.map do |li|
    { 'sku' => li.sku,
                    'qty' => li.quantity,
                    'name' => li.name,
                    'unit_msrp_cost' => ActionController::Base.helpers.number_to_currency(li.price),
                    'msrp_total' => ActionController::Base.helpers.number_to_currency(li.price_total),
                    'unit_discounted_cost' => ActionController::Base.helpers.number_to_currency(li.discounted_price),
                    'discounted_total' => ActionController::Base.helpers.number_to_currency(li.total),
                    'discount' => ActionController::Base.helpers.number_to_currency(li.discounted_total - li.price_total),
                    'serial_number' => li.serial_number,
                    'redemption_code' => li.redemption_code,
                    'url' => if (i = li.item) && i.canonical_path
                               "https://#{WEB_HOSTNAME}#{i.canonical_url(locale: order.store_id == 2 ? 'en-CA' : 'en-US')}"
                             end }
  end
end

#any_rooms_not_orderable?Object

Alias for Order#any_rooms_not_orderable?

Returns:

  • (Object)

    Order#any_rooms_not_orderable?

See Also:



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'app/models/liquid/order_drop.rb', line 9

delegate :company_review_url,
:product_review_url,
:reference_number,
:created_at,
:public_payment_link,
:any_rooms_not_orderable?,
:customer,
:opportunity,
:shipped_date,
:line_total,
:tax_total,
:spiff_reward,
:total_money,
:po_number,
:completely_shipped?,
:funded_by_advance_replacement?,
:id,
to: :order

#company_review_urlObject

Alias for Order#company_review_url

Returns:

  • (Object)

    Order#company_review_url

See Also:



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'app/models/liquid/order_drop.rb', line 9

delegate :company_review_url,
:product_review_url,
:reference_number,
:created_at,
:public_payment_link,
:any_rooms_not_orderable?,
:customer,
:opportunity,
:shipped_date,
:line_total,
:tax_total,
:spiff_reward,
:total_money,
:po_number,
:completely_shipped?,
:funded_by_advance_replacement?,
:id,
to: :order

#completely_shipped?Object

Alias for Order#completely_shipped?

Returns:

  • (Object)

    Order#completely_shipped?

See Also:



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'app/models/liquid/order_drop.rb', line 9

delegate :company_review_url,
:product_review_url,
:reference_number,
:created_at,
:public_payment_link,
:any_rooms_not_orderable?,
:customer,
:opportunity,
:shipped_date,
:line_total,
:tax_total,
:spiff_reward,
:total_money,
:po_number,
:completely_shipped?,
:funded_by_advance_replacement?,
:id,
to: :order

#coupon_totalObject



263
264
265
# File 'app/models/liquid/order_drop.rb', line 263

def coupon_total
  order.line_discounts.sum(:amount)
end

#couponsObject



253
254
255
256
257
# File 'app/models/liquid/order_drop.rb', line 253

def coupons
  order.discounts_grouped_by_coupon.map do |code, vals|
    { 'code' => code, 'title' => vals[:title], 'amount' => ActionController::Base.helpers.number_to_currency(vals[:amount]) }
  end
end

#created_atObject

Alias for Order#created_at

Returns:

  • (Object)

    Order#created_at

See Also:



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'app/models/liquid/order_drop.rb', line 9

delegate :company_review_url,
:product_review_url,
:reference_number,
:created_at,
:public_payment_link,
:any_rooms_not_orderable?,
:customer,
:opportunity,
:shipped_date,
:line_total,
:tax_total,
:spiff_reward,
:total_money,
:po_number,
:completely_shipped?,
:funded_by_advance_replacement?,
:id,
to: :order

#customerObject

Alias for Order#customer

Returns:

  • (Object)

    Order#customer

See Also:



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'app/models/liquid/order_drop.rb', line 9

delegate :company_review_url,
:product_review_url,
:reference_number,
:created_at,
:public_payment_link,
:any_rooms_not_orderable?,
:customer,
:opportunity,
:shipped_date,
:line_total,
:tax_total,
:spiff_reward,
:total_money,
:po_number,
:completely_shipped?,
:funded_by_advance_replacement?,
:id,
to: :order

#customer_emailObject



222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
# File 'app/models/liquid/order_drop.rb', line 222

def customer_email
  primary_party = order.primary_party
  # Try primary party (contact) email first
  email = primary_party&.email
  # Fall back to tracking_email if present
  email ||= order.tracking_email&.first
  # Fall back to customer email
  email ||= customer&.email
  # Fall back to primary party account email
  email ||= begin
    primary_party..email if primary_party.respond_to?(:account) && primary_party.
  rescue StandardError
    nil
  end
  # Fall back to customer account email
  email ||= begin
    customer..email if customer.respond_to?(:account) && customer.
  rescue StandardError
    nil
  end
  email
end

#customer_full_nameObject



216
217
218
219
# File 'app/models/liquid/order_drop.rb', line 216

def customer_full_name
  primary_party = order.primary_party
  primary_party&.full_name || customer&.full_name
end

#disclaimerObject



150
151
152
# File 'app/models/liquid/order_drop.rb', line 150

def disclaimer
  GENERAL_DISCLAIMER_ON_PRODUCT_INSTALLATION_AND_LOCAL_CODES
end

#discounted_shipping_costObject



126
127
128
# File 'app/models/liquid/order_drop.rb', line 126

def discounted_shipping_cost
  ActionController::Base.helpers.number_to_currency(order.shipping_cost)
end

#formatted_coupon_totalObject



259
260
261
# File 'app/models/liquid/order_drop.rb', line 259

def formatted_coupon_total
  ActionController::Base.helpers.number_to_currency(order.line_discounts.sum(:amount))
end

#formatted_tax_totalObject



104
105
106
# File 'app/models/liquid/order_drop.rb', line 104

def formatted_tax_total
  ActionController::Base.helpers.number_to_currency(order.tax_total)
end

#friendly_shipping_methodObject



116
117
118
119
120
121
122
123
124
# File 'app/models/liquid/order_drop.rb', line 116

def friendly_shipping_method
  if order.is_warehouse_pickup?
    'Warehouse Pickup'
  elsif order.friendly_shipping_method == 'Override'
    'Shipping'
  else
    order.friendly_shipping_method
  end
end

#funded_by_advance_replacement?Object

Alias for Order#funded_by_advance_replacement?

Returns:

  • (Object)

    Order#funded_by_advance_replacement?

See Also:



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'app/models/liquid/order_drop.rb', line 9

delegate :company_review_url,
:product_review_url,
:reference_number,
:created_at,
:public_payment_link,
:any_rooms_not_orderable?,
:customer,
:opportunity,
:shipped_date,
:line_total,
:tax_total,
:spiff_reward,
:total_money,
:po_number,
:completely_shipped?,
:funded_by_advance_replacement?,
:id,
to: :order

#has_dropship_items?Boolean

Returns:

  • (Boolean)


154
155
156
# File 'app/models/liquid/order_drop.rb', line 154

def has_dropship_items?
  order.line_items.any?(&:dropship?)
end

#has_out_of_stock_items?Boolean

Returns:

  • (Boolean)


179
180
181
182
# File 'app/models/liquid/order_drop.rb', line 179

def has_out_of_stock_items?
  item_availability = LineItem.availability_hash(order.line_items)
  order.line_items.any? { |li| li.show_out_of_stock?(item_availability) }
end

#has_po_numberObject



134
135
136
# File 'app/models/liquid/order_drop.rb', line 134

def has_po_number
  po_number.present?
end

#has_rooms_needing_layouts?Boolean

Returns:

  • (Boolean)


192
193
194
# File 'app/models/liquid/order_drop.rb', line 192

def has_rooms_needing_layouts?
  rooms_needing_layouts.any?
end

#has_service_items?Boolean

Returns:

  • (Boolean)


184
185
186
# File 'app/models/liquid/order_drop.rb', line 184

def has_service_items?
  order.line_items.any?(&:is_service?)
end

#idObject

Alias for Order#id

Returns:

  • (Object)

    Order#id

See Also:



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'app/models/liquid/order_drop.rb', line 9

delegate :company_review_url,
:product_review_url,
:reference_number,
:created_at,
:public_payment_link,
:any_rooms_not_orderable?,
:customer,
:opportunity,
:shipped_date,
:line_total,
:tax_total,
:spiff_reward,
:total_money,
:po_number,
:completely_shipped?,
:funded_by_advance_replacement?,
:id,
to: :order


246
247
248
249
250
251
# File 'app/models/liquid/order_drop.rb', line 246

def installation_plan_request_link
  room_name_ref_pairs = rooms_needing_layouts.map { |r| "#{r.name}: #{r.reference_number}" }
  subject = CGI.escape("INSTALLATION PLAN REQUEST FOR ORDER # #{order.reference_number}")
  body = CGI.escape("Attached please find room floor plan attachments for each of the following rooms:\r\n\r\n#{room_name_ref_pairs.join("\r\n")}\r\n\r\nPlease send me free installation plans for these rooms.")
  "mailto:#{rep_email}?subject=#{subject}&body=#{body}"
end

#is_canada_order?Boolean

Returns:

  • (Boolean)


267
268
269
# File 'app/models/liquid/order_drop.rb', line 267

def is_canada_order?
  order.store_id == 2
end

#is_pickup?Boolean

Returns:

  • (Boolean)


275
276
277
# File 'app/models/liquid/order_drop.rb', line 275

def is_pickup?
  order.is_warehouse_pickup?
end

#is_usa_order?Boolean

Returns:

  • (Boolean)


271
272
273
# File 'app/models/liquid/order_drop.rb', line 271

def is_usa_order?
  order.store_id == 1
end

#job_nameObject



138
139
140
# File 'app/models/liquid/order_drop.rb', line 138

def job_name
  order.opportunity&.name&.presence
end

#line_items_grouped_by_delivery_categoryObject



75
76
77
# File 'app/models/liquid/order_drop.rb', line 75

def line_items_grouped_by_delivery_category
  self.class.deliveries_to_formatted_hash(order.completed_regular_deliveries)
end

#line_items_grouped_by_roomObject



80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'app/models/liquid/order_drop.rb', line 80

def line_items_grouped_by_room
  line_items = {}
  order.line_items.parents_only.non_shipping.group_by { |li| li.room_configuration.try(:name_with_config) || 'Other Items' }.each do |rc, lines|
    line_items[rc] = []
    lines.each do |li|
      line_items[rc] << { 'sku' => li.sku,
                          'qty' => li.quantity,
                          'name' => li.name,
                          'unit_msrp_cost' => ActionController::Base.helpers.number_to_currency(li.price),
                          'msrp_total' => ActionController::Base.helpers.number_to_currency(li.price_total),
                          'unit_discounted_cost' => ActionController::Base.helpers.number_to_currency(li.discounted_price),
                          'discounted_total' => ActionController::Base.helpers.number_to_currency(li.total),
                          'discount' => ActionController::Base.helpers.number_to_currency(li.discounted_total - li.price_total),
                          'serial_number' => li.serial_number,
                          'redemption_code' => li.redemption_code }
    end
  end
  line_items
end

#line_totalObject

Alias for Order#line_total

Returns:

  • (Object)

    Order#line_total

See Also:



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'app/models/liquid/order_drop.rb', line 9

delegate :company_review_url,
:product_review_url,
:reference_number,
:created_at,
:public_payment_link,
:any_rooms_not_orderable?,
:customer,
:opportunity,
:shipped_date,
:line_total,
:tax_total,
:spiff_reward,
:total_money,
:po_number,
:completely_shipped?,
:funded_by_advance_replacement?,
:id,
to: :order

#lines_on_backorderObject

Returns an array of formatted strings describing items on backorder
Used by the ORDER_BO_NOTIFY email template



160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
# File 'app/models/liquid/order_drop.rb', line 160

def lines_on_backorder
  lines = []
  item_groups = Inventory::OrderedRemainingItems.new.process(order, nest_kit_components: true).item_groups
  item_groups.each do |_line_item_id, line_info|
    next unless line_info[:shortage]&.negative? # Skip those with stock

    line_message = "#{line_info[:name]} (#{line_info[:sku]})"
    line_message += ", #{line_info[:shortage].abs} on backorder"
    promised_delivery_date = line_info.dig(:on_order, 0, :promised_delivery_date)
    if promised_delivery_date && (promised_delivery_date > Date.current)
      promised_delivery_date_formatted = promised_delivery_date.strftime('%B %d, %Y')
      line_message += ", we expect to have this item back in stock on #{promised_delivery_date_formatted}"
    end
    lines << line_message
  end
  lines
end

#msrp_shipping_costObject



130
131
132
# File 'app/models/liquid/order_drop.rb', line 130

def msrp_shipping_cost
  ActionController::Base.helpers.number_to_currency(order.line_items.shipping_only.to_a.sum(&:price_total))
end

#opportunityObject

Alias for Order#opportunity

Returns:

  • (Object)

    Order#opportunity

See Also:



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'app/models/liquid/order_drop.rb', line 9

delegate :company_review_url,
:product_review_url,
:reference_number,
:created_at,
:public_payment_link,
:any_rooms_not_orderable?,
:customer,
:opportunity,
:shipped_date,
:line_total,
:tax_total,
:spiff_reward,
:total_money,
:po_number,
:completely_shipped?,
:funded_by_advance_replacement?,
:id,
to: :order

#po_numberObject

Alias for Order#po_number

Returns:

  • (Object)

    Order#po_number

See Also:



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'app/models/liquid/order_drop.rb', line 9

delegate :company_review_url,
:product_review_url,
:reference_number,
:created_at,
:public_payment_link,
:any_rooms_not_orderable?,
:customer,
:opportunity,
:shipped_date,
:line_total,
:tax_total,
:spiff_reward,
:total_money,
:po_number,
:completely_shipped?,
:funded_by_advance_replacement?,
:id,
to: :order

#product_review_urlObject

Alias for Order#product_review_url

Returns:

  • (Object)

    Order#product_review_url

See Also:



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'app/models/liquid/order_drop.rb', line 9

delegate :company_review_url,
:product_review_url,
:reference_number,
:created_at,
:public_payment_link,
:any_rooms_not_orderable?,
:customer,
:opportunity,
:shipped_date,
:line_total,
:tax_total,
:spiff_reward,
:total_money,
:po_number,
:completely_shipped?,
:funded_by_advance_replacement?,
:id,
to: :order

Alias for Order#public_payment_link

Returns:

  • (Object)

    Order#public_payment_link

See Also:



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'app/models/liquid/order_drop.rb', line 9

delegate :company_review_url,
:product_review_url,
:reference_number,
:created_at,
:public_payment_link,
:any_rooms_not_orderable?,
:customer,
:opportunity,
:shipped_date,
:line_total,
:tax_total,
:spiff_reward,
:total_money,
:po_number,
:completely_shipped?,
:funded_by_advance_replacement?,
:id,
to: :order

#quote_numberObject



142
143
144
# File 'app/models/liquid/order_drop.rb', line 142

def quote_number
  order.quote&.reference_number
end

#reference_numberObject

Alias for Order#reference_number

Returns:

  • (Object)

    Order#reference_number

See Also:



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'app/models/liquid/order_drop.rb', line 9

delegate :company_review_url,
:product_review_url,
:reference_number,
:created_at,
:public_payment_link,
:any_rooms_not_orderable?,
:customer,
:opportunity,
:shipped_date,
:line_total,
:tax_total,
:spiff_reward,
:total_money,
:po_number,
:completely_shipped?,
:funded_by_advance_replacement?,
:id,
to: :order

#rep_emailObject



212
213
214
# File 'app/models/liquid/order_drop.rb', line 212

def rep_email
  customer.primary_sales_rep.try(:email) || INFO_EMAIL
end

#rma_numberObject



279
280
281
# File 'app/models/liquid/order_drop.rb', line 279

def rma_number
  order.rma.try(:rma_number)
end

#rooms_needing_layoutsObject



196
197
198
# File 'app/models/liquid/order_drop.rb', line 196

def rooms_needing_layouts
  order.room_configurations.select { |r| r.room_layout_image.nil? }
end

#rooms_needing_layouts_formattedObject



200
201
202
# File 'app/models/liquid/order_drop.rb', line 200

def rooms_needing_layouts_formatted
  rooms_needing_layouts.map { |r| "#{r.name}: #{r.reference_number}" }.join("\r\n")
end


204
205
206
207
208
209
210
# File 'app/models/liquid/order_drop.rb', line 204

def rooms_needing_layouts_links
  links = {}
  rooms_needing_layouts.each do |r|
    links[r.name_with_room_and_opp] = "https://#{WEB_HOSTNAME}#{r.public_path}"
  end
  links
end

#service_only_order?Boolean

Returns:

  • (Boolean)


188
189
190
# File 'app/models/liquid/order_drop.rb', line 188

def service_only_order?
  order.line_items.non_shipping.any? && order.line_items.non_shipping.all?(&:is_service?)
end

#ship_from_attributesObject



37
38
39
# File 'app/models/liquid/order_drop.rb', line 37

def ship_from_attributes
  order.ship_from_attributes.stringify_keys
end

#ship_from_full_addressObject



46
47
48
# File 'app/models/liquid/order_drop.rb', line 46

def ship_from_full_address
  self.class.address_attributes_to_string ship_from_attributes
end

#ship_to_attributesObject



32
33
34
# File 'app/models/liquid/order_drop.rb', line 32

def ship_to_attributes
  order.ship_to_attributes.stringify_keys
end

#ship_to_full_addressObject



42
43
44
# File 'app/models/liquid/order_drop.rb', line 42

def ship_to_full_address
  self.class.address_attributes_to_string ship_to_attributes
end

#shipments_tracking_linesObject



146
147
148
# File 'app/models/liquid/order_drop.rb', line 146

def shipments_tracking_lines
  order.shipments.completed.map { |s| "#{s.carrier}: <a href='#{s.tracking_link}'>#{s.tracking_number}</a>" }
end

#shipped_dateObject

Alias for Order#shipped_date

Returns:

  • (Object)

    Order#shipped_date

See Also:



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'app/models/liquid/order_drop.rb', line 9

delegate :company_review_url,
:product_review_url,
:reference_number,
:created_at,
:public_payment_link,
:any_rooms_not_orderable?,
:customer,
:opportunity,
:shipped_date,
:line_total,
:tax_total,
:spiff_reward,
:total_money,
:po_number,
:completely_shipped?,
:funded_by_advance_replacement?,
:id,
to: :order

#spiff_rewardObject

Alias for Order#spiff_reward

Returns:

  • (Object)

    Order#spiff_reward

See Also:



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'app/models/liquid/order_drop.rb', line 9

delegate :company_review_url,
:product_review_url,
:reference_number,
:created_at,
:public_payment_link,
:any_rooms_not_orderable?,
:customer,
:opportunity,
:shipped_date,
:line_total,
:tax_total,
:spiff_reward,
:total_money,
:po_number,
:completely_shipped?,
:funded_by_advance_replacement?,
:id,
to: :order

#tax_totalObject

Alias for Order#tax_total

Returns:

  • (Object)

    Order#tax_total

See Also:



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'app/models/liquid/order_drop.rb', line 9

delegate :company_review_url,
:product_review_url,
:reference_number,
:created_at,
:public_payment_link,
:any_rooms_not_orderable?,
:customer,
:opportunity,
:shipped_date,
:line_total,
:tax_total,
:spiff_reward,
:total_money,
:po_number,
:completely_shipped?,
:funded_by_advance_replacement?,
:id,
to: :order

#taxesObject



108
109
110
111
112
113
114
# File 'app/models/liquid/order_drop.rb', line 108

def taxes
  taxes = {}
  order.taxes_grouped_by_type.each do |_code, tax_info|
    taxes[tax_info[:name]] = ActionController::Base.helpers.number_to_currency(tax_info[:tax_amount])
  end
  taxes
end

#totalObject



100
101
102
# File 'app/models/liquid/order_drop.rb', line 100

def total
  ActionController::Base.helpers.number_to_currency(order.total)
end

#total_moneyObject

Alias for Order#total_money

Returns:

  • (Object)

    Order#total_money

See Also:



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'app/models/liquid/order_drop.rb', line 9

delegate :company_review_url,
:product_review_url,
:reference_number,
:created_at,
:public_payment_link,
:any_rooms_not_orderable?,
:customer,
:opportunity,
:shipped_date,
:line_total,
:tax_total,
:spiff_reward,
:total_money,
:po_number,
:completely_shipped?,
:funded_by_advance_replacement?,
:id,
to: :order