This commit is contained in:
Frede Hundewadt 2022-07-09 08:42:38 +02:00
parent 16fa047942
commit 56bd2d25a7
18 changed files with 121 additions and 153 deletions

View file

@ -49,6 +49,7 @@ public partial class ItemSearchComponent : IDisposable
_preferenceService.OnChange += ProfileServiceOnOnChange; _preferenceService.OnChange += ProfileServiceOnOnChange;
_preferences = await _preferenceService.GetPreferences(); _preferences = await _preferenceService.GetPreferences();
_selectedItem = _preferences.ItemSearch; _selectedItem = _preferences.ItemSearch;
await OnChanged.InvokeAsync(_selectedItem);
} }
/// <summary> /// <summary>

View file

@ -17,98 +17,99 @@
@using Wonky.Entity.Views @using Wonky.Entity.Views
@* <table class="table table-sm table-striped table-bordered d-print-table"> *@ <div class="report-page d-block">
<table class="table table-sm table-striped table-bordered"> <table class="table table-sm table-striped table-bordered d-print-table">
<thead> <thead>
<tr class="bg-light text-black"> <tr class="bg-light text-black">
<th colspan="4"> <th colspan="4">
<h3 class="text-center">Ordre @ReportItem.ESalesNumber</h3> <h2 class="text-center">@ReportItem.Company.Name</h2>
</th> </th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">Dato</th>
<td>@ReportItem.OrderDate</td>
<th scope="row">Konto</th>
<td>@ReportItem.Company.Account</td>
</tr>
<tr>
<th scope="col">Telefon</th>
<td>@ReportItem.Company.Phone</td>
<th scope="col">Køber</th>
<td>@ReportItem.YourRef</td>
</tr>
<tr>
<th scope="col">CVR/VAT</th>
<td>@ReportItem.Company.VatNumber</td>
<th scope="col">Rekvisition</th>
<td>@ReportItem.ReferenceNumber</td>
</tr>
<tr>
<th scope="col">Navn</th>
<td>@ReportItem.Company.Name</td>
<th scope="col">Lev.Navn</th>
<td>@ReportItem.DlvName</td>
</tr>
<tr>
<th scope="col">Adresse</th>
<td>@ReportItem.Company.Address1</td>
<th scope="col">Lev.Adresse</th>
<td>@ReportItem.DlvAddress1</td>
</tr>
<tr>
<th scope="col">Adresse</th>
<td>@ReportItem.Company.Address2</td>
<th scope="col">Lev.Adresse</th>
<td>@ReportItem.DlvAddress2</td>
</tr>
<tr>
<th scope="col">Postnr By</th>
<td>@ReportItem.Company.ZipCode @ReportItem.Company.City</td>
<th scope="col">Lev.Postnr By</th>
<td>@ReportItem.DlvZipCity</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-striped table-bordered">
<thead>
<tr class="bg-light text-black">
<th scope="col">Antal</th>
<th scope="col">Varnr</th>
<th scope="col">Beskrivelse</th>
<th class="text-end" scope="col">Pris</th>
<th class="text-end" scope="col">R%</th>
<th class="text-end" scope="col">Beløb</th>
</tr>
</thead>
<tbody>
@foreach (var line in ReportItem.Lines)
{
<tr>
<td>@line.Quantity</td>
<td>@line.Sku</td>
<td>@line.Description</td>
<td class="text-end">@($"{line.Price:N2}")</td>
<td class="text-end">@($"{line.Discount:N2}")</td>
<td class="text-end">@($"{line.LineSum:N2}")</td>
</tr> </tr>
</thead>
<tbody>
<tr>
<th scope="row">Dato</th>
<td>@ReportItem.OrderDate</td>
<th scope="row">Konto</th>
<td>@ReportItem.Company.Account</td>
</tr>
<tr>
<th scope="col">Telefon</th>
<td>@ReportItem.Company.Phone</td>
<th scope="col">Køber</th>
<td>@ReportItem.YourRef</td>
</tr>
<tr>
<th scope="col">CVR/VAT</th>
<td>@ReportItem.Company.VatNumber</td>
<th scope="col">Rekvisition</th>
<td>@ReportItem.ReferenceNumber</td>
</tr>
<tr>
<th scope="col">Navn</th>
<td>@ReportItem.Company.Name</td>
<th scope="col">Lev.Navn</th>
<td>@ReportItem.DlvName</td>
</tr>
<tr>
<th scope="col">Adresse</th>
<td>@ReportItem.Company.Address1</td>
<th scope="col">Lev.Adresse</th>
<td>@ReportItem.DlvAddress1</td>
</tr>
<tr>
<th scope="col">Adresse</th>
<td>@ReportItem.Company.Address2</td>
<th scope="col">Lev.Adresse</th>
<td>@ReportItem.DlvAddress2</td>
</tr>
<tr>
<th scope="col">Postnr By</th>
<td>@ReportItem.Company.ZipCode @ReportItem.Company.City</td>
<th scope="col">Lev.Postnr By</th>
<td>@ReportItem.DlvZipCity</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-striped table-bordered">
<thead>
<tr class="bg-light text-black">
<th scope="col">Antal</th>
<th scope="col">Varnr</th>
<th scope="col">Beskrivelse</th>
<th class="text-end" scope="col">Pris</th>
<th class="text-end" scope="col">R%</th>
<th class="text-end" scope="col">Beløb</th>
</tr>
</thead>
<tbody>
@foreach (var line in ReportItem.Lines)
{
<tr>
<td>@line.Quantity</td>
<td>@line.Sku</td>
<td>@line.Description</td>
<td class="text-end">@($"{line.Price:N2}")</td>
<td class="text-end">@($"{line.Discount:N2}")</td>
<td class="text-end">@($"{line.LineSum:N2}")</td>
</tr>
}
<tr>
<td colspan="4"></td>
<td>Ordresum</td>
<td class="text-end">@ReportItem.OrderAmount</td>
</tr>
</tbody>
</table>
@if (!string.IsNullOrWhiteSpace(@ReportItem.OfficeNote))
{
<div class="alert alert-dark d-print-block">
<h4 class="text-center">
@ReportItem.OfficeNote
</h4>
</div>
} }
<tr> </div>
<td colspan="4"></td>
<td>Ordresum</td>
<td class="text-end">@ReportItem.OrderAmount</td>
</tr>
</tbody>
</table>
@if (!string.IsNullOrWhiteSpace(@ReportItem.OfficeNote))
{
<div class="alert alert-dark d-print-block">
<h4 class="text-center">
@ReportItem.OfficeNote
</h4>
</div>
}
@code{ @code{

View file

@ -17,7 +17,7 @@
<div class="input-group"> <div class="input-group">
<input id="search-input" type="text" class="form-control" placeholder="Søg ..." aria-described-by="search-addon" <input id="search-input" type="text" class="form-control" placeholder="Søg ..." aria-described-by="search-addon"
@bind-value="@SearchTerm" @bind-value:event="oninput" @onkeyup="OnSearchChanged"/> @bind-value="@_searchTerm" @bind-value:event="oninput" @onkeyup="OnSearchChanged"/>
<span class="input-group-text" id="search-addon"><i class="oi oi-delete" @onclick="ClearSearch"></i></span> <span class="input-group-text" id="search-addon"><i class="oi oi-delete" @onclick="ClearSearch"></i></span>
</div> </div>

View file

@ -23,27 +23,24 @@ namespace Wonky.Client.Components
public partial class SearchPhraseComponent public partial class SearchPhraseComponent
{ {
private Timer _timer = new(); private Timer _timer = new();
private string SearchTerm { get; set; } = ""; private string _searchTerm { get; set; } = "";
[Parameter] public EventCallback<string> OnChanged { get; set; } [Parameter] public EventCallback<string> OnChanged { get; set; }
[Parameter] public string SavedSearch { get; set; } = string.Empty; [Parameter] public string SavedSearch { get; set; } = string.Empty;
protected override void OnParametersSet()
{
if (!string.IsNullOrWhiteSpace(SavedSearch))
SearchTerm = SavedSearch;
}
protected override void OnInitialized() protected override void OnInitialized()
{ {
if(!string.IsNullOrWhiteSpace(SavedSearch)) if (string.IsNullOrWhiteSpace(SavedSearch))
OnSearchChanged(); return;
_searchTerm = SavedSearch;
OnSearchChanged();
} }
private void ClearSearch() private void ClearSearch()
{ {
SavedSearch = string.Empty; SavedSearch = string.Empty;
SearchTerm = string.Empty; _searchTerm = string.Empty;
OnChanged.InvokeAsync(SearchTerm); OnChanged.InvokeAsync(_searchTerm);
} }
private void OnSearchChanged() private void OnSearchChanged()
@ -56,7 +53,7 @@ namespace Wonky.Client.Components
private void OnTimerElapsed(object? sender, ElapsedEventArgs e) private void OnTimerElapsed(object? sender, ElapsedEventArgs e)
{ {
OnChanged.InvokeAsync(SearchTerm); OnChanged.InvokeAsync(_searchTerm);
_timer.Enabled = false; _timer.Enabled = false;
_timer.Dispose(); _timer.Dispose();
} }

View file

@ -214,6 +214,7 @@ public partial class ActivityNewVisitPage : IDisposable
{ {
InvalidActivityType = string.IsNullOrWhiteSpace(_draft.ActivityTypeEnum); InvalidActivityType = string.IsNullOrWhiteSpace(_draft.ActivityTypeEnum);
} }
private async Task DeleteDraft() private async Task DeleteDraft()
{ {
await DraftStateProvider.DeleteDraftAsync(); await DraftStateProvider.DeleteDraftAsync();

View file

@ -21,7 +21,7 @@ using Wonky.Entity.Views;
namespace Wonky.Client.Pages; namespace Wonky.Client.Pages;
public partial class AdminSalesReportListPage : IDisposable public partial class AdminReportListPage : IDisposable
{ {
[Parameter] public string UserId { get; set; } = ""; [Parameter] public string UserId { get; set; } = "";
[Parameter] public string CountryCode { get; set; } = ""; [Parameter] public string CountryCode { get; set; } = "";

View file

@ -66,8 +66,6 @@
{ {
@foreach (var item in _items) @foreach (var item in _items)
{ {
<div class="report-page"> <ReportItemComponent ReportItem="@item"></ReportItemComponent>
<ReportItemComponent ReportItem="@item"></ReportItemComponent>
</div>
} }
} }

View file

@ -21,7 +21,7 @@ using Wonky.Entity.Views;
namespace Wonky.Client.Pages; namespace Wonky.Client.Pages;
public partial class AdminViewSalesReportPage : IDisposable public partial class AdminReportViewPage : IDisposable
{ {
/// <summary> /// <summary>
/// Country code from url parameter /// Country code from url parameter

View file

@ -21,7 +21,7 @@ using Wonky.Entity.Views;
namespace Wonky.Client.Pages; namespace Wonky.Client.Pages;
public partial class SalesReportListPage : IDisposable public partial class AdviserReportListPage : IDisposable
{ {
[Inject] private IReportHttpRepository _reportRepo { get; set; } [Inject] private IReportHttpRepository _reportRepo { get; set; }
[Inject] private HttpInterceptorService _interceptor { get; set; } [Inject] private HttpInterceptorService _interceptor { get; set; }

View file

@ -29,14 +29,14 @@ using Wonky.Entity.Views;
namespace Wonky.Client.Pages; namespace Wonky.Client.Pages;
public partial class SalesReportNewPage : IDisposable public partial class AdviserReportNewPage : IDisposable
{ {
[Inject] private HttpInterceptorService _interceptor { get; set; } [Inject] private HttpInterceptorService _interceptor { get; set; }
[Inject] private UserPreferenceService _userPrefs { get; set; } [Inject] private UserPreferenceService _userPrefs { get; set; }
[Inject] private IActivityHttpRepository _activityRepo { get; set; } [Inject] private IActivityHttpRepository _activityRepo { get; set; }
[Inject] private IReportHttpRepository _reportRepo { get; set; } [Inject] private IReportHttpRepository _reportRepo { get; set; }
[Inject] private NavigationManager _navigator { get; set; } [Inject] private NavigationManager _navigator { get; set; }
[Inject] private ILogger<SalesReportNewPage> _logger { get; set; } [Inject] private ILogger<AdviserReportNewPage> _logger { get; set; }
[Inject] private IToastService _toast { get; set; } [Inject] private IToastService _toast { get; set; }
private EditContext _editContext { get; set; } private EditContext _editContext { get; set; }
private ReportDto _report { get; set; } = new(); private ReportDto _report { get; set; } = new();

View file

@ -20,7 +20,7 @@
@page "/sales-reports/view/{ReportDate}" @page "/sales-reports/view/{ReportDate}"
@attribute [Authorize(Roles = "Adviser,Admin,Supervisor")] @attribute [Authorize(Roles = "Adviser,Admin,Supervisor")]
<div class="report-page"> <div class="report-page d-print-block">
<div class="row mb-3 d-print-none"> <div class="row mb-3 d-print-none">
<div class="col-md-6 align-content-center"> <div class="col-md-6 align-content-center">
<h3 class="workDate">@DateTime.Parse(ReportDate).ToLongDateString()</h3> <h3 class="workDate">@DateTime.Parse(ReportDate).ToLongDateString()</h3>
@ -36,10 +36,8 @@
@if (!string.IsNullOrWhiteSpace(_report.ReportData.DayTypeEnum)) @if (!string.IsNullOrWhiteSpace(_report.ReportData.DayTypeEnum))
{ {
<PageTitle>@_report.ReportData.Name</PageTitle> <PageTitle>@_report.ReportData.Name</PageTitle>
<div class="row"> <div class="alert bg-light text-dark text-center align-content-center">
<div class="col text-center align-content-center"> <h2>@_report.ReportData.Name</h2>
<h3>@_report.ReportData.Name</h3>
</div>
</div> </div>
<div class="row"> <div class="row">
<div class="w-75"> <div class="w-75">
@ -59,13 +57,10 @@
</div> </div>
} }
</div> </div>
@if (_items.Any()) @if (_items.Any())
{ {
@foreach (var item in _items) @foreach (var item in _items)
{ {
<div class="report-page"> <ReportItemComponent ReportItem="@item"></ReportItemComponent>
<ReportItemComponent ReportItem="@item"></ReportItemComponent>
</div>
} }
} }

View file

@ -20,7 +20,7 @@ using Wonky.Entity.Views;
namespace Wonky.Client.Pages; namespace Wonky.Client.Pages;
public partial class SalesReportViewPage public partial class AdviserReportViewPage
{ {
[Parameter] public string ReportDate { get; set; } [Parameter] public string ReportDate { get; set; }
[Inject] private IReportHttpRepository _reportRepo { get; set; } [Inject] private IReportHttpRepository _reportRepo { get; set; }

View file

@ -1,13 +1,13 @@
{ {
"appInfo": { "appInfo": {
"name": "Wonky Client", "name": "Wonky Client",
"version": "0.8.144", "version": "0.8.152",
"isBeta": false, "isBeta": false,
"sandBox": false, "sandBox": false,
"image": "grumpy-coder.png" "image": "grumpy-coder.png"
}, },
"apiConfig": { "apiConfig": {
"innoBaseUrl": "https://staging.innotec.dk", "innoBaseUrl": "https://production.innotec.dk",
"glsTrackUrl": "https://www.gls-group.eu/276-I-PORTAL-WEB/content/GLS/DK01/DA/5004.htm?txtAction=71000&txtRefNo=", "glsTrackUrl": "https://www.gls-group.eu/276-I-PORTAL-WEB/content/GLS/DK01/DA/5004.htm?txtAction=71000&txtRefNo=",
"glsId": "", "glsId": "",
"virkUrl": "api/v2/services/virk", "virkUrl": "api/v2/services/virk",

View file

@ -130,24 +130,6 @@ footer.version {
display: none; display: none;
} }
.report-page {
/* despite being deprecated
https://developer.mozilla.org/en-US/docs/Web/CSS/page-break-before
firefox documentation
https://developer.mozilla.org/en-US/docs/Web/CSS/break-before
firefox still needs this
*/
page-break-before: always;
page-break-after: always;
page-break-inside: avoid;
break-after: page;
break-before: page;
break-inside: avoid;
}
/* printer classes */ /* printer classes */
@media print { @media print {
@page { @page {
@ -164,18 +146,11 @@ footer.version {
color-adjust: exact; color-adjust: exact;
} }
.report-page { .report-page {
/* deprecated style properties */ /*break-before: page;*/
page-break-before: always;
page-break-after: always;
page-break-inside: avoid;
/* new style properties */
break-after: page; break-after: page;
break-before: page;
break-inside: avoid;
height: initial; height: initial;
font-size: 10px; /*font-size: 10px;*/
border: initial; border: initial;
border-radius: initial; border-radius: initial;
box-shadow: initial; box-shadow: initial;

View file

@ -13,7 +13,7 @@
<meta name="theme-color" content="#000"> <meta name="theme-color" content="#000">
<base href="/" /> <base href="/" />
<link href="bootstrap/css/bootstrap.min.css" rel="stylesheet"> <link href="bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="css/app-144.css" rel="stylesheet" /> <link href="css/app-152.css" rel="stylesheet" />
<link href="Wonky.Client.styles.css" rel="stylesheet" /> <link href="Wonky.Client.styles.css" rel="stylesheet" />
<link href="_content/Blazored.Toast/blazored-toast.min.css" rel="stylesheet" /> <link href="_content/Blazored.Toast/blazored-toast.min.css" rel="stylesheet" />
</head> </head>