File size: 15,729 Bytes
00f4802
 
 
 
 
 
 
 
 
 
 
 
 
9c4e7c0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
00f4802
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9ccff87
00f4802
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9c4e7c0
 
 
 
00f4802
 
9c4e7c0
 
 
 
 
 
 
 
 
 
 
 
 
00f4802
 
 
 
 
 
9c4e7c0
 
 
 
 
 
 
 
 
00f4802
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9c4e7c0
 
 
 
 
 
 
 
 
 
 
 
 
 
00f4802
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
<!DOCTYPE html>
<html lang="pl"><head>

  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Generator faktur</title>
  <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:wght@300;400;500;600;700&display=swap" rel="stylesheet">
  <link rel="stylesheet" href="styles.css">

  
  </head><body>
  <main class="container">
    <div class="brand-banner">
      <img src="small_logotyp do strony.jpg" alt="Logotyp FakturON!" class="brand-logo">
    </div>

    <section id="hero-panel" class="panel hero-panel">
      <div class="hero-columns">
        <div class="hero-content">
          <p class="eyebrow">Bezpłatny panel faktur</p>
          <h1 class="app-title">Generator faktur</h1>
          <p class="app-description">
            Proste narzędzie do wystawiania i analizowania faktur: logujesz się, uzupełniasz dane kontrahenta,
            zapisujesz dokument i od razu widzisz efekty w dashboardzie. Zero opłat, zero limitów.
          </p>
          <p class="hero-lead">
            Cały proces zamyka się w jednym widoku – formularze, podgląd i historia korzystają z tej samej siatki,
            dzięki czemu wyglądają identycznie na desktopie i na telefonie.
          </p>
          <ul class="header-highlights">
            <li>
              <strong>Zawsze bezpłatnie</strong>
              <span>Generator działa bez limitów dokumentów i bez pakietów abonamentowych.</span>
            </li>
            <li>
              <strong>Szybkie wystawianie</strong>
              <span>W jednym formularzu zbierasz dane sprzedawcy, nabywcy i pozycje, a podgląd generuje się automatycznie.</span>
            </li>
            <li>
              <strong>Spójny wygląd</strong>
              <span>Każdy etap korzysta z tej samej siatki, więc łatwo pracować na desktopie i na telefonie.</span>
            </li>
            <li>
              <strong>Dashboard i historia</strong>
              <span>Po zalogowaniu od razu widać statystyki i listę faktur gotowych do pobrania.</span>
            </li>
          </ul>
        </div>
        <section id="auth-section" class="auth-panel">
          <div class="auth-panel-header">
            <p class="eyebrow">Logowanie</p>
            <h2 class="auth-headline">Wejdź do generatora</h2>
            <p class="auth-copy">Zaloguj się i prowadź całą obsługę faktur w jednym darmowym panelu.</p>
          </div>
          <div class="auth-login">
            <div class="auth-card login-card">
              <h3>Zaloguj się</h3>
              <form id="login-form" class="form">
                <label>
                  Email
                  <input type="email" name="email" autocomplete="email" required>
                </label>
                <label>
                  Hasło
                  <input type="password" name="password" autocomplete="current-password" required>
                </label>
                <button type="submit">Zaloguj</button>
                <hr class="form-divider">
              </form>
              <p id="login-feedback" class="feedback" aria-live="polite"></p>
              <div class="auth-actions">
                <span>Nie masz konta?</span>
                <button id="show-register-button" type="button" class="ghost-button">Stwórz konto</button>
              </div>
              <p id="legacy-login-hint" class="hint hidden"></p>
            </div>
          </div>
        </section>
      </div>
    </section>

    <section id="register-section" class="panel hidden">
      <div class="auth-card register-card">
        <div class="register-header">
          <h3>Załóż konto</h3>
          <button id="back-to-login" type="button" class="link-button">Wróć do logowania</button>
        </div>
        <form id="register-form" class="form">
          <div class="register-fields">
            <div class="field-grid register-credentials">
              <label>
                Email
                <input type="email" name="email" autocomplete="email" required>
              </label>
              <label>
                Hasło
                <input type="password" name="password" autocomplete="new-password" required>
              </label>
              <label>
                Powtórz hasło
                <input type="password" name="confirm_password" autocomplete="new-password" required>
              </label>
            </div>

            <div class="field-grid register-company">
              <label>
                Nazwa firmy
                <input type="text" name="company_name" required>
              </label>
              <label>
                Imię i nazwisko właściciela
                <input type="text" name="owner_name" required>
              </label>
              <label>
                Ulica i numer
                <input type="text" name="address_line" required>
              </label>
              <label>
                Kod pocztowy
                <input type="text" name="postal_code" required>
              </label>
              <label>
                Miejscowość
                <input type="text" name="city" required>
              </label>
              <label>
                NIP
                <input type="text" name="tax_id" required>
              </label>
              <label>
                Numer konta bankowego
                <input type="text" name="bank_account" required>
              </label>
            </div>
          </div>
          <div class="form-actions">
            <button type="submit">Utwórz konto</button>
            <button id="cancel-register" type="button" class="link-button">Anuluj</button>
          </div>
        </form>
        <p id="register-feedback" class="feedback"></p>
        <p class="hint">Wskazowka: dane firmy zaktualizujesz pozniej w sekcji "Dane sprzedawcy".</p>
      </div>
    </section>

    <section id="app-section" class="panel hidden">
      <header class="app-header">
        <div>
          <h2>Panel faktur</h2>
        </div>
        <div id="login-badge" class="login-badge hidden" aria-live="polite">
          <span class="badge-label">Zalogowany jako</span>
          <span id="current-login-label" class="badge-value"></span>
        </div>
        <nav class="app-nav">
          <button type="button" class="app-nav-button active" data-view="invoice-builder">Nowa faktura</button>
          <button type="button" class="app-nav-button" data-view="dashboard">Dashboard</button>
        </nav>
        <button id="logout-button" type="button" class="link-button">Wyloguj</button>
      </header>

      <section id="invoice-builder-section" class="app-view">
        <section class="business-section">
          <div class="business-section-header">
            <h3>Dane sprzedawcy</h3>
            <div class="business-actions">
              <button id="toggle-business-form" type="button" class="pill-button">Edycja danych</button>
              <label for="logo-input" class="pill-button secondary">
                <input id="logo-input" type="file" accept="image/png,image/jpeg" hidden>
                Wgraj logo
              </label>
              <button id="remove-logo-button" type="button" class="pill-button danger hidden">Usuń logo</button>
            </div>
          </div>
          <div id="business-display" class="business-display"></div>
          <div id="logo-preview" class="logo-preview hidden">
            <span class="logo-preview-label">Logo sprzedawcy</span>
            <img id="logo-preview-image" alt="Logo firmy">
          </div>
          <p id="logo-feedback" class="feedback"></p>
          <form id="business-form" class="form hidden">
            <div class="field-grid">
              <label>
                Nazwa firmy
                <input type="text" name="company_name" required>
              </label>
              <label>
                Imię i nazwisko właściciela
                <input type="text" name="owner_name" required>
              </label>
              <label>
                Ulica i numer
                <input type="text" name="address_line" required>
              </label>
              <label>
                Kod pocztowy
                <input type="text" name="postal_code" required>
              </label>
              <label>
                Miejscowość
                <input type="text" name="city" required>
              </label>
              <label>
                NIP
                <input type="text" name="tax_id" required>
              </label>
              <label>
                Numer konta bankowego
                <input type="text" name="bank_account" required>
              </label>
            </div>
            <div class="form-actions">
              <button type="submit">Zapisz</button>
              <button id="cancel-business-update" type="button" class="link-button">Anuluj</button>
            </div>
            <p id="business-feedback" class="feedback"></p>
          </form>
        </section>

        <form id="invoice-form" class="form">
          <fieldset>
            <legend>Informacje o fakturze</legend>
            <div class="field-grid">
              <label>
                Data sprzedaży / wykonania usługi
                <input type="date" name="saleDate">
              </label>
              <label>
                Termin płatności (dni)
                <input type="number" name="paymentTerm" min="1" step="1" value="14">
              </label>
            </div>
          </fieldset>

        <fieldset>
          <legend>Dane nabywcy</legend>
          <div class="client-lookup">
            <label for="client-search">
              Szybkie wyszukiwanie nabywcy
              <input type="text" id="client-search" placeholder="Wpisz NIP lub nazwę klienta">
            </label>
            <div id="client-suggestions" class="client-suggestions hidden" role="listbox"></div>
          </div>
          <div class="field-grid">
            <label>
              Nazwa / Imię i nazwisko
              <input type="text" name="clientName">
            </label>
              <label>
                NIP
                <input type="text" name="clientTaxId">
              </label>
              <label>
                Ulica i numer
                <input type="text" name="clientAddress">
              </label>
              <label>
                Kod pocztowy
                <input type="text" name="clientPostalCode">
              </label>
              <label>
                Miejscowość
                <input type="text" name="clientCity">
              </label>
              <label>
                Numer telefonu
                <input type="tel" name="clientPhone">
              </label>
            </div>
          </fieldset>

          <section class="items-section">
            <header class="items-header">
              <h3>Pozycje faktury</h3>
              <button type="button" id="add-item-button">Dodaj pozycję</button>
            </header>
            <div class="items-table-wrapper">
              <table class="items-table">
                <thead>
                  <tr>
                    <th>Nazwa towaru/usługi</th>
                    <th>Ilość</th>
                    <th>Jednostka</th>
                    <th>Cena jedn. brutto (PLN)</th>
                    <th>Stawka VAT</th>
                    <th>Wartość brutto (PLN)</th>
                    <th></th>
                  </tr>
                </thead>
                <tbody id="items-body"></tbody>
              </table>
            </div>
          </section>

          <div id="totals-container" class="totals">
            <span id="total-net">Suma netto: 0.00 PLN</span>
            <span id="total-vat">Kwota VAT: 0.00 PLN</span>
            <span id="total-gross">Suma brutto: 0.00 PLN</span>
          </div>

          <section id="rate-summary" class="rate-summary"></section>

          <div id="exemption-note-wrapper" class="hidden">
            <label for="exemption-reason">Powód zastosowania stawki ZW/0%</label>
            <select id="exemption-reason" class="form-select">
              <option value="">Wybierz podstawę zwolnienia...</option>
            </select>
            <label for="exemption-note" id="exemption-note-label">Podstawa prawna zwolnienia</label>
            <textarea id="exemption-note" rows="3" placeholder="np. Art. 43 ust. 1 pkt 19 ustawy o VAT"></textarea>
          </div>

          <div class="form-actions">
            <button type="submit" id="save-invoice-button">Generuj fakturę</button>
            <button id="cancel-edit-invoice" type="button" class="link-button hidden">Anuluj edycję</button>
          </div>
        </form>

        <section id="invoice-result" class="panel hidden">
          <h3>Podgląd faktury</h3>
          <div id="invoice-output" class="invoice-preview"></div>
          <button id="download-button" type="button">Pobierz jako plik PDF</button>
        </section>
      </section>

      <section id="dashboard-section" class="app-view hidden">
        <header class="dashboard-header">
          <div class="filters">
            <label>
              Od
              <input type="date" id="filter-start-date">
            </label>
            <label>
              Do
              <input type="date" id="filter-end-date">
            </label>
            <button type="button" id="clear-filters" class="button secondary">Wyczyść</button>
          </div>
          <p id="dashboard-feedback" class="feedback"></p>
        </header>

        <section class="dashboard-summary">
          <div class="summary-card">
            <span class="summary-label">Ostatnie 30 dni</span>
            <span id="summary-month-count" class="summary-count">0 faktur</span>
            <span id="summary-month-amount" class="summary-amount">0.00 PLN</span>
          </div>
          <div class="summary-card">
            <span class="summary-label">Bieżący kwartał</span>
            <span id="summary-quarter-count" class="summary-count">0 faktur</span>
            <span id="summary-quarter-amount" class="summary-amount">0.00 PLN</span>
          </div>
          <div class="summary-card">
            <span class="summary-label">Bieżący rok</span>
            <span id="summary-year-count" class="summary-count">0 faktur</span>
            <span id="summary-year-amount" class="summary-amount">0.00 PLN</span>
          </div>
        </section>

        <section class="dashboard-chart">
          <canvas id="invoices-chart" aria-label="Podsumowanie faktur"></canvas>
        </section>

        <section class="dashboard-table">
          <div class="items-table-wrapper">
            <table class="items-table">
              <thead>
                <tr>
                  <th>Numer</th>
                  <th>Data wystawienia</th>
                  <th>Nabywca</th>
                  <th>Suma brutto</th>
                  <th>Akcje</th>
                </tr>
              </thead>
              <tbody id="invoices-table-body"></tbody>
            </table>
            <p id="invoices-empty" class="hint hidden">Brak faktur do wyświetlenia.</p>
          </div>
        </section>
      </section>
    </section>
  </main>

  <script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.1/jspdf.umd.min.js" defer></script>
  <script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.6/dist/chart.umd.min.js" defer></script>
  <script src="main.js" defer></script>
</body>
</html>