Clarify activity for recurring invoices/expenses
This commit is contained in:
parent
4bafdfd807
commit
84f7031652
|
|
@ -907,7 +907,8 @@ abstract class ActivityEntity
|
||||||
|
|
||||||
String getDescription(
|
String getDescription(
|
||||||
String activity,
|
String activity,
|
||||||
String systemString, {
|
String systemString,
|
||||||
|
String recurringString, {
|
||||||
UserEntity user,
|
UserEntity user,
|
||||||
ClientEntity client,
|
ClientEntity client,
|
||||||
InvoiceEntity invoice,
|
InvoiceEntity invoice,
|
||||||
|
|
@ -932,8 +933,18 @@ abstract class ActivityEntity
|
||||||
vendorContact = vendor.getContact(vendorContactId);
|
vendorContact = vendor.getContact(vendorContactId);
|
||||||
}
|
}
|
||||||
|
|
||||||
activity =
|
if ((recurringInvoice?.isOld ?? false) && (invoice?.isOld ?? false)) {
|
||||||
activity.replaceFirst(':user', user?.listDisplayName ?? systemString);
|
activity = activity.replaceFirst(
|
||||||
|
':user', '$recurringString ${recurringInvoice.number}');
|
||||||
|
} else if ((recurringExpense?.isOld ?? false) &&
|
||||||
|
(expense?.isOld ?? false)) {
|
||||||
|
activity = activity.replaceFirst(
|
||||||
|
':user', '$recurringString ${recurringExpense.number}');
|
||||||
|
} else {
|
||||||
|
activity =
|
||||||
|
activity.replaceFirst(':user', user?.listDisplayName ?? systemString);
|
||||||
|
}
|
||||||
|
|
||||||
activity = activity.replaceFirst(':client', client?.displayName ?? '');
|
activity = activity.replaceFirst(':client', client?.displayName ?? '');
|
||||||
activity = activity.replaceFirst(':invoice', invoice?.number ?? '');
|
activity = activity.replaceFirst(':invoice', invoice?.number ?? '');
|
||||||
activity = activity.replaceFirst(
|
activity = activity.replaceFirst(
|
||||||
|
|
|
||||||
|
|
@ -54,6 +54,7 @@ class ActivityListTile extends StatelessWidget {
|
||||||
title = activity.getDescription(
|
title = activity.getDescription(
|
||||||
title,
|
title,
|
||||||
localization.system,
|
localization.system,
|
||||||
|
localization.recurring,
|
||||||
user: user,
|
user: user,
|
||||||
client: client,
|
client: client,
|
||||||
invoice: invoice,
|
invoice: invoice,
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@ mixin LocalizationsProvider on LocaleCodeAware {
|
||||||
static final Map<String, Map<String, String>> _localizedValues = {
|
static final Map<String, Map<String, String>> _localizedValues = {
|
||||||
'en': {
|
'en': {
|
||||||
// STARTER: lang key - do not remove comment
|
// STARTER: lang key - do not remove comment
|
||||||
|
'recurring': 'Recurring',
|
||||||
'ziptax_help':
|
'ziptax_help':
|
||||||
'Note: this feature requires a Zip-Tax API key to lookup US sales tax by address',
|
'Note: this feature requires a Zip-Tax API key to lookup US sales tax by address',
|
||||||
'cache_data': 'Cache Data',
|
'cache_data': 'Cache Data',
|
||||||
|
|
@ -109443,6 +109444,10 @@ mixin LocalizationsProvider on LocaleCodeAware {
|
||||||
_localizedValues[localeCode]['ziptax_help'] ??
|
_localizedValues[localeCode]['ziptax_help'] ??
|
||||||
_localizedValues['en']['ziptax_help'];
|
_localizedValues['en']['ziptax_help'];
|
||||||
|
|
||||||
|
String get recurring =>
|
||||||
|
_localizedValues[localeCode]['recurring'] ??
|
||||||
|
_localizedValues['en']['recurring'];
|
||||||
|
|
||||||
// STARTER: lang field - do not remove comment
|
// STARTER: lang field - do not remove comment
|
||||||
|
|
||||||
String lookup(String key) {
|
String lookup(String key) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue