wbcommission 2.2.1__py2.py3-none-any.whl
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.
Potentially problematic release.
This version of wbcommission might be problematic. Click here for more details.
- wbcommission/__init__.py +1 -0
- wbcommission/admin/__init__.py +4 -0
- wbcommission/admin/accounts.py +22 -0
- wbcommission/admin/commission.py +85 -0
- wbcommission/admin/rebate.py +7 -0
- wbcommission/analytics/__init__.py +0 -0
- wbcommission/analytics/marginality.py +181 -0
- wbcommission/apps.py +5 -0
- wbcommission/dynamic_preferences_registry.py +0 -0
- wbcommission/factories/__init__.py +9 -0
- wbcommission/factories/commission.py +100 -0
- wbcommission/factories/rebate.py +16 -0
- wbcommission/filters/__init__.py +7 -0
- wbcommission/filters/rebate.py +187 -0
- wbcommission/filters/signals.py +44 -0
- wbcommission/generators/__init__.py +2 -0
- wbcommission/generators/rebate_generator.py +93 -0
- wbcommission/migrations/0001_initial.py +299 -0
- wbcommission/migrations/0002_commissionrule_remove_accountcustomer_account_and_more.py +395 -0
- wbcommission/migrations/0003_alter_commission_account.py +24 -0
- wbcommission/migrations/0004_rebate_audit_log.py +19 -0
- wbcommission/migrations/0005_alter_rebate_audit_log.py +20 -0
- wbcommission/migrations/0006_commissionrule_consider_zero_percent_for_exclusion.py +21 -0
- wbcommission/migrations/0007_remove_commission_unique_crm_recipient_account_and_more.py +50 -0
- wbcommission/migrations/0008_alter_commission_options_alter_commission_order.py +26 -0
- wbcommission/migrations/__init__.py +0 -0
- wbcommission/models/__init__.py +9 -0
- wbcommission/models/account_service.py +217 -0
- wbcommission/models/commission.py +679 -0
- wbcommission/models/rebate.py +319 -0
- wbcommission/models/signals.py +45 -0
- wbcommission/permissions.py +6 -0
- wbcommission/reports/__init__.py +0 -0
- wbcommission/reports/audit_report.py +51 -0
- wbcommission/reports/customer_report.py +299 -0
- wbcommission/reports/utils.py +30 -0
- wbcommission/serializers/__init__.py +3 -0
- wbcommission/serializers/commissions.py +26 -0
- wbcommission/serializers/rebate.py +87 -0
- wbcommission/serializers/signals.py +27 -0
- wbcommission/tests/__init__.py +0 -0
- wbcommission/tests/analytics/__init__.py +0 -0
- wbcommission/tests/analytics/test_marginality.py +253 -0
- wbcommission/tests/conftest.py +89 -0
- wbcommission/tests/models/__init__.py +0 -0
- wbcommission/tests/models/mixins.py +22 -0
- wbcommission/tests/models/test_account_service.py +293 -0
- wbcommission/tests/models/test_commission.py +587 -0
- wbcommission/tests/models/test_rebate.py +136 -0
- wbcommission/tests/signals.py +0 -0
- wbcommission/tests/test_permissions.py +66 -0
- wbcommission/tests/viewsets/__init__.py +0 -0
- wbcommission/tests/viewsets/test_rebate.py +76 -0
- wbcommission/urls.py +42 -0
- wbcommission/viewsets/__init__.py +7 -0
- wbcommission/viewsets/buttons/__init__.py +2 -0
- wbcommission/viewsets/buttons/rebate.py +46 -0
- wbcommission/viewsets/buttons/signals.py +53 -0
- wbcommission/viewsets/commissions.py +21 -0
- wbcommission/viewsets/display/__init__.py +5 -0
- wbcommission/viewsets/display/commissions.py +21 -0
- wbcommission/viewsets/display/rebate.py +117 -0
- wbcommission/viewsets/endpoints/__init__.py +4 -0
- wbcommission/viewsets/endpoints/commissions.py +0 -0
- wbcommission/viewsets/endpoints/rebate.py +21 -0
- wbcommission/viewsets/menu/__init__.py +1 -0
- wbcommission/viewsets/menu/commissions.py +0 -0
- wbcommission/viewsets/menu/rebate.py +13 -0
- wbcommission/viewsets/mixins.py +39 -0
- wbcommission/viewsets/rebate.py +481 -0
- wbcommission/viewsets/titles/__init__.py +1 -0
- wbcommission/viewsets/titles/commissions.py +0 -0
- wbcommission/viewsets/titles/rebate.py +11 -0
- wbcommission-2.2.1.dist-info/METADATA +11 -0
- wbcommission-2.2.1.dist-info/RECORD +76 -0
- wbcommission-2.2.1.dist-info/WHEEL +5 -0
|
@@ -0,0 +1,395 @@
|
|
|
1
|
+
# Generated by Django 4.1.9 on 2023-07-05 14:26
|
|
2
|
+
|
|
3
|
+
from decimal import Decimal
|
|
4
|
+
|
|
5
|
+
import django.contrib.postgres.constraints
|
|
6
|
+
import django.contrib.postgres.fields.ranges
|
|
7
|
+
import django.db.models.deletion
|
|
8
|
+
import wbcommission.models.rebate
|
|
9
|
+
from django.db import migrations, models
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class Migration(migrations.Migration):
|
|
13
|
+
dependencies = [
|
|
14
|
+
("wbcrm", "0005_account_accountrole_accountroletype_and_more"),
|
|
15
|
+
("wbcommission", "0001_initial"),
|
|
16
|
+
("directory", "0004_entry_is_draft_entry"),
|
|
17
|
+
]
|
|
18
|
+
|
|
19
|
+
operations = [
|
|
20
|
+
migrations.RenameModel(old_name="Commission", new_name="OldCommission"),
|
|
21
|
+
migrations.DeleteModel(name="rebate"),
|
|
22
|
+
migrations.CreateModel(
|
|
23
|
+
name="CommissionType",
|
|
24
|
+
fields=[
|
|
25
|
+
("id", models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
|
|
26
|
+
("name", models.CharField(max_length=256, verbose_name="Name")),
|
|
27
|
+
("key", models.CharField(max_length=256, unique=True)),
|
|
28
|
+
],
|
|
29
|
+
),
|
|
30
|
+
migrations.CreateModel(
|
|
31
|
+
name="Commission",
|
|
32
|
+
fields=[
|
|
33
|
+
("id", models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
|
|
34
|
+
(
|
|
35
|
+
"portfolio_role_recipient",
|
|
36
|
+
models.CharField(
|
|
37
|
+
blank=True,
|
|
38
|
+
choices=[
|
|
39
|
+
("MANAGER", "Manager"),
|
|
40
|
+
("RISK_MANAGER", "Risk Manager"),
|
|
41
|
+
("PORTFOLIO_MANAGER", "Portfolio Manager"),
|
|
42
|
+
("ANALYST", "Analyst"),
|
|
43
|
+
],
|
|
44
|
+
max_length=32,
|
|
45
|
+
null=True,
|
|
46
|
+
verbose_name="Recipient Role",
|
|
47
|
+
),
|
|
48
|
+
),
|
|
49
|
+
("order", models.IntegerField()),
|
|
50
|
+
("net_commission", models.BooleanField(default=True, verbose_name="Net Commission Rule")),
|
|
51
|
+
(
|
|
52
|
+
"commission_type",
|
|
53
|
+
models.ForeignKey(
|
|
54
|
+
on_delete=django.db.models.deletion.PROTECT,
|
|
55
|
+
related_name="commissions",
|
|
56
|
+
to="wbcommission.commissiontype",
|
|
57
|
+
verbose_name="Commission Type",
|
|
58
|
+
),
|
|
59
|
+
),
|
|
60
|
+
(
|
|
61
|
+
"is_hidden",
|
|
62
|
+
models.BooleanField(
|
|
63
|
+
default=True,
|
|
64
|
+
help_text="If False, this commission rule can be seen by anoyone that can access the related account. Otherwise, only an explicit role will grant access",
|
|
65
|
+
verbose_name="Public Commission Rule",
|
|
66
|
+
),
|
|
67
|
+
),
|
|
68
|
+
(
|
|
69
|
+
"account",
|
|
70
|
+
models.ForeignKey(
|
|
71
|
+
limit_choices_to=models.Q(("is_terminal_account", True)),
|
|
72
|
+
on_delete=django.db.models.deletion.CASCADE,
|
|
73
|
+
related_name="account_commissions",
|
|
74
|
+
to="wbcrm.account",
|
|
75
|
+
verbose_name="Account",
|
|
76
|
+
),
|
|
77
|
+
),
|
|
78
|
+
(
|
|
79
|
+
"account_role_type_recipient",
|
|
80
|
+
models.ForeignKey(
|
|
81
|
+
blank=True,
|
|
82
|
+
null=True,
|
|
83
|
+
on_delete=django.db.models.deletion.PROTECT,
|
|
84
|
+
related_name="recipient_commissions",
|
|
85
|
+
to="wbcrm.accountroletype",
|
|
86
|
+
verbose_name="Account Role Type Recipient",
|
|
87
|
+
),
|
|
88
|
+
),
|
|
89
|
+
(
|
|
90
|
+
"crm_recipient",
|
|
91
|
+
models.ForeignKey(
|
|
92
|
+
blank=True,
|
|
93
|
+
null=True,
|
|
94
|
+
on_delete=django.db.models.deletion.PROTECT,
|
|
95
|
+
related_name="recipient_commissions",
|
|
96
|
+
to="directory.entry",
|
|
97
|
+
verbose_name="Recipient",
|
|
98
|
+
),
|
|
99
|
+
),
|
|
100
|
+
],
|
|
101
|
+
options={
|
|
102
|
+
"verbose_name": "Commission",
|
|
103
|
+
"verbose_name_plural": "Commissions",
|
|
104
|
+
},
|
|
105
|
+
),
|
|
106
|
+
migrations.AddConstraint(
|
|
107
|
+
model_name="commission",
|
|
108
|
+
constraint=models.UniqueConstraint(
|
|
109
|
+
fields=("commission_type", "account", "crm_recipient"), name="unique_crm_recipient_account"
|
|
110
|
+
),
|
|
111
|
+
),
|
|
112
|
+
migrations.AddConstraint(
|
|
113
|
+
model_name="commission",
|
|
114
|
+
constraint=models.UniqueConstraint(
|
|
115
|
+
fields=("commission_type", "account", "portfolio_role_recipient"),
|
|
116
|
+
name="unique_portfolio_role_recipient_account",
|
|
117
|
+
),
|
|
118
|
+
),
|
|
119
|
+
migrations.AddConstraint(
|
|
120
|
+
model_name="commission",
|
|
121
|
+
constraint=models.UniqueConstraint(
|
|
122
|
+
fields=("commission_type", "account", "account_role_type_recipient"),
|
|
123
|
+
name="unique_account_role_type_recipient_account",
|
|
124
|
+
),
|
|
125
|
+
),
|
|
126
|
+
migrations.AddConstraint(
|
|
127
|
+
model_name="commission",
|
|
128
|
+
constraint=models.CheckConstraint(
|
|
129
|
+
check=models.Q(
|
|
130
|
+
models.Q(
|
|
131
|
+
("account_role_type_recipient__isnull", True),
|
|
132
|
+
("crm_recipient__isnull", False),
|
|
133
|
+
("portfolio_role_recipient__isnull", True),
|
|
134
|
+
),
|
|
135
|
+
models.Q(
|
|
136
|
+
("account_role_type_recipient__isnull", True),
|
|
137
|
+
("crm_recipient__isnull", True),
|
|
138
|
+
("portfolio_role_recipient__isnull", False),
|
|
139
|
+
),
|
|
140
|
+
models.Q(
|
|
141
|
+
("account_role_type_recipient__isnull", False),
|
|
142
|
+
("crm_recipient__isnull", True),
|
|
143
|
+
("portfolio_role_recipient__isnull", True),
|
|
144
|
+
),
|
|
145
|
+
_connector="OR",
|
|
146
|
+
),
|
|
147
|
+
name="Only one recipient type set",
|
|
148
|
+
),
|
|
149
|
+
),
|
|
150
|
+
migrations.CreateModel(
|
|
151
|
+
name="CommissionRole",
|
|
152
|
+
fields=[
|
|
153
|
+
("id", models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
|
|
154
|
+
("computed_str", models.CharField(blank=True, max_length=512, null=True, verbose_name="Name")),
|
|
155
|
+
(
|
|
156
|
+
"commission",
|
|
157
|
+
models.ForeignKey(
|
|
158
|
+
on_delete=django.db.models.deletion.CASCADE,
|
|
159
|
+
related_name="roles",
|
|
160
|
+
to="wbcommission.commission",
|
|
161
|
+
verbose_name="Commission Line",
|
|
162
|
+
),
|
|
163
|
+
),
|
|
164
|
+
(
|
|
165
|
+
"person",
|
|
166
|
+
models.ForeignKey(
|
|
167
|
+
on_delete=django.db.models.deletion.PROTECT,
|
|
168
|
+
related_name="rebates_account_roles",
|
|
169
|
+
to="directory.person",
|
|
170
|
+
verbose_name="Person",
|
|
171
|
+
),
|
|
172
|
+
),
|
|
173
|
+
],
|
|
174
|
+
options={
|
|
175
|
+
"verbose_name": "Commission Role",
|
|
176
|
+
"verbose_name_plural": "Commission Roles",
|
|
177
|
+
},
|
|
178
|
+
),
|
|
179
|
+
migrations.CreateModel(
|
|
180
|
+
name="CommissionRule",
|
|
181
|
+
fields=[
|
|
182
|
+
("id", models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
|
|
183
|
+
("computed_str", models.CharField(blank=True, max_length=512, null=True, verbose_name="Name")),
|
|
184
|
+
("timespan", django.contrib.postgres.fields.ranges.DateRangeField(verbose_name="Timespan")),
|
|
185
|
+
(
|
|
186
|
+
"assets_under_management_range",
|
|
187
|
+
django.contrib.postgres.fields.ranges.DecimalRangeField(verbose_name="AUM Range"),
|
|
188
|
+
),
|
|
189
|
+
("percent", models.FloatField(default=0, verbose_name="Percent")),
|
|
190
|
+
],
|
|
191
|
+
),
|
|
192
|
+
migrations.AddField(
|
|
193
|
+
model_name="commissionrule",
|
|
194
|
+
name="commission",
|
|
195
|
+
field=models.ForeignKey(
|
|
196
|
+
on_delete=django.db.models.deletion.CASCADE,
|
|
197
|
+
related_name="rules",
|
|
198
|
+
to="wbcommission.commission",
|
|
199
|
+
verbose_name="Commission Line",
|
|
200
|
+
),
|
|
201
|
+
),
|
|
202
|
+
migrations.AddConstraint(
|
|
203
|
+
model_name="commissionrule",
|
|
204
|
+
constraint=django.contrib.postgres.constraints.ExclusionConstraint(
|
|
205
|
+
expressions=[("timespan", "&&"), ("assets_under_management_range", "&&"), ("commission", "=")],
|
|
206
|
+
name="exclude_overlapping_rules",
|
|
207
|
+
),
|
|
208
|
+
),
|
|
209
|
+
migrations.CreateModel(
|
|
210
|
+
name="CommissionExclusionRule",
|
|
211
|
+
fields=[
|
|
212
|
+
("id", models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
|
|
213
|
+
("timespan", django.contrib.postgres.fields.ranges.DateRangeField(verbose_name="Timespan")),
|
|
214
|
+
(
|
|
215
|
+
"overriding_percent",
|
|
216
|
+
models.DecimalField(decimal_places=3, max_digits=4, verbose_name="Overriding Percent"),
|
|
217
|
+
),
|
|
218
|
+
(
|
|
219
|
+
"overriding_net_or_gross_commission",
|
|
220
|
+
models.CharField(
|
|
221
|
+
choices=[("NET", "Net"), ("GROSS", "Gross"), ("DEFAULT", "Default")],
|
|
222
|
+
default="DEFAULT",
|
|
223
|
+
max_length=16,
|
|
224
|
+
verbose_name="Overriding Net or Gross Commission Rule",
|
|
225
|
+
),
|
|
226
|
+
),
|
|
227
|
+
(
|
|
228
|
+
"account_role_type",
|
|
229
|
+
models.ForeignKey(
|
|
230
|
+
blank=True,
|
|
231
|
+
null=True,
|
|
232
|
+
on_delete=django.db.models.deletion.PROTECT,
|
|
233
|
+
to="wbcrm.accountroletype",
|
|
234
|
+
verbose_name="Account Role Type Recipient",
|
|
235
|
+
),
|
|
236
|
+
),
|
|
237
|
+
(
|
|
238
|
+
"commission_type",
|
|
239
|
+
models.ForeignKey(
|
|
240
|
+
on_delete=django.db.models.deletion.PROTECT,
|
|
241
|
+
related_name="commission_exclusion_rules",
|
|
242
|
+
to="wbcommission.commissiontype",
|
|
243
|
+
verbose_name="Commission Type",
|
|
244
|
+
),
|
|
245
|
+
),
|
|
246
|
+
(
|
|
247
|
+
"product",
|
|
248
|
+
models.ForeignKey(
|
|
249
|
+
on_delete=django.db.models.deletion.CASCADE, to="wbportfolio.product", verbose_name="Product"
|
|
250
|
+
),
|
|
251
|
+
),
|
|
252
|
+
],
|
|
253
|
+
options={
|
|
254
|
+
"verbose_name": "Commission Exclusion Rule",
|
|
255
|
+
"verbose_name_plural": "Commissions Exclusion Rules",
|
|
256
|
+
},
|
|
257
|
+
),
|
|
258
|
+
migrations.AddConstraint(
|
|
259
|
+
model_name="commissionexclusionrule",
|
|
260
|
+
constraint=django.contrib.postgres.constraints.ExclusionConstraint(
|
|
261
|
+
expressions=[
|
|
262
|
+
("timespan", "&&"),
|
|
263
|
+
("product", "="),
|
|
264
|
+
("commission_type", "="),
|
|
265
|
+
("account_role_type", "="),
|
|
266
|
+
],
|
|
267
|
+
name="exclude_overlapping_exclusion_rules",
|
|
268
|
+
),
|
|
269
|
+
),
|
|
270
|
+
migrations.AddField(
|
|
271
|
+
model_name="commission",
|
|
272
|
+
name="exclusion_rule_account_role_type",
|
|
273
|
+
field=models.ForeignKey(
|
|
274
|
+
blank=True,
|
|
275
|
+
null=True,
|
|
276
|
+
on_delete=django.db.models.deletion.SET_NULL,
|
|
277
|
+
to="wbcrm.accountroletype",
|
|
278
|
+
verbose_name="Account Role to decide with exclusion rule applies",
|
|
279
|
+
),
|
|
280
|
+
),
|
|
281
|
+
migrations.CreateModel(
|
|
282
|
+
name="Rebate",
|
|
283
|
+
fields=[
|
|
284
|
+
("id", models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
|
|
285
|
+
("date", models.DateField(verbose_name="Date")),
|
|
286
|
+
(
|
|
287
|
+
"value",
|
|
288
|
+
models.DecimalField(decimal_places=4, default=Decimal(0.0), max_digits=16, verbose_name="Value"),
|
|
289
|
+
),
|
|
290
|
+
(
|
|
291
|
+
"account",
|
|
292
|
+
models.ForeignKey(
|
|
293
|
+
limit_choices_to=models.Q(("is_terminal_account", True)),
|
|
294
|
+
on_delete=django.db.models.deletion.CASCADE,
|
|
295
|
+
related_name="rebates",
|
|
296
|
+
to="wbcrm.account",
|
|
297
|
+
verbose_name="Account",
|
|
298
|
+
),
|
|
299
|
+
),
|
|
300
|
+
(
|
|
301
|
+
"commission",
|
|
302
|
+
models.ForeignKey(
|
|
303
|
+
on_delete=django.db.models.deletion.PROTECT,
|
|
304
|
+
related_name="rebates",
|
|
305
|
+
to="wbcommission.commission",
|
|
306
|
+
verbose_name="Commission Line",
|
|
307
|
+
),
|
|
308
|
+
),
|
|
309
|
+
(
|
|
310
|
+
"commission_type",
|
|
311
|
+
models.ForeignKey(
|
|
312
|
+
on_delete=django.db.models.deletion.PROTECT,
|
|
313
|
+
related_name="rebates",
|
|
314
|
+
to="wbcommission.commissiontype",
|
|
315
|
+
verbose_name="Commission Type",
|
|
316
|
+
),
|
|
317
|
+
),
|
|
318
|
+
(
|
|
319
|
+
"product",
|
|
320
|
+
models.ForeignKey(
|
|
321
|
+
on_delete=django.db.models.deletion.CASCADE,
|
|
322
|
+
related_name="rebates",
|
|
323
|
+
to="wbportfolio.product",
|
|
324
|
+
verbose_name="Product",
|
|
325
|
+
),
|
|
326
|
+
),
|
|
327
|
+
(
|
|
328
|
+
"recipient",
|
|
329
|
+
models.ForeignKey(
|
|
330
|
+
on_delete=django.db.models.deletion.PROTECT,
|
|
331
|
+
related_name="recipient_rebates",
|
|
332
|
+
to="directory.entry",
|
|
333
|
+
verbose_name="Recipient",
|
|
334
|
+
),
|
|
335
|
+
),
|
|
336
|
+
],
|
|
337
|
+
options={
|
|
338
|
+
"verbose_name": "Rebate",
|
|
339
|
+
"verbose_name_plural": "Rebates",
|
|
340
|
+
"unique_together": {("date", "recipient", "account", "product", "commission_type")},
|
|
341
|
+
"index_together": {("commission_type", "date", "recipient", "product", "account")},
|
|
342
|
+
},
|
|
343
|
+
bases=(wbcommission.models.rebate.BookingEntryCalculatedValueMixin, models.Model),
|
|
344
|
+
),
|
|
345
|
+
migrations.RemoveField(
|
|
346
|
+
model_name="accountcustomer",
|
|
347
|
+
name="account",
|
|
348
|
+
),
|
|
349
|
+
migrations.RemoveField(
|
|
350
|
+
model_name="accountcustomer",
|
|
351
|
+
name="entry",
|
|
352
|
+
),
|
|
353
|
+
migrations.RemoveField(
|
|
354
|
+
model_name="accountcustomercommissionconstraint",
|
|
355
|
+
name="customer",
|
|
356
|
+
),
|
|
357
|
+
migrations.RemoveField(
|
|
358
|
+
model_name="accountcustomercommissionconstraint",
|
|
359
|
+
name="products",
|
|
360
|
+
),
|
|
361
|
+
migrations.DeleteModel(
|
|
362
|
+
name="AccountCustomer",
|
|
363
|
+
),
|
|
364
|
+
migrations.DeleteModel(
|
|
365
|
+
name="AccountCustomerCommissionConstraint",
|
|
366
|
+
),
|
|
367
|
+
migrations.DeleteModel(
|
|
368
|
+
name="OldCommission",
|
|
369
|
+
),
|
|
370
|
+
migrations.DeleteModel(
|
|
371
|
+
name="CommissionAccountRole",
|
|
372
|
+
),
|
|
373
|
+
migrations.AlterField(
|
|
374
|
+
model_name="commission",
|
|
375
|
+
name="is_hidden",
|
|
376
|
+
field=models.BooleanField(
|
|
377
|
+
default=True,
|
|
378
|
+
help_text="If False, this commission rule can be seen by anoyone that can access the related account. Otherwise, only an explicit role will grant access",
|
|
379
|
+
verbose_name="Hidden Commission Rule",
|
|
380
|
+
),
|
|
381
|
+
),
|
|
382
|
+
migrations.AlterField(
|
|
383
|
+
model_name="commissionrule",
|
|
384
|
+
name="percent",
|
|
385
|
+
field=models.DecimalField(decimal_places=3, default=Decimal("0"), max_digits=4, verbose_name="Percent"),
|
|
386
|
+
),
|
|
387
|
+
migrations.AlterModelOptions(
|
|
388
|
+
name="commission",
|
|
389
|
+
options={
|
|
390
|
+
"permissions": (("administrate_commission", "Can administrate Commission"),),
|
|
391
|
+
"verbose_name": "Commission",
|
|
392
|
+
"verbose_name_plural": "Commissions",
|
|
393
|
+
},
|
|
394
|
+
),
|
|
395
|
+
]
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Generated by Django 4.1.10 on 2023-09-06 14:10
|
|
2
|
+
|
|
3
|
+
import django.db.models.deletion
|
|
4
|
+
from django.db import migrations, models
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class Migration(migrations.Migration):
|
|
8
|
+
dependencies = [
|
|
9
|
+
("wbcrm", "0005_account_accountrole_accountroletype_and_more"),
|
|
10
|
+
("wbcommission", "0002_commissionrule_remove_accountcustomer_account_and_more"),
|
|
11
|
+
]
|
|
12
|
+
|
|
13
|
+
operations = [
|
|
14
|
+
migrations.AlterField(
|
|
15
|
+
model_name="commission",
|
|
16
|
+
name="account",
|
|
17
|
+
field=models.ForeignKey(
|
|
18
|
+
on_delete=django.db.models.deletion.CASCADE,
|
|
19
|
+
related_name="account_commissions",
|
|
20
|
+
to="wbcrm.account",
|
|
21
|
+
verbose_name="Account",
|
|
22
|
+
),
|
|
23
|
+
),
|
|
24
|
+
]
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Generated by Django 4.2.7 on 2023-11-14 08:55
|
|
2
|
+
import django.core.serializers.json
|
|
3
|
+
from django.db import migrations, models
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class Migration(migrations.Migration):
|
|
7
|
+
dependencies = [
|
|
8
|
+
("wbcommission", "0003_alter_commission_account"),
|
|
9
|
+
]
|
|
10
|
+
|
|
11
|
+
operations = [
|
|
12
|
+
migrations.AddField(
|
|
13
|
+
model_name="rebate",
|
|
14
|
+
name="audit_log",
|
|
15
|
+
field=models.JSONField(
|
|
16
|
+
default=dict, encoder=django.core.serializers.json.DjangoJSONEncoder, verbose_name="Audit Log"
|
|
17
|
+
),
|
|
18
|
+
),
|
|
19
|
+
]
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Generated by Django 4.2.7 on 2023-11-16 13:54
|
|
2
|
+
|
|
3
|
+
import django.core.serializers.json
|
|
4
|
+
from django.db import migrations, models
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class Migration(migrations.Migration):
|
|
8
|
+
dependencies = [
|
|
9
|
+
("wbcommission", "0004_rebate_audit_log"),
|
|
10
|
+
]
|
|
11
|
+
|
|
12
|
+
operations = [
|
|
13
|
+
migrations.AlterField(
|
|
14
|
+
model_name="rebate",
|
|
15
|
+
name="audit_log",
|
|
16
|
+
field=models.JSONField(
|
|
17
|
+
default=dict, encoder=django.core.serializers.json.DjangoJSONEncoder, verbose_name="Audit Log"
|
|
18
|
+
),
|
|
19
|
+
),
|
|
20
|
+
]
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Generated by Django 5.0.9 on 2024-10-17 07:44
|
|
2
|
+
|
|
3
|
+
from django.db import migrations, models
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class Migration(migrations.Migration):
|
|
7
|
+
dependencies = [
|
|
8
|
+
("wbcommission", "0005_alter_rebate_audit_log"),
|
|
9
|
+
]
|
|
10
|
+
|
|
11
|
+
operations = [
|
|
12
|
+
migrations.AddField(
|
|
13
|
+
model_name="commissionrule",
|
|
14
|
+
name="consider_zero_percent_for_exclusion",
|
|
15
|
+
field=models.BooleanField(
|
|
16
|
+
default=False,
|
|
17
|
+
help_text="If true, the commission rule with percent 0 (initially consider disabled), will be considered for exclusion rule matching",
|
|
18
|
+
verbose_name="Consider 0 percent for exclusion",
|
|
19
|
+
),
|
|
20
|
+
),
|
|
21
|
+
]
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Generated by Django 5.0.9 on 2024-11-06 13:31
|
|
2
|
+
|
|
3
|
+
from django.db import migrations, models
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class Migration(migrations.Migration):
|
|
7
|
+
dependencies = [
|
|
8
|
+
("directory", "0009_remove_entry_external_identfier_and_more"),
|
|
9
|
+
("wbcommission", "0006_commissionrule_consider_zero_percent_for_exclusion"),
|
|
10
|
+
("wbcrm", "0013_account_action_plan_account_relationship_status_and_more"),
|
|
11
|
+
]
|
|
12
|
+
|
|
13
|
+
operations = [
|
|
14
|
+
migrations.RemoveConstraint(
|
|
15
|
+
model_name="commission",
|
|
16
|
+
name="unique_crm_recipient_account",
|
|
17
|
+
),
|
|
18
|
+
migrations.RemoveConstraint(
|
|
19
|
+
model_name="commission",
|
|
20
|
+
name="unique_portfolio_role_recipient_account",
|
|
21
|
+
),
|
|
22
|
+
migrations.RemoveConstraint(
|
|
23
|
+
model_name="commission",
|
|
24
|
+
name="unique_account_role_type_recipient_account",
|
|
25
|
+
),
|
|
26
|
+
migrations.AddConstraint(
|
|
27
|
+
model_name="commission",
|
|
28
|
+
constraint=models.UniqueConstraint(
|
|
29
|
+
condition=models.Q(("crm_recipient__isnull", False)),
|
|
30
|
+
fields=("commission_type", "account", "crm_recipient"),
|
|
31
|
+
name="unique_crm_recipient_account",
|
|
32
|
+
),
|
|
33
|
+
),
|
|
34
|
+
migrations.AddConstraint(
|
|
35
|
+
model_name="commission",
|
|
36
|
+
constraint=models.UniqueConstraint(
|
|
37
|
+
condition=models.Q(("portfolio_role_recipient__isnull", False)),
|
|
38
|
+
fields=("commission_type", "account", "portfolio_role_recipient"),
|
|
39
|
+
name="unique_portfolio_role_recipient_account",
|
|
40
|
+
),
|
|
41
|
+
),
|
|
42
|
+
migrations.AddConstraint(
|
|
43
|
+
model_name="commission",
|
|
44
|
+
constraint=models.UniqueConstraint(
|
|
45
|
+
condition=models.Q(("account_role_type_recipient__isnull", False)),
|
|
46
|
+
fields=("commission_type", "account", "account_role_type_recipient"),
|
|
47
|
+
name="unique_account_role_type_recipient_account",
|
|
48
|
+
),
|
|
49
|
+
),
|
|
50
|
+
]
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Generated by Django 5.0.9 on 2024-11-11 11:59
|
|
2
|
+
|
|
3
|
+
from django.db import migrations, models
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class Migration(migrations.Migration):
|
|
7
|
+
dependencies = [
|
|
8
|
+
("wbcommission", "0007_remove_commission_unique_crm_recipient_account_and_more"),
|
|
9
|
+
]
|
|
10
|
+
|
|
11
|
+
operations = [
|
|
12
|
+
migrations.AlterModelOptions(
|
|
13
|
+
name="commission",
|
|
14
|
+
options={
|
|
15
|
+
"ordering": ("order",),
|
|
16
|
+
"permissions": (("administrate_commission", "Can administrate Commission"),),
|
|
17
|
+
"verbose_name": "Commission",
|
|
18
|
+
"verbose_name_plural": "Commissions",
|
|
19
|
+
},
|
|
20
|
+
),
|
|
21
|
+
migrations.AlterField(
|
|
22
|
+
model_name="commission",
|
|
23
|
+
name="order",
|
|
24
|
+
field=models.PositiveIntegerField(db_index=True, editable=False, verbose_name="order"),
|
|
25
|
+
),
|
|
26
|
+
]
|
|
File without changes
|