billing 0.0.9 → 0.1.0a
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/jobs/billing/issue_print_doc.rb +22 -5
- data/app/models/billing/bill.rb +20 -20
- data/app/models/billing/charge.rb +1 -1
- data/app/models/billing/modifier.rb +7 -3
- data/app/models/concerns/billing/bill_item.rb +2 -0
- data/lib/billing/version.rb +1 -1
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/db/schema.rb +5 -1
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/development.log +484 -0
- data/test/dummy/log/test.log +764 -0
- metadata +8 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bdd7495c66cfacd842fd55916bf4449fd8d9871c
|
4
|
+
data.tar.gz: 8ac3bbaa57155b5774031c8ee5858bbde682001c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: abaf03a7d7b75ea3e05f94fdbe9eea5943fabe3cfab69b6f8c25509b187ffb57037ed64b9ccfe777fcc27f3a8a4238157f60915556120662dd2973f9b0eebc1c
|
7
|
+
data.tar.gz: ff0aab102ae9b9d95d98d85a7c227375277edad2c8e83aa0ab0c31aef5f86b97b4cfe4900952fdfe4807631f3c001799a8f684eedca9938f4462573252637def
|
@@ -29,15 +29,32 @@ module Billing
|
|
29
29
|
s.print "\r\n------------------------------\r\n"
|
30
30
|
|
31
31
|
bill.charges.each do |charge|
|
32
|
-
|
32
|
+
text = "#{charge.qty ? charge.qty : 1} x #{charge.name}"
|
33
|
+
s.print "\r\n#{text.truncate(22).ljust(22)} #{charge.price.to_s.rjust(7)}\r\n"
|
34
|
+
if charge.description
|
35
|
+
s.print "#{charge.description.truncate(30)}\r\n"
|
36
|
+
end
|
33
37
|
if charge.modifier.present?
|
34
|
-
|
38
|
+
text = charge.modifier.percent_ratio.nil? ? "" : " #{charge.modifier.percentage}"
|
39
|
+
if charge.modifier.positive?
|
40
|
+
text += " Surcharge"
|
41
|
+
else
|
42
|
+
text += " Discount"
|
43
|
+
end
|
44
|
+
s.print "#{text.ljust(22)} #{(charge.value - charge.price).to_s.rjust(7)}\r\n"
|
35
45
|
end
|
36
46
|
end
|
37
|
-
if bill.modifiers.any?
|
38
|
-
s.print " Global modifier: #{bill.global_modifier_value.to_s.rjust(7)}\r\n"
|
39
|
-
end
|
40
47
|
s.print "-----------\r\n".rjust(32)
|
48
|
+
if bill.modifiers.global.any?
|
49
|
+
global_modifier = bill.modifiers.global.first
|
50
|
+
text = global_modifier.percent_ratio.nil? ? "" : " #{global_modifier.percentage}"
|
51
|
+
if global_modifier.positive?
|
52
|
+
text += " Surcharge"
|
53
|
+
else
|
54
|
+
text += " Discount"
|
55
|
+
end
|
56
|
+
s.print "#{text.ljust(22)} #{bill.global_modifier_value.to_s.rjust(7)}\r\n"
|
57
|
+
end
|
41
58
|
s.print "TOTAL: #{bill.total.to_s.rjust(20)}\r\n"
|
42
59
|
|
43
60
|
# s.print "..............................\r\n"
|
data/app/models/billing/bill.rb
CHANGED
@@ -2,7 +2,9 @@ module Billing
|
|
2
2
|
class Bill < ActiveRecord::Base
|
3
3
|
acts_as_paranoid if respond_to?(:acts_as_paranoid)
|
4
4
|
has_paper_trail class_name: 'Billing::Version' if respond_to?(:has_paper_trail)
|
5
|
-
|
5
|
+
|
6
|
+
attr_accessor :perform_print, :perform_fiscalize
|
7
|
+
|
6
8
|
monetize :charges_sum_cents
|
7
9
|
monetize :discounts_sum_cents
|
8
10
|
monetize :surcharges_sum_cents
|
@@ -40,8 +42,8 @@ module Billing
|
|
40
42
|
self.name = "B:#{number}" if name.nil?
|
41
43
|
end
|
42
44
|
before_save :perform_autofin, if: :becomes_paid?
|
43
|
-
|
44
|
-
|
45
|
+
after_commit :create_fiscal_job, on: [ :create, :update ]
|
46
|
+
after_commit :create_print_job, on: [ :create, :update ]
|
45
47
|
|
46
48
|
validates_numericality_of :total, greater_than_or_equal_to: 0
|
47
49
|
validates_numericality_of :balance, less_than_or_equal_to: 0
|
@@ -130,12 +132,15 @@ module Billing
|
|
130
132
|
def calculate_modifiers
|
131
133
|
charges_a = charges.to_a
|
132
134
|
@modifier_items = ModifierItems.new.tap() do |items|
|
133
|
-
modifiers.select{ |m| m.charge.present? }.each do |charge_modifier|
|
134
|
-
|
135
|
-
|
135
|
+
# modifiers.select{ |m| m.charge.present? }.each do |charge_modifier|
|
136
|
+
# charge = charges_a.find{ |c| c == charge_modifier.charge }
|
137
|
+
# mod_value = charge_modifier.percent_ratio.nil? ? charge_modifier.fixed_value : (charge_modifier.charge.price * charge_modifier.percent_ratio)
|
138
|
+
# charge.value = charge.price + mod_value
|
139
|
+
# items << Charge.new(price: mod_value, chargable: charge)
|
140
|
+
# end
|
141
|
+
charges_a.select{ |c| c.modifier.present? }.each do |charge|
|
142
|
+
mod_value = charge.modifier.percent_ratio.nil? ? charge.modifier.fixed_value : (charge.modifier.charge.price * charge.modifier.percent_ratio)
|
136
143
|
charge.value = charge.price + mod_value
|
137
|
-
#p charge.value
|
138
|
-
#p "-"
|
139
144
|
items << Charge.new(price: mod_value, chargable: charge)
|
140
145
|
end
|
141
146
|
modifiers.select{ |m| m.charge.nil? }.each do |global_modifier|
|
@@ -145,7 +150,7 @@ module Billing
|
|
145
150
|
end
|
146
151
|
def update_sumaries
|
147
152
|
calculate_modifiers
|
148
|
-
self.charges_sum = charges.to_a.sum(0.to_money, &:
|
153
|
+
self.charges_sum = charges.to_a.sum(0.to_money, &:price).to_money
|
149
154
|
self.discounts_sum = @modifier_items.discounts.sum(0.to_money, &:price).to_money
|
150
155
|
self.surcharges_sum = @modifier_items.surcharges.sum(0.to_money, &:price).to_money
|
151
156
|
self.payments_sum = payments.to_a.sum(0.to_money, &:value).to_money
|
@@ -170,38 +175,33 @@ module Billing
|
|
170
175
|
end
|
171
176
|
|
172
177
|
def perform_autofin
|
173
|
-
p "!!!!!!!!!!perform_autofin"
|
174
178
|
if autofin
|
175
179
|
self.finalized_at = Time.now
|
176
180
|
if defined?(Extface) && fiscalizable? && device = origin.try(:fiscal_device)
|
177
181
|
#self.extface_job = origin.fiscal_device.driver.fiscalize(self) if fiscalizable? && origin.try(:fiscal_device)
|
178
182
|
self.extface_job = device.jobs.new
|
183
|
+
self.perform_fiscalize = true
|
179
184
|
end
|
180
185
|
if defined?(Extface) && printable? && print_device = origin.try(:print_device)
|
181
186
|
#self.extface_job = origin.fiscal_device.driver.fiscalize(self) if fiscalizable? && origin.try(:fiscal_device)
|
182
187
|
self.print_job = print_device.jobs.new
|
188
|
+
self.perform_print = true
|
183
189
|
end
|
184
190
|
end
|
185
191
|
true
|
186
192
|
end
|
187
193
|
|
188
194
|
def create_fiscal_job
|
189
|
-
if
|
190
|
-
p "device: #{device.try(:id)}"
|
191
|
-
p "self: #{self.try(:id)}"
|
192
|
-
p "self.finalized_at changed: #{self.finalized_at_changed?}"
|
193
|
-
|
195
|
+
if @perform_fiscalize && defined?(Resque) && defined?(Extface) && device = origin.try(:fiscal_device)
|
194
196
|
Resque.enqueue_to("extface_#{device.id}", Billing::IssueFiscalDoc, self.id)
|
195
|
-
end
|
197
|
+
end if fiscalizable?
|
196
198
|
true
|
197
199
|
end
|
198
200
|
|
199
201
|
def create_print_job
|
200
|
-
if
|
201
|
-
p "################ vprint device: #{print_device.try(:id)}"
|
202
|
-
p "self: #{self.try(:id)}"
|
202
|
+
if @perform_print && defined?(Resque) && defined?(Extface) && print_device = origin.try(:print_device)
|
203
203
|
Resque.enqueue_to("extface_#{print_device.id}", Billing::IssuePrintDoc, self.id)
|
204
|
-
end
|
204
|
+
end if printable?
|
205
205
|
true
|
206
206
|
end
|
207
207
|
end
|
@@ -22,7 +22,7 @@ module Billing
|
|
22
22
|
validates_numericality_of :value, greater_than_or_equal_to: 0
|
23
23
|
|
24
24
|
after_initialize do
|
25
|
-
self.value = price #unless modifier.present? #bill validation will update modified value
|
25
|
+
self.value = price if self.new_record? #unless modifier.present? #bill validation will update modified value
|
26
26
|
end
|
27
27
|
|
28
28
|
def find_tax_group_mapping_for(fiscal_driver) # optimize and remove me!
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module Billing
|
2
2
|
class Modifier < ActiveRecord::Base
|
3
3
|
include BillItem
|
4
|
-
belongs_to :bill, inverse_of: :modifiers
|
4
|
+
belongs_to :bill, inverse_of: :modifiers#, validate: true
|
5
5
|
belongs_to :charge, inverse_of: :modifier
|
6
6
|
monetize :fixed_value_cents
|
7
7
|
|
@@ -11,8 +11,12 @@ module Billing
|
|
11
11
|
validates_uniqueness_of :charge, scope: :bill_id, allow_nil: true
|
12
12
|
validates_uniqueness_of :bill, scope: :charge_id
|
13
13
|
|
14
|
-
def
|
15
|
-
percent_ratio.nil? ?
|
14
|
+
def percentage
|
15
|
+
percent_ratio.nil? ? "" : "#{(percent_ratio * 100).to_i}%"
|
16
|
+
end
|
17
|
+
|
18
|
+
def positive?
|
19
|
+
percent_ratio.nil? ? fixed_value_cents > 0 : percent_ratio > 0
|
16
20
|
end
|
17
21
|
|
18
22
|
private
|
data/lib/billing/version.rb
CHANGED
Binary file
|
data/test/dummy/db/schema.rb
CHANGED
@@ -11,7 +11,7 @@
|
|
11
11
|
#
|
12
12
|
# It's strongly recommended that you check this file into your version control system.
|
13
13
|
|
14
|
-
ActiveRecord::Schema.define(version:
|
14
|
+
ActiveRecord::Schema.define(version: 20160824235224) do
|
15
15
|
|
16
16
|
create_table "billing_bills", force: :cascade do |t|
|
17
17
|
t.integer "billable_id"
|
@@ -38,6 +38,7 @@ ActiveRecord::Schema.define(version: 20150512040421) do
|
|
38
38
|
t.string "name", limit: 255
|
39
39
|
t.string "number", limit: 255
|
40
40
|
t.datetime "deleted_at"
|
41
|
+
t.integer "print_job_id"
|
41
42
|
end
|
42
43
|
|
43
44
|
add_index "billing_bills", ["billable_id", "billable_type"], name: "index_billing_bills_on_billable_id_and_billable_type"
|
@@ -134,6 +135,9 @@ ActiveRecord::Schema.define(version: 20150512040421) do
|
|
134
135
|
t.string "type", limit: 255
|
135
136
|
t.string "payment_model", limit: 255, default: "Billing::PaymentWithType"
|
136
137
|
t.integer "transfer_device_id"
|
138
|
+
t.integer "print_device_id"
|
139
|
+
t.string "print_header"
|
140
|
+
t.string "print_footer"
|
137
141
|
end
|
138
142
|
|
139
143
|
add_index "billing_origins", ["deleted_at"], name: "index_billing_origins_on_deleted_at"
|
Binary file
|
@@ -2809,4 +2809,488 @@ Migrating to AddDeletedAtToBillingReport (20150512040421)
|
|
2809
2809
|
SELECT sql
|
2810
2810
|
FROM sqlite_temp_master
|
2811
2811
|
WHERE name='index_billing_versions_on_item_type_and_item_id' AND type='index'
|
2812
|
+
[0m
|
2813
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.2ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
2814
|
+
Migrating to AddPrintDeviceToBillingOrigin (20160723160908)
|
2815
|
+
[1m[35m (0.1ms)[0m begin transaction
|
2816
|
+
[1m[36m (0.4ms)[0m [1mALTER TABLE "billing_origins" ADD "print_device_id" integer[0m
|
2817
|
+
[1m[35mSQL (0.4ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20160723160908"]]
|
2818
|
+
[1m[36m (115.6ms)[0m [1mcommit transaction[0m
|
2819
|
+
Migrating to AddPrintJobToBillingBill (20160723234233)
|
2820
|
+
[1m[35m (0.3ms)[0m begin transaction
|
2821
|
+
[1m[36m (1.8ms)[0m [1mALTER TABLE "billing_bills" ADD "print_job_id" integer[0m
|
2822
|
+
[1m[35mSQL (0.5ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20160723234233"]]
|
2823
|
+
[1m[36m (140.1ms)[0m [1mcommit transaction[0m
|
2824
|
+
Migrating to AddPrintHeadersToBillingOrigin (20160824235224)
|
2825
|
+
[1m[35m (0.2ms)[0m begin transaction
|
2826
|
+
[1m[36m (0.8ms)[0m [1mALTER TABLE "billing_origins" ADD "print_header" varchar[0m
|
2827
|
+
[1m[35m (0.4ms)[0m ALTER TABLE "billing_origins" ADD "print_footer" varchar
|
2828
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES (?)[0m [["version", "20160824235224"]]
|
2829
|
+
[1m[35m (116.1ms)[0m commit transaction
|
2830
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.7ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
2831
|
+
[1m[35m (0.5ms)[0m SELECT sql
|
2832
|
+
FROM sqlite_master
|
2833
|
+
WHERE name='index_billing_bills_on_billable_id_and_billable_type' AND type='index'
|
2834
|
+
UNION ALL
|
2835
|
+
SELECT sql
|
2836
|
+
FROM sqlite_temp_master
|
2837
|
+
WHERE name='index_billing_bills_on_billable_id_and_billable_type' AND type='index'
|
2838
|
+
|
2839
|
+
[1m[36m (0.3ms)[0m [1m SELECT sql
|
2840
|
+
FROM sqlite_master
|
2841
|
+
WHERE name='index_billing_bills_on_origin_id' AND type='index'
|
2842
|
+
UNION ALL
|
2843
|
+
SELECT sql
|
2844
|
+
FROM sqlite_temp_master
|
2845
|
+
WHERE name='index_billing_bills_on_origin_id' AND type='index'
|
2846
|
+
[0m
|
2847
|
+
[1m[35m (0.3ms)[0m SELECT sql
|
2848
|
+
FROM sqlite_master
|
2849
|
+
WHERE name='index_billing_bills_on_extface_job_id' AND type='index'
|
2850
|
+
UNION ALL
|
2851
|
+
SELECT sql
|
2852
|
+
FROM sqlite_temp_master
|
2853
|
+
WHERE name='index_billing_bills_on_extface_job_id' AND type='index'
|
2854
|
+
|
2855
|
+
[1m[36m (0.2ms)[0m [1m SELECT sql
|
2856
|
+
FROM sqlite_master
|
2857
|
+
WHERE name='index_billing_bills_on_report_id' AND type='index'
|
2858
|
+
UNION ALL
|
2859
|
+
SELECT sql
|
2860
|
+
FROM sqlite_temp_master
|
2861
|
+
WHERE name='index_billing_bills_on_report_id' AND type='index'
|
2862
|
+
[0m
|
2863
|
+
[1m[35m (0.2ms)[0m SELECT sql
|
2864
|
+
FROM sqlite_master
|
2865
|
+
WHERE name='index_billing_charges_on_bill_id' AND type='index'
|
2866
|
+
UNION ALL
|
2867
|
+
SELECT sql
|
2868
|
+
FROM sqlite_temp_master
|
2869
|
+
WHERE name='index_billing_charges_on_bill_id' AND type='index'
|
2870
|
+
|
2871
|
+
[1m[36m (0.2ms)[0m [1m SELECT sql
|
2872
|
+
FROM sqlite_master
|
2873
|
+
WHERE name='index_billing_charges_on_revenue_at' AND type='index'
|
2874
|
+
UNION ALL
|
2875
|
+
SELECT sql
|
2876
|
+
FROM sqlite_temp_master
|
2877
|
+
WHERE name='index_billing_charges_on_revenue_at' AND type='index'
|
2878
|
+
[0m
|
2879
|
+
[1m[35m (0.2ms)[0m SELECT sql
|
2880
|
+
FROM sqlite_master
|
2881
|
+
WHERE name='index_billing_charges_on_deleted_at' AND type='index'
|
2882
|
+
UNION ALL
|
2883
|
+
SELECT sql
|
2884
|
+
FROM sqlite_temp_master
|
2885
|
+
WHERE name='index_billing_charges_on_deleted_at' AND type='index'
|
2886
|
+
|
2887
|
+
[1m[36m (0.2ms)[0m [1m SELECT sql
|
2888
|
+
FROM sqlite_master
|
2889
|
+
WHERE name='index_billing_charges_on_origin_id' AND type='index'
|
2890
|
+
UNION ALL
|
2891
|
+
SELECT sql
|
2892
|
+
FROM sqlite_temp_master
|
2893
|
+
WHERE name='index_billing_charges_on_origin_id' AND type='index'
|
2894
|
+
[0m
|
2895
|
+
[1m[35m (0.3ms)[0m SELECT sql
|
2896
|
+
FROM sqlite_master
|
2897
|
+
WHERE name='index_billing_charges_on_chargable_id_and_chargable_type' AND type='index'
|
2898
|
+
UNION ALL
|
2899
|
+
SELECT sql
|
2900
|
+
FROM sqlite_temp_master
|
2901
|
+
WHERE name='index_billing_charges_on_chargable_id_and_chargable_type' AND type='index'
|
2902
|
+
|
2903
|
+
[1m[36m (0.2ms)[0m [1m SELECT sql
|
2904
|
+
FROM sqlite_master
|
2905
|
+
WHERE name='index_billing_departments_on_deleted_at' AND type='index'
|
2906
|
+
UNION ALL
|
2907
|
+
SELECT sql
|
2908
|
+
FROM sqlite_temp_master
|
2909
|
+
WHERE name='index_billing_departments_on_deleted_at' AND type='index'
|
2910
|
+
[0m
|
2911
|
+
[1m[35m (0.2ms)[0m SELECT sql
|
2912
|
+
FROM sqlite_master
|
2913
|
+
WHERE name='index_billing_departments_on_tax_group_id' AND type='index'
|
2914
|
+
UNION ALL
|
2915
|
+
SELECT sql
|
2916
|
+
FROM sqlite_temp_master
|
2917
|
+
WHERE name='index_billing_departments_on_tax_group_id' AND type='index'
|
2918
|
+
|
2919
|
+
[1m[36m (0.2ms)[0m [1m SELECT sql
|
2920
|
+
FROM sqlite_master
|
2921
|
+
WHERE name='index_billing_modifiers_on_bill_id' AND type='index'
|
2922
|
+
UNION ALL
|
2923
|
+
SELECT sql
|
2924
|
+
FROM sqlite_temp_master
|
2925
|
+
WHERE name='index_billing_modifiers_on_bill_id' AND type='index'
|
2926
|
+
[0m
|
2927
|
+
[1m[35m (0.1ms)[0m SELECT sql
|
2928
|
+
FROM sqlite_master
|
2929
|
+
WHERE name='index_billing_op_fp_mappings_on_operator_id' AND type='index'
|
2930
|
+
UNION ALL
|
2931
|
+
SELECT sql
|
2932
|
+
FROM sqlite_temp_master
|
2933
|
+
WHERE name='index_billing_op_fp_mappings_on_operator_id' AND type='index'
|
2934
|
+
|
2935
|
+
[1m[36m (0.2ms)[0m [1m SELECT sql
|
2936
|
+
FROM sqlite_master
|
2937
|
+
WHERE name='index_billing_op_fp_mappings_on_extface_driver_id' AND type='index'
|
2938
|
+
UNION ALL
|
2939
|
+
SELECT sql
|
2940
|
+
FROM sqlite_temp_master
|
2941
|
+
WHERE name='index_billing_op_fp_mappings_on_extface_driver_id' AND type='index'
|
2942
|
+
[0m
|
2943
|
+
[1m[35m (0.2ms)[0m SELECT sql
|
2944
|
+
FROM sqlite_master
|
2945
|
+
WHERE name='index_billing_operators_on_deleted_at' AND type='index'
|
2946
|
+
UNION ALL
|
2947
|
+
SELECT sql
|
2948
|
+
FROM sqlite_temp_master
|
2949
|
+
WHERE name='index_billing_operators_on_deleted_at' AND type='index'
|
2950
|
+
|
2951
|
+
[1m[36m (0.1ms)[0m [1m SELECT sql
|
2952
|
+
FROM sqlite_master
|
2953
|
+
WHERE name='index_billing_origins_on_transfer_device_id' AND type='index'
|
2954
|
+
UNION ALL
|
2955
|
+
SELECT sql
|
2956
|
+
FROM sqlite_temp_master
|
2957
|
+
WHERE name='index_billing_origins_on_transfer_device_id' AND type='index'
|
2958
|
+
[0m
|
2959
|
+
[1m[35m (0.2ms)[0m SELECT sql
|
2960
|
+
FROM sqlite_master
|
2961
|
+
WHERE name='index_billing_origins_on_deleted_at' AND type='index'
|
2962
|
+
UNION ALL
|
2963
|
+
SELECT sql
|
2964
|
+
FROM sqlite_temp_master
|
2965
|
+
WHERE name='index_billing_origins_on_deleted_at' AND type='index'
|
2966
|
+
|
2967
|
+
[1m[36m (0.2ms)[0m [1m SELECT sql
|
2968
|
+
FROM sqlite_master
|
2969
|
+
WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index'
|
2970
|
+
UNION ALL
|
2971
|
+
SELECT sql
|
2972
|
+
FROM sqlite_temp_master
|
2973
|
+
WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index'
|
2974
|
+
[0m
|
2975
|
+
[1m[35m (0.2ms)[0m SELECT sql
|
2976
|
+
FROM sqlite_master
|
2977
|
+
WHERE name='index_billing_payment_types_on_deleted_at' AND type='index'
|
2978
|
+
UNION ALL
|
2979
|
+
SELECT sql
|
2980
|
+
FROM sqlite_temp_master
|
2981
|
+
WHERE name='index_billing_payment_types_on_deleted_at' AND type='index'
|
2982
|
+
|
2983
|
+
[1m[36m (0.2ms)[0m [1m SELECT sql
|
2984
|
+
FROM sqlite_master
|
2985
|
+
WHERE name='index_billing_payments_on_bill_id' AND type='index'
|
2986
|
+
UNION ALL
|
2987
|
+
SELECT sql
|
2988
|
+
FROM sqlite_temp_master
|
2989
|
+
WHERE name='index_billing_payments_on_bill_id' AND type='index'
|
2990
|
+
[0m
|
2991
|
+
[1m[35m (0.2ms)[0m SELECT sql
|
2992
|
+
FROM sqlite_master
|
2993
|
+
WHERE name='index_billing_payments_on_deleted_at' AND type='index'
|
2994
|
+
UNION ALL
|
2995
|
+
SELECT sql
|
2996
|
+
FROM sqlite_temp_master
|
2997
|
+
WHERE name='index_billing_payments_on_deleted_at' AND type='index'
|
2998
|
+
|
2999
|
+
[1m[36m (0.2ms)[0m [1m SELECT sql
|
3000
|
+
FROM sqlite_master
|
3001
|
+
WHERE name='index_billing_plus_on_department_id' AND type='index'
|
3002
|
+
UNION ALL
|
3003
|
+
SELECT sql
|
3004
|
+
FROM sqlite_temp_master
|
3005
|
+
WHERE name='index_billing_plus_on_department_id' AND type='index'
|
3006
|
+
[0m
|
3007
|
+
[1m[35m (0.2ms)[0m SELECT sql
|
3008
|
+
FROM sqlite_master
|
3009
|
+
WHERE name='index_billing_plus_on_tax_group_id' AND type='index'
|
3010
|
+
UNION ALL
|
3011
|
+
SELECT sql
|
3012
|
+
FROM sqlite_temp_master
|
3013
|
+
WHERE name='index_billing_plus_on_tax_group_id' AND type='index'
|
3014
|
+
|
3015
|
+
[1m[36m (0.2ms)[0m [1m SELECT sql
|
3016
|
+
FROM sqlite_master
|
3017
|
+
WHERE name='index_billing_pt_fp_mappings_on_payment_type_id' AND type='index'
|
3018
|
+
UNION ALL
|
3019
|
+
SELECT sql
|
3020
|
+
FROM sqlite_temp_master
|
3021
|
+
WHERE name='index_billing_pt_fp_mappings_on_payment_type_id' AND type='index'
|
3022
|
+
[0m
|
3023
|
+
[1m[35m (0.2ms)[0m SELECT sql
|
3024
|
+
FROM sqlite_master
|
3025
|
+
WHERE name='index_billing_pt_fp_mappings_on_extface_driver_id' AND type='index'
|
3026
|
+
UNION ALL
|
3027
|
+
SELECT sql
|
3028
|
+
FROM sqlite_temp_master
|
3029
|
+
WHERE name='index_billing_pt_fp_mappings_on_extface_driver_id' AND type='index'
|
3030
|
+
|
3031
|
+
[1m[36m (0.2ms)[0m [1m SELECT sql
|
3032
|
+
FROM sqlite_master
|
3033
|
+
WHERE name='index_billing_reports_on_origin_id' AND type='index'
|
3034
|
+
UNION ALL
|
3035
|
+
SELECT sql
|
3036
|
+
FROM sqlite_temp_master
|
3037
|
+
WHERE name='index_billing_reports_on_origin_id' AND type='index'
|
3038
|
+
[0m
|
3039
|
+
[1m[35m (0.1ms)[0m SELECT sql
|
3040
|
+
FROM sqlite_master
|
3041
|
+
WHERE name='index_billing_tg_fp_mappings_on_tax_group_id' AND type='index'
|
3042
|
+
UNION ALL
|
3043
|
+
SELECT sql
|
3044
|
+
FROM sqlite_temp_master
|
3045
|
+
WHERE name='index_billing_tg_fp_mappings_on_tax_group_id' AND type='index'
|
3046
|
+
|
3047
|
+
[1m[36m (0.2ms)[0m [1m SELECT sql
|
3048
|
+
FROM sqlite_master
|
3049
|
+
WHERE name='index_billing_tg_fp_mappings_on_extface_driver_id' AND type='index'
|
3050
|
+
UNION ALL
|
3051
|
+
SELECT sql
|
3052
|
+
FROM sqlite_temp_master
|
3053
|
+
WHERE name='index_billing_tg_fp_mappings_on_extface_driver_id' AND type='index'
|
3054
|
+
[0m
|
3055
|
+
[1m[35m (0.2ms)[0m SELECT sql
|
3056
|
+
FROM sqlite_master
|
3057
|
+
WHERE name='index_billing_versions_on_item_type_and_item_id' AND type='index'
|
3058
|
+
UNION ALL
|
3059
|
+
SELECT sql
|
3060
|
+
FROM sqlite_temp_master
|
3061
|
+
WHERE name='index_billing_versions_on_item_type_and_item_id' AND type='index'
|
3062
|
+
|
3063
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.2ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
3064
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.2ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
3065
|
+
[1m[36m (0.2ms)[0m [1m SELECT sql
|
3066
|
+
FROM sqlite_master
|
3067
|
+
WHERE name='index_billing_bills_on_billable_id_and_billable_type' AND type='index'
|
3068
|
+
UNION ALL
|
3069
|
+
SELECT sql
|
3070
|
+
FROM sqlite_temp_master
|
3071
|
+
WHERE name='index_billing_bills_on_billable_id_and_billable_type' AND type='index'
|
3072
|
+
[0m
|
3073
|
+
[1m[35m (0.1ms)[0m SELECT sql
|
3074
|
+
FROM sqlite_master
|
3075
|
+
WHERE name='index_billing_bills_on_origin_id' AND type='index'
|
3076
|
+
UNION ALL
|
3077
|
+
SELECT sql
|
3078
|
+
FROM sqlite_temp_master
|
3079
|
+
WHERE name='index_billing_bills_on_origin_id' AND type='index'
|
3080
|
+
|
3081
|
+
[1m[36m (0.1ms)[0m [1m SELECT sql
|
3082
|
+
FROM sqlite_master
|
3083
|
+
WHERE name='index_billing_bills_on_extface_job_id' AND type='index'
|
3084
|
+
UNION ALL
|
3085
|
+
SELECT sql
|
3086
|
+
FROM sqlite_temp_master
|
3087
|
+
WHERE name='index_billing_bills_on_extface_job_id' AND type='index'
|
3088
|
+
[0m
|
3089
|
+
[1m[35m (0.1ms)[0m SELECT sql
|
3090
|
+
FROM sqlite_master
|
3091
|
+
WHERE name='index_billing_bills_on_report_id' AND type='index'
|
3092
|
+
UNION ALL
|
3093
|
+
SELECT sql
|
3094
|
+
FROM sqlite_temp_master
|
3095
|
+
WHERE name='index_billing_bills_on_report_id' AND type='index'
|
3096
|
+
|
3097
|
+
[1m[36m (0.1ms)[0m [1m SELECT sql
|
3098
|
+
FROM sqlite_master
|
3099
|
+
WHERE name='index_billing_charges_on_bill_id' AND type='index'
|
3100
|
+
UNION ALL
|
3101
|
+
SELECT sql
|
3102
|
+
FROM sqlite_temp_master
|
3103
|
+
WHERE name='index_billing_charges_on_bill_id' AND type='index'
|
3104
|
+
[0m
|
3105
|
+
[1m[35m (0.2ms)[0m SELECT sql
|
3106
|
+
FROM sqlite_master
|
3107
|
+
WHERE name='index_billing_charges_on_revenue_at' AND type='index'
|
3108
|
+
UNION ALL
|
3109
|
+
SELECT sql
|
3110
|
+
FROM sqlite_temp_master
|
3111
|
+
WHERE name='index_billing_charges_on_revenue_at' AND type='index'
|
3112
|
+
|
3113
|
+
[1m[36m (0.1ms)[0m [1m SELECT sql
|
3114
|
+
FROM sqlite_master
|
3115
|
+
WHERE name='index_billing_charges_on_deleted_at' AND type='index'
|
3116
|
+
UNION ALL
|
3117
|
+
SELECT sql
|
3118
|
+
FROM sqlite_temp_master
|
3119
|
+
WHERE name='index_billing_charges_on_deleted_at' AND type='index'
|
3120
|
+
[0m
|
3121
|
+
[1m[35m (0.1ms)[0m SELECT sql
|
3122
|
+
FROM sqlite_master
|
3123
|
+
WHERE name='index_billing_charges_on_origin_id' AND type='index'
|
3124
|
+
UNION ALL
|
3125
|
+
SELECT sql
|
3126
|
+
FROM sqlite_temp_master
|
3127
|
+
WHERE name='index_billing_charges_on_origin_id' AND type='index'
|
3128
|
+
|
3129
|
+
[1m[36m (0.1ms)[0m [1m SELECT sql
|
3130
|
+
FROM sqlite_master
|
3131
|
+
WHERE name='index_billing_charges_on_chargable_id_and_chargable_type' AND type='index'
|
3132
|
+
UNION ALL
|
3133
|
+
SELECT sql
|
3134
|
+
FROM sqlite_temp_master
|
3135
|
+
WHERE name='index_billing_charges_on_chargable_id_and_chargable_type' AND type='index'
|
3136
|
+
[0m
|
3137
|
+
[1m[35m (0.1ms)[0m SELECT sql
|
3138
|
+
FROM sqlite_master
|
3139
|
+
WHERE name='index_billing_departments_on_deleted_at' AND type='index'
|
3140
|
+
UNION ALL
|
3141
|
+
SELECT sql
|
3142
|
+
FROM sqlite_temp_master
|
3143
|
+
WHERE name='index_billing_departments_on_deleted_at' AND type='index'
|
3144
|
+
|
3145
|
+
[1m[36m (0.1ms)[0m [1m SELECT sql
|
3146
|
+
FROM sqlite_master
|
3147
|
+
WHERE name='index_billing_departments_on_tax_group_id' AND type='index'
|
3148
|
+
UNION ALL
|
3149
|
+
SELECT sql
|
3150
|
+
FROM sqlite_temp_master
|
3151
|
+
WHERE name='index_billing_departments_on_tax_group_id' AND type='index'
|
3152
|
+
[0m
|
3153
|
+
[1m[35m (0.1ms)[0m SELECT sql
|
3154
|
+
FROM sqlite_master
|
3155
|
+
WHERE name='index_billing_modifiers_on_bill_id' AND type='index'
|
3156
|
+
UNION ALL
|
3157
|
+
SELECT sql
|
3158
|
+
FROM sqlite_temp_master
|
3159
|
+
WHERE name='index_billing_modifiers_on_bill_id' AND type='index'
|
3160
|
+
|
3161
|
+
[1m[36m (0.1ms)[0m [1m SELECT sql
|
3162
|
+
FROM sqlite_master
|
3163
|
+
WHERE name='index_billing_op_fp_mappings_on_operator_id' AND type='index'
|
3164
|
+
UNION ALL
|
3165
|
+
SELECT sql
|
3166
|
+
FROM sqlite_temp_master
|
3167
|
+
WHERE name='index_billing_op_fp_mappings_on_operator_id' AND type='index'
|
3168
|
+
[0m
|
3169
|
+
[1m[35m (0.1ms)[0m SELECT sql
|
3170
|
+
FROM sqlite_master
|
3171
|
+
WHERE name='index_billing_op_fp_mappings_on_extface_driver_id' AND type='index'
|
3172
|
+
UNION ALL
|
3173
|
+
SELECT sql
|
3174
|
+
FROM sqlite_temp_master
|
3175
|
+
WHERE name='index_billing_op_fp_mappings_on_extface_driver_id' AND type='index'
|
3176
|
+
|
3177
|
+
[1m[36m (0.1ms)[0m [1m SELECT sql
|
3178
|
+
FROM sqlite_master
|
3179
|
+
WHERE name='index_billing_operators_on_deleted_at' AND type='index'
|
3180
|
+
UNION ALL
|
3181
|
+
SELECT sql
|
3182
|
+
FROM sqlite_temp_master
|
3183
|
+
WHERE name='index_billing_operators_on_deleted_at' AND type='index'
|
3184
|
+
[0m
|
3185
|
+
[1m[35m (0.1ms)[0m SELECT sql
|
3186
|
+
FROM sqlite_master
|
3187
|
+
WHERE name='index_billing_origins_on_transfer_device_id' AND type='index'
|
3188
|
+
UNION ALL
|
3189
|
+
SELECT sql
|
3190
|
+
FROM sqlite_temp_master
|
3191
|
+
WHERE name='index_billing_origins_on_transfer_device_id' AND type='index'
|
3192
|
+
|
3193
|
+
[1m[36m (0.1ms)[0m [1m SELECT sql
|
3194
|
+
FROM sqlite_master
|
3195
|
+
WHERE name='index_billing_origins_on_deleted_at' AND type='index'
|
3196
|
+
UNION ALL
|
3197
|
+
SELECT sql
|
3198
|
+
FROM sqlite_temp_master
|
3199
|
+
WHERE name='index_billing_origins_on_deleted_at' AND type='index'
|
3200
|
+
[0m
|
3201
|
+
[1m[35m (0.1ms)[0m SELECT sql
|
3202
|
+
FROM sqlite_master
|
3203
|
+
WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index'
|
3204
|
+
UNION ALL
|
3205
|
+
SELECT sql
|
3206
|
+
FROM sqlite_temp_master
|
3207
|
+
WHERE name='index_billing_origins_on_fiscal_device_id' AND type='index'
|
3208
|
+
|
3209
|
+
[1m[36m (0.1ms)[0m [1m SELECT sql
|
3210
|
+
FROM sqlite_master
|
3211
|
+
WHERE name='index_billing_payment_types_on_deleted_at' AND type='index'
|
3212
|
+
UNION ALL
|
3213
|
+
SELECT sql
|
3214
|
+
FROM sqlite_temp_master
|
3215
|
+
WHERE name='index_billing_payment_types_on_deleted_at' AND type='index'
|
3216
|
+
[0m
|
3217
|
+
[1m[35m (0.1ms)[0m SELECT sql
|
3218
|
+
FROM sqlite_master
|
3219
|
+
WHERE name='index_billing_payments_on_bill_id' AND type='index'
|
3220
|
+
UNION ALL
|
3221
|
+
SELECT sql
|
3222
|
+
FROM sqlite_temp_master
|
3223
|
+
WHERE name='index_billing_payments_on_bill_id' AND type='index'
|
3224
|
+
|
3225
|
+
[1m[36m (0.1ms)[0m [1m SELECT sql
|
3226
|
+
FROM sqlite_master
|
3227
|
+
WHERE name='index_billing_payments_on_deleted_at' AND type='index'
|
3228
|
+
UNION ALL
|
3229
|
+
SELECT sql
|
3230
|
+
FROM sqlite_temp_master
|
3231
|
+
WHERE name='index_billing_payments_on_deleted_at' AND type='index'
|
3232
|
+
[0m
|
3233
|
+
[1m[35m (0.1ms)[0m SELECT sql
|
3234
|
+
FROM sqlite_master
|
3235
|
+
WHERE name='index_billing_plus_on_department_id' AND type='index'
|
3236
|
+
UNION ALL
|
3237
|
+
SELECT sql
|
3238
|
+
FROM sqlite_temp_master
|
3239
|
+
WHERE name='index_billing_plus_on_department_id' AND type='index'
|
3240
|
+
|
3241
|
+
[1m[36m (0.1ms)[0m [1m SELECT sql
|
3242
|
+
FROM sqlite_master
|
3243
|
+
WHERE name='index_billing_plus_on_tax_group_id' AND type='index'
|
3244
|
+
UNION ALL
|
3245
|
+
SELECT sql
|
3246
|
+
FROM sqlite_temp_master
|
3247
|
+
WHERE name='index_billing_plus_on_tax_group_id' AND type='index'
|
3248
|
+
[0m
|
3249
|
+
[1m[35m (0.1ms)[0m SELECT sql
|
3250
|
+
FROM sqlite_master
|
3251
|
+
WHERE name='index_billing_pt_fp_mappings_on_payment_type_id' AND type='index'
|
3252
|
+
UNION ALL
|
3253
|
+
SELECT sql
|
3254
|
+
FROM sqlite_temp_master
|
3255
|
+
WHERE name='index_billing_pt_fp_mappings_on_payment_type_id' AND type='index'
|
3256
|
+
|
3257
|
+
[1m[36m (0.1ms)[0m [1m SELECT sql
|
3258
|
+
FROM sqlite_master
|
3259
|
+
WHERE name='index_billing_pt_fp_mappings_on_extface_driver_id' AND type='index'
|
3260
|
+
UNION ALL
|
3261
|
+
SELECT sql
|
3262
|
+
FROM sqlite_temp_master
|
3263
|
+
WHERE name='index_billing_pt_fp_mappings_on_extface_driver_id' AND type='index'
|
3264
|
+
[0m
|
3265
|
+
[1m[35m (0.1ms)[0m SELECT sql
|
3266
|
+
FROM sqlite_master
|
3267
|
+
WHERE name='index_billing_reports_on_origin_id' AND type='index'
|
3268
|
+
UNION ALL
|
3269
|
+
SELECT sql
|
3270
|
+
FROM sqlite_temp_master
|
3271
|
+
WHERE name='index_billing_reports_on_origin_id' AND type='index'
|
3272
|
+
|
3273
|
+
[1m[36m (0.1ms)[0m [1m SELECT sql
|
3274
|
+
FROM sqlite_master
|
3275
|
+
WHERE name='index_billing_tg_fp_mappings_on_tax_group_id' AND type='index'
|
3276
|
+
UNION ALL
|
3277
|
+
SELECT sql
|
3278
|
+
FROM sqlite_temp_master
|
3279
|
+
WHERE name='index_billing_tg_fp_mappings_on_tax_group_id' AND type='index'
|
3280
|
+
[0m
|
3281
|
+
[1m[35m (0.1ms)[0m SELECT sql
|
3282
|
+
FROM sqlite_master
|
3283
|
+
WHERE name='index_billing_tg_fp_mappings_on_extface_driver_id' AND type='index'
|
3284
|
+
UNION ALL
|
3285
|
+
SELECT sql
|
3286
|
+
FROM sqlite_temp_master
|
3287
|
+
WHERE name='index_billing_tg_fp_mappings_on_extface_driver_id' AND type='index'
|
3288
|
+
|
3289
|
+
[1m[36m (0.1ms)[0m [1m SELECT sql
|
3290
|
+
FROM sqlite_master
|
3291
|
+
WHERE name='index_billing_versions_on_item_type_and_item_id' AND type='index'
|
3292
|
+
UNION ALL
|
3293
|
+
SELECT sql
|
3294
|
+
FROM sqlite_temp_master
|
3295
|
+
WHERE name='index_billing_versions_on_item_type_and_item_id' AND type='index'
|
2812
3296
|
[0m
|