53 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
56c7d80c7c Finish v2.1.0(16) 2025-10-30 13:45:05 +01:00
3d231ac7c7 -> v2.1.0 (16) 2025-10-30 13:44:32 +01:00
5814243c2b Fix Apple 2025-10-30 13:43:24 +01:00
f36741b8de Finish v2.1.0(15) 2025-10-30 12:13:51 +01:00
38eaaa9db2 Finish v2.1.0(15) 2025-10-30 12:13:50 +01:00
bd15ab5106 -> v2.1.0 (15) 2025-10-30 12:13:43 +01:00
42004f82a1 Fix keySensitive commessa 2025-10-30 12:13:08 +01:00
cf6e11193e Finish v2.1.0(14) 2025-10-30 11:35:30 +01:00
4698e43fd7 Finish v2.1.0(14) 2025-10-30 11:35:29 +01:00
5ade3b7a5f -> v2.1.0 (14) 2025-10-30 11:35:22 +01:00
b7522fb116 Aggiunto tasto per il suggerimento della descrizione attvità in base al tipo 2025-10-30 10:12:10 +01:00
a593141185 Aggiunta possibilità che dalla commessa viene selezionato il cliente 2025-10-30 09:33:48 +01:00
3609749a26 Fix build ios 2025-10-29 12:08:56 +01:00
48930550fe Finish v2.0.3(10) 2025-10-15 10:33:11 +02:00
11e7b04a88 Finish v2.0.3(10) 2025-10-15 10:33:10 +02:00
27588097a3 -> v2.0.3 (10) 2025-10-15 10:33:04 +02:00
934258d422 Fix sync 2025-10-15 10:32:24 +02:00
c3e646403b Aggiunta possibilità di rimozione allegati 2025-10-15 09:57:01 +02:00
effdc317c2 Fix date 2025-10-13 15:14:02 +02:00
9f95bb23e6 Fix vari 2025-10-03 16:32:16 +02:00
5016b3ed8d Finish v2.0.2(9) 2025-10-03 00:02:13 +02:00
5981691815 Finish v2.0.2(9) 2025-10-03 00:02:12 +02:00
f4621f48c8 -> 2.0.2 (9) 2025-10-03 00:02:08 +02:00
ff36b1cdab Fix salvataggio posizione 2025-10-02 23:48:14 +02:00
36fe05e3c3 Fix apertura fotocamera e fix codJcom interno 2025-10-01 12:35:34 +02:00
7359310c48 Finish v2.0.2(8) 2025-09-23 10:44:31 +02:00
29 changed files with 642 additions and 289 deletions

View File

