Invoice content display - fixed loader
This commit is contained in:
parent
00ff0a66f7
commit
949d27b903
29 changed files with 392 additions and 82 deletions
|
@ -15,23 +15,23 @@
|
|||
<div class="col-md-2">
|
||||
<h4>Rekvisition</h4>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="col-md-2">
|
||||
<h4>Reference</h4>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="col-md-2 text-end">
|
||||
<h4>Beløb</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@foreach (var invoice in InvoiceList)
|
||||
{
|
||||
<div class="list-group-item list-group-item-action">
|
||||
<div class="list-group-item list-group-item-action" @onclick="() => ShowInvoice(invoice.ArchiveHeadId)">
|
||||
<div class="row">
|
||||
<div class="col-md-2">@invoice.DocumentDate</div>
|
||||
<div class="col-md-2">@invoice.DocumentNumber</div>
|
||||
<div class="col-md-2">@invoice.ReferenceNumber</div>
|
||||
<div class="col-md-3">@invoice.YourRef</div>
|
||||
<div class="col-md-3">@invoice.InvoiceAmount</div>
|
||||
<div class="col-md-2">@invoice.YourRef</div>
|
||||
<div class="col-md-2 text-end">@invoice.InvoiceAmount</div>
|
||||
</div>
|
||||
@if (!string.IsNullOrWhiteSpace(invoice.OrderNote))
|
||||
{
|
||||
|
@ -49,10 +49,4 @@ else
|
|||
{
|
||||
<span>Ingen data</span>
|
||||
}
|
||||
|
||||
@code{
|
||||
|
||||
[Parameter]
|
||||
public List<InvoiceListItemView> InvoiceList { get; set; }
|
||||
|
||||
}
|
||||
<InvoiceViewModal CompanyId="@CompanyId" InvoiceId="@InvoiceId" @ref="InvoiceView" />
|
20
Wonky.Client/Components/InvoiceTableComponent.razor.cs
Normal file
20
Wonky.Client/Components/InvoiceTableComponent.razor.cs
Normal file
|
@ -0,0 +1,20 @@
|
|||
using Microsoft.AspNetCore.Components;
|
||||
using Wonky.Client.Shared;
|
||||
using Wonky.Entity.Views;
|
||||
|
||||
namespace Wonky.Client.Components;
|
||||
|
||||
public partial class InvoiceTableComponent
|
||||
{
|
||||
[Parameter] public List<InvoiceListItemView> InvoiceList { get; set; } = new();
|
||||
[Parameter] public string CompanyId { get; set; } = "";
|
||||
private InvoiceViewModal InvoiceView { get; set; }
|
||||
private string InvoiceId { get; set; } = "";
|
||||
private void ShowInvoice(string invoiceId)
|
||||
{
|
||||
Console.WriteLine($"invoiceId => {invoiceId}");
|
||||
Console.WriteLine($"companyId => {CompanyId}");
|
||||
InvoiceId = invoiceId;
|
||||
InvoiceView.Show();
|
||||
}
|
||||
}
|
|
@ -22,5 +22,5 @@
|
|||
<!-- loader credit: samherbert.net/svg-loaders -->
|
||||
<img src="/svg-loaders/three-dots.svg" alt="loading ..."/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
|
|
@ -5,18 +5,10 @@ namespace Wonky.Client.Components;
|
|||
|
||||
public partial class LoaderThreeDots
|
||||
{
|
||||
[Parameter] public bool Loading { get; set; } = true;
|
||||
[Parameter] public int Timeout { get; set; } = 30000;
|
||||
private bool ShowMe { get; set; }
|
||||
|
||||
protected override void OnParametersSet()
|
||||
{
|
||||
ShowMe = Loading;
|
||||
}
|
||||
|
||||
private bool ShowMe { get; set; } = true;
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
await Task.Delay(Timeout);
|
||||
ShowMe = false;
|
||||
await Task.Delay(15000);
|
||||
ShowMe = false;
|
||||
}
|
||||
}
|
|
@ -109,5 +109,5 @@
|
|||
}
|
||||
else
|
||||
{
|
||||
<LoaderThreeDots Loading="Loading" />
|
||||
<LoaderThreeDots />
|
||||
}
|
||||
|
|
8
Wonky.Client/HttpInterfaces/ICrmContactHttpRepository.cs
Normal file
8
Wonky.Client/HttpInterfaces/ICrmContactHttpRepository.cs
Normal file
|
@ -0,0 +1,8 @@
|
|||
using Wonky.Entity.DTO;
|
||||
|
||||
namespace Wonky.Client.HttpInterfaces;
|
||||
|
||||
public interface ICrmContactHttpRepository
|
||||
{
|
||||
Task CreateContact(ContactDto contact);
|
||||
}
|
|
@ -69,7 +69,7 @@ public class CrmHistoryHttpRepository : ICrmHistoryHttpRepository
|
|||
public async Task<InvoiceView> FetchInvoice(string companyId, string invoiceId)
|
||||
{
|
||||
return await _client
|
||||
.GetFromJsonAsync<InvoiceView>($"{_api.CrmCustomers}/{companyId}/invoices/{invoiceId}");
|
||||
.GetFromJsonAsync<InvoiceView>($"{_api.CrmCustomers}/{companyId}/invoices/{invoiceId}", _options);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -94,7 +94,7 @@ public class CrmHistoryHttpRepository : ICrmHistoryHttpRepository
|
|||
public async Task<List<ProductHistoryView>> FetchHistory(string companyId)
|
||||
{
|
||||
return await _client.GetFromJsonAsync<List<ProductHistoryView>>(
|
||||
$"{_api.CrmCustomers}/{companyId}/{_api.CrmProducts}");
|
||||
$"{_api.CrmCustomers}/{companyId}/{_api.CrmProducts}", _options);
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
|
@ -106,7 +106,7 @@ public class CrmHistoryHttpRepository : ICrmHistoryHttpRepository
|
|||
public async Task<List<ProductHistoryView>> FetchHistory(string companyId, string sku)
|
||||
{
|
||||
return await _client.GetFromJsonAsync<List<ProductHistoryView>>(
|
||||
$"{_api.CrmCustomers}/{companyId}/{_api.CrmProducts}/{sku}");
|
||||
$"{_api.CrmCustomers}/{companyId}/{_api.CrmProducts}/{sku}", _options);
|
||||
}
|
||||
/// <summary>
|
||||
/// execute a remote procedure designed to update crm database from erp system based on a date string
|
||||
|
|
|
@ -45,6 +45,6 @@
|
|||
}
|
||||
else
|
||||
{
|
||||
<LoaderThreeDots Loading="Loading" />
|
||||
<LoaderThreeDots />
|
||||
}
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ public partial class CrmActivityTodayPage : IDisposable
|
|||
[Inject] public NavigationManager _navigator { get; set; }
|
||||
[Inject] public ICrmActivityHttpRepository CrmActivityRepo { get; set; }
|
||||
[Inject] public ICrmReportHttpRepository CrmReportRepo { get; set; }
|
||||
[Inject] public IToastService _toast { get; set; }
|
||||
[Inject] public IToastService Toaster { get; set; }
|
||||
private ReportStatusView? ReportStatusView { get; set; } = new();
|
||||
private Preferences _prefs { get; set; } = new();
|
||||
private DateTime SelectedDate { get; set; }
|
||||
|
@ -54,12 +54,13 @@ public partial class CrmActivityTodayPage : IDisposable
|
|||
|
||||
private async Task GetActivities(string workDate)
|
||||
{
|
||||
_toast.ShowInfo("Vent nogle sekunder for data");
|
||||
Toaster.ShowInfo("Vent nogle sekunder for data");
|
||||
SelectedDate = DateTime.Parse(workDate);
|
||||
ReportStatusView = new ReportStatusView();
|
||||
ReportStatusView = await CrmActivityRepo.GetActivities($"{SelectedDate:yyyy-MM-dd}");
|
||||
_logger.LogDebug("Activities => {}", JsonSerializer.Serialize(ReportStatusView));
|
||||
Loading = false;
|
||||
Toaster.ClearAll();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
|
|
|
@ -83,5 +83,5 @@
|
|||
</div>
|
||||
@if (Working)
|
||||
{
|
||||
<LoaderThreeDots Loading="Working"/>
|
||||
<LoaderThreeDots />
|
||||
}
|
||||
|
|
59
Wonky.Client/Pages/CrmCompanyContactNewPage.razor
Normal file
59
Wonky.Client/Pages/CrmCompanyContactNewPage.razor
Normal file
|
@ -0,0 +1,59 @@
|
|||
@page "/companies/{CompanyId}/contacts/new"
|
||||
<h3>Ny kontakt</h3>
|
||||
|
||||
<EditForm EditContext="ContactContext" OnValidSubmit="SubmitContactForm">
|
||||
<DataAnnotationsValidator/>
|
||||
<InputText type="hidden" id="companyId" @bind-Value="CompanyId"/>
|
||||
<table class="table">
|
||||
<thead>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th class="align-middle" scope="row">
|
||||
JobTitel
|
||||
</th>
|
||||
<td class="align-middle">
|
||||
<InputText id="jobTitle" class="form-control" @bind-Value="Contact.JobTitle"/>
|
||||
<ValidationMessage For="@(() => Contact.JobTitle)"></ValidationMessage>
|
||||
</td>
|
||||
<th class="align-middle" scope="row">
|
||||
Email
|
||||
</th>
|
||||
<td class="align-middle">
|
||||
<InputText id="email" class="form-control" @bind-Value="Contact.Email"/>
|
||||
<ValidationMessage For="@(() => Contact.Email)"></ValidationMessage>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="align-middle" scope="row">Fornavn</th>
|
||||
<td class="align-middle">
|
||||
<InputText id="firstName" class="form-control" @bind-Value="Contact.FirstName"/>
|
||||
<ValidationMessage For="@(() => Contact.FirstName)"></ValidationMessage>
|
||||
</td>
|
||||
<th class="align-middle" scope="row">Efternavn</th>
|
||||
<td class="align-middle">
|
||||
<InputText id="lastName" class="form-control" @bind-Value="Contact.LastName"/>
|
||||
<ValidationMessage For="@(() => Contact.LastName)"></ValidationMessage>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="align-middle" scope="row">Mobile</th>
|
||||
<td class="align-middle">
|
||||
<InputText id="mobile" class="form-control" @bind-Value="Contact.Mobile"/>
|
||||
<ValidationMessage For="@(() => Contact.Mobile)"></ValidationMessage>
|
||||
</td>
|
||||
<th class="align-middle" scope="row">Telefon</th>
|
||||
<td class="align-middle">
|
||||
<InputText id="phone" class="form-control" @bind-Value="Contact.Phone"/>
|
||||
<ValidationMessage For="@(() => Contact.Phone)"></ValidationMessage>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="row mb-2">
|
||||
<div class="col-md-8"></div>
|
||||
<div class="col-md-4">
|
||||
<button type="submit" class="btn btn-success" disabled="@FormInvalid">Opret</button>
|
||||
</div>
|
||||
</div>
|
||||
</EditForm>
|
19
Wonky.Client/Pages/CrmCompanyContactNewPage.razor.cs
Normal file
19
Wonky.Client/Pages/CrmCompanyContactNewPage.razor.cs
Normal file
|
@ -0,0 +1,19 @@
|
|||
using Microsoft.AspNetCore.Components;
|
||||
using Microsoft.AspNetCore.Components.Forms;
|
||||
using Wonky.Entity.DTO;
|
||||
|
||||
namespace Wonky.Client.Pages;
|
||||
|
||||
public partial class CrmCompanyContactNewPage
|
||||
{
|
||||
[Parameter] public string CompanyId { get; set; } = "";
|
||||
|
||||
private EditContext ContactContext { get; set; }
|
||||
private ContactDto Contact { get; set; } = new();
|
||||
private bool FormInvalid { get; set; } = true;
|
||||
|
||||
private async Task SubmitContactForm()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
|
@ -30,7 +30,7 @@
|
|||
</div>
|
||||
@if (Loading)
|
||||
{
|
||||
<LoaderThreeDots Loading="Loading"/>
|
||||
<LoaderThreeDots />
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -36,8 +36,8 @@ public partial class CrmCompanyInventoryPage : IDisposable
|
|||
private CompanyDto Company { get; set; } = new();
|
||||
private List<ProductInventoryView>? Inventory { get; set; }
|
||||
private bool Loading { get; set; } = true;
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
|
||||
protected override async Task OnParametersSetAsync()
|
||||
{
|
||||
Interceptor.RegisterEvent();
|
||||
Interceptor.RegisterBeforeSendEvent();
|
||||
|
@ -46,10 +46,9 @@ public partial class CrmCompanyInventoryPage : IDisposable
|
|||
|
||||
await RefreshHistory();
|
||||
}
|
||||
|
||||
|
||||
private async Task RefreshHistory()
|
||||
{
|
||||
await CrmHistoryRepo.RpcSyncErpToCrm(CompanyId, Company.HistorySync);
|
||||
Toaster.ShowInfo("Arbejder på sagen ...", "Vent venligst");
|
||||
Inventory = await CrmHistoryRepo.FetchInventory(CompanyId);
|
||||
Inventory = Inventory?.OrderBy(x => x.Description).ToList();
|
||||
|
|
|
@ -1,19 +1,22 @@
|
|||
@page "/companies/{CompanyId}/invoices"
|
||||
@using Wonky.Client.Components
|
||||
<div class="row pt-2 pb-2 rounded-2 bg-dark text-white">
|
||||
<div class="col-6">
|
||||
<h3>@Company.Name</h3>
|
||||
</div>
|
||||
<div class="col-6 align-content-end">
|
||||
<a class="btn btn-primary" href="/companies/@Company.CompanyId">Kundekort</a>
|
||||
<a class="btn btn-primary" href="/companies/@Company.CompanyId/activities/new">Besøg</a>
|
||||
</div>
|
||||
</div>
|
||||
@if (Loading)
|
||||
@if (!string.IsNullOrWhiteSpace(Company.Name))
|
||||
{
|
||||
<LoaderThreeDots Loading="Loading"/>
|
||||
<div class="row pt-2 pb-2 rounded-2 bg-dark text-white">
|
||||
<div class="col-6">
|
||||
<h3>@Company.Name</h3>
|
||||
</div>
|
||||
<div class="col-6 align-content-end">
|
||||
<a class="btn btn-primary" href="/companies/@Company.CompanyId">Kundekort</a>
|
||||
<a class="btn btn-primary" href="/companies/@Company.CompanyId/activities/new">Besøg</a>
|
||||
</div>
|
||||
</div>
|
||||
<InvoiceTableComponent CompanyId="@CompanyId" InvoiceList="@History.Invoices"/>
|
||||
}
|
||||
else
|
||||
{
|
||||
<InvoiceTableComponent InvoiceList="@History.InvoiceList" />
|
||||
}
|
||||
@if (Loading)
|
||||
{
|
||||
<LoaderThreeDots />
|
||||
}
|
||||
}
|
|
@ -18,26 +18,27 @@ public partial class CrmCompanyInvoiceListPage : IDisposable
|
|||
[Inject] public IToastService Toaster { get; set; }
|
||||
|
||||
private InvoiceListView History { get; set; } = new();
|
||||
private CompanyDto Company { get; set; }
|
||||
private CompanyDto Company { get; set; } = new();
|
||||
private bool Loading { get; set; } = true;
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
protected override async Task OnParametersSetAsync()
|
||||
{
|
||||
Interceptor.RegisterEvent();
|
||||
Interceptor.RegisterBeforeSendEvent();
|
||||
|
||||
Company = await CompanyRepo.GetCompanyById(CompanyId);
|
||||
await RefreshHistory();
|
||||
}
|
||||
|
||||
private async Task RefreshHistory()
|
||||
await GetInvoices();
|
||||
}
|
||||
|
||||
private async Task GetInvoices()
|
||||
{
|
||||
Toaster.ShowInfo("Arbejder på sagen ...", "Vent venligst");
|
||||
await HistoryRepo.RpcSyncErpToCrm(CompanyId, Company.HistorySync);
|
||||
History = await HistoryRepo.FetchInvoiceList(CompanyId);
|
||||
Loading = false;
|
||||
Toaster.ClearAll();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
Interceptor.DisposeEvent();
|
||||
|
|
|
@ -247,7 +247,7 @@
|
|||
}
|
||||
else
|
||||
{
|
||||
<LoaderThreeDots/>
|
||||
<LoaderThreeDots />
|
||||
}
|
||||
|
||||
<VatLookupDkModal VatAddress="_vatAddress" OnSelectedCompany="OnSelectedCompany" @ref="_vatLookupModal"/>
|
|
@ -38,11 +38,11 @@ namespace Wonky.Client.Pages;
|
|||
public partial class CrmCompanyViewPage : IDisposable
|
||||
{
|
||||
[Parameter] public string CompanyId { get; set; } = "";
|
||||
[Inject] public IToastService _toast { get; set; }
|
||||
[Inject] public IToastService Toaster { get; set; }
|
||||
[Inject] public ILogger<CrmCompanyViewPage> _logger { get; set; }
|
||||
[Inject] public NavigationManager _navigator { get; set; }
|
||||
[Inject] public ICrmCompanyHttpRepository _companyRepo { get; set; }
|
||||
[Inject] public ICrmHistoryHttpRepository CrmHistoryRepo { get; set; }
|
||||
[Inject] public ICrmHistoryHttpRepository HistoryRepo { get; set; }
|
||||
[Inject] public HttpInterceptorService _interceptor { get; set; }
|
||||
[Inject] public VatInfoLookupService _vatService { get; set; }
|
||||
[Inject] public ILocalStorageService _storage { get; set; }
|
||||
|
@ -68,25 +68,22 @@ public partial class CrmCompanyViewPage : IDisposable
|
|||
private bool _dk { get; set; } = true;
|
||||
private int _isDirty { get; set; }
|
||||
private int _vatUpdated { get; set; }
|
||||
private bool _blocked { get; set; } = true;
|
||||
private bool Loading { get; set; } = true;
|
||||
|
||||
private VatLookupDkModal _vatLookupModal { get; set; } = new();
|
||||
|
||||
private readonly JsonSerializerOptions _options = new ()
|
||||
{
|
||||
PropertyNameCaseInsensitive = true
|
||||
};
|
||||
private readonly JsonSerializerOptions _options = new () { PropertyNameCaseInsensitive = true };
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
var ux = await _storage.GetItemAsync<UserInfoView>("_xu");
|
||||
_countryCode = ux.CountryCode;
|
||||
_dk = ux.CountryCode.ToLower() == "dk";
|
||||
|
||||
Company = await _companyRepo.GetCompanyById(CompanyId);
|
||||
_interceptor.RegisterEvent();
|
||||
_interceptor.RegisterBeforeSendEvent();
|
||||
|
||||
Company = await _companyRepo.GetCompanyById(CompanyId);
|
||||
// Company = await _companyRepo.GetCompanyById(CompanyId);
|
||||
_orgVat = Company.VatNumber;
|
||||
Company.CountryCode = ux.CountryCode.ToLower();
|
||||
_enableActivity = Company.ValidVat;
|
||||
|
@ -130,12 +127,20 @@ public partial class CrmCompanyViewPage : IDisposable
|
|||
_editContext = new EditContext(Company);
|
||||
_editContext.OnFieldChanged += HandleFieldChanged;
|
||||
_editContext.OnValidationStateChanged += ValidationChanged;
|
||||
|
||||
await SyncCompanyHistory();
|
||||
}
|
||||
|
||||
private void ForceActivity()
|
||||
{
|
||||
_enableActivity = _enableActivity == 0 ? 1 : 0;
|
||||
}
|
||||
|
||||
private async Task SyncCompanyHistory()
|
||||
{
|
||||
await HistoryRepo.RpcSyncErpToCrm(CompanyId, Company.HistorySync);
|
||||
}
|
||||
|
||||
private void HandleFieldChanged(object sender, FieldChangedEventArgs e)
|
||||
{
|
||||
_nextVisit = _lastVisit.AddDays(Company.Interval * 7);
|
||||
|
@ -174,11 +179,11 @@ public partial class CrmCompanyViewPage : IDisposable
|
|||
// simple format validation if CRM indicates invalid vatNumber
|
||||
if (!VatUtils.ValidateFormat(Company.CountryCode, Company.VatNumber))
|
||||
{
|
||||
_toast.ShowError($"CVR/VAT/ORG nummer mangler eller er ugyldig.");
|
||||
Toaster.ShowError($"CVR/VAT/ORG nummer mangler eller er ugyldig.");
|
||||
StateHasChanged();
|
||||
return;
|
||||
}
|
||||
_toast.ShowInfo("Vent venligst ....");
|
||||
Toaster.ShowInfo("Vent venligst ....");
|
||||
//_hideButtons = true;
|
||||
Company.LastVisit = $"{_lastVisit:yyyy-MM-dd}";
|
||||
Company.NextVisit = $"{_nextVisit:yyyy-MM-dd}";
|
||||
|
@ -191,7 +196,7 @@ public partial class CrmCompanyViewPage : IDisposable
|
|||
Company.IsDirty = _isDirty;
|
||||
|
||||
var success = await _companyRepo.UpdateCompany(CompanyId, Company );
|
||||
_toast.ShowSuccess("Opdatering er afsendt. Der går nogle minutter inden data er opdateret.");
|
||||
Toaster.ShowSuccess("Opdatering er afsendt. Der går nogle minutter inden data er opdateret.");
|
||||
Company = await _companyRepo.GetCompanyById(Company.CompanyId);
|
||||
Company.ValidVat = 1;
|
||||
_enableActivity = 1;
|
||||
|
@ -201,11 +206,12 @@ public partial class CrmCompanyViewPage : IDisposable
|
|||
}
|
||||
StateHasChanged();
|
||||
_working = false;
|
||||
Toaster.ClearAll();
|
||||
}
|
||||
|
||||
private async Task GetInfoFromAddress(VatAddress address)
|
||||
{
|
||||
_toast.ShowInfo("Vent for adresse info ...");
|
||||
Toaster.ShowInfo("Vent for adresse info ...");
|
||||
_vInfos = await _vatService.QueryVirkRegistry(
|
||||
new VirkParams
|
||||
{
|
||||
|
@ -215,7 +221,7 @@ public partial class CrmCompanyViewPage : IDisposable
|
|||
});
|
||||
if (!_vInfos.Any())
|
||||
{
|
||||
_toast.ShowWarning($"Ingen data fundet ...");
|
||||
Toaster.ShowWarning($"Ingen data fundet ...");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -53,6 +53,9 @@ public partial class CrmTaskItemListPage : IDisposable
|
|||
{
|
||||
Toaster.ShowInfo("Vent nogle sekunder for data");
|
||||
TaskItems = await TaskItemRepo.GetTaskList(workDate);
|
||||
|
||||
Toaster.ClearAll();
|
||||
|
||||
}
|
||||
public void Dispose()
|
||||
{
|
||||
|
|
103
Wonky.Client/Shared/InvoiceViewModal.razor
Normal file
103
Wonky.Client/Shared/InvoiceViewModal.razor
Normal file
|
@ -0,0 +1,103 @@
|
|||
@*
|
||||
// Copyright (C) 2022 FCS Frede's Computer Services.
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see [https://www.gnu.org/licenses/agpl-3.0.en.html]
|
||||
//
|
||||
*@
|
||||
@using Wonky.Client.Components
|
||||
@using Wonky.Client.Helpers
|
||||
<div class="modal" tabindex="-1" role="dialog" style="display:@_modalDisplay">
|
||||
<div class="modal-dialog modal-dialog-scrollable modal-lg modal-xl">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">Faktura</h5>
|
||||
<button type="button" class="btn-close" @onclick="Hide" data-bs-dismiss="modal" aria-label="Luk"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
@if (!string.IsNullOrWhiteSpace(Invoice.Company.Name))
|
||||
{
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row">Dato</th>
|
||||
<td>@Invoice.DocumentDate</td>
|
||||
<th scope="row">Faktura nr.</th>
|
||||
<td>@Invoice.DocumentNumber</td>
|
||||
<td colspan="2"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">Konto</th>
|
||||
<td>@Invoice.Account</td>
|
||||
<th scope="row">Moms Nr.</th>
|
||||
<td>@Invoice.VatNumber</td>
|
||||
<td colspan="2"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">Eordre</th>
|
||||
<td>@Invoice.ESalesNumber</td>
|
||||
<th scope="row">Vores Ref.</th>
|
||||
<td>@Invoice.OurRef</td>
|
||||
<td colspan="2"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">Rekv.</th>
|
||||
<td>@Invoice.ReferenceNumber</td>
|
||||
<th scope="row">Deres Ref.</th>
|
||||
<td>@Invoice.YourRef</td>
|
||||
<th scope="row">Pakke nr.</th>
|
||||
<td>@Invoice.TrackingNumber</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">Notat</th>
|
||||
<td class="fw-bold" colspan="5">@Invoice.OrderNote</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Varenr</th>
|
||||
<th scope="col">Beskrivelse</th>
|
||||
<th class="text-end" scope="col">Antal</th>
|
||||
<th class="text-end" scope="col">Pris</th>
|
||||
<th class="text-end" scope="col">Rabat</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var line in Invoice.Lines)
|
||||
{
|
||||
<tr>
|
||||
<td>@line.Sku</td>
|
||||
<td>@line.Text</td>
|
||||
<td class="text-end">@line.Qty</td>
|
||||
<td class="text-end">@line.Price</td>
|
||||
<td class="text-end">@line.Discount</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span>Ingen data</span>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@if (_showBackdrop)
|
||||
{
|
||||
<div class="modal-backdrop fade show"></div>
|
||||
}
|
66
Wonky.Client/Shared/InvoiceViewModal.razor.cs
Normal file
66
Wonky.Client/Shared/InvoiceViewModal.razor.cs
Normal file
|
@ -0,0 +1,66 @@
|
|||
// Copyright (C) 2022 FCS Frede's Computer Services.
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see [https://www.gnu.org/licenses/agpl-3.0.en.html]
|
||||
//
|
||||
|
||||
using System.Text.Json;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using Wonky.Client.HttpInterceptors;
|
||||
using Wonky.Client.HttpInterfaces;
|
||||
using Wonky.Client.HttpRepository;
|
||||
using Wonky.Client.Models;
|
||||
using Wonky.Client.Services;
|
||||
using Wonky.Entity.Requests;
|
||||
using Wonky.Entity.Views;
|
||||
|
||||
namespace Wonky.Client.Shared;
|
||||
|
||||
public partial class InvoiceViewModal : IDisposable
|
||||
{
|
||||
[Parameter] public string CompanyId { get; set; } = "";
|
||||
[Parameter] public string InvoiceId { get; set; } = "";
|
||||
[Inject] public HttpInterceptorService Interceptor { get; set; }
|
||||
[Inject] public ICrmHistoryHttpRepository HistoryRepo { get; set; }
|
||||
private string _modalDisplay = "";
|
||||
private bool _showBackdrop;
|
||||
private InvoiceView Invoice { get; set; } = new();
|
||||
|
||||
protected override async Task OnParametersSetAsync()
|
||||
{
|
||||
Console.WriteLine($"CompanyId => {CompanyId}");
|
||||
Console.WriteLine($"InvoiceId => {InvoiceId}");
|
||||
Interceptor.RegisterEvent();
|
||||
Interceptor.RegisterBeforeSendEvent();
|
||||
|
||||
Console.WriteLine("Getting invoice");
|
||||
Invoice = await HistoryRepo.FetchInvoice(CompanyId, InvoiceId);
|
||||
Console.WriteLine($"Invoice => {JsonSerializer.Serialize(Invoice)}");
|
||||
}
|
||||
|
||||
|
||||
public void Show()
|
||||
{
|
||||
_modalDisplay = "block;";
|
||||
_showBackdrop = true;
|
||||
StateHasChanged();
|
||||
}
|
||||
|
||||
private void Hide()
|
||||
{
|
||||
_modalDisplay = "none;";
|
||||
_showBackdrop = false;
|
||||
StateHasChanged();
|
||||
}
|
||||
|
||||
public void Dispose() => Interceptor.DisposeEvent();
|
||||
}
|
|
@ -1,13 +1,13 @@
|
|||
{
|
||||
"appInfo": {
|
||||
"name": "Wonky Client",
|
||||
"version": "0.38.3",
|
||||
"version": "0.41.1",
|
||||
"rc": true,
|
||||
"sandBox": false,
|
||||
"image": "grumpy-coder.png"
|
||||
},
|
||||
"apiConfig": {
|
||||
"innoBaseUrl": "https://zeta.innotec.dk",
|
||||
"innoBaseUrl": "https://eta.innotec.dk",
|
||||
"glsTrackUrl": "https://www.gls-group.eu/276-I-PORTAL-WEB/content/GLS/DK01/DA/5004.htm?txtAction=71000&txtRefNo=",
|
||||
"glsId": "",
|
||||
"serviceVirk": "api/v2/services/virk",
|
||||
|
@ -22,7 +22,7 @@
|
|||
"crmCustomers": "api/v2/crm/companies",
|
||||
"crmInventory": "history/inventory",
|
||||
"crmProducts": "history/products",
|
||||
"crmSync": "history/sync",
|
||||
"crmSync": "invoices/sync",
|
||||
"crmWorkplaces": "workplaces",
|
||||
"officeAdvisors": "api/v2/office/users/advisors",
|
||||
"officeUsers": "api/v2/office/users/admin",
|
||||
|
|
|
@ -170,7 +170,9 @@ footer.version {
|
|||
}
|
||||
.report-main {
|
||||
font-size: 10px;
|
||||
break-before: page;
|
||||
break-after: page;
|
||||
page-break-after: always;
|
||||
height: initial;
|
||||
border: initial;
|
||||
border-radius: initial;
|
||||
|
@ -181,6 +183,8 @@ footer.version {
|
|||
color-adjust: exact;
|
||||
}
|
||||
.report-visit {
|
||||
page-break-before: always;
|
||||
break-after: page;
|
||||
break-before: page;
|
||||
break-inside: avoid-page;
|
||||
height: initial;
|
||||
|
@ -195,5 +199,8 @@ footer.version {
|
|||
.distance-ledger {}
|
||||
.report-ledger {
|
||||
page-break-inside: avoid;
|
||||
page-break-after: always;
|
||||
break-after: recto;
|
||||
min-height: 300px;
|
||||
}
|
||||
}
|
|
@ -2,7 +2,7 @@
|
|||
<html lang="da">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Inno Web CRM</title>
|
||||
<title>Innotec WWO</title>
|
||||
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
|
||||
<meta http-equiv="Pragma" content="no-cache" />
|
||||
<meta http-equiv="Expires" content="0" />
|
||||
|
@ -17,7 +17,7 @@
|
|||
<link href="bootstrap/css/bootstrap.min.css" rel="stylesheet" />
|
||||
<link href="bootstrap/css/bootstrap-icons.css" rel="stylesheet" />
|
||||
<link href="flag-icons/flag-icons.css" rel="stylesheet" />
|
||||
<link href="css/app-v0.26.css" rel="stylesheet" />
|
||||
<link href="css/app-v0.38.css" rel="stylesheet" />
|
||||
<link href="Wonky.Client.styles.css" rel="stylesheet" />
|
||||
<link href="_content/Blazored.Toast/blazored-toast.min.css" rel="stylesheet" />
|
||||
</head>
|
||||
|
|
29
Wonky.Entity/DTO/ContactDto.cs
Normal file
29
Wonky.Entity/DTO/ContactDto.cs
Normal file
|
@ -0,0 +1,29 @@
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Wonky.Entity.DTO;
|
||||
|
||||
public class ContactDto
|
||||
{
|
||||
[Required(ErrorMessage = "CompanyId")]
|
||||
[MaxLength(128, ErrorMessage = "CompanyId mangler")]
|
||||
public string CompanyId { get; set; } = "";
|
||||
|
||||
[Required(ErrorMessage = "Fornavn skal udfyldes.")]
|
||||
[MaxLength(30, ErrorMessage = "Du kan højst bruge 30 tegn")]
|
||||
public string FirstName { get; set; } = "";
|
||||
|
||||
[MaxLength(50, ErrorMessage = "Du kan højst bruge 50 tegn.")]
|
||||
public string JobTitle { get; set; } = "";
|
||||
|
||||
[MaxLength(30, ErrorMessage = "Du kan højst bruge 30 tegn.")]
|
||||
public string LastName { get; set; } = "";
|
||||
|
||||
[MaxLength(80, ErrorMessage = "Du kan højst bruge 80 tegn.")]
|
||||
public string Email { get; set; } = "";
|
||||
|
||||
[MaxLength(30, ErrorMessage = "Du kan højst bruge 30 tegn.")]
|
||||
public string Phone { get; set; } = "";
|
||||
|
||||
[MaxLength(30, ErrorMessage = "Du kan højst bruge 30 tegn.")]
|
||||
public string Mobile { get; set; } = "";
|
||||
}
|
|
@ -4,7 +4,7 @@ public class InvoiceLineView
|
|||
{
|
||||
public string Sku { get; set; } = "";
|
||||
public string Text { get; set; } = "";
|
||||
public int Qty { get; set; }
|
||||
public decimal Price { get; set; }
|
||||
public decimal Discount { get; set; }
|
||||
public string Qty { get; set; } = "";
|
||||
public string Price { get; set; } = "";
|
||||
public string Discount { get; set; } = "";
|
||||
}
|
|
@ -10,5 +10,5 @@ public class InvoiceListItemView
|
|||
public string OrderNote { get; set; } = "";
|
||||
public string TrackingNumber { get; set; } = "";
|
||||
public string DocumentDate { get; set; } = "";
|
||||
public decimal InvoiceAmount { get; set; }
|
||||
public string InvoiceAmount { get; set; } = "";
|
||||
}
|
|
@ -3,5 +3,5 @@ namespace Wonky.Entity.Views;
|
|||
public class InvoiceListView
|
||||
{
|
||||
public InvoiceCompanyView Company { get; set; } = new();
|
||||
public List<InvoiceListItemView> InvoiceList { get; set; } = new();
|
||||
public List<InvoiceListItemView> Invoices { get; set; } = new();
|
||||
}
|
|
@ -8,7 +8,7 @@ public class InvoiceView
|
|||
public string DocumentDate { get; set; } = "";
|
||||
public string DocumentNumber { get; set; } = "";
|
||||
public string ESalesNumber { get; set; } = "";
|
||||
public decimal InvoiceAmount { get; set; }
|
||||
public string InvoiceAmount { get; set; } = "";
|
||||
public string OrderNote { get; set; } = "";
|
||||
public string OurRef { get; set; } = "";
|
||||
public string ReferenceNumber { get; set; } = "";
|
||||
|
|
Loading…
Reference in a new issue