Transaction rules

This commit is contained in:
Hillel Coren 2022-11-20 17:44:37 +02:00
parent d7921fe92a
commit d8e1cca2a4
12 changed files with 58 additions and 41 deletions

View File

@ -147,6 +147,7 @@ abstract class CompanyEntity extends Object
purchaseOrders: BuiltList<InvoiceEntity>(), purchaseOrders: BuiltList<InvoiceEntity>(),
bankAccounts: BuiltList<BankAccountEntity>(), bankAccounts: BuiltList<BankAccountEntity>(),
transactions: BuiltList<TransactionEntity>(), transactions: BuiltList<TransactionEntity>(),
transactionRules: BuiltList<TransactionRuleEntity>(),
); );
} }
@ -336,6 +337,9 @@ abstract class CompanyEntity extends Object
@BuiltValueField(wireName: 'bank_transactions') @BuiltValueField(wireName: 'bank_transactions')
BuiltList<TransactionEntity> get transactions; BuiltList<TransactionEntity> get transactions;
@BuiltValueField(wireName: 'bank_transaction_rules')
BuiltList<TransactionRuleEntity> get transactionRules;
BuiltList<TaskEntity> get tasks; BuiltList<TaskEntity> get tasks;
BuiltList<ProjectEntity> get projects; BuiltList<ProjectEntity> get projects;
@ -605,6 +609,7 @@ abstract class CompanyEntity extends Object
..purchaseOrders.clear() ..purchaseOrders.clear()
..bankAccounts.clear() ..bankAccounts.clear()
..transactions.clear() ..transactions.clear()
..transactionRules.clear()
..credits.clear() ..credits.clear()
..tasks.clear() ..tasks.clear()
..projects.clear() ..projects.clear()
@ -692,7 +697,8 @@ abstract class CompanyEntity extends Object
..clientRegistrationFields.replace(BuiltList<RegistrationFieldEntity>()) ..clientRegistrationFields.replace(BuiltList<RegistrationFieldEntity>())
..purchaseOrders.replace(BuiltList<InvoiceEntity>()) ..purchaseOrders.replace(BuiltList<InvoiceEntity>())
..bankAccounts.replace(BuiltList<BankAccountEntity>()) ..bankAccounts.replace(BuiltList<BankAccountEntity>())
..transactions.replace(BuiltList<BankAccountEntity>()); ..transactions.replace(BuiltList<TransactionEntity>())
..transactionRules.replace(BuiltList<TransactionRuleEntity>());
static Serializer<CompanyEntity> get serializer => _$companyEntitySerializer; static Serializer<CompanyEntity> get serializer => _$companyEntitySerializer;
} }

View File

