23 Commits

Author SHA1 Message Date
39c34e7c7d Finish v2.1.5(23) 2025-11-11 14:51:33 +01:00
1f530bc130 -> v2.1.5 (23) 2025-11-11 14:51:25 +01:00
a4c2eee49d Valorizzato tipoAnag 2025-11-11 13:38:53 +01:00
70a34eef06 Finish v2.1.4(22) 2025-11-11 11:59:28 +01:00
c61ebe348c Finish v2.1.4(22) 2025-11-11 11:59:27 +01:00
e586279c6b -> v2.1.4 (22) 2025-11-11 11:59:22 +01:00
85e227a5cb Fix apple 2025-11-11 11:58:51 +01:00
71ce027fb8 Finish v2.1.4(21) 2025-11-11 11:32:26 +01:00
9318d7bd3f Finish v2.1.4(21) 2025-11-11 11:32:25 +01:00
3ae0a7f7d1 -> v2.1.4 (21) 2025-11-11 11:32:14 +01:00
2879008c20 Fix apple 2025-11-11 11:31:48 +01:00
0dfc0baa28 Finish v2.1.3(20) 2025-11-05 15:22:59 +01:00
b423ce8d16 Finish v2.1.3(20) 2025-11-05 15:22:57 +01:00
514f98a8a7 -> v2.1.3 (20) 2025-11-05 15:22:51 +01:00
a26f1a57cc Aggiunto caricamento file 2025-11-05 15:20:27 +01:00
f4b2e70881 Ripristinata cancellazione documenti 2025-11-05 15:06:34 +01:00
bb0bf1e496 Fix 2025-11-05 11:44:47 +01:00
d0f961b052 Aggiunta forzatura della sinc dopo 7 giorni 2025-11-04 12:06:10 +01:00
61ea1776b3 Finish v2.1.1(18) 2025-11-04 07:32:23 +01:00
8dcd61b697 Finish v2.1.1(18) 2025-11-04 07:32:23 +01:00
2480a6a60c -> v2.1.1 (18) 2025-11-04 07:32:12 +01:00
dd5f354b14 Fix caricamento post prima login 2025-11-04 07:31:15 +01:00
6a8414ff6c Finish v2.1.0(17) 2025-11-03 15:03:15 +01:00
7 changed files with 87 additions and 43 deletions

View File

