Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
hillelcoren committed Feb 21, 2024
2 parents a9c0043 + 12f68cd commit 35276f9
Show file tree
Hide file tree
Showing 32 changed files with 292 additions and 128 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/flatpak.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ jobs:
draft: false
prerelease: false
title: "Latest Release"
automatic_release_tag: "v5.0.155"
automatic_release_tag: "v5.0.156"
files: |
${{ github.workspace }}/artifacts/Invoice-Ninja-Archive
${{ github.workspace }}/artifacts/Invoice-Ninja-Hash
Expand Down
1 change: 1 addition & 0 deletions flatpak/com.invoiceninja.InvoiceNinja.metainfo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
</screenshots>
<content_rating type="oars-1.1"/>
<releases>
<release version="5.0.156" date="2024-02-21"/>
<release version="5.0.155" date="2024-02-07"/>
<release version="5.0.154" date="2024-02-04"/>
<release version="5.0.153" date="2024-01-29"/>
Expand Down
2 changes: 1 addition & 1 deletion lib/constants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class Constants {
}

// TODO remove version once #46609 is fixed
const String kClientVersion = '5.0.155';
const String kClientVersion = '5.0.156';
const String kMinServerVersion = '5.0.4';

const String kAppName = 'Invoice Ninja';
Expand Down
2 changes: 0 additions & 2 deletions lib/data/models/account_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,6 @@ abstract class AccountEntity
@BuiltValueField(wireName: 'nordigen_enabled')
bool get nordigenEnabled;

bool get canMakeIAP => !hasIapPlan && paymentId.isEmpty;

