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>
|
||||
<td colspan="3">@ReportItem.Company.Email</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">Vores Ref</th>
|
||||
<td>@ReportItem.OurRef</td>
|
||||
<th scope="row">Oprettet af</th>
|
||||
<td>@ReportItem.CreatedBy</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<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.Discount: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>
|
||||
}
|
||||
</tbody>
|
||||
|
@ -147,8 +155,8 @@
|
|||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tfoot>
|
||||
|
||||
</tfoot>
|
||||
|
||||
</table>
|
||||
@if (!string.IsNullOrWhiteSpace(ReportItem.OfficeNote))
|
||||
{
|
||||
|
@ -158,4 +166,4 @@
|
|||
</p>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
|
@ -23,6 +23,9 @@
|
|||
|
||||
<PageTitle>@ReportItem.Company.Name @ReportItem.OrderDate</PageTitle>
|
||||
|
||||
<ActivityHeaderComponent ReportItem="ReportItem" />
|
||||
<ActivityLinesComponent ReportItem="ReportItem" />
|
||||
@*
|
||||
<table class="table table-sm table-striped d-print-table">
|
||||
<thead>
|
||||
<tr>
|
||||
|
@ -104,7 +107,9 @@
|
|||
|
||||
</tbody>
|
||||
</table>
|
||||
*@
|
||||
|
||||
@*
|
||||
<table class="table table-sm table-striped table-bordered">
|
||||
<thead>
|
||||
<tr class="bg-light text-black">
|
||||
|
@ -163,6 +168,8 @@
|
|||
}
|
||||
</tfoot>
|
||||
</table>
|
||||
*@
|
||||
|
||||
@* Office Note *@
|
||||
@if (ReportItem is { ProcessStatusEnum: "None",Express: false } && AllowOfficeNoteUpdate())
|
||||
{
|
||||
|
|
|
@ -62,6 +62,7 @@ public partial class AdvisorReportCreatePage : IDisposable
|
|||
private int _currKmPrivate;
|
||||
private bool _isSupervisor;
|
||||
private int _kmMorning;
|
||||
private ReportInitDto _reportData = new();
|
||||
|
||||
|
||||
/// <summary>
|
||||
|
@ -138,15 +139,15 @@ public partial class AdvisorReportCreatePage : IDisposable
|
|||
_initialValues = new ReportFiguresView();
|
||||
_activities = new List<ReportItemView>();
|
||||
|
||||
var data = await AdvisorSalesReportRepo.InitializeReportData(_workDate);
|
||||
if(data.ReportClosed)
|
||||
_reportData = await AdvisorSalesReportRepo.InitializeReportData(_workDate);
|
||||
if(_reportData.ReportClosed)
|
||||
Navigator.NavigateTo($"/advisor/reports/view/{_thisWorkDate:yyyy-MM-dd}");
|
||||
|
||||
Report.Figures = data.ReportData;
|
||||
_initialValues = data.ReportData;
|
||||
_activities = data.ReportItems;
|
||||
_currKmMonth = data.ReportData.DistanceMonth;
|
||||
_currKmPrivate = data.ReportData.DistancePrivate;
|
||||
Report.Figures = _reportData.ReportData;
|
||||
_initialValues = _reportData.ReportData;
|
||||
_activities = _reportData.ReportItems;
|
||||
_currKmMonth = _reportData.ReportData.DistanceMonth;
|
||||
_currKmPrivate = _reportData.ReportData.DistancePrivate;
|
||||
|
||||
if (Report.DayTypeEnum.Contains("leave", StringComparison.CurrentCultureIgnoreCase))
|
||||
{
|
||||
|
@ -253,6 +254,9 @@ public partial class AdvisorReportCreatePage : IDisposable
|
|||
DateTime checkIn;
|
||||
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
|
||||
if (Report.DayTypeEnum.Contains("leave", StringComparison.CurrentCultureIgnoreCase))
|
||||
{
|
||||
|
|
|
@ -41,58 +41,8 @@
|
|||
</div>
|
||||
|
||||
<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))
|
||||
{
|
||||
<div class="alert border border-1">
|
||||
|
@ -100,7 +50,6 @@
|
|||
</div>
|
||||
}
|
||||
|
||||
|
||||
@if (Working)
|
||||
{
|
||||
<WorkingThreeDots/>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"appInfo": {
|
||||
"name": "Wonky Online",
|
||||
"version": "294.0",
|
||||
"version": "296.0",
|
||||
"rc": true,
|
||||
"sandBox": true,
|
||||
"image": "grumpy-coder.png",
|
||||
|
|
|
@ -23,10 +23,9 @@
|
|||
}
|
||||
|
||||
.i-larger {
|
||||
font-size: 1.3rem;
|
||||
/*font-size: 1.3rem;*/
|
||||
}
|
||||
.sas-check {
|
||||
font-size: 2rem;
|
||||
}
|
||||
|
||||
.btn.btn-edit {
|
||||
|
|
|
@ -35,4 +35,5 @@ public class ReportDto
|
|||
public string FromDateTime { get; set; } = "";
|
||||
public string ToDateTime { get; set; } = "";
|
||||
public ReportFiguresView Figures { get; set; } = new();
|
||||
public List<string> ActivityIdList { get; set; } = new();
|
||||
}
|
Loading…
Reference in a new issue