Files
PowderCoatingLogix/src/PowderCoating.Web/Views/JournalEntries/Index.cshtml
T
spouliot f467862877 Add mobile card views to 12 high-priority list pages
Pages were blank on phones because mobile-cards.css hides .table-responsive
below 992px. Added .mobile-card-view sections to: GiftCertificates, PurchaseOrders,
CreditMemos, VendorCredits, JournalEntries, Appointments, InAppNotifications,
BankReconciliations, FixedAssets, RecurringTemplates, SmsAgreements, SmsConsentAudit.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-14 23:07:52 -04:00

175 lines
7.7 KiB
Plaintext

@model IEnumerable<PowderCoating.Core.Entities.JournalEntry>
@using PowderCoating.Core.Enums
@{
ViewData["Title"] = "Journal Entries";
var statusFilter = ViewBag.StatusFilter as string ?? "All";
}
<div class="d-flex align-items-center mb-3 gap-2">
<h4 class="mb-0 fw-semibold">Journal Entries</h4>
<a asp-action="Create" class="btn btn-sm btn-primary ms-auto">
<i class="bi bi-plus-lg me-1"></i>New Entry
</a>
</div>
@if (TempData["Success"] != null)
{
<div class="alert alert-success alert-permanent alert-dismissible fade show">
@TempData["Success"]
<button type="button" class="btn-close" data-bs-dismiss="alert"></button>
</div>
}
@if (TempData["Error"] != null)
{
<div class="alert alert-danger alert-permanent alert-dismissible fade show">
@TempData["Error"]
<button type="button" class="btn-close" data-bs-dismiss="alert"></button>
</div>
}
<ul class="nav nav-tabs mb-3">
<li class="nav-item">
<a class="nav-link @(statusFilter == "All" ? "active" : "")" asp-action="Index">
All <span class="badge bg-secondary ms-1">@ViewBag.TotalCount</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link @(statusFilter == "Draft" ? "active" : "")" asp-action="Index" asp-route-status="Draft">
Draft <span class="badge bg-warning text-dark ms-1">@ViewBag.DraftCount</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link @(statusFilter == "Posted" ? "active" : "")" asp-action="Index" asp-route-status="Posted">
Posted <span class="badge bg-success ms-1">@ViewBag.PostedCount</span>
</a>
</li>
</ul>
<div class="card shadow-sm">
<div class="card-body p-0">
<div class="mobile-card-view">
<div class="mobile-card-list">
@foreach (var je in Model)
{
<div class="mobile-data-card" onclick="window.location='@Url.Action("Details", new { id = je.Id })'">
<div class="mobile-card-header">
<div class="mobile-card-icon" style="background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);">
<i class="bi bi-journal-text"></i>
</div>
<div class="mobile-card-title">
<h6>
@je.EntryNumber
@if (je.IsReversal)
{
<span class="badge bg-secondary ms-1">REV</span>
}
</h6>
<small>@je.EntryDate.ToString("MMM d, yyyy")</small>
</div>
</div>
<div class="mobile-card-body">
<div class="mobile-card-row">
<span class="mobile-card-label">Status</span>
<span class="mobile-card-value">
@if (je.Status == JournalEntryStatus.Draft)
{
<span class="badge bg-warning text-dark">Draft</span>
}
else if (je.Status == JournalEntryStatus.Posted)
{
<span class="badge bg-success">Posted</span>
}
else
{
<span class="badge bg-secondary">Reversed</span>
}
</span>
</div>
@if (!string.IsNullOrWhiteSpace(je.Description))
{
<div class="mobile-card-row">
<span class="mobile-card-label">Description</span>
<span class="mobile-card-value" style="white-space:normal;text-align:right;">@je.Description</span>
</div>
}
@if (!string.IsNullOrWhiteSpace(je.Reference))
{
<div class="mobile-card-row">
<span class="mobile-card-label">Reference</span>
<span class="mobile-card-value">@je.Reference</span>
</div>
}
</div>
<div class="mobile-card-footer">
<a asp-action="Details" asp-route-id="@je.Id" class="btn btn-sm btn-outline-secondary" onclick="event.stopPropagation()">
View
</a>
</div>
</div>
}
</div>
</div>
<div class="table-responsive">
<table class="table table-hover mb-0">
<thead class="table-light">
<tr>
<th>Entry #</th>
<th>Date</th>
<th>Description</th>
<th>Reference</th>
<th>Status</th>
<th class="text-end">Actions</th>
</tr>
</thead>
<tbody>
@if (!Model.Any())
{
<tr>
<td colspan="6" class="text-center text-muted py-4">
No journal entries found.
<a asp-action="Create">Create the first one.</a>
</td>
</tr>
}
@foreach (var je in Model)
{
<tr>
<td>
<a asp-action="Details" asp-route-id="@je.Id" class="fw-semibold text-decoration-none">
@je.EntryNumber
</a>
@if (je.IsReversal)
{
<span class="badge bg-secondary ms-1" title="Reversal entry">REV</span>
}
</td>
<td>@je.EntryDate.ToString("MMM d, yyyy")</td>
<td class="text-truncate" style="max-width:280px">@je.Description</td>
<td class="text-muted small">@je.Reference</td>
<td>
@if (je.Status == JournalEntryStatus.Draft)
{
<span class="badge bg-warning text-dark">Draft</span>
}
else if (je.Status == JournalEntryStatus.Posted)
{
<span class="badge bg-success">Posted</span>
}
else
{
<span class="badge bg-secondary">Reversed</span>
}
</td>
<td class="text-end">
<a asp-action="Details" asp-route-id="@je.Id" class="btn btn-sm btn-outline-secondary">
View
</a>
</td>
</tr>
}
</tbody>
</table>
</div>
</div>
</div>