effective_orders 6.3.0 → 6.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/datatables/admin/report_transactions_datatable.rb +2 -0
- data/app/models/concerns/acts_as_purchasable.rb +1 -1
- data/app/models/effective/order.rb +4 -7
- data/app/models/effective/order_item.rb +4 -3
- data/app/views/admin/order_reports/index.html.haml +2 -1
- data/lib/effective_orders/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dcf54cb263731e52d92dde70fa2035f84ed936cdffedc4e4fb204812270f9ac6
|
4
|
+
data.tar.gz: 3c12854db2e85a59e269b9e804de2828973b95e361add948012863146a181359
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e627ddb5abcd86a77e66ad3ac4d880b83379fc7ed5d45188ffa662675d4fbdecbd6d1af05b4cae63a32334d529fea0a57ca7c14ef7aa9de7b59fa57bcb1de436
|
7
|
+
data.tar.gz: 32fe71842c0c28eb5c27e205fec73f065eaace30de1480f3ce7e07554306180522d35f02c5c7c08a6a3e63ae67cdb1b8c028f58af2a107fb4e12f8e3f982bbbc
|
@@ -116,14 +116,11 @@ module Effective
|
|
116
116
|
|
117
117
|
# Price validations
|
118
118
|
validates :subtotal, presence: true
|
119
|
+
validates :total, presence: true, if: -> { EffectiveOrders.minimum_charge.to_i > 0 }
|
119
120
|
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
validate(unless: -> { (free? && EffectiveOrders.free?) || (refund? && EffectiveOrders.refund?) }) do
|
124
|
-
if total.present? && total < EffectiveOrders.minimum_charge
|
125
|
-
errors.add(:total, "must be $#{'%0.2f' % (EffectiveOrders.minimum_charge.to_i / 100.0)} or more. Please add additional items.")
|
126
|
-
end
|
121
|
+
validate(if: -> { total.present? && EffectiveOrders.minimum_charge.to_i > 0 }, unless: -> { purchased? || (free? && EffectiveOrders.free?) || (refund? && EffectiveOrders.refund?) }) do
|
122
|
+
if total < EffectiveOrders.minimum_charge
|
123
|
+
errors.add(:total, "must be $#{'%0.2f' % (EffectiveOrders.minimum_charge.to_i / 100.0)} or more. Please add additional items.")
|
127
124
|
end
|
128
125
|
end
|
129
126
|
|
@@ -1,4 +1,7 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Effective
|
4
|
+
# An Order Item
|
2
5
|
class OrderItem < ActiveRecord::Base
|
3
6
|
self.table_name = EffectiveOrders.order_items_table_name.to_s
|
4
7
|
|
@@ -9,9 +12,7 @@ module Effective
|
|
9
12
|
|
10
13
|
log_changes(to: :order) if respond_to?(:log_changes)
|
11
14
|
|
12
|
-
if defined?(EffectiveQbSync)
|
13
|
-
has_one :qb_order_item
|
14
|
-
end
|
15
|
+
has_one :qb_order_item if defined?(EffectiveQbSync)
|
15
16
|
|
16
17
|
effective_resource do
|
17
18
|
name :string
|
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: 6.3.
|
4
|
+
version: 6.3.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: 2023-
|
11
|
+
date: 2023-04-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|