Update models
This commit is contained in:
parent
2c3863eb00
commit
8d08df504d
|
|
@ -294,10 +294,6 @@ abstract class ExpenseEntity extends Object
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isInvoiced && !multiselect) {
|
|
||||||
actions.add(EntityAction.viewInvoice);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (userCompany.canCreate(EntityType.task) && !multiselect) {
|
if (userCompany.canCreate(EntityType.task) && !multiselect) {
|
||||||
actions.add(EntityAction.clone);
|
actions.add(EntityAction.clone);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -70,8 +70,6 @@ class EntityAction extends EnumClass {
|
||||||
static const EntityAction newExpense = _$newExpense;
|
static const EntityAction newExpense = _$newExpense;
|
||||||
static const EntityAction newProject = _$newProject;
|
static const EntityAction newProject = _$newProject;
|
||||||
static const EntityAction newTask = _$newTask;
|
static const EntityAction newTask = _$newTask;
|
||||||
static const EntityAction viewInvoice = _$viewInvoice;
|
|
||||||
static const EntityAction viewQuote = _$viewQuote;
|
|
||||||
static const EntityAction clientPortal = _$clientPortal;
|
static const EntityAction clientPortal = _$clientPortal;
|
||||||
static const EntityAction newPayment = _$newPayment;
|
static const EntityAction newPayment = _$newPayment;
|
||||||
static const EntityAction settings = _$settings;
|
static const EntityAction settings = _$settings;
|
||||||
|
|
|
||||||
|
|
@ -516,10 +516,6 @@ abstract class TaskEntity extends Object
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!multiselect) {
|
if (!multiselect) {
|
||||||
if (isInvoiced) {
|
|
||||||
actions.add(EntityAction.viewInvoice);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (userCompany.canCreate(EntityType.task)) {
|
if (userCompany.canCreate(EntityType.task)) {
|
||||||
actions.add(EntityAction.clone);
|
actions.add(EntityAction.clone);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -424,13 +424,6 @@ Future handleCreditAction(
|
||||||
forceSafariVC: false, forceWebView: false);
|
forceSafariVC: false, forceWebView: false);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case EntityAction.viewInvoice:
|
|
||||||
viewEntityById(
|
|
||||||
context: context,
|
|
||||||
// TODO fix this
|
|
||||||
// entityId: credit.creditInvoiceId,
|
|
||||||
entityType: EntityType.invoice);
|
|
||||||
break;
|
|
||||||
case EntityAction.markSent:
|
case EntityAction.markSent:
|
||||||
store.dispatch(MarkSentCreditRequest(
|
store.dispatch(MarkSentCreditRequest(
|
||||||
snackBarCompleter<Null>(context, localization.markedCreditAsSent),
|
snackBarCompleter<Null>(context, localization.markedCreditAsSent),
|
||||||
|
|
|
||||||
|
|
@ -288,12 +288,6 @@ void handleExpenseAction(
|
||||||
..lineItems.addAll(items)));
|
..lineItems.addAll(items)));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case EntityAction.viewInvoice:
|
|
||||||
viewEntityById(
|
|
||||||
context: context,
|
|
||||||
entityType: EntityType.invoice,
|
|
||||||
entityId: expense.invoiceId);
|
|
||||||
break;
|
|
||||||
case EntityAction.restore:
|
case EntityAction.restore:
|
||||||
final message = expenseIds.length > 1
|
final message = expenseIds.length > 1
|
||||||
? localization.restoredExpenses
|
? localization.restoredExpenses
|
||||||
|
|
|
||||||
|
|
@ -443,12 +443,6 @@ Future handleQuoteAction(
|
||||||
forceSafariVC: false, forceWebView: false);
|
forceSafariVC: false, forceWebView: false);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case EntityAction.viewInvoice:
|
|
||||||
viewEntityById(
|
|
||||||
context: context,
|
|
||||||
entityId: quote.invoiceId,
|
|
||||||
entityType: EntityType.invoice);
|
|
||||||
break;
|
|
||||||
case EntityAction.convert:
|
case EntityAction.convert:
|
||||||
store.dispatch(ConvertQuotes(
|
store.dispatch(ConvertQuotes(
|
||||||
snackBarCompleter<Null>(context, localization.convertedQuote),
|
snackBarCompleter<Null>(context, localization.convertedQuote),
|
||||||
|
|
|
||||||
|
|
@ -337,12 +337,6 @@ void handleTaskAction(
|
||||||
..lineItems.addAll(items)));
|
..lineItems.addAll(items)));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case EntityAction.viewInvoice:
|
|
||||||
viewEntityById(
|
|
||||||
context: context,
|
|
||||||
entityType: EntityType.invoice,
|
|
||||||
entityId: task.invoiceId);
|
|
||||||
break;
|
|
||||||
case EntityAction.clone:
|
case EntityAction.clone:
|
||||||
createEntity(context: context, entity: task.clone);
|
createEntity(context: context, entity: task.clone);
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -90,7 +90,7 @@ class _ExpenseViewState extends State<ExpenseView>
|
||||||
entity: expense,
|
entity: expense,
|
||||||
action1: EntityAction.clone,
|
action1: EntityAction.clone,
|
||||||
action2: expense.isInvoiced
|
action2: expense.isInvoiced
|
||||||
? EntityAction.viewInvoice
|
? EntityAction.archive
|
||||||
: EntityAction.newInvoice,
|
: EntityAction.newInvoice,
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
|
|
|
||||||
|
|
@ -94,7 +94,7 @@ class _TaskViewState extends State<TaskView>
|
||||||
? EntityAction.start
|
? EntityAction.start
|
||||||
: EntityAction.resume,
|
: EntityAction.resume,
|
||||||
action2: task.isInvoiced
|
action2: task.isInvoiced
|
||||||
? EntityAction.viewInvoice
|
? EntityAction.archive
|
||||||
: EntityAction.newInvoice,
|
: EntityAction.newInvoice,
|
||||||
action1Enabled: !task.isInvoiced,
|
action1Enabled: !task.isInvoiced,
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -39,8 +39,6 @@ IconData getEntityActionIcon(EntityAction entityAction) {
|
||||||
return Icons.content_copy;
|
return Icons.content_copy;
|
||||||
case EntityAction.approve:
|
case EntityAction.approve:
|
||||||
return Icons.check_circle_outline;
|
return Icons.check_circle_outline;
|
||||||
case EntityAction.viewInvoice:
|
|
||||||
return Icons.insert_drive_file;
|
|
||||||
case EntityAction.newInvoice:
|
case EntityAction.newInvoice:
|
||||||
case EntityAction.newExpense:
|
case EntityAction.newExpense:
|
||||||
case EntityAction.newTask:
|
case EntityAction.newTask:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue