erp_txns_and_accts 3.0.6 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/app/models/base_txn_context.rb +1 -0
- data/app/models/biz_acct_txn_task.rb +1 -0
- data/app/models/biz_txn_acct_party_role.rb +1 -0
- data/app/models/biz_txn_acct_pty_rtype.rb +2 -0
- data/app/models/biz_txn_acct_rel_type.rb +1 -1
- data/app/models/biz_txn_acct_relationship.rb +1 -0
- data/app/models/biz_txn_acct_root.rb +14 -14
- data/app/models/biz_txn_acct_status.rb +1 -1
- data/app/models/biz_txn_acct_status_type.rb +1 -1
- data/app/models/biz_txn_acct_type.rb +2 -0
- data/app/models/biz_txn_agreement_role.rb +1 -0
- data/app/models/biz_txn_agreement_role_type.rb +2 -0
- data/app/models/biz_txn_event.rb +1 -0
- data/app/models/biz_txn_event_desc.rb +1 -0
- data/app/models/biz_txn_party_role.rb +1 -0
- data/app/models/biz_txn_party_role_type.rb +2 -0
- data/app/models/biz_txn_rel_type.rb +2 -0
- data/app/models/biz_txn_relationship.rb +1 -0
- data/app/models/biz_txn_status.rb +1 -1
- data/app/models/biz_txn_task.rb +1 -1
- data/app/models/biz_txn_task_type.rb +1 -1
- data/app/models/biz_txn_type.rb +1 -0
- data/app/models/financial_txn.rb +2 -0
- data/app/models/financial_txn_account.rb +2 -0
- data/lib/erp_txns_and_accts.rb +2 -0
- data/lib/erp_txns_and_accts/extensions/active_record/acts_as_biz_txn_account.rb +8 -9
- data/lib/erp_txns_and_accts/version.rb +2 -2
- data/spec/dummy/config/application.rb +6 -0
- data/spec/dummy/config/environments/spec.rb +3 -0
- data/spec/dummy/db/data_migrations/20101011152441_payment_gateway_actions.erp_commerce.rb +28 -0
- data/spec/dummy/db/data_migrations/20101014142230_financial_txn_types.erp_txns_and_accts.rb +16 -0
- data/spec/dummy/db/data_migrations/20110109173616_create_capability_scope_types.erp_tech_svcs.rb +15 -0
- data/spec/dummy/db/data_migrations/20110324010232_product_role_types.erp_products.rb +24 -0
- data/spec/dummy/db/data_migrations/20110525001935_add_usd_currency.erp_base_erp_svcs.rb +12 -0
- data/spec/dummy/db/data_migrations/20110527160807_add_default_prod_avail_types.erp_products.rb +27 -0
- data/spec/dummy/db/data_migrations/20110605231556_create_order_party_roles.erp_orders.rb +24 -0
- data/spec/dummy/db/data_migrations/20110609150135_add_iso_codes.erp_base_erp_svcs.rb +19 -0
- data/spec/dummy/db/data_migrations/20110728201729_erp_app_setup.erp_app.rb +252 -0
- data/spec/dummy/db/data_migrations/20110728201730_create_desktop_app_product_manager.erp_products.rb +26 -0
- data/spec/dummy/db/data_migrations/20110728201731_create_desktop_app_order_manager.erp_orders.rb +26 -0
- data/spec/dummy/db/data_migrations/20110728201732_create_organizer_app_order_management.erp_orders.rb +15 -0
- data/spec/dummy/db/data_migrations/20110728201733_update_preferences.erp_app.rb +53 -0
- data/spec/dummy/db/data_migrations/20110802200222_schedule_delete_expired_sessions_job.erp_tech_svcs.rb +16 -0
- data/spec/dummy/db/data_migrations/20110816161238_create_desktop_app_audit_log_viewer.erp_app.rb +21 -0
- data/spec/dummy/db/data_migrations/20110817160743_add_file_manager_application.erp_app.rb +32 -0
- data/spec/dummy/db/data_migrations/20110913145838_setup_compass_ae_instance.erp_base_erp_svcs.rb +12 -0
- data/spec/dummy/db/data_migrations/20111108183739_add_default_capabilities.erp_app.rb +23 -0
- data/spec/dummy/db/data_migrations/20111108183740_add_new_contact_widgets.erp_app.rb +42 -0
- data/spec/dummy/db/data_migrations/20111111144706_setup_audit_log_types.erp_tech_svcs.rb +22 -0
- data/spec/dummy/db/data_migrations/20120109173616_create_download_capability_type.erp_tech_svcs.rb +14 -0
- data/spec/dummy/db/data_migrations/20120229160222_add_userinfo_widget.erp_app.rb +29 -0
- data/spec/dummy/db/data_migrations/20120229174343_add_orders_widget.erp_orders.rb +29 -0
- data/spec/dummy/db/data_migrations/20120405193721_create_party_and_role_type_for_communication_events.erp_app.rb +11 -0
- data/spec/dummy/db/data_migrations/20120411180756_create_user_management_mobile_application.erp_app.rb +19 -0
- data/spec/dummy/db/data_migrations/20120418164215_create_configuration_management_desktop_application.erp_app.rb +23 -0
- data/spec/dummy/db/data_migrations/20121116155018_create_group_relationship_and_role_types.erp_tech_svcs.rb +20 -0
- data/spec/dummy/db/data_migrations/20121130201859_upgrade_remove_system_mgmt_app.erp_app.rb +16 -0
- data/spec/dummy/db/data_migrations/20121130212146_note_capabilities.erp_tech_svcs.rb +24 -0
- data/spec/dummy/db/data_migrations/20121218175028_create_security_management_desktop_application.erp_app.rb +23 -0
- data/spec/dummy/db/migrate/20130107214858_base_erp_services.erp_base_erp_svcs.rb +461 -0
- data/spec/dummy/db/migrate/20130107214859_base_txns_and_accts.erp_txns_and_accts.rb +364 -0
- data/spec/dummy/db/migrate/20130107214860_base_tech_services.erp_tech_svcs.rb +271 -0
- data/spec/dummy/db/migrate/20130107214861_create_has_attribute_tables.erp_tech_svcs.rb +39 -0
- data/spec/dummy/db/migrate/20130107214862_create_groups.erp_tech_svcs.rb +19 -0
- data/spec/dummy/db/migrate/20130107214863_upgrade_security.erp_tech_svcs.rb +54 -0
- data/spec/dummy/db/migrate/20130107214864_upgrade_security2.erp_tech_svcs.rb +270 -0
- data/spec/dummy/db/migrate/20130107214865_agreements_services.erp_agreements.rb +160 -0
- data/spec/dummy/db/migrate/20130107214866_agreements_services_indexes.erp_agreements.rb +52 -0
- data/spec/dummy/db/migrate/20130107214867_base_app_framework.erp_app.rb +276 -0
- data/spec/dummy/db/migrate/20130107214868_base_products.erp_products.rb +234 -0
- data/spec/dummy/db/migrate/20130107214869_base_products_indexes.erp_products.rb +59 -0
- data/spec/dummy/db/migrate/20130107214870_base_orders.erp_orders.rb +178 -0
- data/spec/dummy/db/migrate/20130107214871_erp_commerce_base.erp_commerce.rb +442 -0
- data/spec/dummy/db/schema.rb +1821 -0
- data/spec/dummy/db/spec.sqlite3 +0 -0
- data/spec/dummy/log/spec.log +12768 -0
- data/spec/spec_helper.rb +11 -3
- metadata +106 -11
- data/db/migrate/20110609230152_update_financial_txns.rb +0 -21
- data/db/migrate/20130408195119_add_biz_txn_acct_type_id_to_biz_txn_acct_root.rb +0 -5
- data/db/migrate/upgrade/20120118135738_add_type_column_to_biz_txn_acct_root.rb +0 -7
- data/db/migrate/upgrade/20120118143602_add_apply_date_to_financial_txn.rb +0 -7
- data/db/migrate/upgrade/20120515155000_update_financial_txn_acct_due_date.rb +0 -9
@@ -1,4 +1,5 @@
|
|
1
1
|
class BizTxnAcctRelationship < ActiveRecord::Base
|
2
|
+
attr_protected :created_at, :updated_at
|
2
3
|
|
3
4
|
belongs_to :account_from, :class_name => "BizTxnAcctRoot", :foreign_key => "biz_txn_acct_root_id_from"
|
4
5
|
belongs_to :account_to, :class_name => "BizTxnAcctRoot", :foreign_key => "biz_txn_acct_root_id_to"
|
@@ -1,21 +1,21 @@
|
|
1
1
|
class BizTxnAcctRoot < ActiveRecord::Base
|
2
|
+
attr_protected :created_at, :updated_at
|
2
3
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
4
|
+
belongs_to :biz_txn_acct, :polymorphic => true
|
5
|
+
has_many :biz_txn_events, :dependent => :destroy
|
6
|
+
has_many :biz_txn_acct_party_roles, :dependent => :destroy
|
7
|
+
|
8
|
+
alias :account :biz_txn_acct
|
9
|
+
alias :txn_events :biz_txn_events
|
10
|
+
alias :txns :biz_txn_events
|
7
11
|
|
8
|
-
|
9
|
-
alias :txn_events :biz_txn_events
|
10
|
-
alias :txns :biz_txn_events
|
11
|
-
|
12
|
-
def to_label
|
12
|
+
def to_label
|
13
13
|
"#{description}"
|
14
|
-
|
15
|
-
|
16
|
-
|
14
|
+
end
|
15
|
+
|
16
|
+
def to_s
|
17
17
|
"#{description}"
|
18
|
-
|
18
|
+
end
|
19
19
|
|
20
20
|
def add_party_with_role(party, biz_txn_acct_pty_rtype, description=nil)
|
21
21
|
biz_txn_acct_pty_rtype = BizTxnAcctPtyRtype.iid(biz_txn_acct_pty_rtype) if biz_txn_acct_pty_rtype.is_a? String
|
@@ -30,5 +30,5 @@ class BizTxnAcctRoot < ActiveRecord::Base
|
|
30
30
|
raise "BizTxnAcctPtyRtype #{biz_txn_acct_pty_rtype.to_s} does not exist" if biz_txn_acct_pty_rtype.nil?
|
31
31
|
self.biz_txn_acct_party_roles.where('biz_txn_acct_pty_rtype_id = ?', biz_txn_acct_pty_rtype.id).collect(&:party)
|
32
32
|
end
|
33
|
-
|
33
|
+
|
34
34
|
end
|
data/app/models/biz_txn_event.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
class BizTxnRelationship < ActiveRecord::Base
|
2
|
+
attr_protected :created_at, :updated_at
|
2
3
|
|
3
4
|
belongs_to :txn_event_from, :class_name => "BizTxnEvent", :foreign_key => "txn_event_id_from"
|
4
5
|
belongs_to :txn_event_to , :class_name => "BizTxnEvent", :foreign_key => "txn_event_id_to"
|
data/app/models/biz_txn_task.rb
CHANGED
data/app/models/biz_txn_type.rb
CHANGED
data/app/models/financial_txn.rb
CHANGED
data/lib/erp_txns_and_accts.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
module ErpTxnsAndAccts
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
2
|
+
module Extensions
|
3
|
+
module ActiveRecord
|
4
|
+
module ActsAsBizTxnAccount
|
5
|
+
|
6
6
|
def self.included(base)
|
7
7
|
base.extend(ClassMethods)
|
8
8
|
end
|
@@ -21,7 +21,6 @@ module ErpTxnsAndAccts
|
|
21
21
|
|
22
22
|
[
|
23
23
|
:biz_txn_acct_type,
|
24
|
-
:txn_account_type,:txn_account_type=,
|
25
24
|
:biz_txn_events,
|
26
25
|
:biz_txn_acct_party_roles,
|
27
26
|
:txn_events,:add_party_with_role,
|
@@ -53,13 +52,13 @@ module ErpTxnsAndAccts
|
|
53
52
|
end
|
54
53
|
|
55
54
|
def destroy_biz_txn_account
|
56
|
-
|
57
|
-
|
55
|
+
self.biz_txn_acct_root.destroy if (self.biz_txn_acct_root && !self.biz_txn_acct_root.frozen?)
|
56
|
+
end
|
58
57
|
end
|
59
|
-
|
58
|
+
|
60
59
|
module SingletonMethods
|
61
60
|
end
|
62
|
-
|
61
|
+
|
63
62
|
end#ActsAsBizTxnAccount
|
64
63
|
end#ActiveRecord
|
65
64
|
end#Extensions
|
@@ -43,6 +43,12 @@ module Dummy
|
|
43
43
|
|
44
44
|
# Enable the asset pipeline
|
45
45
|
config.assets.enabled = true
|
46
|
+
|
47
|
+
# Enforce whitelist mode for mass assignment.
|
48
|
+
# This will create an empty whitelist of attributes available for mass-assignment for all models
|
49
|
+
# in your app. As such, your models will need to explicitly whitelist or blacklist accessible
|
50
|
+
# parameters by using an attr_accessible or attr_protected declaration.
|
51
|
+
config.active_record.whitelist_attributes = true
|
46
52
|
end
|
47
53
|
end
|
48
54
|
|
@@ -1,6 +1,9 @@
|
|
1
1
|
Dummy::Application.configure do
|
2
2
|
# Settings specified here will take precedence over those in config/application.rb
|
3
3
|
|
4
|
+
# Raise exception on mass assignment protection for Active Record models
|
5
|
+
config.active_record.mass_assignment_sanitizer = :strict
|
6
|
+
|
4
7
|
# In the development environment your application's code is reloaded on
|
5
8
|
# every request. This slows down response time but is perfect for development
|
6
9
|
# since you don't have to restart the web server when you make code changes.
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# This migration comes from erp_commerce (originally 20101011152441)
|
2
|
+
class PaymentGatewayActions
|
3
|
+
|
4
|
+
def self.up
|
5
|
+
PaymentGatewayAction.create(
|
6
|
+
:internal_identifier => 'capture',
|
7
|
+
:description => 'capture'
|
8
|
+
)
|
9
|
+
|
10
|
+
PaymentGatewayAction.create(
|
11
|
+
:internal_identifier => 'authorize',
|
12
|
+
:description => 'Authorize'
|
13
|
+
)
|
14
|
+
|
15
|
+
PaymentGatewayAction.create(
|
16
|
+
:internal_identifier => 'full_reverse_of_authorization',
|
17
|
+
:description => 'Full Reverse Of Authorization'
|
18
|
+
)
|
19
|
+
end
|
20
|
+
|
21
|
+
def self.down
|
22
|
+
['sale','void_sale','authorize'].each do |iid|
|
23
|
+
type = PaymentGatewayAction.find_by_internal_identifier(iid)
|
24
|
+
type.destroy unless type.nil?
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# This migration comes from erp_txns_and_accts (originally 20101014142230)
|
2
|
+
class FinancialTxnTypes
|
3
|
+
|
4
|
+
def self.up
|
5
|
+
BizTxnType.create(
|
6
|
+
:description => "Payment Transaction",
|
7
|
+
:internal_identifier => 'payment_txn'
|
8
|
+
)
|
9
|
+
end
|
10
|
+
|
11
|
+
def self.down
|
12
|
+
type = BizTxnType.iid('payment_txn')
|
13
|
+
type.destroy unless type.nil?
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
data/spec/dummy/db/data_migrations/20110109173616_create_capability_scope_types.erp_tech_svcs.rb
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
# This migration comes from erp_tech_svcs (originally 20110109173616)
|
2
|
+
class CreateCapabilityScopeTypes
|
3
|
+
|
4
|
+
def self.up
|
5
|
+
CapabilityType.create(:internal_identifier => 'download', :description => 'Download') if CapabilityType.where("internal_identifier = 'download'").first.nil?
|
6
|
+
|
7
|
+
ScopeType.create(:description => 'Instance', :internal_identifier => 'instance') if ScopeType.where("internal_identifier = 'instance'").first.nil?
|
8
|
+
ScopeType.create(:description => 'Class', :internal_identifier => 'class') if ScopeType.where("internal_identifier = 'class'").first.nil?
|
9
|
+
ScopeType.create(:description => 'Query', :internal_identifier => 'query') if ScopeType.where("internal_identifier = 'query'").first.nil?
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.down
|
13
|
+
end
|
14
|
+
|
15
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# This migration comes from erp_products (originally 20110324010232)
|
2
|
+
class ProductRoleTypes
|
3
|
+
|
4
|
+
def self.up
|
5
|
+
ProdTypeRelnType.create(:internal_identifier => 'product_type_package_reln', :description => 'Product Type Package Relationship')
|
6
|
+
ProdTypeRoleType.create(:internal_identifier => 'product_type_package', :description => 'Product Type Package')
|
7
|
+
ProdTypeRoleType.create(:internal_identifier => 'packaged_product_type', :description => 'Packaged Product Type')
|
8
|
+
|
9
|
+
ProdInstanceRelnType.create(:internal_identifier => 'product_instance_package_reln', :description => 'Product Instance Package Relantionship')
|
10
|
+
ProdInstanceRoleType.create(:internal_identifier => 'product_instance_package', :description => 'Product Instance Package')
|
11
|
+
ProdInstanceRoleType.create(:internal_identifier => 'packaged_product_instance', :description => 'Packaged Product Instance')
|
12
|
+
end
|
13
|
+
|
14
|
+
def self.down
|
15
|
+
['product_type_package_reln','product_type_package','packaged_product_type'].each do |iid|
|
16
|
+
ProdTypeRelnType.iid(iid).destroy
|
17
|
+
end
|
18
|
+
|
19
|
+
['product_instance_package_reln','product_instance_package','packaged_product_instance'].each do |iid|
|
20
|
+
ProdInstanceRoleType.iid(iid).destroy
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# This migration comes from erp_base_erp_svcs (originally 20110525001935)
|
2
|
+
class AddUsdCurrency
|
3
|
+
|
4
|
+
def self.up
|
5
|
+
Currency.create(:name => 'US Dollar', :internal_identifier => 'USD', :major_unit_symbol => "$")
|
6
|
+
end
|
7
|
+
|
8
|
+
def self.down
|
9
|
+
Currency.usd.destroy
|
10
|
+
end
|
11
|
+
|
12
|
+
end
|
data/spec/dummy/db/data_migrations/20110527160807_add_default_prod_avail_types.erp_products.rb
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
# This migration comes from erp_products (originally 20110527160807)
|
2
|
+
class AddDefaultProdAvailTypes
|
3
|
+
|
4
|
+
def self.up
|
5
|
+
ProdAvailabilityStatusType.create(
|
6
|
+
:description => 'Available',
|
7
|
+
:internal_identifier => 'available'
|
8
|
+
)
|
9
|
+
|
10
|
+
ProdAvailabilityStatusType.create(
|
11
|
+
:description => 'Sold',
|
12
|
+
:internal_identifier => 'sold'
|
13
|
+
)
|
14
|
+
|
15
|
+
ProdAvailabilityStatusType.create(
|
16
|
+
:description => 'Shipped',
|
17
|
+
:internal_identifier => 'shipped'
|
18
|
+
)
|
19
|
+
end
|
20
|
+
|
21
|
+
def self.down
|
22
|
+
%w(available sold shipped).each do |iid|
|
23
|
+
ProdAvailabilityStatusType.find_by_internal_identifier(iid).destroy
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# This migration comes from erp_orders (originally 20110605231556)
|
2
|
+
class CreateOrderPartyRoles
|
3
|
+
|
4
|
+
def self.up
|
5
|
+
order_roles = BizTxnPartyRoleType.create(
|
6
|
+
:description => 'Order Roles',
|
7
|
+
:internal_identifier => 'order_roles'
|
8
|
+
)
|
9
|
+
|
10
|
+
buyor_role = BizTxnPartyRoleType.create(
|
11
|
+
:description => 'Payor',
|
12
|
+
:internal_identifier => 'payor'
|
13
|
+
)
|
14
|
+
|
15
|
+
buyor_role.move_to_child_of(order_roles)
|
16
|
+
buyor_role.save
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.down
|
20
|
+
BizTxnPartyRoleType.find_by_internal_identifier('payor').destroy
|
21
|
+
BizTxnPartyRoleType.find_by_internal_identifier('order_roles').destroy
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|