-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
461 lines (438 loc) · 20.9 KB
/
index.html
File metadata and controls
461 lines (438 loc) · 20.9 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>Invoice Generator Dashboard</title>
<link rel="stylesheet" href="styles.css" />
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<script src="https://cdn.jsdelivr.net/npm/chartjs-adapter-date-fns/dist/chartjs-adapter-date-fns.bundle.min.js"></script>
</head>
<body class="pre-init">
<div class="app-container">
<div class="sidebar">
<div class="tab-box">
<button class="collapse-btn"><</button>
<div class="tab-container">
<button class="tab-btn" data-tab="home">
Home <span class="icon">🏠</span>
</button>
</div>
<div class="tab-container">
<button class="tab-btn" data-tab="sale">
Sale <span class="icon">🛒</span>
</button>
<div class="sub-menu">
<button class="sub-menu-btn" data-sub-tab="add-sale">Add Sale</button>
<button class="sub-menu-btn" data-sub-tab="sale-return">Sale Return</button>
</div>
</div>
<div class="tab-container">
<button class="tab-btn" data-tab="customer">
Customer <span class="icon">👤</span>
</button>
</div>
<div class="tab-container">
<button class="tab-btn" data-tab="items">
Items <span class="icon">📦</span>
</button>
</div>
<div class="tab-container">
<button class="tab-btn" data-tab="backup">
Backup <span class="icon">☁️</span>
</button>
</div>
<div class="tab-container">
<button class="tab-btn" data-tab="utilities">
Utilities <span class="icon">🧰</span>
</button>
</div>
<div class="tab-container">
<button class="tab-btn" data-tab="settings">
Settings <span class="icon">⚙️</span>
</button>
</div>
</div>
</div>
<div id="confirmation-modal" class="modal-container">
<div class="modal-content" style="max-width: 400px;">
<div class="modal-header">
<h3 id="modal-title">Confirm Action</h3>
<button class="close-btn" id="close-modal-btn">×</button>
</div>
<div class="modal-body">
<p id="modal-message">Are you sure?</p>
</div>
<div class="modal-footer" style="justify-content: flex-end;">
<button id="modal-cancel-btn" class="action-button secondary">Cancel</button>
<button id="modal-confirm-btn" class="action-button danger">Confirm</button>
</div>
</div>
</div>
<div id="customer-modal" class="modal-container" style="display: none;">
<div class="modal-content">
<div class="modal-header">
<h3 id="customer-modal-title">Add New Customer</h3>
<button class="close-btn" id="close-customer-modal-main">×</button>
</div>
<div class="modal-body">
<form id="customer-form" onsubmit="return false;">
<input type="hidden" id="customer-id-input">
<div class="form-group">
<label for="customer-name-main">Customer Name *</label>
<input type="text" id="customer-name-main" required>
</div>
<div class="form-group">
<label for="customer-address-main">Address *</label>
<textarea id="customer-address-main" rows="3" required></textarea>
</div>
<div class="form-group">
<label for="customer-phone-main">Phone No.</label>
<input type="text" id="customer-phone-main">
</div>
<div class="form-group">
<label for="customer-gstin-main">GSTIN</label>
<input type="text" id="customer-gstin-main">
</div>
<div class="form-group">
<label for="customer-pos-main">Place of Supply *</label>
<select id="customer-pos-main" required></select>
</div>
<div id="customer-form-error-main" class="error-message" style="display: none;"></div>
</form>
</div>
<div class="modal-footer">
<button type="button" id="cancel-customer-btn-main" class="action-button secondary">Cancel</button>
<button type="button" id="save-customer-btn-main" class="action-button">Save Customer</button>
</div>
</div>
</div>
<!-- NEW: Item Add/Edit Modal -->
<div id="item-modal" class="modal-container" style="display: none;">
<div class="modal-content">
<div class="modal-header">
<h3 id="item-modal-title">Add New Item</h3>
<button class="close-btn" id="close-item-modal-main">×</button>
</div>
<div class="modal-body">
<form id="item-form" onsubmit="return false;">
<input type="hidden" id="item-id-input">
<div class="form-group">
<label for="item-name-main">Item Name *</label>
<input type="text" id="item-name-main" required>
</div>
<div class="form-group">
<label for="item-hsn-main">HSN Code</label>
<input type="text" id="item-hsn-main">
</div>
<div class="form-group">
<label for="item-unit-main">Default Unit *</label>
<select id="item-unit-main" required></select>
</div>
<div class="form-group">
<label for="item-mrp-main">Default MRP *</label>
<input type="number" id="item-mrp-main" min="0" step="0.01" required>
</div>
<div class="form-group">
<label for="item-purchase-price-main">Purchase Price</label>
<input type="number" id="item-purchase-price-main" min="0" step="0.01">
</div>
<div class="form-group">
<label for="item-price-main">Default Sale Price *</label>
<input type="number" id="item-price-main" min="0" step="0.01" required>
</div>
<div class="form-group">
<label for="item-tax-main">Default GST Rate *</label>
<select id="item-tax-main" required></select>
</div>
<div class="form-group price-mode-toggle" style="justify-content: flex-start;">
<label class="switch">
<input type="checkbox" id="item-inclusive-main" checked>
<span class="slider round"></span>
</label>
<span>Price is Inclusive of Tax</span>
</div>
<div id="item-form-error-main" class="error-message" style="display: none;"></div>
</form>
</div>
<div class="modal-footer">
<button type="button" id="cancel-item-btn-main" class="action-button secondary">Cancel</button>
<button type="button" id="save-item-btn-main" class="action-button">Save Item</button>
</div>
</div>
</div>
<div class="content-area">
<div class="tile-grid">
<section id="home" class="tile">
<div class="dashboard-header">
<button id="add-sale-btn-home" class="action-button">+ Add Sale</button>
</div>
<div class="fy-summary-card">
<h4>Financial Year At a Glance (YTD)</h4>
<div class="fy-summary-metrics">
<div class="fy-metric">
<span>Total Sales</span>
<p>₹ <span id="fy-total-sales">0.00</span></p>
</div>
<div class="fy-metric">
<span>Total Profit (Est.)</span>
<p>₹ <span id="fy-total-profit">0.00</span></p>
</div>
</div>
</div>
<div class="kpi-cards-grid">
<div class="kpi-card">
<h4>Total Sales</h4>
<p>₹ <span id="kpi-total-sales">0</span></p>
</div>
<div class="kpi-card">
<h4>Total Invoices</h4>
<p><span id="kpi-total-invoices">0</span></p>
</div>
<div class="kpi-card">
<h4>Profit (Est.)</h4>
<p>₹ <span id="kpi-total-profit">0</span></p>
</div>
</div>
<div class="dashboard-main-content">
<div class="main-sale-chart">
<div class="dashboard-top">
<div class="sale-info">
<h3>Sales Overview</h3>
<p><span id="sales-change">+0%</span> vs previous period</p>
</div>
<div class="filter-controls">
<div class="filter">
<select id="timeframe-select">
<option value="this-month">This Month</option>
<option value="last-month">Last Month</option>
<option value="this-quarter">This Quarter</option>
<option value="this-year">This Year</option>
<option value="custom">Custom Range</option>
</select>
</div>
<div class="custom-date-range" id="custom-date-range-picker" style="display: none;">
<input type="date" id="custom-start-date">
<span>to</span>
<input type="date" id="custom-end-date">
</div>
</div>
</div>
<div class="chart-container">
<canvas id="sales-chart"></canvas>
</div>
</div>
<div class="recent-invoices">
<h3>Recent Invoices</h3>
<ul id="recent-invoices-list"></ul>
</div>
</div>
</section>
<section id="sale" class="tile">
<div class="sale-header">
<div class="sale-header-main">
<h2>Sale Invoices</h2>
<div class="sale-total-summary">
<span>Total Sales (Filtered):</span>
<span id="filtered-sales-total">₹0.00</span>
</div>
</div>
<div class="sale-actions">
<div class="filters">
<div class="filter-item">
<label for="invoice-search" class="filter-label">Search</label>
<input type="text" id="invoice-search" placeholder="Search by Invoice # or Customer">
</div>
<div class="filter-item">
<label for="date-range-filter" class="filter-label">Date</label>
<select id="date-range-filter">
<option value="all" selected>All Time</option>
<option value="this_month">This Month</option>
<option value="last_month">Last Month</option>
<option value="this_quarter">This Quarter</option>
<option value="last_quarter">Last Quarter</option>
<option value="custom">Custom Range</option>
</select>
</div>
<div class="filter-item" id="custom-date-container" style="display: none;">
<div class="custom-date-inputs">
<div class="date-input-group">
<label for="start-date" class="filter-label">From</label>
<input type="date" id="start-date">
</div>
<div class="date-input-group">
<label for="end-date" class="filter-label">To</label>
<input type="date" id="end-date">
</div>
</div>
</div>
<div class="filter-item">
<label for="sort-by-select" class="filter-label">Sort By</label>
<select id="sort-by-select">
<option value="date_desc">Date (Newest)</option>
<option value="date_asc">Date (Oldest)</option>
<option value="invoice_no_desc" selected>Invoice No (Highest)</option>
<option value="invoice_no_asc">Invoice No (Lowest)</option>
<option value="total_value_desc">Value (High-Low)</option>
<option value="total_value_asc">Value (Low-High)</option>
</select>
</div>
<div class="filter-item">
<label class="filter-label"> </label> <button id="print-report-btn" class="action-button">Print Report</button>
</div>
</div>
</div>
</div>
<div class="data-table-container">
<table class="data-table">
<thead>
<tr>
<th data-sort="invoice_no">Invoice No <span class="sort-arrow"></span></th>
<th data-sort="customer_name">Customer Name <span class="sort-arrow"></span></th>
<th data-sort="date">Date <span class="sort-arrow">▼</span></th>
<th data-sort="total_value">Total Value <span class="sort-arrow"></span></th>
<th data-sort="status">Status <span class="sort-arrow"></span></th>
<th>Actions</th>
</tr>
</thead>
<tbody id="invoice-list-body"></tbody>
</table>
</div>
</section>
<section id="customer" class="tile">
<div class="sale-header">
<div class="sale-header-main">
<h2>Customers</h2>
<button id="add-new-customer-btn" class="action-button">+ Add New Customer</button>
</div>
<div class="sale-actions">
<div class="search-container" style="width: 100%;">
<input type="text" id="customer-search-main" placeholder="Search by Name, Phone, or GSTIN..." style="width: 100%;">
<span class="search-icon">🔍</span>
</div>
</div>
</div>
<div class="data-table-container">
<table class="data-table">
<thead>
<tr>
<th>Name</th>
<th>Phone</th>
<th>GSTIN</th>
<th>Place of Supply</th>
<th>Actions</th>
</tr>
</thead>
<tbody id="customer-list-body"></tbody>
</table>
</div>
<div class="pagination-footer" style="padding-top: 15px; display: flex; justify-content: flex-end; align-items: center;"></div>
</section>
<!-- NEW: Item Management Tile -->
<section id="items" class="tile">
<div class="sale-header">
<div class="sale-header-main">
<h2>Items</h2>
<button id="add-new-item-btn" class="action-button">+ Add New Item</button>
</div>
<div class="sale-actions">
<div class="search-container" style="width: 100%;">
<input type="text" id="item-search-main" placeholder="Search by Name or HSN Code..." style="width: 100%;">
<span class="search-icon">🔍</span>
</div>
</div>
</div>
<div class="data-table-container">
<table class="data-table">
<thead>
<tr>
<th>Name</th>
<th>HSN</th>
<th>Sale Price</th>
<th>Tax Rate</th>
<th>Actions</th>
</tr>
</thead>
<tbody id="item-list-body">
<!-- Item data will be populated here by JS -->
</tbody>
</table>
</div>
<div class="pagination-footer" style="padding-top: 15px; display: flex; justify-content: flex-end; align-items: center;"></div>
</section>
<!-- NEW: Backup Tile -->
<section id="backup" class="tile">
<h2>Backup & Restore</h2>
<div class="setting-group">
<h3>Backup</h3>
<p class="setting-description">Download a copy of the entire application database. Keep this file in a safe place.</p>
<button id="backup-db-btn" class="action-button">Download Database Backup</button>
</div>
<div class="setting-group">
<h3>Restore</h3>
<p class="setting-description">Restore the application data from a backup file. <strong>Warning:</strong> This will overwrite all current data.</p>
<input type="file" id="restore-db-input" accept=".db" style="display: none;">
<button id="restore-db-btn" class="action-button secondary">Choose Backup File</button>
<span id="restore-file-name" style="margin-left: 15px;">No file selected.</span>
</div>
</section>
<section id="settings" class="tile">
<h2>Settings</h2>
<div class="setting-group">
<h3>Appearance</h3>
<div class="theme-switch-wrapper">
<label class="theme-switch" for="theme-toggle">
<input type="checkbox" id="theme-toggle" />
<span class="slider round"></span>
</label>
<span class="theme-label">Dark Mode</span>
</div>
</div>
<div class="setting-group">
<h3>Invoice Defaults</h3>
<div class="theme-switch-wrapper" style="margin-top: 15px;">
<label class="theme-switch" for="default-price-mode-toggle">
<input type="checkbox" id="default-price-mode-toggle" />
<span class="slider round"></span>
</label>
<span class="theme-label">Default new invoices to 'Price With Tax'</span>
</div>
</div>
<div class="setting-group">
<h3>PDF Theme</h3>
<p class="setting-description">Select the default theme for generated PDF invoices.</p>
<div id="pdf-theme-selector" class="theme-selector-container">
<div class="theme-option">
<img src="https://placehold.co/200x283/FFFFFF/000000?text=Default" alt="Default Theme Preview" class="theme-preview">
<label><input type="radio" name="pdf_theme" value="default" checked> Default</label>
</div>
<div class="theme-option">
<img src="https://placehold.co/200x283/007BFF/FFFFFF?text=Modern" alt="Modern Theme Preview" class="theme-preview">
<label><input type="radio" name="pdf_theme" value="modern"> Modern</label>
</div>
<div class="theme-option">
<img src="https://placehold.co/200x283/F8F9FA/343A40?text=Minimalist" alt="Minimalist Theme Preview" class="theme-preview">
<label><input type="radio" name="pdf_theme" value="minimalist"> Minimalist</label>
</div>
<div class="theme-option">
<img src="https://placehold.co/200x283/EEEEEE/000000?text=Classic" alt="Classic Theme Preview" class="theme-preview">
<label><input type="radio" name="pdf_theme" value="classic"> Classic</label>
</div>
<div class="theme-option">
<img src="https://placehold.co/200x283/3498DB/FFFFFF?text=Creative" alt="Creative Theme Preview" class="theme-preview">
<label><input type="radio" name="pdf_theme" value="creative"> Creative</label>
</div>
<div class="theme-option">
<img src="https://placehold.co/200x283/212529/FFFFFF?text=Technical" alt="Technical Theme Preview" class="theme-preview">
<label><input type="radio" name="pdf_theme" value="technical"> Technical</label>
</div>
</div>
</div>
</section>
</div>
</div>
</div>
<div id="notification" class="notification"></div>
<script src="script.js"></script>
</body>
</html>