diff --git a/Areas/Report/Views/Reporting/InventoryReport.cshtml b/Areas/Report/Views/Reporting/InventoryReport.cshtml index 040efdd..d22da9d 100644 --- a/Areas/Report/Views/Reporting/InventoryReport.cshtml +++ b/Areas/Report/Views/Reporting/InventoryReport.cshtml @@ -78,6 +78,58 @@ +
+
+

User Report

+
+
+
+
+
+
+

Department

+ + +
+
+
+
+
+

Date filter

+ +
+
+
+
+ +
+
+
+
+
+
+
+
+
+

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 { @{ @@ -112,13 +164,14 @@ selectedMonth: [], selectedDepartment: [], selectedItem: [], - selectedCategory: [] + selectedCategory: [], + usersInfo: [], + submitBody: null, } }, mounted() { this.fetchUser(); this.fetchProductList(); - this.fetchCurrentReport(); this.fetchDepartmentsCompaniesList(); }, watch: { @@ -131,6 +184,14 @@ } }, methods: { + async generateReport(){ + this.submitBody = { + selectedMonth: this.selectedMonth, + selectedDepartment: this.selectedDepartment + } + console.log(this.submitBody); + // this.fetchCurrentReport(); + }, async fetchCurrentReport(){ try { const response = await fetch(`/ReportingAPI/GetMonthlyReport/`, { diff --git a/Controllers/API/ReportingAPI.cs b/Controllers/API/ReportingAPI.cs index bcfa336..96521c1 100644 --- a/Controllers/API/ReportingAPI.cs +++ b/Controllers/API/ReportingAPI.cs @@ -209,8 +209,8 @@ namespace PSTW_CentralSystem.Controllers.API .ToListAsync(); var latestItemMovements = await _centralDbContext.ItemMovements - //.Include(m => m.Item) - //.Include(m => m.Item!.Product) + .Include(m => m.Item) + .Include(m => m.Item!.Product) .Include(m => m.NextUser) .Where(m => m.ItemId != null && (ToUser > 0 ? m.ToUser != null : m.ToUser > 0) && (ToStation > 0 ? m.ToStation != null : m.ToStation > 0) && (ToStore > 0 ? m.ToStore != null : m.ToStore > 0)) .GroupBy(m => m.ItemId)