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