refactor for time display

This commit is contained in:
Frede Hundewadt 2023-10-11 14:14:19 +02:00
parent f413618859
commit 67a53988e1
11 changed files with 57 additions and 45 deletions

View file

@ -18,7 +18,7 @@
<table class="table table-sm table-bordered table-striped">
<thead>
<tr class="bg-dark text-white opacity-75 border-bottom">
<tr class="bg-dark border-bottom">
<th></th>
<th class="text-center" colspan="2" scope="col">Dagens Demo @(ReportData.NewDemoCount + ReportData.RecallDemoCount)</th>
<th class="text-center border-end" colspan="2" scope="col">Dagens Resultat</th>
@ -26,16 +26,16 @@
</tr>
</thead>
<tbody>
<tr class="bg-dark bg-opacity-50 border-bottom">
<tr class="bg-dark border-bottom">
<td></td>
<th class="text-end text-white" scope="col">Besøg</th>
<th class="text-end text-white" scope="col">Demo</th>
<th class="text-end text-white" scope="col">Salg</th>
<th class="text-end text-white border-end" scope="col">Beløb</th>
<th class="text-end text-white" scope="col">Besøg</th>
<th class="text-end text-white" scope="col">Demo</th>
<th class="text-end text-white" scope="col">Salg</th>
<th class="text-end text-white" scope="col">Beløb</th>
<th class="text-end" scope="col">Besøg</th>
<th class="text-end" scope="col">Demo</th>
<th class="text-end" scope="col">Salg</th>
<th class="text-end border-end" scope="col">Beløb</th>
<th class="text-end" scope="col">Besøg</th>
<th class="text-end" scope="col">Demo</th>
<th class="text-end" scope="col">Salg</th>
<th class="text-end" scope="col">Beløb</th>
</tr>
<tr>
<th scope="row">N</th>
@ -83,7 +83,11 @@
</tr>
</tbody>
</table>
<div class="row">
<div class="col text-end">
<span style="font-size:10px;" >@(ReportData.TotalTurnoverMonth + ReportData.SasTurnoverMonth)</span>
</div>
</div>
@code{
[Parameter]

View file

@ -19,7 +19,7 @@
<div class="report-ledger">
<table class="table table-sm table-bordered table-striped">
<thead>
<tr class="bg-dark text-white opacity-75 border-bottom">
<tr class="bg-dark border-bottom">
<th></th>
<th class="text-center" colspan="2" scope="col">Dagens Demo @(ReportData.NewDemoCount + ReportData.RecallDemoCount)</th>
<th class="text-center border-end" colspan="2" scope="col">Dagens Resultat</th>
@ -27,16 +27,16 @@
</tr>
</thead>
<tbody>
<tr class="bg-dark bg-opacity-50 border-bottom">
<tr class="bg-dark border-bottom">
<td></td>
<th class="text-end text-white" scope="col">Besøg</th>
<th class="text-end text-white" scope="col">Demo</th>
<th class="text-end text-white" scope="col">Salg</th>
<th class="text-end text-white border-end" scope="col">Beløb</th>
<th class="text-end text-white" scope="col">Besøg</th>
<th class="text-end text-white" scope="col">Demo</th>
<th class="text-end text-white" scope="col">Salg</th>
<th class="text-end text-white" scope="col">Beløb</th>
<th class="text-end" scope="col">Besøg</th>
<th class="text-end" scope="col">Demo</th>
<th class="text-end" scope="col">Salg</th>
<th class="text-end border-end" scope="col">Beløb</th>
<th class="text-end" scope="col">Besøg</th>
<th class="text-end" scope="col">Demo</th>
<th class="text-end" scope="col">Salg</th>
<th class="text-end" scope="col">Beløb</th>
</tr>
<tr>
<th scope="row">N</th>
@ -84,7 +84,11 @@
</tr>
</tbody>
</table>
<div class="row">
<div class="col text-end">
<span style="font-size:10px;" >@(ReportData.TotalTurnoverMonth + ReportData.SasTurnoverMonth)</span>
</div>
</div>
</div>
@code{

View file

@ -119,7 +119,7 @@ public partial class AdvisorActivityCreatePage : IDisposable
if (_company.HasFolded == 1)
{
// _company has shut down
_activity.OrderMessage = "BEMÆRK: CVR nummer er ophørt.";
_activity.OrderMessage = "BEMÆRK: CVR nummer er ikke normal. Check for ophør eller fusion";
}
_activity.ActivityStatusEnum = "noSale";
// decide if new or recall
@ -176,6 +176,7 @@ public partial class AdvisorActivityCreatePage : IDisposable
await PreferenceService.SetWorkDate(SelectedDate);
}
// raise flag if report is closed
// the flag cause a message instead of order entry
ReportClosed = await ReportRepo.ReportExist($"{SelectedDate:yyyy-MM-dd}");
// Lines may already have been added from the company inventory page
if (DraftProvider.Draft.DraftType == "order")
@ -188,7 +189,7 @@ public partial class AdvisorActivityCreatePage : IDisposable
_activity.ActivityStatusEnum = "order";
_formInvalid = false;
}
if (_salesRep.CountryCode.ToLower() == "se")
if (_salesRep.CountryCode.Equals("se", StringComparison.CurrentCultureIgnoreCase))
{
await TestOrgNumber();
}

View file

@ -78,11 +78,11 @@
Report.Figures.KmMorning = _kmMorning;
<td>
<input type="time" id="checkIn" class="form-control"
@bind-Value="_checkIn" @bind-Value:event="oninput" onchange="@OnTimeChanged"/>
@bind-Value="_checkIn" @bind-Value:event="oninput" @onchange="@OnTimeChanged"/>
</td>
<td>
<input type="time" id="checkOut" class="form-control"
@bind-Value="_checkOut" @bind-Value:event="oninput" onchange="@OnTimeChanged"/>
@bind-Value="_checkOut" @bind-Value:event="oninput" @onchange="@OnTimeChanged"/>
</td>
}
<td class="text-end">
@ -191,7 +191,7 @@
}
<div class="row">
@* ledger summaries calculated *@
<AdvisorReportActivityLedgerComponent ReportData="Report.Figures"/>
<ReportActivityLedgerComponent ReportData="Report.Figures"/>
</div>
</EditForm>

View file

@ -147,7 +147,7 @@ public partial class AdvisorReportCreatePage : IDisposable
_currKmMonth = data.ReportData.DistanceMonth;
_currKmPrivate = data.ReportData.DistancePrivate;
if (Report.DayTypeEnum.ToLower().Contains("leave"))
if (Report.DayTypeEnum.Contains("leave", StringComparison.CurrentCultureIgnoreCase))
{
// ensure no distances in calculation
Report.Figures.KmMorning = 0;
@ -253,7 +253,7 @@ public partial class AdvisorReportCreatePage : IDisposable
DateTime checkOut;
// create a date time object using workDate and workHour input
if (Report.DayTypeEnum.ToLower().Contains("leave"))
if (Report.DayTypeEnum.Contains("leave", StringComparison.CurrentCultureIgnoreCase))
{
checkIn = new DateTime(_beginLeave.Year, _beginLeave.Month, _beginLeave.Day, 0, 0, 0);
checkOut = new DateTime(_endLeave.Year, _endLeave.Month, _endLeave.Day, 0, 0, 0);
@ -269,8 +269,9 @@ public partial class AdvisorReportCreatePage : IDisposable
// format report date time input
Report.FromDateTime = checkIn.ToString("yyyy-MM-dd'T'HH:mm:ss", CultureInfo.InvariantCulture);
Report.ToDateTime = checkOut.ToString("yyyy-MM-dd'T'HH:mm:ss", CultureInfo.InvariantCulture);
Report.ToDateTime = checkOut.ToString("yyyy-MM-dd'T'HH:mm:ss", CultureInfo.InvariantCulture);
Logger.LogDebug("Report.FromDateTime => {}", Report.FromDateTime );
Logger.LogDebug("Report.ToDateTime => {}", Report.ToDateTime );
Logger.LogDebug("_workDate => {workDate}", $"{_thisWorkDate:yyyy-MM-dd}");
Logger.LogDebug("Report => {report}", JsonSerializer.Serialize(Report));

View file

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

View file

@ -15,9 +15,9 @@
}
.report-main {
font-size: 10px;
page-break-before: always;
page-break-after: always;
break-before: page;
/*page-break-before: always;*/
/*page-break-after: always;*/
/*break-before: page;*/
break-after: page;
break-inside: avoid;
/*min-height: 280mm;*/
@ -30,10 +30,10 @@
color-adjust: exact;
}
.report-visit {
page-break-before: always;
page-break-after: always;
/*page-break-before: always;*/
/*page-break-after: always;*/
break-after: page;
break-before: page;
/*break-before: page;*/
break-inside: avoid-page;
height: initial;
border: initial;
@ -47,9 +47,11 @@
}
.distance-ledger {}
.report-ledger {
page-break-before: avoid;
page-break-inside: avoid;
page-break-after: always;
/*page-break-before: avoid;*/
/*page-break-inside: avoid;*/
/*page-break-after: always;*/
break-before: avoid;
break-inside: avoid;
break-after: recto;
min-height: 300px;
}

View file

@ -21,7 +21,7 @@ sed -i 's|\"baseUrl\".*|\"baseUrl\": \"https://eta.innotec.dk\",|g' "${FILE}"
dotnet clean
dotnet publish -c release
cp --recursive /a/projects/inno/a/Wonky.Client/Wonky.Client/bin/Release/net7.0/publish/* "/a/projects/inno/version-sync/${FOLDER}"
cp --recursive /a/projects/inno/a/Wonky.Client/Wonky.Client/bin/Release/net8.0/publish/* "/a/projects/inno/version-sync/${FOLDER}"
sed -i 's|\"baseUrl\".*|\"baseUrl\": \"https://dev.innotec.dk\",|g' "${FILE}"
sed -i 's|\"rc\".*|\"rc\": true,|g' "${FILE}"

View file

@ -21,7 +21,7 @@ sed -i 's|\"baseUrl\".*|\"baseUrl\": \"https://eta.innotec.dk\",|g' "${FILE}"
dotnet clean
dotnet publish -c release
cp --recursive /a/projects/inno/a/Wonky.Client/Wonky.Client/bin/Release/net7.0/publish/ "/a/projects/inno/version-sync/client/${FOLDER}"
cp --recursive /a/projects/inno/a/Wonky.Client/Wonky.Client/bin/Release/net8.0/publish/ "/a/projects/inno/version-sync/client/${FOLDER}"
# RESET TO DEVELOPMENT
sed -i 's|\"sandBox\".*|\"sandBox\": true,|g' "${FILE}"

View file

@ -21,7 +21,7 @@ sed -i 's|\"baseUrl\".*|\"baseUrl\": \"https://zeta.innotec.dk\",|g' "${FILE}"
dotnet clean
dotnet publish -c release
cp --recursive /a/projects/inno/a/Wonky.Client/Wonky.Client/bin/Release/net7.0/publish/ "/a/projects/inno/version-sync/client/${FOLDER}"
cp --recursive /a/projects/inno/a/Wonky.Client/Wonky.Client/bin/Release/net8.0/publish/ "/a/projects/inno/version-sync/client/${FOLDER}"
# RESET TO DEVELOPMENT
sed -i 's|\"sandBox\".*|\"sandBox\": true,|g' "${FILE}"

View file

@ -21,7 +21,7 @@ sed -i 's|\"baseUrl\".*|\"baseUrl\": \"https://zeta.innotec.dk\",|g' "${FILE}"
dotnet clean
dotnet publish -c release
cp --recursive /a/projects/inno/a/Wonky.Client/Wonky.Client/bin/Release/net7.0/publish/ "/a/projects/inno/version-sync/client/${FOLDER}"
cp --recursive /a/projects/inno/a/Wonky.Client/Wonky.Client/bin/Release/net8.0/publish/ "/a/projects/inno/version-sync/client/${FOLDER}"
# RESET TO DEVELOPMENT
sed -i 's|\"sandBox\".*|\"sandBox\": true,|g' "${FILE}"