diff --git a/api/__pycache__/settings.cpython-313.pyc b/api/__pycache__/settings.cpython-313.pyc index 5093dd99..6c4febb9 100644 Binary files a/api/__pycache__/settings.cpython-313.pyc and b/api/__pycache__/settings.cpython-313.pyc differ diff --git a/app/__pycache__/payment.cpython-313.pyc b/app/__pycache__/payment.cpython-313.pyc index 563ece8a..e3cf370c 100644 Binary files a/app/__pycache__/payment.cpython-313.pyc and b/app/__pycache__/payment.cpython-313.pyc differ diff --git a/app/__pycache__/workflow_actions.cpython-313.pyc b/app/__pycache__/workflow_actions.cpython-313.pyc index c88ebb8c..58cc66a9 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 1166deac..14eea1e2 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/payment.py b/app/payment.py index 5699991a..a8728d6c 100644 --- a/app/payment.py +++ b/app/payment.py @@ -27,6 +27,7 @@ def account_entry_api(code, amount, content, type, category, userid, ref=None, p entry_type = Entry_Type.objects.get(code=type) entry_category = Entry_Category.objects.get(id=category) system_date = date if date else datetime.now().strftime("%Y-%m-%d") + amount = float(amount) with transaction.atomic(): account = Internal_Account.objects.select_for_update().get(code=code) diff --git a/app/workflow_actions.py b/app/workflow_actions.py index ff6476ad..58b87a86 100644 --- a/app/workflow_actions.py +++ b/app/workflow_actions.py @@ -123,6 +123,7 @@ def api_call_action(params, context): body = resolve_value(raw_body, context) print(f" [API_CALL] {method} {url}") + print(f" [API_CALL] Resolved Body: {body}") # Thực hiện request if method == "POST": diff --git a/app/workflow_utils.py b/app/workflow_utils.py index ad4a2ff8..fa66c7ed 100644 --- a/app/workflow_utils.py +++ b/app/workflow_utils.py @@ -45,8 +45,8 @@ def resolve_value(expr, context): arg2_val = resolve_value(func_match.group(3).strip(), context) try: - num1 = float(arg1_val) if arg1_val is not None else 0 - num2 = float(arg2_val) if arg2_val is not None else 0 + num1 = float(arg1_val or 0) + num2 = float(arg2_val or 0) if func_name == "add": return num1 + num2 if func_name == "sub":