-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpayroll.html
More file actions
342 lines (329 loc) · 17.5 KB
/
payroll.html
File metadata and controls
342 lines (329 loc) · 17.5 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Payroll — Simpatico HR</title>
<link rel="stylesheet" href="hr-modules.css">
<script>
// Hide shell when loaded inside dashboard iframe
if (window.self !== window.top) {
document.addEventListener("DOMContentLoaded", function() {
var shell = document.querySelector(".hr-shell");
if (shell) {
shell.style.gridTemplateColumns = "1fr";
shell.style.gridTemplateRows = "1fr";
}
var topbar = document.querySelector(".hr-topbar");
if (topbar) topbar.style.display = "none";
var sidebar = document.querySelector(".hr-sidebar");
if (sidebar) sidebar.style.display = "none";
var main = document.querySelector(".hr-main");
if (main) {
main.style.gridColumn = "1";
main.style.padding = "20px";
}
});
}
</script></head>
<body class="hr-module">
<div class="hr-shell">
<header class="hr-topbar">
<a href="/dashboard/hr.html" class="hr-topbar-brand">
<img src="favicon-96x96.png" style="width:24px;height:24px;margin-right:10px;border-radius:4px">Simpatico<span>HR</span>
</a>
<div class="hr-topbar-right">
<div class="hr-avatar" id="user-avatar">U</div>
</div>
</header>
<nav class="hr-sidebar">
<div class="hr-nav-section">Core HR</div>
<a class="hr-nav-item" href="/employees.html"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"/><circle cx="9" cy="7" r="4"/></svg>Employees</a>
<a class="hr-nav-item" href="/onboarding.html"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/></svg>Onboarding</a>
<a class="hr-nav-item" href="/training.html"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z"/><path d="M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z"/></svg>Training</a>
<a class="hr-nav-item" href="/performance.html"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="22 12 18 12 15 21 9 3 6 12 2 12"/></svg>Performance</a>
<div class="hr-nav-section" style="margin-top:8px">Operations</div>
<a class="hr-nav-item" href="/hr-ops.html"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="2" y="3" width="20" height="14" rx="2"/></svg>HR Ops</a>
<a class="hr-nav-item active" href="/payroll.html"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="12" y1="1" x2="12" y2="23"/><path d="M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6"/></svg>Payroll</a>
<div class="hr-nav-section" style="margin-top:8px">Intelligence</div>
<a class="hr-nav-item" href="/analytics.html"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="18" y1="20" x2="18" y2="10"/><line x1="12" y1="20" x2="12" y2="4"/><line x1="6" y1="20" x2="6" y2="14"/></svg>Analytics</a>
<a class="hr-nav-item" href="/ai-assistant.html"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10"/></svg>AI Assistant</a>
<div class="hr-nav-section" style="margin-top:8px">Automation</div>
<a class="hr-nav-item" href="/hr-automation.html"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M13 2L3 14h9l-1 8 10-12h-9l1-8z"/></svg>HR Rules</a>
<a class="hr-nav-item" href="/ats-automation.html"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10"/><path d="M12 8v4l3 3"/></svg>ATS Engine</a>
</nav>
<main class="hr-main">
<div class="hr-page-header">
<div class="hr-page-title">Payroll
<small>Salaries, payslips, compensation & deductions</small>
</div>
<div class="hr-page-actions">
<button class="hr-btn hr-btn-secondary" onclick="exportPayroll()">Export CSV</button>
<button class="hr-btn hr-btn-primary" onclick="openRunPayrollModal()">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" style="width:15px;height:15px"><polygon points="5 3 19 12 5 21 5 3"/></svg>
Run Payroll
</button>
</div>
</div>
<div class="hr-stats-grid">
<div class="hr-stat-card" style="--card-accent:#10b981">
<div class="label">Total Payroll (Month)</div>
<div class="value" id="stat-total-payroll"></div>
<div class="trend up" id="stat-payroll-sub">This period</div>
<div class="icon" style="--icon-bg:rgba(16,185,129,.1)"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="12" y1="1" x2="12" y2="23"/><path d="M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6"/></svg></div>
</div>
<div class="hr-stat-card" style="--card-accent:#00c4ff">
<div class="label">Employees on Payroll</div>
<div class="value" id="stat-on-payroll"></div>
<div class="trend neutral">Active employees</div>
<div class="icon" style="--icon-bg:rgba(0,196,255,.1)"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"/><circle cx="9" cy="7" r="4"/></svg></div>
</div>
<div class="hr-stat-card" style="--card-accent:#f59e0b">
<div class="label">Next Payroll Date</div>
<div class="value" id="stat-next-date" style="font-size:20px"></div>
<div class="trend neutral" id="stat-next-sub">Scheduled</div>
<div class="icon" style="--icon-bg:rgba(245,158,11,.1)"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="4" width="18" height="18" rx="2"/><line x1="16" y1="2" x2="16" y2="6"/><line x1="8" y1="2" x2="8" y2="6"/><line x1="3" y1="10" x2="21" y2="10"/></svg></div>
</div>
<div class="hr-stat-card" style="--card-accent:#a78bfa">
<div class="label">Pending Payslips</div>
<div class="value" id="stat-pending-payslips"></div>
<div class="trend neutral">Awaiting distribution</div>
<div class="icon" style="--icon-bg:rgba(167,139,250,.1)"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/></svg></div>
</div>
</div>
<div class="hr-tabs" id="payroll-tabs">
<button class="hr-tab active" onclick="switchPayrollTab(this,'tab-payslips')">Payslips</button>
<button class="hr-tab" onclick="switchPayrollTab(this,'tab-salary')">Salary Register</button>
<button class="hr-tab" onclick="switchPayrollTab(this,'tab-runs')">Payroll Runs</button>
<button class="hr-tab" onclick="switchPayrollTab(this,'tab-deductions')">Deductions</button>
</div>
<!-- Payslips -->
<div id="tab-payslips">
<div style="display:flex;gap:10px;margin-bottom:16px;flex-wrap:wrap;align-items:center">
<div class="hr-search">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>
<input type="text" placeholder="Search employee" id="payslip-search" oninput="filterPayslips()">
</div>
<select class="hr-select" id="payslip-period" onchange="filterPayslips()" style="width:auto;min-width:160px">
<option value="">All Periods</option>
</select>
</div>
<div class="hr-table-wrap">
<div class="hr-table-header">
<span class="hr-table-title">Payslips</span>
<button class="hr-btn hr-btn-ghost hr-btn-sm" onclick="sendAllPayslips()">Send All</button>
</div>
<table class="hr-table">
<thead><tr><th>Employee</th><th>Period</th><th>Gross Pay</th><th>Deductions</th><th>Net Pay</th><th>Status</th><th>Actions</th></tr></thead>
<tbody id="payslips-tbody"></tbody>
</table>
</div>
</div>
<!-- Salary Register -->
<div id="tab-salary" style="display:none">
<div class="hr-table-wrap">
<div class="hr-table-header">
<span class="hr-table-title">Salary Register</span>
<div style="display:flex;gap:8px">
<button class="hr-btn hr-btn-primary hr-btn-sm" onclick="openAddSalaryModal()">+ Add Salary</button>
<button class="hr-btn hr-btn-ghost hr-btn-sm" onclick="openSalaryUpdateModal()">Bulk Update</button>
</div>
</div>
<table class="hr-table">
<thead><tr><th>Employee</th><th>Department</th><th>Role</th><th>Type</th><th>Base Salary</th><th>Currency</th><th>Effective Date</th><th>Actions</th></tr></thead>
<tbody id="salary-tbody"></tbody>
</table>
</div>
</div>
<!-- Payroll Runs -->
<div id="tab-runs" style="display:none">
<div class="hr-table-wrap">
<table class="hr-table">
<thead><tr><th>Period</th><th>Type</th><th>Total Gross</th><th>Total Net</th><th>Employees</th><th>Status</th><th>Run By</th><th>Actions</th></tr></thead>
<tbody id="runs-tbody"></tbody>
</table>
</div>
</div>
<!-- Deductions -->
<div id="tab-deductions" style="display:none">
<div style="display:flex;justify-content:flex-end;margin-bottom:16px">
<button class="hr-btn hr-btn-primary hr-btn-sm" onclick="openAddDeductionModal()">Add Deduction Type</button>
</div>
<div class="hr-table-wrap">
<table class="hr-table">
<thead><tr><th>Employee</th><th>Type</th><th>Amount</th><th>Frequency</th><th>Start Date</th><th>End Date</th><th>Status</th></tr></thead>
<tbody id="deductions-tbody"></tbody>
</table>
</div>
</div>
</main>
</div>
<!-- Run Payroll Modal -->
<div class="hr-modal-overlay" id="run-payroll-modal">
<div class="hr-modal">
<div class="hr-modal-head">
<h2>Run Payroll</h2>
<button class="hr-modal-close" onclick="closeModal('run-payroll-modal')">
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>
</button>
</div>
<div class="hr-grid-2">
<div class="hr-form-group">
<label class="hr-label">Pay Period *</label>
<input class="hr-input" id="run-period" placeholder="e.g. March 2026">
</div>
<div class="hr-form-group">
<label class="hr-label">Currency</label>
<select class="hr-select" id="run-currency">
<option value="INR">INR (₹) - India</option>
<option value="USD">USD ($) - USA</option>
<option value="GBP">GBP (£) - UK</option>
<option value="CAD">CAD ($) - Canada</option>
<option value="AUD">AUD ($) - Australia</option>
<option value="NZD">NZD ($) - New Zealand</option>
<option value="EUR">EUR (€) - Europe (DE)</option>
<option value="AED">AED (د.إ) - Middle East (UAE)</option>
<option value="SGD">SGD ($) - Singapore</option>
</select>
</div>
</div>
<div class="hr-grid-2">
<div class="hr-form-group">
<label class="hr-label">Pay Date</label>
<input class="hr-input" type="date" id="run-pay-date">
</div>
<div class="hr-form-group">
<label class="hr-label">Pay Type</label>
<select class="hr-select" id="run-type">
<option value="monthly">Monthly</option>
<option value="biweekly">Bi-weekly</option>
<option value="weekly">Weekly</option>
</select>
</div>
</div>
<div class="hr-form-group">
<label class="hr-label">Notes</label>
<textarea class="hr-textarea" id="run-notes" placeholder="Optional notes" style="min-height:70px"></textarea>
</div>
<div style="background:rgba(16,185,129,.06);border:1px solid rgba(16,185,129,.2);border-radius:var(--hr-radius);padding:14px;margin-bottom:16px">
<div style="font-size:13px;color:var(--hr-text-secondary)">Preview</div>
<div id="run-preview" style="font-size:13px;margin-top:6px;color:var(--hr-text-primary)">Select period and calculate to preview</div>
</div>
<div style="display:flex;justify-content:space-between;align-items:center">
<button class="hr-btn hr-btn-ghost" onclick="calculatePayroll()">Calculate Preview</button>
<div style="display:flex;gap:10px">
<button class="hr-btn hr-btn-ghost" onclick="closeModal('run-payroll-modal')">Cancel</button>
<button class="hr-btn hr-btn-primary" onclick="executePayroll()">Run Payroll</button>
</div>
</div>
</div>
</div>
<div class="hr-modal-overlay" id="edit-salary-modal">
<div class="hr-modal">
<div class="hr-modal-head">
<h2 id="salary-modal-title">Add Salary</h2>
<button class="hr-modal-close" onclick="closeModal('edit-salary-modal')">
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>
</button>
</div>
<input type="hidden" id="edit-salary-id">
<div class="hr-form-group">
<label class="hr-label">Employee *</label>
<select class="hr-select" id="salary-employee">
<option value="">Select employee...</option>
</select>
</div>
<div class="hr-grid-2">
<div class="hr-form-group">
<label class="hr-label">Base Salary (Monthly) *</label>
<input type="number" class="hr-input" id="edit-salary-amount" placeholder="e.g. 50000" min="0" step="100">
</div>
<div class="hr-form-group">
<label class="hr-label">Currency</label>
<select class="hr-select" id="salary-currency">
<option value="INR">INR (₹) - India</option>
<option value="USD">USD ($) - USA</option>
<option value="GBP">GBP (£) - UK</option>
<option value="CAD">CAD ($) - Canada</option>
<option value="AUD">AUD ($) - Australia</option>
<option value="NZD">NZD ($) - New Zealand</option>
<option value="EUR">EUR (€) - Europe (DE)</option>
<option value="AED">AED (د.إ) - Middle East (UAE)</option>
<option value="SGD">SGD ($) - Singapore</option>
</select>
</div>
</div>
<div class="hr-grid-2">
<div class="hr-form-group">
<label class="hr-label">HRA Allowance</label>
<input type="number" class="hr-input" id="salary-hra-amount" placeholder="e.g. 20000" min="0" step="100">
</div>
<div class="hr-form-group">
<label class="hr-label">Special Allowance</label>
<input type="number" class="hr-input" id="salary-special-amount" placeholder="e.g. 15000" min="0" step="100">
</div>
</div>
<div class="hr-grid-2">
<div class="hr-form-group">
<label class="hr-label">Tax Regime</label>
<select class="hr-select" id="salary-tax-regime">
<option value="old">Old Regime</option>
<option value="new">New Regime</option>
</select>
</div>
<div class="hr-form-group">
<label class="hr-label">Effective Date</label>
<input type="date" class="hr-input" id="salary-effective-date">
</div>
</div>
<div class="hr-form-group">
<label class="hr-label">Employment Type</label>
<select class="hr-select" id="salary-emp-type">
<option value="full_time">Full Time</option>
<option value="part_time">Part Time</option>
<option value="contract">Contract</option>
<option value="intern">Intern</option>
</select>
</div>
<div style="display:flex;justify-content:flex-end;gap:10px">
<button class="hr-btn hr-btn-ghost" onclick="closeModal('edit-salary-modal')">Cancel</button>
<button class="hr-btn hr-btn-primary" onclick="saveSalary()">Save</button>
</div>
</div>
</div>
<div class="hr-modal-overlay" id="add-deduction-modal">
<div class="hr-modal">
<div class="hr-modal-head">
<h2>Add Deduction</h2>
<button class="hr-modal-close" onclick="closeModal('add-deduction-modal')">
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>
</button>
</div>
<div class="hr-form-group">
<label class="hr-label">Employee *</label>
<select class="hr-select" id="deduction-employee">
<option value="">Select employee...</option>
</select>
</div>
<div class="hr-form-group">
<label class="hr-label">Type</label>
<input type="text" class="hr-input" id="deduction-type" placeholder="e.g. Tax, Health Insurance, PF">
</div>
<div class="hr-form-group">
<label class="hr-label">Amount (Monthly)</label>
<input type="number" class="hr-input" id="deduction-amount" placeholder="0.00" min="0" step="100">
</div>
<div style="display:flex;justify-content:flex-end;gap:10px">
<button class="hr-btn hr-btn-ghost" onclick="closeModal('add-deduction-modal')">Cancel</button>
<button class="hr-btn hr-btn-primary" onclick="saveDeduction()">Add</button>
</div>
</div>
</div>
<div class="hr-toast-container" id="toasts"></div>
<script src="https://cdn.jsdelivr.net/npm/@supabase/supabase-js@2"></script>
<script src="/js/hr-config.js"></script>
<script src="/js/shared-utils.js"></script>
<script src="/js/supabase-client.js"></script>
<script src="/js/payroll.js"></script>
</body>
</html>