Compare commits

...

2 Commits

Author SHA1 Message Date
a9d43ac866 change fastify port 3080 > 3090 2025-12-24 17:17:43 +01:00
a11026972b translate to swedish 2025-12-23 23:45:27 +01:00
17 changed files with 78 additions and 83 deletions

View File

@ -4,7 +4,7 @@ PROTOCOL=https
HOSTNAME=brf.local HOSTNAME=brf.local
PORT=null PORT=null
FASTIFY_HOST=0.0.0.0 FASTIFY_HOST=0.0.0.0
FASTIFY_PORT=3080 FASTIFY_PORT=3090
LOG_LEVEL=debug LOG_LEVEL=debug
LOG_STREAM=console LOG_STREAM=console
PGHOST=postgres PGHOST=postgres

View File

@ -4,7 +4,7 @@ PROTOCOL=https
HOSTNAME=brf.lkm.nu HOSTNAME=brf.lkm.nu
PORT=null PORT=null
FASTIFY_HOST=localhost FASTIFY_HOST=localhost
FASTIFY_PORT=3080 FASTIFY_PORT=3090
LOG_LEVEL=debug LOG_LEVEL=debug
LOG_STREAM=console LOG_STREAM=console
PGHOST=/run/postgresql PGHOST=/run/postgresql

View File

