diff --git a/Areas/Identity/Pages/Account/Login.cshtml b/Areas/Identity/Pages/Account/Login.cshtml index 0e2e5b2..533512d 100644 --- a/Areas/Identity/Pages/Account/Login.cshtml +++ b/Areas/Identity/Pages/Account/Login.cshtml @@ -44,7 +44,7 @@
- +
diff --git a/Areas/Identity/Pages/Account/Register.cshtml.cs b/Areas/Identity/Pages/Account/Register.cshtml.cs index 7a7da32..bf4edf5 100644 --- a/Areas/Identity/Pages/Account/Register.cshtml.cs +++ b/Areas/Identity/Pages/Account/Register.cshtml.cs @@ -22,6 +22,7 @@ using PSTW_CentralSystem.Models; namespace PSTW_CentralSystem.Areas.Identity.Pages.Account { + [Authorize] public class RegisterModel : PageModel { private readonly SignInManager _signInManager; diff --git a/Areas/Inventory/Controllers/Admin/InventoryAdminController.cs b/Areas/Inventory/Controllers/Admin/InventoryMasterController.cs similarity index 69% rename from Areas/Inventory/Controllers/Admin/InventoryAdminController.cs rename to Areas/Inventory/Controllers/Admin/InventoryMasterController.cs index 962176d..df6280f 100644 --- a/Areas/Inventory/Controllers/Admin/InventoryAdminController.cs +++ b/Areas/Inventory/Controllers/Admin/InventoryMasterController.cs @@ -3,7 +3,8 @@ namespace PSTW_CentralSystem.Areas.Inventory.Controllers.Admin { [Area("Inventory")] - public class InventoryAdminController : Controller + //[Authorize(Policy = "RoleModulePolicy")] + public class InventoryMasterController : Controller { public IActionResult AdminDashboard() { diff --git a/Areas/Inventory/Controllers/ItemController.cs b/Areas/Inventory/Controllers/ItemController.cs index 403a41e..0d02ccc 100644 --- a/Areas/Inventory/Controllers/ItemController.cs +++ b/Areas/Inventory/Controllers/ItemController.cs @@ -25,29 +25,5 @@ namespace PSTW_CentralSystem.Areas.Inventory.Controllers return View(); } - // GET: Inventory/Details/5 - public ActionResult Details(int id) - { - return View(); - } - - // GET: Inventory/Create - public ActionResult Create() - { - return View(); - } - - // GET: Inventory/Edit/5 - public ActionResult Edit(int id) - { - return View(); - } - - // GET: Inventory/Delete/5 - public ActionResult Delete(int id) - { - return View(); - } - } } diff --git a/Areas/Inventory/Controllers/MainController.cs b/Areas/Inventory/Controllers/MainController.cs index 526809d..2872cf2 100644 --- a/Areas/Inventory/Controllers/MainController.cs +++ b/Areas/Inventory/Controllers/MainController.cs @@ -23,29 +23,5 @@ namespace PSTW_CentralSystem.Areas.Inventory.Controllers return View(); } - // GET: Inventory/Details/5 - public ActionResult Details(int id) - { - return View(); - } - - // GET: Inventory/Create - public ActionResult Create() - { - return View(); - } - - // GET: Inventory/Edit/5 - public ActionResult Edit(int id) - { - return View(); - } - - // GET: Inventory/Delete/5 - public ActionResult Delete(int id) - { - return View(); - } - } } diff --git a/Areas/Inventory/Models/ItemMovementModel.cs b/Areas/Inventory/Models/ItemMovementModel.cs index 7ee1647..b618169 100644 --- a/Areas/Inventory/Models/ItemMovementModel.cs +++ b/Areas/Inventory/Models/ItemMovementModel.cs @@ -14,12 +14,12 @@ namespace PSTW_CentralSystem.Areas.Inventory.Models public int? ToUser { get; set; } [Comment("Repair, Calibration, Faulty, Ready To Deploy, On Delivery")] public string? ToOther { get; set; } - [Comment("StockIn, Stock Out")] + [Comment("Register, StockIn, Stock Out")] public string? Action { get; set; } public int? Quantity { get; set; } public string? Remark { get; set; } public string? ConsignmentNote { get; set; } - public DateTime? Date { get; set; } + public DateTime Date { get; set; } public int? LastUser { get; set; } public int? LastStore{ get; set; } public int? LastStation{ get; set; } diff --git a/Areas/Inventory/Views/InventoryAdmin/AdminDashboard.cshtml b/Areas/Inventory/Views/InventoryAdmin/AdminDashboard.cshtml deleted file mode 100644 index 6b260fa..0000000 --- a/Areas/Inventory/Views/InventoryAdmin/AdminDashboard.cshtml +++ /dev/null @@ -1,12 +0,0 @@ -@{ - ViewData["Title"] = "PSTW Centralized System"; - Layout = "~/Views/Shared/_Layout.cshtml"; -} -@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers -
-
-

Inventory Admin Dashboard

-

Learn about building Web apps with ASP.NET Core.

-
-
-@await Html.PartialAsync("~/Areas/Inventory/Views/_InventoryPartial.cshtml"); \ No newline at end of file diff --git a/Areas/Inventory/Views/InventoryMaster/AdminDashboard.cshtml b/Areas/Inventory/Views/InventoryMaster/AdminDashboard.cshtml new file mode 100644 index 0000000..94d3e40 --- /dev/null +++ b/Areas/Inventory/Views/InventoryMaster/AdminDashboard.cshtml @@ -0,0 +1,116 @@ +@{ + ViewData["Title"] = "Dashboard"; + Layout = "~/Views/Shared/_Layout.cshtml"; +} +@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers +
+
+
+

Inventory Admin Dashboard

+

Store: {{ currentUserCompanyDept.departmentName }}

+
+
+ @await Html.PartialAsync("~/Areas/Inventory/Views/_InventoryPartial.cshtml"); +
+
+

Inventory Report

+
+
+
+
+
+

Statistic

+

Total Number of Item Registered: {{ reportData.itemCountRegistered }}

+

Total Number of Item Still in Stock: {{ reportData.itemCountStillInStock }}

+
+
+

Item Registered

+

This Month: {{ reportData.itemCountRegisteredThisMonth }}

+

Last Month: {{ reportData.itemCountRegisteredLastMonth }}

+
+
+

Item Stock Out

+

This Month: {{ reportData.itemCountStockOutThisMonth }}

+

Last Month: {{ reportData.itemCountStockOutLastMonth }}

+
+
+
+
+
+
+@section Scripts { +@{ + await Html.RenderPartialAsync("_ValidationScriptsPartial"); +} + +} \ No newline at end of file diff --git a/Areas/Inventory/Views/Item/ItemRegistration.cshtml b/Areas/Inventory/Views/Item/ItemRegistration.cshtml index 3481acd..2d2cff5 100644 --- a/Areas/Inventory/Views/Item/ItemRegistration.cshtml +++ b/Areas/Inventory/Views/Item/ItemRegistration.cshtml @@ -108,7 +108,7 @@
- @@ -440,7 +440,7 @@ return []; // No company selected, return empty list } const company = this.companies.find(c => c.companyId === this.selectedCompany); - this.selectedDepartment = ''; + // this.selectedDepartment = ''; return company ? company.departments : []; }, showProduct() { @@ -617,7 +617,7 @@ const containerId = `qr${data.uniqueID}`; const container = $(`#${containerId}`); container.empty(); - container.append(`${data.uniqueID}`); + container.append(`${data.uniqueID}`); // console.log(container[0]); if (container) { // Generate QR code only if not already generated @@ -630,6 +630,9 @@ correctLevel: QRCode.CorrectLevel.M }); } + container.on('click', function() { + window.open(data.qrString, '_blank'); + }); }); }, }) @@ -893,6 +896,7 @@ const companyDeptData = await this.currentUser.department; this.currentUserCompanyDept = companyDeptData; this.selectedCompany = companyDeptData?.companyId || ""; + this.selectedDepartment = companyDeptData?.departmentId || ""; } else { console.error(`Failed to fetch user: ${response.statusText}`); @@ -933,7 +937,7 @@
${this.thisQRInfo.departmentName}
-
${this.thisQRInfo.serialNumber}
+
${this.thisQRInfo.serialNumber??"-"}
${this.thisQRInfo.productName}
${this.thisQRInfo.endWDate}
diff --git a/Controllers/API/Inventory/InvMainAPI.cs b/Controllers/API/Inventory/InvMainAPI.cs index bff074b..5e3eb52 100644 --- a/Controllers/API/Inventory/InvMainAPI.cs +++ b/Controllers/API/Inventory/InvMainAPI.cs @@ -8,6 +8,7 @@ using PSTW_CentralSystem.Areas.Inventory.Models; using PSTW_CentralSystem.DBContext; using PSTW_CentralSystem.Models; using System.ComponentModel.Design; +using System.Data; using System.Diagnostics; using System.Reflection; @@ -385,7 +386,8 @@ namespace PSTW_CentralSystem.Controllers.API.Inventory LastStore = inventoryMaster.StoreId, LastUser = inventoryMaster.UserId, LatestStatus = "Ready To Deploy", - Action= "Stock In", + Quantity = item.Quantity, + Action= "Register", Date = DateTime.Now, MovementComplete = true, }; @@ -498,5 +500,97 @@ namespace PSTW_CentralSystem.Controllers.API.Inventory } #endregion Item + + #region ItemReport + + [HttpPost("GetInventoryReport/{deptId}")] + public async Task GetInventoryReport(int deptId) + { + try{ + var user = await _userManager.GetUserAsync(User); + + var userRole = await _userManager.GetRolesAsync(user ?? new UserModel()); + List items = new List(); + if (userRole.Contains("SuperAdmin") && userRole.Contains("SystemAdmin")) + { + items = await _centralDbContext.Items + .Include("CreatedBy") + .Include("Department") + .Include("Product") + .ToListAsync(); + } + else + { + items = await _centralDbContext.Items + .Include("CreatedBy") + .Include("Department") + .Include("Product") + .Where(i => i.DepartmentId == deptId) + .ToListAsync(); + } + var itemListWithDetails = items.Where(i => i.Quantity > 0).Select(item => new + { + item.ItemID, + item.UniqueID, + item.CompanyId, + item.DepartmentId, + item.ProductId, + item.SerialNumber, + item.Quantity, + item.Supplier, + PurchaseDate = item.PurchaseDate.ToString("dd/MM/yyyy"), + item.PONo, + item.Currency, + item.DefaultPrice, + item.CurrencyRate, + item.ConvertPrice, + item.DODate, + item.Warranty, + EndWDate = item.EndWDate.ToString("dd/MM/yyyy"), + InvoiceDate = item.InvoiceDate?.ToString("dd/MM/yyyy"), + item.Department?.DepartmentName, + CreatedBy = item.CreatedBy!.UserName, + item.Product!.ProductName, + item.Product!.Category, + //CurrentUser = item.Movement?.FromUser?.UserName, + CurrentUser = item.Movement?.FromUser?.UserName, + CurrentStore = item.Movement?.FromStore?.StoreName, + CurrentStation = item.Movement?.FromStation?.StationName, + + QRString = $"{HttpContext.Request.Scheme}://{HttpContext.Request.Host.Value}/I/{item.UniqueID}" // Generate QR String + }).ToList(); + + int itemCountRegistered = items.Count; + int itemCountStillInStock = items.Where(i => i.Quantity > 0).Count(); + var itemsMovementsThisMonth = _centralDbContext.ItemMovements + .Where(i => i.Date.Month == DateTime.Now.Month); + int itemCountRegisteredThisMonth = itemsMovementsThisMonth.Count(i => i.Action == "Register"); + int itemCountStockOutThisMonth = itemsMovementsThisMonth.Count(i => i.Action == "Stock Out"); + + var lastMonth = DateTime.Now.AddMonths(-1).Month; + var itemsMovementsLastMonth = _centralDbContext.ItemMovements + .Where(i => i.Date.Month == lastMonth); + int itemCountRegisteredLastMonth = itemsMovementsLastMonth.Count(i => i.Action == "Register"); + int itemCountStockOutLastMonth = itemsMovementsLastMonth.Count(i => i.Action == "Stock Out"); + + var report = new + { + itemListWithDetails, + itemCountRegistered, + itemCountStillInStock, + itemCountRegisteredThisMonth, + itemCountStockOutThisMonth, + itemCountRegisteredLastMonth, + itemCountStockOutLastMonth + }; + return Json(report); + } + catch (Exception ex) + { + return BadRequest(ex.Message); + } + } + + #endregion } } diff --git a/Controllers/InventoryController.cs b/Controllers/InventoryController.cs index 79b5d3d..426f202 100644 --- a/Controllers/InventoryController.cs +++ b/Controllers/InventoryController.cs @@ -27,7 +27,7 @@ namespace PSTW_CentralSystem.Controllers [Authorize] [HttpPost("/i/{id}")] - public IActionResult ItemInformation(string id, [FromBody] ItemModel item) + public IActionResult ItemRecognization(string id, [FromBody] ItemModel item) { return View(); } diff --git a/CustomPolicy/RoleModulePolicy.cs b/CustomPolicy/RoleModulePolicy.cs index a0fc0c0..bdf280e 100644 --- a/CustomPolicy/RoleModulePolicy.cs +++ b/CustomPolicy/RoleModulePolicy.cs @@ -115,7 +115,6 @@ namespace PSTW_CentralSystem.CustomPolicy // Load all ModuleSettings and process them in memory var moduleSettings = _authDBContext.ModuleSettings.AsEnumerable(); - // Check if the method exists in the module settings // Check if the method exists in the module settings var isMethodExist = moduleSettings.FirstOrDefault(m => m.MethodAllowedUserType?.Any(mt => mt.MethodName == pageName) == true); diff --git a/DBContext/CentralSystemContext.cs b/DBContext/CentralSystemContext.cs index dfdbf80..a48815a 100644 --- a/DBContext/CentralSystemContext.cs +++ b/DBContext/CentralSystemContext.cs @@ -39,7 +39,8 @@ namespace PSTW_CentralSystem.DBContext new RoleModel { Id = 2, Name = "SystemAdmin", NormalizedName = "SystemAdmin".ToUpper(), Description = "Can access some admin pages" }, new RoleModel { Id = 3, Name = "Engineer", NormalizedName = "Engineer".ToUpper(), Description = "Can access operation pages" }, new RoleModel { Id = 4, Name = "Observer", NormalizedName = "Observer".ToUpper(), Description = "Can access data viewer pages" }, - new RoleModel { Id = 5, Name = "Inventory Master", NormalizedName = "Inventory Master".ToUpper(), Description = "Handle inventory module" }); + new RoleModel { Id = 5, Name = "Inventory Master", NormalizedName = "Inventory Master".ToUpper(), Description = "Handle inventory module" }, + new RoleModel { Id = 6, Name = "Finance", NormalizedName = "Finance".ToUpper(), Description = "Involve in inventory transaction" }); var passwordHasher = new PasswordHasher(); diff --git a/Migrations/20241230074733_Initiate.Designer.cs b/Migrations/20250106062312_Initiate.Designer.cs similarity index 97% rename from Migrations/20241230074733_Initiate.Designer.cs rename to Migrations/20250106062312_Initiate.Designer.cs index 47a403a..c7294ec 100644 --- a/Migrations/20241230074733_Initiate.Designer.cs +++ b/Migrations/20250106062312_Initiate.Designer.cs @@ -12,7 +12,7 @@ using PSTW_CentralSystem.DBContext; namespace PSTW_CentralSystem.Migrations { [DbContext(typeof(CentralSystemContext))] - [Migration("20241230074733_Initiate")] + [Migration("20250106062312_Initiate")] partial class Initiate { /// @@ -200,10 +200,6 @@ namespace PSTW_CentralSystem.Migrations b.Property("InvoiceNo") .HasColumnType("longtext"); - b.Property("ItemLocation") - .IsRequired() - .HasColumnType("longtext"); - b.Property("ItemStatus") .HasColumnType("int") .HasComment("1 = In stock; 2 = Item Moving; 3 = Item Out; 4 = Item Broken; 5 = Item Lost; 6 = Item Stolen; 7 = Item Damaged; 8 = Item Discarded; 9 = Item Destroyed; 10 = Item Finished;"); @@ -267,12 +263,12 @@ namespace PSTW_CentralSystem.Migrations b.Property("Action") .HasColumnType("longtext") - .HasComment("StockIn, Stock Out"); + .HasComment("Register, StockIn, Stock Out"); b.Property("ConsignmentNote") .HasColumnType("longtext"); - b.Property("Date") + b.Property("Date") .HasColumnType("datetime(6)"); b.Property("ItemId") @@ -600,6 +596,13 @@ namespace PSTW_CentralSystem.Migrations Description = "Handle inventory module", Name = "Inventory Master", NormalizedName = "INVENTORY MASTER" + }, + new + { + Id = 6, + Description = "Involve in inventory transaction", + Name = "Finance", + NormalizedName = "FINANCE" }); }); @@ -685,16 +688,16 @@ namespace PSTW_CentralSystem.Migrations { Id = 1, AccessFailedCount = 0, - ConcurrencyStamp = "cedbd3af-4aa6-41cc-a71f-f85ac3a7c6ac", + ConcurrencyStamp = "4c8e81ae-2e43-4f98-82a0-4d7c4aa6d011", Email = "admin@pstw.com.my", EmailConfirmed = true, FullName = "MAAdmin", LockoutEnabled = false, NormalizedEmail = "ADMIN@PSTW.COM.MY", NormalizedUserName = "ADMIN@PSTW.COM.MY", - PasswordHash = "AQAAAAIAAYagAAAAEEsEPaF/WtRT6js4zpE9wiOXZXn+Vq29o4nc8esBsMmSE3Sm5q636DZeu7ECQlQ0RA==", + PasswordHash = "AQAAAAIAAYagAAAAEKr0d9Fe168hXvdX6+oJvbfo2QHFsp8i/EQjhLbkWRn/yvKImJa6XzZ5KJ6qohTE1w==", PhoneNumberConfirmed = false, - SecurityStamp = "a7be7fa2-a275-4646-a387-2d1d1042878d", + SecurityStamp = "2219ec34-d4a0-496b-a7d7-e6c5d7b2a222", TwoFactorEnabled = false, UserInfoStatus = 1, UserName = "admin@pstw.com.my" @@ -703,16 +706,16 @@ namespace PSTW_CentralSystem.Migrations { Id = 2, AccessFailedCount = 0, - ConcurrencyStamp = "948106ca-aeaa-49fa-87c9-018445595c12", + ConcurrencyStamp = "bcc1500e-9ae2-4704-9997-dbe646d2fa7a", Email = "sysadmin@pstw.com.my", EmailConfirmed = true, FullName = "SysAdmin", LockoutEnabled = false, NormalizedEmail = "SYSADMIN@PSTW.COM.MY", NormalizedUserName = "SYSADMIN@PSTW.COM.MY", - PasswordHash = "AQAAAAIAAYagAAAAEL/iXkcbIqa5+OnqaBOBuG2KiSvkxA2shZYl0XQVtmadQnaO2eARuKwyGQqlWu9NqQ==", + PasswordHash = "AQAAAAIAAYagAAAAEE3CUAWzIeL592V5xPyAD5ciHe8OGtvbNHhU6UNafDMT/+0R77o6UCDj/K8wc0j0Xw==", PhoneNumberConfirmed = false, - SecurityStamp = "04aeb405-81f6-4ca0-9ed8-ce10c2e5dd6e", + SecurityStamp = "7c582e0d-8237-4605-8fec-449bbe78f6c9", TwoFactorEnabled = false, UserInfoStatus = 1, UserName = "sysadmin@pstw.com.my" diff --git a/Migrations/20241230074733_Initiate.cs b/Migrations/20250106062312_Initiate.cs similarity index 97% rename from Migrations/20241230074733_Initiate.cs rename to Migrations/20250106062312_Initiate.cs index d79c446..81aa1b0 100644 --- a/Migrations/20241230074733_Initiate.cs +++ b/Migrations/20250106062312_Initiate.cs @@ -417,14 +417,14 @@ namespace PSTW_CentralSystem.Migrations ToUser = table.Column(type: "int", nullable: true), ToOther = table.Column(type: "longtext", nullable: true, comment: "Repair, Calibration, Faulty, Ready To Deploy, On Delivery") .Annotation("MySql:CharSet", "utf8mb4"), - Action = table.Column(type: "longtext", nullable: true, comment: "StockIn, Stock Out") + Action = table.Column(type: "longtext", nullable: true, comment: "Register, StockIn, Stock Out") .Annotation("MySql:CharSet", "utf8mb4"), Quantity = table.Column(type: "int", nullable: true), Remark = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), ConsignmentNote = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), - Date = table.Column(type: "datetime(6)", nullable: true), + Date = table.Column(type: "datetime(6)", nullable: false), LastUser = table.Column(type: "int", nullable: true), LastStore = table.Column(type: "int", nullable: true), LastStation = table.Column(type: "int", nullable: true), @@ -503,8 +503,6 @@ namespace PSTW_CentralSystem.Migrations .Annotation("MySql:CharSet", "utf8mb4"), InvoiceDate = table.Column(type: "datetime(6)", nullable: true), ItemStatus = table.Column(type: "int", nullable: false, comment: "1 = In stock; 2 = Item Moving; 3 = Item Out; 4 = Item Broken; 5 = Item Lost; 6 = Item Stolen; 7 = Item Damaged; 8 = Item Discarded; 9 = Item Destroyed; 10 = Item Finished;"), - ItemLocation = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), MovementId = table.Column(type: "int", nullable: true), CreatedByUserId = table.Column(type: "int", nullable: false) }, @@ -552,7 +550,8 @@ namespace PSTW_CentralSystem.Migrations { 2, null, "Can access some admin pages", "SystemAdmin", "SYSTEMADMIN" }, { 3, null, "Can access operation pages", "Engineer", "ENGINEER" }, { 4, null, "Can access data viewer pages", "Observer", "OBSERVER" }, - { 5, null, "Handle inventory module", "Inventory Master", "INVENTORY MASTER" } + { 5, null, "Handle inventory module", "Inventory Master", "INVENTORY MASTER" }, + { 6, null, "Involve in inventory transaction", "Finance", "FINANCE" } }); migrationBuilder.InsertData( @@ -560,8 +559,8 @@ namespace PSTW_CentralSystem.Migrations columns: new[] { "Id", "AccessFailedCount", "ConcurrencyStamp", "Email", "EmailConfirmed", "FullName", "LockoutEnabled", "LockoutEnd", "NormalizedEmail", "NormalizedUserName", "PasswordHash", "PhoneNumber", "PhoneNumberConfirmed", "SecurityStamp", "TwoFactorEnabled", "UserInfoStatus", "UserName", "departmentId" }, values: new object[,] { - { 1, 0, "cedbd3af-4aa6-41cc-a71f-f85ac3a7c6ac", "admin@pstw.com.my", true, "MAAdmin", false, null, "ADMIN@PSTW.COM.MY", "ADMIN@PSTW.COM.MY", "AQAAAAIAAYagAAAAEEsEPaF/WtRT6js4zpE9wiOXZXn+Vq29o4nc8esBsMmSE3Sm5q636DZeu7ECQlQ0RA==", null, false, "a7be7fa2-a275-4646-a387-2d1d1042878d", false, 1, "admin@pstw.com.my", null }, - { 2, 0, "948106ca-aeaa-49fa-87c9-018445595c12", "sysadmin@pstw.com.my", true, "SysAdmin", false, null, "SYSADMIN@PSTW.COM.MY", "SYSADMIN@PSTW.COM.MY", "AQAAAAIAAYagAAAAEL/iXkcbIqa5+OnqaBOBuG2KiSvkxA2shZYl0XQVtmadQnaO2eARuKwyGQqlWu9NqQ==", null, false, "04aeb405-81f6-4ca0-9ed8-ce10c2e5dd6e", false, 1, "sysadmin@pstw.com.my", null } + { 1, 0, "4c8e81ae-2e43-4f98-82a0-4d7c4aa6d011", "admin@pstw.com.my", true, "MAAdmin", false, null, "ADMIN@PSTW.COM.MY", "ADMIN@PSTW.COM.MY", "AQAAAAIAAYagAAAAEKr0d9Fe168hXvdX6+oJvbfo2QHFsp8i/EQjhLbkWRn/yvKImJa6XzZ5KJ6qohTE1w==", null, false, "2219ec34-d4a0-496b-a7d7-e6c5d7b2a222", false, 1, "admin@pstw.com.my", null }, + { 2, 0, "bcc1500e-9ae2-4704-9997-dbe646d2fa7a", "sysadmin@pstw.com.my", true, "SysAdmin", false, null, "SYSADMIN@PSTW.COM.MY", "SYSADMIN@PSTW.COM.MY", "AQAAAAIAAYagAAAAEE3CUAWzIeL592V5xPyAD5ciHe8OGtvbNHhU6UNafDMT/+0R77o6UCDj/K8wc0j0Xw==", null, false, "7c582e0d-8237-4605-8fec-449bbe78f6c9", false, 1, "sysadmin@pstw.com.my", null } }); migrationBuilder.InsertData( diff --git a/Migrations/CentralSystemContextModelSnapshot.cs b/Migrations/CentralSystemContextModelSnapshot.cs index 8286762..b731a40 100644 --- a/Migrations/CentralSystemContextModelSnapshot.cs +++ b/Migrations/CentralSystemContextModelSnapshot.cs @@ -197,10 +197,6 @@ namespace PSTW_CentralSystem.Migrations b.Property("InvoiceNo") .HasColumnType("longtext"); - b.Property("ItemLocation") - .IsRequired() - .HasColumnType("longtext"); - b.Property("ItemStatus") .HasColumnType("int") .HasComment("1 = In stock; 2 = Item Moving; 3 = Item Out; 4 = Item Broken; 5 = Item Lost; 6 = Item Stolen; 7 = Item Damaged; 8 = Item Discarded; 9 = Item Destroyed; 10 = Item Finished;"); @@ -264,12 +260,12 @@ namespace PSTW_CentralSystem.Migrations b.Property("Action") .HasColumnType("longtext") - .HasComment("StockIn, Stock Out"); + .HasComment("Register, StockIn, Stock Out"); b.Property("ConsignmentNote") .HasColumnType("longtext"); - b.Property("Date") + b.Property("Date") .HasColumnType("datetime(6)"); b.Property("ItemId") @@ -597,6 +593,13 @@ namespace PSTW_CentralSystem.Migrations Description = "Handle inventory module", Name = "Inventory Master", NormalizedName = "INVENTORY MASTER" + }, + new + { + Id = 6, + Description = "Involve in inventory transaction", + Name = "Finance", + NormalizedName = "FINANCE" }); }); @@ -682,16 +685,16 @@ namespace PSTW_CentralSystem.Migrations { Id = 1, AccessFailedCount = 0, - ConcurrencyStamp = "cedbd3af-4aa6-41cc-a71f-f85ac3a7c6ac", + ConcurrencyStamp = "4c8e81ae-2e43-4f98-82a0-4d7c4aa6d011", Email = "admin@pstw.com.my", EmailConfirmed = true, FullName = "MAAdmin", LockoutEnabled = false, NormalizedEmail = "ADMIN@PSTW.COM.MY", NormalizedUserName = "ADMIN@PSTW.COM.MY", - PasswordHash = "AQAAAAIAAYagAAAAEEsEPaF/WtRT6js4zpE9wiOXZXn+Vq29o4nc8esBsMmSE3Sm5q636DZeu7ECQlQ0RA==", + PasswordHash = "AQAAAAIAAYagAAAAEKr0d9Fe168hXvdX6+oJvbfo2QHFsp8i/EQjhLbkWRn/yvKImJa6XzZ5KJ6qohTE1w==", PhoneNumberConfirmed = false, - SecurityStamp = "a7be7fa2-a275-4646-a387-2d1d1042878d", + SecurityStamp = "2219ec34-d4a0-496b-a7d7-e6c5d7b2a222", TwoFactorEnabled = false, UserInfoStatus = 1, UserName = "admin@pstw.com.my" @@ -700,16 +703,16 @@ namespace PSTW_CentralSystem.Migrations { Id = 2, AccessFailedCount = 0, - ConcurrencyStamp = "948106ca-aeaa-49fa-87c9-018445595c12", + ConcurrencyStamp = "bcc1500e-9ae2-4704-9997-dbe646d2fa7a", Email = "sysadmin@pstw.com.my", EmailConfirmed = true, FullName = "SysAdmin", LockoutEnabled = false, NormalizedEmail = "SYSADMIN@PSTW.COM.MY", NormalizedUserName = "SYSADMIN@PSTW.COM.MY", - PasswordHash = "AQAAAAIAAYagAAAAEL/iXkcbIqa5+OnqaBOBuG2KiSvkxA2shZYl0XQVtmadQnaO2eARuKwyGQqlWu9NqQ==", + PasswordHash = "AQAAAAIAAYagAAAAEE3CUAWzIeL592V5xPyAD5ciHe8OGtvbNHhU6UNafDMT/+0R77o6UCDj/K8wc0j0Xw==", PhoneNumberConfirmed = false, - SecurityStamp = "04aeb405-81f6-4ca0-9ed8-ce10c2e5dd6e", + SecurityStamp = "7c582e0d-8237-4605-8fec-449bbe78f6c9", TwoFactorEnabled = false, UserInfoStatus = 1, UserName = "sysadmin@pstw.com.my" diff --git a/PSTW_CentralSystem.csproj b/PSTW_CentralSystem.csproj index c809682..5bd3f49 100644 --- a/PSTW_CentralSystem.csproj +++ b/PSTW_CentralSystem.csproj @@ -27,6 +27,9 @@ + + + diff --git a/Views/Admin/ModuleCreate.cshtml b/Views/Admin/ModuleCreate.cshtml index 01e2626..551bed9 100644 --- a/Views/Admin/ModuleCreate.cshtml +++ b/Views/Admin/ModuleCreate.cshtml @@ -73,6 +73,7 @@
diff --git a/Views/Shared/_Layout.cshtml b/Views/Shared/_Layout.cshtml index ae31875..bac0445 100644 --- a/Views/Shared/_Layout.cshtml +++ b/Views/Shared/_Layout.cshtml @@ -171,7 +171,7 @@ -
- + *@ diff --git a/appsettings.json b/appsettings.json index 3b5b1fc..fd08057 100644 --- a/appsettings.json +++ b/appsettings.json @@ -2,7 +2,8 @@ "ConnectionStrings": { //"DefaultConnection": "Server=localhost;uid=root;Password='';Database=web_interface;" //"DefaultConnection": "server=175.136.244.102;user id=root;password=tw_mysql_root;port=3306;database=web_interface" - "CentralConnnection": "Server=219.92.7.60;Port=3307;uid=installer;password='pstw_mysql_installer';database=pstw_cs;", //DB_dev connection + //"CentralConnnection": "Server=192.168.12.12;Port=3306;uid=installer;password='pstw_mysql_installer';database=pstw_cs;", //DB_dev Local connection + "CentralConnnection": "Server=219.92.7.60;Port=3307;uid=installer;password='pstw_mysql_installer';database=pstw_cs;", //DB_dev Public connection //"InventoryConnection": "Server=219.92.7.60;Port=3307;uid=installer;password='pstw_mysql_installer';database=pstw_cs_inventory;" //DB_dev connection //"DefaultConnection": "Server=219.92.7.60;Port=3307;uid=intern;password='intern_mysql_acct';database=web_interface;"//DB_dev connection }, diff --git a/wwwroot/Media/Inventory/Images/Part01.jpg b/wwwroot/Media/Inventory/Images/Part01.jpg new file mode 100644 index 0000000..4a13fc6 Binary files /dev/null and b/wwwroot/Media/Inventory/Images/Part01.jpg differ