Add check for new features
This commit is contained in:
parent
90f19f1c0d
commit
0fa35ffa60
|
|
@ -15,6 +15,7 @@ import 'package:invoiceninja_flutter/redux/app/app_state.dart';
|
|||
import 'package:invoiceninja_flutter/redux/client/client_selectors.dart';
|
||||
import 'package:invoiceninja_flutter/utils/formatting.dart';
|
||||
import 'package:invoiceninja_flutter/utils/money.dart';
|
||||
import 'package:invoiceninja_flutter/utils/platforms.dart';
|
||||
import 'package:invoiceninja_flutter/utils/strings.dart';
|
||||
|
||||
part 'invoice_model.g.dart';
|
||||
|
|
@ -1029,8 +1030,10 @@ abstract class InvoiceEntity extends Object
|
|||
actions.add(EntityAction.stop);
|
||||
}
|
||||
|
||||
actions.add(EntityAction.updatePrices);
|
||||
actions.add(EntityAction.increasePrices);
|
||||
if (supportsLatestFeatures()) {
|
||||
actions.add(EntityAction.updatePrices);
|
||||
actions.add(EntityAction.increasePrices);
|
||||
}
|
||||
} else {
|
||||
if (!isCancelledOrReversed) {
|
||||
if (multiselect) {
|
||||
|
|
@ -1038,7 +1041,9 @@ abstract class InvoiceEntity extends Object
|
|||
} else {
|
||||
actions.add(EntityAction.sendEmail);
|
||||
if (isUnpaid) {
|
||||
actions.add(EntityAction.schedule);
|
||||
if (supportsLatestFeatures()) {
|
||||
actions.add(EntityAction.schedule);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1071,18 +1071,19 @@ class _InvoiceDesignState extends State<InvoiceDesign>
|
|||
),
|
||||
),
|
||||
),
|
||||
FormCard(
|
||||
isLast: true,
|
||||
child: SwitchListTile(
|
||||
title: Text(localization.shareInvoiceQuoteColumns),
|
||||
value: settings.shareInvoiceQuoteColumns ?? true,
|
||||
activeColor: Theme.of(context).colorScheme.secondary,
|
||||
onChanged: (value) {
|
||||
viewModel.onSettingsChanged(settings.rebuild(
|
||||
(b) => b..shareInvoiceQuoteColumns = value));
|
||||
},
|
||||
),
|
||||
)
|
||||
if (supportsLatestFeatures())
|
||||
FormCard(
|
||||
isLast: true,
|
||||
child: SwitchListTile(
|
||||
title: Text(localization.shareInvoiceQuoteColumns),
|
||||
value: settings.shareInvoiceQuoteColumns ?? true,
|
||||
activeColor: Theme.of(context).colorScheme.secondary,
|
||||
onChanged: (value) {
|
||||
viewModel.onSettingsChanged(settings.rebuild(
|
||||
(b) => b..shareInvoiceQuoteColumns = value));
|
||||
},
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
if (settings.shareInvoiceQuoteColumns == false)
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ import 'package:invoiceninja_flutter/ui/app/forms/decorated_form_field.dart';
|
|||
import 'package:invoiceninja_flutter/ui/settings/payment_settings_vm.dart';
|
||||
import 'package:invoiceninja_flutter/utils/formatting.dart';
|
||||
import 'package:invoiceninja_flutter/utils/localization.dart';
|
||||
import 'package:invoiceninja_flutter/utils/platforms.dart';
|
||||
|
||||
class PaymentSettings extends StatefulWidget {
|
||||
const PaymentSettings({
|
||||
|
|
@ -246,13 +247,14 @@ class _PaymentSettingsState extends State<PaymentSettings> {
|
|||
decimal: true, signed: true),
|
||||
),
|
||||
),
|
||||
BoolDropdownButton(
|
||||
label: localization.clientInitiatedPayments,
|
||||
value: settings.clientInitiatedPayments,
|
||||
helpLabel: localization.clientInitiatedPaymentsHelp,
|
||||
onChanged: (value) => viewModel.onSettingsChanged(
|
||||
settings.rebuild((b) => b..clientInitiatedPayments = value)),
|
||||
),
|
||||
if (supportsLatestFeatures())
|
||||
BoolDropdownButton(
|
||||
label: localization.clientInitiatedPayments,
|
||||
value: settings.clientInitiatedPayments,
|
||||
helpLabel: localization.clientInitiatedPaymentsHelp,
|
||||
onChanged: (value) => viewModel.onSettingsChanged(settings
|
||||
.rebuild((b) => b..clientInitiatedPayments = value)),
|
||||
),
|
||||
if (settings.clientInitiatedPayments == true)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 16),
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ import 'package:invoiceninja_flutter/ui/settings/task_settings_vm.dart';
|
|||
import 'package:invoiceninja_flutter/utils/formatting.dart';
|
||||
import 'package:invoiceninja_flutter/utils/icons.dart';
|
||||
import 'package:invoiceninja_flutter/utils/localization.dart';
|
||||
import 'package:invoiceninja_flutter/utils/platforms.dart';
|
||||
|
||||
class TaskSettings extends StatefulWidget {
|
||||
const TaskSettings({
|
||||
|
|
@ -123,22 +124,24 @@ class _TaskSettingsState extends State<TaskSettings> {
|
|||
onChanged: (value) => viewModel.onCompanyChanged(
|
||||
company.rebuild((b) => b..showTaskEndDate = value)),
|
||||
),
|
||||
SwitchListTile(
|
||||
activeColor: Theme.of(context).colorScheme.secondary,
|
||||
title: Text(localization.showTaskItemDescription),
|
||||
value: settings.showTaskItemDescription,
|
||||
subtitle: Text(localization.showTaskItemDescriptionHelp),
|
||||
onChanged: (value) => viewModel.onSettingsChanged(settings
|
||||
.rebuild((b) => b..showTaskItemDescription = value)),
|
||||
),
|
||||
SwitchListTile(
|
||||
activeColor: Theme.of(context).colorScheme.secondary,
|
||||
title: Text(localization.allowBillableTaskItems),
|
||||
value: settings.allowBillableTaskItems,
|
||||
subtitle: Text(localization.allowBillableTaskItemsHelp),
|
||||
onChanged: (value) => viewModel.onSettingsChanged(
|
||||
settings.rebuild((b) => b..allowBillableTaskItems = value)),
|
||||
),
|
||||
if (supportsLatestFeatures()) ...[
|
||||
SwitchListTile(
|
||||
activeColor: Theme.of(context).colorScheme.secondary,
|
||||
title: Text(localization.showTaskItemDescription),
|
||||
value: settings.showTaskItemDescription,
|
||||
subtitle: Text(localization.showTaskItemDescriptionHelp),
|
||||
onChanged: (value) => viewModel.onSettingsChanged(settings
|
||||
.rebuild((b) => b..showTaskItemDescription = value)),
|
||||
),
|
||||
SwitchListTile(
|
||||
activeColor: Theme.of(context).colorScheme.secondary,
|
||||
title: Text(localization.allowBillableTaskItems),
|
||||
value: settings.allowBillableTaskItems,
|
||||
subtitle: Text(localization.allowBillableTaskItemsHelp),
|
||||
onChanged: (value) => viewModel.onSettingsChanged(settings
|
||||
.rebuild((b) => b..allowBillableTaskItems = value)),
|
||||
),
|
||||
],
|
||||
]
|
||||
]),
|
||||
if (!viewModel.state.settingsUIState.isFiltered)
|
||||
|
|
|
|||
|
|
@ -47,8 +47,7 @@ bool supportsAppleOAuth() => kIsWeb || isApple();
|
|||
// TODO remove this function
|
||||
bool supportsMicrosoftOAuth() => kIsWeb;
|
||||
|
||||
/*
|
||||
bool supportsSchedules() {
|
||||
bool supportsLatestFeatures() {
|
||||
final store = StoreProvider.of<AppState>(navigatorKey.currentContext);
|
||||
final state = store.state;
|
||||
|
||||
|
|
@ -60,9 +59,8 @@ bool supportsSchedules() {
|
|||
return true;
|
||||
}
|
||||
|
||||
return Version.parse(state.account.currentVersion) >= Version.parse('5.5.74');
|
||||
return Version.parse(state.account.currentVersion) >= Version.parse('5.5.99');
|
||||
}
|
||||
*/
|
||||
|
||||
bool supportsInAppPurchase() {
|
||||
final store = StoreProvider.of<AppState>(navigatorKey.currentContext);
|
||||
|
|
|
|||
Loading…
Reference in New Issue