@@ -8,7 +8,9 @@ public class AttachedService : IAttachedService
public async Task<AttachedDTO?> SelectImageFromCamera()
{
var cameraPerm = await Permissions.RequestAsync<Permissions.Camera>();
if (cameraPerm != PermissionStatus.Granted)
var storagePerm = await Permissions.RequestAsync<Permissions.StorageWrite>();
if (cameraPerm != PermissionStatus.Granted || storagePerm != PermissionStatus.Granted)
return null;
FileResult? result = null;
@@ -20,6 +22,7 @@ public class AttachedService : IAttachedService
catch (Exception ex)
{
Console.WriteLine($"Errore cattura foto: {ex.Message}");
SentrySdk.CaptureException(ex);
return null;
}
@@ -41,13 +44,13 @@ public class AttachedService : IAttachedService
catch (Exception ex)
{
Console.WriteLine($"Errore selezione galleria: {ex.Message}");
SentrySdk.CaptureException(ex);
return null;
}
return result is null ? null : await ConvertToDto(result, AttachedDTO.TypeAttached.Image);
}
public async Task<AttachedDTO?> SelectFile()
{
var perm = await Permissions.RequestAsync<Permissions.StorageRead>();
@@ -115,6 +118,7 @@ public class AttachedService : IAttachedService
catch (Exception e)
{
Console.WriteLine($"Errore durante il salvataggio dello stream: {e.Message}");
SentrySdk.CaptureException(e);
return null;
}
finally

View File

@@ -1,8 +1,8 @@
using AutoMapper;
using IntegryApiClient.Core.Domain.Abstraction.Contracts.Storage;
using salesbook.Shared.Core.Dto;
using salesbook.Shared.Core.Dto.Activity;
using salesbook.Shared.Core.Dto.Contact;
using salesbook.Shared.Core.Dto.PageState;
using salesbook.Shared.Core.Entity;
using salesbook.Shared.Core.Helpers;
using salesbook.Shared.Core.Helpers.Enum;
@@ -10,7 +10,7 @@ using salesbook.Shared.Core.Interface;
using salesbook.Shared.Core.Interface.IntegryApi;
using salesbook.Shared.Core.Interface.System.Network;
using System.Linq.Expressions;
using salesbook.Shared.Core.Dto.PageState;
using IntegryApiClient.Core.Domain.Abstraction.Contracts.Account;
namespace salesbook.Maui.Core.Services;
@@ -19,7 +19,8 @@ public class ManageDataService(
IMapper mapper,
UserListState userListState,
IIntegryApiService integryApiService,
INetworkService networkService
INetworkService networkService,
IUserSession userSession
) : IManageDataService
{
public Task<List<T>> GetTable<T>(Expression<Func<T, bool>>? whereCond = null) where T : new() =>
@@ -174,13 +175,11 @@ 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.EffectiveDate == null &&
x.EstimatedDate >= whereCond.Start && x.EstimatedDate <= whereCond.End) ||
(x.EffectiveDate >= whereCond.Start && x.EffectiveDate <= whereCond.End) ||
(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))
);
@@ -197,6 +196,7 @@ public class ManageDataService(
_ = UpdateDb(activities);
}
else return [];
return await MapActivity(activities);
}
@@ -218,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.EffectiveDate == null &&
x.EstimatedDate >= whereCond.Start && x.EstimatedDate <= whereCond.End) ||
(x.EffectiveDate >= whereCond.Start && x.EffectiveDate <= whereCond.End) ||
(whereCond.ActivityId == null && (whereCond.Start == null || whereCond.End == null))
);
}
else return await GetActivityTryLocalDb(whereCond);
return await MapActivity(activities);
}
@@ -260,6 +251,11 @@ public class ManageDataService(
var returnDto = activities
.Select(activity =>
{
if (activity.CodJcom is "0000" && userSession.ProfileDb != null && userSession.ProfileDb.Equals("smetar", StringComparison.OrdinalIgnoreCase))
{
activity.CodJcom = null;
}
var dto = mapper.Map<ActivityDTO>(activity);
if (activity is { AlarmTime: not null, EstimatedTime: not null })
@@ -302,6 +298,8 @@ public class ManageDataService(
private Task UpdateDbUsers(UsersSyncResponseDTO response)
{
return Task.Run(async () =>
{
try
{
if (response.AnagClie != null)
{
@@ -317,6 +315,13 @@ public class ManageDataService(
if (response.PtbProsRif != null) await localDb.InsertOrUpdate(response.PtbProsRif);
}
}
catch (Exception e)
{
Console.WriteLine(e.Message);
SentrySdk.CaptureException(e);
throw;
}
});
}

View File

@@ -1,4 +1,17 @@
<?xml version="1.0" encoding="utf-8" ?>
<linker>
<assembly fullname="salesbook.Shared" preserve="all" />
<assembly fullname="System.Private.CoreLib">
<type fullname="System.Runtime.InteropServices.SafeHandle" preserve="all" />
<type fullname="System.IO.FileStream" preserve="all" />
</assembly>
<assembly fullname="SourceGear.sqlite3" preserve="all"/>
<assembly fullname="sqlite-net-e" preserve="all"/>
<assembly fullname="Sentry.Maui" preserve="all"/>
<assembly fullname="Shiny.Hosting.Maui" preserve="all"/>
<assembly fullname="Shiny.Notifications" preserve="all"/>
<assembly fullname="Shiny.Push" preserve="all"/>
</linker>

View File

@@ -104,6 +104,9 @@ namespace salesbook.Maui
builder.Services.AddSingleton<INetworkService, NetworkService>();
builder.Services.AddSingleton<LocalDbService>();
_ = typeof(System.Runtime.InteropServices.SafeHandle);
_ = typeof(System.IO.FileStream);
return builder;
}
}

View File

@@ -1,27 +1,57 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="it.integry.salesbook">
<application android:allowBackup="true" android:icon="@mipmap/appicon" android:usesCleartextTraffic="true" android:supportsRtl="true">
<receiver android:name="com.google.firebase.iid.FirebaseInstanceIdInternalReceiver" android:exported="false" />
<receiver android:name="com.google.firebase.iid.FirebaseInstanceIdReceiver" android:exported="true" android:permission="com.google.android.c2dm.permission.SEND">
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="it.integry.salesbook">
<application
android:allowBackup="true"
android:icon="@mipmap/appicon"
android:usesCleartextTraffic="true"
android:supportsRtl="true">
<!-- Firebase push -->
<receiver android:name="com.google.firebase.iid.FirebaseInstanceIdInternalReceiver"
android:exported="false" />
<receiver android:name="com.google.firebase.iid.FirebaseInstanceIdReceiver"
android:exported="true"
android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="${applicationId}" />
</intent-filter>
</receiver>
</application>
<!-- Rete -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<!-- Geolocalizzazione -->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_MEDIA_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<!-- Fotocamera -->
<uses-permission android:name="android.permission.CAMERA" />
<!-- Storage / Media -->
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="28" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<!-- Android 10+ -->
<uses-permission android:name="android.permission.ACCESS_MEDIA_LOCATION" />
<!-- Android 13+ -->
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />
<uses-permission android:name="android.permission.READ_MEDIA_AUDIO" />
<!-- Background / Notifiche -->
<uses-permission android:name="android.permission.BATTERY_STATS" />
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.VIBRATE" />
</manifest>

View File

@@ -36,8 +36,11 @@
<true/>
</dict>
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>Questa app utilizza la tua posizione per migliorare alcune funzionalità basate sulla localizzazione.</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>L'app utilizza la tua posizione per allegarla alle attività.</string>
<string>Questa app utilizza la tua posizione solo mentre è in uso per allegarla alle attività.</string>
<key>NSCameraUsageDescription</key>
<string>Questa app necessita di accedere alla fotocamera per scattare foto.</string>
@@ -48,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

@@ -1,4 +1,3 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
@@ -7,10 +6,10 @@
<array>
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategoryFileTimestamp</string>
<string>NSPrivacyAccessedAPICategoryUserDefaults</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>C617.1</string>
<string>CA92.1</string>
</array>
</dict>
<dict>
@@ -23,29 +22,21 @@
</dict>
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategoryDiskSpace</string>
<string>NSPrivacyAccessedAPICategoryFileTimestamp</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>E174.1</string>
</array>
</dict>
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategoryUserDefaults</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>CA92.1</string>
<string>C617.1</string>
</array>
</dict>
</array>
<key>NSPrivacyCollectedDataTypes</key>
<array>
<!--user info-->
<dict>
<key>NSPrivacyCollectedDataTypeUserID</key>
<string>NSPrivacyCollectedDataTypeLocation</string>
<key>NSPrivacyCollectedDataType</key>
<string>NSPrivacyCollectedDataTypeCrashData</string>
<key>NSPrivacyCollectedDataTypeLinked</key>
<true />
<false />
<key>NSPrivacyCollectedDataTypeTracking</key>
<false />
<key>NSPrivacyCollectedDataTypePurposes</key>
@@ -54,10 +45,10 @@
</array>
</dict>
<dict>
<key>NSPrivacyCollectedDataTypeEmailAddress</key>
<string>NSPrivacyCollectedDataTypeLocation</string>
<key>NSPrivacyCollectedDataType</key>
<string>NSPrivacyCollectedDataTypePerformanceData</string>
<key>NSPrivacyCollectedDataTypeLinked</key>
<true />
<false />
<key>NSPrivacyCollectedDataTypeTracking</key>
<false />
<key>NSPrivacyCollectedDataTypePurposes</key>
@@ -65,20 +56,6 @@
<string>NSPrivacyCollectedDataTypePurposeAppFunctionality</string>
</array>
</dict>
<dict>
<key>NSPrivacyCollectedDataTypePhoneNumber</key>
<string>NSPrivacyCollectedDataTypeLocation</string>
<key>NSPrivacyCollectedDataTypeLinked</key>
<true />
<key>NSPrivacyCollectedDataTypeTracking</key>
<false />
<key>NSPrivacyCollectedDataTypePurposes</key>
<array>
<string>NSPrivacyCollectedDataTypePurposeAppFunctionality</string>
</array>
</dict>
<!--crashlytics/analytics-->
<dict>
<key>NSPrivacyCollectedDataType</key>
<string>NSPrivacyCollectedDataTypeOtherDiagnosticData</string>
@@ -93,9 +70,33 @@
</dict>
<dict>
<key>NSPrivacyCollectedDataType</key>
<string>NSPrivacyCollectedDataTypeCrashData</string>
<string>NSPrivacyCollectedDataTypePreciseLocation</string>
<key>NSPrivacyCollectedDataTypeLinked</key>
<true />
<false />
<key>NSPrivacyCollectedDataTypeTracking</key>
<false />
<key>NSPrivacyCollectedDataTypePurposes</key>
<array>
<string>NSPrivacyCollectedDataTypePurposeAppFunctionality</string>
</array>
</dict>
<dict>
<key>NSPrivacyCollectedDataType</key>
<string>NSPrivacyCollectedDataTypeCoarseLocation</string>
<key>NSPrivacyCollectedDataTypeLinked</key>
<false />
<key>NSPrivacyCollectedDataTypeTracking</key>
<false />
<key>NSPrivacyCollectedDataTypePurposes</key>
<array>
<string>NSPrivacyCollectedDataTypePurposeAppFunctionality</string>
</array>
</dict>
<dict>
<key>NSPrivacyCollectedDataType</key>
<string>NSPrivacyCollectedDataTypePhotosorVideos</string>
<key>NSPrivacyCollectedDataTypeLinked</key>
<false />
<key>NSPrivacyCollectedDataTypeTracking</key>
<false />
<key>NSPrivacyCollectedDataTypePurposes</key>
@@ -103,8 +104,6 @@
<string>NSPrivacyCollectedDataTypePurposeAppFunctionality</string>
</array>
</dict>
</array>
</dict>
</plist>

View File

@@ -1 +1,8 @@
<svg version="1.2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 230 230" width="230" height="230"><style>.a{fill:#dff2ff}</style><path fill-rule="evenodd" class="a" d="m230 0v230h-230v-230z"/></svg>
<svg version="1.2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 456 456" width="456" height="456">
<defs>
<image width="456" height="456" id="img1" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAcgAAAHIAQMAAADwb+ipAAAAAXNSR0IB2cksfwAAAANQTFRF3/L/KicjZQAAAGhJREFUeJztyzENAAAMA6DVv+l5aHrCT64V0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN05zNB6OcAcm2KNubAAAAAElFTkSuQmCC"/>
</defs>
<style>
</style>
<use id="Background" href="#img1" x="0" y="0"/>
</svg>

Before

Width:  |  Height:  |  Size: 201 B

After

Width:  |  Height:  |  Size: 522 B

View File

@@ -1 +1,10 @@
<svg version="1.2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 230 230" width="230" height="230"><style>.a{fill:none;stroke:#002339;stroke-linecap:round;stroke-linejoin:round;stroke-width:16}.b{fill:none;stroke:#00a0de;stroke-linecap:round;stroke-linejoin:round;stroke-width:16}</style><path fill-rule="evenodd" class="a" d="m119.9 71.4h34.4c20.3 0 36.8 16.5 36.8 36.9v28.3c0 20.4-16.5 36.9-36.8 36.9h-5.1l0.1 32.2-34.7-32.2h-72.2"/><path fill-rule="evenodd" class="b" d="m117.3 24l-77.1 47.4v102.1l77.1-47.4v-102.1z"/></svg>
<svg version="1.2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" width="1024" height="1024">
<defs>
<image width="920" height="920" id="img1" href="data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDIzMCAyMzAiIHdpZHRoPSIyMzAiIGhlaWdodD0iMjMwIj48c3R5bGU+LmF7ZmlsbDpub25lO3N0cm9rZTojMDAyMzM5O3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2Utd2lkdGg6MTZ9LmJ7ZmlsbDpub25lO3N0cm9rZTojMDBhMGRlO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2Utd2lkdGg6MTZ9PC9zdHlsZT48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsYXNzPSJhIiBkPSJtMTE5LjkgNzEuNGgzNC40YzIwLjMgMCAzNi44IDE2LjUgMzYuOCAzNi45djI4LjNjMCAyMC40LTE2LjUgMzYuOS0zNi44IDM2LjloLTUuMWwwLjEgMzIuMi0zNC43LTMyLjJoLTcyLjIiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsYXNzPSJiIiBkPSJtMTE3LjMgMjRsLTc3LjEgNDcuNHYxMDIuMWw3Ny4xLTQ3LjR2LTEwMi4xeiIvPjwvc3ZnPg=="/>
</defs>
<style>
</style>
<g>
<use id="appiconfg" href="#img1" transform="matrix(1.113,0,0,1.113,0,0)"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 529 B

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@@ -29,8 +29,8 @@
<ApplicationId>it.integry.salesbook</ApplicationId>
<!-- Versions -->
<ApplicationDisplayVersion>2.0.2</ApplicationDisplayVersion>
<ApplicationVersion>8</ApplicationVersion>
<ApplicationDisplayVersion>2.1.5</ApplicationDisplayVersion>
<ApplicationVersion>23</ApplicationVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">14.2</SupportedOSPlatformVersion>
<!--<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">
@@ -78,8 +78,8 @@
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)'=='net9.0-ios'">
<CodesignKey>Apple Development: Created via API (5B7B69P4JY)</CodesignKey>
<CodesignProvision>VS: it.integry.salesbook Development</CodesignProvision>
<CodesignKey>Apple Distribution: Integry S.r.l. (UNP26J4R89)</CodesignKey>
<CodesignProvision>salesbook</CodesignProvision>
<ProvisioningType>manual</ProvisioningType>
</PropertyGroup>
@@ -114,6 +114,15 @@
<RunAOTCompilation>true</RunAOTCompilation>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)'=='net9.0-ios' and '$(Configuration)'=='Release'">
<UseInterpreter>true</UseInterpreter>
<RunAOTCompilation>true</RunAOTCompilation>
<PublishTrimmed>true</PublishTrimmed>
<PublishAot>true</PublishAot>
<MonoAotMode>Hybrid</MonoAotMode>
<MtouchLink>None</MtouchLink>
</PropertyGroup>
<ItemGroup>
<TrimmerRootAssembly Include="salesbook.Shared" RootMode="All" />
<TrimmerRootDescriptor Include="ILLink.Descriptors.xml" />
@@ -147,13 +156,13 @@
<ItemGroup>
<PackageReference Include="CommunityToolkit.Maui" Version="12.2.0" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0" />
<PackageReference Include="IntegryApiClient.MAUI" Version="1.2.1" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.9" />
<PackageReference Include="Microsoft.Maui.Controls" Version="9.0.110" />
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="9.0.110" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebView.Maui" Version="9.0.110" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="9.0.9" />
<PackageReference Include="Sentry.Maui" Version="5.15.1" />
<PackageReference Include="IntegryApiClient.MAUI" Version="1.2.2" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.10" />
<PackageReference Include="Microsoft.Maui.Controls" Version="9.0.120" />
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="9.0.120" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebView.Maui" Version="9.0.120" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="9.0.10" />
<PackageReference Include="Sentry.Maui" Version="5.16.1" />
<PackageReference Include="Shiny.Hosting.Maui" Version="3.3.4" />
<PackageReference Include="Shiny.Notifications" Version="3.3.4" />
<PackageReference Include="Shiny.Push" Version="3.3.4" />

View File

@@ -181,7 +181,7 @@
private string _headerTitle = string.Empty;
private readonly Dictionary<DateTime, List<ActivityDTO>> _eventsCache = new();
private readonly Dictionary<DateTime, CategoryData[]> _categoriesCache = new();
private bool _isInitialized = false;
private bool _isInitialized;
// Stato UI
private bool Expanded { get; set; }
@@ -278,7 +278,7 @@
// Raggruppa le attività per data
var activitiesByDate = MonthActivities
.GroupBy(x => (x.EffectiveDate ?? x.EstimatedDate!).Value.Date)
.GroupBy(x => (x.EffectiveTime ?? x.EstimatedTime!).Value.Date)
.ToDictionary(g => g.Key, g => g.ToList());
foreach (var (date, activities) in activitiesByDate)
@@ -482,7 +482,7 @@
var start = CurrentMonth;
var end = start.AddDays(DaysInMonth - 1);
var activities = await ManageData.GetActivity(new WhereCondActivity{Start = start, End = end});
MonthActivities = activities.OrderBy(x => x.EffectiveDate ?? x.EstimatedDate).ToList();
MonthActivities = activities.OrderBy(x => x.EffectiveTime ?? x.EstimatedTime).ToList();
PrepareRenderingData();
IsLoading = false;
@@ -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;
@@ -574,7 +578,7 @@
return;
}
var date = activity.EffectiveDate ?? activity.EstimatedDate;
var date = activity.EffectiveTime ?? activity.EstimatedTime;
if (CurrentMonth.Month != date!.Value.Month)
{

View File

@@ -21,6 +21,16 @@
{
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

@@ -85,21 +85,21 @@
FullWidth="true"
StartIcon="@Icons.Material.Outlined.Sync"
Size="Size.Medium"
OnClick="() => UpdateDb(true)"
OnClick="() => UpdateDb()"
Variant="Variant.Outlined">
Sincronizza
</MudButton>
<div class="divider"></div>
@* <div class="divider"></div> *@
<MudButton Class="button-settings red-icon"
@* <MudButton Class="button-settings red-icon"
FullWidth="true"
StartIcon="@Icons.Material.Outlined.Sync"
Size="Size.Medium"
OnClick="() => UpdateDb()"
Variant="Variant.Outlined">
Ripristina dati
</MudButton>
</MudButton> *@
</div>
<div class="container-button">

View File

@@ -425,7 +425,7 @@ else
set
{
_filteredActivity = value;
StateHasChanged();
InvokeAsync(StateHasChanged);
}
}

View File

@@ -10,17 +10,17 @@
.activity-card.memo {
border-left: 5px solid var(--mud-palette-info-darken);
background-color: hsl(from var(--mud-palette-info-darken) h s 98%);
background-color: hsl(from var(--mud-palette-info-darken) h s 99%);
}
.activity-card.interna {
border-left: 5px solid var(--mud-palette-success-darken);
background-color: hsl(from var(--mud-palette-success-darken) h s 98%);
background-color: hsl(from var(--mud-palette-success-darken) h s 99%);
}
.activity-card.commessa {
border-left: 5px solid var(--mud-palette-warning);
background-color: hsl(from var(--mud-palette-warning) h s 98%);
background-color: hsl(from var(--mud-palette-warning) h s 99%);
}
.activity-left-section {

View File

@@ -20,17 +20,32 @@
<MudDialog Class="customDialog-form">
<DialogContent>
<HeaderLayout ShowProfile="false" Cancel="true" OnCancel="() => MudDialog.Cancel()" LabelSave="@LabelSave" OnSave="Save" Title="@(IsNew ? "Nuova" : $"{ActivityModel.ActivityId}")"/>
<HeaderLayout ShowProfile="false" Cancel="true" OnCancel="() => MudDialog.Cancel()" LabelSave="@LabelSave"
OnSave="Save" Title="@(IsNew ? "Nuova" : $"{ActivityModel.ActivityId}")"/>
<div class="content">
<div class="input-card">
<MudTextField ReadOnly="IsView" T="string?" Placeholder="Descrizione" Variant="Variant.Text" Lines="3" @bind-Value="ActivityModel.ActivityDescription" @bind-Value:after="OnAfterChangeValue" DebounceInterval="500" OnDebounceIntervalElapsed="OnAfterChangeValue"/>
<MudTextField ReadOnly="IsView" T="string?" Placeholder="Descrizione" Variant="Variant.Text" Lines="3"
@bind-Value="ActivityModel.ActivityDescription" @bind-Value:after="OnAfterChangeValue"
DebounceInterval="500" OnDebounceIntervalElapsed="OnAfterChangeValue"/>
</div>
<div class="container-button">
<MudButton Class="button-settings blue-icon"
FullWidth="true"
StartIcon="@Icons.Material.Rounded.Description"
Size="Size.Medium"
OnClick="@SuggestActivityDescription"
Variant="Variant.Outlined">
Suggerisci descrizione
</MudButton>
</div>
<div class="input-card">
<div class="form-container">
<MudAutocomplete ReadOnly="IsView" T="string?" Placeholder="Cliente"
SearchFunc="@SearchCliente" @bind-Value="ActivityModel.Cliente" @bind-Value:after="OnClienteChanged"
SearchFunc="@SearchCliente" @bind-Value="ActivityModel.Cliente"
@bind-Value:after="OnClienteChanged"
CoerceValue="true"/>
</div>
@@ -46,7 +61,6 @@
else
{
<MudAutocomplete
Disabled="ActivityModel.Cliente.IsNullOrEmpty()"
T="JtbComt?" ReadOnly="IsView"
@bind-Value="SelectedComessa"
@bind-Value:after="OnCommessaSelectedAfter"
@@ -66,7 +80,10 @@
<div class="form-container">
<span>Inizio</span>
<MudTextField ReadOnly="IsView" T="DateTime?" Format="s" Culture="CultureInfo.CurrentUICulture" InputType="InputType.DateTimeLocal" @bind-Value="ActivityModel.EstimatedTime" @bind-Value:after="OnAfterChangeValue" DebounceInterval="500" OnDebounceIntervalElapsed="OnAfterChangeValue"/>
<MudTextField ReadOnly="IsView" T="DateTime?" Format="s" Culture="CultureInfo.CurrentUICulture"
InputType="InputType.DateTimeLocal" @bind-Value="ActivityModel.EstimatedTime"
@bind-Value:after="OnAfterChangeValue" DebounceInterval="500"
OnDebounceIntervalElapsed="OnAfterChangeValue"/>
</div>
<div class="divider"></div>
@@ -74,7 +91,10 @@
<div class="form-container">
<span>Fine</span>
<MudTextField ReadOnly="IsView" T="DateTime?" Format="s" Culture="CultureInfo.CurrentUICulture" InputType="InputType.DateTimeLocal" @bind-Value="ActivityModel.EstimatedEndtime" @bind-Value:after="OnAfterChangeValue" DebounceInterval="500" OnDebounceIntervalElapsed="OnAfterChangeValue"/>
<MudTextField ReadOnly="IsView" T="DateTime?" Format="s" Culture="CultureInfo.CurrentUICulture"
InputType="InputType.DateTimeLocal" @bind-Value="ActivityModel.EstimatedEndtime"
@bind-Value:after="OnAfterChangeValue" DebounceInterval="500"
OnDebounceIntervalElapsed="OnAfterChangeValue"/>
</div>
<div class="divider"></div>
@@ -82,14 +102,31 @@
<div class="form-container">
<span class="disable-full-width">Avviso</span>
<MudSelectExtended FullWidth="true" ReadOnly="@(IsView || ActivityModel.EstimatedTime == null)" T="int" Variant="Variant.Text" @bind-Value="ActivityModel.MinuteBefore" @bind-Value:after="OnAfterChangeTimeBefore" Class="customIcon-select" AdornmentIcon="@Icons.Material.Filled.Code">
<MudSelectItemExtended Class="custom-item-select" Text="Nessuno" Value="-1">Nessuno</MudSelectItemExtended>
<MudSelectItemExtended Class="custom-item-select" Text="All'ora pianificata" Value="0">All'ora pianificata</MudSelectItemExtended>
<MudSelectItemExtended Class="custom-item-select" Text="30 minuti prima" Value="30">30 minuti prima</MudSelectItemExtended>
<MudSelectItemExtended Class="custom-item-select" Text="1 ora prima" Value="60">1 ora prima</MudSelectItemExtended>
<MudSelectItemExtended Class="custom-item-select" Text="2 ore prima" Value="120">2 ore prima</MudSelectItemExtended>
<MudSelectItemExtended Class="custom-item-select" Text="1 giorno prima" Value="1440">1 giorno prima</MudSelectItemExtended>
<MudSelectItemExtended Class="custom-item-select" Text="1 settimana prima" Value="10080">1 settimana prima</MudSelectItemExtended>
<MudSelectExtended FullWidth="true" ReadOnly="@(IsView || ActivityModel.EstimatedTime == null)"
T="int" Variant="Variant.Text" @bind-Value="ActivityModel.MinuteBefore"
@bind-Value:after="OnAfterChangeTimeBefore" Class="customIcon-select"
AdornmentIcon="@Icons.Material.Filled.Code">
<MudSelectItemExtended Class="custom-item-select" Text="Nessuno" Value="-1">
Nessuno
</MudSelectItemExtended>
<MudSelectItemExtended Class="custom-item-select" Text="All'ora pianificata" Value="0">All'ora
pianificata
</MudSelectItemExtended>
<MudSelectItemExtended Class="custom-item-select" Text="30 minuti prima" Value="30">
30 minuti prima
</MudSelectItemExtended>
<MudSelectItemExtended Class="custom-item-select" Text="1 ora prima" Value="60">
1 ora prima
</MudSelectItemExtended>
<MudSelectItemExtended Class="custom-item-select" Text="2 ore prima" Value="120">
2 ore prima
</MudSelectItemExtended>
<MudSelectItemExtended Class="custom-item-select" Text="1 giorno prima" Value="1440">
1 giorno prima
</MudSelectItemExtended>
<MudSelectItemExtended Class="custom-item-select" Text="1 settimana prima" Value="10080">
1 settimana prima
</MudSelectItemExtended>
</MudSelectExtended>
</div>
</div>
@@ -132,10 +169,14 @@
}
else
{
<MudSelectExtended ReadOnly="IsView" FullWidth="true" T="string?" Variant="Variant.Text" @bind-Value="ActivityModel.ActivityTypeId" @bind-Value:after="OnAfterChangeValue" Class="customIcon-select" AdornmentIcon="@Icons.Material.Filled.Code">
<MudSelectExtended ReadOnly="IsView" FullWidth="true" T="string?" Variant="Variant.Text"
@bind-Value="ActivityModel.ActivityTypeId"
@bind-Value:after="OnAfterChangeValue" Class="customIcon-select"
AdornmentIcon="@Icons.Material.Filled.Code">
@foreach (var type in ActivityType)
{
<MudSelectItemExtended Class="custom-item-select" Value="@type.ActivityTypeId">@type.ActivityTypeId</MudSelectItemExtended>
<MudSelectItemExtended Class="custom-item-select"
Value="@type.ActivityTypeId">@type.ActivityTypeId</MudSelectItemExtended>
}
</MudSelectExtended>
}
@@ -146,17 +187,23 @@
<div class="form-container" @onclick="OpenSelectEsito">
<span class="disable-full-width">Esito</span>
<MudSelectExtended ReadOnly="true" FullWidth="true" T="string?" Variant="Variant.Text" @bind-Value="ActivityModel.ActivityResultId" @bind-Value:after="OnAfterChangeValue" Class="customIcon-select" AdornmentIcon="@Icons.Material.Filled.Code">
<MudSelectExtended ReadOnly="true" FullWidth="true" T="string?" Variant="Variant.Text"
@bind-Value="ActivityModel.ActivityResultId"
@bind-Value:after="OnAfterChangeValue" Class="customIcon-select"
AdornmentIcon="@Icons.Material.Filled.Code">
@foreach (var result in ActivityResult)
{
<MudSelectItemExtended Class="custom-item-select" Value="@result.ActivityResultId">@result.ActivityResultId</MudSelectItemExtended>
<MudSelectItemExtended Class="custom-item-select"
Value="@result.ActivityResultId">@result.ActivityResultId</MudSelectItemExtended>
}
</MudSelectExtended>
</div>
</div>
<div class="input-card">
<MudTextField ReadOnly="IsView" T="string?" Placeholder="Note" Variant="Variant.Text" Lines="4" @bind-Value="ActivityModel.Note" @bind-Value:after="OnAfterChangeValue" DebounceInterval="500" OnDebounceIntervalElapsed="OnAfterChangeValue"/>
<MudTextField ReadOnly="IsView" T="string?" Placeholder="Note" Variant="Variant.Text" Lines="4"
@bind-Value="ActivityModel.Note" @bind-Value:after="OnAfterChangeValue"
DebounceInterval="500" OnDebounceIntervalElapsed="OnAfterChangeValue"/>
</div>
<div class="container-chip-attached">
@@ -166,28 +213,39 @@
{
@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)">
<MudChip T="string" Icon="@Icons.Material.Rounded.LocationOn" Color="Color.Success"
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)
{
if (ActivityFileList != null)
{
foreach (var file in ActivityFileList)
{
<MudChip T="string" OnClick="() => OpenAttached(file.Id, file.FileName)" Color="Color.Default">
<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)
@@ -246,7 +304,8 @@
<SaveOverlay VisibleOverlay="VisibleOverlay" SuccessAnimation="SuccessAnimation"/>
<SelectEsito @bind-IsSheetVisible="OpenEsito" @bind-ActivityModel="ActivityModel" @bind-ActivityModel:after="OnAfterChangeEsito"/>
<SelectEsito @bind-IsSheetVisible="OpenEsito" @bind-ActivityModel="ActivityModel"
@bind-ActivityModel:after="OnAfterChangeEsito"/>
<AddMemo @bind-IsSheetVisible="OpenAddMemo"/>
@@ -268,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; }
@@ -393,6 +453,9 @@
{
return Task.Run(async () =>
{
IsLoading = true;
await InvokeAsync(StateHasChanged);
SelectedComessa = ActivityModel.Commessa;
Users = await ManageData.GetTable<StbUser>();
@@ -406,6 +469,7 @@
Clienti = await ManageData.GetClienti(new WhereCondContact { FlagStato = "A" });
Pros = await ManageData.GetProspect();
IsLoading = false;
await InvokeAsync(StateHasChanged);
});
}
@@ -422,18 +486,29 @@
);
}
private async Task LoadCommesse()
private async Task LoadCommesse(string searchValue)
{
if (_lastLoadedCodAnag == ActivityModel.CodAnag) return;
if (_lastLoadedCodAnag == ActivityModel.CodAnag && searchValue.IsNullOrEmpty()) return;
if (ActivityModel.CodAnag == null)
{
Commesse = await ManageData.GetTable<JtbComt>(x =>
x.CodJcom.ToUpper().Contains(searchValue.ToUpper()) ||
x.Descrizione.ToUpper().Contains(searchValue.ToUpper())
);
}
else
{
Commesse = await ManageData.GetTable<JtbComt>(x => x.CodAnag == ActivityModel.CodAnag);
}
Commesse = Commesse.OrderByDescending(x => x.CodJcom).ToList();
_lastLoadedCodAnag = ActivityModel.CodAnag;
}
private async Task<IEnumerable<JtbComt>> SearchCommesseAsync(string value, CancellationToken token)
{
await LoadCommesse();
await LoadCommesse(value);
if (Commesse.IsNullOrEmpty()) return [];
IEnumerable<JtbComt> list;
@@ -483,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);
@@ -503,24 +578,49 @@
{
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();
return Task.CompletedTask;
}
private async Task OnCommessaSelectedAfter()
private void OnCommessaSelectedAfter()
{
var com = SelectedComessa;
if (com != null)
{
ActivityModel.CodJcom = com.CodJcom;
ActivityModel.Commessa = com;
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)
.FirstOrDefault() ?? Pros
.Where(x => x.CodPpro != null && x.CodPpro.Equals(com.CodAnag))
.Select(x => x.RagSoc)
.FirstOrDefault();
}
else
{
ActivityModel.CodAnag = null;
ActivityModel.Cliente = null;
ActivityModel.TipoAnag = null;
}
}
else
{
ActivityModel.CodJcom = null;
ActivityModel.Commessa = null;
ActivityModel.CodAnag = null;
ActivityModel.Cliente = null;
ActivityModel.TipoAnag = null;
}
OnAfterChangeValue();
@@ -695,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 })
@@ -714,4 +841,29 @@
private static string AdjustCoordinate(double coordinate) =>
coordinate.ToString(CultureInfo.InvariantCulture).Replace(",", ".");
private async Task SuggestActivityDescription()
{
if (ActivityModel.ActivityTypeId == null)
{
Snackbar.Add("Indicare prima il tipo attività", Severity.Error);
return;
}
VisibleOverlay = true;
StateHasChanged();
_ = Task.Run(async () =>
{
var activityDescriptions = await IntegryApiService.SuggestActivityDescription(ActivityModel.ActivityTypeId);
var modal = ModalHelpers.OpenSuggestActivityDescription(Dialog, activityDescriptions);
if (modal is { IsCanceled: false, Result: not null })
ActivityModel.ActivityDescription = modal.Result.Data!.ToString();
VisibleOverlay = false;
await InvokeAsync(StateHasChanged);
});
}
}

