Aging report

This commit is contained in:
Hillel Coren 2020-03-15 21:00:58 +02:00
parent f738814daf
commit 69da36731d
3 changed files with 181 additions and 133 deletions

View File

@ -231,6 +231,20 @@ const String kSettings = 'settings';
const String kDashboard = 'dashboard';
const String kReports = 'reports';
const String kAgeGroup0 = 'age_group_0';
const String kAgeGroup30 = 'age_group_30';
const String kAgeGroup60 = 'age_group_60';
const String kAgeGroup90 = 'age_group_90';
const String kAgeGroup120 = 'age_group_120';
const kAgeGroups = {
kAgeGroup0: 0,
kAgeGroup30: 30,
kAgeGroup60: 60,
kAgeGroup90: 90,
kAgeGroup120: 120,
};
/*
const String kEmailTemplateInvoice = 'invoice_email';
const String kEmailTemplateQuote = 'quote_email';

View File

@ -782,6 +782,23 @@ class ReportResult {
),
],
))
else
if (column == 'age')
DataCell(AppDropdownButton<String>(
value: (textEditingControllers[column].text ?? '')
.isNotEmpty &&
textEditingControllers[column].text != 'null'
? localization.lookup(textEditingControllers[column].text)
: null,
onChanged: (dynamic value) {
print('## onChanged: $value');
},
items: kAgeGroups.keys.map((ageGroup) =>
DropdownMenuItem(
child: Text(localization.lookup(ageGroup)),
value: ageGroup,
)).toList(),
))
else
if (getReportColumnType(column, context) ==
ReportColumnType.number)
@ -807,7 +824,8 @@ class ReportResult {
else
if (getReportColumnType(column, context) ==
ReportColumnType.dateTime ||
getReportColumnType(column, context) == ReportColumnType.date)
getReportColumnType(column, context) ==
ReportColumnType.date)
DataCell(AppDropdownButton<DateRange>(
labelText: null,
showBlank: true,
@ -829,7 +847,8 @@ class ReportResult {
items: DateRange.values
.map((dateRange) =>
DropdownMenuItem<DateRange>(
child: Text(localization.lookup(dateRange.toString())),
child: Text(localization.lookup(dateRange
.toString())),
value: dateRange,
))
.toList(),

View File

@ -15,6 +15,11 @@ mixin LocalizationsProvider on LocaleCodeAware {
static final Map<String, Map<String, String>> _localizedValues = {
'en': {
// STARTER: lang key - do not remove comment
'age_group_0': '0 - 30 Days',
'age_group_30': '30 - 60 Days',
'age_group_60': '60 - 90 Days',
'age_group_90': '90 - 120 Days',
'age_group_120': '120+ Days',
'refresh': 'Refresh',
'saved_design': 'Successfully saved design',
'client_details': 'Client Details',
@ -33039,6 +33044,16 @@ mixin LocalizationsProvider on LocaleCodeAware {
String get age => _localizedValues[localeCode]['age'];
String get ageGroup0 => _localizedValues[localeCode]['age_group_0'];
String get ageGroup30 => _localizedValues[localeCode]['age_group_30'];
String get ageGroup60 => _localizedValues[localeCode]['age_group_60'];
String get ageGroup90 => _localizedValues[localeCode]['age_group_90'];
String get ageGroup120 => _localizedValues[localeCode]['age_group_120'];
String lookup(String key) {
final lookupKey = toSnakeCase(key);
return _localizedValues[localeCode][lookupKey] ??