From 213fd2b4609ce9514bd64ca01c742182c463b906 Mon Sep 17 00:00:00 2001 From: ArifHilmi Date: Fri, 14 Mar 2025 11:03:12 +0800 Subject: [PATCH 1/8] Update Item & Station --- .../InventoryMaster/ItemRegistration.cshtml | 38 +++++++---- .../StationRegistration.cshtml | 24 +++---- Controllers/API/IdentityAPI.cs | 66 +++++++++---------- Controllers/API/Inventory/InvMainAPI.cs | 24 +++++-- Views/Home/Privacy.cshtml | 3 +- Views/Shared/_Layout.cshtml | 12 ++-- appsettings.json | 2 +- 7 files changed, 99 insertions(+), 70 deletions(-) diff --git a/Areas/Inventory/Views/InventoryMaster/ItemRegistration.cshtml b/Areas/Inventory/Views/InventoryMaster/ItemRegistration.cshtml index 2f41ebb..90cb1b6 100644 --- a/Areas/Inventory/Views/InventoryMaster/ItemRegistration.cshtml +++ b/Areas/Inventory/Views/InventoryMaster/ItemRegistration.cshtml @@ -288,7 +288,7 @@
- +
@@ -296,7 +296,7 @@
- +
@@ -304,7 +304,7 @@
- +
@@ -320,7 +320,7 @@
- +
@@ -328,7 +328,7 @@
- +
@@ -401,12 +401,12 @@ purchaseDate: null, PO: null, currency: "MYR", - DefaultPrice: 0.01, + DefaultPrice: null, currencyRate: 1, convertPrice: 0.01, DONo: null, DODate: null, - warranty: 0, + warranty: null, EndWDate: null, invoiceNo: null, invoiceDate: null, @@ -473,6 +473,18 @@ }, methods: { async addItem() { + + // List of required fields + const requiredFields = ['DefaultPrice', 'DONo', 'DODate', 'warranty', 'invoiceNo', 'invoiceDate']; + + // Loop through required fields and check if any are null or empty + for (let field of requiredFields) { + if (this[field] === null || this[field] === '') { + alert('Item Error', `Please fill in required fields: ${field}.`, 'warning'); + return; + } + } + if (this.showProduct.category == "Disposable") { this.serialNumber = ""; } @@ -489,9 +501,11 @@ DefaultPrice: this.DefaultPrice, CurrencyRate: this.currencyRate, ConvertPrice: this.convertPrice, + DONo: this.DONo, DODate: this.DODate, Warranty: this.warranty, EndWDate: this.EndWDate, + InvoiceNo: this.invoiceNo, InvoiceDate: this.invoiceDate, CreatedByUserId: this.currentUser.id, TeamType: this.selectedTeamType, @@ -811,17 +825,19 @@ this.purchaseDate = null; this.PO = null; this.currency = 'MYR'; - this.DefaultPrice = 0.01; + this.DefaultPrice = null; this.currencyRate = 1; this.convertPrice = 0.01; this.DODate = null; - this.warranty = 0; + this.warranty = null; + this.DONo = null; + this.invoiceNo = null; this.EndWDate = null; this.invoiceDate = null; this.selectedProduct = ''; this.selectedSupplier = ''; - this.selectedCompany = this.currentUserCompanyDept.companyId; - this.selectedDepartment = ''; + // this.selectedCompany = this.currentUserCompanyDept.companyId; + // this.selectedDepartment = ''; this.selectedTeamType = ''; this.partNumber = null; }, diff --git a/Areas/Inventory/Views/InventoryMaster/StationRegistration.cshtml b/Areas/Inventory/Views/InventoryMaster/StationRegistration.cshtml index 45bfc6d..9b49354 100644 --- a/Areas/Inventory/Views/InventoryMaster/StationRegistration.cshtml +++ b/Areas/Inventory/Views/InventoryMaster/StationRegistration.cshtml @@ -27,11 +27,11 @@
-