Fix inserimento primo record + blocco buttons spostamento

This commit is contained in:
Samuele Locatelli
2022-01-12 10:45:11 +01:00
parent 70f3cf9c5e
commit e1b1e0d48c
8 changed files with 34 additions and 30 deletions
+4 -1
View File
@@ -48,7 +48,10 @@
// recupero ultima fase x utente...
newItem = await GDataServ.RegAttLastByDip(1);
}
durata = newItem.Durata;
// calcolo durata arrotondata ai 5 minuti...
TimeOnly step = new TimeOnly(0, 5);
long ticks = (newItem.Durata.Ticks + step.Ticks - 1) / step.Ticks;
durata = new TimeSpan(ticks * step.Ticks);
newItem.IdxRa = 0;
newItem.Inizio = InizioPer;
newItem.Fine = InizioPer.AddMinutes(durata.TotalMinutes);
+3 -1
View File
@@ -26,6 +26,7 @@
}
else
{
<!-- Timbrature -->
<div class="d-flex justify-content-between text-center">
@if (@DayDTO != null && @DayDTO.ListTimbr != null)
{
@@ -35,10 +36,11 @@
}
}
</div>
<!-- RegAtt -->
<div class="d-flex justify-content-between text-center">
@if (@noData)
{
<AddRA NewItemCreated="ReportSelected" InizioPer="@DayDTO.DtRif.AddHours(StartHour)" IdxDip="@IdxDipSel"></AddRA>
<AddRA NewItemCreated="ReportSelected" InizioPer="@FirstTimb" IdxDip="@IdxDipSel"></AddRA>
}
else if (@DayDTO != null && @DayDTO.ListRA != null)
{
+19
View File
@@ -173,6 +173,11 @@ namespace GPW.CORE.UI.Components
}
}
/// <summary>
/// record prima timbratura x
/// </summary>
protected DateTime FirstTimb = DateTime.Now;
private List<PeriodoDTO> ListTimb()
{
// init
@@ -190,6 +195,20 @@ namespace GPW.CORE.UI.Components
var timbOUT = DayDTO.ListTimbr.Where(x => x.Entrata == false).ToList();
DateTime fineLav = currHour;
// sistemo la prima timbratura
if (timbIN.Count > 0)
{
var firstRec = timbIN.OrderBy(x => x.DataOra).FirstOrDefault();
if (firstRec != null)
{
// calcolo dataora approssimata arrotondando ai 5 minuti x difetto...
// https://stackoverflow.com/questions/1393696/rounding-datetime-objects
TimeOnly step = new TimeOnly(0, 5);
long ticks = (firstRec.DataOra.Ticks + step.Ticks - 1) / step.Ticks;
FirstTimb = new DateTime(ticks * step.Ticks, firstRec.DataOra.Kind);
}
}
// ciclo partendo dal primo evento timbratura IN ed aggiungendo eventuali periodi in testa / coda / intermedi
foreach (var item in timbIN)
{
+1 -1
View File
@@ -2,7 +2,7 @@
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Version>3.0.2201.1119</Version>
<Version>3.0.2201.1210</Version>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
+4 -24
View File
@@ -38,44 +38,24 @@ else if (ListTimbr != null)
<div class="col-12 col-lg-2 text-center">
<div class="btn-group w-100 mb-1">
<button class="btn btn-sm btn-dark pt-1 pb-0 @actionCss" @onclick="() => ResetWeek()" title="Ritorna a data corrente">
<button class="btn btn-sm btn-dark pt-1 pb-0 @actionCss" @onclick="() => ResetWeek()" title="Ritorna a data corrente" disabled="@isLoading">
<h3><i class="fas fa-home"></i> Week Plan</h3>
</button>
</div>
<div class="btn-group w-100">
<button class="btn btn-sm btn-info py-0 @actionCss" @onclick="() => MoveWeek(-4)" title="-4 settimane">
<button class="btn btn-sm btn-info py-0 @actionCss" @onclick="() => MoveWeek(-4)" title="-4 settimane" disabled="@isLoading">
<div><sub>@currWeekSel.inizio.ToString("dd.MM.yy")</sub></div>
<i class="fas fa-angle-double-left"></i>
</button>
<button class="btn btn-sm btn-primary py-0 @actionCss" @onclick="() => ShowSelPeriodo()" title="Imposta periodo">
<button class="btn btn-sm btn-primary py-0 @actionCss" @onclick="() => ShowSelPeriodo()" title="Imposta periodo" disabled="@isLoading">
<div>Week <b>@currWeekNum.ToString("00")</b></div>
<sub>@currYear</sub>
</button>
<button class="btn btn-sm btn-info py-0 @actionCss" @onclick="() => MoveWeek(4)" title="+4 settimane">
<button class="btn btn-sm btn-info py-0 @actionCss" @onclick="() => MoveWeek(4)" title="+4 settimane" disabled="@isLoading">
<div><sub>@currWeekSel.fine.ToString("dd.MM.yy")</sub></div>
<i class="fas fa-angle-double-right"></i>
</button>
</div>
@*<div class="d-flex justify-content-between">
<div class="py-0 px-1">
<button class="btn btn-sm btn-block btn-info" @onclick="() => MoveWeek(-4)">
<div><sub>@currWeekSel.inizio.ToString("dd.MM.yy")</sub></div>
<i class="fas fa-angle-double-left"></i>
</button>
</div>
<div class="py-0 px-1">
<button class="btn btn-sm btn-block btn-primary" @onclick="() => ShowSelPeriodo()">
<div>W <b>@currWeekNum.ToString("00")</b></div>
<sub>@currYear</sub>
</button>
</div>
<div class="py-0 px-1">
<button class="btn btn-sm btn-block btn-info" @onclick="() => MoveWeek(4)">
<div><sub>@currWeekSel.fine.ToString("dd.MM.yy")</sub></div>
<i class="fas fa-angle-double-right"></i>
</button>
</div>
</div>*@
</div>
<div class="col-12 col-lg-10">
@if (weekStatList != null)
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>GPW - Gestione Presenze Web</i>
<h4>Versione: 3.0.2201.1119</h4>
<h4>Versione: 3.0.2201.1210</h4>
<br /> Note di rilascio:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
3.0.2201.1119
3.0.2201.1210
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>3.0.2201.1119</version>
<version>3.0.2201.1210</version>
<url>http://nexus.steamware.net/repository/SWS/GWMS/stable/0/GWMS.UI.zip</url>
<changelog>http://nexus.steamware.net/repository/SWS/GWMS/stable/0/ChangeLog.html</changelog>
<mandatory>false</mandatory>