production v.296 added activityIdList to create report endpoint
This commit is contained in:
parent
97331a0467
commit
73520262b1
8 changed files with 94 additions and 66 deletions
60
Wonky.Client/Components/ActivityLinesComponent.razor
Normal file
60
Wonky.Client/Components/ActivityLinesComponent.razor
Normal file
|
@ -0,0 +1,60 @@
|
||||||
|
@using Wonky.Entity.Views
|
||||||
|
|
||||||
|
<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>
|
||||||
|
<th class="text-center" scope="col">SAS</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>
|
||||||
|
<td class="text-center"><i class="bi- @(line.Sas ? "bi-check-square" : "bi-square")"></i></td>
|
||||||
|
</tr>
|
||||||
|
}
|
||||||
|
@if (ReportItem.Express)
|
||||||
|
{
|
||||||
|
<td colspan="4"></td>
|
||||||
|
<td class="text-end" colspan="2">
|
||||||
|
<h5 class="fw-bold"><i class="bi-lightning-charge the-fast" style="font-size: 2rem;"></i> HASTER</h5>
|
||||||
|
</td>
|
||||||
|
}
|
||||||
|
</tbody>
|
||||||
|
<tfoot>
|
||||||
|
<tr>
|
||||||
|
<td colspan="5" class="text-end">SAS</td>
|
||||||
|
<td class="text-end">@ReportItem.SasAmount</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="5" class="text-end">NORMAL</td>
|
||||||
|
<td class="text-end">@ReportItem.OrderAmount</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="5" class="text-end">TOTAL</td>
|
||||||
|
<td class="text-end">@(ReportItem.OrderAmount + ReportItem.SasAmount)</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
</tfoot>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
@code {
|
||||||
|
|
||||||
|
[Parameter]
|
||||||
|
public ReportItemView ReportItem { get; set; } = new();
|
||||||
|
|
||||||
|
}
|
|
@ -92,6 +92,12 @@
|
||||||
<th scope="col">Email</th>
|
<th scope="col">Email</th>
|
||||||
<td colspan="3">@ReportItem.Company.Email</td>
|
<td colspan="3">@ReportItem.Company.Email</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th scope="row">Vores Ref</th>
|
||||||
|
<td>@ReportItem.OurRef</td>
|
||||||
|
<th scope="row">Oprettet af</th>
|
||||||
|
<td>@ReportItem.CreatedBy</td>
|
||||||
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<table class="table table-sm table-striped table-bordered">
|
<table class="table table-sm table-striped table-bordered">
|
||||||
|
@ -118,7 +124,9 @@
|
||||||
<td class="text-end">@($"{line.Price:N2}")</td>
|
<td class="text-end">@($"{line.Price:N2}")</td>
|
||||||
<td class="text-end">@($"{line.Discount:N2}")</td>
|
<td class="text-end">@($"{line.Discount:N2}")</td>
|
||||||
<td class="text-end">@($"{line.LineSum:N2}")</td>
|
<td class="text-end">@($"{line.LineSum:N2}")</td>
|
||||||
<td class="text-center"><i class="sas-check @(line.Sas ? "bi-check" : "")"></i></td>
|
<td class="text-center">
|
||||||
|
<i class="sas-check @(line.Sas ? "bi-check" : "")"></i>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
}
|
}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
|
@ -23,6 +23,9 @@
|
||||||
|
|
||||||
<PageTitle>@ReportItem.Company.Name @ReportItem.OrderDate</PageTitle>
|
<PageTitle>@ReportItem.Company.Name @ReportItem.OrderDate</PageTitle>
|
||||||
|
|
||||||
|
<ActivityHeaderComponent ReportItem="ReportItem" />
|
||||||
|
<ActivityLinesComponent ReportItem="ReportItem" />
|
||||||
|
@*
|
||||||
<table class="table table-sm table-striped d-print-table">
|
<table class="table table-sm table-striped d-print-table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -104,7 +107,9 @@
|
||||||
|
|
||||||
</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">
|
||||||
|
@ -163,6 +168,8 @@
|
||||||
}
|
}
|
||||||
</tfoot>
|
</tfoot>
|
||||||
</table>
|
</table>
|
||||||
|
*@
|
||||||
|
|
||||||
@* Office Note *@
|
@* Office Note *@
|
||||||
@if (ReportItem is { ProcessStatusEnum: "None",Express: false } && AllowOfficeNoteUpdate())
|
@if (ReportItem is { ProcessStatusEnum: "None",Express: false } && AllowOfficeNoteUpdate())
|
||||||
{
|
{
|
||||||
|
|
|
@ -62,6 +62,7 @@ public partial class AdvisorReportCreatePage : IDisposable
|
||||||
private int _currKmPrivate;
|
private int _currKmPrivate;
|
||||||
private bool _isSupervisor;
|
private bool _isSupervisor;
|
||||||
private int _kmMorning;
|
private int _kmMorning;
|
||||||
|
private ReportInitDto _reportData = new();
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -138,15 +139,15 @@ public partial class AdvisorReportCreatePage : IDisposable
|
||||||
_initialValues = new ReportFiguresView();
|
_initialValues = new ReportFiguresView();
|
||||||
_activities = new List<ReportItemView>();
|
_activities = new List<ReportItemView>();
|
||||||
|
|
||||||
var data = await AdvisorSalesReportRepo.InitializeReportData(_workDate);
|
_reportData = await AdvisorSalesReportRepo.InitializeReportData(_workDate);
|
||||||
if(data.ReportClosed)
|
if(_reportData.ReportClosed)
|
||||||
Navigator.NavigateTo($"/advisor/reports/view/{_thisWorkDate:yyyy-MM-dd}");
|
Navigator.NavigateTo($"/advisor/reports/view/{_thisWorkDate:yyyy-MM-dd}");
|
||||||
|
|
||||||
Report.Figures = data.ReportData;
|
Report.Figures = _reportData.ReportData;
|
||||||
_initialValues = data.ReportData;
|
_initialValues = _reportData.ReportData;
|
||||||
_activities = data.ReportItems;
|
_activities = _reportData.ReportItems;
|
||||||
_currKmMonth = data.ReportData.DistanceMonth;
|
_currKmMonth = _reportData.ReportData.DistanceMonth;
|
||||||
_currKmPrivate = data.ReportData.DistancePrivate;
|
_currKmPrivate = _reportData.ReportData.DistancePrivate;
|
||||||
|
|
||||||
if (Report.DayTypeEnum.Contains("leave", StringComparison.CurrentCultureIgnoreCase))
|
if (Report.DayTypeEnum.Contains("leave", StringComparison.CurrentCultureIgnoreCase))
|
||||||
{
|
{
|
||||||
|
@ -253,6 +254,9 @@ public partial class AdvisorReportCreatePage : IDisposable
|
||||||
DateTime checkIn;
|
DateTime checkIn;
|
||||||
DateTime checkOut;
|
DateTime checkOut;
|
||||||
|
|
||||||
|
// create a list of activity ids for the report
|
||||||
|
Report.ActivityIdList = _reportData.ReportItems.Select(x => x.ActivityId).ToList();
|
||||||
|
Logger.LogDebug("ActivityIdList => {}", JsonSerializer.Serialize(Report.ActivityIdList));
|
||||||
// create a date time object using workDate and workHour input
|
// create a date time object using workDate and workHour input
|
||||||
if (Report.DayTypeEnum.Contains("leave", StringComparison.CurrentCultureIgnoreCase))
|
if (Report.DayTypeEnum.Contains("leave", StringComparison.CurrentCultureIgnoreCase))
|
||||||
{
|
{
|
||||||
|
|
|
@ -41,58 +41,8 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ActivityHeaderComponent ReportItem="ReportItem" />
|
<ActivityHeaderComponent ReportItem="ReportItem" />
|
||||||
|
<ActivityLinesComponent ReportItem="ReportItem" />
|
||||||
|
|
||||||
<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>
|
|
||||||
<th class="text-center" scope="col">SAS</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>
|
|
||||||
<td class="text-center"><i class="bi- @(line.Sas ? "bi-check-square" : "bi-square")"></i></td>
|
|
||||||
</tr>
|
|
||||||
}
|
|
||||||
@if (ReportItem.Express)
|
|
||||||
{
|
|
||||||
<td colspan="4"></td>
|
|
||||||
<td class="text-end" colspan="2">
|
|
||||||
<h5 class="fw-bold"><i class="bi-lightning-charge the-fast" style="font-size: 2rem;"></i> HASTER</h5>
|
|
||||||
</td>
|
|
||||||
}
|
|
||||||
</tbody>
|
|
||||||
<tfoot>
|
|
||||||
<tr>
|
|
||||||
<td colspan="5" class="text-end">SAS</td>
|
|
||||||
<td class="text-end">@ReportItem.SasAmount</td>
|
|
||||||
<td></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td colspan="5" class="text-end">NORMAL</td>
|
|
||||||
<td class="text-end">@ReportItem.OrderAmount</td>
|
|
||||||
<td></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td colspan="5" class="text-end">TOTAL</td>
|
|
||||||
<td class="text-end">@(ReportItem.OrderAmount + ReportItem.SasAmount)</td>
|
|
||||||
<td></td>
|
|
||||||
</tr>
|
|
||||||
</tfoot>
|
|
||||||
</table>
|
|
||||||
@if (!string.IsNullOrWhiteSpace(ReportItem.OfficeNote))
|
@if (!string.IsNullOrWhiteSpace(ReportItem.OfficeNote))
|
||||||
{
|
{
|
||||||
<div class="alert border border-1">
|
<div class="alert border border-1">
|
||||||
|
@ -100,7 +50,6 @@
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@if (Working)
|
@if (Working)
|
||||||
{
|
{
|
||||||
<WorkingThreeDots/>
|
<WorkingThreeDots/>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"appInfo": {
|
"appInfo": {
|
||||||
"name": "Wonky Online",
|
"name": "Wonky Online",
|
||||||
"version": "294.0",
|
"version": "296.0",
|
||||||
"rc": true,
|
"rc": true,
|
||||||
"sandBox": true,
|
"sandBox": true,
|
||||||
"image": "grumpy-coder.png",
|
"image": "grumpy-coder.png",
|
||||||
|
|
|
@ -23,10 +23,9 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.i-larger {
|
.i-larger {
|
||||||
font-size: 1.3rem;
|
/*font-size: 1.3rem;*/
|
||||||
}
|
}
|
||||||
.sas-check {
|
.sas-check {
|
||||||
font-size: 2rem;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn.btn-edit {
|
.btn.btn-edit {
|
||||||
|
|
|
@ -35,4 +35,5 @@ public class ReportDto
|
||||||
public string FromDateTime { get; set; } = "";
|
public string FromDateTime { get; set; } = "";
|
||||||
public string ToDateTime { get; set; } = "";
|
public string ToDateTime { get; set; } = "";
|
||||||
public ReportFiguresView Figures { get; set; } = new();
|
public ReportFiguresView Figures { get; set; } = new();
|
||||||
|
public List<string> ActivityIdList { get; set; } = new();
|
||||||
}
|
}
|
Loading…
Reference in a new issue