Show expenses as paid
This commit is contained in:
parent
2f6dac2509
commit
ce171321a1
|
|
@ -101,6 +101,7 @@ class ExpenseStatusColors {
|
|||
kExpenseStatusLogged: _colorTheme.colorGray,
|
||||
kExpenseStatusPending: _colorTheme.colorPrimary,
|
||||
kExpenseStatusInvoiced: _colorTheme.colorSuccess,
|
||||
kExpenseStatusPaid: _colorTheme.colorInfo,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -638,6 +638,11 @@ abstract class ExpenseEntity extends Object
|
|||
@BuiltValueField(compare: false)
|
||||
int get loadedAt;
|
||||
|
||||
bool get isPaid =>
|
||||
paymentDate.isNotEmpty ||
|
||||
paymentTypeId.isNotEmpty ||
|
||||
transactionReference.isNotEmpty;
|
||||
|
||||
bool isBetween(String startDate, String endDate) {
|
||||
return (startDate ?? '').compareTo(date ?? '') <= 0 &&
|
||||
(endDate ?? '').compareTo(date ?? '') >= 0;
|
||||
|
|
@ -787,6 +792,8 @@ abstract class ExpenseEntity extends Object
|
|||
return kExpenseStatusInvoiced;
|
||||
} else if (shouldBeInvoiced) {
|
||||
return kExpenseStatusPending;
|
||||
} else if (isPaid) {
|
||||
return kExpenseStatusPaid;
|
||||
} else {
|
||||
return kExpenseStatusLogged;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue