diff --git a/Areas/Inventory/Views/InventoryMaster/ItemMovement.cshtml b/Areas/Inventory/Views/InventoryMaster/ItemMovement.cshtml index 909df47..75a019a 100644 --- a/Areas/Inventory/Views/InventoryMaster/ItemMovement.cshtml +++ b/Areas/Inventory/Views/InventoryMaster/ItemMovement.cshtml @@ -18,64 +18,282 @@ @await Html.PartialAsync("~/Areas/Inventory/Views/_InventoryPartial.cshtml");
-
-
-

Item Movement List

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

Sort by:

+
+
-
+ + @section Scripts { @@ -113,8 +175,9 @@ $('.modal').modal('hide'); }); $('.submit-button').on('click', function () { - // Show the modal + // Show the modal $('#rejectModal').modal('hide'); + $('#approveModal').modal('hide'); }); }); const app = Vue.createApp({ @@ -139,6 +202,7 @@ selectedCategory: "", showRequestModal: false, showRejectModal: false, + showApproveModal: false, loading: false, request: [], currentUser: null, @@ -447,7 +511,7 @@ $('#requestDatatable tbody').on('click', '.approve-btn', function () { const requestId = $(this).data('id'); - self.approveRequest(requestId); + self.approveRequestModal(requestId); }); $('#requestDatatable tbody').on('click', '.print-btn', function () { @@ -665,16 +729,25 @@ this.EndWDate = null; } }, - async approveRequest(itemId) { + async approveRequest() { // if (!confirm("Are you sure you want to approve this request?")) { // return; // } + + const formData = { + RemarkMasterInv: this.rejectremark, + + }; + + let requestId = this.currentRequestId; try { - const response = await fetch(`/InvMainAPI/ApproveRequest/${itemId}`, { + const response = await fetch(`/InvMainAPI/ApproveRequest/${requestId}`, { method: 'POST', headers: { 'Content-Type': 'application/json', }, + body: JSON.stringify(formData) + }); const result = await response.json(); @@ -682,7 +755,7 @@ alert(result.message); //static update - const row = $(`.approve-btn[data-id="${itemId}"]`).closest('tr'); + const row = $(`.approve-btn[data-id="${requestId}"]`).closest('tr'); let rowData = this.requestDatatable.row(row).data(); // Update the status and remark @@ -769,6 +842,16 @@ $(`#rejectModal`).modal('show'); + }, + async approveRequestModal(requestId, remark) { + + this.currentRequestId = requestId; + this.approveremark = remark; + + + $(`#approveModal`).modal('show'); + + }, async printItem(itemId, imgSrc) { try { diff --git a/Areas/Inventory/Views/InventoryMaster/QrMaster.cshtml b/Areas/Inventory/Views/InventoryMaster/QrMaster.cshtml index 4785875..f1a1a7a 100644 --- a/Areas/Inventory/Views/InventoryMaster/QrMaster.cshtml +++ b/Areas/Inventory/Views/InventoryMaster/QrMaster.cshtml @@ -16,32 +16,51 @@ display: block !important; } -@await Html.PartialAsync("~/Areas/Inventory/Views/_InventoryPartial.cshtml"); -
+@await Html.PartialAsync("~/Areas/Inventory/Views/_InventoryPartial.cshtml") +
+
-
-
-

QR & Barcode Scanner

-
-
+ + -
-

Scan Result:

-
- +
+

Scan QR Code Here:

+ + + +

{{ error }}

- -
+ +
+
+
+ Product Image +
+
+

{{ thisItem.uniqueID }}

+
+
+
+

@@ -89,7 +108,7 @@ User: - {{ thisItem.currentUser }} + {{ thisItem.toUserName }}

@@ -97,9 +116,9 @@
  • - Store: + Store: - {{ thisItem.currentStore }} + {{ thisItem.toStoreName }}
  • @@ -107,7 +126,7 @@ Station: - {{ thisItem.currentStation || 'N/A' }} + {{ thisItem.toStationName || 'N/A' }}
    @@ -223,7 +242,8 @@ @* *@ @* *@ @* *@ - + + @@ -260,14 +280,27 @@
    -
    +
    -
    +
    + +
    + +
    + +
    +
    + +
    + +
    + +
    +
    -
    @* Submit and Reset Buttons *@ @@ -281,6 +314,70 @@
    +
    + +
    +
    +
    + +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    + +
    + +
    + +
    +
    + +
    + +
    + +
    +
    + +
    + +
    + +
    +
    + +
    + + @* Submit and Reset Buttons *@ +
    +
    + + +
    +
    +
    + +
    +
    @@ -304,8 +401,21 @@
    + +
    + +
    + +
    +
    +
    + +
    + +
    +
    @* Submit and Reset Buttons *@ @@ -357,6 +467,13 @@
    +
    + +
    + +
    +
    +
    @@ -438,12 +555,11 @@ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } - - + diff --git a/Controllers/API/Inventory/InvMainAPI.cs b/Controllers/API/Inventory/InvMainAPI.cs index 2abea70..9fcd4ae 100644 --- a/Controllers/API/Inventory/InvMainAPI.cs +++ b/Controllers/API/Inventory/InvMainAPI.cs @@ -590,6 +590,7 @@ namespace PSTW_CentralSystem.Controllers.API.Inventory i.ToUser, UniqueID = i.Item?.UniqueID, ProductName = i.Item?.Product?.ProductName, + ProductCategory = i.Item?.Product?.Category, LastUserName = i.FromUser?.FullName, LastStoreName = i.FromStore?.StoreName, LastStationName = i.FromStation?.StationName, @@ -980,7 +981,7 @@ namespace PSTW_CentralSystem.Controllers.API.Inventory } [HttpPost("ApproveRequest/{id}")] - public async Task ApproveRequest(int id) + public async Task ApproveRequest(int id, [FromBody] RequestModel request) { var Request = await _centralDbContext.Requests.FindAsync(id); if (Request == null) @@ -989,6 +990,7 @@ namespace PSTW_CentralSystem.Controllers.API.Inventory } Request.status = "Approved"; + Request.remarkMasterInv = request.remarkMasterInv; Request.approvalDate = DateTime.UtcNow; _centralDbContext.SaveChanges(); diff --git a/wwwroot/Media/Inventory/itemmovement/8_32753d79-0974-4c01-89f3-8d82622517578_Request.jpg b/wwwroot/Media/Inventory/itemmovement/8_32753d79-0974-4c01-89f3-8d82622517578_Request.jpg new file mode 100644 index 0000000..5e223c8 Binary files /dev/null and b/wwwroot/Media/Inventory/itemmovement/8_32753d79-0974-4c01-89f3-8d82622517578_Request.jpg differ