diff --git a/Areas/Inventory/Views/InventoryMaster/ItemRegistration.cshtml b/Areas/Inventory/Views/InventoryMaster/ItemRegistration.cshtml index 215c040..7edaef7 100644 --- a/Areas/Inventory/Views/InventoryMaster/ItemRegistration.cshtml +++ b/Areas/Inventory/Views/InventoryMaster/ItemRegistration.cshtml @@ -480,7 +480,7 @@ }, showProduct() { if (!this.selectedProduct) { - return []; // No company selected, return empty list + return []; // No company selected, return empty listx` } const product = this.products.find(c => c.productId === this.selectedProduct); return product ? product : {}; @@ -843,6 +843,24 @@ console.error('Error fetching currency data:', error); } }, + calculateWarrantyEndDate() { + // Check if DODate and warranty are valid + if (!this.DODate || isNaN(Date.parse(this.DODate))) { + this.EndWDate = null; + return; + } + + const DODates = new Date(this.DODate); + const warrantyMonth = parseInt(this.warranty); + + // Ensure warranty is a valid number + if (!isNaN(warrantyMonth)) { + DODates.setMonth(DODates.getMonth() + warrantyMonth); + this.EndWDate = DODates.toISOString().split('T')[0]; + } else { + this.EndWDate = null; + } + }, convertCurrency() { // Your currency conversion logic here console.log('Selected currency:', this.currency);