| 1 | @model List<StockMaster.ViewModels.POStatusViewModel>
|
|---|
| 2 | @{
|
|---|
| 3 | ViewData["Title"] = "PO Status";
|
|---|
| 4 | }
|
|---|
| 5 |
|
|---|
| 6 | <div class="d-flex justify-content-between align-items-center mb-3">
|
|---|
| 7 | <h2>Purchase Order Status</h2>
|
|---|
| 8 | <div>
|
|---|
| 9 | <a href="/Report/Index" class="btn btn-secondary"><i class="fas fa-arrow-left"></i> Back</a>
|
|---|
| 10 | <a href="/Report/ExportPOStatus" class="btn btn-success"><i class="fas fa-file-csv"></i> CSV</a>
|
|---|
| 11 | <button onclick="exportToPDF()" class="btn btn-danger"><i class="fas fa-file-pdf"></i> PDF</button>
|
|---|
| 12 | </div>
|
|---|
| 13 | </div>
|
|---|
| 14 |
|
|---|
| 15 | <div id="reportContent">
|
|---|
| 16 | <table class="table table-bordered">
|
|---|
| 17 | <thead class="table-light">
|
|---|
| 18 | <tr>
|
|---|
| 19 | <th>PO ID</th>
|
|---|
| 20 | <th>Status</th>
|
|---|
| 21 | <th>Product</th>
|
|---|
| 22 | <th>Ordered</th>
|
|---|
| 23 | <th>Received</th>
|
|---|
| 24 | <th>Pending</th>
|
|---|
| 25 | </tr>
|
|---|
| 26 | </thead>
|
|---|
| 27 | <tbody>
|
|---|
| 28 | @foreach (var item in Model)
|
|---|
| 29 | {
|
|---|
| 30 | <tr>
|
|---|
| 31 | <td>#@item.PoId</td>
|
|---|
| 32 | <td>@item.Status</td>
|
|---|
| 33 | <td>@item.ProductName</td>
|
|---|
| 34 | <td>@item.OrderedQuantity</td>
|
|---|
| 35 | <td>@item.ReceivedQuantity</td>
|
|---|
| 36 | <td>
|
|---|
| 37 | @if (item.PendingQuantity > 0)
|
|---|
| 38 | {
|
|---|
| 39 | <span class="text-danger fw-bold">@item.PendingQuantity</span>
|
|---|
| 40 | }
|
|---|
| 41 | else
|
|---|
| 42 | {
|
|---|
| 43 | <span>0</span>
|
|---|
| 44 | }
|
|---|
| 45 | </td>
|
|---|
| 46 | </tr>
|
|---|
| 47 | }
|
|---|
| 48 | </tbody>
|
|---|
| 49 | </table>
|
|---|
| 50 | </div>
|
|---|
| 51 |
|
|---|
| 52 | @section Scripts {
|
|---|
| 53 | <script src="https://cdnjs.cloudflare.com/ajax/libs/html2pdf.js/0.10.1/html2pdf.bundle.min.js"></script>
|
|---|
| 54 | <script>
|
|---|
| 55 | function exportToPDF() {
|
|---|
| 56 | var element = document.getElementById('reportContent');
|
|---|
| 57 | var opt = {
|
|---|
| 58 | margin: 0.5, filename: 'POStatus.pdf',
|
|---|
| 59 | image: { type: 'jpeg', quality: 0.98 },
|
|---|
| 60 | html2canvas: { scale: 2 },
|
|---|
| 61 | jsPDF: { unit: 'in', format: 'letter', orientation: 'portrait' }
|
|---|
| 62 | };
|
|---|
| 63 | html2pdf().set(opt).from(element).save();
|
|---|
| 64 | }
|
|---|
| 65 | </script>
|
|---|
| 66 | } |
|---|