effective_orders 5.1.9 → 5.1.13

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: aebed7dcf8c4b8c6e754b4425d407020ab7e3078baa82e0e5ddb10d748041d74
4
- data.tar.gz: a834e0574e803ad7af2e568395814a3fc7e2b129953dcc37e52bea17bae1a963
3
+ metadata.gz: d17fbe687d0cbbb9a8bea76c5a537d26edd929655f7ca620266ea9c9de1935f2
4
+ data.tar.gz: 49d1e34f960ce258483823bab108460344934bd6d4d3666655e523a56458f729
5
5
  SHA512:
6
- metadata.gz: b4162e7ec6328b52f4dc36b3a79199966980948cc8dbb9612a460105e4f9682c70586424be157baf897b07f501bff158499e80f3c77ea7f229b3351fa9bc9d61
7
- data.tar.gz: 27eff0b3035f2dbaf1e426aa7337a933b8f90ef44e88da04eac4fab0ba77f3d7d8ea3695b6bd3cf6e7d42f933f5186868076e45fb25c66717b1d8e423401883d
6
+ metadata.gz: e6aca42047832dbf391eeca8ac2f8fb6a896900ccc6e4e418b1463c3814c98f00838be8dcbfe26a2f7a065554f9f89537fbbd02cd1a01ebabdea1fe404a5abfa
7
+ data.tar.gz: 536e053ad280f5c755524414e1510a7be9cd270166fb50514299125d2a54b8c313ff1fd71265957816fb1a957e446aa51d01ea70cd439aa3effc0e8fa87ee1f9
@@ -43,7 +43,7 @@ module Effective
43
43
  @order = (order_param.kind_of?(Effective::Order) ? order_param : Effective::Order.find(order_param))
44
44
  @user = @order.user
45
45
 
46
- @subject = subject_for(@order, :payment_request_to_buyer, "Request for Payment: Invoice ##{@order.to_param}")
46
+ @subject = subject_for(@order, :payment_request_to_buyer, "Payment request - Order ##{@order.to_param}")
47
47
 
48
48
  mail({to: @order.email, cc: @order.cc, subject: @subject}.compact)
49
49
  end
@@ -265,14 +265,30 @@ module Effective
265
265
  end
266
266
 
267
267
  def label
268
- if refund?
269
- "Refund"
268
+ if refund? && purchased?
269
+ 'Refund'
270
270
  elsif purchased?
271
- "Receipt"
272
- elsif pending?
273
- "Pending Order"
271
+ 'Receipt'
272
+ elsif refund? && (pending? || confirmed?)
273
+ 'Pending Refund'
274
+ elsif (pending? || confirmed?)
275
+ 'Pending Order'
274
276
  else
275
- "Order"
277
+ 'Order'
278
+ end
279
+ end
280
+
281
+ def total_label
282
+ if refund? && purchased?
283
+ 'Total Paid'
284
+ elsif purchased?
285
+ 'Total Paid'
286
+ elsif refund? && (pending? || confirmed?)
287
+ 'Total Due'
288
+ elsif (pending? || confirmed?)
289
+ 'Total Due'
290
+ else
291
+ 'Total'
276
292
  end
277
293
  end
278
294
 
@@ -6,7 +6,7 @@
6
6
 
7
7
  - if order.purchased?
8
8
  = dropdown_link_to 'Email receipt to buyer', effective_orders.send_buyer_receipt_order_path(order),
9
- data: { confirm: "Send receipt to #{order.emails_send_to}?" }
9
+ data: { method: :post, confirm: "Send receipt to #{order.emails_send_to}?" }
10
10
 
11
11
  - if order.pending? || order.confirmed? || order.deferred?
12
12
  = dropdown_link_to 'Email request for payment to buyer', effective_orders.send_payment_request_admin_order_path(order),
@@ -5,7 +5,7 @@
5
5
  - if order.purchased?
6
6
  = link_to 'E-mail Receipt', effective_orders.send_buyer_receipt_order_path(order),
7
7
  class: 'btn btn-secondary',
8
- data: { confirm: "Send receipt to #{order.emails_send_to}?" }
8
+ data: { method: :post, confirm: "Send receipt to #{order.emails_send_to}?" }
9
9
 
10
10
  - if order.persisted? && EffectiveResources.authorized?(controller, :admin, :effective_orders)
11
11
  - if order.pending? || order.confirmed? || order.deferred?
@@ -62,11 +62,6 @@
62
62
  %th.download
63
63
 
64
64
  %th.total
65
- - if order.pending?
66
- Amount Due
67
- - elsif order.purchased?
68
- Amount Paid
69
- - else
70
- Total
65
+ = order.total_label
71
66
 
72
67
  %td.price.total-price= price_to_currency(order.total)
@@ -5,10 +5,7 @@
5
5
  = order.refund? ? 'Complete Refund' : 'Mark as Paid'
6
6
 
7
7
  = effective_form_with(model: order, url: effective_orders.mark_as_paid_order_path(order), method: :post) do |f|
8
- - if order.refund?
9
- = f.hidden_field :purchased_at, value: Time.zone.now
10
- - else
11
- = f.date_field :purchased_at, required: true
8
+ = f.hidden_field :purchased_at, value: Time.zone.now
12
9
 
13
10
  = f.select :payment_provider, EffectiveOrders.payment_providers, required: true
14
11
 
data/config/routes.rb CHANGED
@@ -5,7 +5,7 @@ EffectiveOrders::Engine.routes.draw do
5
5
  get :purchased
6
6
  get :deferred
7
7
  get :declined
8
- get :send_buyer_receipt
8
+ post :send_buyer_receipt
9
9
 
10
10
  post :free
11
11
  post :mark_as_paid
@@ -1,3 +1,3 @@
1
1
  module EffectiveOrders
2
- VERSION = '5.1.9'.freeze
2
+ VERSION = '5.1.13'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_orders
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.1.9
4
+ version: 5.1.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-09-14 00:00:00.000000000 Z
11
+ date: 2021-09-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails