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

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

View file

@ -32,38 +32,45 @@
<tr> <tr>
<th scope="row">Dato</th> <th scope="row">Dato</th>
<td>@Invoice.DocumentDate</td> <td>@Invoice.DocumentDate</td>
<th scope="row">Faktura nr.</th> <th scope="row">Eordre</th>
<td>@Invoice.DocumentNumber</td> <td>@Invoice.ESalesNumber</td>
<td colspan="2"></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>
<tr> <tr>
<th scope="row">Konto</th> <th scope="row">Konto</th>
<td>@Invoice.Account</td> <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>@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> <th scope="row">Pakke nr.</th>
<td>@Invoice.TrackingNumber</td> <td>@Invoice.TrackingNumber</td>
</tr> </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> <tr>
<th scope="row">Notat</th> <th scope="row">Notat</th>
<td class="fw-bold" colspan="5">@Invoice.OrderNote</td> <td colspan="3">@Invoice.OrderNote</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@* Sales linies *@
<table class="table table-striped"> <table class="table table-striped">
<thead> <thead>
<tr> <tr>
@ -72,7 +79,6 @@
<th class="text-end" scope="col">Antal</th> <th class="text-end" scope="col">Antal</th>
<th class="text-end" scope="col">Pris</th> <th class="text-end" scope="col">Pris</th>
<th class="text-end" scope="col">Rabat</th> <th class="text-end" scope="col">Rabat</th>
<th class="text-center" scope="col">SAS</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>

View file

@ -19,7 +19,7 @@
<div class="modal-dialog modal-dialog-scrollable modal-fullscreen"> <div class="modal-dialog modal-dialog-scrollable modal-fullscreen">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <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> <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>
<div class="modal-body"> <div class="modal-body">
@ -96,7 +96,7 @@
</tbody> </tbody>
<tfoot> <tfoot>
<tr> <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 class="text-end">@Invoice.InvoiceAmount</td>
<td colspan="1"></td> <td colspan="1"></td>
</tr> </tr>

View file

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