From ea20400f43a5f43344968198a4f0ef8350205b79 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Fri, 3 Mar 2023 13:38:24 +0200 Subject: [PATCH 1/3] Show unapplied credit on the mobile app --- lib/ui/client/view/client_view_overview.dart | 25 ++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/lib/ui/client/view/client_view_overview.dart b/lib/ui/client/view/client_view_overview.dart index 1ee2c5604a2..c76bc8ed72d 100644 --- a/lib/ui/client/view/client_view_overview.dart +++ b/lib/ui/client/view/client_view_overview.dart @@ -1,5 +1,6 @@ // Flutter imports: import 'package:flutter/material.dart'; +import 'package:invoiceninja_flutter/redux/client/client_selectors.dart'; import 'package:invoiceninja_flutter/ui/app/portal_links.dart'; // Package imports: @@ -118,6 +119,11 @@ class ClientOverview extends StatelessWidget { value: client.customValue4); } + final availableCredits = + memoizedGetClientAvailableCredits(client.id, state.creditState.map); + final unappliedPayments = + memoizedGetClientUnappliedPayments(client.id, state.paymentState.map); + return ScrollableListView( children: [ EntityHeader( @@ -129,6 +135,25 @@ class ClientOverview extends StatelessWidget { formatNumber(client.balance, context, clientId: client.id), ), ListDivider(), + if (availableCredits != 0 || unappliedPayments != 0) ...[ + Padding( + padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 12), + child: + Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + if (availableCredits != 0) + Text(localization.credit + + ': ' + + formatNumber(availableCredits, context, + clientId: client.id)), + if (unappliedPayments != 0) + Text(localization.payments + + ': ' + + formatNumber(unappliedPayments, context, + clientId: client.id)), + ]), + ), + ListDivider(), + ], Padding( padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 16), child: PortalLinks( From a921127748d46e090904cb60902c4ad59808b08a Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Fri, 3 Mar 2023 13:55:36 +0200 Subject: [PATCH 2/3] Fixes for FOSS build --- pubspec.foss.yaml | 11 ++++++++--- pubspec.yaml | 1 - 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/pubspec.foss.yaml b/pubspec.foss.yaml index a0bfe2f78ad..fa68664828b 100644 --- a/pubspec.foss.yaml +++ b/pubspec.foss.yaml @@ -35,7 +35,7 @@ dependencies: memoize: ^3.0.0 cached_network_image: 3.0.0 # imageRenderMethodForWeb: ImageRenderMethodForWeb.HttpGet, url_launcher: ^6.0.20 - share: ^2.0.4 + share_plus: ^6.3.1 intl: ^0.17.0 flutter_slidable: ^2.0.0 charts_flutter: ^0.12.0 @@ -56,7 +56,7 @@ dependencies: # flutter_launcher_icons: ^0.9.1 overflow_view: ^0.3.1 flutter_styled_toast: ^2.0.0 - permission_handler: 9.1.0 + permission_handler: 9.1.0 # Disables Windows support to fix crash file_picker: ^5.2.5 boardview: ^0.2.2 pointer_interceptor: ^0.9.0 @@ -69,7 +69,6 @@ dependencies: git: url: https://github.com/superlistapp/super_editor.git path: super_editor - ref: 1601fdce95ebfa34bddf80cab3e58e700b0edec3 html2md: ^1.2.6 printing: ^5.10.1 image_cropper: ^3.0.1 @@ -82,6 +81,12 @@ dependencies: # quick_actions: ^0.2.1 # idb_shim: ^1.11.1+1 +dependency_overrides: + photo_view: + git: + url: https://github.com/bluefireteam/photo_view + ref: master + dev_dependencies: flutter_driver: sdk: flutter diff --git a/pubspec.yaml b/pubspec.yaml index 0de6091e243..41d2cac7e18 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -74,7 +74,6 @@ dependencies: git: url: https://github.com/superlistapp/super_editor.git path: super_editor - #ref: 1601fdce95ebfa34bddf80cab3e58e700b0edec3 html2md: ^1.2.6 printing: ^5.10.1 image_cropper: ^3.0.1 From 9c8f26cd3f3872a432d58001ddb1ce7b9fb0fe04 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Fri, 3 Mar 2023 13:55:52 +0200 Subject: [PATCH 3/3] Fixes for FOSS build --- lib/constants.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/constants.dart b/lib/constants.dart index 70ff4100b98..7e932de07c0 100644 --- a/lib/constants.dart +++ b/lib/constants.dart @@ -80,7 +80,7 @@ const String kGitHubDiffUrl = 'https://github.com/invoiceninja/invoiceninja/compare/vVERSION...v5-stable'; const String kGitHubLangUrl = 'https://github.com/invoiceninja/invoiceninja/blob/master/resources/lang/en/texts.php'; -const String kStatusCheckUrl = 'https://status.invoiceninja.com/'; +const String kStatusCheckUrl = 'https://status.invoiceninja.com'; const String kGoogleAnalyticsUrl = 'https://support.google.com/analytics/answer/1037249?hl=en';