Settings
This commit is contained in:
parent
93b94a8062
commit
eed398ba9f
|
|
@ -389,7 +389,7 @@ abstract class ClientEntity extends Object
|
||||||
}
|
}
|
||||||
|
|
||||||
if (userCompany.canCreate(EntityType.payment)) {
|
if (userCompany.canCreate(EntityType.payment)) {
|
||||||
actions.add(EntityAction.enterPayment);
|
actions.add(EntityAction.newPayment);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -415,7 +415,7 @@ abstract class InvoiceEntity extends Object
|
||||||
if (userCompany.canEditEntity(this) &&
|
if (userCompany.canEditEntity(this) &&
|
||||||
userCompany.canCreate(EntityType.payment) &&
|
userCompany.canCreate(EntityType.payment) &&
|
||||||
isUnpaid) {
|
isUnpaid) {
|
||||||
actions.add(EntityAction.enterPayment);
|
actions.add(EntityAction.newPayment);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (invitations.isNotEmpty) {
|
if (invitations.isNotEmpty) {
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ class EntityAction extends EnumClass {
|
||||||
static const EntityAction viewInvoice = _$viewInvoice;
|
static const EntityAction viewInvoice = _$viewInvoice;
|
||||||
static const EntityAction viewQuote = _$viewQuote;
|
static const EntityAction viewQuote = _$viewQuote;
|
||||||
static const EntityAction clientPortal = _$clientPortal;
|
static const EntityAction clientPortal = _$clientPortal;
|
||||||
static const EntityAction enterPayment = _$enterPayment;
|
static const EntityAction newPayment = _$newPayment;
|
||||||
static const EntityAction settings = _$settings;
|
static const EntityAction settings = _$settings;
|
||||||
static const EntityAction pdf = _$pdf;
|
static const EntityAction pdf = _$pdf;
|
||||||
static const EntityAction more = _$more;
|
static const EntityAction more = _$more;
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ const EntityAction _$newTask = const EntityAction._('newTask');
|
||||||
const EntityAction _$viewInvoice = const EntityAction._('viewInvoice');
|
const EntityAction _$viewInvoice = const EntityAction._('viewInvoice');
|
||||||
const EntityAction _$viewQuote = const EntityAction._('viewQuote');
|
const EntityAction _$viewQuote = const EntityAction._('viewQuote');
|
||||||
const EntityAction _$clientPortal = const EntityAction._('clientPortal');
|
const EntityAction _$clientPortal = const EntityAction._('clientPortal');
|
||||||
const EntityAction _$enterPayment = const EntityAction._('enterPayment');
|
const EntityAction _$newPayment = const EntityAction._('newPayment');
|
||||||
const EntityAction _$settings = const EntityAction._('settings');
|
const EntityAction _$settings = const EntityAction._('settings');
|
||||||
const EntityAction _$pdf = const EntityAction._('pdf');
|
const EntityAction _$pdf = const EntityAction._('pdf');
|
||||||
const EntityAction _$more = const EntityAction._('more');
|
const EntityAction _$more = const EntityAction._('more');
|
||||||
|
|
@ -72,8 +72,8 @@ EntityAction _$valueOf(String name) {
|
||||||
return _$viewQuote;
|
return _$viewQuote;
|
||||||
case 'clientPortal':
|
case 'clientPortal':
|
||||||
return _$clientPortal;
|
return _$clientPortal;
|
||||||
case 'enterPayment':
|
case 'newPayment':
|
||||||
return _$enterPayment;
|
return _$newPayment;
|
||||||
case 'settings':
|
case 'settings':
|
||||||
return _$settings;
|
return _$settings;
|
||||||
case 'pdf':
|
case 'pdf':
|
||||||
|
|
@ -113,7 +113,7 @@ final BuiltSet<EntityAction> _$values =
|
||||||
_$viewInvoice,
|
_$viewInvoice,
|
||||||
_$viewQuote,
|
_$viewQuote,
|
||||||
_$clientPortal,
|
_$clientPortal,
|
||||||
_$enterPayment,
|
_$newPayment,
|
||||||
_$settings,
|
_$settings,
|
||||||
_$pdf,
|
_$pdf,
|
||||||
_$more,
|
_$more,
|
||||||
|
|
|
||||||
|
|
@ -403,7 +403,7 @@ abstract class QuoteEntity extends Object
|
||||||
|
|
||||||
if (userCompany.canEditEntity(this) &&
|
if (userCompany.canEditEntity(this) &&
|
||||||
userCompany.canCreate(EntityType.payment)) {
|
userCompany.canCreate(EntityType.payment)) {
|
||||||
actions.add(EntityAction.enterPayment);
|
actions.add(EntityAction.newPayment);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((quoteInvoiceId ?? '').isNotEmpty) {
|
if ((quoteInvoiceId ?? '').isNotEmpty) {
|
||||||
|
|
|
||||||
|
|
@ -484,7 +484,7 @@ bool hasChanges({
|
||||||
if (store.state.hasChanges() && !isMobile(context)) {
|
if (store.state.hasChanges() && !isMobile(context)) {
|
||||||
showDialog<MessageDialog>(
|
showDialog<MessageDialog>(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext dialogContext) {
|
||||||
return MessageDialog(localization.errorUnsavedChanges,
|
return MessageDialog(localization.errorUnsavedChanges,
|
||||||
dismissLabel: localization.continueEditing, onDiscard: () {
|
dismissLabel: localization.continueEditing, onDiscard: () {
|
||||||
store.dispatch(DiscardChanges());
|
store.dispatch(DiscardChanges());
|
||||||
|
|
|
||||||
|
|
@ -306,7 +306,7 @@ void handleClientAction(
|
||||||
company: company, client: client, prefState: state.prefState),
|
company: company, client: client, prefState: state.prefState),
|
||||||
context: context));
|
context: context));
|
||||||
break;
|
break;
|
||||||
case EntityAction.enterPayment:
|
case EntityAction.newPayment:
|
||||||
store.dispatch(EditPayment(
|
store.dispatch(EditPayment(
|
||||||
payment: PaymentEntity(company: company)
|
payment: PaymentEntity(company: company)
|
||||||
.rebuild((b) => b.clientId = client.id),
|
.rebuild((b) => b.clientId = client.id),
|
||||||
|
|
|
||||||
|
|
@ -393,7 +393,7 @@ void handleInvoiceAction(BuildContext context, List<BaseEntity> invoices,
|
||||||
store.dispatch(
|
store.dispatch(
|
||||||
EditQuote(context: context, quote: invoice.clone)); // TODO fix this
|
EditQuote(context: context, quote: invoice.clone)); // TODO fix this
|
||||||
break;
|
break;
|
||||||
case EntityAction.enterPayment:
|
case EntityAction.newPayment:
|
||||||
store.dispatch(EditPayment(
|
store.dispatch(EditPayment(
|
||||||
context: context, payment: invoice.createPayment(company)));
|
context: context, payment: invoice.createPayment(company)));
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -699,6 +699,7 @@ mixin LocalizationsProvider on LocaleCodeAware {
|
||||||
'payment_type': 'Payment Type',
|
'payment_type': 'Payment Type',
|
||||||
'transaction_reference': 'Transaction Reference',
|
'transaction_reference': 'Transaction Reference',
|
||||||
'enter_payment': 'Enter Payment',
|
'enter_payment': 'Enter Payment',
|
||||||
|
'new_payment': 'Enter Payment',
|
||||||
'created_payment': 'Successfully created payment',
|
'created_payment': 'Successfully created payment',
|
||||||
'updated_payment': 'Successfully updated payment',
|
'updated_payment': 'Successfully updated payment',
|
||||||
'archived_payment': 'Successfully archived payment',
|
'archived_payment': 'Successfully archived payment',
|
||||||
|
|
@ -15763,6 +15764,8 @@ mixin LocalizationsProvider on LocaleCodeAware {
|
||||||
|
|
||||||
String get selectCompany => _localizedValues[localeCode]['select_company'];
|
String get selectCompany => _localizedValues[localeCode]['select_company'];
|
||||||
|
|
||||||
|
String get newPayment => _localizedValues[localeCode]['new_payment'];
|
||||||
|
|
||||||
String lookup(String key) {
|
String lookup(String key) {
|
||||||
final lookupKey = toSnakeCase(key);
|
final lookupKey = toSnakeCase(key);
|
||||||
return _localizedValues[localeCode][lookupKey] ??
|
return _localizedValues[localeCode][lookupKey] ??
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ IconData getEntityActionIcon(EntityAction entityAction) {
|
||||||
case EntityAction.newExpense:
|
case EntityAction.newExpense:
|
||||||
case EntityAction.newTask:
|
case EntityAction.newTask:
|
||||||
case EntityAction.newClient:
|
case EntityAction.newClient:
|
||||||
case EntityAction.enterPayment:
|
case EntityAction.newPayment:
|
||||||
return Icons.add_circle_outline;
|
return Icons.add_circle_outline;
|
||||||
case EntityAction.resume:
|
case EntityAction.resume:
|
||||||
case EntityAction.start:
|
case EntityAction.start:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue