fix: correct engine column names, dashboard revenue calc, email config, and UX issues

- Fix buildLineInserts() using wrong DB column names (cost_center_id → cost_center,
  project_id → project) and add missing tax_code field
- Replace transaction-based dashboard income/expense with journal-entry-based
  calculation using account classes (3xxx revenue, 4-7xxx expenses)
- Add email/phone fields to CompanySettings type, validate RESEND_FROM_EMAIL
  in isResendConfigured(), remove unsafe type casts in invoice send/reminders
- Always auto-fill line description from account name in JournalEntryForm
- Reorder expense lines in TransactionBookingDialog so 1930 is always first row

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Jakob Wennberg
2026-02-24 10:02:54 +01:00
co-authored by Claude Opus 4.6
parent bbb82866ee
commit 4d2140bcf8
9 changed files with 56 additions and 30 deletions
+1 -1
View File
@@ -110,7 +110,7 @@ export default function JournalEntryForm({
}
// Auto-fill line description from account name when selecting an account
if (field === 'account_number' && value && !updated[index].line_description) {
if (field === 'account_number' && value) {
const account = accounts.find((a) => a.account_number === value)
if (account) {
updated[index].line_description = account.account_name
@@ -27,8 +27,8 @@ function buildInitialLines(transaction: TransactionWithInvoice): FormLine[] {
if (isExpense) {
return [
{ account_number: '', debit_amount: amountStr, credit_amount: '', line_description: '' },
{ account_number: '1930', debit_amount: '', credit_amount: amountStr, line_description: 'Företagskonto' },
{ account_number: '', debit_amount: amountStr, credit_amount: '', line_description: '' },
]
}