Kleinunternehmer Mode

This commit is contained in:
Andre Beging
2024-11-21 15:28:04 +01:00
parent 1211b789bc
commit c21e1f0978
4 changed files with 103 additions and 18 deletions

View File

@@ -1,5 +1,6 @@
@page "/"
@page "/invoices"
@using Server.Data
@using Server.Model
@rendermode InteractiveServer
@@ -18,7 +19,18 @@
<p class="card-text">
@invoice.Customer?.Name<br />
@invoice.Items.Count Artikel<br />
@($"{invoice.TotalNetto:N2} €") Netto<br />
@if (SettingsData.Instance.Kleinunternehmer)
{
@($"{invoice.TotalNetto:N2} €")<br />
}
else
{
<div>
@($"{invoice.TotalNetto:N2} €") Netto<br />
@($"{invoice.TotalBrutto:N2} €") Brutto<br />
</div>
}
</p>
<a href="@($"edit/{invoice.InvoiceId}")" class="btn btn-sm btn-primary">Bearbeiten</a>
<button class="btn btn-sm btn-info" @onclick="() => GenerateDocumentAsync(invoice)"><i class="fas fa-file-pdf"></i></button>

View File

@@ -1,4 +1,5 @@
@page "/edit/{InvoiceId}"
@using QuestPDF
@using Server.Data
@using Server.Model
@rendermode InteractiveServer
@@ -85,18 +86,21 @@
<InputNumber TValue="double" class="form-control" @bind-Value="@item.Quantity"></InputNumber>
</div>
<div class="col-sm">
<label class="form-label mb-0">Price (Netto)</label>
<label class="form-label mb-0">Price @(SettingsData.Instance.Kleinunternehmer ? string.Empty : "(Netto)")</label>
<InputNumber TValue="double" class="form-control" @bind-Value="@item.PriceNetto"></InputNumber>
</div>
<div class="col-sm">
<label class="form-label mb-0">Tax Type</label>
<InputSelect @bind-Value="@item.TaxType" class="form-select">
@foreach (var taxType in Enum.GetValues(typeof(TaxType)))
{
<option value="@taxType">@taxType</option>
}
</InputSelect>
</div>
@if (!SettingsData.Instance.Kleinunternehmer)
{
<div class="col-sm">
<label class="form-label mb-0">Tax Type</label>
<InputSelect @bind-Value="@item.TaxType" class="form-select">
@foreach (var taxType in Enum.GetValues(typeof(TaxType)))
{
<option value="@taxType">@taxType</option>
}
</InputSelect>
</div>
}
</div>
<div class="mb-1 mt-2">