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,91 +0,0 @@
1
- # This migration comes from erp_inventory (originally 20080805000050)
2
- class BaseInventory < ActiveRecord::Migration
3
- def self.up
4
-
5
- unless table_exists?(:inventory_entries)
6
- create_table :inventory_entries do |t|
7
- t.column :description, :string
8
- t.column :inventory_entry_record_id, :integer
9
- t.column :inventory_entry_record_type, :string
10
- t.column :external_identifier, :string
11
- t.column :external_id_source, :string
12
- t.column :product_type_id, :integer
13
- t.column :number_available, :integer
14
- t.string :sku
15
- t.integer :number_sold
16
-
17
- t.timestamps
18
- end
19
- end
20
-
21
- unless table_exists?(:inv_entry_reln_types)
22
- create_table :inv_entry_reln_types do |t|
23
- t.column :parent_id, :integer
24
- t.column :lft, :integer
25
- t.column :rgt, :integer
26
- #custom columns go here
27
- t.column :description, :string
28
- t.column :comments, :string
29
- t.column :internal_identifier, :string
30
- t.column :external_identifier, :string
31
- t.column :external_id_source, :string
32
-
33
- t.timestamps
34
- end
35
- end
36
-
37
- unless table_exists?(:inv_entry_role_types)
38
- create_table :inv_entry_role_types do |t|
39
- t.column :parent_id, :integer
40
- t.column :lft, :integer
41
- t.column :rgt, :integer
42
- #custom columns go here
43
- t.column :description, :string
44
- t.column :comments, :string
45
- t.column :internal_identifier, :string
46
- t.column :external_identifier, :string
47
- t.column :external_id_source, :string
48
-
49
- t.timestamps
50
- end
51
- end
52
-
53
- unless table_exists?(:inv_entry_relns)
54
- create_table :inv_entry_relns do |t|
55
- t.column :inv_entry_reln_type_id, :integer
56
- t.column :description, :string
57
- t.column :inv_entry_id_from, :integer
58
- t.column :inv_entry_id_to, :integer
59
- t.column :role_type_id_from, :integer
60
- t.column :role_type_id_to, :integer
61
- t.column :status_type_id, :integer
62
- t.column :from_date, :date
63
- t.column :thru_date, :date
64
-
65
- t.timestamps
66
- end
67
- end
68
-
69
- unless table_exists?(:prod_instance_inv_entries)
70
- create_table :prod_instance_inv_entries do |t|
71
- t.column :product_instance_id, :integer
72
- t.column :inventory_entry_id, :integer
73
-
74
- t.timestamps
75
- end
76
- end
77
-
78
- end
79
-
80
- def self.down
81
- [
82
- :prod_instance_inv_entries,:inv_entry_relns,
83
- :inv_entry_role_types, :inv_entry_reln_types, :inventory_entries
84
- ].each do |tbl|
85
- if table_exists?(tbl)
86
- drop_table tbl
87
- end
88
- end
89
- end
90
-
91
- end
@@ -1,48 +0,0 @@
1
- # This migration comes from erp_inventory (originally 20080805000051)
2
- class BaseInventoryIndexes < ActiveRecord::Migration
3
- def self.up
4
- add_index :inventory_entries, [:inventory_entry_record_id, :inventory_entry_record_type],
5
- :name => "bii_1"
6
-
7
- add_index :inv_entry_reln_types, :parent_id
8
-
9
- add_index :inv_entry_role_types, :parent_id
10
-
11
- add_index :inv_entry_relns, :inv_entry_reln_type_id
12
- add_index :inv_entry_relns, :status_type_id
13
-
14
- add_index :prod_instance_inv_entries, :product_instance_id
15
- add_index :prod_instance_inv_entries, :inventory_entry_id
16
-
17
- ### Conditional checks: since these columns may have been added with a later migration,
18
- ### we check that the column exists before adding an index on it.
19
-
20
- if columns(:inventory_entries).include?('product_type_id')
21
- add_index :inventory_entries, :product_type_id
22
- end
23
- end
24
-
25
- def self.down
26
- remove_index :inventory_entries, :name => "bii_1"
27
-
28
- remove_index :inv_entry_reln_types, :parent_id
29
-
30
- remove_index :inv_entry_role_types, :parent_id
31
-
32
- remove_index :inv_entry_relns, :inv_entry_reln_type_id
33
- remove_index :inv_entry_relns, :status_type_id
34
-
35
- remove_index :prod_instance_inv_entries, :product_instance_id
36
- remove_index :prod_instance_inv_entries, :inventory_entry_id
37
-
38
- ### Conditional checks: since these columns were originally added in a later
39
- ### migration that may not yet have already been run,
40
- ### we check that the column exists before removing an index on it.
41
-
42
- if indexes(:inventory_entries).collect {|i|
43
- i.name}.include?('index_inventory_entries_on_product_type_id')
44
- remove_index :inventory_entries, :product_type_id
45
- end
46
-
47
- end
48
- end
@@ -1,364 +0,0 @@
1
- # This migration comes from erp_txns_and_accts (originally 20080805000030)
2
- class BaseTxnsAndAccts < ActiveRecord::Migration
3
- def self.up
4
-
5
- unless table_exists?(:biz_txn_events)
6
- create_table :biz_txn_events do |t|
7
- t.column :description, :string
8
- t.column :biz_txn_acct_root_id, :integer
9
- t.column :biz_txn_type_id, :integer
10
- t.column :entered_date, :datetime
11
- t.column :post_date, :datetime
12
- t.column :biz_txn_record_id, :integer
13
- t.column :biz_txn_record_type, :string
14
- t.column :external_identifier, :string
15
- t.column :external_id_source, :string
16
- t.timestamps
17
- end
18
-
19
- add_index :biz_txn_events, :biz_txn_acct_root_id
20
- add_index :biz_txn_events, :biz_txn_type_id
21
- add_index :biz_txn_events, [:biz_txn_record_id, :biz_txn_record_type], :name => "btai_1"
22
- end
23
-
24
- unless table_exists?(:biz_txn_event_descs)
25
- create_table :biz_txn_event_descs do |t|
26
- t.column :biz_txn_event_id, :integer
27
- t.column :language_id, :integer
28
- t.column :locale_id, :integer
29
- t.column :priority, :integer
30
- t.column :sequence, :integer
31
- t.column :short_description, :string
32
- t.column :long_description, :string
33
- t.timestamps
34
- end
35
-
36
- add_index :biz_txn_event_descs, :biz_txn_event_id
37
- add_index :biz_txn_event_descs, :language_id
38
- add_index :biz_txn_event_descs, :locale_id
39
- end
40
-
41
- unless table_exists?(:biz_txn_types)
42
- create_table :biz_txn_types do |t|
43
- t.column :parent_id, :integer
44
- t.column :lft, :integer
45
- t.column :rgt, :integer
46
-
47
- #custom columns go here
48
- t.column :description, :string
49
- t.column :comments, :string
50
- t.column :internal_identifier, :string
51
- t.column :external_identifier, :string
52
- t.column :external_id_source, :string
53
- t.timestamps
54
- end
55
-
56
- add_index :biz_txn_types, [:parent_id,:lft,:rgt], :name => 'biz_txn_type_nested_set_idx'
57
- end
58
-
59
- unless table_exists?(:biz_txn_relationships)
60
- create_table :biz_txn_relationships do |t|
61
- t.column :biz_txn_rel_type_id, :integer
62
- t.column :description, :string
63
- t.column :txn_event_id_from, :integer
64
- t.column :txn_event_id_to, :integer
65
- t.column :status_type_id, :integer
66
- t.column :from_date, :date
67
- t.column :thru_date, :date
68
- t.timestamps
69
- end
70
-
71
- add_index :biz_txn_relationships, :biz_txn_rel_type_id
72
- add_index :biz_txn_relationships, :status_type_id
73
- end
74
-
75
- unless table_exists?(:biz_txn_rel_types)
76
- create_table :biz_txn_rel_types do |t|
77
- t.column :parent_id, :integer
78
- t.column :lft, :integer
79
- t.column :rgt, :integer
80
- #custom columns go here
81
- t.column :description, :string
82
- t.column :comments, :string
83
- t.column :internal_identifier, :string
84
- t.column :external_identifier, :string
85
- t.column :external_id_source, :string
86
- t.timestamps
87
- end
88
-
89
- add_index :biz_txn_rel_types, :parent_id
90
- end
91
-
92
- unless table_exists?(:biz_txn_statuses)
93
- create_table :biz_txn_statuses do |t|
94
- t.column :description, :string
95
- t.column :comments, :string
96
- t.timestamps
97
- end
98
- end
99
-
100
- unless table_exists?(:biz_txn_tasks)
101
- create_table :biz_txn_tasks do |t|
102
- t.column :description, :string
103
- t.timestamps
104
- end
105
- end
106
-
107
- unless table_exists?(:biz_txn_task_types)
108
- create_table :biz_txn_task_types do |t|
109
- t.column :parent_id, :integer
110
- t.column :lft, :integer
111
- t.column :rgt, :integer
112
- #custom columns go here
113
- t.column :description, :string
114
- t.column :comments, :string
115
- t.timestamps
116
- end
117
-
118
- add_index :biz_txn_task_types, :parent_id
119
- end
120
-
121
- unless table_exists?(:biz_txn_party_roles)
122
- create_table :biz_txn_party_roles do |t|
123
- t.column :biz_txn_event_id, :integer
124
- t.column :party_id, :integer
125
- t.column :biz_txn_party_role_type_id, :integer
126
- t.timestamps
127
- end
128
-
129
- add_index :biz_txn_party_roles, :biz_txn_event_id
130
- add_index :biz_txn_party_roles, :party_id
131
- add_index :biz_txn_party_roles, :biz_txn_party_role_type_id
132
- end
133
-
134
- unless table_exists?(:biz_txn_party_role_types)
135
- create_table :biz_txn_party_role_types do |t|
136
- t.column :parent_id, :integer
137
- t.column :lft, :integer
138
- t.column :rgt, :integer
139
- #custom columns go here
140
- t.column :description, :string
141
- t.column :comments, :string
142
- t.column :internal_identifier, :string
143
- t.timestamps
144
- end
145
-
146
- add_index :biz_txn_party_role_types, :parent_id
147
- end
148
-
149
- unless table_exists?(:biz_txn_acct_roots)
150
- create_table :biz_txn_acct_roots do |t|
151
- t.column :description, :string
152
- t.column :status, :integer
153
- t.column :biz_txn_acct_id, :integer
154
- t.column :biz_txn_acct_type, :string
155
- t.column :external_identifier, :string
156
- t.column :external_id_source, :string
157
- t.column :type, :string
158
- t.timestamps
159
- end
160
-
161
- add_index :biz_txn_acct_roots, [:biz_txn_acct_id, :biz_txn_acct_type], :name => "btai_2"
162
- end
163
-
164
- unless table_exists?(:biz_txn_acct_status_types)
165
- create_table :biz_txn_acct_status_types do |t|
166
- t.timestamps
167
- end
168
- end
169
-
170
- unless table_exists?(:biz_txn_acct_types)
171
- create_table :biz_txn_acct_types do |t|
172
- t.column :parent_id, :integer
173
- t.column :lft, :integer
174
- t.column :rgt, :integer
175
- #custom columns go here
176
- t.column :description, :string
177
- t.column :comments, :string
178
- t.column :internal_identifier, :string
179
- t.column :external_identifier, :string
180
- t.column :external_id_source, :string
181
- t.timestamps
182
- end
183
-
184
- add_index :biz_txn_acct_types, :parent_id
185
- end
186
-
187
- unless table_exists?(:biz_txn_acct_statuses)
188
- create_table :biz_txn_acct_statuses do |t|
189
- t.timestamps
190
- end
191
- end
192
-
193
- unless table_exists?(:biz_txn_acct_rel_types)
194
- create_table :biz_txn_acct_rel_types do |t|
195
- t.column :parent_id, :integer
196
- t.column :lft, :integer
197
- t.column :rgt, :integer
198
- #custom columns go here
199
- t.column :description, :string
200
- t.column :comments, :string
201
- t.column :internal_identifier, :string
202
- t.column :external_identifier, :string
203
- t.column :external_id_source, :string
204
- t.timestamps
205
- end
206
-
207
- add_index :biz_txn_acct_rel_types, :parent_id
208
- end
209
-
210
- unless table_exists?(:biz_txn_acct_relationships)
211
- create_table :biz_txn_acct_relationships do |t|
212
- t.column :biz_txn_acct_rel_type_id, :integer
213
- t.column :description, :string
214
- t.column :biz_txn_acct_root_id_from, :integer
215
- t.column :biz_txn_acct_root_id_to, :integer
216
- t.column :status_type_id, :integer
217
- t.column :from_date, :date
218
- t.column :thru_date, :date
219
- t.timestamps
220
- end
221
-
222
- add_index :biz_txn_acct_relationships, :biz_txn_acct_rel_type_id
223
- add_index :biz_txn_acct_relationships, :status_type_id
224
-
225
- end
226
-
227
- unless table_exists?(:biz_txn_acct_party_roles)
228
- create_table :biz_txn_acct_party_roles do |t|
229
- t.column :description, :string
230
- t.column :biz_txn_acct_root_id, :integer
231
- t.column :party_id, :integer
232
- t.column :biz_txn_acct_pty_rtype_id, :integer
233
- t.column :is_default_billing_acct_flag, :integer
234
- t.timestamps
235
- end
236
-
237
- add_index :biz_txn_acct_party_roles, :biz_txn_acct_root_id
238
- add_index :biz_txn_acct_party_roles, :party_id
239
- add_index :biz_txn_acct_party_roles, :biz_txn_acct_pty_rtype_id
240
- end
241
-
242
- unless table_exists?(:biz_txn_acct_pty_rtypes)
243
- create_table :biz_txn_acct_pty_rtypes do |t|
244
- t.column :parent_id, :integer
245
- t.column :lft, :integer
246
- t.column :rgt, :integer
247
- #custom columns go here
248
- t.column :description, :string
249
- t.column :comments, :string
250
- t.column :internal_identifier, :string
251
- t.column :external_identifier, :string
252
- t.column :external_id_source, :string
253
- t.timestamps
254
- end
255
-
256
- add_index :biz_txn_acct_pty_rtypes, :parent_id
257
- end
258
-
259
- unless table_exists?(:biz_acct_txn_tasks)
260
- create_table :biz_acct_txn_tasks do |t|
261
- t.column :biz_txn_task_id, :integer
262
- t.column :biz_txn_account_id, :integer
263
- t.column :description, :string
264
- t.column :comments, :string
265
- t.column :entered_date, :datetime
266
- t.column :requested_date, :datetime
267
- t.timestamps
268
- end
269
-
270
- add_index :biz_acct_txn_tasks, :biz_txn_task_id
271
- add_index :biz_acct_txn_tasks, :biz_txn_account_id
272
- end
273
-
274
- unless table_exists?(:biz_txn_agreement_role_types)
275
- create_table :biz_txn_agreement_role_types do |t|
276
- t.column :parent_id, :integer
277
- t.column :lft, :integer
278
- t.column :rgt, :integer
279
- #custom columns go here
280
- t.column :description, :string
281
- t.column :comments, :string
282
- t.column :internal_identifier, :string
283
- t.timestamps
284
- end
285
-
286
- add_index :biz_txn_agreement_role_types, :parent_id
287
- end
288
-
289
- unless table_exists?(:biz_txn_agreement_roles)
290
- create_table :biz_txn_agreement_roles do |t|
291
- t.references :biz_txn_event, :polymorphic => true
292
- t.column :agreement_id, :integer
293
- t.column :biz_txn_agreement_role_type_id, :integer
294
- t.timestamps
295
- end
296
-
297
- add_index :biz_txn_agreement_roles, :agreement_id
298
- add_index :biz_txn_agreement_roles, :biz_txn_agreement_role_type_id
299
- end
300
-
301
- unless table_exists?(:financial_txns)
302
- create_table :financial_txns do |t|
303
- t.integer :money_id
304
- t.date :apply_date
305
-
306
- t.timestamps
307
- end
308
- end
309
-
310
- unless table_exists?(:financial_txn_assns)
311
- create_table :financial_txn_assns do |t|
312
- t.references :financial_txn
313
- t.references :financial_txn_record, :polymorphic => true
314
-
315
- t.timestamps
316
- end
317
- end
318
-
319
- unless table_exists?(:financial_txn_accounts)
320
- create_table :financial_txn_accounts do |t|
321
- t.column :account_number, :string
322
- t.column :agreement_id, :integer
323
- t.column :balance_id, :integer
324
- t.column :balance_date, :date
325
- t.column :calculate_balance, :boolean
326
- t.column :payment_due_id, :integer
327
- t.column :due_date, :date
328
-
329
- #polymorphic tables
330
- t.references :financial_account, :polymorphic => true
331
-
332
- t.timestamps
333
- end
334
- end
335
-
336
- unless table_exists?(:base_txn_contexts)
337
- create_table :base_txn_contexts do |t|
338
- t.references :biz_txn_event
339
- t.references :txn_context_record, :polymorphic => true
340
-
341
- t.timestamps
342
- end
343
-
344
- add_index :base_txn_contexts, [:txn_context_record_id, :txn_context_record_type], :name => 'txn_context_record_idx'
345
- end
346
-
347
- end
348
-
349
- def self.down
350
- [
351
- :biz_txn_agreement_roles, :biz_txn_agreement_role_types, :biz_acct_txn_tasks,
352
- :biz_txn_acct_pty_rtypes, :biz_txn_acct_party_roles, :biz_txn_acct_relationships,
353
- :biz_txn_acct_rel_types, :biz_txn_acct_statuses, :biz_txn_acct_types,
354
- :biz_txn_acct_status_types, :biz_txn_acct_roots, :biz_txn_party_role_types,
355
- :biz_txn_party_roles, :biz_txn_task_types, :biz_txn_tasks,
356
- :biz_txn_statuses, :biz_txn_rel_types, :biz_txn_relationships,:base_txn_contexts,
357
- :biz_txn_types, :biz_txn_event_descs, :biz_txn_events,:financial_txn_accounts,:financial_txns
358
- ].each do |tbl|
359
- if table_exists?(tbl)
360
- drop_table tbl
361
- end
362
- end
363
- end
364
- end
@@ -1,160 +0,0 @@
1
- # This migration comes from erp_agreements (originally 20080805000070)
2
- class AgreementsServices < ActiveRecord::Migration
3
- def self.up
4
-
5
- # Create agreements
6
- unless table_exists?(:agreements)
7
- create_table :agreements do |t|
8
- t.column :description, :string
9
- t.column :agreement_type_id, :integer
10
- t.column :agreement_status, :string
11
- t.column :product_id, :integer
12
- t.column :agreement_date, :date
13
- t.column :from_date, :date
14
- t.column :thru_date, :date
15
- t.column :external_identifier, :string
16
- t.column :external_id_source, :string
17
-
18
- t.timestamps
19
- end
20
- end
21
-
22
- # Create agreement types
23
- unless table_exists?(:agreement_types)
24
- create_table :agreement_types do |t|
25
- t.column :parent_id, :integer
26
- t.column :lft, :integer
27
- t.column :rgt, :integer
28
-
29
- #custom columns go here
30
- t.column :description, :string
31
- t.column :comments, :string
32
- t.column :internal_identifier, :string
33
- t.column :external_identifier, :string
34
- t.column :external_id_source, :string
35
-
36
- t.timestamps
37
- end
38
- end
39
-
40
- # Create agreement items
41
- unless table_exists?(:agreement_items)
42
- create_table :agreement_items do |t|
43
- t.column :agreement_id, :integer
44
- t.column :agreement_item_type_id, :integer
45
- t.column :agreement_item_value, :string
46
- t.column :description, :string
47
- t.column :agreement_item_rule_string, :string
48
-
49
- t.timestamps
50
- end
51
- end
52
-
53
- # Create agreement item types
54
- unless table_exists?(:agreement_item_types)
55
- create_table :agreement_item_types do |t|
56
- t.column :parent_id, :integer
57
- t.column :lft, :integer
58
- t.column :rgt, :integer
59
-
60
- #custom columns go here
61
- t.column :description, :string
62
- t.column :comments, :string
63
- t.column :internal_identifier, :string
64
- t.column :external_identifier, :string
65
- t.column :external_id_source, :string
66
-
67
- t.timestamps
68
- end
69
- end
70
-
71
- # Create agreement_party_roles
72
- unless table_exists?(:agreement_party_roles)
73
- create_table :agreement_party_roles do |t|
74
- t.column :description, :string
75
- t.column :agreement_id, :integer
76
- t.column :party_id, :integer
77
- t.column :role_type_id, :integer
78
- t.column :external_identifier, :string
79
- t.column :external_id_source, :string
80
-
81
- t.timestamps
82
- end
83
- end
84
-
85
- unless table_exists?(:agreement_relationships)
86
- create_table :agreement_relationships do |t|
87
- t.column :agreement_reln_type_id, :integer
88
- t.column :description, :string
89
- t.column :agreement_id_from, :integer
90
- t.column :agreement_id_to, :integer
91
- t.column :role_type_id_from, :integer
92
- t.column :role_type_id_to, :integer
93
- t.column :status_type_id, :integer
94
- t.column :from_date, :date
95
- t.column :thru_date, :date
96
-
97
- t.timestamps
98
- end
99
- end
100
-
101
- unless table_exists?(:agreement_reln_types)
102
- create_table :agreement_reln_types do |t|
103
- t.column :parent_id, :integer
104
- t.column :lft, :integer
105
- t.column :rgt, :integer
106
- #custom columns go here
107
- t.column :valid_from_role_type_id, :integer
108
- t.column :valid_to_role_type_id, :integer
109
- t.column :name, :string
110
- t.column :description, :string
111
- t.column :internal_identifier, :string
112
- t.column :external_identifier, :string
113
- t.column :external_id_source, :string
114
-
115
- t.timestamps
116
- end
117
- end
118
-
119
- unless table_exists?(:agreement_role_types)
120
- create_table :agreement_role_types do |t|
121
-
122
- t.column :parent_id, :integer
123
- t.column :lft, :integer
124
- t.column :rgt, :integer
125
- #custom columns go here
126
- t.column :description, :string
127
- t.column :comments, :string
128
- t.column :internal_identifier, :string
129
- t.column :external_identifier, :string
130
- t.column :external_id_source, :string
131
-
132
- t.timestamps
133
- end
134
- end
135
-
136
- unless table_exists?(:loyalty_program_codes)
137
- create_table :loyalty_program_codes do |t|
138
- t.string :identifier
139
- t.string :name
140
- t.string :description
141
-
142
- t.timestamps
143
- end
144
- end
145
-
146
- end
147
-
148
- def self.down
149
- [
150
- :loyalty_program_codes, :agreement_role_types, :agreement_reln_types,
151
- :agreement_relationships, :agreement_party_roles, :agreement_item_types,
152
- :agreement_items, :agreements
153
- ].each do |tbl|
154
- if table_exists?(tbl)
155
- drop_table tbl
156
- end
157
- end
158
-
159
- end
160
- end