testing v0.8.135-beta
This commit is contained in:
parent
e782e7cac2
commit
c27626f46e
25 changed files with 347 additions and 280 deletions
|
@ -20,61 +20,50 @@
|
||||||
|
|
||||||
@if (Companies.Any())
|
@if (Companies.Any())
|
||||||
{
|
{
|
||||||
<div class="list-group list-group-flush">
|
<table class="table table-striped">
|
||||||
<div class="list-group-item px-3 bg-black text-white opacity-75">
|
<thead>
|
||||||
<div class="row">
|
<tr>
|
||||||
<div class="col-sm-1 col-md-1">
|
<th scope="col">BS</th>
|
||||||
Besøg
|
<th scope="col">Navn</th>
|
||||||
</div>
|
<th scope="col">Konto</th>
|
||||||
<div class="col">
|
<th scope="col">Tlf</th>
|
||||||
Navn
|
<th scope="col">Bynavn</th>
|
||||||
</div>
|
<th scope="col"></th>
|
||||||
<div class="col">
|
</tr>
|
||||||
Konto
|
</thead>
|
||||||
</div>
|
<tbody>
|
||||||
<div class="col">
|
|
||||||
Telefon
|
|
||||||
</div>
|
|
||||||
<div class="col">
|
|
||||||
Bynavn
|
|
||||||
</div>
|
|
||||||
<div class="col">
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
@foreach (var company in Companies)
|
@foreach (var company in Companies)
|
||||||
{
|
{
|
||||||
<a class=" list-group-item list-group-item-action" href="/companies/@company.CompanyId">
|
<tr @onclick="() => { ViewCustomer(company.CompanyId); }" style="cursor: pointer">
|
||||||
<div class="row align-items-center">
|
<td class="state align-middle">
|
||||||
<div class="col-sm-1 col-md-1">
|
<DisplayStateComponent StateClass="@(company.HasFolded == 1 ? "the-dead" : Utils.GetVisitState(company.NextVisit))">
|
||||||
<DisplayStateComponent StateClass="@(company.HasFolded == 1 ? "the-dead" : Utils.GetVisitState(company.NextVisit))">
|
</DisplayStateComponent>
|
||||||
</DisplayStateComponent>
|
</td>
|
||||||
</div>
|
<td class="align-middle">
|
||||||
<div class="col">
|
@company.Name
|
||||||
@company.Name
|
</td>
|
||||||
</div>
|
<td class="align-middle">
|
||||||
<div class="col">
|
@company.Account
|
||||||
@company.Account
|
</td>
|
||||||
</div>
|
<td class="align-middle">
|
||||||
<div class="col">
|
@company.Phone
|
||||||
@company.Phone
|
</td>
|
||||||
</div>
|
<td class="align-middle">
|
||||||
<div class="col">
|
@company.City
|
||||||
@company.City
|
</td>
|
||||||
</div>
|
<td class="align-middle">
|
||||||
<div class="col justify-content-end">
|
<ActivityButton CompanyId="@company.CompanyId"
|
||||||
<ActivityButton CompanyId="@company.CompanyId"
|
ActionLink="/companies/$ID$/activities/new"
|
||||||
ActionLink="/companies/$ID$/activities/new"
|
ButtonText="Besøg"
|
||||||
ButtonText="Besøg"
|
ButtonType="primary"
|
||||||
ButtonType="primary"
|
Enabled="@company.ValidVat">
|
||||||
Enabled="@company.ValidVat">
|
</ActivityButton>
|
||||||
</ActivityButton>
|
</td>
|
||||||
</div>
|
</tr>
|
||||||
</div>
|
|
||||||
</a>
|
|
||||||
}
|
}
|
||||||
</div>
|
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -29,6 +29,7 @@ namespace Wonky.Client.Components
|
||||||
[Parameter] public List<CompanyDto> Companies { get; set; } = new();
|
[Parameter] public List<CompanyDto> Companies { get; set; } = new();
|
||||||
[Parameter] public EventCallback<string> OnDelete { get; set; }
|
[Parameter] public EventCallback<string> OnDelete { get; set; }
|
||||||
[Parameter] public EventCallback<string> OnSelect { get; set; }
|
[Parameter] public EventCallback<string> OnSelect { get; set; }
|
||||||
|
[Inject] private NavigationManager _navigator { get; set; }
|
||||||
|
|
||||||
private Confirmation _confirmation = new ();
|
private Confirmation _confirmation = new ();
|
||||||
private string _companyId = "";
|
private string _companyId = "";
|
||||||
|
@ -39,6 +40,11 @@ namespace Wonky.Client.Components
|
||||||
await base.OnInitializedAsync();
|
await base.OnInitializedAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void ViewCustomer(string companyId)
|
||||||
|
{
|
||||||
|
_navigator.NavigateTo($"/companies/{companyId}");
|
||||||
|
}
|
||||||
|
|
||||||
private void CallConfirmationModal(string companyId)
|
private void CallConfirmationModal(string companyId)
|
||||||
{
|
{
|
||||||
_companyId = companyId;
|
_companyId = companyId;
|
||||||
|
|
|
@ -17,100 +17,98 @@
|
||||||
|
|
||||||
@using Wonky.Entity.Views
|
@using Wonky.Entity.Views
|
||||||
|
|
||||||
<div class="report-page">
|
@* <table class="table table-sm table-striped table-bordered d-print-table"> *@
|
||||||
@* <table class="table table-sm table-striped table-bordered d-print-table"> *@
|
<table class="table table-sm table-striped table-bordered">
|
||||||
<table class="table table-sm table-striped table-bordered">
|
<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>
|
||||||
Ordre @ReportItem.ESalesNumber
|
</th>
|
||||||
</th>
|
</tr>
|
||||||
</tr>
|
</thead>
|
||||||
</thead>
|
<tbody>
|
||||||
<tbody>
|
<tr>
|
||||||
<tr>
|
<th scope="row">Dato</th>
|
||||||
<th scope="row">Dato</th>
|
<td>@ReportItem.OrderDate</td>
|
||||||
<td>@ReportItem.OrderDate</td>
|
<th scope="row">Konto</th>
|
||||||
<th scope="row">Konto</th>
|
<td>@ReportItem.Company.Account</td>
|
||||||
<td>@ReportItem.Company.Account</td>
|
</tr>
|
||||||
</tr>
|
<tr>
|
||||||
<tr>
|
<th scope="col">Telefon</th>
|
||||||
<th scope="col">Telefon</th>
|
<td>@ReportItem.Company.Phone</td>
|
||||||
<td>@ReportItem.Company.Phone</td>
|
<th scope="col">Køber</th>
|
||||||
<th scope="col">Køber</th>
|
<td>@ReportItem.YourRef</td>
|
||||||
<td>@ReportItem.YourRef</td>
|
</tr>
|
||||||
</tr>
|
<tr>
|
||||||
<tr>
|
<th scope="col">CVR/VAT</th>
|
||||||
<th scope="col">CVR/VAT</th>
|
<td>@ReportItem.Company.VatNumber</td>
|
||||||
<td>@ReportItem.Company.VatNumber</td>
|
<th scope="col">Rekvisition</th>
|
||||||
<th scope="col">Rekvisition</th>
|
<td>@ReportItem.ReferenceNumber</td>
|
||||||
<td>@ReportItem.ReferenceNumber</td>
|
</tr>
|
||||||
</tr>
|
<tr>
|
||||||
<tr>
|
<th scope="col">Navn</th>
|
||||||
<th scope="col">Navn</th>
|
<td>@ReportItem.Company.Name</td>
|
||||||
<td>@ReportItem.Company.Name</td>
|
<th scope="col">Lev.Navn</th>
|
||||||
<th scope="col">Lev.Navn</th>
|
<td>@ReportItem.DlvName</td>
|
||||||
<td>@ReportItem.DlvName</td>
|
</tr>
|
||||||
</tr>
|
<tr>
|
||||||
<tr>
|
<th scope="col">Adresse</th>
|
||||||
<th scope="col">Adresse</th>
|
<td>@ReportItem.Company.Address1</td>
|
||||||
<td>@ReportItem.Company.Address1</td>
|
<th scope="col">Lev.Adresse</th>
|
||||||
<th scope="col">Lev.Adresse</th>
|
<td>@ReportItem.DlvAddress1</td>
|
||||||
<td>@ReportItem.DlvAddress1</td>
|
</tr>
|
||||||
</tr>
|
<tr>
|
||||||
<tr>
|
<th scope="col">Adresse</th>
|
||||||
<th scope="col">Adresse</th>
|
<td>@ReportItem.Company.Address2</td>
|
||||||
<td>@ReportItem.Company.Address2</td>
|
<th scope="col">Lev.Adresse</th>
|
||||||
<th scope="col">Lev.Adresse</th>
|
<td>@ReportItem.DlvAddress2</td>
|
||||||
<td>@ReportItem.DlvAddress2</td>
|
</tr>
|
||||||
</tr>
|
<tr>
|
||||||
<tr>
|
<th scope="col">Postnr By</th>
|
||||||
<th scope="col">Postnr By</th>
|
<td>@ReportItem.Company.ZipCode @ReportItem.Company.City</td>
|
||||||
<td>@ReportItem.Company.ZipCode @ReportItem.Company.City</td>
|
<th scope="col">Lev.Postnr By</th>
|
||||||
<th scope="col">Lev.Postnr By</th>
|
<td>@ReportItem.DlvZipCity</td>
|
||||||
<td>@ReportItem.DlvZipCity</td>
|
</tr>
|
||||||
</tr>
|
</tbody>
|
||||||
</tbody>
|
</table>
|
||||||
</table>
|
<table class="table table-sm table-striped table-bordered">
|
||||||
<table class="table table-sm table-striped table-bordered">
|
<thead>
|
||||||
<thead>
|
<tr class="bg-light text-black">
|
||||||
<tr class="bg-light text-black">
|
<th scope="col">Antal</th>
|
||||||
<th scope="col">Antal</th>
|
<th scope="col">Varnr</th>
|
||||||
<th scope="col">Varnr</th>
|
<th scope="col">Beskrivelse</th>
|
||||||
<th scope="col">Beskrivelse</th>
|
<th class="text-end" scope="col">Pris</th>
|
||||||
<th class="text-end" scope="col">Pris</th>
|
<th class="text-end" scope="col">R%</th>
|
||||||
<th class="text-end" scope="col">R%</th>
|
<th class="text-end" scope="col">Beløb</th>
|
||||||
<th class="text-end" scope="col">Beløb</th>
|
</tr>
|
||||||
</tr>
|
</thead>
|
||||||
</thead>
|
<tbody>
|
||||||
<tbody>
|
@foreach (var line in ReportItem.Lines)
|
||||||
@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">
|
<tr>
|
||||||
<h4 class="text-center">
|
<td>@line.Quantity</td>
|
||||||
@ReportItem.OfficeNote
|
<td>@line.Sku</td>
|
||||||
</h4>
|
<td>@line.Description</td>
|
||||||
</div>
|
<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>
|
||||||
}
|
}
|
||||||
</div>
|
<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>
|
||||||
|
}
|
||||||
|
|
||||||
@code{
|
@code{
|
||||||
|
|
||||||
|
|
|
@ -121,7 +121,7 @@
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
@* Order draft lines *@
|
@* Order draft lines *@
|
||||||
<table class="table table-hover table-striped table-bordered">
|
<table class="sticky-top table table-hover table-striped table-bordered">
|
||||||
<thead>
|
<thead>
|
||||||
<tr class="bg-dark text-white">
|
<tr class="bg-dark text-white">
|
||||||
<th scope="col" colspan="6">
|
<th scope="col" colspan="6">
|
||||||
|
@ -208,7 +208,7 @@
|
||||||
</td>
|
</td>
|
||||||
<td>@_selectedItem.Sku</td>
|
<td>@_selectedItem.Sku</td>
|
||||||
<td>
|
<td>
|
||||||
<button type="button" class="btn btn-warning text-nowrap d-block" @onclick="@(() => AddItem(_selectedItem))">BESTIL @Quantity @_selectedItem.Name</button>
|
<button type="button" class="btn btn-warning text-nowrap d-block" @onclick="@(() => AddItem(_selectedItem))">bestil @Quantity stk @_selectedItem.Name</button>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
@ -336,16 +336,23 @@
|
||||||
</EditForm>
|
</EditForm>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-footer">
|
<div class="card-footer">
|
||||||
<div class="row mt-2 mb-2">
|
@if (HideButtons)
|
||||||
<div class="col">
|
{
|
||||||
<a class="btn btn-info" href="/companies">Til Oversigt</a>
|
<AppSpinner></AppSpinner>
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<div class="row mt-2 mb-2">
|
||||||
|
<div class="col">
|
||||||
|
<a class="btn btn-info" href="/companies">Til Oversigt</a>
|
||||||
|
</div>
|
||||||
|
<div class="col">
|
||||||
|
<a class="btn btn-warning" href="/companies/@_company.CompanyId">Annuller</a>
|
||||||
|
</div>
|
||||||
|
<div class="col">
|
||||||
|
<button type="button" class="btn btn-primary" @onclick="CreateActivity" disabled="@_poFormInvalid">Opret besøg</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col">
|
}
|
||||||
<a class="btn btn-warning" href="/companies/@_company.CompanyId">Annuller</a>
|
|
||||||
</div>
|
|
||||||
<div class="col">
|
|
||||||
<button type="button" class="btn btn-primary" @onclick="CreateActivity" disabled="@_poFormInvalid">Opret besøg</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
|
@ -99,8 +99,7 @@ public partial class ActivityNewVisitPage : IDisposable
|
||||||
|
|
||||||
_draft.ActivityDate = $"{_workDate:yyyy-MM-dd}" ;
|
_draft.ActivityDate = $"{_workDate:yyyy-MM-dd}" ;
|
||||||
|
|
||||||
// todo - does it make sense to continue if _reportClosed is true?
|
_paging.SearchColumn = string.IsNullOrWhiteSpace(_prefs.ItemSearch) ? "name" : _prefs.ItemSearch;
|
||||||
_paging.SearchColumn = _prefs.ItemSearch ?? "name";
|
|
||||||
_paging.PageSize = Convert.ToInt32(_prefs.PageSize);
|
_paging.PageSize = Convert.ToInt32(_prefs.PageSize);
|
||||||
|
|
||||||
await GetSalesItems();
|
await GetSalesItems();
|
||||||
|
|
|
@ -1,70 +0,0 @@
|
||||||
@*
|
|
||||||
// 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 Microsoft.AspNetCore.Authorization
|
|
||||||
@page "/admin/users/advisers/{CountryCode}/{UserId}/reports/{ReportDate}"
|
|
||||||
@attribute [Authorize(Roles = "Admin")]
|
|
||||||
|
|
||||||
@if (Report != null)
|
|
||||||
{
|
|
||||||
<div class="report-page">
|
|
||||||
<div class="d-print-block">
|
|
||||||
<PageTitle>@Report.ReportData.Name</PageTitle>
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-6 d-print-none align-content-center">
|
|
||||||
@if (!string.IsNullOrWhiteSpace(ReportDate))
|
|
||||||
{
|
|
||||||
<h3 class="workDate">@DateTime.Parse(ReportDate).ToLongDateString()</h3>
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
<div class="col col-md-4 d-print-none align-content-center">
|
|
||||||
<WorkDateComponent SelectedDate="@ReportDate" OnChanged="GetReport"></WorkDateComponent>
|
|
||||||
</div>
|
|
||||||
<div class="col col-md-1 d-print-none align-content-center">
|
|
||||||
<button class="btn btn-warning" type="button" onclick="window.print();">Print</button>
|
|
||||||
</div>
|
|
||||||
<div class="col d-none d-print-block text-center align-content-center">
|
|
||||||
<h3>@Report.ReportData.Name</h3>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="row">
|
|
||||||
<div class="w-75">
|
|
||||||
<ReportSummaryComponent ReportData="Report.ReportData"></ReportSummaryComponent>
|
|
||||||
</div>
|
|
||||||
<div class="w-25">
|
|
||||||
<ReportDistanceLedgerComponent ReportData="Report.ReportData"></ReportDistanceLedgerComponent>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<ActivityTableComponent Activities="Report.ReportItems"></ActivityTableComponent>
|
|
||||||
<ReportActivityLedgerComponent ReportData="Report.ReportData"></ReportActivityLedgerComponent>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
<AppSpinner></AppSpinner>
|
|
||||||
}
|
|
||||||
|
|
||||||
@if (_items.Any())
|
|
||||||
{
|
|
||||||
@foreach (var item in _items)
|
|
||||||
{
|
|
||||||
<ReportItemComponent ReportItem="@item"></ReportItemComponent>
|
|
||||||
}
|
|
||||||
}
|
|
73
Wonky.Client/Pages/AdminVewSalesReportPage.razor
Normal file
73
Wonky.Client/Pages/AdminVewSalesReportPage.razor
Normal file
|
@ -0,0 +1,73 @@
|
||||||
|
@*
|
||||||
|
// 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 Microsoft.AspNetCore.Authorization
|
||||||
|
@page "/admin/users/advisers/{CountryCode}/{UserId}/reports/{ReportDate}"
|
||||||
|
@attribute [Authorize(Roles = "Admin")]
|
||||||
|
|
||||||
|
<div class="report-page">
|
||||||
|
|
||||||
|
<div class="row mb-3 d-print-none">
|
||||||
|
<div class="col-md-6 align-content-center">
|
||||||
|
<h3 class="workDate">@DateTime.Parse(ReportDate).ToLongDateString()</h3>
|
||||||
|
</div>
|
||||||
|
<div class="col col-md-4 align-content-center">
|
||||||
|
<WorkDateComponent SelectedDate="@ReportDate" OnChanged="GetReport"></WorkDateComponent>
|
||||||
|
</div>
|
||||||
|
<div class="col col-md-1 align-content-center">
|
||||||
|
<button class="btn btn-warning" type="button" onclick="window.print();">Print</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@if (!string.IsNullOrWhiteSpace(Report.ReportData.DayTypeEnum))
|
||||||
|
{
|
||||||
|
<PageTitle>@Report.ReportData.Name</PageTitle>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col d-none text-center align-content-center">
|
||||||
|
<h3>@Report.ReportData.Name</h3>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="w-75">
|
||||||
|
<ReportSummaryComponent ReportData="Report.ReportData"></ReportSummaryComponent>
|
||||||
|
</div>
|
||||||
|
<div class="w-25">
|
||||||
|
<ReportDistanceLedgerComponent ReportData="Report.ReportData"></ReportDistanceLedgerComponent>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<ActivityTableComponent Activities="Report.ReportItems"></ActivityTableComponent>
|
||||||
|
<ReportActivityLedgerComponent ReportData="Report.ReportData"></ReportActivityLedgerComponent>
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<div class="row">
|
||||||
|
<div class="col">Ingen data</div>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@if (_items.Any())
|
||||||
|
{
|
||||||
|
@foreach (var item in _items)
|
||||||
|
{
|
||||||
|
<div class="report-page">
|
||||||
|
<ReportItemComponent ReportItem="@item"></ReportItemComponent>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
}
|
|
@ -21,7 +21,7 @@ using Wonky.Entity.Views;
|
||||||
|
|
||||||
namespace Wonky.Client.Pages;
|
namespace Wonky.Client.Pages;
|
||||||
|
|
||||||
public partial class AdminSalesReportViewPage : IDisposable
|
public partial class AdminVewSalesReportPage : IDisposable
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Country code from url parameter
|
/// Country code from url parameter
|
||||||
|
@ -54,6 +54,7 @@ public partial class AdminSalesReportViewPage : IDisposable
|
||||||
private ReportView Report { get; set; } = new();
|
private ReportView Report { get; set; } = new();
|
||||||
|
|
||||||
private List<ReportItemView> _items { get; set; } = new();
|
private List<ReportItemView> _items { get; set; } = new();
|
||||||
|
private string _workDate { get; set; } = "";
|
||||||
|
|
||||||
protected override async Task OnParametersSetAsync()
|
protected override async Task OnParametersSetAsync()
|
||||||
{
|
{
|
||||||
|
@ -69,11 +70,18 @@ public partial class AdminSalesReportViewPage : IDisposable
|
||||||
/// <param name="workDate"></param>
|
/// <param name="workDate"></param>
|
||||||
private async Task GetReport(string workDate)
|
private async Task GetReport(string workDate)
|
||||||
{
|
{
|
||||||
if(workDate != ReportDate)
|
if (workDate != ReportDate)
|
||||||
|
{
|
||||||
_navigator.NavigateTo($"/admin/users/advisers/{CountryCode}/{UserId}/reports/{workDate}");
|
_navigator.NavigateTo($"/admin/users/advisers/{CountryCode}/{UserId}/reports/{workDate}");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Report = new ReportView();
|
Report = new ReportView();
|
||||||
|
_items = new List<ReportItemView>();
|
||||||
|
|
||||||
Report = await GetUserReport(UserId, workDate);
|
Report = await GetUserReport(UserId, workDate);
|
||||||
_items = Report.ReportItems.Where(x => x.OrderAmount > 0).ToList();
|
_items = Report.ReportItems.Where(x => x.OrderAmount > 0).ToList();
|
||||||
|
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get report for user with entity Id for work date
|
/// Get report for user with entity Id for work date
|
|
@ -38,11 +38,11 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row mb-2">
|
<div class="row mb-2">
|
||||||
<div class="col-md-10">
|
<div class="col-md-9">
|
||||||
<PaginationComponent MetaData="_metaData" Spread="2" SelectedPage="SelectedPage"></PaginationComponent>
|
<PaginationComponent MetaData="_metaData" Spread="2" SelectedPage="SelectedPage"></PaginationComponent>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-2 justify-content-end">
|
<div class="col-md-3 justify-content-end">
|
||||||
<a class="btn btn-success" href="/companies/new">Opret kunde</a>
|
<a class="btn btn-success text-nowrap" href="/companies/new">Opret kunde</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
|
@ -26,12 +26,13 @@ using Wonky.Entity.Requests;
|
||||||
|
|
||||||
namespace Wonky.Client.Pages
|
namespace Wonky.Client.Pages
|
||||||
{
|
{
|
||||||
public partial class CompanyListPage : IDisposable
|
public partial class CustomerListPage : IDisposable
|
||||||
{
|
{
|
||||||
[Inject] private ILocalStorageService _storage { get; set; }
|
[Inject] private ILocalStorageService _storage { get; set; }
|
||||||
[Inject] private UserPreferenceService _preferenceService { get; set; }
|
[Inject] private UserPreferenceService _preferenceService { get; set; }
|
||||||
[Inject] private ICompanyHttpRepository _companyRepo { get; set; }
|
[Inject] private ICompanyHttpRepository _companyRepo { get; set; }
|
||||||
[Inject] private HttpInterceptorService _interceptor { get; set; }
|
[Inject] private HttpInterceptorService _interceptor { get; set; }
|
||||||
|
[Inject] private NavigationManager _navigator { get; set; }
|
||||||
private List<CompanyDto> _companyList { get; set; } = new();
|
private List<CompanyDto> _companyList { get; set; } = new();
|
||||||
private MetaData _metaData { get; set; } = new();
|
private MetaData _metaData { get; set; } = new();
|
||||||
private CompanyPagingParams _paging = new();
|
private CompanyPagingParams _paging = new();
|
||||||
|
@ -82,7 +83,7 @@ namespace Wonky.Client.Pages
|
||||||
private async Task SetSearchPhrase(string searchTerm)
|
private async Task SetSearchPhrase(string searchTerm)
|
||||||
{
|
{
|
||||||
_savedSearch = searchTerm;
|
_savedSearch = searchTerm;
|
||||||
await _preferenceService.SetCompanyFilterPhrase(searchTerm);
|
await _preferenceService.SetCompanyFilterPhrase(searchTerm.Trim());
|
||||||
_companyList = new List<CompanyDto>();
|
_companyList = new List<CompanyDto>();
|
||||||
_paging.PageNumber = 1;
|
_paging.PageNumber = 1;
|
||||||
_paging.SearchTerm = searchTerm;
|
_paging.SearchTerm = searchTerm;
|
|
@ -35,10 +35,10 @@ using Wonky.Entity.Views;
|
||||||
|
|
||||||
namespace Wonky.Client.Pages
|
namespace Wonky.Client.Pages
|
||||||
{
|
{
|
||||||
public partial class CompanyNewPage : IDisposable
|
public partial class CustomerNewPage : IDisposable
|
||||||
{
|
{
|
||||||
[Inject] private IToastService _toast { get; set; }
|
[Inject] private IToastService _toast { get; set; }
|
||||||
[Inject] private ILogger<CompanyNewPage> _logger { get; set; }
|
[Inject] private ILogger<CustomerNewPage> _logger { get; set; }
|
||||||
[Inject] private ILocalStorageService _storage { get; set; }
|
[Inject] private ILocalStorageService _storage { get; set; }
|
||||||
[Inject] private NavigationManager _navigator { get; set; }
|
[Inject] private NavigationManager _navigator { get; set; }
|
||||||
[Inject] private ICompanyHttpRepository _companyRepo { get; set; }
|
[Inject] private ICompanyHttpRepository _companyRepo { get; set; }
|
|
@ -33,11 +33,11 @@ using Wonky.Entity.Views;
|
||||||
|
|
||||||
namespace Wonky.Client.Pages;
|
namespace Wonky.Client.Pages;
|
||||||
|
|
||||||
public partial class CompanyViewPage : IDisposable
|
public partial class CustomerViewPage : IDisposable
|
||||||
{
|
{
|
||||||
[Parameter] public string CompanyId { get; set; } = "";
|
[Parameter] public string CompanyId { get; set; } = "";
|
||||||
[Inject] private IToastService _toast { get; set; }
|
[Inject] private IToastService _toast { get; set; }
|
||||||
[Inject] private ILogger<CompanyViewPage> _logger { get; set; }
|
[Inject] private ILogger<CustomerViewPage> _logger { get; set; }
|
||||||
[Inject] private NavigationManager _navigator { get; set; }
|
[Inject] private NavigationManager _navigator { get; set; }
|
||||||
[Inject] private ICompanyHttpRepository _companyRepo { get; set; }
|
[Inject] private ICompanyHttpRepository _companyRepo { get; set; }
|
||||||
[Inject] private IHistoryHttpRepository _historyRepo { get; set; }
|
[Inject] private IHistoryHttpRepository _historyRepo { get; set; }
|
|
@ -20,24 +20,24 @@
|
||||||
@page "/sales-reports/view/{ReportDate}"
|
@page "/sales-reports/view/{ReportDate}"
|
||||||
@attribute [Authorize(Roles = "Adviser,Admin,Supervisor")]
|
@attribute [Authorize(Roles = "Adviser,Admin,Supervisor")]
|
||||||
|
|
||||||
@if (_report != null)
|
<div class="report-page">
|
||||||
{
|
<div class="row mb-3 d-print-none">
|
||||||
<div class="report-page d-print-block">
|
<div class="col-md-6 align-content-center">
|
||||||
|
<h3 class="workDate">@DateTime.Parse(ReportDate).ToLongDateString()</h3>
|
||||||
|
</div>
|
||||||
|
<div class="col col-md-4 align-content-center">
|
||||||
|
<WorkDateComponent SelectedDate="@ReportDate" OnChanged="GetReport"></WorkDateComponent>
|
||||||
|
</div>
|
||||||
|
<div class="col col-md-1 align-content-center">
|
||||||
|
<button class="btn btn-warning" type="button" onclick="window.print();">Print</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@if (!string.IsNullOrWhiteSpace(_report.ReportData.DayTypeEnum))
|
||||||
|
{
|
||||||
<PageTitle>@_report.ReportData.Name</PageTitle>
|
<PageTitle>@_report.ReportData.Name</PageTitle>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-6 d-print-none align-content-center">
|
<div class="col d-none text-center align-content-center">
|
||||||
@if (!string.IsNullOrWhiteSpace(ReportDate))
|
|
||||||
{
|
|
||||||
<h3 class="workDate">@DateTime.Parse(ReportDate).ToLongDateString()</h3>
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
<div class="col col-md-4 d-print-none align-content-center">
|
|
||||||
<WorkDateComponent SelectedDate="@ReportDate" OnChanged="GetReport"></WorkDateComponent>
|
|
||||||
</div>
|
|
||||||
<div class="col col-md-1 d-print-none align-content-center">
|
|
||||||
<button class="btn btn-warning" type="button" onclick="window.print();">Print</button>
|
|
||||||
</div>
|
|
||||||
<div class="col d-none d-print-block text-center align-content-center">
|
|
||||||
<h3>@_report.ReportData.Name</h3>
|
<h3>@_report.ReportData.Name</h3>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -49,22 +49,16 @@
|
||||||
<ReportDistanceLedgerComponent ReportData="_report.ReportData"></ReportDistanceLedgerComponent>
|
<ReportDistanceLedgerComponent ReportData="_report.ReportData"></ReportDistanceLedgerComponent>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<ActivityTableComponent Activities="_report.ReportItems"></ActivityTableComponent>
|
||||||
|
<ReportActivityLedgerComponent ReportData="_report.ReportData"></ReportActivityLedgerComponent>
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col">
|
<div class="col">Ingen data</div>
|
||||||
<ActivityTableComponent Activities="_report.ReportItems"></ActivityTableComponent>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
}
|
||||||
<div class="col">
|
</div>
|
||||||
<ReportActivityLedgerComponent ReportData="_report.ReportData"></ReportActivityLedgerComponent>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
<AppSpinner></AppSpinner>
|
|
||||||
}
|
|
||||||
|
|
||||||
@if (_items.Any())
|
@if (_items.Any())
|
||||||
{
|
{
|
||||||
|
|
|
@ -38,6 +38,8 @@ public partial class SalesReportViewPage
|
||||||
|
|
||||||
private async Task GetReport(string workDate)
|
private async Task GetReport(string workDate)
|
||||||
{
|
{
|
||||||
|
_report = new ReportView();
|
||||||
|
_items = new List<ReportItemView>();
|
||||||
if(workDate != ReportDate)
|
if(workDate != ReportDate)
|
||||||
_navigator.NavigateTo($"/sales-reports/view/{workDate}");
|
_navigator.NavigateTo($"/sales-reports/view/{workDate}");
|
||||||
_report = await _reportRepo.GetReport(workDate);
|
_report = await _reportRepo.GetReport(workDate);
|
||||||
|
|
|
@ -18,6 +18,26 @@
|
||||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"Chrome": {
|
||||||
|
"commandName": "Project",
|
||||||
|
"dotnetRunMessages": true,
|
||||||
|
"launchBrowser": true,
|
||||||
|
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
|
||||||
|
"applicationUrl": "https://localhost:7174;http://localhost:5280",
|
||||||
|
"environmentVariables": {
|
||||||
|
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Firefox": {
|
||||||
|
"commandName": "Project",
|
||||||
|
"dotnetRunMessages": true,
|
||||||
|
"launchBrowser": true,
|
||||||
|
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
|
||||||
|
"applicationUrl": "https://localhost:7174;http://localhost:5280",
|
||||||
|
"environmentVariables": {
|
||||||
|
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||||
|
}
|
||||||
|
},
|
||||||
"IIS Express": {
|
"IIS Express": {
|
||||||
"commandName": "IISExpress",
|
"commandName": "IISExpress",
|
||||||
"launchBrowser": true,
|
"launchBrowser": true,
|
||||||
|
|
|
@ -39,7 +39,7 @@ main {
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 640.98px) {
|
@media (max-width: 1024px) {
|
||||||
.top-row:not(.auth) {
|
.top-row:not(.auth) {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
@ -53,7 +53,7 @@ main {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (min-width: 641px) {
|
@media (min-width: 1025px) {
|
||||||
.page {
|
.page {
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
}
|
}
|
||||||
|
|
|
@ -95,6 +95,13 @@
|
||||||
<span class="oi oi-question-mark" aria-hidden="true"></span> Hjælp
|
<span class="oi oi-question-mark" aria-hidden="true"></span> Hjælp
|
||||||
</NavLink>
|
</NavLink>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="nav-item px-3">
|
||||||
|
<NavLink class="nav-link ps-2" href="/logout">
|
||||||
|
<span class="oi oi-account-login"></span> Log af
|
||||||
|
</NavLink>
|
||||||
|
</div>
|
||||||
|
|
||||||
</Authorized>
|
</Authorized>
|
||||||
</AuthorizeView>
|
</AuthorizeView>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
|
@ -50,7 +50,7 @@
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (min-width: 641px) {
|
@media (min-width: 1025px) {
|
||||||
.navbar-toggler {
|
.navbar-toggler {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
|
@ -100,8 +100,4 @@
|
||||||
<_ContentIncludedByDefault Remove="wwwroot\css\bootstrap\js\bootstrap.min.js.map" />
|
<_ContentIncludedByDefault Remove="wwwroot\css\bootstrap\js\bootstrap.min.js.map" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<Folder Include="wwwroot\scripts" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
{
|
{
|
||||||
"appInfo": {
|
"appInfo": {
|
||||||
"name": "Wonky Client",
|
"name": "Wonky Client",
|
||||||
"version": "0.8.122",
|
"version": "0.8.135",
|
||||||
"isBeta": true,
|
"isBeta": true,
|
||||||
"sandBox": true,
|
"sandBox": false,
|
||||||
"image": "grumpy-coder.png"
|
"image": "grumpy-coder.png"
|
||||||
},
|
},
|
||||||
"apiConfig": {
|
"apiConfig": {
|
||||||
|
|
|
@ -123,8 +123,24 @@ footer.version {
|
||||||
padding: 0 10px 0 0;
|
padding: 0 10px 0 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.back-to-top {
|
||||||
|
position: fixed;
|
||||||
|
bottom: 25px;
|
||||||
|
right: 25px;
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
.report-page {
|
.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-after: always;
|
||||||
|
page-break-inside: avoid;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* printer classes */
|
/* printer classes */
|
||||||
|
@ -143,9 +159,14 @@ footer.version {
|
||||||
color-adjust: exact;
|
color-adjust: exact;
|
||||||
}
|
}
|
||||||
.report-page {
|
.report-page {
|
||||||
|
/* deprecated properties */
|
||||||
page-break-before: always;
|
page-break-before: always;
|
||||||
page-break-after: always;
|
page-break-after: always;
|
||||||
page-break-inside: avoid;
|
page-break-inside: avoid;
|
||||||
|
/* new properties */
|
||||||
|
break-after: page;
|
||||||
|
break-inside: avoid;
|
||||||
|
|
||||||
height: initial;
|
height: initial;
|
||||||
font-size: 10px;
|
font-size: 10px;
|
||||||
border: initial;
|
border: initial;
|
|
@ -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.css" rel="stylesheet" />
|
<link href="css/app-135.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>
|
||||||
|
|
16
Wonky.Client/wwwroot/scripts/scripts.js
Normal file
16
Wonky.Client/wwwroot/scripts/scripts.js
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
(document).ready(function(){
|
||||||
|
$(window).scroll(function () {
|
||||||
|
if ($(this).scrollTop() > 50) {
|
||||||
|
$('#back-to-top').fadeIn();
|
||||||
|
} else {
|
||||||
|
$('#back-to-top').fadeOut();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// scroll body to 0px on click
|
||||||
|
$('#back-to-top').click(function () {
|
||||||
|
$('body,html').animate({
|
||||||
|
scrollTop: 0
|
||||||
|
}, 400);
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
});
|
Loading…
Reference in a new issue