erp_invoicing 3.1.0 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (107) hide show
  1. checksums.yaml +7 -0
  2. data/app/models/extensions/party.rb +15 -3
  3. data/app/models/invoice.rb +33 -1
  4. data/app/models/invoice_party_role.rb +16 -0
  5. data/app/models/payment_application.rb +17 -1
  6. data/lib/erp_invoicing/engine.rb +1 -1
  7. data/lib/erp_invoicing/version.rb +6 -2
  8. metadata +31 -234
  9. data/app/assets/javascripts/erp_invoicing/application.js +0 -9
  10. data/app/assets/stylesheets/erp_invoicing/application.css +0 -7
  11. data/app/controllers/erp_invoicing/erp_app/organizer/bill_pay/accounts_controller.rb +0 -166
  12. data/app/controllers/erp_invoicing/erp_app/organizer/bill_pay/base_controller.rb +0 -22
  13. data/app/controllers/erp_invoicing/erp_app/shared/billing_accounts_controller.rb +0 -111
  14. data/app/controllers/erp_invoicing/erp_app/shared/files_controller.rb +0 -52
  15. data/app/controllers/erp_invoicing/erp_app/shared/invoices_controller.rb +0 -208
  16. data/app/controllers/erp_invoicing/sms_controller.rb +0 -156
  17. data/app/helpers/erp_invoicing/application_helper.rb +0 -4
  18. data/app/views/layouts/erp_invoicing/application.html.erb +0 -14
  19. data/db/data_migrations/20111121153349_create_bill_pay_organizer_application.rb +0 -14
  20. data/db/data_migrations/20120118181839_create_invoice_management_desktop_application.rb +0 -26
  21. data/db/data_migrations/20120229174322_add_billpay_widget.rb +0 -26
  22. data/public/javascripts/erp_app/desktop/applications/invoice_management/billing_accounts_panel.js +0 -79
  23. data/public/javascripts/erp_app/desktop/applications/invoice_management/invoices_panel.js +0 -48
  24. data/public/javascripts/erp_app/desktop/applications/invoice_management/module.js +0 -36
  25. data/public/javascripts/erp_app/organizer/applications/bill_pay/base.js +0 -146
  26. data/public/javascripts/erp_app/organizer/applications/bill_pay/extensions.js +0 -21
  27. data/public/javascripts/erp_app/organizer/applications/bill_pay/make_payment_window.js +0 -109
  28. data/public/javascripts/erp_app/organizer/applications/bill_pay/payment_accounts_grid_panel.js +0 -105
  29. data/public/javascripts/erp_app/organizer/applications/bill_pay/transactions_grid_panel.js +0 -84
  30. data/public/javascripts/erp_app/shared/add_invoice_window.js +0 -220
  31. data/public/javascripts/erp_app/shared/billing_accounts_grid_panel.js +0 -316
  32. data/public/javascripts/erp_app/shared/invoice_items_grid_panel.js +0 -152
  33. data/public/javascripts/erp_app/shared/invoices_grid_panel.js +0 -361
  34. data/public/javascripts/erp_app/shared/payments_grid_panel.js +0 -74
  35. data/spec/dummy/db/data_migrations/20101011152441_payment_gateway_actions.erp_commerce.rb +0 -28
  36. data/spec/dummy/db/data_migrations/20101014142230_financial_txn_types.erp_txns_and_accts.rb +0 -16
  37. data/spec/dummy/db/data_migrations/20110109173616_create_capability_scope_types.erp_tech_svcs.rb +0 -15
  38. data/spec/dummy/db/data_migrations/20110324010232_product_role_types.erp_products.rb +0 -24
  39. data/spec/dummy/db/data_migrations/20110509223702_add_publisher_role.knitkit.rb +0 -22
  40. data/spec/dummy/db/data_migrations/20110525001935_add_usd_currency.erp_base_erp_svcs.rb +0 -12
  41. data/spec/dummy/db/data_migrations/20110527160807_add_default_prod_avail_types.erp_products.rb +0 -27
  42. data/spec/dummy/db/data_migrations/20110605231556_create_order_party_roles.erp_orders.rb +0 -24
  43. data/spec/dummy/db/data_migrations/20110608185830_create_default_dynamic_models_and_forms.erp_forms.rb +0 -33
  44. data/spec/dummy/db/data_migrations/20110609150135_add_iso_codes.erp_base_erp_svcs.rb +0 -19
  45. data/spec/dummy/db/data_migrations/20110728201729_erp_app_setup.erp_app.rb +0 -252
  46. data/spec/dummy/db/data_migrations/20110728201730_create_desktop_app_product_manager.erp_products.rb +0 -26
  47. data/spec/dummy/db/data_migrations/20110728201731_create_desktop_app_order_manager.erp_orders.rb +0 -26
  48. data/spec/dummy/db/data_migrations/20110728201732_create_organizer_app_order_management.erp_orders.rb +0 -15
  49. data/spec/dummy/db/data_migrations/20110728201733_update_preferences.erp_app.rb +0 -53
  50. data/spec/dummy/db/data_migrations/20110802200222_schedule_delete_expired_sessions_job.erp_tech_svcs.rb +0 -16
  51. data/spec/dummy/db/data_migrations/20110816153456_add_knitkit_application.knitkit.rb +0 -32
  52. data/spec/dummy/db/data_migrations/20110816161238_create_desktop_app_audit_log_viewer.erp_app.rb +0 -21
  53. data/spec/dummy/db/data_migrations/20110817160743_add_file_manager_application.erp_app.rb +0 -32
  54. data/spec/dummy/db/data_migrations/20110828190913_create_desktop_app_dynamic_forms.erp_forms.rb +0 -19
  55. data/spec/dummy/db/data_migrations/20110913145838_setup_compass_ae_instance.erp_base_erp_svcs.rb +0 -12
  56. data/spec/dummy/db/data_migrations/20111108183739_add_default_capabilities.erp_app.rb +0 -23
  57. data/spec/dummy/db/data_migrations/20111108183740_add_new_contact_widgets.erp_app.rb +0 -42
  58. data/spec/dummy/db/data_migrations/20111111144706_setup_audit_log_types.erp_tech_svcs.rb +0 -22
  59. data/spec/dummy/db/data_migrations/20111118182910_setup_knitkit_capabilities.knitkit.rb +0 -128
  60. data/spec/dummy/db/data_migrations/20111121153349_create_bill_pay_organizer_application.erp_invoicing.rb +0 -15
  61. data/spec/dummy/db/data_migrations/20120109173616_create_download_capability_type.erp_tech_svcs.rb +0 -14
  62. data/spec/dummy/db/data_migrations/20120118181839_create_invoice_management_desktop_application.erp_invoicing.rb +0 -27
  63. data/spec/dummy/db/data_migrations/20120127144444_create_website_role_types.knitkit.rb +0 -14
  64. data/spec/dummy/db/data_migrations/20120127150505_create_website_default_configuration.knitkit.rb +0 -73
  65. data/spec/dummy/db/data_migrations/20120127150506_add_primary_host_to_website_configuration.knitkit.rb +0 -34
  66. data/spec/dummy/db/data_migrations/20120229160222_add_userinfo_widget.erp_app.rb +0 -29
  67. data/spec/dummy/db/data_migrations/20120229174322_add_billpay_widget.erp_invoicing.rb +0 -27
  68. data/spec/dummy/db/data_migrations/20120229174343_add_orders_widget.erp_orders.rb +0 -29
  69. data/spec/dummy/db/data_migrations/20120316150424_add_is_template_to_default_website_config.knitkit.rb +0 -17
  70. data/spec/dummy/db/data_migrations/20120405193721_create_party_and_role_type_for_communication_events.erp_app.rb +0 -11
  71. data/spec/dummy/db/data_migrations/20120411180756_create_user_management_mobile_application.erp_app.rb +0 -19
  72. data/spec/dummy/db/data_migrations/20120418164215_create_configuration_management_desktop_application.erp_app.rb +0 -23
  73. data/spec/dummy/db/data_migrations/20120605154637_add_calculate_balance_strategy_types.erp_invoicing.rb +0 -21
  74. data/spec/dummy/db/data_migrations/20120809020508_update_website_and_configuration.knitkit.rb +0 -78
  75. data/spec/dummy/db/data_migrations/20120824013449_create_ticket_form.erp_forms.rb +0 -67
  76. data/spec/dummy/db/data_migrations/20121026013449_update_ticket_form.erp_forms.rb +0 -65
  77. data/spec/dummy/db/data_migrations/20121026191738_update_contact_form.erp_forms.rb +0 -27
  78. data/spec/dummy/db/data_migrations/20121116155018_create_group_relationship_and_role_types.erp_tech_svcs.rb +0 -20
  79. data/spec/dummy/db/data_migrations/20121129185611_upgrade_website_role_iid.knitkit.rb +0 -21
  80. data/spec/dummy/db/data_migrations/20121130201859_upgrade_remove_system_mgmt_app.erp_app.rb +0 -16
  81. data/spec/dummy/db/data_migrations/20121130212146_note_capabilities.erp_tech_svcs.rb +0 -24
  82. data/spec/dummy/db/data_migrations/20121218175028_create_security_management_desktop_application.erp_app.rb +0 -23
  83. data/spec/dummy/db/migrate/20121214000230_base_erp_services.erp_base_erp_svcs.rb +0 -461
  84. data/spec/dummy/db/migrate/20121214000231_base_tech_services.erp_tech_svcs.rb +0 -255
  85. data/spec/dummy/db/migrate/20121214000232_create_has_attribute_tables.erp_tech_svcs.rb +0 -39
  86. data/spec/dummy/db/migrate/20121214000233_base_app_framework.erp_app.rb +0 -276
  87. data/spec/dummy/db/migrate/20121214000234_dynamic_forms.erp_forms.rb +0 -95
  88. data/spec/dummy/db/migrate/20121214000235_create_tickets.erp_forms.rb +0 -19
  89. data/spec/dummy/db/migrate/20121214000236_upgrade_dynamic_forms_table.erp_forms.rb +0 -32
  90. data/spec/dummy/db/migrate/20121214000237_setup_knitkit.knitkit.rb +0 -316
  91. data/spec/dummy/db/migrate/20121214000238_invoicing_services.erp_invoicing.rb +0 -277
  92. data/spec/dummy/db/migrate/20121214000239_base_inventory.erp_inventory.rb +0 -91
  93. data/spec/dummy/db/migrate/20121214000240_base_inventory_indexes.erp_inventory.rb +0 -48
  94. data/spec/dummy/db/migrate/20121214000241_base_txns_and_accts.erp_txns_and_accts.rb +0 -364
  95. data/spec/dummy/db/migrate/20121214000242_agreements_services.erp_agreements.rb +0 -160
  96. data/spec/dummy/db/migrate/20121214000243_agreements_services_indexes.erp_agreements.rb +0 -52
  97. data/spec/dummy/db/migrate/20121214000244_base_orders.erp_orders.rb +0 -178
  98. data/spec/dummy/db/migrate/20121214000245_base_products.erp_products.rb +0 -234
  99. data/spec/dummy/db/migrate/20121214000246_base_products_indexes.erp_products.rb +0 -59
  100. data/spec/dummy/db/migrate/20121214000247_erp_commerce_base.erp_commerce.rb +0 -442
  101. data/spec/dummy/db/migrate/20121214000248_base_work_efforts.erp_work_effort.rb +0 -211
  102. data/spec/dummy/db/migrate/20130107181155_create_groups.erp_tech_svcs.rb +0 -19
  103. data/spec/dummy/db/migrate/20130107181156_upgrade_security.erp_tech_svcs.rb +0 -54
  104. data/spec/dummy/db/migrate/20130107181157_upgrade_security2.erp_tech_svcs.rb +0 -270
  105. data/spec/dummy/db/schema.rb +0 -2569
  106. data/spec/dummy/db/spec.sqlite3 +0 -0
  107. data/spec/dummy/log/spec.log +0 -64744
