layout update

This commit is contained in:
Frede Hundewadt 2023-12-01 16:18:27 +01:00
parent fe8950579f
commit b150b3679d
4 changed files with 46 additions and 35 deletions

View file

@ -35,15 +35,20 @@ public class Mapper
public static string MapVisitState(string dtNextVisit)
{
if (dtNextVisit is "0001-01-01" or "1970-01-01" or "2010-01-01" or "2020-01-01")
return "the-draw";
if (!DateTime.TryParse(dtNextVisit, out _))
return "the-draw";
var specialDates = new HashSet<string>
{
"0001-01-01",
"1970-01-01",
"2010-01-01",
"2020-01-01"
};
if (specialDates.Contains(dtNextVisit)) return "the-draw";
if (!DateTime.TryParse(dtNextVisit, out var dtNext)) return "the-draw";
var dtNow = DateTime.Now;
var dtNext = DateTime.Parse(dtNextVisit);
if (dtNow > dtNext)
return "the-ugly";
if (dtNow > dtNext) return "the-ugly";
return dtNow > dtNext.AddDays(-14) ? "the-bad" : "the-good";
}

View file

@ -32,38 +32,45 @@
<tr>
<th scope="row">Dato</th>
<td>@Invoice.DocumentDate</td>
<th scope="row">Faktura nr.</th>
<td>@Invoice.DocumentNumber</td>
<td colspan="2"></td>
<th scope="row">Eordre</th>
<td>@Invoice.ESalesNumber</td>
</tr>
<tr>
<th scope="row">Navn</th>
<td >@Invoice.Company.Name</td>
<th scope="row">Ordre No.</th>
<td>@Invoice.OrderNo</td>
</tr>
<tr>
<th scope="row">Konto</th>
<td>@Invoice.Account</td>
<th scope="row">Moms Nr.</th>
<th scope="row">Faktura nr.</th>
<td>@Invoice.DocumentNumber</td>
</tr>
<tr>
<th scope="row">Moms No.</th>
<td>@Invoice.VatNumber</td>
<td colspan="2"></td>
</tr>
<tr>
<th scope="row">Eordre</th>
<td>@Invoice.ESalesNumber</td>
<th scope="row">Vores Ref.</th>
<td>@Invoice.OurRef</td>
<td colspan="2"></td>
</tr>
<tr>
<th scope="row">Rekv.</th>
<td>@Invoice.ReferenceNumber</td>
<th scope="row">Deres Ref.</th>
<td>@Invoice.YourRef</td>
<th scope="row">Pakke nr.</th>
<td>@Invoice.TrackingNumber</td>
</tr>
<tr>
<th scope="row">Rekv.</th>
<td>@Invoice.ReferenceNumber</td>
<th scope="row">Vores Ref.</th>
<td>@Invoice.OurRef</td>
</tr>
<tr>
<th scope="row">Deres Ref.</th>
<td>@Invoice.YourRef</td>
<td colspan="2"></td>
</tr>
<tr>
<th scope="row">Notat</th>
<td class="fw-bold" colspan="5">@Invoice.OrderNote</td>
<td colspan="3">@Invoice.OrderNote</td>
</tr>
</tbody>
</table>
@* Sales linies *@
<table class="table table-striped">
<thead>
<tr>
@ -72,7 +79,6 @@
<th class="text-end" scope="col">Antal</th>
<th class="text-end" scope="col">Pris</th>
<th class="text-end" scope="col">Rabat</th>
<th class="text-center" scope="col">SAS</th>
</tr>
</thead>
<tbody>

View file

@ -19,7 +19,7 @@
<div class="modal-dialog modal-dialog-scrollable modal-fullscreen">
<div class="modal-content">
<div class="modal-header">
<h2 class="modal-title">Info fra @(Invoice.DocumentNumber.Split("-")[1])</h2>
<h2 class="modal-title">Salgsfaktura @(Invoice.DocumentNumber.Split("-")[1])</h2>
<button type="button" class="btn btn-danger" @onclick="@Hide" data-bs-dismiss="modal" aria-label="Luk"><i class="bi-x-lg"></i></button>
</div>
<div class="modal-body">
@ -96,7 +96,7 @@
</tbody>
<tfoot>
<tr>
<td colspan="5" class="text-end">Beløb</td>
<td colspan="5" class="text-end">Faktura Beløb</td>
<td class="text-end">@Invoice.InvoiceAmount</td>
<td colspan="1"></td>
</tr>

View file

@ -1,8 +1,8 @@
{
"appInfo": {
"name": "Wonky Online",
"version": "313.0",
"rc": false,
"version": "314.0",
"rc": true,
"sandBox": true,
"image": "grumpy-coder.png",
"sdk": "dotnet 8.0"