Settings
This commit is contained in:
parent
a464428144
commit
a010756b5f
|
|
@ -405,24 +405,28 @@ abstract class InvoiceEntity extends Object
|
|||
final actions = <EntityAction>[];
|
||||
|
||||
if (!isDeleted) {
|
||||
if (includeEdit && userCompany.canEditEntity(this)) {
|
||||
actions.add(EntityAction.edit);
|
||||
}
|
||||
if (userCompany.canEditEntity(this)) {
|
||||
if (includeEdit) {
|
||||
actions.add(EntityAction.edit);
|
||||
}
|
||||
|
||||
if (userCompany.canEditEntity(this) && !isSent) {
|
||||
actions.add(EntityAction.markSent);
|
||||
}
|
||||
if (!isSent) {
|
||||
actions.add(EntityAction.markSent);
|
||||
}
|
||||
|
||||
if (userCompany.canEditEntity(this) &&
|
||||
client != null &&
|
||||
client.hasEmailAddress) {
|
||||
actions.add(EntityAction.sendEmail);
|
||||
}
|
||||
if (!isPaid) {
|
||||
actions.add(EntityAction.markPaid);
|
||||
}
|
||||
|
||||
if (userCompany.canEditEntity(this) &&
|
||||
userCompany.canCreate(EntityType.payment) &&
|
||||
isUnpaid) {
|
||||
actions.add(EntityAction.newPayment);
|
||||
if (client != null &&
|
||||
client.hasEmailAddress) {
|
||||
actions.add(EntityAction.sendEmail);
|
||||
}
|
||||
|
||||
if (userCompany.canCreate(EntityType.payment) &&
|
||||
isUnpaid) {
|
||||
actions.add(EntityAction.newPayment);
|
||||
}
|
||||
}
|
||||
|
||||
if (invitations.isNotEmpty) {
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@ class EntityAction extends EnumClass {
|
|||
static const EntityAction download = _$download;
|
||||
static const EntityAction sendEmail = _$sendEmail;
|
||||
static const EntityAction markSent = _$markSent;
|
||||
static const EntityAction markPaid = _$markPaid;
|
||||
static const EntityAction newClient = _$newClient;
|
||||
static const EntityAction newInvoice = _$newInvoice;
|
||||
static const EntityAction newQuote = _$newQuote;
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ const EntityAction _$convert = const EntityAction._('convert');
|
|||
const EntityAction _$download = const EntityAction._('download');
|
||||
const EntityAction _$sendEmail = const EntityAction._('sendEmail');
|
||||
const EntityAction _$markSent = const EntityAction._('markSent');
|
||||
const EntityAction _$markPaid = const EntityAction._('markPaid');
|
||||
const EntityAction _$newClient = const EntityAction._('newClient');
|
||||
const EntityAction _$newInvoice = const EntityAction._('newInvoice');
|
||||
const EntityAction _$newQuote = const EntityAction._('newQuote');
|
||||
|
|
@ -60,6 +61,8 @@ EntityAction _$valueOf(String name) {
|
|||
return _$sendEmail;
|
||||
case 'markSent':
|
||||
return _$markSent;
|
||||
case 'markPaid':
|
||||
return _$markPaid;
|
||||
case 'newClient':
|
||||
return _$newClient;
|
||||
case 'newInvoice':
|
||||
|
|
@ -112,6 +115,7 @@ final BuiltSet<EntityAction> _$values =
|
|||
_$download,
|
||||
_$sendEmail,
|
||||
_$markSent,
|
||||
_$markPaid,
|
||||
_$newClient,
|
||||
_$newInvoice,
|
||||
_$newQuote,
|
||||
|
|
|
|||
Loading…
Reference in New Issue