|
|
|
|
@ -2,282 +2,417 @@
|
|
|
|
|
@using Gremlin_BlazorServer.Services
|
|
|
|
|
@using Gremlin_BlazorServer.Data.EntityClasses
|
|
|
|
|
@using System.Globalization
|
|
|
|
|
@using System.Security.Claims;
|
|
|
|
|
|
|
|
|
|
@inject GenericController GenericController
|
|
|
|
|
@inject NavigationManager NavigationManager
|
|
|
|
|
@inject HostingService HostingService
|
|
|
|
|
@inject GenericController genericController
|
|
|
|
|
@inject NavigationManager navigationManager
|
|
|
|
|
@inject HostingService hostingService
|
|
|
|
|
@inject IJSRuntime jSRuntime
|
|
|
|
|
|
|
|
|
|
<h1>Create New Quote</h1>
|
|
|
|
|
|
|
|
|
|
<h2>Recipient</h2>
|
|
|
|
|
<DataGrid TItem="Contact" Data="@contacts" SelectedRow="@selectedContact" SelectedRowChanged="@OnSelectedContactChanged" Bordered Hoverable Filterable Striped ShowPager Responsive Sortable>
|
|
|
|
|
<DataGridCommandColumn/>
|
|
|
|
|
<DataGridColumn Field="@nameof(Contact.ContactId)" Caption="ContactId" Sortable Filterable/>
|
|
|
|
|
<DataGridColumn Field="@nameof(Contact.AccountId)" Caption="AccountId" Sortable Filterable/>
|
|
|
|
|
<DataGridColumn Field="@nameof(Contact.FirstName)" Caption="FirstName" Sortable Filterable/>
|
|
|
|
|
<DataGridColumn Field="@nameof(Contact.LastName)" Caption="LastName" Sortable Filterable/>
|
|
|
|
|
<DataGridColumn Field="@nameof(Contact.Gender)" Caption="Gender" Sortable Filterable/>
|
|
|
|
|
<DataGridColumn Field="@nameof(Contact.EMail)" Caption="EMail" Sortable Filterable/>
|
|
|
|
|
<DataGridColumn Field="@nameof(Contact.PhoneNumber)" Caption="PhoneNumber" Sortable Filterable/>
|
|
|
|
|
<DataGridColumn Field="@nameof(Contact.SapContactNumber)" Caption="SAPContactNumber" Sortable Filterable/>
|
|
|
|
|
</DataGrid>
|
|
|
|
|
|
|
|
|
|
<h2>Quote Details</h2>
|
|
|
|
|
<Row>
|
|
|
|
|
<Column ColumnSize="ColumnSize.Is7">
|
|
|
|
|
<Fields>
|
|
|
|
|
<Field Horizontal>
|
|
|
|
|
<FieldLabel ColumnSize="ColumnSize.Is4">Angebotsname:</FieldLabel>
|
|
|
|
|
<FieldBody ColumnSize="ColumnSize.Is6">
|
|
|
|
|
<TextEdit Text="@quote.Description" TextChanged="@OnDescriptionChanged"/>
|
|
|
|
|
</FieldBody>
|
|
|
|
|
</Field>
|
|
|
|
|
<Field Horizontal>
|
|
|
|
|
<FieldLabel ColumnSize="ColumnSize.Is4">Angebotsnummer:</FieldLabel>
|
|
|
|
|
<FieldBody ColumnSize="ColumnSize.Is6">
|
|
|
|
|
<TextEdit Text="@quote.QuotationNumber" TextChanged="@OnQuotationNumberChanged"/>
|
|
|
|
|
</FieldBody>
|
|
|
|
|
</Field>
|
|
|
|
|
<Field Horizontal>
|
|
|
|
|
<FieldLabel ColumnSize="ColumnSize.Is4">Angebotspfad:</FieldLabel><FieldBody ColumnSize="ColumnSize.Is6">@quote.Path</FieldBody>
|
|
|
|
|
</Field>
|
|
|
|
|
<Field Horizontal>
|
|
|
|
|
<FieldLabel ColumnSize="ColumnSize.Is4">Gewährleistung (Monate):</FieldLabel><FieldBody ColumnSize="ColumnSize.Is6">@quote.Warranty</FieldBody>
|
|
|
|
|
</Field>
|
|
|
|
|
<Field Horizontal>
|
|
|
|
|
<FieldLabel ColumnSize="ColumnSize.Is4">Angebotsgültigkeit (Tage):</FieldLabel>
|
|
|
|
|
<FieldBody ColumnSize="ColumnSize.Is6">
|
|
|
|
|
<TextEdit Text="@quote.ValidFor.ToString()" TextChanged="@OnValidForChanged"/>
|
|
|
|
|
</FieldBody>
|
|
|
|
|
</Field>
|
|
|
|
|
<Field Horizontal>
|
|
|
|
|
<FieldLabel ColumnSize="ColumnSize.Is4">Mehrwertsteuer (%):</FieldLabel>
|
|
|
|
|
<FieldBody ColumnSize="ColumnSize.Is6">
|
|
|
|
|
<TextEdit Text="@quote.Vat.ToString(CultureInfo.CurrentCulture)" TextChanged="@OnVATChanged"/>
|
|
|
|
|
</FieldBody>
|
|
|
|
|
</Field>
|
|
|
|
|
<Field Horizontal>
|
|
|
|
|
<FieldLabel ColumnSize="ColumnSize.Is4">Versandkosten (%):</FieldLabel>
|
|
|
|
|
<FieldBody ColumnSize="ColumnSize.Is6">
|
|
|
|
|
<TextEdit Text="@quote.Freight.ToString(CultureInfo.CurrentCulture)"/>
|
|
|
|
|
</FieldBody>
|
|
|
|
|
</Field>
|
|
|
|
|
</Fields>
|
|
|
|
|
</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 Horizontal>
|
|
|
|
|
<FieldLabel ColumnSize="ColumnSize.Is4">Listenpreis netto:</FieldLabel>
|
|
|
|
|
<FieldBody ColumnSize="ColumnSize.Is6">
|
|
|
|
|
<TextEdit ReadOnly Text="@quote.TotalListprice.ToString("C", CultureInfo.CurrentCulture)"></TextEdit>
|
|
|
|
|
</FieldBody>
|
|
|
|
|
</Field>
|
|
|
|
|
<Field Horizontal>
|
|
|
|
|
<FieldLabel ColumnSize="ColumnSize.Is4">Summe netto:</FieldLabel>
|
|
|
|
|
<FieldBody ColumnSize="ColumnSize.Is6">
|
|
|
|
|
<TextEdit ReadOnly Text="@quote.TotalNet.ToString("C", CultureInfo.CurrentCulture)"></TextEdit>
|
|
|
|
|
</FieldBody>
|
|
|
|
|
</Field>
|
|
|
|
|
<Field Horizontal>
|
|
|
|
|
<FieldLabel ColumnSize="ColumnSize.Is4">Versandkosten:</FieldLabel>
|
|
|
|
|
<FieldBody ColumnSize="ColumnSize.Is6">
|
|
|
|
|
<TextEdit ReadOnly Text="@quote.TotalFreightOnly.ToString("C", CultureInfo.CurrentCulture)"></TextEdit>
|
|
|
|
|
</FieldBody>
|
|
|
|
|
</Field>
|
|
|
|
|
<Field Horizontal>
|
|
|
|
|
<FieldLabel ColumnSize="ColumnSize.Is4">Gesamtsumme netto:</FieldLabel>
|
|
|
|
|
<FieldBody ColumnSize="ColumnSize.Is6">
|
|
|
|
|
<TextEdit ReadOnly Text="@quote.TotalFreight.ToString("C", CultureInfo.CurrentCulture)"></TextEdit>
|
|
|
|
|
</FieldBody>
|
|
|
|
|
</Field>
|
|
|
|
|
<Field Horizontal>
|
|
|
|
|
<FieldLabel ColumnSize="ColumnSize.Is4">Mehrwertsteuer:</FieldLabel>
|
|
|
|
|
<FieldBody ColumnSize="ColumnSize.Is6">
|
|
|
|
|
<TextEdit ReadOnly Text="@quote.TotalVat.ToString("C", CultureInfo.CurrentCulture)"></TextEdit>
|
|
|
|
|
</FieldBody>
|
|
|
|
|
</Field>
|
|
|
|
|
<Field Horizontal>
|
|
|
|
|
<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>
|
|
|
|
|
|
|
|
|
|
@if (quote.LineItems != null) {
|
|
|
|
|
<h2>LineItems</h2>
|
|
|
|
|
<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.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>
|
|
|
|
|
|
|
|
|
|
@if (selectedLineItem != null && customDescriptionOfSelectedLineItem != null) {
|
|
|
|
|
<h2>CustomDescription</h2>
|
|
|
|
|
<Column ColumnSize="ColumnSize.Is12">
|
|
|
|
|
<Fields>
|
|
|
|
|
<Field Horizontal>
|
|
|
|
|
<FieldLabel ColumnSize="ColumnSize.Is4">ProductNumber</FieldLabel>
|
|
|
|
|
<FieldBody ColumnSize="ColumnSize.Is6">
|
|
|
|
|
<TextEdit ReadOnly Text="@customDescriptionOfSelectedLineItem.ProductNumber"/>
|
|
|
|
|
</FieldBody>
|
|
|
|
|
</Field>
|
|
|
|
|
<Field Horizontal>
|
|
|
|
|
<FieldLabel ColumnSize="ColumnSize.Is4">OptionNumber</FieldLabel>
|
|
|
|
|
<FieldBody ColumnSize="ColumnSize.Is6">
|
|
|
|
|
<TextEdit ReadOnly Text="@customDescriptionOfSelectedLineItem.OptionNumber"/>
|
|
|
|
|
</FieldBody>
|
|
|
|
|
</Field>
|
|
|
|
|
<Field Horizontal>
|
|
|
|
|
<FieldLabel ColumnSize="ColumnSize.Is4">Heading</FieldLabel>
|
|
|
|
|
<FieldBody ColumnSize="ColumnSize.Is6">
|
|
|
|
|
<TextEdit ReadOnly Text="@customDescriptionOfSelectedLineItem.Heading"/>
|
|
|
|
|
</FieldBody>
|
|
|
|
|
</Field>
|
|
|
|
|
<Field Horizontal>
|
|
|
|
|
<FieldLabel ColumnSize="ColumnSize.Is4">DescriptionText</FieldLabel>
|
|
|
|
|
<FieldBody ColumnSize="ColumnSize.Is6">
|
|
|
|
|
<TextEdit ReadOnly Text="@customDescriptionOfSelectedLineItem.DescriptionText"/>
|
|
|
|
|
</FieldBody>
|
|
|
|
|
</Field>
|
|
|
|
|
</Fields>
|
|
|
|
|
</Column>
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@if (quote.LineItems == null) {
|
|
|
|
|
<h2>Uploading Quote</h2>
|
|
|
|
|
<Field>
|
|
|
|
|
<FieldLabel>Please select PriceSurfer quote as TSV</FieldLabel><FileEdit Filter=".tsv" Changed="@SelectQuoteOnChanged" Written="@SelectQuoteOnWritten" Progressed="@SelectQuoteOnProgressed"/>
|
|
|
|
|
</Field>
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
<h2>Create Quote</h2>
|
|
|
|
|
<Button Color="Color.Primary" Disabled="@lineItemsNotReady" Clicked="@OnCreateTex" Loading="@isCreatingTex">Create Tex from Quote</Button>
|
|
|
|
|
<Button Color="Color.Secondary" Disabled="@texNotReady" Clicked="@OnCreatePdf" Loading="@isCreatingPdf">Create Pdf from Tex</Button>
|
|
|
|
|
<Button Color="Color.Secondary" Disabled="@pdfNotReady" Clicked="@OnOpenPdfApp">Open Pdf with App</Button>
|
|
|
|
|
<Button Color="Color.Secondary" Disabled="@pdfNotReady" Clicked="@OnOpenPdfNewTab">Open Pdf in Tab</Button>
|
|
|
|
|
<Button Color="Color.Success" Disabled="@pdfNotReady" Clicked="@OnSave">Save</Button>
|
|
|
|
|
<Button Color="Color.Danger" Clicked="@OnCancel">Cancel</Button>
|
|
|
|
|
|
|
|
|
|
@if (!pdfNotReady && url != null && debug) {
|
|
|
|
|
<h3>Pdf</h3>
|
|
|
|
|
<iframe src="/quotes/@url" style="width:50%;height:600px;"></iframe>
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@if (quote.Tex != null && debug) {
|
|
|
|
|
<h3>Tex</h3>
|
|
|
|
|
<MemoEdit ReadOnly Size="Size.Small" Autosize @bind-Text="@quote.Tex" />
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@code {
|
|
|
|
|
private IList<Contact>? contacts;
|
|
|
|
|
private Quote quote = new();
|
|
|
|
|
private Contact? selectedContact;
|
|
|
|
|
private LineItem? selectedLineItem;
|
|
|
|
|
private CustomDescription? customDescriptionOfSelectedLineItem;
|
|
|
|
|
private readonly CultureInfo cultureInfo = new("de-DE");
|
|
|
|
|
private bool pdfNotReady = true;
|
|
|
|
|
private bool isCreatingPdf;
|
|
|
|
|
private bool texNotReady = true;
|
|
|
|
|
private bool isCreatingTex;
|
|
|
|
|
private bool lineItemsNotReady = true;
|
|
|
|
|
private string? url;
|
|
|
|
|
private bool debug;
|
|
|
|
|
|
|
|
|
|
protected override Task OnParametersSetAsync() {
|
|
|
|
|
contacts = GenericController.GetAll<Contact>();
|
|
|
|
|
GenerateNewQuote("Woitschetzki"); //TODO: get salesRep from Login
|
|
|
|
|
return Task.CompletedTask;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void GenerateNewQuote(string salesRep) {
|
|
|
|
|
quote.SalesRep = GenericController.Get<Contact>(c => c.LastName == salesRep);
|
|
|
|
|
quote.QuoteId = GenericController.GetLast<Quote>().QuoteId + 1;
|
|
|
|
|
if (quote.SalesRep != null) {
|
|
|
|
|
quote.QuotationNumber = quote.SalesRep.LastName switch
|
|
|
|
|
{
|
|
|
|
|
"Woitschetzki" => $"DE-83PE89-{DateTime.Now:My}-{quote.QuoteId}",
|
|
|
|
|
"Welsch" => $"DE-83RE32-{DateTime.Now:My}-{quote.QuoteId}",
|
|
|
|
|
_ => $"DE-XXYYXX-{DateTime.Now:My}-{quote.QuoteId}"
|
|
|
|
|
};
|
|
|
|
|
@inject ILoadingIndicatorService ApplicationLoadingIndicatorService
|
|
|
|
|
|
|
|
|
|
<AuthorizeView>
|
|
|
|
|
<Authorized>
|
|
|
|
|
<Div Margin="Margin.Is3"
|
|
|
|
|
Border="Border.Dark.OnAll"
|
|
|
|
|
Padding="Padding.Is3"
|
|
|
|
|
style="box-shadow: 10px 10px #343A40">
|
|
|
|
|
|
|
|
|
|
<Heading Size="HeadingSize.Is5">Recipient</Heading>
|
|
|
|
|
<Paragraph>
|
|
|
|
|
<DataGrid TItem="Contact"
|
|
|
|
|
Data="@contacts"
|
|
|
|
|
SelectedRow="@selectedContact"
|
|
|
|
|
SelectedRowChanged="@OnSelectedContactChanged"
|
|
|
|
|
Bordered Hoverable Filterable Striped ShowPager Responsive Sortable>
|
|
|
|
|
|
|
|
|
|
<DataGridCommandColumn/>
|
|
|
|
|
<DataGridColumn Field="@nameof(Contact.ContactId)" Caption="ContactId" Sortable Filterable/>
|
|
|
|
|
<DataGridColumn Field="@nameof(Contact.AccountId)" Caption="AccountId" Sortable Filterable/>
|
|
|
|
|
<DataGridColumn Field="@nameof(Contact.FirstName)" Caption="FirstName" Sortable Filterable/>
|
|
|
|
|
<DataGridColumn Field="@nameof(Contact.LastName)" Caption="LastName" Sortable Filterable/>
|
|
|
|
|
<DataGridColumn Field="@nameof(Contact.Gender)" Caption="Gender" Sortable Filterable/>
|
|
|
|
|
<DataGridColumn Field="@nameof(Contact.EMail)" Caption="EMail" Sortable Filterable/>
|
|
|
|
|
<DataGridColumn Field="@nameof(Contact.PhoneNumber)" Caption="PhoneNumber" Sortable Filterable/>
|
|
|
|
|
<DataGridColumn Field="@nameof(Contact.SapContactNumber)" Caption="SAPContactNumber" Sortable Filterable/>
|
|
|
|
|
</DataGrid>
|
|
|
|
|
</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 != null && quote.Recipient.Account != 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>
|
|
|
|
|
|
|
|
|
|
@if (quote.LineItems != null) {
|
|
|
|
|
<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.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>
|
|
|
|
|
|
|
|
|
|
@if (selectedLineItem != null && customDescriptionOfSelectedLineItem != null) {
|
|
|
|
|
<Div Margin="Margin.Is3"
|
|
|
|
|
Border="Border.Dark.OnAll"
|
|
|
|
|
Padding="Padding.Is3"
|
|
|
|
|
style="box-shadow: 10px 10px #343A40">
|
|
|
|
|
|
|
|
|
|
<Heading Size="HeadingSize.Is5">CustomDescription</Heading>
|
|
|
|
|
<Paragraph>
|
|
|
|
|
<Column ColumnSize="ColumnSize.Is12">
|
|
|
|
|
<Field>
|
|
|
|
|
<FieldLabel ColumnSize="ColumnSize.Is4">ProductNumber</FieldLabel>
|
|
|
|
|
<FieldBody ColumnSize="ColumnSize.Is6">@customDescriptionOfSelectedLineItem.ProductNumber</FieldBody>
|
|
|
|
|
</Field>
|
|
|
|
|
<Field>
|
|
|
|
|
<FieldLabel ColumnSize="ColumnSize.Is4">OptionNumber</FieldLabel>
|
|
|
|
|
<FieldBody ColumnSize="ColumnSize.Is6">@customDescriptionOfSelectedLineItem.OptionNumber</FieldBody>
|
|
|
|
|
</Field>
|
|
|
|
|
<Field>
|
|
|
|
|
<FieldLabel ColumnSize="ColumnSize.Is4">Heading</FieldLabel>
|
|
|
|
|
<FieldBody ColumnSize="ColumnSize.Is6">@customDescriptionOfSelectedLineItem.Heading</FieldBody>
|
|
|
|
|
</Field>
|
|
|
|
|
<Field>
|
|
|
|
|
<FieldLabel ColumnSize="ColumnSize.Is4">DescriptionText</FieldLabel>
|
|
|
|
|
<FieldBody ColumnSize="ColumnSize.Is6">@customDescriptionOfSelectedLineItem.DescriptionText</FieldBody>
|
|
|
|
|
</Field>
|
|
|
|
|
</Column>
|
|
|
|
|
</Paragraph>
|
|
|
|
|
</Div>
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
quote.Description = "Gerät";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private async Task SelectQuoteOnChanged(FileChangedEventArgs e) {
|
|
|
|
|
try {
|
|
|
|
|
foreach (IFileEntry? file in e.Files) {
|
|
|
|
|
using MemoryStream stream = new();
|
|
|
|
|
await file.WriteToStreamAsync(stream);
|
|
|
|
|
stream.Seek(0, SeekOrigin.Begin);
|
|
|
|
|
using StreamReader reader = new(stream);
|
|
|
|
|
string fileContent = await reader.ReadToEndAsync();
|
|
|
|
|
quote = QuoteHandling.ReadLineItems(quote, fileContent);
|
|
|
|
|
|
|
|
|
|
if (quote.Recipient?.Account?.AccountName != null)
|
|
|
|
|
{
|
|
|
|
|
quote = HostingService.SetPath(quote); //Set path to wwwroot/quotes folder
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FileService.WriteQuoteToTsv(fileContent, quote);
|
|
|
|
|
}
|
|
|
|
|
@if (quote.LineItems == null) {
|
|
|
|
|
<Div Margin="Margin.Is3"
|
|
|
|
|
Border="Border.Dark.OnAll"
|
|
|
|
|
Padding="Padding.Is3"
|
|
|
|
|
style="box-shadow: 10px 10px #343A40">
|
|
|
|
|
|
|
|
|
|
<Heading Size="HeadingSize.Is5">Upload PriceSurfer Quote </Heading>
|
|
|
|
|
<Paragraph>
|
|
|
|
|
<Field>
|
|
|
|
|
<FieldLabel>Please select PriceSurfer quote as TSV</FieldLabel>
|
|
|
|
|
<FileEdit Filter=".tsv" Changed="@SelectQuoteOnChanged" Written="@SelectQuoteOnWritten" Progressed="@SelectQuoteOnProgressed"/>
|
|
|
|
|
</Field>
|
|
|
|
|
</Paragraph>
|
|
|
|
|
</Div>
|
|
|
|
|
}
|
|
|
|
|
catch (Exception exc) {
|
|
|
|
|
Console.WriteLine(exc.Message);
|
|
|
|
|
|
|
|
|
|
<Div Margin="Margin.Is3"
|
|
|
|
|
Border="Border.Dark.OnAll"
|
|
|
|
|
Padding="Padding.Is3"
|
|
|
|
|
style="box-shadow: 10px 10px #343A40">
|
|
|
|
|
|
|
|
|
|
<Heading Size="HeadingSize.Is5">Create Quote</Heading>
|
|
|
|
|
<Paragraph>
|
|
|
|
|
<Button Color="Color.Primary" Disabled="@lineItemsNotReady" Clicked="@OnCreateTex" Loading="@isCreatingTex">Create Tex from Quote</Button>
|
|
|
|
|
<Button Color="Color.Secondary" Disabled="@texNotReady" Clicked="@OnCreatePdf" Loading="@isCreatingPdf">Create Pdf from Tex</Button>
|
|
|
|
|
<Button Color="Color.Secondary" Disabled="@pdfNotReady" Clicked="@OnOpenPdfApp">Open Pdf with App</Button>
|
|
|
|
|
<Button Color="Color.Secondary" Disabled="@pdfNotReady" Clicked="@OnOpenPdfNewTab">Open Pdf in Tab</Button>
|
|
|
|
|
<Button Color="Color.Success" Disabled="@pdfNotReady" Clicked="@OnSave">Save</Button>
|
|
|
|
|
<Button Color="Color.Danger" Clicked="@OnCancel">Cancel</Button>
|
|
|
|
|
</Paragraph>
|
|
|
|
|
</Div>
|
|
|
|
|
|
|
|
|
|
@if (!pdfNotReady && url != null && debug) {
|
|
|
|
|
<Div Margin="Margin.Is3"
|
|
|
|
|
Border="Border.Dark.OnAll"
|
|
|
|
|
Padding="Padding.Is3"
|
|
|
|
|
style="box-shadow: 10px 10px #343A40">
|
|
|
|
|
|
|
|
|
|
<Heading Size="HeadingSize.Is5">PDF</Heading>
|
|
|
|
|
<Paragraph>
|
|
|
|
|
<iframe src="/quotes/@url" style="width:50%;height:600px;"></iframe>
|
|
|
|
|
</Paragraph>
|
|
|
|
|
</Div>
|
|
|
|
|
}
|
|
|
|
|
finally {
|
|
|
|
|
Console.WriteLine("LineItems successfull read");
|
|
|
|
|
lineItemsNotReady = false;
|
|
|
|
|
StateHasChanged();
|
|
|
|
|
|
|
|
|
|
@if (quote.Tex != null && debug) {
|
|
|
|
|
<Div Margin="Margin.Is3"
|
|
|
|
|
Border="Border.Dark.OnAll"
|
|
|
|
|
Padding="Padding.Is3"
|
|
|
|
|
style="box-shadow: 10px 10px #343A40">
|
|
|
|
|
|
|
|
|
|
<Heading Size="HeadingSize.Is5">Tex</Heading>
|
|
|
|
|
<Paragraph>
|
|
|
|
|
<MemoEdit ReadOnly Size="Size.Small" Autosize @bind-Text="@quote.Tex" />
|
|
|
|
|
</Paragraph>
|
|
|
|
|
</Div>
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
</Authorized>
|
|
|
|
|
|
|
|
|
|
<NotAuthorized>
|
|
|
|
|
<Div Margin="Margin.Is3"
|
|
|
|
|
Border="Border.Dark.OnAll"
|
|
|
|
|
Padding="Padding.Is3"
|
|
|
|
|
style="box-shadow: 10px 10px #343A40">
|
|
|
|
|
|
|
|
|
|
<Heading Size="HeadingSize.Is3">Authentication Failure!</Heading>
|
|
|
|
|
<Paragraph>You're not signed in. Please click on the upper right to either register or log in.</Paragraph>
|
|
|
|
|
</Div>
|
|
|
|
|
</NotAuthorized>
|
|
|
|
|
</AuthorizeView>
|
|
|
|
|
|
|
|
|
|
@code {
|
|
|
|
|
[CascadingParameter] private Task<AuthenticationState>? authenticationStateTask { get; set; }
|
|
|
|
|
|
|
|
|
|
private IList<Contact>? contacts;
|
|
|
|
|
private Quote quote = new();
|
|
|
|
|
private Contact? selectedContact;
|
|
|
|
|
private LineItem? selectedLineItem;
|
|
|
|
|
private CustomDescription? customDescriptionOfSelectedLineItem;
|
|
|
|
|
private readonly CultureInfo cultureInfo = new("de-DE");
|
|
|
|
|
private bool pdfNotReady = true;
|
|
|
|
|
private bool isCreatingPdf;
|
|
|
|
|
private bool texNotReady = true;
|
|
|
|
|
private bool isCreatingTex;
|
|
|
|
|
private bool lineItemsNotReady = true;
|
|
|
|
|
private string? url;
|
|
|
|
|
private bool debug;
|
|
|
|
|
|
|
|
|
|
protected override async Task OnParametersSetAsync() {
|
|
|
|
|
if (authenticationStateTask != null) {
|
|
|
|
|
ClaimsPrincipal user = (await authenticationStateTask).User;
|
|
|
|
|
|
|
|
|
|
if (user.Identity is { IsAuthenticated: true }) {
|
|
|
|
|
await ApplicationLoadingIndicatorService.Show();
|
|
|
|
|
contacts = await genericController.GetAllAsync<Contact>();
|
|
|
|
|
await ApplicationLoadingIndicatorService.Hide();
|
|
|
|
|
quote = await GenerateNewQuote(quote, "Woitschetzki");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
await base.OnInitializedAsync();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private async Task<Quote> GenerateNewQuote(Quote _quote, string salesRepLastName) {
|
|
|
|
|
if (_quote == null) return new();
|
|
|
|
|
|
|
|
|
|
_quote.SalesRep = await genericController.GetAsync<Contact>(c => c.LastName.Equals(salesRepLastName), "Account");
|
|
|
|
|
|
|
|
|
|
private static void SelectQuoteOnWritten(FileWrittenEventArgs e) {
|
|
|
|
|
Console.WriteLine($"File: {e.File.Name} Position: {e.Position} Data: {Convert.ToBase64String(e.Data)}");
|
|
|
|
|
Quote? lastQuote = genericController.GetLast<Quote>();
|
|
|
|
|
if (lastQuote != null)
|
|
|
|
|
{
|
|
|
|
|
_quote.QuoteId = lastQuote.QuoteId + 1;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
_quote.QuoteId = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static void SelectQuoteOnProgressed(FileProgressedEventArgs e) {
|
|
|
|
|
Console.WriteLine($"File: {e.File.Name} Progress: {e.Percentage}");
|
|
|
|
|
if (_quote.SalesRep != null) {
|
|
|
|
|
_quote.QuotationNumber = _quote.SalesRep.LastName switch
|
|
|
|
|
{
|
|
|
|
|
"Woitschetzki" => $"DE-83PE89-{DateTime.Now:My}-{_quote.QuoteId}",
|
|
|
|
|
"Welsch" => $"DE-83RE32-{DateTime.Now:My}-{_quote.QuoteId}",
|
|
|
|
|
_ => $"DE-XXYYXX-{DateTime.Now:My}-{_quote.QuoteId}"
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
_quote.QuotationNumber = $"DE-XXYYXX-{DateTime.Now:My}-{_quote.QuoteId}";
|
|
|
|
|
}
|
|
|
|
|
_quote.Description = "Gerät";
|
|
|
|
|
return _quote;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private async Task SelectQuoteOnChanged(FileChangedEventArgs e) {
|
|
|
|
|
try {
|
|
|
|
|
foreach (IFileEntry? file in e.Files) {
|
|
|
|
|
using MemoryStream stream = new();
|
|
|
|
|
await file.WriteToStreamAsync(stream);
|
|
|
|
|
stream.Seek(0, SeekOrigin.Begin);
|
|
|
|
|
using StreamReader reader = new(stream);
|
|
|
|
|
string fileContent = await reader.ReadToEndAsync();
|
|
|
|
|
quote = QuoteHandling.ReadLineItems(quote, fileContent);
|
|
|
|
|
|
|
|
|
|
if (quote.Recipient?.Account?.AccountName != null)
|
|
|
|
|
{
|
|
|
|
|
quote = hostingService.SetPath(quote); //Set path to wwwroot/quotes folder
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private Task OnSelectedContactChanged(Contact sC) {
|
|
|
|
|
selectedContact = sC;
|
|
|
|
|
quote.Recipient = selectedContact;
|
|
|
|
|
quote.Recipient.Account = GenericController.Get<Account>(account => account.AccountId == quote.Recipient.AccountId);
|
|
|
|
|
return Task.CompletedTask;
|
|
|
|
|
FileService.WriteQuoteToTsv(fileContent, quote);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch (Exception exc) {
|
|
|
|
|
Console.WriteLine(exc.Message);
|
|
|
|
|
}
|
|
|
|
|
finally {
|
|
|
|
|
lineItemsNotReady = false;
|
|
|
|
|
StateHasChanged();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private Task OnSave() {
|
|
|
|
|
if (GenericController.Insert(quote) > 0)
|
|
|
|
|
NavigationManager.NavigateTo("Quotes/QuoteIndex");
|
|
|
|
|
private static void SelectQuoteOnWritten(FileWrittenEventArgs e) {
|
|
|
|
|
Console.WriteLine($"File: {e.File.Name} Position: {e.Position} Data: {Convert.ToBase64String(e.Data)}");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return Task.CompletedTask;
|
|
|
|
|
private static void SelectQuoteOnProgressed(FileProgressedEventArgs e) {
|
|
|
|
|
Console.WriteLine($"File: {e.File.Name} Progress: {e.Percentage}");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private async Task OnSelectedContactChanged(Contact _selectedContact) {
|
|
|
|
|
selectedContact = _selectedContact;
|
|
|
|
|
quote.Recipient = selectedContact;
|
|
|
|
|
quote.Recipient.Account = await genericController.GetAsync<Account>(account => account.AccountId.Equals(quote.Recipient.AccountId));
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private async Task OnSave() {
|
|
|
|
|
if (await genericController.InsertAsync(quote) > 0)
|
|
|
|
|
navigationManager.NavigateTo("Quotes/QuoteIndex");
|
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private async Task OnCreateTex() {
|
|
|
|
|
isCreatingTex = true;
|
|
|
|
|
quote.Tex = (await QuoteHandling.CreateTex(quote))?.ToString();
|
|
|
|
|
quote.Tex = (await QuoteHandling.CreateTexAsync(quote))?.ToString();
|
|
|
|
|
if (quote.Tex == null) return;
|
|
|
|
|
await FileService.WriteTexFile(quote);
|
|
|
|
|
isCreatingTex = false;
|
|
|
|
|
@ -351,15 +486,21 @@
|
|
|
|
|
return Task.CompletedTask;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private Task OnWarrantyChanged(string warranty) {
|
|
|
|
|
quote.Warranty = int.Parse(warranty);
|
|
|
|
|
return Task.CompletedTask;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private Task OnCancel() {
|
|
|
|
|
NavigationManager.NavigateTo("Quotes/QuoteIndex");
|
|
|
|
|
navigationManager.NavigateTo("Quotes/QuoteIndex");
|
|
|
|
|
return Task.CompletedTask;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private Task OnSelectedLineItemChanged(LineItem lI) {
|
|
|
|
|
private async Task OnSelectedLineItemChanged(LineItem lI) {
|
|
|
|
|
selectedLineItem = lI;
|
|
|
|
|
customDescriptionOfSelectedLineItem = GenericController.Get<CustomDescription>(cD => cD.ProductNumber == lI.ProductNumber && cD.OptionNumber == lI.OptionNumber);
|
|
|
|
|
return Task.CompletedTask;
|
|
|
|
|
customDescriptionOfSelectedLineItem =
|
|
|
|
|
await genericController.GetAsync<CustomDescription>(cD => cD.ProductNumber.Equals(lI.ProductNumber) && cD.OptionNumber.Equals(lI.OptionNumber));
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|