diff --git a/internal/handlers/expenses.go b/internal/handlers/expenses.go index e0c9746..d4d5d6c 100644 --- a/internal/handlers/expenses.go +++ b/internal/handlers/expenses.go @@ -136,8 +136,11 @@ func (h *ExpenseHandler) UploadReceipt(w http.ResponseWriter, r *http.Request) { exchangeRate = 1.0 } - // 9. Call the Gemini Vision API for AI extraction. - receipt, aiErr := ai.ExtractReceipt(storagePath) + // 9. Call the Gemini Vision API for AI extraction (uses full disk path). + receipt, aiErr := ai.ExtractReceipt(filepath.Join("storage", filename)) + + // Strip the storage/ prefix so the template can build a proper URL: /storage/{file} + storagePath = filename // 10. Render the receipt_form.html fragment. tmpl := getTemplate("receipt_form.html") diff --git a/templates/event_expenses.html b/templates/event_expenses.html index f35f03d..6f616b5 100644 --- a/templates/event_expenses.html +++ b/templates/event_expenses.html @@ -43,12 +43,25 @@
{{printf "%.2f" .ConvertedAmount}} {{.BaseCurrency}}
{{end}} - +
+ {{if .ImagePath}} + + {{end}} + +
+ {{if .ImagePath}} + + {{end}} {{end}} {{else}} diff --git a/templates/expense_list.html b/templates/expense_list.html index 5df4dbd..6716d27 100644 --- a/templates/expense_list.html +++ b/templates/expense_list.html @@ -28,8 +28,15 @@ {{end}} -
- + {{end}} +
+ {{if .ImagePath}} + + {{end}} {{end}}