From 49a1978736c096c491930d0a283d6abbab7a741c Mon Sep 17 00:00:00 2001 From: Eduardo Silva Date: Mon, 25 Aug 2025 18:22:07 +0100 Subject: [PATCH] Working on the debts Also started adding support for lua scripts, still working on that part tho; --- src/TODO.md | 2 ++ src/assets/htmx/expense.html | 8 ++++++++ src/assets/htmx/expenseDebts.html | 24 ++++++++++++++++++++++ src/cmd/debts.go | 16 ++++++++++++++- src/expenses/expenses.go | 34 +++++++++++++++++++++++++++++++ src/expenses/models/expense.go | 1 + src/go.mod | 5 ++--- src/go.sum | 4 ++++ src/lua-scripts/test.lua | 14 +++++++++++++ src/luadec/luadec.go | 16 +++++++++++++++ src/pages/expenses.go | 6 ++++++ src/pages/overview.go | 2 +- 12 files changed, 127 insertions(+), 5 deletions(-) create mode 100644 src/assets/htmx/expenseDebts.html create mode 100644 src/lua-scripts/test.lua create mode 100644 src/luadec/luadec.go diff --git a/src/TODO.md b/src/TODO.md index 3d4c9d6..1f6ee05 100644 --- a/src/TODO.md +++ b/src/TODO.md @@ -14,6 +14,8 @@ used - [X] The button for deleting share rows isn't working at all unlike the payments - [X] Use shopspring/decimal for money handling - [ ] Rename this file +- [ ] Better UX when adding expenses on the payments and share values (default even split) +- [ ] Verification popups for delete actions ### Stack - Go diff --git a/src/assets/htmx/expense.html b/src/assets/htmx/expense.html index 0a6c118..6f3259b 100644 --- a/src/assets/htmx/expense.html +++ b/src/assets/htmx/expense.html @@ -67,6 +67,14 @@ {{ template "expensePayments" . }} + {{ if eq .method "put" }} +
+ DEBTS + {{ template "expenseDebts" . }} +
+ {{ end }} + +