effective_orders 5.9.0 → 5.9.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/admin/orders_controller.rb +15 -0
- data/app/datatables/admin/effective_orders_datatable.rb +2 -1
- data/app/datatables/effective_orders_datatable.rb +3 -3
- data/app/models/concerns/acts_as_purchasable.rb +12 -0
- data/app/views/admin/orders/_layout.html.haml +2 -0
- data/app/views/admin/orders/checkout.html.haml +3 -2
- data/app/views/admin/orders/edit.html.haml +12 -11
- data/app/views/admin/orders/index.html.haml +5 -4
- data/app/views/admin/orders/new.html.haml +3 -2
- data/app/views/admin/orders/show.html.haml +4 -3
- data/app/views/effective/orders/_layout.html.haml +2 -0
- data/app/views/effective/orders/declined.html.haml +9 -8
- data/app/views/effective/orders/deferred.html.haml +9 -8
- data/app/views/effective/orders/edit.html.haml +3 -2
- data/app/views/effective/orders/index.html.haml +3 -2
- data/app/views/effective/orders/new.html.haml +3 -2
- data/app/views/effective/orders/purchased.html.haml +7 -6
- data/app/views/effective/orders/show.html.haml +8 -7
- data/lib/effective_orders/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8207656323cf7dfe93656598ad79fec2db779f8879d1c89adce3d2c71f66b079
|
4
|
+
data.tar.gz: 705cf2da66eee1acdaf88dd41061d517d7701ec5ff7aa66d0369d1324e177b3e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 84102e16425ac192cf6f011ed9e10630971fb46beed5d16a433ae19e661e387e215d7242003e414ee76302cbe8c1913ccb86ada31a6caec9c86f32b3b6f0d083
|
7
|
+
data.tar.gz: 44845062ecb7a093b1139d65a4912b6edbc2a261cb119663ea06456981ac4262b97e1e68989039684fcf201afa934b71a89ae8321da56faf6ec3fa5e1741d1c4
|
@@ -20,6 +20,21 @@ module Admin
|
|
20
20
|
message
|
21
21
|
}
|
22
22
|
|
23
|
+
def create
|
24
|
+
@order = Effective::Order.new
|
25
|
+
@order.assign_attributes(permitted_params)
|
26
|
+
|
27
|
+
authorize_effective_order!
|
28
|
+
|
29
|
+
@page_title ||= 'New Order'
|
30
|
+
|
31
|
+
if save_resource(@order, :pending)
|
32
|
+
respond_with_success(@order, :save)
|
33
|
+
else
|
34
|
+
respond_with_error(@order, :save)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
23
38
|
# The show page posts to this action
|
24
39
|
# See Effective::OrdersController checkout
|
25
40
|
def checkout
|
@@ -40,7 +40,7 @@ class Admin::EffectiveOrdersDatatable < Effective::Datatable
|
|
40
40
|
end
|
41
41
|
|
42
42
|
col :purchased_at do |order|
|
43
|
-
order.purchased_at&.strftime('%F %H:%M') || ('pending refund' if order.pending_refund?) || 'not purchased'
|
43
|
+
order.purchased_at&.strftime('%F %H:%M') || ('pending refund' if order.pending_refund?) || ("pending #{order.payment_provider}" if order.deferred?) || 'not purchased'
|
44
44
|
end
|
45
45
|
|
46
46
|
if attributes[:user_id].blank?
|
@@ -66,6 +66,7 @@ class Admin::EffectiveOrdersDatatable < Effective::Datatable
|
|
66
66
|
end
|
67
67
|
|
68
68
|
col :payment_method
|
69
|
+
col :payment_provider
|
69
70
|
|
70
71
|
col :subtotal, as: :price, visible: false
|
71
72
|
col :tax, as: :price, visible: false
|
@@ -3,12 +3,12 @@
|
|
3
3
|
class EffectiveOrdersDatatable < Effective::Datatable
|
4
4
|
filters do
|
5
5
|
unless attributes[:not_purchased]
|
6
|
-
scope :
|
6
|
+
scope :all
|
7
|
+
scope :purchased
|
7
8
|
|
8
9
|
scope :deferred if EffectiveOrders.deferred_providers.present?
|
9
10
|
scope :refunds if EffectiveOrders.refund
|
10
|
-
|
11
|
-
scope :all
|
11
|
+
scope :not_purchased
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
@@ -1,3 +1,15 @@
|
|
1
|
+
# Acts as purchasable
|
2
|
+
# Add to your model:
|
3
|
+
# t.integer :purchased_order_id
|
4
|
+
# t.integer :price
|
5
|
+
# t.boolean :tax_exempt, default: false
|
6
|
+
# t.string :qb_item_name
|
7
|
+
# or
|
8
|
+
# add_column :resources, :purchased_order_id, :integer
|
9
|
+
# add_column :resources, :price, :integer
|
10
|
+
# add_column :resources, :tax_exempt, :boolean, default: false
|
11
|
+
# add_column :resources, :qb_item_name, :string
|
12
|
+
|
1
13
|
module ActsAsPurchasable
|
2
14
|
extend ActiveSupport::Concern
|
3
15
|
|
@@ -1,3 +1,4 @@
|
|
1
|
-
|
1
|
+
= render 'layout' do
|
2
|
+
%h1.effective-admin-heading= @page_title
|
2
3
|
|
3
|
-
= render_checkout(@order, namespace: :admin, purchased_url: effective_orders.admin_order_path(@order), declined_url: effective_orders.admin_order_path(@order))
|
4
|
+
= render_checkout(@order, namespace: :admin, purchased_url: effective_orders.admin_order_path(@order), declined_url: effective_orders.admin_order_path(@order))
|
@@ -1,15 +1,16 @@
|
|
1
|
-
|
1
|
+
= render 'layout' do
|
2
|
+
%h1.effective-admin-heading= @page_title
|
2
3
|
|
3
|
-
- if @order.custom_order? && @order.in_progress?
|
4
|
-
|
4
|
+
- if @order.custom_order? && @order.in_progress?
|
5
|
+
= render 'effective/orders/order_actions', order: @order
|
5
6
|
|
6
|
-
|
7
|
-
|
8
|
-
|
7
|
+
.mb-4
|
8
|
+
= collapse('show order') do
|
9
|
+
= render 'effective/orders/order', order: @order, no_order_actions: true
|
9
10
|
|
10
|
-
|
11
|
+
= render 'admin/orders/form', order: @order
|
11
12
|
|
12
|
-
- else
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
- else
|
14
|
+
- # Same as the show action
|
15
|
+
= render 'effective/orders/order', order: @order
|
16
|
+
= render 'admin/orders/form_note_internal', order: @order
|
@@ -1,6 +1,7 @@
|
|
1
|
-
|
1
|
+
= render 'layout' do
|
2
|
+
%h1.effective-admin-heading= @page_title
|
2
3
|
|
3
|
-
%p.text-right.effective-admin-actions
|
4
|
-
|
4
|
+
%p.text-right.effective-admin-actions
|
5
|
+
= link_to 'New Order', effective_orders.new_admin_order_path, class: 'btn btn-primary'
|
5
6
|
|
6
|
-
= render_datatable @datatable
|
7
|
+
= render_datatable @datatable
|
@@ -1,4 +1,5 @@
|
|
1
|
-
|
1
|
+
= render 'layout' do
|
2
|
+
%h1.effective-admin-heading= @page_title
|
2
3
|
|
3
|
-
= render 'effective/orders/order', order: @order
|
4
|
-
= render 'admin/orders/form_note_internal', order: @order
|
4
|
+
= render 'effective/orders/order', order: @order
|
5
|
+
= render 'admin/orders/form_note_internal', order: @order
|
@@ -1,10 +1,11 @@
|
|
1
|
-
|
1
|
+
= render 'layout' do
|
2
|
+
%h1.effective-heading= @page_title
|
2
3
|
|
3
|
-
%p.effective-orders-page-content
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
%p.effective-orders-page-content
|
5
|
+
- if current_cart.present?
|
6
|
+
Your #{link_to_current_cart(label: 'Cart')} items have been saved. Please try again.
|
7
|
+
- else
|
8
|
+
Please try again.
|
8
9
|
|
9
|
-
%p.text-center
|
10
|
-
|
10
|
+
%p.text-center
|
11
|
+
= link_to 'Continue', root_path, class: 'btn btn-primary'
|
@@ -1,11 +1,12 @@
|
|
1
|
-
|
1
|
+
= render 'layout' do
|
2
|
+
%h1.effective-heading= @page_title
|
2
3
|
|
3
|
-
%p.effective-orders-page-content
|
4
|
-
|
5
|
-
|
6
|
-
|
4
|
+
%p.effective-orders-page-content
|
5
|
+
You have indicated that this order will be paid by #{@order.payment_provider}.
|
6
|
+
Your order will not be considered purchased until we receive your payment.
|
7
|
+
Please contact us at your earliest convenience.
|
7
8
|
|
8
|
-
= render @order
|
9
|
+
= render @order
|
9
10
|
|
10
|
-
%p.text-center
|
11
|
-
|
11
|
+
%p.text-center
|
12
|
+
= link_to 'Continue', root_path, class: 'btn btn-primary'
|
@@ -1,9 +1,10 @@
|
|
1
|
-
|
1
|
+
= render 'layout' do
|
2
|
+
%h1.effective-heading= @page_title
|
2
3
|
|
3
|
-
%p.effective-orders-page-content
|
4
|
-
|
4
|
+
%p.effective-orders-page-content
|
5
|
+
You have successfully purchased the following:
|
5
6
|
|
6
|
-
= render @order
|
7
|
+
= render @order
|
7
8
|
|
8
|
-
%p.text-center
|
9
|
-
|
9
|
+
%p.text-center
|
10
|
+
= link_to 'Continue', root_path, class: 'btn btn-primary'
|
@@ -1,9 +1,10 @@
|
|
1
|
-
|
1
|
+
= render 'layout' do
|
2
|
+
%h1.effective-heading= @page_title
|
2
3
|
|
3
|
-
- if !@order.purchased? && @order.user == current_user
|
4
|
-
|
5
|
-
- else
|
6
|
-
|
4
|
+
- if !@order.purchased? && @order.user == current_user
|
5
|
+
= render_checkout(@order)
|
6
|
+
- else
|
7
|
+
= render(@order)
|
7
8
|
|
8
|
-
|
9
|
-
|
9
|
+
%p.text-center
|
10
|
+
= link_to 'Continue', effective_orders.orders_path, class: 'btn btn-primary'
|
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.9.
|
4
|
+
version: 5.9.2
|
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: 2022-
|
11
|
+
date: 2022-11-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -236,6 +236,7 @@ files:
|
|
236
236
|
- app/views/admin/orders/_datatable_actions.html.haml
|
237
237
|
- app/views/admin/orders/_form.html.haml
|
238
238
|
- app/views/admin/orders/_form_note_internal.html.haml
|
239
|
+
- app/views/admin/orders/_layout.html.haml
|
239
240
|
- app/views/admin/orders/_order_actions.html.haml
|
240
241
|
- app/views/admin/orders/_order_item_fields.html.haml
|
241
242
|
- app/views/admin/orders/checkout.html.haml
|
@@ -257,6 +258,7 @@ files:
|
|
257
258
|
- app/views/effective/orders/_fields.html.haml
|
258
259
|
- app/views/effective/orders/_fields_note.html.haml
|
259
260
|
- app/views/effective/orders/_fields_terms.html.haml
|
261
|
+
- app/views/effective/orders/_layout.html.haml
|
260
262
|
- app/views/effective/orders/_order.html.haml
|
261
263
|
- app/views/effective/orders/_order_actions.html.haml
|
262
264
|
- app/views/effective/orders/_order_deferred.html.haml
|