bool get isUpdateAvailable {
if (disableAutoUpdate) {
return false;
Expand Down
5 changes: 5 additions & 0 deletions lib/data/models/client_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ abstract class ClientEntity extends Object
customValue4: '',
routingId: '',
isTaxExempt: false,
hasValidVatNumber: false,
classification: '',
taxData: TaxDataEntity(),
contacts: BuiltList<ClientContactEntity>(
Expand Down Expand Up @@ -316,6 +317,9 @@ abstract class ClientEntity extends Object
@BuiltValueField(wireName: 'is_tax_exempt')
bool get isTaxExempt;

@BuiltValueField(wireName: 'has_valid_vat_number')
bool get hasValidVatNumber;

@BuiltValueField(wireName: 'tax_info')
TaxDataEntity get taxData;

Expand Down Expand Up @@ -794,6 +798,7 @@ abstract class ClientEntity extends Object
..number = ''
..routingId = ''
..isTaxExempt = false
..hasValidVatNumber = false
..taxData.replace(TaxDataEntity())
..paymentBalance = 0
..classification = '';
Expand Down
22 changes: 22 additions & 0 deletions lib/data/models/client_model.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions lib/data/models/company_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,9 @@ abstract class CompanyEntity extends Object

CompanyEntity._();

static const USE_CREDITS_ALWAYS = 'always';
static const USE_CREDITS_OPTION = 'option';
static const USE_CREDITS_OFF = 'off';
static const USE_ALWAYS = 'always';
static const USE_OPTION = 'option';
static const USE_OFF = 'off';

static const SMTP_ENCRYPTION_TLS = 'TLS';
static const SMTP_ENCRYPTION_STARTTLS = 'STARTTLS';
Expand Down
3 changes: 3 additions & 0 deletions lib/data/models/settings_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -818,6 +818,9 @@ abstract class SettingsEntity
@BuiltValueField(wireName: 'show_pdfhtml_on_mobile')
bool? get showPdfhtmlOnMobile;

@BuiltValueField(wireName: 'use_unapplied_payment')
String? get useUnappliedPayment;

bool get hasAddress => address1 != null && address1!.isNotEmpty;

bool get hasLogo => companyLogo != null && companyLogo!.isNotEmpty;
Expand Down
32 changes: 28 additions & 4 deletions lib/data/models/settings_model.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,11 @@ void main({bool isTesting = false}) async {
// Ignore CERT_ALREADY_IN_HASH_TABLE
}

final prefs = await SharedPreferences.getInstance();

if (isDesktopOS()) {
await windowManager.ensureInitialized();

final prefs = await SharedPreferences.getInstance();
windowManager.waitUntilReadyToShow(
WindowOptions(
center: true,
Expand All @@ -128,7 +129,7 @@ void main({bool isTesting = false}) async {
}

final store = Store<AppState>(appReducer,
initialState: await _initialState(isTesting),
initialState: await _initialState(isTesting, prefs),
middleware: []
..addAll(createStoreAuthMiddleware())
..addAll(createStoreDocumentsMiddleware())
Expand Down Expand Up @@ -219,8 +220,7 @@ void main({bool isTesting = false}) async {
*/
}

Future<AppState> _initialState(bool isTesting) async {
final prefs = await SharedPreferences.getInstance();
Future<AppState> _initialState(bool isTesting, SharedPreferences prefs) async {
final prefString = prefs.getString(kSharedPrefs);

final url = WebUtils.apiUrl ?? prefs.getString(kSharedPrefUrl) ?? '';
Expand Down
15 changes: 2 additions & 13 deletions lib/ui/app/edit_scaffold.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@ import 'package:flutter_redux/flutter_redux.dart';
import 'package:invoiceninja_flutter/ui/app/forms/save_cancel_buttons.dart';
import 'package:invoiceninja_flutter/ui/app/icon_text.dart';
import 'package:invoiceninja_flutter/ui/app/loading_indicator.dart';
import 'package:invoiceninja_flutter/ui/app/upgrade_dialog.dart';
import 'package:invoiceninja_flutter/ui/transaction/edit/transaction_edit_vm.dart';
import 'package:overflow_view/overflow_view.dart';
import 'package:url_launcher/url_launcher.dart';

// Project imports:
import 'package:invoiceninja_flutter/constants.dart';
Expand Down Expand Up @@ -137,9 +135,7 @@ class EditScaffold extends StatelessWidget {
children: [
Column(
children: [
if (showUpgradeBanner &&
state.userCompany.isOwner &&
(!isApple() || supportsInAppPurchase()))
if (showUpgradeBanner && state.userCompany.isOwner)
InkWell(
child: IconMessage(
upgradeMessage,
Expand All @@ -148,15 +144,8 @@ class EditScaffold extends StatelessWidget {
onTap: () async {
if (bannerClick != null) {
bannerClick();
} else if (supportsInAppPurchase() &&
account.canMakeIAP) {
showDialog<void>(
context: context,
builder: (context) => UpgradeDialog(),
);
} else {
launchUrl(Uri.parse(
state.userCompany.ninjaPortalUrl));
initiatePurchase();
}
},
),
Expand Down
16 changes: 2 additions & 14 deletions lib/ui/app/invoice/invoice_email_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import 'package:invoiceninja_flutter/ui/app/icon_message.dart';
import 'package:invoiceninja_flutter/ui/app/lists/activity_list_tile.dart';
import 'package:invoiceninja_flutter/ui/app/loading_indicator.dart';
import 'package:invoiceninja_flutter/ui/app/scrollable_listview.dart';
import 'package:invoiceninja_flutter/ui/app/upgrade_dialog.dart';
import 'package:invoiceninja_flutter/ui/credit/credit_pdf_vm.dart';
import 'package:invoiceninja_flutter/ui/invoice/invoice_email_vm.dart';
import 'package:invoiceninja_flutter/ui/invoice/invoice_pdf_vm.dart';
Expand All @@ -29,7 +28,6 @@ import 'package:invoiceninja_flutter/utils/localization.dart';
import 'package:invoiceninja_flutter/utils/platforms.dart';
import 'package:invoiceninja_flutter/utils/super_editor/super_editor.dart';
import 'package:invoiceninja_flutter/utils/templates.dart';
import 'package:url_launcher/url_launcher.dart';

class InvoiceEmailView extends StatefulWidget {
const InvoiceEmailView({
Expand Down Expand Up @@ -337,18 +335,8 @@ class _InvoiceEmailViewState extends State<InvoiceEmailView>
color: Colors.white,
),
),
onPressed: () {
if (supportsInAppPurchase() &&
state.account.canMakeIAP) {
showDialog<void>(
context: context,
builder: (context) => UpgradeDialog(),
);
} else {
launchUrl(
Uri.parse(state.userCompany.ninjaPortalUrl));
}
}),
onPressed: () => initiatePurchase(),
),
),
),
ColoredBox(
Expand Down
Loading

0 comments on commit 35276f9

Please sign in to comment.