@@ -1,442 +0,0 @@
1
- # This migration comes from erp_commerce (originally 20100823174238)
2
- class ErpCommerceBase < ActiveRecord::Migration
3
- def self.up
4
- #fees
5
- unless table_exists?(:fees)
6
- create_table :fees do |t|
7
- t.references :fee_record, :polymorphic => true
8
- t.references :money
9
- t.references :fee_type
10
- t.string :description
11
- t.datetime :start_date
12
- t.datetime :end_date
13
- t.string :external_identifier
14
- t.string :external_id_source
15
-
16
- t.timestamps
17
- end
18
-
19
- add_index :fees, [:fee_record_id, :fee_record_type], :name => 'fee_record_idx'
20
- add_index :fees, :fee_type_id
21
- add_index :fees, :money_id
22
- end
23
-
24
- unless table_exists?(:fee_types)
25
- create_table :fee_types do |t|
26
- t.string :internal_identifier
27
- t.string :description
28
- t.string :comments
29
- t.string :external_identifier
30
- t.string :external_id_source
31
-
32
- #these columns are required to support the behavior of the plugin 'awesome_nested_set'
33
- t.integer :parent_id
34
- t.integer :lft
35
- t.integer :rgt
36
-
37
- t.timestamps
38
- end
39
- end
40
-
41
- #pricing tables
42
- unless table_exists?(:price_component_types)
43
- create_table :price_component_types do |t|
44
-
45
- t.string :description
46
- t.string :internal_identifier
47
- t.string :external_identifier
48
- t.string :external_id_source
49
-
50
- t.timestamps
51
- end
52
- end
53
-
54
- unless table_exists?(:pricing_plans)
55
- create_table :pricing_plans do |t|
56
-
57
- t.string :description
58
- t.string :comments
59
-
60
- t.string :internal_identifier
61
-
62
- t.string :external_identifier
63
- t.string :external_id_source
64
-
65
- t.date :from_date
66
- t.date :thru_date
67
-
68
- #this is here as a placeholder for an 'interpreter' or 'rule' pattern
69
- t.string :matching_rules
70
- #this is here as a placeholder for an 'interpreter' or 'rule' pattern
71
- t.string :pricing_calculation
72
-
73
- #support for simple assignment of a single money amount
74
- t.boolean :is_simple_amount
75
- t.integer :currency_id
76
- t.decimal :money_amount, :precision => 8, :scale => 2
77
-
78
- t.timestamps
79
- end
80
- end
81
-
82
- unless table_exists?(:pricing_plan_components)
83
- create_table :pricing_plan_components do |t|
84
-
85
- t.integer :price_component_type_id
86
- t.string :description
87
- t.string :comments
88
-
89
- t.string :internal_identifier
90
- t.string :external_identifier
91
- t.string :external_id_source
92
-
93
-
94
- #this is here as a placeholder for an 'interpreter' or 'rule' pattern
95
- t.string :matching_rules
96
- #this is here as a placeholder for an 'interpreter' or 'rule' pattern
97
- t.string :pricing_calculation
98
-
99
- #support for simple assignment of a single money amount
100
- t.boolean :is_simple_amount
101
- t.integer :currency_id
102
- t.decimal :money_amount, :precision => 8, :scale => 2
103
-
104
- t.timestamps
105
-
106
- end
107
- add_index :pricing_plan_components, :price_component_type_id
108
- end
109
-
110
- unless table_exists?(:valid_price_plan_components)
111
- create_table :valid_price_plan_components do |t|
112
-
113
- t.references :pricing_plan
114
- t.references :pricing_plan_component
115
-
116
- t.timestamps
117
-
118
- end
119
- add_index :valid_price_plan_components, :pricing_plan_id
120
- add_index :valid_price_plan_components, :pricing_plan_component_id
121
- end
122
-
123
- unless table_exists?(:pricing_plan_assignments)
124
- create_table :pricing_plan_assignments do |t|
125
-
126
- t.references :pricing_plan
127
-
128
- #support a polymorhic interface to the thing we want to price
129
- t.integer :priceable_item_id
130
- t.string :priceable_item_type
131
-
132
- t.integer :priority
133
-
134
- t.timestamps
135
-
136
- end
137
- add_index :pricing_plan_assignments, :pricing_plan_id
138
- add_index :pricing_plan_assignments, [:priceable_item_id,:priceable_item_type], :name => 'priceable_item_idx'
139
- end
140
-
141
- unless table_exists?(:prices)
142
- create_table :prices do |t|
143
-
144
- t.string :description
145
-
146
- #support a polymorhic interface to the thing that HAS BEEN priced
147
- t.integer :priced_item_id
148
- t.string :priced_item_type
149
-
150
- #refer to the pricing plan by which this price was calculated
151
- t.references :pricing_plan
152
-
153
- t.references :money
154
-
155
- t.timestamps
156
-
157
- end
158
- add_index :prices, :money_id
159
- add_index :prices, :pricing_plan_id
160
- add_index :prices, [:priced_item_id,:priced_item_type], :name => 'priced_item_idx'
161
- end
162
-
163
- unless table_exists?(:price_components)
164
- create_table :price_components do |t|
165
-
166
- t.string :description
167
- t.references :pricing_plan_component
168
- t.references :price
169
- t.references :money
170
-
171
- #polymorphic relationship
172
- t.integer :priced_component_id
173
- t.string :priced_component_type
174
-
175
- t.timestamps
176
-
177
- end
178
- add_index :price_components, :money_id
179
- add_index :price_components, :pricing_plan_component_id
180
- add_index :price_components, :price_id
181
- add_index :price_components, [:priced_component_id,:priced_component_type], :name => 'priced_component_idx'
182
- end
183
-
184
- #payment tables
185
- unless table_exists?(:payments)
186
- create_table :payments do |t|
187
-
188
- t.column :success, :boolean
189
- t.column :reference_number, :string
190
- t.column :financial_txn_id, :integer
191
- t.column :current_state, :string
192
- t.column :authorization_code, :string
193
- t.string :external_identifier
194
-
195
- t.timestamps
196
- end
197
-
198
- add_index :payments, :financial_txn_id
199
- end
200
-
201
- unless table_exists?(:payment_gateways)
202
- create_table :payment_gateways do |t|
203
-
204
- t.column :params, :string
205
- t.column :payment_gateway_action_id, :integer
206
- t.column :payment_id, :integer
207
- t.column :response, :string
208
-
209
- t.timestamps
210
- end
211
- end
212
-
213
- unless table_exists?(:payment_gateway_actions)
214
- create_table :payment_gateway_actions do |t|
215
-
216
- t.column :internal_identifier, :string
217
- t.column :description, :string
218
-
219
- t.timestamps
220
- end
221
- end
222
-
223
- add_index :payment_gateway_actions, :internal_identifier
224
-
225
- #tables
226
- unless table_exists?(:credit_cards)
227
- create_table :credit_cards do |t|
228
-
229
- t.column :crypted_private_card_number, :string
230
- t.column :expiration_month, :integer
231
- t.column :expiration_year, :integer
232
-
233
- t.column :description, :string
234
- t.column :first_name_on_card, :string
235
- t.column :last_name_on_card, :string
236
- t.column :card_type, :string
237
-
238
- t.column :postal_address_id, :integer
239
- t.column :credit_card_account_purpose_id, :integer
240
- t.column :credit_card_token, :string
241
-
242
- t.timestamps
243
- end
244
- end
245
-
246
- unless table_exists?(:credit_card_accounts)
247
- create_table :credit_card_accounts do |t|
248
-
249
- t.timestamps
250
- end
251
- end
252
-
253
- unless table_exists?(:credit_card_account_party_roles)
254
- create_table :credit_card_account_party_roles do |t|
255
- t.column :credit_card_account_id, :integer
256
- t.column :role_type_id, :integer
257
- t.column :party_id, :integer
258
- t.column :credit_card_id, :integer
259
-
260
- t.timestamps
261
- end
262
-
263
- add_index :credit_card_account_party_roles, :credit_card_account_id
264
- add_index :credit_card_account_party_roles, :role_type_id
265
- add_index :credit_card_account_party_roles, :party_id
266
- add_index :credit_card_account_party_roles, :credit_card_id
267
- end
268
-
269
- unless table_exists?(:credit_card_account_purposes)
270
- create_table :credit_card_account_purposes do |t|
271
-
272
- t.column :parent_id, :integer
273
- t.column :lft, :integer
274
- t.column :rgt, :integer
275
-
276
- #custom columns go here
277
-
278
- t.column :description, :string
279
- t.column :comments, :string
280
-
281
- t.column :internal_identifier, :string
282
- t.column :external_identifier, :string
283
- t.column :external_id_source, :string
284
-
285
- t.timestamps
286
- end
287
- end
288
-
289
- unless table_exists?(:accepted_credit_cards)
290
- create_table :accepted_credit_cards do |t|
291
-
292
- t.references :organization
293
- t.string :card_type
294
-
295
- t.timestamps
296
- end
297
- end
298
-
299
- unless table_exists?(:bank_account_types)
300
- create_table :bank_account_types do |t|
301
- t.string :description
302
- t.string :internal_identifier
303
-
304
- t.timestamps
305
- end
306
- end
307
-
308
- unless table_exists?(:bank_accounts)
309
- create_table :bank_accounts do |t|
310
- t.string :routing_number
311
- t.string :crypted_private_account_number
312
- t.string :name_on_account
313
- t.references :bank_account_type
314
-
315
- t.timestamps
316
- end
317
-
318
- add_index :bank_accounts, :bank_account_type_id, :name => 'bank_accounts_account_type_idx'
319
- end
320
- #end tables
321
-
322
- #columns
323
- unless columns(:order_txns).collect {|c| c.name}.include?('payment_gateway_txn_id')
324
- add_column :order_txns, :payment_gateway_txn_id, :string
325
- end
326
-
327
- unless columns(:order_txns).collect {|c| c.name}.include?('credit_card_id')
328
- add_column :order_txns, :credit_card_id, :integer
329
- end
330
-
331
- unless columns(:order_txns).collect {|c| c.name}.include?('bill_to_first_name')
332
- add_column :order_txns, :bill_to_first_name, :string
333
- end
334
-
335
- unless columns(:order_txns).collect {|c| c.name}.include?('bill_to_last_name')
336
- add_column :order_txns, :bill_to_last_name, :string
337
- end
338
-
339
- unless columns(:order_txns).collect {|c| c.name}.include?('bill_to_address_line_1')
340
- add_column :order_txns, :bill_to_address_line_1, :string
341
- end
342
-
343
- unless columns(:order_txns).collect {|c| c.name}.include?('bill_to_address_line_2')
344
- add_column :order_txns, :bill_to_address_line_2, :string
345
- end
346
-
347
- unless columns(:order_txns).collect {|c| c.name}.include?('bill_to_city')
348
- add_column :order_txns, :bill_to_city, :string
349
- end
350
-
351
- unless columns(:order_txns).collect {|c| c.name}.include?('bill_to_state')
352
- add_column :order_txns, :bill_to_state, :string
353
- end
354
-
355
- unless columns(:order_txns).collect {|c| c.name}.include?('bill_to_postal_code')
356
- add_column :order_txns, :bill_to_postal_code, :string
357
- end
358
-
359
- unless columns(:order_txns).collect {|c| c.name}.include?('bill_to_country')
360
- add_column :order_txns, :bill_to_country, :string
361
- end
362
-
363
- unless columns(:order_txns).collect {|c| c.name}.include?('bill_to_country_name')
364
- rename_column :order_txns, :bill_to_country, :bill_to_country_name
365
- rename_column :order_txns, :ship_to_country, :ship_to_country_name
366
- add_column :order_txns, :bill_to_country, :string
367
- add_column :order_txns, :ship_to_country, :string
368
- end
369
- #end
370
- end
371
-
372
- def self.down
373
-
374
- if columns(:order_txns).collect {|c| c.name}.include?('payment_gateway_txn_id')
375
- remove_column :order_txns, :payment_gateway_txn_id
376
- end
377
-
378
- if columns(:order_txns).collect {|c| c.name}.include?('credit_card_id')
379
- remove_column :order_txns, :credit_card_id, :integer
380
- end
381
-
382
- if columns(:order_txns).collect {|c| c.name}.include?('bill_to_first_name')
383
- remove_column :order_txns, :bill_to_first_name, :string
384
- end
385
-
386
- if columns(:order_txns).collect {|c| c.name}.include?('bill_to_last_name')
387
- remove_column :order_txns, :bill_to_last_name, :string
388
- end
389
-
390
- if columns(:order_txns).collect {|c| c.name}.include?('bill_to_address')
391
- remove_column :order_txns, :bill_to_address, :string
392
- end
393
-
394
- if columns(:order_txns).collect {|c| c.name}.include?('bill_to_city')
395
- remove_column :order_txns, :bill_to_city, :string
396
- end
397
-
398
- if columns(:order_txns).collect {|c| c.name}.include?('bill_to_state')
399
- remove_column :order_txns, :bill_to_state, :string
400
- end
401
-
402
- if columns(:order_txns).collect {|c| c.name}.include?('bill_to_postal_code')
403
- remove_column :order_txns, :bill_to_postal_code, :string
404
- end
405
-
406
- if columns(:order_txns).collect {|c| c.name}.include?('bill_to_country')
407
- remove_column :order_txns, :bill_to_country, :string
408
- end
409
-
410
- if columns(:order_txns).collect {|c| c.name}.include?('bill_to_country_name')
411
- remove_column :order_txns, :bill_to_country, :bill_to_country_name
412
- remove_column :order_txns, :ship_to_country, :ship_to_country_name
413
- end
414
-
415
- #tables
416
- drop_tables = [
417
- :bank_account_types,
418
- :bank_accounts,
419
- :credit_cards,
420
- :credit_card_accounts,
421
- :credit_card_account_party_roles,
422
- :credit_card_account_purposes,
423
- :payments,
424
- :payment_gateways,
425
- :payment_gateway_actions,
426
- :pricing_plans,
427
- :pricing_plan_components,
428
- :valid_price_plan_components,
429
- :pricing_plan_assignments,
430
- :prices,
431
- :price_components,
432
- :price_component_types,
433
- :fees,:fee_types
434
- ]
435
- drop_tables.each do |table|
436
- if table_exists?(table)
437
- drop_table table
438
- end
439
- end
440
-
441
- end
442
- end
@@ -1,211 +0,0 @@
1
- # This migration comes from erp_work_effort (originally 20100220000000)
2
- class BaseWorkEfforts < ActiveRecord::Migration
3
-
4
- def self.up
5
-
6
- ## work_efforts
7
- unless table_exists?(:work_efforts)
8
- create_table :work_efforts do |t|
9
- t.string :description
10
- t.string :type
11
- t.datetime :started_at
12
- t.datetime :finished_at
13
- t.integer :projected_completion_time
14
- t.integer :actual_completion_time
15
-
16
- t.timestamps
17
-
18
- #polymorphic columns
19
- t.integer :facility_id
20
- t.string :facility_type
21
- t.integer :work_effort_record_id
22
- t.string :work_effort_record_type
23
-
24
- #foreign keys
25
- t.integer :projected_cost_id
26
- t.integer :actual_cost_id
27
-
28
- #better nested set columns
29
- t.integer :parent_id
30
- t.integer :lft
31
- t.integer :rgt
32
- end
33
-
34
- add_index :work_efforts, [:work_effort_record_id, :work_effort_record_type], :name => "work_effort_record_id_type"
35
- add_index :work_efforts, [:facility_type, :facility_id], :name => "facility"
36
- add_index :work_efforts, :finished_at
37
- end
38
-
39
- ## work_requirements
40
- unless table_exists?(:work_requirements)
41
- create_table :work_requirements do |t|
42
- t.string :description
43
- t.string :type
44
- t.integer :projected_completion_time
45
- t.timestamps
46
-
47
- #polymorphic columns
48
- t.integer :work_requirement_record_id
49
- t.string :work_requirement_record_type
50
- t.integer :facility_id
51
- t.string :facility_type
52
-
53
- # foreign keys
54
- t.integer :cost_id
55
-
56
- #better nested set columns
57
- t.integer :parent_id
58
- t.integer :lft
59
- t.integer :rgt
60
- end
61
- end
62
-
63
- ## work_requirement_work_effort_status_types
64
- unless table_exists?(:work_requirement_work_effort_status_types)
65
- create_table :work_requirement_work_effort_status_types do |t|
66
- t.timestamps
67
-
68
- #foreign keys
69
- t.integer :work_requirement_id
70
- t.integer :work_effort_status_type_id
71
- t.boolean :is_initial_status
72
- end
73
- end
74
-
75
- ## work_effort_statuses
76
- unless table_exists?(:work_effort_statuses)
77
- create_table :work_effort_statuses do |t|
78
- t.datetime :started_at
79
- t.datetime :finished_at
80
- t.integer :work_effort_id
81
- t.integer :work_effort_status_type_id
82
-
83
- t.timestamps
84
- end
85
-
86
- add_index :work_effort_statuses, :work_effort_status_type_id
87
- add_index :work_effort_statuses, :work_effort_id
88
- end
89
-
90
- ## work_effort_status_types
91
- unless table_exists?(:work_effort_status_types)
92
- create_table :work_effort_status_types do |t|
93
- t.string :internal_identifier
94
- t.string :description
95
- t.integer :next_status_id
96
- t.integer :previous_status_id
97
-
98
- t.timestamps
99
- end
100
-
101
- add_index :work_effort_status_types, :internal_identifier
102
- add_index :work_effort_status_types, :description
103
- end
104
-
105
- ## work_effort_assignments
106
- unless table_exists?(:work_effort_assignments)
107
- create_table :work_effort_assignments do |t|
108
- #foreign keys
109
- t.references :work_effort
110
-
111
- t.datetime :assigned_at
112
- t.datetime :assigned_from
113
- t.datetime :assigned_thru
114
- t.datetime :unassigned_at
115
-
116
- #Polymorphic Columns
117
- t.integer :assigned_to_id
118
- t.string :assigned_to_type
119
- t.integer :assigned_by_id
120
- t.string :assigned_by_type
121
-
122
- t.timestamps
123
- end
124
-
125
- add_index :work_effort_assignments, [:assigned_to_id, :assigned_to_type], :name => "assigned_to"
126
- add_index :work_effort_assignments, :assigned_from
127
- add_index :work_effort_assignments, :assigned_thru
128
- add_index :work_effort_assignments, :work_effort_id
129
- end
130
-
131
- ## valid_work_assignments
132
- unless table_exists?(:valid_work_assignments)
133
- create_table :valid_work_assignments do |t|
134
- t.integer :role_type_id
135
- t.integer :work_requirement_id
136
-
137
- t.timestamps
138
- end
139
-
140
- end
141
-
142
- ## valid_work_assignment_attributes
143
- unless table_exists?(:valid_work_assignment_attributes)
144
- create_table :valid_work_assignment_attributes do |t|
145
- t.integer :valid_work_assignment_id
146
- t.string :name
147
- t.string :type
148
- t.string :value
149
-
150
- t.timestamps
151
- end
152
- end
153
-
154
- ## party_resource_availabilities
155
- unless table_exists?(:party_resource_availabilities)
156
- create_table :party_resource_availabilities do |t|
157
- t.datetime :from_date
158
- t.datetime :to_date
159
- t.integer :party_id
160
- t.integer :pra_type_id #:party_resource_availability_type_id is too long
161
-
162
- t.timestamps
163
- end
164
-
165
- add_index :party_resource_availabilities, :from_date
166
- add_index :party_resource_availabilities, :to_date
167
- add_index :party_resource_availabilities, :pra_type_id
168
- add_index :party_resource_availabilities, :party_id
169
- end
170
-
171
- unless table_exists?(:party_resource_availability_types)
172
- create_table :party_resource_availability_types do |t|
173
- t.string :description
174
- t.string :internal_identifier
175
-
176
- t.timestamps
177
- end
178
-
179
- add_index :party_resource_availability_types, :internal_identifier
180
- add_index :party_resource_availability_types, :description
181
- end
182
-
183
- ## costs
184
- unless table_exists?(:costs)
185
- create_table :costs do |t|
186
- t.integer :money_id
187
- t.timestamps
188
- end
189
- end
190
-
191
- end
192
-
193
- def self.down
194
- # Drop all tables, including those that were originally created then deleted
195
- [
196
- # Old tables deleted and no longer used
197
- :work_requirement_assignabilities,
198
- # Currently used tables
199
- :category_classifications, :categories, :work_requirement_assignability_attributes,
200
- :valid_work_assignments, :work_effort_assignments, :work_effort_status_types,
201
- :work_effort_statuses, :work_requirement_work_effort_status_types,
202
- :work_requirements, :work_efforts, :party_resource_availabilities, :party_resource_availability_types,
203
- :costs
204
- ].each do |tbl|
205
- if table_exists?(tbl)
206
- drop_table tbl
207
- end
208
- end
209
-
210
- end
211
- end
@@ -1,19 +0,0 @@
1
- # This migration comes from erp_tech_svcs (originally 20121116151510)
2
- class CreateGroups < ActiveRecord::Migration
3
- def self.up
4
- unless table_exists?(:groups)
5
- create_table :groups do |t|
6
- t.column :description, :string
7
- t.timestamps
8
- end
9
- end
10
- end
11
-
12
- def self.down
13
- [ :groups ].each do |tbl|
14
- if table_exists?(tbl)
15
- drop_table tbl
16
- end
17
- end
18
- end
19
- end