forked from TetsuakiBaba/invoicable
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
235 lines (232 loc) · 19.3 KB
/
index.html
File metadata and controls
235 lines (232 loc) · 19.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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0">
<title>Invoicable - Simple Invoice</title>
<meta name="description" content="Simple and Free Invoice Generator. Create and download PDF invoices directly in your browser.">
<meta property="og:title" content="Invoicable - Simple Invoice Generator">
<meta property="og:description" content="Create professional invoices in seconds. No sign-up required, data saved locally in your browser.">
<meta property="og:type" content="website">
<!-- Favicon -->
<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 16 16%22 fill=%22%230d6efd%22><path d=%22M4 0h5.293A1 1 0 0 1 10 .293L13.707 4a1 1 0 0 1 .293.707V14a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2zm5.5 1.5v2a1 1 0 0 0 1 1h2l-3-3zM4.118 4 4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4H4.118zM5.5 7h5a.5.5 0 0 1 0 1h-5a.5.5 0 0 1 0-1zm0 2h5a.5.5 0 0 1 0 1h-5a.5.5 0 0 1 0-1zm0 2h5a.5.5 0 0 1 0 1h-5a.5.5 0 0 1 0-1z%22/></svg>">
<!-- Fonts -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@400;500;700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
<!-- CSS -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css">
<link href="./index.css?v=2.2.0" rel="stylesheet">
</head>
<body>
<div class="container unselectable">
<!-- General Configuration -->
<nav class="navbar fixed-top bg-white border-bottom py-2 shadow-sm">
<div class="container">
<span class="navbar-brand mb-0 h1 fw-bold d-flex align-items-center gap-2">
<i class="bi bi-file-earmark-text-fill text-primary-custom fs-4"></i>
<span style="font-family: 'Inter', sans-serif; letter-spacing: -0.5px; font-size: 1.2rem;">Invoicable</span>
</span>
<div class="d-flex gap-2 align-items-center toolbar-actions flex-wrap justify-content-end">
<div class="toolbar-item" title="Date Format">
<i class="bi bi-calendar-event text-muted"></i>
<select id="dateFormatSelect" class="toolbar-select form-select form-select-sm">
<option value="us">MM/DD/YYYY (US)</option>
<option value="jp">YYYY-MM-DD (JP)</option>
<option value="br">DD/MM/YYYY (BR)</option>
</select>
</div>
<div class="toolbar-item" title="Time Format">
<i class="bi bi-clock text-muted"></i>
<select id="timeFormatSelect" class="toolbar-select form-select form-select-sm">
<option value="24h">24h</option>
<option value="12h">12h (AM/PM)</option>
</select>
</div>
<div class="toolbar-item" title="Currency">
<i class="bi bi-cash-coin text-muted"></i>
<select id="currencySelect" class="toolbar-select form-select form-select-sm">
</select>
</div>
<div class="toolbar-item" title="Language">
<i class="bi bi-translate text-muted"></i>
<select id="languageSelect" class="toolbar-select form-select form-select-sm">
<option value="en">English</option>
<option value="jp">日本語</option>
<option value="pt">Português</option>
</select>
</div>
<div class="color-picker-wrapper" title="Theme Color">
<input type="color" class="form-control form-control-color" id="colorPicker" value="#2c3e50">
</div>
</div>
</div>
</nav>
<div class="navbar-spacer"></div>
<div class="row justify-content-center">
<!-- Invoice -->
<div class="col-lg-9 p-0">
<div class="card shadow-lg border-0 rounded-3 overflow-hidden mb-5">
<div id="pdf_element" class="bg-white p-4">
<div class="card-body p-0">
<div class="d-flex justify-content-between align-items-end mb-3">
<div>
<h2 class="fw-bold text-uppercase m-0 header-title" id="title" data-i18n="invoice_title">INVOICE</h2>
</div>
<div class="text-end">
<div class="d-flex align-items-center justify-content-end gap-2">
<span class="text-muted small fw-bold text-uppercase" data-i18n="invoice_number_label">Invoice #</span>
<span contenteditable="true" class="fs-5 fw-bold editable-field text-end" id="invoice_number" title="Edit Number"></span>
</div>
<div class="d-flex align-items-center justify-content-end gap-2 mt-1">
<span class="text-muted small fw-bold text-uppercase" data-i18n="date_label">Date:</span>
<input type="date" id="date" class="form-control date-picker-input" title="Click to change date">
</div>
<div class="d-flex align-items-center justify-content-end gap-2 mt-1">
<span class="text-muted small fw-bold text-uppercase" data-i18n="time_label">Time:</span>
<input type="time" id="time" class="form-control date-picker-input" title="Click to change time">
</div>
</div>
</div>
<div class="header-banner mb-4" style="height: 4px; width: 100%; border-radius: 2px;"></div>
<div class="row mb-4 gx-5">
<div class="col-6">
<h6 class="text-uppercase text-muted fw-bold mb-2 header-label-lg" data-i18n="from_title">From</h6>
<div class="d-flex align-items-center gap-2 fw-bold fs-5 mb-1 text-nowrap-custom">
<i class="small bi bi-person"></i>
<span contenteditable="true" class="editable-field" id="bill_from_name" data-placeholder="Name / Company"></span>
</div>
<div class="d-flex align-items-center gap-2 mb-1 fs-6">
<i class="small bi bi-geo-alt"></i> <span contenteditable="true" class="editable-field" id="bill_from_address" data-placeholder="Address"></span>
</div>
<div class="contact-line d-flex align-items-center gap-2 text-muted small mt-2 mb-2">
<i class="small bi bi-telephone"></i>
<span contenteditable="true" class="editable-field" id="bill_from_phone" data-placeholder="Phone"></span>
</div>
<div class="contact-line d-flex align-items-center gap-2 text-muted small">
<i class="small bi bi-envelope"></i>
<span contenteditable="true" class="editable-field" id="bill_from_email" data-placeholder="Email"></span>
</div>
</div>
<div class="col-6 text-end">
<h6 class="text-uppercase text-muted fw-bold mb-2 header-label-lg" data-i18n="bill_to_title">Bill To</h6>
<div class="d-flex align-items-center justify-content-end gap-2 fw-bold fs-5 mb-1 text-nowrap-custom">
<span contenteditable="true" class="editable-field text-end" id="bill_to_name" data-placeholder="Name / Company"></span>
<i class="small bi bi-person"></i>
</div>
<div class="d-flex align-items-center justify-content-end gap-2 mb-1 fs-6">
<span contenteditable="true" class="editable-field text-end" id="bill_to_address" data-placeholder="Address"></span>
<i class="small bi bi-geo-alt"></i>
</div>
<div class="contact-line d-flex align-items-center justify-content-end gap-2 text-muted small mt-2 mb-2">
<span contenteditable="true" class="editable-field text-end" id="bill_to_phone" data-placeholder="Phone"></span>
<i class="small bi bi-telephone"></i>
</div>
<div class="contact-line d-flex align-items-center justify-content-end gap-2 text-muted small">
<span contenteditable="true" class="editable-field text-end" id="bill_to_email" data-placeholder="Email"></span>
<i class="small bi bi-envelope"></i>
</div>
</div>
</div>
<div class="mt-2 mb-3">
<table class="table table-sm table-hover align-middle mb-0">
<thead class="table-light">
<tr>
<th width="35%" class="border-0 ps-2 py-2 x-small text-uppercase text-muted" data-i18n="col_description">Description</th>
<th width="19%" class="border-0 text-center py-2 x-small text-uppercase text-muted" data-i18n="col_qty">Qty</th>
<th width="19%" class="border-0 text-center py-2 x-small text-uppercase text-muted" data-i18n="col_price">Price</th>
<th width="22%" class="border-0 text-center py-2 x-small text-uppercase text-muted" data-i18n="col_amount">Amount</th>
<th width="5%" class="action-column border-0 text-center py-2"></th>
</tr>
</thead>
<tbody id="invoice_items" class="border-top-0">
</tbody>
<tfoot class="border-top">
<tr>
<td colspan="5" class="pt-2 border-0">
<button type="button" class="btn btn-light btn-sm text-muted no-print x-small" onclick="invoiceApp.addItem()">
<i class="bi bi-plus-circle me-1"></i> <span data-i18n="btn_add_item">Add Item</span>
</button>
</td>
</tr>
<tr>
<td colspan="2" class="border-0"></td>
<td class="text-center fw-bold fs-5 border-0" data-i18n="total_label">Total:</td>
<td class="text-center fw-bold fs-5 border-0 text-primary-custom" id="invoice_total">0.00</td>
</tr>
</tfoot>
</table>
</div>
<div class="row g-4 mt-1">
<div class="col-7">
<div class="p-3 rounded-2 bg-light bg-opacity-50 border border-light h-100 break-inside-avoid">
<h6 class="text-uppercase text-muted fw-bold mb-3" data-i18n="payment_info_title">Payment Details</h6>
<div class="row g-2">
<div class="col-12 d-flex justify-content-between border-bottom pb-1 mb-1 border-light">
<span class="text-muted x-small fw-bold" data-i18n="bank_label">Bank</span>
<span contenteditable="true" class="editable-field fw-medium text-dark small text-end" id="bank_name" data-placeholder="..."></span>
</div>
<div class="col-12 d-flex justify-content-between border-bottom pb-1 mb-1 border-light">
<span class="text-muted x-small fw-bold" data-i18n="branch_label">Branch</span>
<span contenteditable="true" class="editable-field fw-medium text-dark small text-end" id="branch_name" data-placeholder="..."></span>
</div>
<div class="col-12 d-flex justify-content-between border-bottom pb-1 mb-1 border-light">
<span class="text-muted x-small fw-bold" data-i18n="account_type_label">Type</span>
<span contenteditable="true" class="editable-field fw-medium text-dark small text-end" id="account_type" data-placeholder="..."></span>
</div>
<div class="col-12 d-flex justify-content-between border-bottom pb-1 mb-1 border-light">
<span class="text-muted x-small fw-bold" data-i18n="account_number_label">Account #</span>
<span contenteditable="true" class="editable-field fw-medium text-dark small text-end" id="account_number" data-placeholder="..."></span>
</div>
<div class="col-12 d-flex justify-content-between">
<span class="text-muted x-small fw-bold" data-i18n="account_holder_label">Holder</span>
<span contenteditable="true" class="editable-field fw-medium text-dark small text-end" id="account_holder" data-placeholder="..."></span>
</div>
</div>
</div>
</div>
<div class="col-5">
<div class="h-100">
<h6 class="text-uppercase text-muted fw-bold mb-2" data-i18n="notes_title">Notes</h6>
<div contenteditable="true" class="editable-field d-block text-muted small fst-italic" id="invoice_notes" data-placeholder="..." style="min-height: 100px; border: 1px dashed #eee; padding: 8px;"></div>
</div>
</div>
</div>
<div class="mt-5 pt-3 border-top text-center text-muted">
<a id="pdf_recreate_link" href="#" target="_blank" class="text-decoration-none text-muted small" data-i18n="pdf_recreate_link"> Click here to recreate Invoice </a>
</div>
</div>
</div>
</div>
</div>
<!-- Buttons and Footer -->
<div class="col-lg-9 mb-5">
<div class="d-flex gap-2 justify-content-center align-items-center bg-white p-3 rounded-pill shadow-sm border footer-actions">
<button class="btn btn-danger rounded-pill px-4" onclick="invoiceApp.clearData();">
<i class="bi bi-trash me-1"></i> <span data-i18n="btn_clear">Clear inputs</span>
</button>
<button class="btn btn-dark rounded-pill px-4" id="btn_copy_link" onclick="invoiceApp.copyShareLink();">
<i class="bi bi-link-45deg me-1"></i> <span data-i18n="btn_copy_link">Copy Link</span>
</button>
<button class="btn btn-primary rounded-pill px-4" onclick="invoiceApp.downloadPDF();">
<i class="bi bi-download me-2"></i> <span data-i18n="btn_download_pdf">PDF</span>
</button>
<input type="text" id="share_link" readonly style="position:absolute; left:-9999px;">
</div>
<footer class="text-center text-muted mt-5 pb-4 small">
<p data-i18n="footer_privacy">Data remains local. Auto-saved in your browser.</p>
<div class="opacity-75"> 2025 © Invoicable. <br> Original Project by Tetsuaki Baba <a href="https://github.com/TetsuakiBaba/invoicable" target="_blank"><i class="bi bi-github"></i></a>
<br> Refactoring by Rubens Braz <a href="https://github.com/rubensbraz" target="_blank"><i class="bi bi-github"></i></a>
</div>
</footer>
</div>
</div>
</div>
<!-- JS -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/js/bootstrap.bundle.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2pdf.js/0.10.1/html2pdf.bundle.min.js"></script>
<script src="./index.js?v=2.2.0"></script>
</body>
</html>