| 1 | @model List<StockMaster.ViewModels.WarehouseCapacityViewModel>
|
|---|
| 2 | @{ ViewData["Title"] = "Warehouse Capacity"; }
|
|---|
| 3 |
|
|---|
| 4 | <div class="d-flex justify-content-between align-items-center mb-3">
|
|---|
| 5 | <h2>Warehouse Capacity</h2>
|
|---|
| 6 | <div>
|
|---|
| 7 | <a href="/Report/Index" class="btn btn-secondary"><i class="fas fa-arrow-left"></i> Back</a>
|
|---|
| 8 | <a href="/Report/ExportWarehouseCapacity" class="btn btn-success"><i class="fas fa-file-csv"></i> CSV</a>
|
|---|
| 9 | <button onclick="exportToPDF()" class="btn btn-danger"><i class="fas fa-file-pdf"></i> PDF</button>
|
|---|
| 10 | </div>
|
|---|
| 11 | </div>
|
|---|
| 12 |
|
|---|
| 13 | <div id="reportContent">
|
|---|
| 14 | <table class="table table-bordered">
|
|---|
| 15 | <thead class="table-warning">
|
|---|
| 16 | <tr>
|
|---|
| 17 | <th>Warehouse</th>
|
|---|
| 18 | <th>Capacity</th>
|
|---|
| 19 | <th>In Stock</th>
|
|---|
| 20 | <th>Occupancy</th>
|
|---|
| 21 | </tr>
|
|---|
| 22 | </thead>
|
|---|
| 23 | <tbody>
|
|---|
| 24 | @foreach(var item in Model) {
|
|---|
| 25 | <tr>
|
|---|
| 26 | <td>@item.WarehouseName</td>
|
|---|
| 27 | <td>@item.Capacity</td>
|
|---|
| 28 | <td>@item.UnitsInStock</td>
|
|---|
| 29 | <td>
|
|---|
| 30 | <div class="progress" style="height: 25px;">
|
|---|
| 31 | <div class="progress-bar @(item.OccupancyPercentage > 90 ? "bg-danger" : "bg-success")"
|
|---|
| 32 | role="progressbar"
|
|---|
| 33 | style="width: @item.OccupancyPercentage%;"
|
|---|
| 34 | aria-valuenow="@item.OccupancyPercentage"
|
|---|
| 35 | aria-valuemin="0"
|
|---|
| 36 | aria-valuemax="100">
|
|---|
| 37 | @item.OccupancyPercentage%
|
|---|
| 38 | </div>
|
|---|
| 39 | </div>
|
|---|
| 40 | </td>
|
|---|
| 41 | </tr>
|
|---|
| 42 | }
|
|---|
| 43 | </tbody>
|
|---|
| 44 | </table>
|
|---|
| 45 | </div>
|
|---|
| 46 |
|
|---|
| 47 | @section Scripts {
|
|---|
| 48 | <script src="https://cdnjs.cloudflare.com/ajax/libs/html2pdf.js/0.10.1/html2pdf.bundle.min.js"></script>
|
|---|
| 49 | <script>
|
|---|
| 50 | function exportToPDF() {
|
|---|
| 51 | var element = document.getElementById('reportContent');
|
|---|
| 52 | var opt = {
|
|---|
| 53 | margin: 0.5, filename: 'WarehouseCapacity.pdf',
|
|---|
| 54 | image: { type: 'jpeg', quality: 0.98 },
|
|---|
| 55 | html2canvas: { scale: 2 },
|
|---|
| 56 | jsPDF: { unit: 'in', format: 'letter', orientation: 'portrait' }
|
|---|
| 57 | };
|
|---|
| 58 | html2pdf().set(opt).from(element).save();
|
|---|
| 59 | }
|
|---|
| 60 | </script>
|
|---|
| 61 | } |
|---|