-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdistributor.html
More file actions
647 lines (620 loc) · 33.3 KB
/
Copy pathdistributor.html
File metadata and controls
647 lines (620 loc) · 33.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Distributor Manager - Inventory Management System</title>
<!-- Bootstrap 5 CSS -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
<!-- Bootstrap Icons -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/bootstrap-icons.css">
<!-- Custom CSS -->
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<div class="wrapper">
<!-- Sidebar -->
<aside class="sidebar">
<div class="sidebar-header">
<div class="logo-icon">
<i class="bi bi-box-seam"></i>
</div>
<div class="logo-text">
<h4 class="mb-0">Inventory</h4>
<small class="text-muted">Distributor Manager</small>
</div>
</div>
<nav class="sidebar-nav">
<div class="nav-section">
<h6 class="nav-section-title">Main Menu</h6>
<ul class="nav-menu">
<li class="nav-item">
<a class="nav-link active" href="#dashboard" data-section="dashboard">
<i class="bi bi-grid"></i>
<span>Dashboard</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#products" data-section="products">
<i class="bi bi-box-seam"></i>
<span>Products</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#inventory" data-section="inventory">
<i class="bi bi-file-text"></i>
<span>Inventory</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#new-transfer" data-section="new-transfer">
<i class="bi bi-send"></i>
<span>New Transfer</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#stock-movements" data-section="stock-movements">
<i class="bi bi-arrow-left-right"></i>
<span>Stock Movements</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#reports" data-section="reports">
<i class="bi bi-graph-up-arrow"></i>
<span>Reports</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#activity-log" data-section="activity-log">
<i class="bi bi-clock-history"></i>
<span>Activity Log</span>
</a>
</li>
</ul>
</div>
</nav>
<div class="sidebar-footer">
<a href="#" class="sign-out-link">
<i class="bi bi-box-arrow-right"></i>
<span>Sign Out</span>
</a>
</div>
</aside>
<!-- Main Content -->
<main class="main-content">
<!-- Top Header -->
<div class="top-header">
<div class="header-content">
<i class="bi bi-file-text me-2"></i>
<span>Inventory Management System - Distributor Manager</span>
</div>
</div>
<!-- Content Area -->
<div class="content-area">
<!-- Dashboard Section -->
<section id="dashboard" class="content-section">
<div class="dashboard-header mb-4">
<h1 class="dashboard-title">Dashboard</h1>
<p class="dashboard-subtitle">Welcome back! Here's an overview of your distributor inventory.</p>
</div>
<!-- Stats Cards -->
<div class="row g-4 mb-4">
<div class="col-md-3">
<div class="stat-card">
<div class="stat-card-body">
<div class="stat-content">
<h6 class="stat-label">Total Products</h6>
<h2 class="stat-value" id="totalItems">0</h2>
<p class="stat-description">Products in catalog</p>
</div>
<div class="stat-icon stat-icon-blue">
<i class="bi bi-box-seam"></i>
</div>
</div>
</div>
</div>
<div class="col-md-3">
<div class="stat-card">
<div class="stat-card-body">
<div class="stat-content">
<h6 class="stat-label">Distributor Inventory</h6>
<h2 class="stat-value" id="totalInventory">0</h2>
<p class="stat-description">Total units in stock</p>
</div>
<div class="stat-icon stat-icon-green">
<i class="bi bi-graph-up"></i>
</div>
</div>
</div>
</div>
<div class="col-md-3">
<div class="stat-card">
<div class="stat-card-body">
<div class="stat-content">
<h6 class="stat-label">Pending Movements</h6>
<h2 class="stat-value" id="pendingMovements">0</h2>
<p class="stat-description">Awaiting action</p>
</div>
<div class="stat-icon stat-icon-yellow">
<i class="bi bi-graph-up-arrow"></i>
</div>
</div>
</div>
</div>
<div class="col-md-3">
<div class="stat-card">
<div class="stat-card-body">
<div class="stat-content">
<h6 class="stat-label">Activity Logs</h6>
<h2 class="stat-value" id="activityLogs">0</h2>
<p class="stat-description">Your actions</p>
</div>
<div class="stat-icon stat-icon-green">
<i class="bi bi-graph-up"></i>
</div>
</div>
</div>
</div>
</div>
<!-- Date/Time and User Profile Section -->
<div class="row mb-4">
<div class="col-md-6">
<div class="d-flex align-items-center">
<i class="bi bi-calendar3 me-2 text-primary"></i>
<span id="currentDateTime" class="text-muted"></span>
</div>
</div>
<div class="col-md-6 text-end">
<div class="d-flex align-items-center justify-content-end">
<div class="user-profile-dropdown">
<div class="d-flex align-items-center">
<div class="user-avatar me-2">
<i class="bi bi-person-circle text-primary" style="font-size: 2rem;"></i>
</div>
<div>
<div class="fw-bold" id="userNameDisplay">Distributor Manager</div>
<small class="text-muted" id="userEmailDisplay">distributor@inventory.com</small>
</div>
<i class="bi bi-chevron-down ms-2 text-muted"></i>
</div>
</div>
</div>
</div>
</div>
<!-- Top Row - Three Cards -->
<div class="row g-4 mb-4">
<!-- Highest Quantity Products Card -->
<div class="col-md-4">
<div class="card">
<div class="card-header">
<h5 class="mb-0">HIGHEST QUANTITY PRODUCTS</h5>
</div>
<div class="card-body">
<div class="table-responsive">
<table class="table table-sm table-hover mb-0">
<thead>
<tr>
<th>Title</th>
<th>Total Movements</th>
<th>Total Quantity</th>
</tr>
</thead>
<tbody id="highestQuantityProductsTable">
<tr>
<td colspan="3" class="text-center text-muted">Loading...</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<!-- Latest Movements Card -->
<div class="col-md-4">
<div class="card">
<div class="card-header">
<h5 class="mb-0">LATEST MOVEMENTS</h5>
</div>
<div class="card-body">
<div class="table-responsive">
<table class="table table-sm table-hover mb-0">
<thead>
<tr>
<th>#</th>
<th>Product Name</th>
<th>Date</th>
<th>Total Value</th>
</tr>
</thead>
<tbody id="latestMovementsTable">
<tr>
<td colspan="4" class="text-center text-muted">Loading...</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<!-- Recently Added Products Card -->
<div class="col-md-4">
<div class="card">
<div class="card-header">
<h5 class="mb-0">RECENTLY ADDED PRODUCTS</h5>
</div>
<div class="card-body">
<div id="recentlyAddedProductsList">
<p class="text-muted mb-0">Loading...</p>
</div>
</div>
</div>
</div>
</div>
<!-- Bottom Row - Recent Movements Card -->
<div class="row mb-4">
<div class="col-12">
<div class="card">
<div class="card-header">
<h5 class="mb-0">RECENT MOVEMENTS</h5>
</div>
<div class="card-body">
<div class="table-responsive">
<table class="table table-striped table-hover mb-0">
<thead>
<tr>
<th>#</th>
<th>Product name</th>
<th>Quantity moved</th>
<th>Total</th>
<th>Date</th>
</tr>
</thead>
<tbody id="dailyMovementsTable">
<tr>
<td colspan="5" class="text-center text-muted">Loading...</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<!-- Role Information Card -->
<div class="row">
<div class="col-md-12">
<div class="card role-info-card">
<div class="card-body">
<h5 class="card-title mb-3">Role Information</h5>
<p class="card-subtitle text-muted mb-4">Your current role and permissions</p>
<div class="role-info-content">
<div class="role-info-item">
<span class="role-label">Role:</span>
<span class="role-badge">Distributor Manager</span>
</div>
<div class="role-info-item">
<span class="role-label">Email:</span>
<span class="role-value">distributor@inventory.com</span>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- Products Section (View Only) -->
<section id="products" class="content-section d-none">
<div class="row mb-4">
<div class="col-md-6">
<h2>Products</h2>
</div>
</div>
<!-- Search and Filter -->
<div class="row mb-3">
<div class="col-md-4">
<input type="text" class="form-control" id="productSearchInput" placeholder="Search products..." oninput="filterProducts()">
</div>
<div class="col-md-3">
<select class="form-select" id="productCategoryFilter" onchange="filterProducts()">
<option value="">All Categories</option>
</select>
</div>
<div class="col-md-3">
<select class="form-select" id="productStatusFilter" onchange="filterProducts()">
<option value="">All Status</option>
<option value="active">Active</option>
<option value="inactive">Inactive</option>
</select>
</div>
<div class="col-md-2">
<button class="btn btn-secondary w-100" onclick="document.getElementById('productSearchInput').value=''; document.getElementById('productCategoryFilter').value=''; document.getElementById('productStatusFilter').value=''; filterProducts();">
<i class="bi bi-x-circle me-1"></i>Clear
</button>
</div>
</div>
<!-- Products Table -->
<div class="card">
<div class="card-body">
<div class="table-responsive">
<table class="table table-striped table-hover">
<thead>
<tr>
<th>ID</th>
<th>Name</th>
<th>SKU</th>
<th>Category</th>
<th>Unit Price</th>
<th>Status</th>
</tr>
</thead>
<tbody id="productsTable">
<tr>
<td colspan="6" class="text-center text-muted">No products found.</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</section>
<!-- Inventory Section -->
<section id="inventory" class="content-section d-none">
<div class="row mb-4">
<div class="col-md-6">
<h2>
<i class="bi bi-boxes me-2"></i>Distributor Inventory
</h2>
</div>
</div>
<!-- Search and Filter -->
<div class="row mb-3">
<div class="col-md-4">
<input type="text" class="form-control" id="searchInput" placeholder="Search items...">
</div>
<div class="col-md-3">
<select class="form-select" id="categoryFilter">
<option value="">All Categories</option>
</select>
</div>
<div class="col-md-3">
<select class="form-select" id="statusFilter">
<option value="">All Status</option>
<option value="in-stock">In Stock</option>
<option value="low-stock">Low Stock</option>
<option value="out-of-stock">Out of Stock</option>
</select>
</div>
<div class="col-md-2">
<button class="btn btn-secondary w-100" onclick="clearFilters()">
<i class="bi bi-x-circle me-1"></i>Clear
</button>
</div>
</div>
<!-- Inventory Table -->
<div class="card">
<div class="card-body">
<div class="table-responsive">
<table class="table table-striped table-hover">
<thead>
<tr>
<th>ID</th>
<th>Product Name</th>
<th>Category</th>
<th>Quantity</th>
<th>Unit Price</th>
<th>Total Value</th>
<th>Status</th>
<th>Location</th>
</tr>
</thead>
<tbody id="inventoryTable">
<tr>
<td colspan="8" class="text-center text-muted">No items found.</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</section>
<!-- New Transfer Section -->
<section id="new-transfer" class="content-section d-none">
<div class="section-header mb-4">
<h2>New Transfer</h2>
</div>
<div class="card">
<div class="card-body text-center py-5">
<i class="bi bi-arrow-left-right fs-1 text-primary mb-3"></i>
<h4>Create a New Stock Transfer</h4>
<p class="text-muted mb-4">Transfer stock from distributor to sales agent</p>
<button class="btn btn-primary btn-lg" onclick="movementWizard.open()">
<i class="bi bi-plus-circle me-2"></i>Start New Transfer
</button>
</div>
</div>
</section>
<!-- Stock Movements Section -->
<section id="stock-movements" class="content-section d-none">
<div class="row mb-4">
<div class="col-md-6">
<h2>Stock Movements</h2>
</div>
<div class="col-md-6 text-end">
<button class="btn btn-primary me-2" onclick="movementWizard.open()">
<i class="bi bi-plus-circle me-2"></i>New Transfer
</button>
</div>
</div>
<!-- Filters -->
<div class="row mb-3">
<div class="col-md-3">
<select class="form-select" id="movementStatusFilter" onchange="filterMovements()">
<option value="">All Status</option>
<option value="pending">Pending</option>
<option value="approved">Approved</option>
<option value="received">Received</option>
<option value="cancelled">Cancelled</option>
</select>
</div>
<div class="col-md-3">
<select class="form-select" id="movementFromFilter" onchange="filterMovements()">
<option value="">All From Locations</option>
</select>
</div>
<div class="col-md-3">
<select class="form-select" id="movementToFilter" onchange="filterMovements()">
<option value="">All To Locations</option>
</select>
</div>
<div class="col-md-3">
<button class="btn btn-secondary w-100" onclick="document.getElementById('movementStatusFilter').value=''; document.getElementById('movementFromFilter').value=''; document.getElementById('movementToFilter').value=''; filterMovements();">
<i class="bi bi-x-circle me-1"></i>Clear
</button>
</div>
</div>
<div class="card">
<div class="card-body">
<div class="table-responsive">
<table class="table table-striped table-hover">
<thead>
<tr>
<th>ID</th>
<th>Date</th>
<th>From</th>
<th>To</th>
<th>Items</th>
<th>Status</th>
<th>Created By</th>
<th>Actions</th>
</tr>
</thead>
<tbody id="movementsTable">
<tr>
<td colspan="8" class="text-center text-muted">No movements found.</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</section>
<!-- Reports Section -->
<section id="reports" class="content-section d-none">
<div class="section-header mb-4">
<h2>Reports & Analytics</h2>
</div>
<div class="row mb-4">
<div class="col-md-6">
<div class="card">
<div class="card-header">
<h5 class="mb-0">Stock Value Summary</h5>
</div>
<div class="card-body">
<div class="mb-3">
<strong>Total Inventory Value:</strong>
<span class="fs-4 text-primary ms-2" id="totalValue">$0.00</span>
</div>
<div class="mb-3">
<strong>Average Item Value:</strong>
<span class="fs-5 text-secondary ms-2" id="avgValue">$0.00</span>
</div>
</div>
</div>
</div>
<div class="col-md-6">
<div class="card">
<div class="card-header">
<h5 class="mb-0">Category Distribution</h5>
</div>
<div class="card-body">
<div id="categoryDistribution">
<p class="text-muted">No data available</p>
</div>
</div>
</div>
</div>
</div>
<div class="row mb-4">
<div class="col-md-6">
<div class="card">
<div class="card-header">
<h5 class="mb-0">Stock Levels</h5>
</div>
<div class="card-body">
<div id="stockLevels">
<p class="text-muted">Loading...</p>
</div>
</div>
</div>
</div>
<div class="col-md-6">
<div class="card">
<div class="card-header">
<h5 class="mb-0">Recent Movement History</h5>
</div>
<div class="card-body">
<div id="movementHistory">
<p class="text-muted">Loading...</p>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- Activity Log Section -->
<section id="activity-log" class="content-section d-none">
<div class="section-header mb-4">
<h2>Activity Log</h2>
</div>
<div class="card">
<div class="card-body">
<div class="table-responsive">
<table class="table table-hover">
<thead>
<tr>
<th>Date & Time</th>
<th>Action</th>
<th>Description</th>
<th>User</th>
<th>View</th>
</tr>
</thead>
<tbody id="activityLogTable">
<tr>
<td colspan="5" class="text-center text-muted">No activity recorded</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</section>
</div>
</main>
</div>
<!-- Bootstrap 5 JS Bundle -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
<!-- API Utility JS (must be loaded before other modules) -->
<script src="js/api.js"></script>
<!-- Auth JS -->
<script src="js/auth.js"></script>
<!-- Products JS -->
<script src="js/products.js"></script>
<!-- Inventory Manager JS -->
<script src="js/inventoryManager.js"></script>
<!-- Movements JS -->
<script src="js/movements.js"></script>
<!-- Movement Wizard JS -->
<script src="js/movementWizard.js"></script>
<!-- Reports JS -->
<script src="js/reports.js"></script>
<!-- Activity Log JS -->
<script src="js/activityLog.js"></script>
<!-- Role Config JS -->
<script src="js/roleConfig.js"></script>
<!-- Distributor JS -->
<script src="js/distributor.js"></script>
<!-- Custom JS -->
<script src="js/app.js"></script>
</body>
</html>