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