From 7b6070af8ea3bafe23af38223c41af53e9f87e7d Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 18 Jan 2024 19:34:27 +0200 Subject: [PATCH] Scheduled reports --- lib/data/models/import_model.dart | 14 +++---- lib/data/models/import_model.g.dart | 53 +++++++++++-------------- lib/ui/schedule/edit/schedule_edit.dart | 41 +------------------ lib/utils/i18n.dart | 17 ++++---- 4 files changed, 38 insertions(+), 87 deletions(-) diff --git a/lib/data/models/import_model.dart b/lib/data/models/import_model.dart index d6fe68618..90f7d5dfd 100644 --- a/lib/data/models/import_model.dart +++ b/lib/data/models/import_model.dart @@ -202,14 +202,12 @@ class ExportType extends EnumClass { static const ExportType products = _$products; static const ExportType tasks = _$tasks; static const ExportType profitloss = _$profitloss; - static const ExportType aged_receivable_detailed_report = - _$aged_receivable_detailed_report; - static const ExportType aged_receivable_summary_report = - _$aged_receivable_summary_report; - static const ExportType client_balance_report = _$client_balance_report; - static const ExportType client_sales_report = _$client_sales_report; - static const ExportType tax_summary_report = _$tax_summary_report; - static const ExportType user_sales_report = _$user_sales_report; + static const ExportType ar_detailed = _$ar_detailed; + static const ExportType ar_summary = _$ar_summary; + static const ExportType client_balance = _$client_balance; + static const ExportType client_sales = _$client_sales; + static const ExportType tax_summary = _$tax_summary; + static const ExportType user_sales = _$user_sales; static BuiltSet get values => _$exportValues; diff --git a/lib/data/models/import_model.g.dart b/lib/data/models/import_model.g.dart index 2085b103b..6cc1f2274 100644 --- a/lib/data/models/import_model.g.dart +++ b/lib/data/models/import_model.g.dart @@ -62,17 +62,12 @@ const ExportType _$payments = const ExportType._('payments'); const ExportType _$products = const ExportType._('products'); const ExportType _$tasks = const ExportType._('tasks'); const ExportType _$profitloss = const ExportType._('profitloss'); -const ExportType _$aged_receivable_detailed_report = - const ExportType._('aged_receivable_detailed_report'); -const ExportType _$aged_receivable_summary_report = - const ExportType._('aged_receivable_summary_report'); -const ExportType _$client_balance_report = - const ExportType._('client_balance_report'); -const ExportType _$client_sales_report = - const ExportType._('client_sales_report'); -const ExportType _$tax_summary_report = - const ExportType._('tax_summary_report'); -const ExportType _$user_sales_report = const ExportType._('user_sales_report'); +const ExportType _$ar_detailed = const ExportType._('ar_detailed'); +const ExportType _$ar_summary = const ExportType._('ar_summary'); +const ExportType _$client_balance = const ExportType._('client_balance'); +const ExportType _$client_sales = const ExportType._('client_sales'); +const ExportType _$tax_summary = const ExportType._('tax_summary'); +const ExportType _$user_sales = const ExportType._('user_sales'); ExportType _$exportValueOf(String name) { switch (name) { @@ -106,18 +101,18 @@ ExportType _$exportValueOf(String name) { return _$tasks; case 'profitloss': return _$profitloss; - case 'aged_receivable_detailed_report': - return _$aged_receivable_detailed_report; - case 'aged_receivable_summary_report': - return _$aged_receivable_summary_report; - case 'client_balance_report': - return _$client_balance_report; - case 'client_sales_report': - return _$client_sales_report; - case 'tax_summary_report': - return _$tax_summary_report; - case 'user_sales_report': - return _$user_sales_report; + case 'ar_detailed': + return _$ar_detailed; + case 'ar_summary': + return _$ar_summary; + case 'client_balance': + return _$client_balance; + case 'client_sales': + return _$client_sales; + case 'tax_summary': + return _$tax_summary; + case 'user_sales': + return _$user_sales; default: throw new ArgumentError(name); } @@ -140,12 +135,12 @@ final BuiltSet _$exportValues = _$products, _$tasks, _$profitloss, - _$aged_receivable_detailed_report, - _$aged_receivable_summary_report, - _$client_balance_report, - _$client_sales_report, - _$tax_summary_report, - _$user_sales_report, + _$ar_detailed, + _$ar_summary, + _$client_balance, + _$client_sales, + _$tax_summary, + _$user_sales, ]); Serializer _$preImportResponseSerializer = diff --git a/lib/ui/schedule/edit/schedule_edit.dart b/lib/ui/schedule/edit/schedule_edit.dart index f4d9fb82b..808b0baf8 100644 --- a/lib/ui/schedule/edit/schedule_edit.dart +++ b/lib/ui/schedule/edit/schedule_edit.dart @@ -232,46 +232,7 @@ class _ScheduleEditState extends State { ), if (schedule.template == ScheduleEntity.TEMPLATE_EMAIL_REPORT) ...[ - FormCard( - isLast: true, - children: [ - ClientPicker( - key: ValueKey( - '__report_client_picker_${_clientClearedAt}__'), - isRequired: false, - clientId: null, - clientState: state.clientState, - excludeIds: parameters.clients!.toList(), - onSelected: (value) { - if (value == null) { - return; - } - if (!parameters.clients!.contains(value.id)) { - viewModel.onChanged(schedule.rebuild( - (b) => b..parameters.clients.add(value.id))); - } - setState(() { - _clientClearedAt = - DateTime.now().toIso8601String(); - }); - }), - SizedBox(height: 20), - if (parameters.clients!.isEmpty) - HelpText(localization.allClients), - for (var clientId in parameters.clients!) - ListTile( - title: - Text(state.clientState.get(clientId).displayName), - trailing: IconButton( - icon: Icon(Icons.clear), - onPressed: () { - viewModel.onChanged(schedule.rebuild((b) => - b..parameters.clients.remove(clientId))); - }, - ), - ), - ], - ), + // ] else if (schedule.template == ScheduleEntity.TEMPLATE_EMAIL_STATEMENT) ...[ FormCard(children: [ diff --git a/lib/utils/i18n.dart b/lib/utils/i18n.dart index debe6777c..f1c6f662b 100644 --- a/lib/utils/i18n.dart +++ b/lib/utils/i18n.dart @@ -37,12 +37,11 @@ mixin LocalizationsProvider on LocaleCodeAware { 'primary_contact': 'Primary Contact', 'all_contacts': 'All Contacts', 'insert_below': 'Insert Below', - 'aged_receivable_detailed_report': 'Aged Receivable Detailed Report', - 'aged_receivable_summary_report': 'Aged Receivable Summary Report', - 'client_balance_report': 'Client Balance Report', - 'client_sales_report': 'Client Sales Report', - 'tax_summary_report': 'Tax Summary Report', - 'user_sales_report': 'User Sales Report', + 'ar_detailed': 'Accounts Receivable Detailed', + 'ar_summary': 'Accounts Receivable Summary', + 'client_sales': 'Client Sales', + 'tax_summary': 'Tax Summary', + 'user_sales': 'User Sales', 'run_template': 'Run Template', 'task_extension_banner': 'Install the Chrome extension to manage tasks in your browser', @@ -114240,12 +114239,10 @@ mixin LocalizationsProvider on LocaleCodeAware { _localizedValues['en']!['nordigen_help']!; String get host => - _localizedValues[localeCode]!['host'] ?? - _localizedValues['en']!['host']!; + _localizedValues[localeCode]!['host'] ?? _localizedValues['en']!['host']!; String get port => - _localizedValues[localeCode]!['port'] ?? - _localizedValues['en']!['port']!; + _localizedValues[localeCode]!['port'] ?? _localizedValues['en']!['port']!; String get encryption => _localizedValues[localeCode]!['encryption'] ??