| [dfe03b8] | 1 | @model List<StockMaster.Models.WarehouseStock>
|
|---|
| 2 | @{
|
|---|
| 3 | ViewData["Title"] = "Warehouse Stock Status";
|
|---|
| 4 | var warehouse = ViewBag.Warehouse as StockMaster.Models.Warehouse;
|
|---|
| 5 | }
|
|---|
| 6 |
|
|---|
| 7 | <div class="row mb-4">
|
|---|
| 8 | <div class="col-12">
|
|---|
| 9 | <h2><i class="fas fa-boxes"></i> @warehouse.Name - Stock Status</h2>
|
|---|
| 10 | <nav aria-label="breadcrumb">
|
|---|
| 11 | <ol class="breadcrumb">
|
|---|
| 12 | <li class="breadcrumb-item"><a href="/">Home</a></li>
|
|---|
| 13 | <li class="breadcrumb-item"><a href="/Warehouse/Index">Warehouses</a></li>
|
|---|
| 14 | <li class="breadcrumb-item active">@warehouse.Name</li>
|
|---|
| 15 | </ol>
|
|---|
| 16 | </nav>
|
|---|
| 17 | </div>
|
|---|
| 18 | </div>
|
|---|
| 19 |
|
|---|
| 20 | <div class="row mb-4">
|
|---|
| 21 | <div class="col-md-4">
|
|---|
| 22 | <div class="stat-card">
|
|---|
| 23 | <div class="d-flex justify-content-between align-items-center">
|
|---|
| 24 | <div>
|
|---|
| 25 | <p class="text-muted mb-1">Total Product Types</p>
|
|---|
| 26 | <h3 class="mb-0">@Model.Count</h3>
|
|---|
| 27 | </div>
|
|---|
| 28 | <div class="stat-icon" style="background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);">
|
|---|
| 29 | <i class="fas fa-box"></i>
|
|---|
| 30 | </div>
|
|---|
| 31 | </div>
|
|---|
| 32 | </div>
|
|---|
| 33 | </div>
|
|---|
| 34 |
|
|---|
| 35 | <div class="col-md-4">
|
|---|
| 36 | <div class="stat-card">
|
|---|
| 37 | <div class="d-flex justify-content-between align-items-center">
|
|---|
| 38 | <div>
|
|---|
| 39 | <p class="text-muted mb-1">Total Stock Quantity</p>
|
|---|
| 40 | <h3 class="mb-0">@Model.Sum(s => s.QuantityOnHand)</h3>
|
|---|
| 41 | </div>
|
|---|
| 42 | <div class="stat-icon" style="background: linear-gradient(135deg, #10b981 0%, #059669 100%);">
|
|---|
| 43 | <i class="fas fa-cubes"></i>
|
|---|
| 44 | </div>
|
|---|
| 45 | </div>
|
|---|
| 46 | </div>
|
|---|
| 47 | </div>
|
|---|
| 48 |
|
|---|
| 49 | <div class="col-md-4">
|
|---|
| 50 | <div class="stat-card">
|
|---|
| 51 | <div class="d-flex justify-content-between align-items-center">
|
|---|
| 52 | <div>
|
|---|
| 53 | <p class="text-muted mb-1">Low Stock Alert</p>
|
|---|
| 54 | <h3 class="mb-0 text-warning">
|
|---|
| 55 | @Model.Count(s => s.QuantityOnHand <= s.Product.ReorderLevel)
|
|---|
| 56 | </h3>
|
|---|
| 57 | </div>
|
|---|
| 58 | <div class="stat-icon" style="background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);">
|
|---|
| 59 | <i class="fas fa-exclamation-triangle"></i>
|
|---|
| 60 | </div>
|
|---|
| 61 | </div>
|
|---|
| 62 | </div>
|
|---|
| 63 | </div>
|
|---|
| 64 | </div>
|
|---|
| 65 |
|
|---|
| 66 | <div class="card">
|
|---|
| 67 | <div class="card-header">
|
|---|
| 68 | <i class="fas fa-list"></i> Stock List
|
|---|
| 69 | </div>
|
|---|
| 70 | <div class="card-body">
|
|---|
| 71 | <div class="mb-3">
|
|---|
| 72 | <input type="text" class="form-control" placeholder="Search products..." id="searchBox">
|
|---|
| 73 | </div>
|
|---|
| 74 |
|
|---|
| 75 | <div class="table-responsive">
|
|---|
| 76 | <table class="table table-hover" id="stockTable">
|
|---|
| 77 | <thead>
|
|---|
| 78 | <tr>
|
|---|
| 79 | <th>Product</th>
|
|---|
| 80 | <th>SKU</th>
|
|---|
| 81 | <th>Category</th>
|
|---|
| 82 | <th class="text-center">Quantity On Hand</th>
|
|---|
| 83 | <th class="text-center">Reorder Level</th>
|
|---|
| 84 | <th class="text-center">Status</th>
|
|---|
| 85 | <th>Last Updated</th>
|
|---|
| 86 | </tr>
|
|---|
| 87 | </thead>
|
|---|
| 88 | <tbody>
|
|---|
| 89 | @foreach (var stock in Model.OrderBy(s => s.Product.Name))
|
|---|
| 90 | {
|
|---|
| 91 | var isLowStock = stock.QuantityOnHand <= stock.Product.ReorderLevel;
|
|---|
| 92 | var statusClass = isLowStock ? "table-warning" : "";
|
|---|
| 93 |
|
|---|
| 94 | <tr class="@statusClass">
|
|---|
| 95 | <td>
|
|---|
| 96 | <strong>@stock.Product.Name</strong>
|
|---|
| 97 | @if (isLowStock)
|
|---|
| 98 | {
|
|---|
| 99 | <br>
|
|---|
| 100 | <small class="text-warning">
|
|---|
| 101 | <i class="fas fa-exclamation-triangle"></i> Low Stock!
|
|---|
| 102 | </small>
|
|---|
| 103 | }
|
|---|
| 104 | </td>
|
|---|
| 105 | <td>
|
|---|
| 106 | <code>@stock.Product.Sku</code>
|
|---|
| 107 | </td>
|
|---|
| 108 | <td>
|
|---|
| 109 | @(stock.Product.Category?.Name ?? "-")
|
|---|
| 110 | </td>
|
|---|
| 111 | <td class="text-center">
|
|---|
| 112 | <span class="badge @(isLowStock ? "bg-warning" : "bg-success") fs-6">
|
|---|
| 113 | @stock.QuantityOnHand
|
|---|
| 114 | </span>
|
|---|
| 115 | </td>
|
|---|
| 116 | <td class="text-center">
|
|---|
| 117 | <span class="badge bg-info">
|
|---|
| 118 | @stock.Product.ReorderLevel
|
|---|
| 119 | </span>
|
|---|
| 120 | </td>
|
|---|
| 121 | <td class="text-center">
|
|---|
| 122 | @if (stock.QuantityOnHand == 0)
|
|---|
| 123 | {
|
|---|
| 124 | <span class="badge bg-danger">
|
|---|
| 125 | <i class="fas fa-times"></i> Out of Stock
|
|---|
| 126 | </span>
|
|---|
| 127 | }
|
|---|
| 128 | else if (isLowStock)
|
|---|
| 129 | {
|
|---|
| 130 | <span class="badge bg-warning">
|
|---|
| 131 | <i class="fas fa-exclamation-triangle"></i> Low
|
|---|
| 132 | </span>
|
|---|
| 133 | }
|
|---|
| 134 | else
|
|---|
| 135 | {
|
|---|
| 136 | <span class="badge bg-success">
|
|---|
| 137 | <i class="fas fa-check"></i> Sufficient
|
|---|
| 138 | </span>
|
|---|
| 139 | }
|
|---|
| 140 | </td>
|
|---|
| 141 | <td>
|
|---|
| 142 | <small>@stock.LastUpdated.ToString("dd.MM.yyyy HH:mm")</small>
|
|---|
| 143 | </td>
|
|---|
| 144 | </tr>
|
|---|
| 145 | }
|
|---|
| 146 | </tbody>
|
|---|
| 147 | </table>
|
|---|
| 148 | </div>
|
|---|
| 149 |
|
|---|
| 150 | @if (!Model.Any())
|
|---|
| 151 | {
|
|---|
| 152 | <div class="text-center py-5">
|
|---|
| 153 | <i class="fas fa-inbox fa-3x text-muted mb-3"></i>
|
|---|
| 154 | <p class="text-muted">No stock records found in this warehouse.</p>
|
|---|
| 155 | </div>
|
|---|
| 156 | }
|
|---|
| 157 | </div>
|
|---|
| 158 | </div>
|
|---|
| 159 |
|
|---|
| 160 | @section Scripts {
|
|---|
| 161 | <script>
|
|---|
| 162 | $(document).ready(function() {
|
|---|
| 163 | $('#searchBox').on('keyup', function() {
|
|---|
| 164 | const value = $(this).val().toLowerCase();
|
|---|
| 165 | $('#stockTable tbody tr').filter(function() {
|
|---|
| 166 | $(this).toggle($(this).text().toLowerCase().indexOf(value) > -1);
|
|---|
| 167 | });
|
|---|
| 168 | });
|
|---|
| 169 | });
|
|---|
| 170 | </script>
|
|---|
| 171 | } |
|---|