effective_orders 5.1.10 → 5.1.14

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: a31f4212c1ca7b711c0d7d03b69e58c6f1e0f77511883fa78409622323367062
4
- data.tar.gz: b79a13299a5ab09053ce2350f38195c6dd1eb5daf2e6bb7eda235ee521b78c39
3
+ metadata.gz: 9ea7a1a4554f56dd9230c6d1f4c4c00ae6884fb3d61508c1c437464a9106065b
4
+ data.tar.gz: 846428fc00eae462dbf46f128b777ec32d22ed8f47415d0b411de9922a39dee6
5
5
  SHA512:
6
- metadata.gz: 2068342ba84af239527321d6d566c1cd81cad00e91076dafbde3e77c02c491b4f8320d622b2144ec79b875db135da434e35604b7fa9af23e709ac0516990bd39
7
- data.tar.gz: 7ac19a161ebafaa92c463ebbc36d0a825c99eb4a8ccd20d5bd0d797fd91443413cb6187abe4a50820d8bdf6d565e8232e74caf788a9a7448c1ca27c9e25e1910
6
+ metadata.gz: f6bcd2880d585a48f68785e62f0b44e52627b68d42e1764ec642bccef8de36810314876bd26b9a24ca0216c2609fb8b8c11649d8c0b63f605f341dcf90c04444
7
+ data.tar.gz: cf6eced1338c660b98d2e75eca61b645899fcc6888772cef8c4184d07296ef7e3a684a8ed22c2a19231eb42d737305e0da1fcb74357a13138a8eb52f68d1813a
@@ -17,8 +17,10 @@ class Admin::EffectiveOrdersDatatable < Effective::Datatable
17
17
  unless attributes[:skip_filters]
18
18
  scope :all
19
19
  scope :purchased
20
- scope :deferred
21
- scope :refunds
20
+
21
+ scope :deferred if EffectiveOrders.deferred_providers.present?
22
+ scope :refunds if EffectiveOrders.refund
23
+
22
24
  scope :not_purchased
23
25
  end
24
26
  end
@@ -4,8 +4,11 @@ class EffectiveOrdersDatatable < Effective::Datatable
4
4
  filters do
5
5
  unless attributes[:not_purchased]
6
6
  scope :purchased, default: true
7
- scope :deferred
8
- scope :refunds
7
+
8
+ scope :deferred if EffectiveOrders.deferred_providers.present?
9
+ scope :refunds if EffectiveOrders.refund
10
+
11
+ scope :all
9
12
  end
10
13
  end
11
14
 
@@ -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),
@@ -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
 
@@ -1,3 +1,3 @@
1
1
  module EffectiveOrders
2
- VERSION = '5.1.10'.freeze
2
+ VERSION = '5.1.14'.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.10
4
+ version: 5.1.14
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-27 00:00:00.000000000 Z
11
+ date: 2021-10-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails