working on document view/edit
This commit is contained in:
@@ -24,7 +24,9 @@
|
||||
var resp = await fetch(url,{ credentials: 'include'});
|
||||
if (resp.ok){
|
||||
const companies = await resp.json();
|
||||
company = companies[document.sender.company];
|
||||
for (let c of companies) {
|
||||
if (c.id == document.sender.company) company = c;
|
||||
}
|
||||
document.sender.name = '';
|
||||
if (company.name) document.sender.name += company.name+"\n";
|
||||
if (company.address) document.sender.name += company.address+"\n";
|
||||
|
||||
7
frontend/src/routes/document/StateSelector.svelte
Normal file
7
frontend/src/routes/document/StateSelector.svelte
Normal file
@@ -0,0 +1,7 @@
|
||||
<script>
|
||||
import { t } from '../../translations.svelte.js';
|
||||
</script>
|
||||
|
||||
<select>
|
||||
<option>{t('document.select_type')}</option>
|
||||
</select>
|
||||
@@ -2,7 +2,7 @@
|
||||
import { onMount } from 'svelte';
|
||||
import { t } from '../../translations.svelte.js';
|
||||
import { useTinyRouter } from 'svelte-tiny-router';
|
||||
|
||||
import StateSelector from './StateSelector.svelte';
|
||||
let { id } = $props();
|
||||
let error = null;
|
||||
let doc = $state(null);
|
||||
@@ -20,13 +20,67 @@
|
||||
onMount(loadDoc);
|
||||
</script>
|
||||
|
||||
{#if error}
|
||||
<span class="error">{error}</span>
|
||||
{/if}
|
||||
|
||||
<fieldset>
|
||||
{#if error}
|
||||
<span class="error">{error}</span>
|
||||
{/if}
|
||||
{#if doc}
|
||||
<legend>{t('document.type_'+doc.type)} {doc.number}</legend>
|
||||
|
||||
{/if}
|
||||
</fieldset>
|
||||
{#if doc}
|
||||
<fieldset>
|
||||
<legend>{t('document.customer')}</legend>
|
||||
<div>
|
||||
{#each doc.customer.name.split("\n") as line}
|
||||
{line}<br/>
|
||||
{/each}
|
||||
</div>
|
||||
<div>
|
||||
<span>{t('document.customer_number',doc.customer.id)}</span>
|
||||
</div>
|
||||
<div>
|
||||
<span>{t('document.tax_id',doc.customer.tax_id)}</span>
|
||||
</div>
|
||||
<div>
|
||||
<span>{t('document.email',doc.customer.email)}</span>
|
||||
</div>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend>{t('document.sender')}</legend>
|
||||
<div>
|
||||
{#each doc.sender.name.split("\n") as line}
|
||||
{line}<br/>
|
||||
{/each}
|
||||
</div>
|
||||
<div>
|
||||
<span>{t('document.court',doc.sender.court)}</span>
|
||||
</div>
|
||||
<div>
|
||||
<span>{t('document.tax_id',doc.sender.tax_id)}</span>
|
||||
</div>
|
||||
<div>
|
||||
<span>{t('document.bank_account',doc.sender.bank_account)}</span>
|
||||
</div>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend>{t('document.type_'+doc.type)}</legend>
|
||||
<div>{t('document.number')}: {doc.number}</div>
|
||||
<div>{t('document.state')}: <StateSelector /></div>
|
||||
<div>{t('document.date')}: {doc.date}</div>
|
||||
<div>{t('document.delivery')}: {doc.delivery}</div>
|
||||
<div>{t('document.template')}: {doc.template.name} <span class="error">SElektor hier!</span></div>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend>{t('document.head')}</legend>
|
||||
{doc.head}
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend>{t('document.positions')}</legend>
|
||||
<span class="error">laden!</span>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend>{t('document.footer')}</legend>
|
||||
{doc.footer}
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend>{t('document.actions')}</legend>
|
||||
<span class="error">laden!</span>
|
||||
</fieldset>
|
||||
{/if}
|
||||
|
||||
Reference in New Issue
Block a user