client v.0.48.1
This commit is contained in:
parent
b867faf609
commit
1184247c4d
11 changed files with 181 additions and 251 deletions
|
@ -32,7 +32,7 @@ public partial class VatAddressInputComponent
|
|||
}
|
||||
private async Task SubmitForm()
|
||||
{
|
||||
await OnValidSubmit.InvokeAsync(Address);
|
||||
await OnValidSubmit.InvokeAsync(_address);
|
||||
}
|
||||
|
||||
}
|
|
@ -31,6 +31,6 @@ public partial class VatCompanyNameInputComponent
|
|||
}
|
||||
private async Task SubmitForm()
|
||||
{
|
||||
await OnValidSubmit.InvokeAsync(CompanyName);
|
||||
await OnValidSubmit.InvokeAsync(_companyName);
|
||||
}
|
||||
}
|
|
@ -33,6 +33,6 @@ public partial class VatNumberInputComponent
|
|||
|
||||
private async Task SubmitForm()
|
||||
{
|
||||
await OnValidSubmit.InvokeAsync(VatNumber);
|
||||
await OnValidSubmit.InvokeAsync(_vatNumber);
|
||||
}
|
||||
}
|
|
@ -23,197 +23,113 @@
|
|||
|
||||
|
||||
<h2>Opret kunde</h2>
|
||||
<table class="table table-striped table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Virksomhedsopslag</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if (Dk)
|
||||
{
|
||||
<tr>
|
||||
<td>
|
||||
<VatCompanyNameInputComponent CompanyName="@Company.Name" OnValidSubmit="GetInfoFromName"/>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
<tr>
|
||||
<td>
|
||||
<VatNumberInputComponent VatNumber="@Company.VatNumber" OnValidSubmit="GetInfoFromVat"/>
|
||||
</td>
|
||||
</tr>
|
||||
@if (Dk)
|
||||
{
|
||||
<tr>
|
||||
<td>
|
||||
<VatAddressInputComponent Address="CompanyVatAddress" OnValidSubmit="GetInfoFromAddress"/>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
|
||||
@if (VatInfos.Any() && ShowInfos)
|
||||
{
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">CVR ORG</th>
|
||||
<th scope="col">Navn</th>
|
||||
<th scope="col">Status</th>
|
||||
<th scope="col"></th>
|
||||
<th scope="col"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var info in VatInfos)
|
||||
{
|
||||
<tr>
|
||||
<td class="align-middle">@info.VatNumber</td>
|
||||
<td class="align-middle">@info.Name</td>
|
||||
<td class="align-middle">@info.States[^1].State</td>
|
||||
<td class="align-middle"></td>
|
||||
<td class="align-middle">
|
||||
<button class="btn btn-primary" @onclick="@(() => SelectCompany(info.VatNumber))">OVERFØR</button>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<EditForm EditContext="CompanyContext" OnValidSubmit="SubmitCompanyForm">
|
||||
<DataAnnotationsValidator/>
|
||||
<InputText type="hidden" id="salesRepId" @bind-Value="Company.SalesRepId"/>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
Besøg dato
|
||||
</th>
|
||||
<th>
|
||||
Næste besøg
|
||||
</th>
|
||||
<th>
|
||||
Interval (uger)
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<InputDate id="lastVisit" class="form-control" @bind-Value="@LastVisit"/>
|
||||
</td>
|
||||
<td>
|
||||
<InputDate id="nextVisit" class="form-control" @bind-Value="@(NextVisit)" readonly />
|
||||
</td>
|
||||
<td>
|
||||
<InputNumber id="interval" class="form-control" @bind-Value="Company.Interval"/>
|
||||
<ValidationMessage For="@(() => Company.Interval)"></ValidationMessage>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="5">
|
||||
Stamdata
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th class="align-middle">Moms/Org Reg.</th>
|
||||
<td class="align-middle state">
|
||||
<DisplayStateComponent StateClass="@RegState"></DisplayStateComponent>
|
||||
</td>
|
||||
<td class="align-middle">
|
||||
<InputText id="vatNumber" class="form-control" @bind-Value="Company.VatNumber"/>
|
||||
<ValidationMessage For="@(() => Company.VatNumber)"></ValidationMessage>
|
||||
</td>
|
||||
<th class="align-middle">Telefon</th>
|
||||
<td class="align-middle">
|
||||
<InputText id="phone" class="form-control" @bind-Value="Company.Phone"/>
|
||||
<ValidationMessage For="@(() => Company.Phone)"></ValidationMessage>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="align-middle">Firmanavn</th>
|
||||
<td class="align-middle"></td>
|
||||
<td>
|
||||
|
||||
<div class="row g-2">
|
||||
@* vat lookup *@
|
||||
<div class="col-sm-12 text-end">
|
||||
<button type="button" class="btn btn-primary" @onclick="CallVatLookupModal">CVR opslag</button>
|
||||
</div>
|
||||
@* entity name *@
|
||||
<label for="name" class="col-sm-1 col-form-label-sm">Navn</label>
|
||||
<div class="col-sm-7">
|
||||
<InputText id="name" class="form-control" @bind-Value="Company.Name"/>
|
||||
<ValidationMessage For="@(() => Company.Name)"></ValidationMessage>
|
||||
</td>
|
||||
<th class="align-middle">Attention</th>
|
||||
<td>
|
||||
</div>
|
||||
@* entity attention *@
|
||||
<label for="attention" class="col-sm-1 col-form-label-sm">Att.</label>
|
||||
<div class="col-sm-3">
|
||||
<InputText id="attention" class="form-control" @bind-Value="Company.Attention"/>
|
||||
<ValidationMessage For="@(() => Company.Attention)"></ValidationMessage>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="align-middle">Adresse1</th>
|
||||
<td class="align-middle"></td>
|
||||
<td class="align-middle">
|
||||
</div>
|
||||
@* entity address 1 *@
|
||||
<label for="address1" class="col-sm-1 col-form-label-sm">Adresse</label>
|
||||
<div class="col-sm-6">
|
||||
<InputText id="address1" class="form-control" @bind-Value="Company.Address1"/>
|
||||
<ValidationMessage For="@(() => Company.Address1)"></ValidationMessage>
|
||||
</td>
|
||||
<th class="align-middle">Adresse2</th>
|
||||
<td class="align-middle">
|
||||
</div>
|
||||
@* entity address 2 *@
|
||||
<label for="address2" class="col-sm-1 col-form-label-sm">Adresse</label>
|
||||
<div class="col-sm-4">
|
||||
<InputText id="address2" class="form-control" @bind-Value="Company.Address2"/>
|
||||
<ValidationMessage For="@(() => Company.Address2)"></ValidationMessage>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="align-middle">Postnr</th>
|
||||
<td class="align-middle"></td>
|
||||
<td class="align-middle">
|
||||
</div>
|
||||
@* entity postal code *@
|
||||
<label for="zipCode" class="col-sm-1 col-form-label-sm">Post Nr</label>
|
||||
<div class="col-sm-2">
|
||||
<InputText id="zipCode" class="form-control" @bind-Value="Company.ZipCode"/>
|
||||
<ValidationMessage For="@(() => Company.ZipCode)"></ValidationMessage>
|
||||
</td>
|
||||
<th class="align-middle">Bynavn</th>
|
||||
<td class="align-middle">
|
||||
</div>
|
||||
@* entity city name *@
|
||||
<label for="city" class="col-sm-1 col-form-label-sm">Bynavn</label>
|
||||
<div class="col-sm-8">
|
||||
<InputText id="city" class="form-control" @bind-Value="Company.City"/>
|
||||
<ValidationMessage For="@(() => Company.City)"></ValidationMessage>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="align-middle">Mobil</th>
|
||||
<td class="align-middle"></td>
|
||||
<td class="align-middle">
|
||||
</div>
|
||||
@* entity vat number *@
|
||||
<label for="vatNumber" class="col-sm-1 col-form-label-sm">Moms Nr</label>
|
||||
<div class="col-sm-3">
|
||||
<div class="input-group">
|
||||
<span class="input-group-text">
|
||||
<DisplayStateComponent StateClass="@RegState"/>
|
||||
</span>
|
||||
<InputText id="vatNumber" class="form-control" @bind-Value="Company.VatNumber"/>
|
||||
<ValidationMessage For="@(() => Company.VatNumber)"></ValidationMessage>
|
||||
</div>
|
||||
</div>
|
||||
@* entity phone *@
|
||||
<label for="phone" class="col-sm-1 col-form-label-sm">Telefon</label>
|
||||
<div class="col-sm-3">
|
||||
<InputText id="phone" class="form-control" @bind-Value="Company.Phone"/>
|
||||
<ValidationMessage For="@(() => Company.Phone)"></ValidationMessage>
|
||||
</div>
|
||||
@* entity mobile *@
|
||||
<label for="mobile" class="col-sm-1 col-form-label-sm">Mobil</label>
|
||||
<div class="col-sm-3">
|
||||
<InputText id="mobile" class="form-control" @bind-Value="Company.Mobile"/>
|
||||
<ValidationMessage For="@(() => Company.Mobile)"></ValidationMessage>
|
||||
</td>
|
||||
<th class="align-middle">Email</th>
|
||||
<td class="align-middle">
|
||||
</div>
|
||||
@* entity email *@
|
||||
<label for="email" class="col-sm-1 col-form-label-sm">Email</label>
|
||||
<div class="col-sm-11">
|
||||
<InputText id="email" class="form-control" @bind-Value="Company.Email"/>
|
||||
<ValidationMessage For="@(() => Company.Email)"></ValidationMessage>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="align-middle">OBS</th>
|
||||
<td class="align-middle" colspan="5">
|
||||
</div>
|
||||
</div>
|
||||
<hr class="mb-3"/>
|
||||
<div class="row g-2">
|
||||
<label for="note" class="col-sm-1 col-form-label-sm">OBS</label>
|
||||
<div class="col-sm-5">
|
||||
<InputText id="note" class="form-control" @bind-Value="Company.Note"/>
|
||||
<ValidationMessage For="@(() => Company.Note)"></ValidationMessage>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="align-middle">Notater</th>
|
||||
<td class="align-middle" colspan="5">
|
||||
</div>
|
||||
<label for="crmNotes" class="col-sm-1">Noter</label>
|
||||
<div class="col-sm-5">
|
||||
<InputTextArea id="crmNotes" class="form-control" @bind-Value="Company.CrmNotes"/>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="row mb-2">
|
||||
<div class="col-md-8"></div>
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
<label for="nextVisit" class="col-sm-1 col-form-label-sm">Næste besøg</label>
|
||||
<div class="col-sm-3">
|
||||
<InputDate id="nextVisit" class="form-control" @bind-Value="@(NextVisit)" />
|
||||
</div>
|
||||
<label for="lastVisit" class="col-sm-1 col-form-label-sm">Sidste besøg</label>
|
||||
<div class="col-sm-3">
|
||||
<InputDate id="lastVisit" class="form-control" @bind-Value="@LastVisit"/>
|
||||
</div>
|
||||
<label for="interval" class="col-sm-1 col-form-label-sm">Uge interval</label>
|
||||
<div class="col-sm-3">
|
||||
<InputNumber id="interval" class="form-control" @bind-Value="Company.Interval"/>
|
||||
<ValidationMessage For="@(() => Company.Interval)"></ValidationMessage>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<div class="col-sm-12 text-end">
|
||||
<button type="submit" class="btn btn-success" disabled="@FormInvalid">Opret</button>
|
||||
</div>
|
||||
</div>
|
||||
</EditForm>
|
||||
|
||||
<VatLookupDkModal VatAddress="CompanyVatAddress" EntityName="@Company.Name" VatNumber="@Company.VatNumber"
|
||||
@ref="VatLookupPopup" OnSelectedCompany="SelectCompanyCallback"/>
|
|
@ -16,6 +16,7 @@
|
|||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Text.Json;
|
||||
using System.Threading.Tasks;
|
||||
using Blazored.LocalStorage;
|
||||
using Blazored.Toast.Services;
|
||||
|
@ -50,6 +51,8 @@ namespace Wonky.Client.Pages
|
|||
private VirkRegInfo CompanyRegInfo { get; set; } = new();
|
||||
private List<VirkRegInfo> VatInfos { get; set; } = new();
|
||||
private VatAddress CompanyVatAddress { get; set; } = new();
|
||||
private VatLookupDkModal VatLookupPopup { get; set; } = new();
|
||||
|
||||
private bool FormInvalid = true;
|
||||
private string RegState = "";
|
||||
private DateTime LastVisit { get; set; }
|
||||
|
@ -80,6 +83,13 @@ namespace Wonky.Client.Pages
|
|||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Show Vat Lookup modal
|
||||
/// </summary>
|
||||
private void CallVatLookupModal()
|
||||
{
|
||||
VatLookupPopup.Show();
|
||||
}
|
||||
private async Task GetInfoFromName(string entityName)
|
||||
{
|
||||
Toaster.ShowInfo("Vent for firma info ...");
|
||||
|
@ -118,6 +128,30 @@ namespace Wonky.Client.Pages
|
|||
Toaster.ShowError($"Firma med CVR '{vatNumber}' findes ikke.");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Modal callback to update company properties
|
||||
/// </summary>
|
||||
/// <param name="regInfo"></param>
|
||||
private void SelectCompanyCallback(VirkRegInfo regInfo)
|
||||
{
|
||||
Logger.LogDebug($"CrmCompanyView => SelectCompanyCallback => {JsonSerializer.Serialize(regInfo)}");
|
||||
|
||||
// this can be removed in favor of the new data returned from updating the VatNumber
|
||||
RegState = regInfo.States[0].State.ToLower() == "normal" ? "the-good" : "the-dead";
|
||||
|
||||
if (regInfo.SyncAll)
|
||||
{
|
||||
|
||||
Company.Name = regInfo.Name;
|
||||
Company.Address1 = regInfo.Address;
|
||||
Company.Address2 = regInfo.CoName;
|
||||
Company.ZipCode = regInfo.ZipCode;
|
||||
Company.City = regInfo.City;
|
||||
}
|
||||
Company.VatNumber = regInfo.VatNumber;
|
||||
}
|
||||
|
||||
private void SelectCompany(string vatNumber)
|
||||
{
|
||||
ShowInfos = false;
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
@attribute [Authorize(Roles = "Advisor")]
|
||||
@page "/companies/{CompanyId}"
|
||||
|
||||
@if (!string.IsNullOrWhiteSpace(Company.Name))
|
||||
@if (!string.IsNullOrWhiteSpace(Company.Account))
|
||||
{
|
||||
@if (!string.IsNullOrWhiteSpace(Company.Blocked))
|
||||
{
|
||||
|
|
|
@ -27,7 +27,6 @@ using Wonky.Client.Services;
|
|||
using Wonky.Client.Shared;
|
||||
using Wonky.Entity.DTO;
|
||||
using Wonky.Entity.Models;
|
||||
using Wonky.Entity.Requests;
|
||||
using Wonky.Entity.Views;
|
||||
|
||||
namespace Wonky.Client.Pages;
|
||||
|
@ -47,12 +46,10 @@ public partial class CrmCompanyViewPage : IDisposable
|
|||
private readonly JsonSerializerOptions _options = new () { PropertyNameCaseInsensitive = true };
|
||||
private CompanyDto Company { get; set; } = new();
|
||||
private EditContext ErpContext { get; set; }
|
||||
private List<VirkRegInfo> VatInfos { get; set; } = new();
|
||||
private VirkRegInfo CompanyRegInfo { get; set; } = new();
|
||||
private DateTime LastVisit { get; set; }
|
||||
private DateTime NextVisit { get; set; }
|
||||
private string VatState { get; set; } = "the-ugly";
|
||||
private VatAddress CompanyVatAddress = new();
|
||||
private string VatState { get; set; } = "the-ugly";
|
||||
private bool ValidVat;
|
||||
private bool HasFolded;
|
||||
private string CurrentVat { get; set; } = "";
|
||||
|
@ -237,7 +234,7 @@ public partial class CrmCompanyViewPage : IDisposable
|
|||
{
|
||||
Toaster.ShowError($"Moms Nummer ugyldigt");
|
||||
}
|
||||
Toaster.ShowInfo("Vent venligst ...", "Opdaterer Moms Nr");
|
||||
Toaster.ShowInfo("Vent venligst ...", "OPDATERER MOMS NUMMER");
|
||||
var result = await CompanyRepo.UpdateCompanyVat(CompanyId, Company.VatNumber);
|
||||
if (!string.IsNullOrWhiteSpace(result.Name))
|
||||
{
|
||||
|
@ -245,26 +242,6 @@ public partial class CrmCompanyViewPage : IDisposable
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get vat info from known address
|
||||
/// </summary>
|
||||
/// <param name="address"></param>
|
||||
private async Task GetInfoFromAddress(VatAddress address)
|
||||
{
|
||||
Toaster.ShowInfo("Vent for adresse info ...");
|
||||
VatInfos = await VatService.QueryVirkRegistry(
|
||||
new VirkParams
|
||||
{
|
||||
StreetName = address.StreetName,
|
||||
HouseNumber = address.HouseNumber,
|
||||
ZipCode = address.ZipCode
|
||||
});
|
||||
if (!VatInfos.Any())
|
||||
{
|
||||
Toaster.ShowWarning($"Ingen data fundet ...");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Prepare vat address from company model
|
||||
/// </summary>
|
||||
|
@ -311,9 +288,9 @@ public partial class CrmCompanyViewPage : IDisposable
|
|||
/// Modal callback to update company properties
|
||||
/// </summary>
|
||||
/// <param name="regInfo"></param>
|
||||
private async Task SelectCompanyCallback(VirkRegInfo regInfo)
|
||||
private void SelectCompanyCallback(VirkRegInfo regInfo)
|
||||
{
|
||||
Console.WriteLine(JsonSerializer.Serialize(regInfo));
|
||||
Logger.LogDebug($"CrmCompanyView => SelectCompanyCallback => {JsonSerializer.Serialize(regInfo)}");
|
||||
|
||||
// this can be removed in favor of the new data returned from updating the VatNumber
|
||||
ValidVat = regInfo.States[0].State.ToLower() == "normal";
|
||||
|
@ -323,18 +300,14 @@ public partial class CrmCompanyViewPage : IDisposable
|
|||
|
||||
if (regInfo.SyncAll)
|
||||
{
|
||||
Company.VatNumber = CompanyRegInfo.VatNumber;
|
||||
Company.Name = CompanyRegInfo.Name;
|
||||
Company.Address1 = CompanyRegInfo.Address;
|
||||
Company.Address2 = CompanyRegInfo.CoName;
|
||||
Company.ZipCode = CompanyRegInfo.ZipCode;
|
||||
Company.City = CompanyRegInfo.City;
|
||||
|
||||
Company.Name = regInfo.Name;
|
||||
Company.Address1 = regInfo.Address;
|
||||
Company.Address2 = regInfo.CoName;
|
||||
Company.ZipCode = regInfo.ZipCode;
|
||||
Company.City = regInfo.City;
|
||||
}
|
||||
else
|
||||
{
|
||||
Company.VatNumber = CompanyRegInfo.VatNumber;
|
||||
}
|
||||
// await UpdateVatNumber();
|
||||
Company.VatNumber = regInfo.VatNumber;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -39,25 +39,30 @@
|
|||
<div class="card-body py-5 px-md-5">
|
||||
<EditForm Model="_credentialDto" OnValidSubmit="ExecuteLogin" class="form">
|
||||
<DataAnnotationsValidator/>
|
||||
@* username *@
|
||||
<div class="input-group mb-4">
|
||||
<span class="input-group-text" id="email-addon"><i class="oi oi-person"></i></span>
|
||||
<InputText type="email" id="email" class="form-control" aria-described-by="email-addon"
|
||||
placeholder="Email adresse"
|
||||
<span class="input-group-text" id="at">
|
||||
<i class="bi-at"></i>
|
||||
</span>
|
||||
<InputText type="email" class="form-control" aria-described-by="at"
|
||||
@bind-Value="_credentialDto.Email" autocomplete="username"/>
|
||||
<ValidationMessage For="@(() => _credentialDto.Email)"/>
|
||||
</div>
|
||||
|
||||
@* current-password *@
|
||||
<div class="input-group mb-4">
|
||||
<span class="input-group-text" id="passwd-addon"><i class="oi oi-key"></i></span>
|
||||
<InputText type="password" id="password" class="form-control" aria-described-by="passwd-addon"
|
||||
placeholder="Adgangskode"
|
||||
<span class="input-group-text" id="key">
|
||||
<i class="oi oi-key"></i>
|
||||
</span>
|
||||
<InputText type="password" class="form-control" aria-described-by="key"
|
||||
@bind-Value="_credentialDto.Password" autocomplete="current-password"/>
|
||||
<ValidationMessage For="@(() => _credentialDto.Password)"/>
|
||||
|
||||
</div>
|
||||
@* submit button *@
|
||||
<div class="d-grid">
|
||||
<button type="submit" class="btn btn-primary btn-lg mb-4" disabled="@execLogin">Login</button>
|
||||
</div>
|
||||
</EditForm>
|
||||
@* loader animation *@
|
||||
<div class="row mb-4">
|
||||
<div class="col d-flex justify-content-center">
|
||||
@if (execLogin)
|
||||
|
@ -66,8 +71,6 @@
|
|||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</EditForm>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -122,6 +122,9 @@ public class VatInfoLookupService
|
|||
if (!string.IsNullOrWhiteSpace(query.VatNumber))
|
||||
return true;
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(query.EntityName))
|
||||
return true;
|
||||
|
||||
return !string.IsNullOrWhiteSpace(query.HouseNumber)
|
||||
&& !string.IsNullOrWhiteSpace(query.StreetName)
|
||||
&& !string.IsNullOrWhiteSpace(query.ZipCode);
|
||||
|
|
|
@ -37,6 +37,7 @@ public partial class VatLookupDkModal
|
|||
[Parameter] public EventCallback<VirkRegInfo> OnSelectedCompany { get; set; }
|
||||
[Inject] public VatInfoLookupService VatService { get; set; }
|
||||
[Inject] public IToastService Toaster { get; set; }
|
||||
[Inject] public ILogger<VatLookupDkModal> Logger { get; set; }
|
||||
private VirkRegInfo CompanyRegInfo { get; set; } = new();
|
||||
private List<VirkRegInfo> VatInfos { get; set; } = new();
|
||||
private VatAddress _vatAddress { get; set; } = new();
|
||||
|
@ -50,12 +51,12 @@ public partial class VatLookupDkModal
|
|||
return base.OnParametersSetAsync();
|
||||
}
|
||||
|
||||
private async Task SelectCompany(string vatNumber, bool syncAll)
|
||||
private void SelectCompany(string vatNumber, bool syncAll)
|
||||
{
|
||||
CompanyRegInfo = VatInfos.First(x => x.VatNumber == vatNumber);
|
||||
CompanyRegInfo.SyncAll = syncAll;
|
||||
Console.WriteLine($"SelectCompany => {JsonSerializer.Serialize(CompanyRegInfo)}");
|
||||
await OnSelectedCompany.InvokeAsync(CompanyRegInfo);
|
||||
Logger.LogDebug($"VatLookupModal => SelectCompany => {JsonSerializer.Serialize(CompanyRegInfo)}");
|
||||
OnSelectedCompany.InvokeAsync(CompanyRegInfo);
|
||||
Hide();
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"appInfo": {
|
||||
"name": "Wonky Client",
|
||||
"version": "0.47.4",
|
||||
"version": "0.48.1",
|
||||
"rc": true,
|
||||
"sandBox": false,
|
||||
"image": "grumpy-coder.png"
|
||||
|
|
Loading…
Reference in a new issue