@ -242,6 +242,10 @@ class _$CompanyEntitySerializer implements StructuredSerializer<CompanyEntity> {
serializers.serialize(object.transactions, serializers.serialize(object.transactions,
specifiedType: const FullType( specifiedType: const FullType(
BuiltList, const [const FullType(TransactionEntity)])), BuiltList, const [const FullType(TransactionEntity)])),
'bank_transaction_rules',
serializers.serialize(object.transactionRules,
specifiedType: const FullType(
BuiltList, const [const FullType(TransactionRuleEntity)])),
'tasks', 'tasks',
serializers.serialize(object.tasks, serializers.serialize(object.tasks,
specifiedType: specifiedType:
@ -692,6 +696,12 @@ class _$CompanyEntitySerializer implements StructuredSerializer<CompanyEntity> {
BuiltList, const [const FullType(TransactionEntity)])) BuiltList, const [const FullType(TransactionEntity)]))
as BuiltList<Object>); as BuiltList<Object>);
break; break;
case 'bank_transaction_rules':
result.transactionRules.replace(serializers.deserialize(value,
specifiedType: const FullType(
BuiltList, const [const FullType(TransactionRuleEntity)]))
as BuiltList<Object>);
break;
case 'tasks': case 'tasks':
result.tasks.replace(serializers.deserialize(value, result.tasks.replace(serializers.deserialize(value,
specifiedType: const FullType( specifiedType: const FullType(
@ -1666,6 +1676,8 @@ class _$CompanyEntity extends CompanyEntity {
@override @override
final BuiltList<TransactionEntity> transactions; final BuiltList<TransactionEntity> transactions;
@override @override
final BuiltList<TransactionRuleEntity> transactionRules;
@override
final BuiltList<TaskEntity> tasks; final BuiltList<TaskEntity> tasks;
@override @override
final BuiltList<ProjectEntity> projects; final BuiltList<ProjectEntity> projects;
@ -1808,6 +1820,7 @@ class _$CompanyEntity extends CompanyEntity {
this.purchaseOrders, this.purchaseOrders,
this.bankAccounts, this.bankAccounts,
this.transactions, this.transactions,
this.transactionRules,
this.tasks, this.tasks,
this.projects, this.projects,
this.expenses, this.expenses,
@ -1964,6 +1977,8 @@ class _$CompanyEntity extends CompanyEntity {
bankAccounts, 'CompanyEntity', 'bankAccounts'); bankAccounts, 'CompanyEntity', 'bankAccounts');
BuiltValueNullFieldError.checkNotNull( BuiltValueNullFieldError.checkNotNull(
transactions, 'CompanyEntity', 'transactions'); transactions, 'CompanyEntity', 'transactions');
BuiltValueNullFieldError.checkNotNull(
transactionRules, 'CompanyEntity', 'transactionRules');
BuiltValueNullFieldError.checkNotNull(tasks, 'CompanyEntity', 'tasks'); BuiltValueNullFieldError.checkNotNull(tasks, 'CompanyEntity', 'tasks');
BuiltValueNullFieldError.checkNotNull( BuiltValueNullFieldError.checkNotNull(
projects, 'CompanyEntity', 'projects'); projects, 'CompanyEntity', 'projects');
@ -2100,6 +2115,7 @@ class _$CompanyEntity extends CompanyEntity {
purchaseOrders == other.purchaseOrders && purchaseOrders == other.purchaseOrders &&
bankAccounts == other.bankAccounts && bankAccounts == other.bankAccounts &&
transactions == other.transactions && transactions == other.transactions &&
transactionRules == other.transactionRules &&
tasks == other.tasks && tasks == other.tasks &&
projects == other.projects && projects == other.projects &&
expenses == other.expenses && expenses == other.expenses &&
@ -2161,7 +2177,7 @@ class _$CompanyEntity extends CompanyEntity {
$jc( $jc(
$jc( $jc(
$jc( $jc(
$jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc(0, enableCustomSurchargeTaxes1.hashCode), enableCustomSurchargeTaxes2.hashCode), enableCustomSurchargeTaxes3.hashCode), enableCustomSurchargeTaxes4.hashCode), sizeId.hashCode), industryId.hashCode), subdomain.hashCode), portalMode.hashCode), portalDomain.hashCode), updateProducts.hashCode), convertProductExchangeRate.hashCode), convertRateToClient.hashCode), fillProducts.hashCode), enableProductCost.hashCode), enableProductQuantity.hashCode), enableProductDiscount.hashCode), defaultTaskIsDateBased.hashCode), defaultQuantity.hashCode), showProductDetails.hashCode), clientCanRegister.hashCode), isLarge.hashCode), isDisabled.hashCode), enableShopApi.hashCode), companyKey.hashCode), firstDayOfWeek.hashCode), firstMonthOfYear.hashCode), numberOfInvoiceTaxRates.hashCode), numberOfItemTaxRates.hashCode), numberOfExpenseTaxRates.hashCode), expenseInclusiveTaxes.hashCode), sessionTimeout.hashCode), passwordTimeout.hashCode), oauthPasswordRequired.hashCode), markdownEnabled.hashCode), markdownEmailEnabled.hashCode), useCommaAsDecimalPlace.hashCode), reportIncludeDrafts.hashCode), reportIncludeDeleted.hashCode), useQuoteTermsOnConversion.hashCode), enableApplyingPayments.hashCode), trackInventory.hashCode), stockNotificationThreshold.hashCode), stockNotification.hashCode), groups.hashCode), activities.hashCode), taxRates.hashCode), taskStatuses.hashCode), taskStatusMap.hashCode), companyGateways.hashCode), expenseCategories.hashCode), users.hashCode), clients.hashCode), products.hashCode), invoices.hashCode), recurringInvoices.hashCode), recurringExpenses.hashCode), payments.hashCode), quotes.hashCode), credits.hashCode), purchaseOrders.hashCode), bankAccounts.hashCode), transactions.hashCode), tasks.hashCode), projects.hashCode), expenses.hashCode), vendors.hashCode), designs.hashCode), documents.hashCode), tokens.hashCode), webhooks.hashCode), subscriptions.hashCode), paymentTerms.hashCode), systemLogs.hashCode), clientRegistrationFields.hashCode), customFields.hashCode), slackWebhookUrl.hashCode), googleAnalyticsKey.hashCode), markExpensesInvoiceable.hashCode), markExpensesPaid.hashCode), invoiceExpenseDocuments.hashCode), invoiceTaskDocuments.hashCode), $jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc(0, enableCustomSurchargeTaxes1.hashCode), enableCustomSurchargeTaxes2.hashCode), enableCustomSurchargeTaxes3.hashCode), enableCustomSurchargeTaxes4.hashCode), sizeId.hashCode), industryId.hashCode), subdomain.hashCode), portalMode.hashCode), portalDomain.hashCode), updateProducts.hashCode), convertProductExchangeRate.hashCode), convertRateToClient.hashCode), fillProducts.hashCode), enableProductCost.hashCode), enableProductQuantity.hashCode), enableProductDiscount.hashCode), defaultTaskIsDateBased.hashCode), defaultQuantity.hashCode), showProductDetails.hashCode), clientCanRegister.hashCode), isLarge.hashCode), isDisabled.hashCode), enableShopApi.hashCode), companyKey.hashCode), firstDayOfWeek.hashCode), firstMonthOfYear.hashCode), numberOfInvoiceTaxRates.hashCode), numberOfItemTaxRates.hashCode), numberOfExpenseTaxRates.hashCode), expenseInclusiveTaxes.hashCode), sessionTimeout.hashCode), passwordTimeout.hashCode), oauthPasswordRequired.hashCode), markdownEnabled.hashCode), markdownEmailEnabled.hashCode), useCommaAsDecimalPlace.hashCode), reportIncludeDrafts.hashCode), reportIncludeDeleted.hashCode), useQuoteTermsOnConversion.hashCode), enableApplyingPayments.hashCode), trackInventory.hashCode), stockNotificationThreshold.hashCode), stockNotification.hashCode), groups.hashCode), activities.hashCode), taxRates.hashCode), taskStatuses.hashCode), taskStatusMap.hashCode), companyGateways.hashCode), expenseCategories.hashCode), users.hashCode), clients.hashCode), products.hashCode), invoices.hashCode), recurringInvoices.hashCode), recurringExpenses.hashCode), payments.hashCode), quotes.hashCode), credits.hashCode), purchaseOrders.hashCode), bankAccounts.hashCode), transactions.hashCode), transactionRules.hashCode), tasks.hashCode), projects.hashCode), expenses.hashCode), vendors.hashCode), designs.hashCode), documents.hashCode), tokens.hashCode), webhooks.hashCode), subscriptions.hashCode), paymentTerms.hashCode), systemLogs.hashCode), clientRegistrationFields.hashCode), customFields.hashCode), slackWebhookUrl.hashCode), googleAnalyticsKey.hashCode), markExpensesInvoiceable.hashCode), markExpensesPaid.hashCode), invoiceExpenseDocuments.hashCode), invoiceTaskDocuments.hashCode),
invoiceTaskTimelog.hashCode), invoiceTaskTimelog.hashCode),
invoiceTaskDatelog.hashCode), invoiceTaskDatelog.hashCode),
invoiceTaskProject.hashCode), invoiceTaskProject.hashCode),
@ -2248,6 +2264,7 @@ class _$CompanyEntity extends CompanyEntity {
..add('purchaseOrders', purchaseOrders) ..add('purchaseOrders', purchaseOrders)
..add('bankAccounts', bankAccounts) ..add('bankAccounts', bankAccounts)
..add('transactions', transactions) ..add('transactions', transactions)
..add('transactionRules', transactionRules)
..add('tasks', tasks) ..add('tasks', tasks)
..add('projects', projects) ..add('projects', projects)
..add('expenses', expenses) ..add('expenses', expenses)
@ -2609,6 +2626,12 @@ class CompanyEntityBuilder
set transactions(ListBuilder<TransactionEntity> transactions) => set transactions(ListBuilder<TransactionEntity> transactions) =>
_$this._transactions = transactions; _$this._transactions = transactions;
ListBuilder<TransactionRuleEntity> _transactionRules;
ListBuilder<TransactionRuleEntity> get transactionRules =>
_$this._transactionRules ??= new ListBuilder<TransactionRuleEntity>();
set transactionRules(ListBuilder<TransactionRuleEntity> transactionRules) =>
_$this._transactionRules = transactionRules;
ListBuilder<TaskEntity> _tasks; ListBuilder<TaskEntity> _tasks;
ListBuilder<TaskEntity> get tasks => ListBuilder<TaskEntity> get tasks =>
_$this._tasks ??= new ListBuilder<TaskEntity>(); _$this._tasks ??= new ListBuilder<TaskEntity>();
@ -2872,6 +2895,7 @@ class CompanyEntityBuilder
_purchaseOrders = $v.purchaseOrders.toBuilder(); _purchaseOrders = $v.purchaseOrders.toBuilder();
_bankAccounts = $v.bankAccounts.toBuilder(); _bankAccounts = $v.bankAccounts.toBuilder();
_transactions = $v.transactions.toBuilder(); _transactions = $v.transactions.toBuilder();
_transactionRules = $v.transactionRules.toBuilder();
_tasks = $v.tasks.toBuilder(); _tasks = $v.tasks.toBuilder();
_projects = $v.projects.toBuilder(); _projects = $v.projects.toBuilder();
_expenses = $v.expenses.toBuilder(); _expenses = $v.expenses.toBuilder();
@ -3008,6 +3032,7 @@ class CompanyEntityBuilder
purchaseOrders: purchaseOrders.build(), purchaseOrders: purchaseOrders.build(),
bankAccounts: bankAccounts.build(), bankAccounts: bankAccounts.build(),
transactions: transactions.build(), transactions: transactions.build(),
transactionRules: transactionRules.build(),
tasks: tasks.build(), tasks: tasks.build(),
projects: projects.build(), projects: projects.build(),
expenses: expenses.build(), expenses: expenses.build(),
@ -3087,6 +3112,8 @@ class CompanyEntityBuilder
bankAccounts.build(); bankAccounts.build();
_$failedField = 'transactions'; _$failedField = 'transactions';
transactions.build(); transactions.build();
_$failedField = 'transactionRules';
transactionRules.build();
_$failedField = 'tasks'; _$failedField = 'tasks';
tasks.build(); tasks.build();
_$failedField = 'projects'; _$failedField = 'projects';

View File

@ -434,6 +434,10 @@ Serializers _$serializers = (new Serializers().toBuilder()
..addBuilderFactory( ..addBuilderFactory(
const FullType(BuiltList, const [const FullType(TransactionEntity)]), const FullType(BuiltList, const [const FullType(TransactionEntity)]),
() => new ListBuilder<TransactionEntity>()) () => new ListBuilder<TransactionEntity>())
..addBuilderFactory(
const FullType(
BuiltList, const [const FullType(TransactionRuleEntity)]),
() => new ListBuilder<TransactionRuleEntity>())
..addBuilderFactory( ..addBuilderFactory(
const FullType(BuiltList, const [const FullType(TaskEntity)]), const FullType(BuiltList, const [const FullType(TaskEntity)]),
() => new ListBuilder<TaskEntity>()) () => new ListBuilder<TaskEntity>())

View File

@ -63,8 +63,7 @@ abstract class TransactionRuleEntity extends Object
createdUserId: '', createdUserId: '',
assignedUserId: '', assignedUserId: '',
archivedAt: 0, archivedAt: 0,
// STARTER: constructor - do not remove comment name: '',
transaction_rules: '',
); );
} }
@ -110,8 +109,10 @@ abstract class TransactionRuleEntity extends Object
switch (sortField) { switch (sortField) {
// STARTER: sort switch - do not remove comment // STARTER: sort switch - do not remove comment
case TransactionRuleFields.transaction_rules: case TransactionRuleFields.name:
response = transactionRuleA.name.compareTo(transactionRuleB.name); response = transactionRuleA.name
.toLowerCase()
.compareTo(transactionRuleB.name.toLowerCase());
break; break;
default: default:

View File

@ -56,6 +56,7 @@ import 'package:invoiceninja_flutter/redux/webhook/webhook_middleware.dart';
import 'package:invoiceninja_flutter/redux/transaction/transaction_middleware.dart'; import 'package:invoiceninja_flutter/redux/transaction/transaction_middleware.dart';
import 'package:invoiceninja_flutter/redux/bank_account/bank_account_middleware.dart'; import 'package:invoiceninja_flutter/redux/bank_account/bank_account_middleware.dart';
import 'package:invoiceninja_flutter/redux/purchase_order/purchase_order_middleware.dart'; import 'package:invoiceninja_flutter/redux/purchase_order/purchase_order_middleware.dart';
import 'package:invoiceninja_flutter/redux/transaction_rule/transaction_rule_middleware.dart';
import 'package:window_manager/window_manager.dart'; import 'package:window_manager/window_manager.dart';
// STARTER: import - do not remove comment // STARTER: import - do not remove comment
@ -63,7 +64,8 @@ import 'package:invoiceninja_flutter/utils/web_stub.dart'
if (dart.library.html) 'package:invoiceninja_flutter/utils/web.dart'; if (dart.library.html) 'package:invoiceninja_flutter/utils/web.dart';
// https://github.com/dart-lang/io/issues/83#issuecomment-940617222 // https://github.com/dart-lang/io/issues/83#issuecomment-940617222
const isrgRootX1 = '''-----BEGIN CERTIFICATE----- const isrgRootX1 =
'''-----BEGIN CERTIFICATE-----
MIIFazCCA1OgAwIBAgIRAIIQz7DSQONZRGPgu2OCiwAwDQYJKoZIhvcNAQELBQAw MIIFazCCA1OgAwIBAgIRAIIQz7DSQONZRGPgu2OCiwAwDQYJKoZIhvcNAQELBQAw
TzELMAkGA1UEBhMCVVMxKTAnBgNVBAoTIEludGVybmV0IFNlY3VyaXR5IFJlc2Vh TzELMAkGA1UEBhMCVVMxKTAnBgNVBAoTIEludGVybmV0IFNlY3VyaXR5IFJlc2Vh
cmNoIEdyb3VwMRUwEwYDVQQDEwxJU1JHIFJvb3QgWDEwHhcNMTUwNjA0MTEwNDM4 cmNoIEdyb3VwMRUwEwYDVQQDEwxJU1JHIFJvb3QgWDEwHhcNMTUwNjA0MTEwNDM4

View File

@ -722,8 +722,7 @@ abstract class AppState implements Built<AppState, AppStateBuilder> {
return creditUIState.editing.isChanged == true; return creditUIState.editing.isChanged == true;
// STARTER: has changes - do not remove comment // STARTER: has changes - do not remove comment
case TransactionRuleEditScreen.route: case TransactionRuleEditScreen.route:
return hastransactionRuleUIState.editing.isChanged == true; return transactionRuleUIState.editing.isChanged == true;
case TransactionEditScreen.route: case TransactionEditScreen.route:
return transactionUIState.editing.isChanged == true; return transactionUIState.editing.isChanged == true;
case PurchaseOrderEditScreen.route: case PurchaseOrderEditScreen.route:

View File

@ -53,7 +53,7 @@ List<String> filteredTransactionRulesSelector(
BuiltList<String> transactionRuleList, BuiltList<String> transactionRuleList,
ListUIState transactionRuleListState) { ListUIState transactionRuleListState) {
final filterEntityId = selectionState.filterEntityId; final filterEntityId = selectionState.filterEntityId;
final filterEntityType = selectionState.filterEntityType; //final filterEntityType = selectionState.filterEntityType;
final list = transactionRuleList.where((transactionRuleId) { final list = transactionRuleList.where((transactionRuleId) {
final transactionRule = transactionRuleMap[transactionRuleId]; final transactionRule = transactionRuleMap[transactionRuleId];
@ -64,23 +64,6 @@ List<String> filteredTransactionRulesSelector(
if (!transactionRule.matchesStates(transactionRuleListState.stateFilters)) { if (!transactionRule.matchesStates(transactionRuleListState.stateFilters)) {
return false; return false;
} }
if (transactionRuleListState.custom1Filters.isNotEmpty &&
!transactionRuleListState.custom1Filters
.contains(transactionRule.customValue1)) {
return false;
} else if (transactionRuleListState.custom2Filters.isNotEmpty &&
!transactionRuleListState.custom2Filters
.contains(transactionRule.customValue2)) {
return false;
} else if (transactionRuleListState.custom3Filters.isNotEmpty &&
!transactionRuleListState.custom3Filters
.contains(transactionRule.customValue3)) {
return false;
} else if (transactionRuleListState.custom4Filters.isNotEmpty &&
!transactionRuleListState.custom4Filters
.contains(transactionRule.customValue4)) {
return false;
}
return transactionRule.matchesFilter(transactionRuleListState.filter); return transactionRule.matchesFilter(transactionRuleListState.filter);
}).toList(); }).toList();

View File

@ -648,13 +648,6 @@ class _MenuDrawerState extends State<MenuDrawer> {
iconTooltip: localization.newExpense, iconTooltip: localization.newExpense,
), ),
// STARTER: menu - do not remove comment // STARTER: menu - do not remove comment
DrawerTile(
company: company,
entityType: EntityType.transactionRule,
icon: getEntityIcon(EntityType.transactionRule),
title: localization.transactionRules,
),
DrawerTile( DrawerTile(
company: company, company: company,
entityType: EntityType.recurringExpense, entityType: EntityType.recurringExpense,

View File

@ -24,7 +24,7 @@ class _TransactionRuleEditState extends State<TransactionRuleEdit> {
final _debouncer = Debouncer(); final _debouncer = Debouncer();
// STARTER: controllers - do not remove comment // STARTER: controllers - do not remove comment
final _transaction_rulesController = TextEditingController(); final _nameController = TextEditingController();
List<TextEditingController> _controllers = []; List<TextEditingController> _controllers = [];
@ -32,14 +32,14 @@ class _TransactionRuleEditState extends State<TransactionRuleEdit> {
void didChangeDependencies() { void didChangeDependencies() {
_controllers = [ _controllers = [
// STARTER: array - do not remove comment // STARTER: array - do not remove comment
_transaction_rulesController, _nameController,
]; ];
_controllers.forEach((controller) => controller.removeListener(_onChanged)); _controllers.forEach((controller) => controller.removeListener(_onChanged));
final transactionRule = widget.viewModel.transactionRule; final transactionRule = widget.viewModel.transactionRule;
// STARTER: read value - do not remove comment // STARTER: read value - do not remove comment
_transaction_rulesController.text = transaction_rule.transaction_rules; _nameController.text = transactionRule.name;
_controllers.forEach((controller) => controller.addListener(_onChanged)); _controllers.forEach((controller) => controller.addListener(_onChanged));
@ -60,7 +60,7 @@ class _TransactionRuleEditState extends State<TransactionRuleEdit> {
_debouncer.run(() { _debouncer.run(() {
final transactionRule = widget.viewModel.transactionRule.rebuild((b) => b final transactionRule = widget.viewModel.transactionRule.rebuild((b) => b
// STARTER: set value - do not remove comment // STARTER: set value - do not remove comment
..transaction_rules = _transaction_rulesController.text.trim()); ..name = _nameController.text.trim());
if (transactionRule != widget.viewModel.transactionRule) { if (transactionRule != widget.viewModel.transactionRule) {
widget.viewModel.onChanged(transactionRule); widget.viewModel.onChanged(transactionRule);
} }
@ -96,7 +96,7 @@ class _TransactionRuleEditState extends State<TransactionRuleEdit> {
children: <Widget>[ children: <Widget>[
// STARTER: widgets - do not remove comment // STARTER: widgets - do not remove comment
TextFormField( TextFormField(
controller: _transaction_rulesController, controller: _nameController,
autocorrect: false, autocorrect: false,
decoration: InputDecoration( decoration: InputDecoration(
labelText: 'Transaction_rules', labelText: 'Transaction_rules',

View File

@ -90495,7 +90495,7 @@ mixin LocalizationsProvider on LocaleCodeAware {
String get searchTransactionRule => String get searchTransactionRule =>
_localizedValues[localeCode]['search_transaction_rule'] ?? _localizedValues[localeCode]['search_transaction_rule'] ??
_localizedValues['en']['search_transaction_rule']; _localizedValues['en']['search_transaction_rule'];
String get searchTransactionRule => String get searchTransactionRules =>
_localizedValues[localeCode]['search_transaction_rules'] ?? _localizedValues[localeCode]['search_transaction_rules'] ??
_localizedValues['en']['search_transaction_rules']; _localizedValues['en']['search_transaction_rules'];

View File

@ -174,6 +174,8 @@ IconData getEntityIcon(EntityType entityType) {
return MdiIcons.bankTransfer; return MdiIcons.bankTransfer;
case EntityType.bankAccount: case EntityType.bankAccount:
return MdiIcons.bank; return MdiIcons.bank;
case EntityType.transactionRule:
return Icons.rule_folder;
default: default:
return MdiIcons.crosshairsQuestion; return MdiIcons.crosshairsQuestion;
} }

View File

@ -214,7 +214,7 @@ else
echo "app_state: has changes" echo "app_state: has changes"
comment="STARTER: has changes - do not remove comment" comment="STARTER: has changes - do not remove comment"
code="case ${Module}EditScreen.route: return has${module_camel}UIState.editing.isChanged == true;${lineBreak}" code="case ${Module}EditScreen.route: return ${module_camel}UIState.editing.isChanged == true;${lineBreak}"
sed -i -e "s/$comment/$comment${lineBreak}$code/g" ./lib/redux/app/app_state.dart sed -i -e "s/$comment/$comment${lineBreak}$code/g" ./lib/redux/app/app_state.dart
for (( idx=${#fieldsArray[@]}-1 ; idx>=0 ; idx-- )) ; do for (( idx=${#fieldsArray[@]}-1 ; idx>=0 ; idx-- )) ; do