work on document form
This commit is contained in:
@@ -212,8 +212,8 @@ public final class Document implements Mappable {
|
|||||||
map.put(DATE, date);
|
map.put(DATE, date);
|
||||||
map.put(STATE, state.code);
|
map.put(STATE, state.code);
|
||||||
map.put(FIELD_DELIVERY, delivery);
|
map.put(FIELD_DELIVERY, delivery);
|
||||||
map.put(FIELD_HEAD, markdown(head));
|
map.put(FIELD_HEAD, Map.of(SOURCE,head,RENDERED,markdown(head)));
|
||||||
map.put(FIELD_FOOTER, markdown(footer));
|
map.put(FIELD_FOOTER, Map.of(SOURCE,footer,RENDERED,markdown(footer)));
|
||||||
map.put(FIELD_CURRENCY, currency);
|
map.put(FIELD_CURRENCY, currency);
|
||||||
map.put(SENDER, sender.toMap());
|
map.put(SENDER, sender.toMap());
|
||||||
map.put(FIELD_CUSTOMER, customer.toMap());
|
map.put(FIELD_CUSTOMER, customer.toMap());
|
||||||
|
|||||||
@@ -24,6 +24,16 @@
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
div{
|
||||||
|
min-width: 40px;
|
||||||
|
min-height: 20px;
|
||||||
|
}
|
||||||
|
div:hover{
|
||||||
|
border: 1px dotted;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
{#if editable && editing}
|
{#if editable && editing}
|
||||||
<input bind:value={editValue} onkeyup={typed} autofocus />
|
<input bind:value={editValue} onkeyup={typed} autofocus />
|
||||||
{:else}
|
{:else}
|
||||||
|
|||||||
@@ -45,6 +45,13 @@
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
min-height: 100px;
|
min-height: 100px;
|
||||||
}
|
}
|
||||||
|
div{
|
||||||
|
min-width: 40px;
|
||||||
|
min-height: 20px;
|
||||||
|
}
|
||||||
|
div:hover{
|
||||||
|
border: 1px dotted;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
{#if editable && editing}
|
{#if editable && editing}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
import { onMount } from 'svelte';
|
import { onMount } from 'svelte';
|
||||||
import { t } from '../../translations.svelte.js';
|
import { t } from '../../translations.svelte.js';
|
||||||
import { useTinyRouter } from 'svelte-tiny-router';
|
import { useTinyRouter } from 'svelte-tiny-router';
|
||||||
|
import MarkdownEditor from '../../Components/MarkdownEditor.svelte';
|
||||||
import PositionList from './PositionList.svelte';
|
import PositionList from './PositionList.svelte';
|
||||||
import StateSelector from './StateSelector.svelte';
|
import StateSelector from './StateSelector.svelte';
|
||||||
import TemplateSelector from './TemplateSelector.svelte';
|
import TemplateSelector from './TemplateSelector.svelte';
|
||||||
@@ -9,6 +10,9 @@
|
|||||||
let error = null;
|
let error = null;
|
||||||
let doc = $state(null);
|
let doc = $state(null);
|
||||||
|
|
||||||
|
let editable = $derived(doc.state == 1);
|
||||||
|
|
||||||
|
|
||||||
async function loadDoc(){
|
async function loadDoc(){
|
||||||
const url = `${location.protocol}//${location.host.replace('5173','8080')}/api/document/${id}`;
|
const url = `${location.protocol}//${location.host.replace('5173','8080')}/api/document/${id}`;
|
||||||
const resp = await fetch(url,{credentials:'include'});
|
const resp = await fetch(url,{credentials:'include'});
|
||||||
@@ -39,42 +43,59 @@
|
|||||||
{#if doc}
|
{#if doc}
|
||||||
<fieldset class="left">
|
<fieldset class="left">
|
||||||
<legend>{t('document.customer')}</legend>
|
<legend>{t('document.customer')}</legend>
|
||||||
<div>
|
<table>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td colspan="2">
|
||||||
{#each doc.customer.name.split("\n") as line}
|
{#each doc.customer.name.split("\n") as line}
|
||||||
{line}<br/>
|
{line}<br/>
|
||||||
{/each}
|
{/each}
|
||||||
</div>
|
</td>
|
||||||
<div>
|
</tr>
|
||||||
<span>{t('document.customer_number',doc.customer.id)}</span>
|
<tr>
|
||||||
</div>
|
<th>{t('document.customer_id')}:</th>
|
||||||
<div>
|
<td>{doc.customer.id}</td>
|
||||||
<span>{t('document.tax_id',doc.customer.tax_id)}</span>
|
</tr>
|
||||||
</div>
|
<tr>
|
||||||
<div>
|
<th>{t('document.tax_id')}:</th>
|
||||||
<span>{t('document.email',doc.customer.email)}</span>
|
<td>{doc.customer.tax_id}</td>
|
||||||
</div>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>{t('document.email')}:</th>
|
||||||
|
<td>{doc.customer.email}</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<fieldset class="left">
|
<fieldset class="left">
|
||||||
<legend>{t('document.sender')}</legend>
|
<legend>{t('document.sender')}</legend>
|
||||||
<div>
|
<table>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td colspan="2">
|
||||||
{#each doc.sender.name.split("\n") as line}
|
{#each doc.sender.name.split("\n") as line}
|
||||||
{line}<br/>
|
{line}<br/>
|
||||||
{/each}
|
{/each}
|
||||||
</div>
|
</td>
|
||||||
<div>
|
</tr>
|
||||||
<span>{t('document.court',doc.sender.court)}</span>
|
<tr>
|
||||||
</div>
|
<th>{t('document.court')}:</th>
|
||||||
<div>
|
<td>{doc.sender.court}</td>
|
||||||
<span>{t('document.tax_id',doc.sender.tax_id)}</span>
|
</tr>
|
||||||
</div>
|
<tr>
|
||||||
<div>
|
<th>{t('document.tax_id')}:</th>
|
||||||
<span>
|
<td>{doc.sender.tax_id}</td>
|
||||||
{t('document.bank_account')}:
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>{t('document.bank_account')}:</th>
|
||||||
|
<td>
|
||||||
{#each doc.sender.bank_account.split("\n") as line}
|
{#each doc.sender.bank_account.split("\n") as line}
|
||||||
{line}<br/>
|
{line}<br/>
|
||||||
{/each}
|
{/each}
|
||||||
</span>
|
</td>
|
||||||
</div>
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<fieldset class="left">
|
<fieldset class="left">
|
||||||
<legend>{t('document.type_'+doc.type)}</legend>
|
<legend>{t('document.type_'+doc.type)}</legend>
|
||||||
@@ -86,7 +107,7 @@
|
|||||||
</fieldset>
|
</fieldset>
|
||||||
<fieldset class="clear">
|
<fieldset class="clear">
|
||||||
<legend>{t('document.head')}</legend>
|
<legend>{t('document.head')}</legend>
|
||||||
{@html doc.head}
|
<MarkdownEditor bind:value={doc.head} editable={editable} />
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend>{t('document.positions')}</legend>
|
<legend>{t('document.positions')}</legend>
|
||||||
@@ -94,7 +115,7 @@
|
|||||||
</fieldset>
|
</fieldset>
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend>{t('document.footer')}</legend>
|
<legend>{t('document.footer')}</legend>
|
||||||
{@html doc.footer}
|
<MarkdownEditor bind:value={doc.footer} editable={editable} />
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend>{t('document.actions')}</legend>
|
<legend>{t('document.actions')}</legend>
|
||||||
|
|||||||
@@ -5,19 +5,23 @@
|
|||||||
"document": {
|
"document": {
|
||||||
"actions": "Aktionen",
|
"actions": "Aktionen",
|
||||||
"add_new": "{0} anlegen",
|
"add_new": "{0} anlegen",
|
||||||
"bank_account": "Bankverbindung: {0}",
|
"amount": "Menge",
|
||||||
"court": "Amtsgericht: {0}",
|
"bank_account": "Bankverbindung",
|
||||||
|
"code": "Code",
|
||||||
|
"court": "Amtsgericht",
|
||||||
"create_new": "neues Dokument",
|
"create_new": "neues Dokument",
|
||||||
"customer": "Kunde",
|
"customer": "Kunde",
|
||||||
"customer_address": "Adresse",
|
"customer_address": "Adresse",
|
||||||
"customer_id": "Kundennummer",
|
"customer_id": "Kundennummer",
|
||||||
"date": "Datum",
|
"date": "Datum",
|
||||||
"delete": "löschen",
|
"delete": "löschen",
|
||||||
"email": "E-Mail: {0}",
|
"email": "E-Mail",
|
||||||
"gross_sum": "Brutto-Summe",
|
"gross_sum": "Brutto-Summe",
|
||||||
"list": "Dokumente",
|
"list": "Dokumente",
|
||||||
"list_of": "Dokumente von {0}",
|
"list_of": "Dokumente von {0}",
|
||||||
|
"net_price": "Nettopreis",
|
||||||
"number": "Nummer",
|
"number": "Nummer",
|
||||||
|
"pos": "Pos",
|
||||||
"select_company" : "Wählen Sie eine ihrer Firmen:",
|
"select_company" : "Wählen Sie eine ihrer Firmen:",
|
||||||
"select_customer": "Kunde auswählen",
|
"select_customer": "Kunde auswählen",
|
||||||
"sender": "Absender",
|
"sender": "Absender",
|
||||||
@@ -32,12 +36,16 @@
|
|||||||
"state_new":"neu",
|
"state_new":"neu",
|
||||||
"state_payed": "bezahlt",
|
"state_payed": "bezahlt",
|
||||||
"state_sent": "versendet",
|
"state_sent": "versendet",
|
||||||
"tax_id": "Steuernummer: {0}",
|
"tax_id": "Steuernummer",
|
||||||
|
"tax_rate": "Steuersatz",
|
||||||
|
"title_or_desc": "Titel/Beschreibung",
|
||||||
"type": "Dokumententyp",
|
"type": "Dokumententyp",
|
||||||
"type_confirmation": "Bestätigung",
|
"type_confirmation": "Bestätigung",
|
||||||
"type_invoice": "Rechnung",
|
"type_invoice": "Rechnung",
|
||||||
"type_offer": "Angebot",
|
"type_offer": "Angebot",
|
||||||
"type_reminder": "Erinnerung"
|
"type_reminder": "Erinnerung",
|
||||||
|
"unit": "Einheit",
|
||||||
|
"unit_price": "Preis/Einheit"
|
||||||
},
|
},
|
||||||
"footer": {
|
"footer": {
|
||||||
"message" : "Umbrella ist ein Produkt von {0}."
|
"message" : "Umbrella ist ein Produkt von {0}."
|
||||||
|
|||||||
@@ -30,11 +30,12 @@ button{
|
|||||||
border-color: yellow red red yellow;
|
border-color: yellow red red yellow;
|
||||||
}
|
}
|
||||||
footer {
|
footer {
|
||||||
position: absolute;
|
position: sticky;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin: 5px;
|
margin: 5px;
|
||||||
|
background: black;
|
||||||
}
|
}
|
||||||
nav {
|
nav {
|
||||||
position: sticky;
|
position: sticky;
|
||||||
|
|||||||
Reference in New Issue
Block a user