refactor activity header into component - testing

This commit is contained in:
Frede Hundewadt 2023-11-07 13:39:20 +01:00
parent efaf7ec297
commit 97331a0467
8 changed files with 142 additions and 201 deletions

View file

@ -0,0 +1,92 @@
@using Wonky.Entity.Views
<table class="table table-sm table-striped d-print-table">
<thead>
<tr class="table-light">
<th class="p-0" colspan="4">
<div class="border border-1 rounded-3 pt-3 mb-2">
<h2 class="fw-bold text-center">@ReportItem.Company.Name</h2>
<h3 class="text-center font-monospace">@ReportItem.ESalesNumber</h3>
@if (ReportItem.Express)
{
<h2 class="fw-bold text-center"><i class="bi-lightning-charge text-dark" style="font-size: 2rem;"></i> HASTER</h2>
}
@if (ReportItem.VisitTypeEnum.ToLower() == "phone" || ReportItem.OurRef.Contains("T:"))
{
<h5 class="text-center">TELEFONORDRE</h5>
}
@if (ReportItem.StatusTypeEnum is "Quote")
{
<h5 class="text-center">TILBUD</h5>
}
</div>
</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>
<tr>
<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>
<tfoot>
<tr class="table-light">
<td colspan="4"></td>
</tr>
</tfoot>
</table>
@code {
[Parameter]
public ReportItemView ReportItem { get; set; } = new();
}

View file

@ -41,7 +41,7 @@
<tbody>
@* NEW row *@
<tr>
<th scope="row">NY</th>
<th scope="row">N</th>
<td class="text-end">@ReportDataView.NewVisitCount</td>
<td class="text-end">@ReportDataView.NewDemoCount</td>
<td class="text-end">@ReportDataView.NewSaleCount</td>
@ -53,7 +53,7 @@
</tr>
@* RECALL row *@
<tr>
<th scope="row">SALG</th>
<th scope="row">R</th>
<td class="text-end">@ReportDataView.RecallVisitCount</td>
<td class="text-end">@ReportDataView.RecallDemoCount</td>
<td class="text-end">@ReportDataView.RecallSaleCount</td>
@ -87,17 +87,17 @@
<td class="text-end">@ReportDataView.WebCountMonth</td>
<td class="text-end">@ReportDataView.WebTurnoverMonth</td>
</tr>
@* SUMMARY arow *@
@* SUMMARY row *@
<tr>
<th scope="row">NORMAL SALG</th>
<td class=""></td>
<td class="bg-light"></td>
<td class="bg-light"></td>
<td class="text-end border-end">@(ReportDataView.NormalTurnover + ReportDataView.PhoneTurnover)</td>
<td class="text-end border-end">@(ReportDataView.NormalTurnover)</td>
<td class="bg-light"></td>
<td class="bg-light"></td>
<td class="bg-light"></td>
<td class="text-end">@(ReportDataView.NormalTurnoverMonth + ReportDataView.PhoneTurnoverMonth)</td>
<td class="text-end">@(ReportDataView.NormalTurnoverMonth)</td>
</tr>
@* SAS row *@
<tr>

View file

@ -118,23 +118,23 @@
<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>
<td class="text-center"><i class="sas-check @(line.Sas ? "bi-check" : "")"></i></td>
</tr>
}
</tbody>
<tfoot>
<tfoot class="table-light">
<tr>
<td colspan="4"></td>
<td colspan="5"></td>
<td>SAS</td>
<td class="text-end">@ReportItem.SasAmount</td>
</tr>
<tr>
<td colspan="4"></td>
<td colspan="5"></td>
<td>NORMAL</td>
<td class="text-end">@ReportItem.OrderAmount</td>
</tr>
<tr>
<td colspan="4"></td>
<td colspan="5"></td>
<td>TOTAL</td>
<td class="text-end">@(ReportItem.SasAmount + ReportItem.OrderAmount)</td>
</tr>

View file

@ -34,7 +34,9 @@
{
<h3 class="text-center">TILBUD</h3>
}
@if (ReportItem.VisitTypeEnum.ToLower() == "phone" || ReportItem.OurRef.Contains("T:"))
@if (ReportItem.VisitTypeEnum.ToLower() == "phone" ||
ReportItem.OurRef.Contains("T:") ||
ReportItem.OurRef.Contains("TLF:"))
{
<h3 class="text-center">TELEFONORDRE</h3>
}
@ -89,8 +91,20 @@
<th scope="col">Lev.Postnr By</th>
<td>@ReportItem.DlvZipCity</td>
</tr>
<tr>
<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">
<thead>
<tr class="bg-light text-black">

View file

