diff --git a/frontend/src/Components/LineEditor.svelte b/frontend/src/Components/LineEditor.svelte
new file mode 100644
index 0000000..5fc8562
--- /dev/null
+++ b/frontend/src/Components/LineEditor.svelte
@@ -0,0 +1,19 @@
+
+
+{#if editable && editing}
+
+{:else}
+
{value}
+{/if}
+
diff --git a/frontend/src/Components/MarkdownEditor.svelte b/frontend/src/Components/MarkdownEditor.svelte
new file mode 100644
index 0000000..adf768b
--- /dev/null
+++ b/frontend/src/Components/MarkdownEditor.svelte
@@ -0,0 +1,20 @@
+
+
+
+
+{#if editable && editing}
+
+{/if}
+{@html value}
diff --git a/frontend/src/Components/PriceEditor.svelte b/frontend/src/Components/PriceEditor.svelte
new file mode 100644
index 0000000..589c526
--- /dev/null
+++ b/frontend/src/Components/PriceEditor.svelte
@@ -0,0 +1,29 @@
+
+
+
+
+{#if editable && editing}
+ {currency}
+{:else}
+{Number(value/100).toFixed(2)} {currency}
+{/if}
+
diff --git a/frontend/src/routes/document/Position.svelte b/frontend/src/routes/document/Position.svelte
index cfd9fec..27b790e 100644
--- a/frontend/src/routes/document/Position.svelte
+++ b/frontend/src/routes/document/Position.svelte
@@ -2,25 +2,36 @@
import { useTinyRouter } from 'svelte-tiny-router';
import { onMount } from 'svelte';
import { t } from '../../translations.svelte.js';
-
- var { currency, pos = $bindable(null) } = $props();
+ import LineEditor from '../../Components/LineEditor.svelte';
+ import MarkdownEditor from '../../Components/MarkdownEditor.svelte';
+ import PriceEditor from '../../Components/PriceEditor.svelte';
+ var { currency, editable, pos = $bindable(null) } = $props();
console.log(pos);
{#if pos}
| {pos.number} |
- {pos.item} |
- {pos.title} |
- {pos.amount} |
- {pos.unit} |
- {pos.unit_price/100} {currency} |
- {pos.net_price/100} {currency} |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+
+ |
+ {Number(pos.amount * pos.unit_price/100).toFixed(2)} {currency} |
{pos.tax} % |
⏫ ⏬ |
- {@html pos.description} |
+ |
|
{/if}
\ No newline at end of file
diff --git a/frontend/src/routes/document/PositionList.svelte b/frontend/src/routes/document/PositionList.svelte
index 8196c51..2d728e3 100644
--- a/frontend/src/routes/document/PositionList.svelte
+++ b/frontend/src/routes/document/PositionList.svelte
@@ -5,7 +5,10 @@
import { t } from '../../translations.svelte.js';
var { document = $bindable(null) } = $props();
+
+ let editable = $derived(document.state == 1);
+
{#if document.positions}
@@ -22,7 +25,7 @@
{#each Object.entries(document.positions) as [id,pos]}
-
+
{/each}
|