Adjust version requirements
This commit is contained in:
parent
6b7d9d5bf3
commit
50b61d33f7
|
|
@ -510,7 +510,7 @@ class _EmailSettingsState extends State<EmailSettings> {
|
||||||
onChanged: (value) => viewModel.onSettingsChanged(
|
onChanged: (value) => viewModel.onSettingsChanged(
|
||||||
settings.rebuild((b) => b..ublEmailAttachment = value)),
|
settings.rebuild((b) => b..ublEmailAttachment = value)),
|
||||||
),
|
),
|
||||||
if (supportsLatestFeatures())
|
if (supportsLatestFeatures(null))
|
||||||
BoolDropdownButton(
|
BoolDropdownButton(
|
||||||
label: localization.enableEInvoice,
|
label: localization.enableEInvoice,
|
||||||
value: settings.enableEInvoice,
|
value: settings.enableEInvoice,
|
||||||
|
|
|
||||||
|
|
@ -428,7 +428,7 @@ class SettingsSearch extends StatelessWidget {
|
||||||
[
|
[
|
||||||
'tax_settings',
|
'tax_settings',
|
||||||
'inclusive_taxes',
|
'inclusive_taxes',
|
||||||
if (supportsLatestFeatures()) 'calculate_taxes#2023-04-26',
|
if (supportsLatestFeatures('5.6.0')) 'calculate_taxes#2023-04-26',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
kSettingsTaxRates: [
|
kSettingsTaxRates: [
|
||||||
|
|
@ -623,7 +623,7 @@ class SettingsSearch extends StatelessWidget {
|
||||||
'mailgun#2023-01-11',
|
'mailgun#2023-01-11',
|
||||||
'email_alignment#2023-01-17',
|
'email_alignment#2023-01-17',
|
||||||
'show_email_footer#2023-01-17',
|
'show_email_footer#2023-01-17',
|
||||||
if (supportsLatestFeatures()) 'enable_e_invoice#2023-04-27,'
|
if (supportsLatestFeatures(null)) 'enable_e_invoice#2023-04-27,'
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
kSettingsTemplatesAndReminders: [
|
kSettingsTemplatesAndReminders: [
|
||||||
|
|
|
||||||
|
|
@ -160,7 +160,7 @@ class _TaxSettingsState extends State<TaxSettings> {
|
||||||
onPressed: () => viewModel.onConfigureRatesPressed(context),
|
onPressed: () => viewModel.onConfigureRatesPressed(context),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (supportsLatestFeatures())
|
if (supportsLatestFeatures('5.6.0'))
|
||||||
FormCard(
|
FormCard(
|
||||||
isLast: true,
|
isLast: true,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ bool supportsAppleOAuth() => kIsWeb || isApple();
|
||||||
// TODO remove this function
|
// TODO remove this function
|
||||||
bool supportsMicrosoftOAuth() => kIsWeb;
|
bool supportsMicrosoftOAuth() => kIsWeb;
|
||||||
|
|
||||||
bool supportsLatestFeatures() {
|
bool supportsLatestFeatures(String version) {
|
||||||
final store = StoreProvider.of<AppState>(navigatorKey.currentContext);
|
final store = StoreProvider.of<AppState>(navigatorKey.currentContext);
|
||||||
final state = store.state;
|
final state = store.state;
|
||||||
|
|
||||||
|
|
@ -55,8 +55,15 @@ bool supportsLatestFeatures() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return Version.parse(state.account.currentVersion) >=
|
if (state.isSelfHosted) {
|
||||||
Version.parse('5.5.118');
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (version == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return Version.parse(state.account.currentVersion) >= Version.parse(version);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool supportsInAppPurchase() {
|
bool supportsInAppPurchase() {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue