Adjust dashboard
This commit is contained in:
parent
46b12b2375
commit
ecaf1208e6
|
|
@ -316,6 +316,8 @@ abstract class BaseEntity implements SelectableEntity {
|
||||||
|
|
||||||
bool get isActive => archivedAt == null || archivedAt == 0;
|
bool get isActive => archivedAt == null || archivedAt == 0;
|
||||||
|
|
||||||
|
bool get isNotActive => !isActive;
|
||||||
|
|
||||||
bool get isArchived => archivedAt != null && archivedAt > 0 && !isDeleted;
|
bool get isArchived => archivedAt != null && archivedAt > 0 && !isDeleted;
|
||||||
|
|
||||||
bool get isEditable => !isDeleted;
|
bool get isEditable => !isDeleted;
|
||||||
|
|
|
||||||
|
|
@ -22,9 +22,9 @@ List<InvoiceEntity> _upcomingInvoices({
|
||||||
invoiceMap.forEach((index, invoice) {
|
invoiceMap.forEach((index, invoice) {
|
||||||
final client =
|
final client =
|
||||||
clientMap[invoice.clientId] ?? ClientEntity(id: invoice.clientId);
|
clientMap[invoice.clientId] ?? ClientEntity(id: invoice.clientId);
|
||||||
if (invoice.isDeleted ||
|
if (invoice.isNotActive ||
|
||||||
invoice.isCancelledOrReversed ||
|
invoice.isCancelledOrReversed ||
|
||||||
client.isDeleted) {
|
client.isNotActive) {
|
||||||
// do noting
|
// do noting
|
||||||
} else if (invoice.isUpcoming) {
|
} else if (invoice.isUpcoming) {
|
||||||
invoices.add(invoice);
|
invoices.add(invoice);
|
||||||
|
|
@ -54,9 +54,9 @@ List<InvoiceEntity> _pastDueInvoices({
|
||||||
invoiceMap.forEach((index, invoice) {
|
invoiceMap.forEach((index, invoice) {
|
||||||
final client =
|
final client =
|
||||||
clientMap[invoice.clientId] ?? ClientEntity(id: invoice.clientId);
|
clientMap[invoice.clientId] ?? ClientEntity(id: invoice.clientId);
|
||||||
if (invoice.isDeleted ||
|
if (invoice.isNotActive ||
|
||||||
invoice.isCancelledOrReversed ||
|
invoice.isCancelledOrReversed ||
|
||||||
client.isDeleted) {
|
client.isNotActive) {
|
||||||
// do noting
|
// do noting
|
||||||
} else if (invoice.isPastDue) {
|
} else if (invoice.isPastDue) {
|
||||||
invoices.add(invoice);
|
invoices.add(invoice);
|
||||||
|
|
@ -88,7 +88,7 @@ List<PaymentEntity> _recentPayments({
|
||||||
paymentMap.forEach((index, payment) {
|
paymentMap.forEach((index, payment) {
|
||||||
final client =
|
final client =
|
||||||
clientMap[payment.clientId] ?? ClientEntity(id: payment.clientId);
|
clientMap[payment.clientId] ?? ClientEntity(id: payment.clientId);
|
||||||
if (payment.isDeleted || client.isDeleted) {
|
if (payment.isNotActive || client.isNotActive) {
|
||||||
// do noting
|
// do noting
|
||||||
} else if (payment.isActive && payment.createdAt > oneMonthAgo) {
|
} else if (payment.isActive && payment.createdAt > oneMonthAgo) {
|
||||||
payments.add(payment);
|
payments.add(payment);
|
||||||
|
|
@ -118,7 +118,7 @@ List<InvoiceEntity> _upcomingQuotes({
|
||||||
quoteMap.forEach((index, quote) {
|
quoteMap.forEach((index, quote) {
|
||||||
final client =
|
final client =
|
||||||
clientMap[quote.clientId] ?? ClientEntity(id: quote.clientId);
|
clientMap[quote.clientId] ?? ClientEntity(id: quote.clientId);
|
||||||
if (quote.isDeleted || client.isDeleted) {
|
if (quote.isNotActive || client.isNotActive) {
|
||||||
// do noting
|
// do noting
|
||||||
} else if (quote.isUpcoming) {
|
} else if (quote.isUpcoming) {
|
||||||
quotes.add(quote);
|
quotes.add(quote);
|
||||||
|
|
@ -147,7 +147,7 @@ List<InvoiceEntity> _expiredQuotes({
|
||||||
quoteMap.forEach((index, quote) {
|
quoteMap.forEach((index, quote) {
|
||||||
final client =
|
final client =
|
||||||
clientMap[quote.clientId] ?? ClientEntity(id: quote.clientId);
|
clientMap[quote.clientId] ?? ClientEntity(id: quote.clientId);
|
||||||
if (quote.isDeleted || client.isDeleted) {
|
if (quote.isNotActive || client.isNotActive) {
|
||||||
// do noting
|
// do noting
|
||||||
} else if (quote.isPastDue) {
|
} else if (quote.isPastDue) {
|
||||||
quotes.add(quote);
|
quotes.add(quote);
|
||||||
|
|
@ -175,7 +175,7 @@ List<TaskEntity> _runningTasks({
|
||||||
final tasks = <TaskEntity>[];
|
final tasks = <TaskEntity>[];
|
||||||
taskMap.forEach((index, task) {
|
taskMap.forEach((index, task) {
|
||||||
final client = clientMap[task.clientId] ?? ClientEntity(id: task.clientId);
|
final client = clientMap[task.clientId] ?? ClientEntity(id: task.clientId);
|
||||||
if (task.isDeleted || client.isDeleted) {
|
if (task.isNotActive || client.isNotActive) {
|
||||||
// do noting
|
// do noting
|
||||||
} else if (task.isRunning) {
|
} else if (task.isRunning) {
|
||||||
tasks.add(task);
|
tasks.add(task);
|
||||||
|
|
@ -204,7 +204,7 @@ List<TaskEntity> _recentTasks({
|
||||||
final tasks = <TaskEntity>[];
|
final tasks = <TaskEntity>[];
|
||||||
taskMap.forEach((index, task) {
|
taskMap.forEach((index, task) {
|
||||||
final client = clientMap[task.clientId] ?? ClientEntity(id: task.clientId);
|
final client = clientMap[task.clientId] ?? ClientEntity(id: task.clientId);
|
||||||
if (task.isDeleted || client.isDeleted) {
|
if (task.isNotActive || client.isNotActive) {
|
||||||
// do noting
|
// do noting
|
||||||
} else if (!task.isRunning) {
|
} else if (!task.isRunning) {
|
||||||
tasks.add(task);
|
tasks.add(task);
|
||||||
|
|
@ -235,7 +235,7 @@ List<ExpenseEntity> _upcomingExpenses({
|
||||||
expenseMap.forEach((index, expense) {
|
expenseMap.forEach((index, expense) {
|
||||||
final client =
|
final client =
|
||||||
expenseMap[expense.clientId] ?? ClientEntity(id: expense.clientId);
|
expenseMap[expense.clientId] ?? ClientEntity(id: expense.clientId);
|
||||||
if (expense.isDeleted || client.isDeleted) {
|
if (expense.isNotActive || client.isNotActive) {
|
||||||
// do noting
|
// do noting
|
||||||
} else if (expense.isUpcoming) {
|
} else if (expense.isUpcoming) {
|
||||||
expenses.add(expense);
|
expenses.add(expense);
|
||||||
|
|
@ -266,7 +266,7 @@ List<ExpenseEntity> _recentExpenses({
|
||||||
expenseMap.forEach((index, expense) {
|
expenseMap.forEach((index, expense) {
|
||||||
final client =
|
final client =
|
||||||
clientMap[expense.clientId] ?? ClientEntity(id: expense.clientId);
|
clientMap[expense.clientId] ?? ClientEntity(id: expense.clientId);
|
||||||
if (expense.isDeleted || client.isDeleted) {
|
if (expense.isNotActive || client.isNotActive) {
|
||||||
// do noting
|
// do noting
|
||||||
} else {
|
} else {
|
||||||
expenses.add(expense);
|
expenses.add(expense);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue