Add attachment support for fuel and recurring expenses with camera capture

Co-authored-by: aiulian25 <17886483+aiulian25@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2025-11-12 21:39:52 +00:00
parent 339cd94b26
commit 8a5b916a39
8 changed files with 487 additions and 9 deletions

View file

@ -99,7 +99,7 @@
</div>
<div class="form-group">
<label for="tax-attachment" data-translate="optional">Document (Optional)</label>
<input type="file" id="tax-attachment" name="attachment" accept=".pdf,.png,.jpg,.jpeg,.txt,.doc,.docx">
<input type="file" id="tax-attachment" name="attachment" accept="image/*,.pdf,.txt,.doc,.docx" capture="environment">
<small data-translate="supported_files">Supported: PDF, Images, Text, Word</small>
</div>
<div style="display: flex; gap: 10px; margin-top: 20px;">
@ -193,6 +193,7 @@
<p><strong>Frequency:</strong> ${e.frequency}</p>
<p><strong>Next Due:</strong> ${formatDate(e.next_due_date)}</p>
<p style="color: var(--text-secondary); font-size: 14px;">${e.notes || ''}</p>
${e.document_path ? `<p><strong>Attachment:</strong> <a href="/api/attachments/download?path=${encodeURIComponent(e.document_path)}" class="btn" style="padding: 5px 10px; font-size: 12px; display: inline-block; margin-top: 5px;">Download</a></p>` : ''}
<button class="btn btn-danger" onclick="cancelRecurringExpense(${e.id})" style="margin-top: 10px;">
Cancel Recurring
</button>
@ -291,7 +292,8 @@
amount: parseFloat(document.getElementById('tax-amount').value),
frequency: document.getElementById('tax-frequency').value,
start_date: document.getElementById('tax-date').value,
notes: document.getElementById('tax-notes').value || null
notes: document.getElementById('tax-notes').value || null,
document_path: attachmentPath
};
try {