Scheduled reports

This commit is contained in:
Hillel Coren 2024-01-18 19:34:27 +02:00
parent 5b83883884
commit 7b6070af8e
4 changed files with 38 additions and 87 deletions

View File

@ -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<ExportType> get values => _$exportValues;

View File

@ -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<ExportType> _$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<PreImportResponse> _$preImportResponseSerializer =

View File

@ -232,46 +232,7 @@ class _ScheduleEditState extends State<ScheduleEdit> {
),
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: [

View File

@ -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'] ??