changes
This commit is contained in:
Binary file not shown.
Binary file not shown.
48
app/migrations/0344_payment_schedule_ovd_days_and_more.py
Normal file
48
app/migrations/0344_payment_schedule_ovd_days_and_more.py
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
# Generated by Django 5.1.7 on 2026-01-05 04:52
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('app', '0343_import_setting_call_api_delete_payment'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='payment_schedule',
|
||||||
|
name='ovd_days',
|
||||||
|
field=models.IntegerField(null=True),
|
||||||
|
),
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='payment_schedule',
|
||||||
|
name='penalty_amount',
|
||||||
|
field=models.DecimalField(decimal_places=2, max_digits=15, null=True),
|
||||||
|
),
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='transaction',
|
||||||
|
name='amount_remain',
|
||||||
|
field=models.DecimalField(decimal_places=2, max_digits=15, null=True),
|
||||||
|
),
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='transaction',
|
||||||
|
name='ovd_days',
|
||||||
|
field=models.IntegerField(null=True),
|
||||||
|
),
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='transaction',
|
||||||
|
name='penalty_amount',
|
||||||
|
field=models.DecimalField(decimal_places=2, max_digits=15, null=True),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='company',
|
||||||
|
name='code',
|
||||||
|
field=models.CharField(db_index=True, max_length=20, null=True, unique=True),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='people',
|
||||||
|
name='code',
|
||||||
|
field=models.CharField(db_index=True, max_length=20, null=True, unique=True),
|
||||||
|
),
|
||||||
|
]
|
||||||
@@ -1166,8 +1166,10 @@ class Country(models.Model):
|
|||||||
db_table = 'country'
|
db_table = 'country'
|
||||||
|
|
||||||
|
|
||||||
class Company(models.Model):
|
class Company(AutoCodeModel):
|
||||||
code = models.CharField(max_length=20, null=False, unique=True, db_index=True)
|
code_prefix = "CP"
|
||||||
|
code_padding = 5
|
||||||
|
code = models.CharField(max_length=20, null=True, unique=True, db_index=True)
|
||||||
tax_code = models.CharField(max_length=20, null=True, unique=True)
|
tax_code = models.CharField(max_length=20, null=True, unique=True)
|
||||||
fullname = models.CharField(max_length=300, null=False, db_index=True)
|
fullname = models.CharField(max_length=300, null=False, db_index=True)
|
||||||
shortname = models.CharField(max_length=50, null=True, db_index=True)
|
shortname = models.CharField(max_length=50, null=True, db_index=True)
|
||||||
@@ -1188,8 +1190,10 @@ class Company(models.Model):
|
|||||||
db_table = 'company'
|
db_table = 'company'
|
||||||
|
|
||||||
|
|
||||||
class People(models.Model):
|
class People(AutoCodeModel):
|
||||||
code = models.CharField(max_length=20, null=False, unique=True, db_index=True)
|
code_prefix = "RE"
|
||||||
|
code_padding = 5
|
||||||
|
code = models.CharField(max_length=20, null=True, unique=True, db_index=True)
|
||||||
fullname = models.CharField(max_length=50, null=False)
|
fullname = models.CharField(max_length=50, null=False)
|
||||||
phone = models.CharField(max_length=20, null=False)
|
phone = models.CharField(max_length=20, null=False)
|
||||||
email = models.CharField(max_length=100, null=True)
|
email = models.CharField(max_length=100, null=True)
|
||||||
@@ -1356,6 +1360,9 @@ class Transaction(AutoCodeModel):
|
|||||||
deposit_received = models.DecimalField(max_digits=15, decimal_places=2, null=True)
|
deposit_received = models.DecimalField(max_digits=15, decimal_places=2, null=True)
|
||||||
deposit_remaining = models.DecimalField(max_digits=15, decimal_places=2, null=True)
|
deposit_remaining = models.DecimalField(max_digits=15, decimal_places=2, null=True)
|
||||||
amount_received = models.DecimalField(max_digits=15, decimal_places=2, null=True)
|
amount_received = models.DecimalField(max_digits=15, decimal_places=2, null=True)
|
||||||
|
amount_remain = models.DecimalField(max_digits=15, decimal_places=2, null=True)
|
||||||
|
ovd_days = models.IntegerField(null=True)
|
||||||
|
penalty_amount = models.DecimalField(null=True, max_digits=15, decimal_places=2)
|
||||||
payment_plan = models.JSONField(null=True)
|
payment_plan = models.JSONField(null=True)
|
||||||
create_time = models.DateTimeField(null=True, auto_now_add=True)
|
create_time = models.DateTimeField(null=True, auto_now_add=True)
|
||||||
update_time = models.DateTimeField(null=True, auto_now=True)
|
update_time = models.DateTimeField(null=True, auto_now=True)
|
||||||
@@ -1638,6 +1645,8 @@ class Payment_Schedule(AutoCodeModel):
|
|||||||
updater = models.ForeignKey(User, null=False, related_name='+', on_delete=models.PROTECT)
|
updater = models.ForeignKey(User, null=False, related_name='+', on_delete=models.PROTECT)
|
||||||
entry = models.ForeignKey(Internal_Entry, null=True, related_name='+', on_delete=models.PROTECT)
|
entry = models.ForeignKey(Internal_Entry, null=True, related_name='+', on_delete=models.PROTECT)
|
||||||
detail = models.JSONField(null=True)
|
detail = models.JSONField(null=True)
|
||||||
|
ovd_days = models.IntegerField(null=True)
|
||||||
|
penalty_amount = models.DecimalField(null=True, max_digits=15, decimal_places=2)
|
||||||
create_time = models.DateTimeField(null=True, auto_now_add=True)
|
create_time = models.DateTimeField(null=True, auto_now_add=True)
|
||||||
update_time = models.DateTimeField(null=True, auto_now=True)
|
update_time = models.DateTimeField(null=True, auto_now=True)
|
||||||
|
|
||||||
|
|||||||
17
app/test.py
17
app/test.py
@@ -14,14 +14,9 @@ from django.forms.models import model_to_dict
|
|||||||
# Customer.objects.exclude(creator__username__in=arr).delete()
|
# Customer.objects.exclude(creator__username__in=arr).delete()
|
||||||
# File.objects.exclude(user__username__in=arr).delete()
|
# File.objects.exclude(user__username__in=arr).delete()
|
||||||
# User.objects.exclude(username__in=arr).delete()
|
# User.objects.exclude(username__in=arr).delete()
|
||||||
|
# Dealer_Setting.objects.all().delete()
|
||||||
|
# objs = []
|
||||||
|
# for a in Biz_Setting.objects.all():
|
||||||
Dealer_Setting.objects.all().delete()
|
# data = model_to_dict(a, exclude=['id'])
|
||||||
|
# objs.append(Dealer_Setting(**data))
|
||||||
objs = []
|
# Dealer_Setting.objects.bulk_create(objs)
|
||||||
for a in Biz_Setting.objects.all():
|
|
||||||
data = model_to_dict(a, exclude=['id'])
|
|
||||||
objs.append(Dealer_Setting(**data))
|
|
||||||
|
|
||||||
Dealer_Setting.objects.bulk_create(objs)
|
|
||||||
Reference in New Issue
Block a user