@@ -175,9 +175,7 @@ public class ManageDataService(
public async Task<List<ActivityDTO>> GetActivityTryLocalDb(WhereCondActivity whereCond)
{
List<StbActivity>? activities;
activities = await localDb.Get<StbActivity>(x =>
var activities = await localDb.Get<StbActivity>(x =>
(whereCond.ActivityId != null && x.ActivityId != null && whereCond.ActivityId.Equals(x.ActivityId)) ||
(whereCond.Start != null && whereCond.End != null && x.EffectiveTime == null &&
x.EstimatedTime >= whereCond.Start && x.EstimatedTime <= whereCond.End) ||
@@ -198,6 +196,7 @@ public class ManageDataService(
_ = UpdateDb(activities);
}
else return [];
return await MapActivity(activities);
}
@@ -219,16 +218,7 @@ public class ManageDataService(
_ = UpdateDb(activities);
}
else
{
activities = await localDb.Get<StbActivity>(x =>
(whereCond.ActivityId != null && x.ActivityId != null && whereCond.ActivityId.Equals(x.ActivityId)) ||
(whereCond.Start != null && whereCond.End != null && x.EffectiveTime == null &&
x.EstimatedTime >= whereCond.Start && x.EstimatedTime <= whereCond.End) ||
(x.EffectiveTime >= whereCond.Start && x.EffectiveTime <= whereCond.End) ||
(whereCond.ActivityId == null && (whereCond.Start == null || whereCond.End == null))
);
}
else return await GetActivityTryLocalDb(whereCond);
return await MapActivity(activities);
}

View File

@@ -51,6 +51,9 @@
<key>NSPhotoLibraryAddUsageDescription</key>
<string>Permette all'app di salvare file o immagini nella tua libreria fotografica se necessario.</string>
<key>NSBluetoothAlwaysUsageDescription</key>
<string>Alcune librerie di sistema potrebbero accedere al Bluetooth. Lapp non utilizza direttamente il Bluetooth.</string>
<key>UIBackgroundModes</key>
<array>
<string>remote-notification</string>

View File

@@ -29,8 +29,8 @@
<ApplicationId>it.integry.salesbook</ApplicationId>
<!-- Versions -->
<ApplicationDisplayVersion>2.1.0</ApplicationDisplayVersion>
<ApplicationVersion>17</ApplicationVersion>
<ApplicationDisplayVersion>2.1.5</ApplicationDisplayVersion>
<ApplicationVersion>23</ApplicationVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">14.2</SupportedOSPlatformVersion>
<!--<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">
@@ -120,6 +120,7 @@
<PublishTrimmed>true</PublishTrimmed>
<PublishAot>true</PublishAot>
<MonoAotMode>Hybrid</MonoAotMode>
<MtouchLink>None</MtouchLink>
</PropertyGroup>
<ItemGroup>

View File

@@ -492,6 +492,8 @@
// Selezione giorno in settimana
private async Task SelezionaData(DateTime day)
{
if (IsLoading) return;
SelectedDate = day;
var cacheInternalMonth = _internalMonth;
@@ -513,6 +515,8 @@
// Selezione giorno dal mese (chiude la vista mese!)
private async Task SelezionaDataDalMese(DateTime day)
{
if (IsLoading) return;
SelectedDate = day;
SliderAnimation = "collapse-animation";
Expanded = false;

View File

@@ -15,12 +15,22 @@
@inject PreloadService PreloadService
@inject IMessenger Messenger
<SpinnerLayout FullScreen="true" />
<SpinnerLayout FullScreen="true"/>
@code
{
protected override async Task OnInitializedAsync()
{
var lastSyncDate = LocalStorage.Get<DateTime>("last-sync");
var syncAllData = lastSyncDate.Equals(DateTime.MinValue) || (DateTime.Now - lastSyncDate).TotalDays >= 7;
if (!FormFactor.IsWeb() && NetworkService.ConnectionAvailable && syncAllData)
{
var returnPath = System.Web.HttpUtility.UrlEncode("/");
NavigationManager.NavigateTo($"/sync?path={returnPath}");
return;
}
NetworkService.ConnectionAvailable = NetworkService.IsNetworkAvailable();
await LoadNotification();
@@ -35,14 +45,6 @@
Console.WriteLine($"Firebase init: {e.Message}");
}
var lastSyncDate = LocalStorage.Get<DateTime>("last-sync");
if (!FormFactor.IsWeb() && NetworkService.ConnectionAvailable && lastSyncDate.Equals(DateTime.MinValue))
{
NavigationManager.NavigateTo("/sync");
return;
}
_ = StartSyncUser();
NavigationManager.NavigateTo("/Calendar");
}
@@ -60,9 +62,6 @@
private Task StartSyncUser()
{
return Task.Run(() =>
{
_ = PreloadService.PreloadUsersAsync();
});
return Task.Run(() => { _ = PreloadService.PreloadUsersAsync(); });
}
}

View File

@@ -214,29 +214,38 @@
@if (item.p.Type == AttachedDTO.TypeAttached.Position)
{
<MudChip T="string" Icon="@Icons.Material.Rounded.LocationOn" Color="Color.Success"
OnClick="() => OpenPosition(item.p)" OnClose="() => OnRemoveAttached(item.index)">
OnClick="@(() => OpenPosition(item.p))"
OnClose="@(() => OnRemoveAttached(item.index))">
@item.p.Description
</MudChip>
}
else
{
<MudChip T="string" Color="Color.Default" OnClick="() => OpenAttached(item.p)"
OnClose="() => OnRemoveAttached(item.index)">
<MudChip T="string" Color="Color.Default" OnClick="@(() => OpenAttached(item.p))"
OnClose="@(() => OnRemoveAttached(item.index))">
@item.p.Name
</MudChip>
}
}
}
@if (ActivityFileList != null)
@if (!IsLoading)
{
foreach (var file in ActivityFileList)
if (ActivityFileList != null)
{
<MudChip T="string" OnClick="() => OpenAttached(file.Id, file.FileName)" Color="Color.Default">
@file.FileName
</MudChip>
foreach (var file in ActivityFileList)
{
<MudChip T="string" OnClick="@(() => OpenAttached(file.Id, file.FileName))"
OnClose="@(() => DeleteAttach(file))" Color="Color.Default">
@file.FileName
</MudChip>
}
}
}
else
{
<MudProgressLinear Color="Color.Primary" Indeterminate="true" Class="my-7"/>
}
</div>
@if (!IsView)
@@ -318,6 +327,7 @@
private List<ActivityFileDto>? ActivityFileList { get; set; }
private bool IsNew { get; set; }
private bool IsLoading { get; set; }
private bool IsView => !NetworkService.ConnectionAvailable;
private string? LabelSave { get; set; }
@@ -443,6 +453,9 @@
{
return Task.Run(async () =>
{
IsLoading = true;
await InvokeAsync(StateHasChanged);
SelectedComessa = ActivityModel.Commessa;
Users = await ManageData.GetTable<StbUser>();
@@ -456,6 +469,7 @@
Clienti = await ManageData.GetClienti(new WhereCondContact { FlagStato = "A" });
Pros = await ManageData.GetProspect();
IsLoading = false;
await InvokeAsync(StateHasChanged);
});
}
@@ -479,8 +493,8 @@
if (ActivityModel.CodAnag == null)
{
Commesse = await ManageData.GetTable<JtbComt>(x =>
x.CodJcom.Contains(searchValue, StringComparison.OrdinalIgnoreCase) ||
x.Descrizione.Contains(searchValue, StringComparison.OrdinalIgnoreCase)
x.CodJcom.ToUpper().Contains(searchValue.ToUpper()) ||
x.Descrizione.ToUpper().Contains(searchValue.ToUpper())
);
}
else
@@ -544,11 +558,11 @@
var results = new List<string>();
results.AddRange(Clienti
.Where(x => x.RagSoc.Contains(value, StringComparison.OrdinalIgnoreCase))
.Where(x => (x.CodAnag != null && x.CodAnag.Contains(value, StringComparison.OrdinalIgnoreCase)) || x.RagSoc.Contains(value, StringComparison.OrdinalIgnoreCase))
.Select(x => $"{x.CodAnag} - {x.RagSoc}"));
results.AddRange(Pros
.Where(x => x.RagSoc.Contains(value, StringComparison.OrdinalIgnoreCase))
.Where(x => (x.CodPpro != null && x.CodPpro.Contains(value, StringComparison.OrdinalIgnoreCase)) || x.RagSoc.Contains(value, StringComparison.OrdinalIgnoreCase))
.Select(x => $"{x.CodPpro} - {x.RagSoc}"));
return Task.FromResult<IEnumerable<string>?>(results);
@@ -564,6 +578,9 @@
{
ActivityModel.CodAnag = parts[0];
ActivityModel.Cliente = parts[1];
var isCliente = Clienti.FirstOrDefault(x => x.CodAnag != null && x.CodAnag.Equals(ActivityModel.CodAnag));
ActivityModel.TipoAnag = isCliente == null ? "P" : "C";
}
OnAfterChangeValue();
@@ -581,6 +598,7 @@
if (com.CodAnag != null)
{
ActivityModel.CodAnag = com.CodAnag;
ActivityModel.TipoAnag = com.TipoAnag;
ActivityModel.Cliente = Clienti
.Where(x => x.CodAnag != null && x.CodAnag.Equals(com.CodAnag))
.Select(x => x.RagSoc)
@@ -593,6 +611,7 @@
{
ActivityModel.CodAnag = null;
ActivityModel.Cliente = null;
ActivityModel.TipoAnag = null;
}
}
else
@@ -601,6 +620,7 @@
ActivityModel.Commessa = null;
ActivityModel.CodAnag = null;
ActivityModel.Cliente = null;
ActivityModel.TipoAnag = null;
}
OnAfterChangeValue();
@@ -775,6 +795,33 @@
}
}
private async Task DeleteAttach(ActivityFileDto file)
{
Snackbar.Clear();
if (ActivityFileList == null) return;
try
{
ActivityFileList.Remove(file);
StateHasChanged();
await IntegryApiService.DeleteFile(ActivityModel.ActivityId!, file.FileName);
}
catch (Exception ex)
{
ActivityFileList.Add(file);
StateHasChanged();
Snackbar.Add("Impossibile eliminare il file", Severity.Error);
Console.WriteLine($"Impossibile eliminare il file: {ex.Message}");
}
finally
{
Snackbar.Add($"{file.FileName} eliminato con successo", Severity.Info);
}
}
private void OpenPosition(AttachedDTO attached)
{
if (attached is { Lat: not null, Lng: not null })
@@ -804,7 +851,7 @@
VisibleOverlay = true;
StateHasChanged();
_ = Task.Run(async () =>
{
var activityDescriptions = await IntegryApiService.SuggestActivityDescription(ActivityModel.ActivityTypeId);
@@ -813,7 +860,7 @@
if (modal is { IsCanceled: false, Result: not null })
ActivityModel.ActivityDescription = modal.Result.Data!.ToString();
VisibleOverlay = false;
await InvokeAsync(StateHasChanged);
});

View File

@@ -160,7 +160,7 @@ public class IntegryApiService(IIntegryApiRestClient integryApiRestClient, IUser
}
public Task<Stream> DownloadFile(string activityId, string fileName) =>
integryApiRestClient.Download($"downloadStbFileAttachment/{activityId}/{fileName}")!;
integryApiRestClient.Download($"downloadStbActivityFileAttachment/{activityId}/{fileName}")!;
public Task<Stream> DownloadFileFromRefUuid(string refUuid, string fileName)
{