This commit is contained in:
anhduy-tech
2026-01-28 14:04:13 +07:00
parent 9a01afd1c6
commit f55a0bbfac
9 changed files with 37 additions and 3 deletions

View File

@@ -21,7 +21,7 @@ BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = 'django-insecure-_u202k$8qq2p*cr_eo(7k!0ngr5^n)27@85+5oy8&41(u6&j54'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = False
DEBUG = True
ALLOWED_HOSTS = ['*']
@@ -81,8 +81,8 @@ ASGI_APPLICATION = 'api.asgi.application'
# https://docs.djangoproject.com/en/4.1/ref/settings/#databases
#prod:5.223.52.193 dev:5.223.42.146
MODE = 'prod'
DBHOST = '172.17.0.1' if MODE == 'prod' else '5.223.52.193'
MODE = 'dev'
DBHOST = '172.17.0.1' if MODE == 'prod' else '5.223.42.146'
DATABASES = {
'default': {

View File

@@ -29,6 +29,7 @@ def data_deletion(request):
Contract.objects.all().delete()
Product_Booked.objects.all().delete()
Transaction_File.objects.all().delete()
Transaction_Gift.objects.all().delete()
Co_Ownership.objects.all().delete()
Transaction_Current.objects.all().delete()
Transaction_Discount.objects.all().delete()

View File

@@ -0,0 +1,23 @@
# Generated by Django 5.1.7 on 2026-01-27 09:05
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app', '0371_alter_dealer_commission_amount_and_more'),
]
operations = [
migrations.AddField(
model_name='payment_schedule',
name='amount_remain',
field=models.DecimalField(decimal_places=2, max_digits=35, null=True),
),
migrations.AddField(
model_name='payment_schedule',
name='penalty_remain',
field=models.DecimalField(decimal_places=2, max_digits=35, null=True),
),
]

View File

@@ -1698,6 +1698,7 @@ class Payment_Schedule(AutoCodeModel):
to_date = models.DateField(null=False)
amount = models.DecimalField(max_digits=35, decimal_places=2)
paid_amount = models.DecimalField(null=True, max_digits=35, decimal_places=2)
amount_remain = models.DecimalField(null=True, max_digits=35, decimal_places=2)
remain_amount = models.DecimalField(null=True, max_digits=35, decimal_places=2)
cycle = models.IntegerField(null=False)
cycle_days = models.IntegerField(null=False)
@@ -1711,6 +1712,7 @@ class Payment_Schedule(AutoCodeModel):
ovd_days = models.IntegerField(null=True)
penalty_amount = models.DecimalField(null=True, max_digits=35, decimal_places=2)
penalty_paid = models.DecimalField(null=True, max_digits=35, decimal_places=2)
penalty_remain = models.DecimalField(null=True, max_digits=35, decimal_places=2)
penalty_reduce = models.DecimalField(null=True, max_digits=35, decimal_places=2)
create_time = models.DateTimeField(null=True, auto_now_add=True)
update_time = models.DateTimeField(null=True, auto_now=True)

View File

@@ -48,6 +48,14 @@ def resolve_value(expr, context):
return now_in_context.date()
return date.today()
if expr == "$today_str":
now_val = context.get("now", datetime.now())
if isinstance(now_val, datetime):
return now_val.date().isoformat()
elif isinstance(now_val, date):
return now_val.isoformat()
return date.today().isoformat()
if expr == "$now_iso":
return datetime.now().isoformat(timespec='seconds')