27 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
b93f2f2d16 Finish v2.1.0(17) 2025-11-03 15:03:14 +01:00
a741d60e01 -> v2.1.0 (17) 2025-11-03 15:03:05 +01:00
5c1c9130ec Fix Apple 2025-11-03 15:02:08 +01:00
8a97506dfd Finish v2.1.0(16) 2025-10-30 13:45:06 +01:00
8 changed files with 121 additions and 55 deletions

View File

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

View File

@@ -51,6 +51,9 @@
<key>NSPhotoLibraryAddUsageDescription</key> <key>NSPhotoLibraryAddUsageDescription</key>
<string>Permette all'app di salvare file o immagini nella tua libreria fotografica se necessario.</string> <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> <key>UIBackgroundModes</key>
<array> <array>
<string>remote-notification</string> <string>remote-notification</string>

View File

@@ -2,10 +2,34 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>NSPrivacyTracking</key> <key>NSPrivacyAccessedAPITypes</key>
<false /> <array>
<key>NSPrivacyTrackingDomains</key> <dict>
<array /> <key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategoryUserDefaults</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>CA92.1</string>
</array>
</dict>
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategorySystemBootTime</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>35F9.1</string>
</array>
</dict>
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategoryFileTimestamp</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>C617.1</string>
</array>
</dict>
</array>
<key>NSPrivacyCollectedDataTypes</key> <key>NSPrivacyCollectedDataTypes</key>
<array> <array>
<dict> <dict>
@@ -14,10 +38,10 @@
<key>NSPrivacyCollectedDataTypeLinked</key> <key>NSPrivacyCollectedDataTypeLinked</key>
<false /> <false />
<key>NSPrivacyCollectedDataTypeTracking</key> <key>NSPrivacyCollectedDataTypeTracking</key>
<true /> <false />
<key>NSPrivacyCollectedDataTypePurposes</key> <key>NSPrivacyCollectedDataTypePurposes</key>
<array> <array>
<string>NSPrivacyCollectedDataTypePurposeAnalytics</string> <string>NSPrivacyCollectedDataTypePurposeAppFunctionality</string>
</array> </array>
</dict> </dict>
<dict> <dict>
@@ -26,10 +50,10 @@
<key>NSPrivacyCollectedDataTypeLinked</key> <key>NSPrivacyCollectedDataTypeLinked</key>
<false /> <false />
<key>NSPrivacyCollectedDataTypeTracking</key> <key>NSPrivacyCollectedDataTypeTracking</key>
<true /> <false />
<key>NSPrivacyCollectedDataTypePurposes</key> <key>NSPrivacyCollectedDataTypePurposes</key>
<array> <array>
<string>NSPrivacyCollectedDataTypePurposeAnalytics</string> <string>NSPrivacyCollectedDataTypePurposeAppFunctionality</string>
</array> </array>
</dict> </dict>
<dict> <dict>
@@ -38,10 +62,10 @@
<key>NSPrivacyCollectedDataTypeLinked</key> <key>NSPrivacyCollectedDataTypeLinked</key>
<false /> <false />
<key>NSPrivacyCollectedDataTypeTracking</key> <key>NSPrivacyCollectedDataTypeTracking</key>
<true /> <false />
<key>NSPrivacyCollectedDataTypePurposes</key> <key>NSPrivacyCollectedDataTypePurposes</key>
<array> <array>
<string>NSPrivacyCollectedDataTypePurposeAnalytics</string> <string>NSPrivacyCollectedDataTypePurposeAppFunctionality</string>
</array> </array>
</dict> </dict>
<dict> <dict>
@@ -81,7 +105,5 @@
</array> </array>
</dict> </dict>
</array> </array>
<key>NSPrivacyAccessedAPITypes</key>
<array />
</dict> </dict>
</plist> </plist>

View File

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

View File

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

View File

@@ -15,12 +15,22 @@
@inject PreloadService PreloadService @inject PreloadService PreloadService
@inject IMessenger Messenger @inject IMessenger Messenger
<SpinnerLayout FullScreen="true" /> <SpinnerLayout FullScreen="true"/>
@code @code
{ {
protected override async Task OnInitializedAsync() 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(); NetworkService.ConnectionAvailable = NetworkService.IsNetworkAvailable();
await LoadNotification(); await LoadNotification();
@@ -35,14 +45,6 @@
Console.WriteLine($"Firebase init: {e.Message}"); 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(); _ = StartSyncUser();
NavigationManager.NavigateTo("/Calendar"); NavigationManager.NavigateTo("/Calendar");
} }
@@ -60,9 +62,6 @@
private Task StartSyncUser() private Task StartSyncUser()
{ {
return Task.Run(() => return Task.Run(() => { _ = PreloadService.PreloadUsersAsync(); });
{
_ = PreloadService.PreloadUsersAsync();
});
} }
} }

View File

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

View File

@@ -160,7 +160,7 @@ public class IntegryApiService(IIntegryApiRestClient integryApiRestClient, IUser
} }
public Task<Stream> DownloadFile(string activityId, string fileName) => 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) public Task<Stream> DownloadFileFromRefUuid(string refUuid, string fileName)
{ {