@foreach (var entry in Model)
{
-
- |
- @if (entry.EntryType == "Bill")
- {
-
- Bill
-
- }
- else
- {
-
- Expense
-
- }
- |
-
- @if (entry.EntryType == "Bill")
- {
- @entry.Number
- }
- else
- {
- @entry.Number
- }
- |
- @entry.VendorName |
-
- @(entry.EntryType == "Bill" ? entry.Memo : entry.AccountName)
- @if (entry.HasReceipt)
- {
-
- }
- |
- @entry.Date.ToString("MMM d, yyyy") |
-
+ var isBill = entry.EntryType == "Bill";
+ var detailUrl = isBill
+ ? Url.Action("Details", "Bills", new { id = entry.Id })
+ : Url.Action("Details", "Expenses", new { id = entry.Id });
+
+
+
+
+ Status
+ @entry.StatusLabel
+
+
+ Date
+ @entry.Date.ToString("MMM d, yyyy")
+
@if (entry.DueDate.HasValue)
{
-
- @entry.DueDate.Value.ToString("MMM d, yyyy")
- @if (entry.IsOverdue) { }
-
+
+ Due
+
+ @entry.DueDate.Value.ToString("MMM d, yyyy")
+ @if (entry.IsOverdue) { }
+
+
}
- else if (entry.EntryType == "Expense")
+
+ Amount
+ @entry.Total.ToString("C")
+
+ @if (isBill)
{
- —
+
+ Balance Due
+
+ @entry.BalanceDue.ToString("C")
+
+
}
- |
- @entry.StatusLabel |
- @entry.Total.ToString("C") |
-
- @Html.Raw(entry.EntryType == "Bill" ? entry.BalanceDue.ToString("C") : "—")
- |
-
- @if (entry.EntryType == "Bill")
+ @{
+ var memoText = isBill ? entry.Memo : entry.AccountName;
+ }
+ @if (!string.IsNullOrEmpty(memoText))
{
-
+
+ @(isBill ? "Memo" : "Account")
+
+ @memoText
+ @if (entry.HasReceipt) { }
+
+
}
- else
- {
-
- }
- |
-