diff --git a/api/__pycache__/settings.cpython-313.pyc b/api/__pycache__/settings.cpython-313.pyc index f11396c7..ca5a46d3 100644 Binary files a/api/__pycache__/settings.cpython-313.pyc and b/api/__pycache__/settings.cpython-313.pyc differ diff --git a/api/settings.py b/api/settings.py index 32b12399..3be27995 100644 --- a/api/settings.py +++ b/api/settings.py @@ -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': { diff --git a/app/__pycache__/models.cpython-313.pyc b/app/__pycache__/models.cpython-313.pyc index 29bc8a12..9791e674 100644 Binary files a/app/__pycache__/models.cpython-313.pyc and b/app/__pycache__/models.cpython-313.pyc differ diff --git a/app/__pycache__/workflow_actions.cpython-313.pyc b/app/__pycache__/workflow_actions.cpython-313.pyc index 1293373f..45d87c91 100644 Binary files a/app/__pycache__/workflow_actions.cpython-313.pyc and b/app/__pycache__/workflow_actions.cpython-313.pyc differ diff --git a/app/__pycache__/workflow_utils.cpython-313.pyc b/app/__pycache__/workflow_utils.cpython-313.pyc index 55df2ea2..3a661f9e 100644 Binary files a/app/__pycache__/workflow_utils.cpython-313.pyc and b/app/__pycache__/workflow_utils.cpython-313.pyc differ diff --git a/app/cleardata.py b/app/cleardata.py index 36277ca5..66adcb0a 100644 --- a/app/cleardata.py +++ b/app/cleardata.py @@ -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() diff --git a/app/migrations/0372_payment_schedule_amount_remain_and_more.py b/app/migrations/0372_payment_schedule_amount_remain_and_more.py new file mode 100644 index 00000000..569bb1d4 --- /dev/null +++ b/app/migrations/0372_payment_schedule_amount_remain_and_more.py @@ -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), + ), + ] diff --git a/app/models.py b/app/models.py index fccd37a9..753f14d6 100644 --- a/app/models.py +++ b/app/models.py @@ -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) diff --git a/app/workflow_utils.py b/app/workflow_utils.py index 430c7618..d08ca2f1 100644 --- a/app/workflow_utils.py +++ b/app/workflow_utils.py @@ -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')