@ -11,14 +11,14 @@ const AccountsPage: FunctionComponent = () => {
return ( return (
<section> <section>
<Head> <Head>
<title> : Accounts</title> <title> : Konton</title>
</Head> </Head>
<h1>Accounts</h1> <h1>Konton</h1>
<table className='grid'> <table className='grid'>
<thead> <thead>
<th>Number</th> <th>Nummer</th>
<th>Description</th> <th>Beskrivning</th>
</thead> </thead>
<tbody> <tbody>
{accounts.map((account) => ( {accounts.map((account) => (

View File

@ -20,16 +20,16 @@ const BalancesPage: FunctionComponent = () => {
return ( return (
<section> <section>
<Head> <Head>
<title> : Balances</title> <title> : Balanser</title>
</Head> </Head>
<h1>Balances</h1> <h1>Balanser</h1>
{years.length && balances.length && ( {years.length && balances.length && (
<table className={cn('grid', s.table)}> <table className={cn('grid', s.table)}>
<thead> <thead>
<tr> <tr>
<th>Account</th> <th>Konto</th>
<th>Description</th> <th>Beskrivning</th>
{years.map((year) => ( {years.map((year) => (
<th>{year}</th> <th>{year}</th>
))} ))}

View File

@ -43,9 +43,9 @@ const EntriesPage: FunctionComponent = () => {
return financialYears.length && journals.length ? ( return financialYears.length && journals.length ? (
<section> <section>
<Head> <Head>
<title> : Entries</title> <title> : Verifikat</title>
</Head> </Head>
<h1>Entries</h1> <h1>Verifikat</h1>
<form onSubmit={onSubmit}> <form onSubmit={onSubmit}>
<select defaultValue='D' name='journal'> <select defaultValue='D' name='journal'>
@ -60,7 +60,7 @@ const EntriesPage: FunctionComponent = () => {
<option value={financialYear.year}>{financialYear.year}</option> <option value={financialYear.year}>{financialYear.year}</option>
))} ))}
</select> </select>
<button>Search</button> <button>Sök</button>
</form> </form>
<h2> <h2>
@ -70,11 +70,11 @@ const EntriesPage: FunctionComponent = () => {
<thead> <thead>
<tr> <tr>
<th>ID</th> <th>ID</th>
<th>Number</th> <th>Nummer</th>
<th>Entry Date</th> <th>Bokföringsdatum</th>
<th>Transaction Date</th> <th>Transaktionsdatum</th>
<th>Amount</th> <th>Belopp</th>
<th>Description</th> <th>Beskrivning</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>

View File

@ -17,11 +17,11 @@ const EntryPage: FunctionComponent = () => {
<Head> <Head>
<title> <title>
{' '} {' '}
: Entry {entry.journal} {entry.number}{' '} : Verifikat {entry.journal} {entry.number}{' '}
</title> </title>
</Head> </Head>
<h1> <h1>
Entry {entry.journal} {entry.number} Verifikat {entry.journal} {entry.number}
</h1> </h1>
<table className='grid'> <table className='grid'>
@ -29,11 +29,11 @@ const EntryPage: FunctionComponent = () => {
<tr> <tr>
<th>ID</th> <th>ID</th>
<th>Journal</th> <th>Journal</th>
<th>Number</th> <th>Nummer</th>
<th>Entry Date</th> <th>Bokföringsdatum</th>
<th>Transaction Date</th> <th>Transaktionsdatum</th>
<th>Amount</th> <th>Belopp</th>
<th>Description</th> <th>Beskrivning</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -51,14 +51,14 @@ const EntryPage: FunctionComponent = () => {
</tbody> </tbody>
</table> </table>
<h2>Transactions</h2> <h2>Transaktioner</h2>
<table className='grid'> <table className='grid'>
<thead> <thead>
<tr> <tr>
<th>Account</th> <th>Konto</th>
<th>Debit</th> <th>Debit</th>
<th>Credit</th> <th>Kredit</th>
<th>Description</th> <th>Beskrivning</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>

View File

@ -7,10 +7,11 @@ import { formatNumber } from '../utils/format_number.ts'
import Head from './head.ts' import Head from './head.ts'
const InvoicePage: FunctionComponent = () => { const InvoicePage: FunctionComponent = () => {
const route = useRoute()
const invoice = usePromise<Invoice & { files?: File[]; transactions?: Transaction[] }>(() => const invoice = usePromise<Invoice & { files?: File[]; transactions?: Transaction[] }>(() =>
rek(`/api/invoices/${route.params.id}`), rek(`/api/invoices/${route.params.id}`),
) )
const route = useRoute()
return ( return (
<section> <section>
@ -20,12 +21,6 @@ const InvoicePage: FunctionComponent = () => {
<h1>Invoice</h1> <h1>Invoice</h1>
<table> <table>
<thead>
<tr>
<th>what</th>
<th>who</th>
</tr>
</thead>
{invoice && ( {invoice && (
<tbody> <tbody>
<tr> <tr>

View File

@ -28,10 +28,10 @@ const InvoicesPage: FunctionComponent = () => {
return ( return (
<section> <section>
<Head> <Head>
<title> : Invoices : {supplier?.name}</title> <title> : Fakturor : {supplier?.name}</title>
</Head> </Head>
<h1>Invoices for {supplier?.name}</h1> <h1>Fakturor från {supplier?.name}</h1>
<p> <p>
<strong>Total: {formatPrice(totalAmount)}</strong> <strong>Total: {formatPrice(totalAmount)}</strong>
@ -43,11 +43,11 @@ const InvoicesPage: FunctionComponent = () => {
<th>ID</th> <th>ID</th>
<th>Fisken</th> <th>Fisken</th>
<th>PHM</th> <th>PHM</th>
<th>Invoice Date</th> <th>Fakturadatum</th>
<th>Due Date</th> <th>Förfallodag</th>
<th>Number</th> <th>Nummer</th>
<th>Amount</th> <th>Belopp</th>
<th>Files</th> <th>Filer</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>

View File

@ -11,10 +11,10 @@ const InvoicesPage: FunctionComponent = () => {
return ( return (
<section> <section>
<Head> <Head>
<title> : Invoices</title> <title> : Fakturor</title>
</Head> </Head>
<h1>Invoices</h1> <h1>Fakturor</h1>
<ul> <ul>
{suppliers?.map((supplier) => ( {suppliers?.map((supplier) => (
<li> <li>

View File

@ -20,10 +20,10 @@ const ObjectComponent: FunctionComponent<ObjectComponentProps> = ({ objectId })
<table className='grid'> <table className='grid'>
<thead> <thead>
<tr> <tr>
<th>Entry</th> <th>Verifikat</th>
<th>Date</th> <th>Datum</th>
<th>Account</th> <th>Konto</th>
<th>Amount</th> <th>Belopp</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>

View File

@ -15,10 +15,10 @@ const ObjectsPage: FunctionComponent = () => {
return ( return (
<section> <section>
<Head> <Head>
<title> : Objects</title> <title> : Objekt</title>
</Head> </Head>
<h1>Objects</h1> <h1>Objekt</h1>
<div className={s.objects}> <div className={s.objects}>
{objects.map((object) => ( {objects.map((object) => (
<button onClick={() => setCurrentObject(object)}> <button onClick={() => setCurrentObject(object)}>

View File

@ -19,16 +19,16 @@ const ResultsPage: FunctionComponent = () => {
return ( return (
<section> <section>
<Head> <Head>
<title> : Results</title> <title> : Resultat</title>
</Head> </Head>
<h1>Results</h1> <h1>Resultat</h1>
{years.length && results.length && ( {years.length && results.length && (
<table className={cn('grid', s.table)}> <table className={cn('grid', s.table)}>
<thead> <thead>
<tr> <tr>
<th>Account</th> <th>Konto</th>
<th>Description</th> <th>Beskrivning</th>
{years.map((year) => ( {years.map((year) => (
<th>{year}</th> <th>{year}</th>
))} ))}

View File

@ -2,9 +2,9 @@ import { h, type FunctionComponent } from 'preact'
const StartPage: FunctionComponent = () => ( const StartPage: FunctionComponent = () => (
<section> <section>
<h1>Fart Page</h1> <h1>Start</h1>
<p>Haha oh my, fart page.</p> <p>Kommer vettigare info här snart.</p>
</section> </section>
) )

View File

@ -41,7 +41,7 @@ const TransactionsPage: FunctionComponent = () => {
return ( return (
<section> <section>
<Head> <Head>
<title> : Transactions</title> <title> : Transaktioner</title>
</Head> </Head>
<form onSubmit={onSubmit}> <form onSubmit={onSubmit}>
@ -51,21 +51,21 @@ const TransactionsPage: FunctionComponent = () => {
))} ))}
</select> </select>
<input type='text' name='accountNumber' defaultValue={location.query.accountNumber || ''} /> <input type='text' name='accountNumber' defaultValue={location.query.accountNumber || ''} />
<button>Search</button> <button>Sök</button>
</form> </form>
<h1>Transactions</h1> <h1>Transaktioner</h1>
<div> <div>
<table className='grid'> <table className='grid'>
<thead> <thead>
<th>Date</th> <th>Datum</th>
<th>Account</th> <th>Konto</th>
<th>Debit</th> <th>Debit</th>
<th>Credit</th> <th>Kredit</th>
<th>Description</th> <th>Beskrivning</th>
<th>Entry</th> <th>Verifikat</th>
<th>Entry Description</th> <th>Verifikat beskrivning</th>
<th>Invoice</th> <th>Faktura</th>
</thead> </thead>
<tbody> <tbody>
{transactions.map((transaction) => ( {transactions.map((transaction) => (

View File

@ -20,64 +20,64 @@ export default [
{ {
path: '/accounts', path: '/accounts',
name: 'accounts', name: 'accounts',
title: 'Accounts', title: 'Konton',
component: Accounts, component: Accounts,
}, },
{ {
path: '/entries', path: '/entries',
name: 'entries', name: 'entries',
title: 'Entries', title: 'Verifikat',
component: Entries, component: Entries,
}, },
{ {
path: '/entries/:id', path: '/entries/:id',
name: 'entry', name: 'entries-id',
title: 'Entry', title: 'Verifikat :id',
component: Entry, component: Entry,
nav: false, nav: false,
}, },
{ {
path: '/objects', path: '/objects',
name: 'objects', name: 'objects',
title: 'Objects', title: 'Objekt',
component: Objects, component: Objects,
}, },
{ {
path: '/invoices', path: 'invoices',
name: 'invoices', name: 'invoices',
title: 'Invoices', title: 'Fakturor',
component: Invoices, component: Invoices,
}, },
{ {
path: '/invoices/:id', path: '/invoices/:id',
name: 'invoice', name: 'invoices-id',
title: 'Invoice', title: 'Faktura :id',
component: Invoice, component: Invoice,
nav: false, nav: false,
}, },
{ {
path: '/invoices/by-supplier/:supplier', path: '/invoices/by-supplier/:supplier',
name: 'invoices', name: 'invoices-by-supplier',
title: 'Invoices', title: 'Fakturor från leverantör',
component: InvoicesBySupplier, component: InvoicesBySupplier,
nav: false, nav: false,
}, },
{ {
path: '/balances', path: '/balances',
name: 'balances', name: 'balances',
title: 'Balances', title: 'Balanser',
component: Balances, component: Balances,
}, },
{ {
path: '/results', path: '/results',
name: 'results', name: 'results',
title: 'Results', title: 'Resultat',
component: Results, component: Results,
}, },
{ {
path: '/transactions', path: '/transactions',
name: 'transactions', name: 'transactions',
title: 'Transactions', title: 'Transaktioner',
component: Transactions, component: Transactions,
}, },
] ]

View File

@ -8,7 +8,7 @@ brf.local {
} }
reverse_proxy @ws node:24678 reverse_proxy @ws node:24678
reverse_proxy node:3080 { reverse_proxy node:3090 {
lb_try_duration 30s lb_try_duration 30s
lb_try_interval 1s lb_try_interval 1s
} }

View File

@ -98,7 +98,7 @@ const invoiceRoutes: FastifyPluginCallbackZod = (fastify, _, done) => {
), ),
]) ])
.where('i.id', '=', request.params.id) .where('i.id', '=', request.params.id)
.execute() .executeTakeFirst()
}, },
}) })