fx-shared-models 0.2.4__tar.gz → 0.2.6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {fx_shared_models-0.2.4/fx_shared_models.egg-info → fx_shared_models-0.2.6}/PKG-INFO +1 -1
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6/fx_shared_models.egg-info}/PKG-INFO +1 -1
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/setup.py +1 -1
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/__init__.py +1 -1
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/ib_commission/services/commission_calculator_service.py +41 -10
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/LICENSE +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/MANIFEST.in +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/README.md +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/fx_shared_models.egg-info/SOURCES.txt +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/fx_shared_models.egg-info/dependency_links.txt +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/fx_shared_models.egg-info/requires.txt +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/fx_shared_models.egg-info/top_level.txt +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/setup.cfg +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/accounts/__init__.py +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/accounts/apps.py +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/accounts/migrations/0001_initial.py +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/accounts/migrations/0002_remove_account_group_type_account_has_bonus_and_more.py +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/accounts/migrations/0003_account_is_archived_account_is_trading_enabled.py +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/accounts/migrations/0004_alter_account_created_at_alter_account_created_by_and_more.py +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/accounts/migrations/0005_account_currency.py +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/accounts/migrations/0006_alter_account_options.py +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/accounts/migrations/__init__.py +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/accounts/models.py +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/common/__pycache__/base.cpython-313.pyc +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/common/__pycache__/mixins.cpython-313.pyc +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/common/__pycache__/utils.cpython-313.pyc +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/common/base.py +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/common/mixins.py +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/common/utils.py +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/company_ba/__init__.py +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/company_ba/apps.py +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/company_ba/migrations/0001_initial.py +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/company_ba/migrations/__init__.py +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/company_ba/models.py +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/constants.py +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/customers/__init__.py +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/customers/__pycache__/__init__.cpython-313.pyc +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/customers/__pycache__/apps.cpython-313.pyc +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/customers/__pycache__/models.cpython-313.pyc +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/customers/apps.py +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/customers/migrations/0001_initial.py +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/customers/migrations/0002_alter_customer_email_alter_customer_first_name_and_more.py +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/customers/migrations/0004_customerauth_two_factor_backup_codes_and_more.py +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/customers/migrations/0005_customerauth_temp_webauthn_challenge.py +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/customers/migrations/0006_customerauth_webauthn_challenge.py +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/customers/migrations/0007_customerauth_blocked_customerauth_blocked_at_and_more.py +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/customers/migrations/0008_customer_email_hash.py +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/customers/migrations/__init__.py +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/customers/migrations/__pycache__/0001_initial.cpython-313.pyc +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/customers/migrations/__pycache__/0002_alter_customer_email_alter_customer_first_name_and_more.cpython-313.pyc +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/customers/migrations/__pycache__/0004_customerauth_two_factor_backup_codes_and_more.cpython-313.pyc +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/customers/migrations/__pycache__/0005_customerauth_temp_webauthn_challenge.cpython-313.pyc +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/customers/migrations/__pycache__/0006_customerauth_webauthn_challenge.cpython-313.pyc +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/customers/migrations/__pycache__/0007_customerauth_blocked_customerauth_blocked_at_and_more.cpython-313.pyc +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/customers/migrations/__pycache__/0008_customer_email_hash.cpython-313.pyc +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/customers/migrations/__pycache__/__init__.cpython-313.pyc +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/customers/models.py +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/ib_commission/__init__.py +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/ib_commission/apps.py +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/ib_commission/migrations/0001_initial.py +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/ib_commission/migrations/0002_alter_clientibmapping_id_and_more.py +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/ib_commission/migrations/0003_commissiondistribution_is_pass_up_and_more.py +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/ib_commission/migrations/0004_rename_ib_commissi_account_76e731_idx_ib_commissi_account_10d556_idx_and_more.py +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/ib_commission/migrations/0005_alter_ibagreementmember_start_date.py +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/ib_commission/migrations/0006_clientibmapping_agreement_and_more.py +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/ib_commission/migrations/0007_alter_clientibmapping_mt5_login.py +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/ib_commission/migrations/0008_commissiondistribution_is_processed_and_more.py +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/ib_commission/migrations/0009_commissiondistribution_processing_notes_and_more.py +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/ib_commission/migrations/__init__.py +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/ib_commission/models.py +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/ib_commission/services/__init__.py +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/services/group_resolver.py +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/system_settings/__pycache__/apps.cpython-313.pyc +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/system_settings/__pycache__/serializers.cpython-313.pyc +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/system_settings/apps.py +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/system_settings/migrations/0001_initial.py +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/system_settings/migrations/0002_rename_is_enabled_systemsetting_is_active.py +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/system_settings/migrations/0003_tradingplatformserver.py +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/system_settings/migrations/0004_tradingplatformserver_connection_timeout_and_more.py +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/system_settings/migrations/0005_accountsequence_accounttype.py +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/system_settings/migrations/0006_alter_accounttype_sequence.py +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/system_settings/migrations/0007_remove_accounttype_default_group_type_and_more.py +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/system_settings/migrations/0008_paymentgatewayconfig_paymentmethodconfig_and_more.py +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/system_settings/migrations/0009_alter_accountsequence_created_at_and_more.py +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/system_settings/migrations/0010_alter_paymentgatewayconfig_gateway_and_more.py +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/system_settings/migrations/__init__.py +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/system_settings/migrations/__pycache__/0001_initial.cpython-313.pyc +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/system_settings/migrations/__pycache__/0002_rename_is_enabled_systemsetting_is_active.cpython-313.pyc +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/system_settings/migrations/__pycache__/0003_tradingplatformserver.cpython-313.pyc +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/system_settings/migrations/__pycache__/0004_tradingplatformserver_connection_timeout_and_more.cpython-313.pyc +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/system_settings/migrations/__pycache__/0005_accountsequence_accounttype.cpython-313.pyc +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/system_settings/migrations/__pycache__/0006_alter_accounttype_sequence.cpython-313.pyc +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/system_settings/migrations/__pycache__/0007_remove_accounttype_default_group_type_and_more.cpython-313.pyc +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/system_settings/migrations/__pycache__/0008_paymentgatewayconfig_paymentmethodconfig_and_more.cpython-313.pyc +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/system_settings/migrations/__pycache__/0009_alter_accountsequence_created_at_and_more.cpython-313.pyc +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/system_settings/migrations/__pycache__/0010_alter_paymentgatewayconfig_gateway_and_more.cpython-313.pyc +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/system_settings/migrations/__pycache__/__init__.cpython-313.pyc +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/system_settings/models/__init__.py +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/system_settings/models/__pycache__/__init__.cpython-313.pyc +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/system_settings/models/__pycache__/account_sequence.cpython-313.pyc +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/system_settings/models/__pycache__/account_types.cpython-313.pyc +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/system_settings/models/__pycache__/accounts.cpython-313.pyc +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/system_settings/models/__pycache__/base.cpython-313.pyc +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/system_settings/models/__pycache__/email.cpython-313.pyc +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/system_settings/models/__pycache__/group_configurations.cpython-313.pyc +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/system_settings/models/__pycache__/payment_methods.cpython-313.pyc +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/system_settings/models/__pycache__/trading_platform.cpython-313.pyc +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/system_settings/models/__pycache__/transaction_configs.cpython-313.pyc +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/system_settings/models/account_sequence.py +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/system_settings/models/account_types.py +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/system_settings/models/base.py +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/system_settings/models/email.py +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/system_settings/models/group_configurations.py +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/system_settings/models/payment_methods.py +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/system_settings/models/trading_platform.py +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/system_settings/models/transaction_configs.py +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/system_settings/serializers.py +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/transactions/__init__.py +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/transactions/apps.py +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/transactions/constants.py +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/transactions/enums.py +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/transactions/migrations/0001_initial.py +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/transactions/migrations/0002_transaction_mt5_ticket.py +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/transactions/migrations/0003_alter_transaction_options.py +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/transactions/migrations/__init__.py +0 -0
- {fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/transactions/models.py +0 -0
|
@@ -45,6 +45,7 @@ class CommissionCalculatorService:
|
|
|
45
45
|
Dictionary containing:
|
|
46
46
|
- distributions: List of calculated distributions
|
|
47
47
|
- client_deduction: Total amount to deduct from client (for entry positions)
|
|
48
|
+
- client_server_id: Server ID for the client account (for MT5 processing)
|
|
48
49
|
- is_processed: Whether distributions have been processed
|
|
49
50
|
"""
|
|
50
51
|
# Extract deal data
|
|
@@ -60,24 +61,23 @@ class CommissionCalculatorService:
|
|
|
60
61
|
|
|
61
62
|
# Check if commission already calculated
|
|
62
63
|
if CommissionDistribution.objects.filter(deal_ticket=deal_ticket).exists():
|
|
63
|
-
return {'distributions': [], 'client_deduction': 0, 'is_processed': True}
|
|
64
|
+
return {'distributions': [], 'client_deduction': 0, 'client_server_id': None, 'is_processed': True}
|
|
64
65
|
|
|
65
66
|
# Find account using MT5 login
|
|
66
67
|
account = Account.objects.filter(login=mt5_login, is_active=True).first()
|
|
67
68
|
if not account:
|
|
68
|
-
return {'distributions': [], 'client_deduction': 0, 'is_processed': False}
|
|
69
|
+
return {'distributions': [], 'client_deduction': 0, 'client_server_id': None, 'is_processed': False}
|
|
69
70
|
|
|
70
71
|
# Get customer from account
|
|
71
72
|
customer = account.customer
|
|
72
73
|
|
|
73
74
|
# Find mapping for this customer
|
|
74
75
|
client_mapping = ClientIBMapping.objects.filter(
|
|
75
|
-
customer=customer
|
|
76
|
-
is_active=True
|
|
76
|
+
customer=customer
|
|
77
77
|
).first()
|
|
78
78
|
|
|
79
79
|
if not client_mapping:
|
|
80
|
-
return {'distributions': [], 'client_deduction': 0, 'is_processed': False}
|
|
80
|
+
return {'distributions': [], 'client_deduction': 0, 'client_server_id': None, 'is_processed': False}
|
|
81
81
|
|
|
82
82
|
# Determine which rules to apply based on entry type
|
|
83
83
|
is_entry = entry in [cls.ENTRY_IN, cls.ENTRY_INOUT] # Entry or InOut
|
|
@@ -98,7 +98,7 @@ class CommissionCalculatorService:
|
|
|
98
98
|
)
|
|
99
99
|
|
|
100
100
|
if not applicable_rules:
|
|
101
|
-
return {'distributions': [], 'client_deduction': 0, 'is_processed': False}
|
|
101
|
+
return {'distributions': [], 'client_deduction': 0, 'client_server_id': None, 'is_processed': False}
|
|
102
102
|
|
|
103
103
|
distributions = []
|
|
104
104
|
client_deduction = Decimal('0.0')
|
|
@@ -126,7 +126,7 @@ class CommissionCalculatorService:
|
|
|
126
126
|
).first()
|
|
127
127
|
|
|
128
128
|
if not ib_hierarchy:
|
|
129
|
-
return {'distributions': [], 'client_deduction': 0, 'is_processed': False}
|
|
129
|
+
return {'distributions': [], 'client_deduction': 0, 'client_server_id': None, 'is_processed': False}
|
|
130
130
|
|
|
131
131
|
path_parts = ib_hierarchy.path.split('.')
|
|
132
132
|
|
|
@@ -160,9 +160,18 @@ class CommissionCalculatorService:
|
|
|
160
160
|
commission_tracking.amount = client_deduction
|
|
161
161
|
commission_tracking.save()
|
|
162
162
|
|
|
163
|
+
# Get client server ID for MT5 processing
|
|
164
|
+
client_server_id = account.server.id if account else None
|
|
165
|
+
|
|
166
|
+
# Enrich distributions with server information
|
|
167
|
+
for dist in distributions:
|
|
168
|
+
if dist.ib_account and not hasattr(dist, 'server_id'):
|
|
169
|
+
dist.server_id = dist.ib_account.server.id
|
|
170
|
+
|
|
163
171
|
return {
|
|
164
172
|
'distributions': distributions,
|
|
165
173
|
'client_deduction': client_deduction,
|
|
174
|
+
'client_server_id': client_server_id,
|
|
166
175
|
'is_processed': False
|
|
167
176
|
}
|
|
168
177
|
|
|
@@ -293,11 +302,15 @@ class CommissionCalculatorService:
|
|
|
293
302
|
|
|
294
303
|
ib_account = None
|
|
295
304
|
mt5_login = 0
|
|
305
|
+
server_id = None
|
|
296
306
|
|
|
297
307
|
if ib_hierarchy_entry:
|
|
298
308
|
ib_account = ib_hierarchy_entry.ib_account
|
|
299
309
|
mt5_login = ib_hierarchy_entry.mt5_login
|
|
310
|
+
if ib_account:
|
|
311
|
+
server_id = ib_account.server.id
|
|
300
312
|
|
|
313
|
+
# Create distribution record with server information
|
|
301
314
|
keep_distribution = CommissionDistribution.objects.create(
|
|
302
315
|
deal_ticket=deal_ticket,
|
|
303
316
|
customer_id=ib_id,
|
|
@@ -308,8 +321,15 @@ class CommissionCalculatorService:
|
|
|
308
321
|
level=hierarchy_info[ib_id]['level'],
|
|
309
322
|
rule=rule,
|
|
310
323
|
is_processed=False,
|
|
311
|
-
processed_time=datetime.now()
|
|
324
|
+
processed_time=datetime.now(),
|
|
325
|
+
processing_status='PENDING',
|
|
326
|
+
processing_notes=f'Server ID: {server_id}' if server_id else 'No server information available'
|
|
312
327
|
)
|
|
328
|
+
|
|
329
|
+
# Add server_id as an attribute for easy access
|
|
330
|
+
if server_id:
|
|
331
|
+
keep_distribution.server_id = server_id
|
|
332
|
+
|
|
313
333
|
distributions.append(keep_distribution)
|
|
314
334
|
|
|
315
335
|
# Calculate pass-up amount if not master IB
|
|
@@ -325,11 +345,15 @@ class CommissionCalculatorService:
|
|
|
325
345
|
|
|
326
346
|
parent_account = None
|
|
327
347
|
parent_mt5_login = 0
|
|
348
|
+
parent_server_id = None
|
|
328
349
|
|
|
329
350
|
if parent_hierarchy_entry:
|
|
330
351
|
parent_account = parent_hierarchy_entry.ib_account
|
|
331
352
|
parent_mt5_login = parent_hierarchy_entry.mt5_login
|
|
353
|
+
if parent_account:
|
|
354
|
+
parent_server_id = parent_account.server.id
|
|
332
355
|
|
|
356
|
+
# Create pass-up distribution record with server information
|
|
333
357
|
pass_up_distribution = CommissionDistribution.objects.create(
|
|
334
358
|
deal_ticket=deal_ticket,
|
|
335
359
|
customer_id=parent_id,
|
|
@@ -341,8 +365,15 @@ class CommissionCalculatorService:
|
|
|
341
365
|
rule=rule,
|
|
342
366
|
is_pass_up=True,
|
|
343
367
|
is_processed=False,
|
|
344
|
-
processed_time=datetime.now()
|
|
368
|
+
processed_time=datetime.now(),
|
|
369
|
+
processing_status='PENDING',
|
|
370
|
+
processing_notes=f'Server ID: {parent_server_id}' if parent_server_id else 'No server information available'
|
|
345
371
|
)
|
|
372
|
+
|
|
373
|
+
# Add server_id as an attribute for easy access
|
|
374
|
+
if parent_server_id:
|
|
375
|
+
pass_up_distribution.server_id = parent_server_id
|
|
376
|
+
|
|
346
377
|
distributions.append(pass_up_distribution)
|
|
347
378
|
|
|
348
379
|
return distributions
|
|
@@ -395,7 +426,7 @@ class CommissionCalculatorService:
|
|
|
395
426
|
"""
|
|
396
427
|
# Find all active agreements for this IB
|
|
397
428
|
ib_agreements = IBAgreementMember.objects.filter(
|
|
398
|
-
|
|
429
|
+
customer_id=ib_id,
|
|
399
430
|
agreement__is_active=True
|
|
400
431
|
).values_list('agreement_id', flat=True)
|
|
401
432
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/fx_shared_models.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/accounts/migrations/0001_initial.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/accounts/migrations/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/company_ba/migrations/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/customers/migrations/0001_initial.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/customers/migrations/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/ib_commission/migrations/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/ib_commission/services/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/system_settings/models/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/system_settings/models/base.py
RENAMED
|
File without changes
|
{fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/system_settings/models/email.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/system_settings/serializers.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fx_shared_models-0.2.4 → fx_shared_models-0.2.6}/shared_models/transactions/migrations/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|