@ -21,10 +21,7 @@
@page "/office/customers/{CompanyId}/orders/{OrderId}"
<PageTitle>@ReportItem.ESalesNumber - @ReportItem.Company.Name</PageTitle>
<table class="table table-sm table-striped d-print-table">
<thead>
<tr>
<th class="p-0" colspan="4">
<div class="d-print-none">
<div class="row">
<div class="col-sm-1">
@ -42,73 +39,9 @@
}
</div>
</div>
<div class="bg-light text-dark border border-1 rounded-3 pt-3 mb-2">
<h2 class="fw-bold text-center">@ReportItem.Company.Name</h2>
@if (ReportItem.Express)
{
<h2 class="fw-bold text-center"><i class="bi-lightning-charge text-dark" style="font-size: 2rem;"></i> HASTER</h2>
}
@if (ReportItem.VisitTypeEnum.ToLower() == "phone" || ReportItem.OurRef.Contains("T:"))
{
<h5 class="text-center">TELEFONORDRE</h5>
}
@if (ReportItem.StatusTypeEnum is "Quote")
{
<h5 class="text-center">TILBUD</h5>
}
</div>
</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>
<tr>
<th scope="col">Email</th>
<td colspan="3">@ReportItem.Company.Email</td>
</tr>
</tbody>
</table>
<ActivityHeaderComponent ReportItem="ReportItem" />
<table class="table table-sm table-striped table-bordered">
<thead>
<tr class="bg-light text-black">

View file

@ -1,7 +1,7 @@
{
"appInfo": {
"name": "Wonky Online",
"version": "292.0",
"version": "294.0",
"rc": true,
"sandBox": true,
"image": "grumpy-coder.png",

View file

@ -25,6 +25,9 @@
.i-larger {
font-size: 1.3rem;
}
.sas-check {
font-size: 2rem;
}
.btn.btn-edit {
color: #030303;

View file

@ -19,132 +19,31 @@ namespace Wonky.Entity.Views;
public class ReportItemView
{
/// <summary>
/// Customer company info
/// </summary>
public ReportItemCustomer Company { get; set; } = new();
/// <summary>
/// Lines
/// </summary>
public List<ReportItemLine> Lines { get; set; } = new();
/// <summary>
/// Activity entity id
/// </summary>
public string ActivityId { get; set; } = "";
/// <summary>
/// Closed sale
/// </summary>
public bool Closed { get; set; }
/// <summary>
/// Entity CreateTimestamp as string
/// </summary>
public string CreatedBy { get; set; } = "";
public string CreateTimestamp { get; set; } = "";
/// <summary>
/// CRM Note
/// </summary>
public string CrmNote { get; set; } = "";
/// <summary>
/// Product demo
/// </summary>
public string Demo { get; set; } = "";
/// <summary>
/// Customer delivery address line 1
/// </summary>
public string DlvAddress1 { get; set; } = "";
/// <summary>
/// Customer delivery address line 2
/// </summary>
public string DlvAddress2 { get; set; } = "";
/// <summary>
/// Customer deliver name
/// </summary>
public string DlvName { get; set; } = "";
/// <summary>
/// Customer delivery post code and city name
/// </summary>
public string DlvZipCity { get; set; } = "";
/// <summary>
/// ESales number
/// </summary>
public string ESalesNumber { get; set; } = "";
/// <summary>
/// express flag
/// </summary>
public bool Express { get; set; }
/// <summary>
/// Office note
/// </summary>
public string OfficeNote { get; set; } = "";
/// <summary>
/// Order amount
/// </summary>
public decimal OrderAmount { get; set; }
/// <summary>
/// Order date
/// </summary>
public string OrderDate { get; set; } = "";
/// <summary>
/// Our reference
/// </summary>
public string OurRef { get; set; } = "";
/// <summary>
/// ProcessStatus as string
/// </summary>
public string ProcessStatusEnum { get; set; } = "";
/// <summary>
/// QuoteStatus as string
/// </summary>
public string QuoteStatusEnum { get; set; } = "";
/// <summary>
/// Customer reference number
/// </summary>
public string ReferenceNumber { get; set; } = "";
/// <summary>
/// Product sale resume
/// </summary>
public string Sales { get; set; } = "";
/// <summary>
/// entity id for sales rep
/// </summary>
public string SalesRepId { get; set; } = "";
/// <summary>
/// Order safe seal amount
/// </summary>
public decimal SasAmount { get; set; }
/// <summary>
/// Status type enum as string
/// </summary>
public string StatusTypeEnum { get; set; } = "";
/// <summary>
/// Visit type enum as string
/// </summary>
public string VisitTypeEnum { get; set; } = "";
/// <summary>
/// Customer reference
/// </summary>
public string YourRef { get; set; } = "";
}