Add sales types, party adjustments, FunZone party fields, and treasury fee support
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
78
accounting/migrations/0003_sales_module.py
Normal file
78
accounting/migrations/0003_sales_module.py
Normal file
@@ -0,0 +1,78 @@
|
||||
# Generated manually for sales module extensions
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
import uuid
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('accounting', '0002_seed_chart_of_accounts'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='SalesType',
|
||||
fields=[
|
||||
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
|
||||
('code', models.CharField(db_index=True, max_length=50)),
|
||||
('name', models.CharField(max_length=150)),
|
||||
('description', models.TextField(blank=True, default='')),
|
||||
('active', models.BooleanField(default=True)),
|
||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||
],
|
||||
options={
|
||||
'db_table': 'accounting_sales_types',
|
||||
'ordering': ['code'],
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='PartyAdjustment',
|
||||
fields=[
|
||||
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
|
||||
('number', models.PositiveIntegerField(default=0)),
|
||||
('kind', models.CharField(choices=[('debit', 'Debit'), ('credit', 'Credit')], max_length=20)),
|
||||
('date', models.DateField()),
|
||||
('amount', models.FloatField(default=0)),
|
||||
('description', models.TextField(blank=True, default='')),
|
||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||
('party', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='adjustments', to='accounting.party')),
|
||||
],
|
||||
options={
|
||||
'db_table': 'accounting_party_adjustments',
|
||||
'ordering': ['-date', '-number'],
|
||||
},
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='invoice',
|
||||
name='document_type',
|
||||
field=models.CharField(
|
||||
choices=[('proforma', 'Proforma'), ('invoice', 'Invoice'), ('return', 'Return')],
|
||||
default='invoice',
|
||||
max_length=20,
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='invoice',
|
||||
name='related_invoice',
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name='derived_docs',
|
||||
to='accounting.invoice',
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='invoice',
|
||||
name='sales_type',
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name='invoices',
|
||||
to='accounting.salestype',
|
||||
),
|
||||
),
|
||||
]
|
||||
84
accounting/migrations/0004_party_funzone_fields.py
Normal file
84
accounting/migrations/0004_party_funzone_fields.py
Normal file
@@ -0,0 +1,84 @@
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('accounting', '0003_sales_module'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='party',
|
||||
name='external_id',
|
||||
field=models.UUIDField(blank=True, db_index=True, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='party',
|
||||
name='external_source',
|
||||
field=models.CharField(blank=True, default='', max_length=30),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='party',
|
||||
name='first_name',
|
||||
field=models.CharField(blank=True, default='', max_length=100),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='party',
|
||||
name='last_name',
|
||||
field=models.CharField(blank=True, default='', max_length=100),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='party',
|
||||
name='username',
|
||||
field=models.CharField(blank=True, default='', max_length=100),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='party',
|
||||
name='email',
|
||||
field=models.EmailField(blank=True, default='', max_length=254),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='party',
|
||||
name='national_code',
|
||||
field=models.CharField(blank=True, default='', max_length=20),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='party',
|
||||
name='iban',
|
||||
field=models.CharField(blank=True, default='', max_length=34),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='party',
|
||||
name='wallet_balance',
|
||||
field=models.FloatField(default=0),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='party',
|
||||
name='is_active',
|
||||
field=models.BooleanField(default=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='party',
|
||||
name='is_verified',
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='party',
|
||||
name='birthday',
|
||||
field=models.DateField(blank=True, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='party',
|
||||
name='venues',
|
||||
field=models.JSONField(blank=True, default=list),
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='party',
|
||||
constraint=models.UniqueConstraint(
|
||||
condition=models.Q(external_id__isnull=False),
|
||||
fields=('external_id', 'external_source'),
|
||||
name='unique_external_party',
|
||||
),
|
||||
),
|
||||
]
|
||||
16
accounting/migrations/0005_treasury_source.py
Normal file
16
accounting/migrations/0005_treasury_source.py
Normal file
@@ -0,0 +1,16 @@
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('accounting', '0004_party_funzone_fields'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='treasurytxn',
|
||||
name='source',
|
||||
field=models.CharField(blank=True, default='', max_length=120),
|
||||
),
|
||||
]
|
||||
26
accounting/migrations/0006_treasury_fee_fields.py
Normal file
26
accounting/migrations/0006_treasury_fee_fields.py
Normal file
@@ -0,0 +1,26 @@
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('accounting', '0005_treasury_source'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='treasurytxn',
|
||||
name='tax_amount',
|
||||
field=models.FloatField(default=0),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='treasurytxn',
|
||||
name='platform_profit_amount',
|
||||
field=models.FloatField(default=0),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='treasurytxn',
|
||||
name='owner_net_amount',
|
||||
field=models.FloatField(default=0),
|
||||
),
|
||||
]
|
||||
Reference in New Issue
Block a user