From ce2a741450c90484693294dfcce1c8b40dc4af80 Mon Sep 17 00:00:00 2001 From: ArifHilmi Date: Mon, 10 Mar 2025 22:28:46 +0800 Subject: [PATCH] Update Qr --- Areas/Inventory/Models/RequestModel.cs | 2 + .../Views/InventoryMaster/ItemMovement.cshtml | 2 +- .../InventoryMaster/ItemRegistration.cshtml | 42 +- .../InventoryMaster/ItemRequestMaster.cshtml | 956 +++++++++------ .../ManifacturerRegistration.cshtml | 2 +- .../ProductRegistration.cshtml | 2 +- .../StationRegistration.cshtml | 2 +- .../SupplierRegistration.cshtml | 2 +- .../Views/ItemMovement/ItemRequest.cshtml | 2 +- Controllers/API/Inventory/InvMainAPI.cs | 88 ++ ...50310054721_UpdateTableRequest.Designer.cs | 1059 +++++++++++++++++ .../20250310054721_UpdateTableRequest.cs | 68 ++ .../CentralSystemContextModelSnapshot.cs | 18 +- appsettings.json | 2 +- 14 files changed, 1874 insertions(+), 373 deletions(-) create mode 100644 Migrations/20250310054721_UpdateTableRequest.Designer.cs create mode 100644 Migrations/20250310054721_UpdateTableRequest.cs diff --git a/Areas/Inventory/Models/RequestModel.cs b/Areas/Inventory/Models/RequestModel.cs index 66b6628..fdacce9 100644 --- a/Areas/Inventory/Models/RequestModel.cs +++ b/Areas/Inventory/Models/RequestModel.cs @@ -26,6 +26,8 @@ namespace PSTW_CentralSystem.Areas.Inventory.Models public DateTime? approvalDate { get; set; } public int? RequestQuantity { get; set; } public string? Document { get; set; } + public string? fromStoreItem { get; set; } + public string? assignStoreItem { get; set; } } } diff --git a/Areas/Inventory/Views/InventoryMaster/ItemMovement.cshtml b/Areas/Inventory/Views/InventoryMaster/ItemMovement.cshtml index 12bf185..da045ee 100644 --- a/Areas/Inventory/Views/InventoryMaster/ItemMovement.cshtml +++ b/Areas/Inventory/Views/InventoryMaster/ItemMovement.cshtml @@ -49,7 +49,7 @@ margin-left: auto !important; /* Push Complete/Incomplete to right */ } -@await Html.PartialAsync("~/Areas/Inventory/Views/_InventoryPartial.cshtml"); +@await Html.PartialAsync("~/Areas/Inventory/Views/_InventoryPartial.cshtml")

Sort by:

diff --git a/Areas/Inventory/Views/InventoryMaster/ItemRegistration.cshtml b/Areas/Inventory/Views/InventoryMaster/ItemRegistration.cshtml index f91c0dc..5f0e183 100644 --- a/Areas/Inventory/Views/InventoryMaster/ItemRegistration.cshtml +++ b/Areas/Inventory/Views/InventoryMaster/ItemRegistration.cshtml @@ -638,18 +638,27 @@ ], responsive: true, drawCallback: function (settings) { - // Generate QR codes after rows are rendered - const api = this.api(); - api.rows().every(function () { - const data = this.data(); // Row data - const containerId = `qr${data.uniqueID}`; - const container = $(`#${containerId}`); - container.empty(); - container.append(`${data.uniqueID}`); - // console.log(container[0]); - if (container) { - // Generate QR code only if not already generated - new QRCode(container[0], { + setTimeout(() => { + const api = this.api(); + api.rows().every(function () { + const data = this.data(); + const containerId = `qr${data.uniqueID}`; + const container = document.getElementById(containerId); + + if (!container) { + return; + } + + container.innerHTML = ""; + container.append(data.uniqueID); + + // Ensure qrString is valid before generating QR code + if (!data.qrString) { + return; + } + + // Generate QR Code + new QRCode(container, { text: data.qrString, width: 100, height: 100, @@ -657,12 +666,9 @@ colorLight: "#ffffff", correctLevel: QRCode.CorrectLevel.M }); - } - // container.on('click', function() { - // window.open(data.qrString, '_blank'); - // }); - }); - }, + }); + }, 100); // Small delay to ensure elements exist + } }) // Attach click event listener to the delete buttons diff --git a/Areas/Inventory/Views/InventoryMaster/ItemRequestMaster.cshtml b/Areas/Inventory/Views/InventoryMaster/ItemRequestMaster.cshtml index f06f6c9..8625b70 100644 --- a/Areas/Inventory/Views/InventoryMaster/ItemRequestMaster.cshtml +++ b/Areas/Inventory/Views/InventoryMaster/ItemRequestMaster.cshtml @@ -2,36 +2,129 @@ ViewData["Title"] = "Product Request"; Layout = "~/Views/Shared/_Layout.cshtml"; } -@await Html.PartialAsync("~/Areas/Inventory/Views/_InventoryPartial.cshtml"); +@await Html.PartialAsync("~/Areas/Inventory/Views/_InventoryPartial.cshtml") + +
-
-
-

Pending Request

- @* *@ -
-
- @*
-
- Loading... -
-
*@ -
+
+

Sort by:

+
+
-
-
-

Complete Request

- @* *@ + +
+
+
+

Pending Request Master

+ + +
+
+
+
-
- @*
-
- Loading... -
-
*@ -
+ +
+
+

Pending Approval Request (Your Item)

+
+
+
+
+
+ +
+
+

Complete Request Master

+
+
+
+
+ +
+
+
+

Pending Request

+
+
+
+
+
+ +
+
+

Complete Request

+
+
+
+
+
+
+