View File

@@ -6,7 +6,7 @@
<MudDialog Class="customDialog-form disable-safe-area">
<DialogContent>
<HeaderLayout ShowProfile="false" SmallHeader="true" Cancel="true" OnCancel="() => MudDialog.Cancel()" Title="Aggiungi allegati"/>
<HeaderLayout ShowProfile="false" SmallHeader="true" Cancel="true" OnCancel="() => MudDialog.Cancel()" Title="@TitleModal"/>
@if (RequireNewName)
{
@@ -71,9 +71,21 @@
private AttachedDTO? Attached { get; set; }
private bool RequireNewName { get; set; }
private bool _requireNewName;
private bool RequireNewName
{
get => _requireNewName;
set
{
_requireNewName = value;
TitleModal = _requireNewName ? "Nome allegato" : "Aggiungi allegati";
StateHasChanged();
}
}
private bool SelectTypePicture { get; set; }
private string TitleModal { get; set; } = "Aggiungi allegati";
private string? _newName;
private string? NewName
{
@@ -102,17 +114,23 @@
{
Attached = await AttachedService.SelectImageFromCamera();
if (Attached != null)
{
RequireNewName = true;
StateHasChanged();
}
}
private async Task OnGallery()
{
Attached = await AttachedService.SelectImageFromGallery();
if (Attached != null)
{
RequireNewName = true;
StateHasChanged();
}
}
private async Task OnFile()
{
@@ -124,11 +142,16 @@
{
Attached = await AttachedService.SelectPosition();
if (Attached != null)
{
RequireNewName = true;
StateHasChanged();
}
}
private void OnNewName()
{
if (Attached != null)
{
switch (Attached.Type)
{
@@ -153,6 +176,7 @@
default:
throw new ArgumentOutOfRangeException();
}
}
MudDialog.Close(Attached);
}

View File

@@ -0,0 +1,32 @@
@using salesbook.Shared.Core.Entity
<MudDialog OnBackdropClick="Cancel">
<DialogContent>
@if (!ActivityTypers.IsNullOrEmpty())
{
<MudList T="string" SelectedValueChanged="OnClickItem">
@foreach (var item in ActivityTypers!)
{
<MudListItem Text="@item.ActivityTypeDescription" Value="item.ActivityTypeDescription"/>
}
</MudList>
}
else
{
<div class="spinner-container">
<MudIcon Size="Size.Large" Color="Color.Error" Icon="@Icons.Material.Rounded.Close"/>
<MudText>Nessuna descrizione consigliata</MudText>
</div>
}
</DialogContent>
</MudDialog>
@code {
[CascadingParameter] private IMudDialogInstance MudDialog { get; set; }
[Parameter] public List<StbActivityTyper>? ActivityTypers { get; set; }
private void Cancel() => MudDialog.Cancel();
private void OnClickItem(string? selectedValue) =>
MudDialog.Close(DialogResult.Ok(selectedValue));
}

View File

@@ -18,6 +18,7 @@ public class ActivityDTO : StbActivity
public bool Deleted { get; set; }
[JsonPropertyName("stbPosizioni")]
public PositionDTO? Position { get; set; }
public ActivityDTO Clone()
@@ -33,7 +34,7 @@ public class ActivityDTO : StbActivity
MinuteBefore == other.MinuteBefore &&
NotificationDate == other.NotificationDate &&
Category == other.Category &&
Complete == other.Complete && ActivityId == other.ActivityId && ActivityResultId == other.ActivityResultId && ActivityTypeId == other.ActivityTypeId && DataInsAct.Equals(other.DataInsAct) && ActivityDescription == other.ActivityDescription && ParentActivityId == other.ParentActivityId && TipoAnag == other.TipoAnag && CodAnag == other.CodAnag && CodJcom == other.CodJcom && CodJfas == other.CodJfas && Nullable.Equals(EstimatedDate, other.EstimatedDate) && Nullable.Equals(EstimatedTime, other.EstimatedTime) && Nullable.Equals(AlarmDate, other.AlarmDate) && Nullable.Equals(AlarmTime, other.AlarmTime) && Nullable.Equals(EffectiveDate, other.EffectiveDate) && Nullable.Equals(EffectiveTime, other.EffectiveTime) && ResultDescription == other.ResultDescription && Nullable.Equals(EstimatedEnddate, other.EstimatedEnddate) && Nullable.Equals(EstimatedEndtime, other.EstimatedEndtime) && Nullable.Equals(EffectiveEnddate, other.EffectiveEnddate) && Nullable.Equals(EffectiveEndtime, other.EffectiveEndtime) && UserCreator == other.UserCreator && UserName == other.UserName && Nullable.Equals(PercComp, other.PercComp) && Nullable.Equals(EstimatedHours, other.EstimatedHours) && CodMart == other.CodMart && PartitaMag == other.PartitaMag && Matricola == other.Matricola && Priorita == other.Priorita && Nullable.Equals(ActivityPlayCounter, other.ActivityPlayCounter) && ActivityEvent == other.ActivityEvent && Guarantee == other.Guarantee && Note == other.Note && Rfid == other.Rfid && IdLotto == other.IdLotto && PersonaRif == other.PersonaRif && HrNum == other.HrNum && Gestione == other.Gestione && Nullable.Equals(DataOrd, other.DataOrd) && NumOrd == other.NumOrd && IdStep == other.IdStep && IdRiga == other.IdRiga && Nullable.Equals(OraInsAct, other.OraInsAct) && IndiceGradimento == other.IndiceGradimento && NoteGradimento == other.NoteGradimento && FlagRisolto == other.FlagRisolto && FlagTipologia == other.FlagTipologia && OreRapportino == other.OreRapportino && UserModifier == other.UserModifier && Nullable.Equals(OraModAct, other.OraModAct) && Nullable.Equals(OraViewAct, other.OraViewAct) && CodVdes == other.CodVdes && CodCmac == other.CodCmac && WrikeId == other.WrikeId && CodMgrp == other.CodMgrp && PlanId == other.PlanId;
Complete == other.Complete && ActivityId == other.ActivityId && ActivityResultId == other.ActivityResultId && ActivityTypeId == other.ActivityTypeId && DataInsAct.Equals(other.DataInsAct) && ActivityDescription == other.ActivityDescription && ParentActivityId == other.ParentActivityId && TipoAnag == other.TipoAnag && CodAnag == other.CodAnag && CodJcom == other.CodJcom && CodJfas == other.CodJfas && Nullable.Equals(EstimatedTime, other.EstimatedTime) && Nullable.Equals(AlarmDate, other.AlarmDate) && Nullable.Equals(AlarmTime, other.AlarmTime) && Nullable.Equals(EffectiveTime, other.EffectiveTime) && ResultDescription == other.ResultDescription && Nullable.Equals(EstimatedEndtime, other.EstimatedEndtime) && Nullable.Equals(EffectiveEndtime, other.EffectiveEndtime) && UserCreator == other.UserCreator && UserName == other.UserName && Nullable.Equals(PercComp, other.PercComp) && Nullable.Equals(EstimatedHours, other.EstimatedHours) && CodMart == other.CodMart && PartitaMag == other.PartitaMag && Matricola == other.Matricola && Priorita == other.Priorita && Nullable.Equals(ActivityPlayCounter, other.ActivityPlayCounter) && ActivityEvent == other.ActivityEvent && Guarantee == other.Guarantee && Note == other.Note && Rfid == other.Rfid && IdLotto == other.IdLotto && PersonaRif == other.PersonaRif && HrNum == other.HrNum && Gestione == other.Gestione && Nullable.Equals(DataOrd, other.DataOrd) && NumOrd == other.NumOrd && IdStep == other.IdStep && IdRiga == other.IdRiga && Nullable.Equals(OraInsAct, other.OraInsAct) && IndiceGradimento == other.IndiceGradimento && NoteGradimento == other.NoteGradimento && FlagRisolto == other.FlagRisolto && FlagTipologia == other.FlagTipologia && OreRapportino == other.OreRapportino && UserModifier == other.UserModifier && Nullable.Equals(OraModAct, other.OraModAct) && Nullable.Equals(OraViewAct, other.OraViewAct) && CodVdes == other.CodVdes && CodCmac == other.CodCmac && WrikeId == other.WrikeId && CodMgrp == other.CodMgrp && PlanId == other.PlanId;
}
public override bool Equals(object? obj)
@@ -56,16 +57,12 @@ public class ActivityDTO : StbActivity
hashCode.Add(CodAnag);
hashCode.Add(CodJcom);
hashCode.Add(CodJfas);
hashCode.Add(EstimatedDate);
hashCode.Add(EstimatedTime);
hashCode.Add(AlarmDate);
hashCode.Add(AlarmTime);
hashCode.Add(EffectiveDate);
hashCode.Add(EffectiveTime);
hashCode.Add(ResultDescription);
hashCode.Add(EstimatedEnddate);
hashCode.Add(EstimatedEndtime);
hashCode.Add(EffectiveEnddate);
hashCode.Add(EffectiveEndtime);
hashCode.Add(UserCreator);
hashCode.Add(UserName);

View File

@@ -7,7 +7,7 @@ public class PositionDTO
[JsonPropertyName("id")]
public long? Id { get; set; }
[JsonPropertyName("description")]
[JsonPropertyName("descrizione")]
public string? Description { get; set; }
[JsonPropertyName("lat")]

View File

@@ -7,7 +7,7 @@ namespace salesbook.Shared.Core.Entity;
public class PtbProsRif
{
[PrimaryKey, Column("composite_key")]
public string CompositeKey { get; set; }
public string CompositeKey { get; set; } = null!;
private string? _codPpro;

View File

@@ -36,9 +36,6 @@ public class StbActivity
[Column("cod_jfas"), JsonPropertyName("codJfas")]
public string? CodJfas { get; set; }
[Column("estimated_date"), JsonPropertyName("estimatedDate")]
public DateTime? EstimatedDate { get; set; }
[Column("estimated_time"), JsonPropertyName("estimatedTime")]
public DateTime? EstimatedTime { get; set; }
@@ -48,24 +45,15 @@ public class StbActivity
[Column("alarm_time"), JsonPropertyName("alarmTime")]
public DateTime? AlarmTime { get; set; }
[Column("effective_date"), JsonPropertyName("effectiveDate")]
public DateTime? EffectiveDate { get; set; }
[Column("effective_time"), JsonPropertyName("effectiveTime")]
public DateTime? EffectiveTime { get; set; }
[Column("result_description"), JsonPropertyName("resultDescription")]
public string? ResultDescription { get; set; }
[Column("estimated_enddate"), JsonPropertyName("estimatedEnddate")]
public DateTime? EstimatedEnddate { get; set; }
[Column("estimated_endtime"), JsonPropertyName("estimatedEndtime")]
public DateTime? EstimatedEndtime { get; set; }
[Column("effective_enddate"), JsonPropertyName("effectiveEnddate")]
public DateTime? EffectiveEnddate { get; set; }
[Column("effective_endtime"), JsonPropertyName("effectiveEndtime")]
public DateTime? EffectiveEndtime { get; set; }
@@ -173,4 +161,7 @@ public class StbActivity
[Column("plan_id"), JsonPropertyName("planId")]
public long? PlanId { get; set; }
[Column("id_posizione"), JsonPropertyName("idPosizione")]
public long? IdPosizione { get; set; }
}

View File

@@ -0,0 +1,18 @@
using System.Text.Json.Serialization;
namespace salesbook.Shared.Core.Entity;
public class StbActivityTyper
{
[JsonPropertyName("activityTypeId")]
public string? ActivityTypeId { get; set; }
[JsonPropertyName("activityTypeDescription")]
public string? ActivityTypeDescription { get; set; }
[JsonPropertyName("flagTipologia")]
public string? FlagTipologia { get; set; }
[JsonPropertyName("idRiga")]
public int IdRiga { get; set; }
}

View File

@@ -2,6 +2,7 @@
using salesbook.Shared.Components.SingleElements.Modal;
using salesbook.Shared.Core.Dto;
using salesbook.Shared.Core.Dto.Activity;
using salesbook.Shared.Core.Entity;
namespace salesbook.Shared.Core.Helpers;
@@ -87,4 +88,25 @@ public class ModalHelpers
return await modal.Result;
}
public static async Task<DialogResult?> OpenSuggestActivityDescription(IDialogService dialog,
List<StbActivityTyper>? activityTypers)
{
var modal = await dialog.ShowAsync<ModalSuggestDescription>(
"Suggest activity description",
new DialogParameters<ModalSuggestDescription>
{
{ x => x.ActivityTypers, activityTypers }
},
new DialogOptions
{
FullScreen = false,
CloseButton = false,
NoHeader = true,
BackdropClick = false
}
);
return await modal.Result;
}
}

