|
|
|
|
@ -1,12 +1,177 @@
|
|
|
|
|
@page "/QuoteDebug"
|
|
|
|
|
@using Gremlin_BlazorServer.Services
|
|
|
|
|
@using System.Globalization
|
|
|
|
|
@using Gremlin_BlazorServer.Data.EntityClasses
|
|
|
|
|
@inject NavigationManager NavigationManager
|
|
|
|
|
<AuthorizeView>
|
|
|
|
|
<Authorized>
|
|
|
|
|
@if (debug) {
|
|
|
|
|
<Button Color="Color.Success" Clicked="@OnSave">Save</Button>
|
|
|
|
|
}
|
|
|
|
|
<Div Margin="Margin.Is3"
|
|
|
|
|
Border="Border.Dark.OnAll"
|
|
|
|
|
Padding="Padding.Is3"
|
|
|
|
|
style="box-shadow: 10px 10px #343A40">
|
|
|
|
|
|
|
|
|
|
<Heading Size="HeadingSize.Is5">Quote Debug</Heading>
|
|
|
|
|
<Paragraph>
|
|
|
|
|
@if (debug) {
|
|
|
|
|
<Button Color="Color.Success" Clicked="@OnSave">Save</Button>
|
|
|
|
|
}
|
|
|
|
|
</Paragraph>
|
|
|
|
|
</Div>
|
|
|
|
|
|
|
|
|
|
<Div Margin="Margin.Is3"
|
|
|
|
|
Border="Border.Dark.OnAll"
|
|
|
|
|
Padding="Padding.Is3"
|
|
|
|
|
style="box-shadow: 10px 10px #343A40">
|
|
|
|
|
|
|
|
|
|
<Heading Size="HeadingSize.Is5">Quote Details</Heading>
|
|
|
|
|
<Paragraph>
|
|
|
|
|
<Row>
|
|
|
|
|
<Column ColumnSize="ColumnSize.Is4">
|
|
|
|
|
<Field>
|
|
|
|
|
<FieldLabel ColumnSize="ColumnSize.Is4">Angebotsname</FieldLabel>
|
|
|
|
|
<FieldBody ColumnSize="ColumnSize.Is6">
|
|
|
|
|
<TextEdit Text="@quote.Description" TextChanged="@OnDescriptionChanged"/>
|
|
|
|
|
</FieldBody>
|
|
|
|
|
</Field>
|
|
|
|
|
<Field>
|
|
|
|
|
<FieldLabel ColumnSize="ColumnSize.Is4">Angebotsnummer</FieldLabel>
|
|
|
|
|
<FieldBody ColumnSize="ColumnSize.Is6">
|
|
|
|
|
<TextEdit Text="@quote.QuotationNumber" TextChanged="@OnQuotationNumberChanged"/>
|
|
|
|
|
</FieldBody>
|
|
|
|
|
</Field>
|
|
|
|
|
<Field>
|
|
|
|
|
<FieldLabel ColumnSize="ColumnSize.Is4">Angebotspfad</FieldLabel>
|
|
|
|
|
<FieldBody ColumnSize="ColumnSize.Is6">
|
|
|
|
|
<TextEdit ReadOnly Text="@quote.Path"/>"
|
|
|
|
|
</FieldBody>
|
|
|
|
|
</Field>
|
|
|
|
|
<Field>
|
|
|
|
|
<FieldLabel ColumnSize="ColumnSize.Is4">Gewährleistung (Monate)</FieldLabel>
|
|
|
|
|
<FieldBody ColumnSize="ColumnSize.Is6">
|
|
|
|
|
<TextEdit Text="@quote.Warranty.ToString()" TextChanged="@OnWarrantyChanged"/>
|
|
|
|
|
</FieldBody>
|
|
|
|
|
</Field>
|
|
|
|
|
<Field>
|
|
|
|
|
<FieldLabel ColumnSize="ColumnSize.Is4">Angebotsgültigkeit (Tage)</FieldLabel>
|
|
|
|
|
<FieldBody ColumnSize="ColumnSize.Is6">
|
|
|
|
|
<TextEdit Text="@quote.ValidFor.ToString()" TextChanged="@OnValidForChanged"/>
|
|
|
|
|
</FieldBody>
|
|
|
|
|
</Field>
|
|
|
|
|
<Field>
|
|
|
|
|
<FieldLabel ColumnSize="ColumnSize.Is4">Mehrwertsteuer (%)</FieldLabel>
|
|
|
|
|
<FieldBody ColumnSize="ColumnSize.Is6">
|
|
|
|
|
<TextEdit Text="@quote.Vat.ToString(CultureInfo.CurrentCulture)" TextChanged="@OnVATChanged"/>
|
|
|
|
|
</FieldBody>
|
|
|
|
|
</Field>
|
|
|
|
|
<Field>
|
|
|
|
|
<FieldLabel ColumnSize="ColumnSize.Is4">Versandkosten (%)</FieldLabel>
|
|
|
|
|
<FieldBody ColumnSize="ColumnSize.Is6">
|
|
|
|
|
<TextEdit Text="@quote.Freight.ToString(CultureInfo.CurrentCulture)"/>
|
|
|
|
|
</FieldBody>
|
|
|
|
|
</Field>
|
|
|
|
|
</Column>
|
|
|
|
|
|
|
|
|
|
@if (quote.Recipient is not null) {
|
|
|
|
|
<Column ColumnSize="ColumnSize.Is3">
|
|
|
|
|
<Field>
|
|
|
|
|
<FieldLabel ColumnSize="ColumnSize.Is4">FirstName</FieldLabel>
|
|
|
|
|
<FieldBody ColumnSize="ColumnSize.Is6">@quote.Recipient.FirstName</FieldBody>
|
|
|
|
|
</Field>
|
|
|
|
|
<Field >
|
|
|
|
|
<FieldLabel ColumnSize="ColumnSize.Is4">LastName</FieldLabel>
|
|
|
|
|
<FieldBody ColumnSize="ColumnSize.Is6">@quote.Recipient.LastName</FieldBody>
|
|
|
|
|
</Field>
|
|
|
|
|
<Field >
|
|
|
|
|
<FieldLabel ColumnSize="ColumnSize.Is4">AccountName</FieldLabel>
|
|
|
|
|
<FieldBody ColumnSize="ColumnSize.Is6">@quote.Recipient.Account.AccountName</FieldBody>
|
|
|
|
|
</Field>
|
|
|
|
|
<Field >
|
|
|
|
|
<FieldLabel ColumnSize="ColumnSize.Is4">Street</FieldLabel>
|
|
|
|
|
<FieldBody ColumnSize="ColumnSize.Is6">@quote.Recipient.Account.Street</FieldBody>
|
|
|
|
|
</Field>
|
|
|
|
|
<Field >
|
|
|
|
|
<FieldLabel ColumnSize="ColumnSize.Is4">Zip</FieldLabel>
|
|
|
|
|
<FieldBody ColumnSize="ColumnSize.Is6">@quote.Recipient.Account.Zip.ToString()</FieldBody>
|
|
|
|
|
</Field>
|
|
|
|
|
<Field >
|
|
|
|
|
<FieldLabel ColumnSize="ColumnSize.Is4">City</FieldLabel>
|
|
|
|
|
<FieldBody ColumnSize="ColumnSize.Is6">@quote.Recipient.Account.City</FieldBody>
|
|
|
|
|
</Field>
|
|
|
|
|
</Column>
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
<Column ColumnSize="ColumnSize.Is2">
|
|
|
|
|
<Check TValue="bool" Checked="@quote.IsPriceInformation" CheckedChanged="@OnIsPriceInformationChanged">Preisinformation</Check>
|
|
|
|
|
<Check TValue="bool" Checked="@quote.ShowBrutto" CheckedChanged="@OnShowBruttoChanged">Bruttopreise anzeigen</Check>
|
|
|
|
|
<Check TValue="bool" Checked="@quote.ShowSinglePrices" CheckedChanged="@OnShowSinglePricesChanged">Einzelpreise ausweisen</Check>
|
|
|
|
|
<Check TValue="bool" Checked="@quote.ShowDiscounts" CheckedChanged="@OnShowDiscountsChanged">Discounts ausweisen</Check>
|
|
|
|
|
</Column>
|
|
|
|
|
|
|
|
|
|
<Column ColumnSize="ColumnSize.Is3">
|
|
|
|
|
<Field>
|
|
|
|
|
<FieldLabel ColumnSize="ColumnSize.Is4">Listenpreis netto</FieldLabel>
|
|
|
|
|
<FieldBody ColumnSize="ColumnSize.Is6">
|
|
|
|
|
<TextEdit ReadOnly Text="@quote.TotalListprice.ToString("C", CultureInfo.CurrentCulture)"></TextEdit>
|
|
|
|
|
</FieldBody>
|
|
|
|
|
</Field>
|
|
|
|
|
<Field>
|
|
|
|
|
<FieldLabel ColumnSize="ColumnSize.Is4">Summe netto</FieldLabel>
|
|
|
|
|
<FieldBody ColumnSize="ColumnSize.Is6">
|
|
|
|
|
<TextEdit ReadOnly Text="@quote.TotalNet.ToString("C", CultureInfo.CurrentCulture)"></TextEdit>
|
|
|
|
|
</FieldBody>
|
|
|
|
|
</Field>
|
|
|
|
|
<Field>
|
|
|
|
|
<FieldLabel ColumnSize="ColumnSize.Is4">Versandkosten</FieldLabel>
|
|
|
|
|
<FieldBody ColumnSize="ColumnSize.Is6">
|
|
|
|
|
<TextEdit ReadOnly Text="@quote.TotalFreightOnly.ToString("C", CultureInfo.CurrentCulture)"></TextEdit>
|
|
|
|
|
</FieldBody>
|
|
|
|
|
</Field>
|
|
|
|
|
<Field>
|
|
|
|
|
<FieldLabel ColumnSize="ColumnSize.Is4">Gesamtsumme netto</FieldLabel>
|
|
|
|
|
<FieldBody ColumnSize="ColumnSize.Is6">
|
|
|
|
|
<TextEdit ReadOnly Text="@quote.TotalFreight.ToString("C", CultureInfo.CurrentCulture)"></TextEdit>
|
|
|
|
|
</FieldBody>
|
|
|
|
|
</Field>
|
|
|
|
|
<Field>
|
|
|
|
|
<FieldLabel ColumnSize="ColumnSize.Is4">Mehrwertsteuer</FieldLabel>
|
|
|
|
|
<FieldBody ColumnSize="ColumnSize.Is6">
|
|
|
|
|
<TextEdit ReadOnly Text="@quote.TotalVat.ToString("C", CultureInfo.CurrentCulture)"></TextEdit>
|
|
|
|
|
</FieldBody>
|
|
|
|
|
</Field>
|
|
|
|
|
<Field>
|
|
|
|
|
<FieldLabel ColumnSize="ColumnSize.Is4">Gesamtsumme brutto</FieldLabel>
|
|
|
|
|
<FieldBody ColumnSize="ColumnSize.Is6">
|
|
|
|
|
<TextEdit ReadOnly Text="@quote.TotalGross.ToString("C", CultureInfo.CurrentCulture)"></TextEdit>
|
|
|
|
|
</FieldBody>
|
|
|
|
|
</Field>
|
|
|
|
|
</Column>
|
|
|
|
|
</Row>
|
|
|
|
|
</Paragraph>
|
|
|
|
|
</Div>
|
|
|
|
|
|
|
|
|
|
<Div Margin="Margin.Is3"
|
|
|
|
|
Border="Border.Dark.OnAll"
|
|
|
|
|
Padding="Padding.Is3"
|
|
|
|
|
style="box-shadow: 10px 10px #343A40">
|
|
|
|
|
|
|
|
|
|
<Heading Size="HeadingSize.Is5">LineItems</Heading>
|
|
|
|
|
<Paragraph>
|
|
|
|
|
<DataGrid TItem="LineItem"
|
|
|
|
|
Data="@quote.LineItems"
|
|
|
|
|
SelectedRow="@selectedLineItem"
|
|
|
|
|
SelectedRowChanged="@OnSelectedLineItemChanged"
|
|
|
|
|
Bordered Hoverable Striped ShowPager Responsive>
|
|
|
|
|
<DataGridCommandColumn/>
|
|
|
|
|
<DataGridColumn Field="@nameof(LineItem.Position)" Caption="Position"/>
|
|
|
|
|
<DataGridColumn Field="@nameof(LineItem.Amount)" Caption="Amount"/>
|
|
|
|
|
<DataGridColumn Field="@nameof(LineItem.ProductNumber)" Caption="ProductNumber"/>
|
|
|
|
|
<DataGridColumn Field="@nameof(LineItem.OptionNumber)" Caption="OptionNumber"/>
|
|
|
|
|
<DataGridColumn Field="@nameof(LineItem.SapShortDescription)" Caption="SapShortDescription"/>
|
|
|
|
|
<DataGridColumn Field="@nameof(LineItem.CustomDescriptionId)" Caption="CustomDescriptionId"/>
|
|
|
|
|
<DataGridColumn Field="@nameof(LineItem.ListPrice)" DisplayFormat="{0:C}" DisplayFormatProvider=cultureInfo Caption="ListPrice"/>
|
|
|
|
|
<DataGridColumn Field="@nameof(LineItem.TotalDiscount)" DisplayFormat="{0:n2}%" Caption="TotalDiscount"/>
|
|
|
|
|
<DataGridColumn Field="@nameof(LineItem.Total)" DisplayFormat="{0:C}" DisplayFormatProvider=cultureInfo Caption="Total"/>
|
|
|
|
|
</DataGrid>
|
|
|
|
|
</Paragraph>
|
|
|
|
|
</Div>
|
|
|
|
|
</Authorized>
|
|
|
|
|
|
|
|
|
|
<NotAuthorized>
|
|
|
|
|
@ -19,14 +184,4 @@
|
|
|
|
|
<Paragraph>You're not signed in. Please click on the upper right to either register or log in.</Paragraph>
|
|
|
|
|
</Div>
|
|
|
|
|
</NotAuthorized>
|
|
|
|
|
</AuthorizeView>
|
|
|
|
|
|
|
|
|
|
@code {
|
|
|
|
|
private const bool debug = true;
|
|
|
|
|
private Quote quote = new();
|
|
|
|
|
|
|
|
|
|
private async Task OnSave() {
|
|
|
|
|
if (await GenericController.InsertAsync(quote) > 0)
|
|
|
|
|
NavigationManager.NavigateTo("Quotes/QuoteIndex");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</AuthorizeView>
|