View File

@@ -25,15 +25,18 @@ public interface IIntegryApiService
Task<CRMTransferProspectResponseDTO> TransferProspect(CRMTransferProspectRequestDTO request);
Task UploadFile(string id, byte[] file, string fileName);
Task DeleteFile(string activityId, string fileName);
Task<List<ActivityFileDto>> GetActivityFile(string activityId);
Task<Stream> DownloadFile(string activityId, string fileName);
Task<Stream> DownloadFileFromRefUuid(string refUuid, string fileName);
Task<CRMJobProgressResponseDTO> RetrieveJobProgress(string codJcom);
Task<List<StbActivityTyper>?> SuggestActivityDescription(string activityType);
//Position
Task<PositionDTO> SavePosition(PositionDTO position);
Task<PositionDTO> RetrievePosition(string id);
Task<PositionDTO> RetrievePosition(long id);
//Google
Task<List<IndirizzoDTO>?> Geocode(string address);

View File

@@ -72,8 +72,16 @@ public class IntegryApiService(IIntegryApiRestClient integryApiRestClient, IUser
return integryApiRestClient.AuthorizedGet<object>($"activity/delete", queryParams);
}
public Task<List<StbActivity>?> SaveActivity(ActivityDTO activity) =>
integryApiRestClient.AuthorizedPost<List<StbActivity>?>("crm/saveActivity", activity);
public Task<List<StbActivity>?> SaveActivity(ActivityDTO activity)
{
if (activity.CodJcom is null && userSession.ProfileDb != null &&
userSession.ProfileDb.Equals("smetar", StringComparison.OrdinalIgnoreCase))
{
activity.CodJcom = "0000";
}
return integryApiRestClient.AuthorizedPost<List<StbActivity>?>("crm/saveActivity", activity);
}
public Task<CRMCreateContactResponseDTO?> SaveContact(CRMCreateContactRequestDTO request) =>
integryApiRestClient.AuthorizedPost<CRMCreateContactResponseDTO>("crm/createContact", request);
@@ -127,7 +135,18 @@ public class IntegryApiService(IIntegryApiRestClient integryApiRestClient, IUser
fileContent.Headers.ContentType = MediaTypeHeaderValue.Parse("multipart/form-data");
content.Add(fileContent, "files", fileName);
return integryApiRestClient.Post<object>($"uploadStbActivityFileAttachment", content, queryParams);
return integryApiRestClient.Post<object>("uploadStbActivityFileAttachment", content, queryParams);
}
public Task DeleteFile(string activityId, string fileName)
{
var queryParams = new Dictionary<string, object>
{
{ "activityId", activityId },
{ "fileName", fileName }
};
return integryApiRestClient.Get<object>("activity/removeAttachment", queryParams);
}
public Task<List<ActivityFileDto>> GetActivityFile(string activityId)
@@ -141,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)
{
@@ -157,7 +176,7 @@ public class IntegryApiService(IIntegryApiRestClient integryApiRestClient, IUser
public Task<PositionDTO> SavePosition(PositionDTO position) =>
integryApiRestClient.Post<PositionDTO>("savePosition", position)!;
public Task<PositionDTO> RetrievePosition(string id)
public Task<PositionDTO> RetrievePosition(long id)
{
var queryParams = new Dictionary<string, object> { { "id", id } };
@@ -170,4 +189,10 @@ public class IntegryApiService(IIntegryApiRestClient integryApiRestClient, IUser
return integryApiRestClient.Get<CRMJobProgressResponseDTO>("crm/retrieveJobProgress", queryParams)!;
}
public Task<List<StbActivityTyper>?> SuggestActivityDescription(string activityType) =>
integryApiRestClient.Get<List<StbActivityTyper>>(
"activity/suggestActivityDescription",
new Dictionary<string, object> { { "activityType", activityType } }
);
}

View File

@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">
<Project Sdk="Microsoft.NET.Sdk.Razor">
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
@@ -24,14 +24,14 @@
<PackageReference Include="AutoMapper" Version="14.0.0" />
<PackageReference Include="CodeBeam.MudBlazor.Extensions" Version="8.2.4" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0" />
<PackageReference Include="IntegryApiClient.Core" Version="1.2.1" />
<PackageReference Include="Microsoft.AspNetCore.Components.Authorization" Version="9.0.9" />
<PackageReference Include="Microsoft.Maui.Essentials" Version="9.0.110" />
<PackageReference Include="IntegryApiClient.Core" Version="1.2.2" />
<PackageReference Include="Microsoft.AspNetCore.Components.Authorization" Version="9.0.10" />
<PackageReference Include="Microsoft.Maui.Essentials" Version="9.0.120" />
<PackageReference Include="SourceGear.sqlite3" Version="3.50.4.2" />
<PackageReference Include="sqlite-net-e" Version="1.10.0-beta2" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="8.14.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="9.0.9" />
<PackageReference Include="MudBlazor" Version="8.12.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="9.0.10" />
<PackageReference Include="MudBlazor" Version="8.13.0" />
<PackageReference Include="MudBlazor.ThemeManager" Version="3.0.0" />
</ItemGroup>

View File

@@ -16,10 +16,10 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="IntegryApiClient.Blazor" Version="1.2.1" />
<PackageReference Include="Microsoft.AspNetCore.Components.Authorization" Version="9.0.9" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="9.0.9" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="9.0.9" />
<PackageReference Include="IntegryApiClient.Blazor" Version="1.2.2" />
<PackageReference Include="Microsoft.AspNetCore.Components.Authorization" Version="9.0.10" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="9.0.10" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="9.0.10" />
</ItemGroup>
<ItemGroup>