node-red-contrib-afya-ksef 1.1.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -10,6 +10,9 @@ Log in with a **KSeF token** or a **KSeF certificate** (`.crt` + `.key`). No dep
10
10
 
11
11
  **[English](#english) · [Polski](#polski)** · part of [dobry.doctor](https://dobry.doctor/)
12
12
 
13
+ ![Invoice page – fictional data](https://raw.githubusercontent.com/mchuc/node-red-contrib-afya-ksef/main/docs/page.png)
14
+
15
+
13
16
  ---
14
17
 
15
18
  ## English
@@ -22,10 +25,12 @@ Log in with a **KSeF token** or a **KSeF certificate** (`.crt` + `.key`). No dep
22
25
  Example SMS (Polish, as it goes to Polish users):
23
26
 
24
27
  ```
25
- Przychód 1 234,50 zł netto – Firma Pacjenta S.A., FV FV/12/11/2026, KSeF 5265877635-20261103-0100000000AA-01
26
- Koszt 5 068,22 zł – Hurtownia Medyczna Sp. z o.o., termin 16.11.2026, FV HM/77/2026, KSeF 3225081610-20261102-0200000000CC-03
28
+ Przychód 1 234,50 zł netto – Firma Pacjenta S.A., FV FV/12/11/2026, KSeF 1111111111-20261103-0100000000AA-01
29
+ Koszt 5 068,22 zł – Hurtownia Medyczna Sp. z o.o., termin 16.11.2026, FV HM/77/2026, KSeF 5555555555-20261102-0200000000CC-03
27
30
  ```
28
31
 
32
+ **Flow library:** [`library/flow.json`](library/flow.json) – afya-week-calendar every 2 h (8–20) → KSeF → revenue and cost SMS → HTTP SMS gateway ([description](library/README.md)).
33
+
29
34
  ### Install
30
35
 
31
36
  Requires Node.js ≥ 18.17 and Node-RED ≥ 3.
@@ -93,22 +98,34 @@ With *Show a web page* the node serves `http://<node-red>:1880/afya/ksef` (under
93
98
  * two tables like a journal – **Przychody** (sales) and **Koszty** (purchases): issue date, **due date**,
94
99
  invoice number, counterparty with NIP (purchases: also the **bank account** with *kopiuj*), **KSeF number** with
95
100
  a *kopiuj* (copy) button, amounts and a total row; **sort by issue date or by due date**,
96
- * **☐ / ☑** in every row – costs: *paid*, revenue: *received*; tick it on the page, it is saved in Node-RED (separate
97
- file, survives restarts); invoices marked as paid in their XML are ticked for good. Paid transfer cards move below a
98
- line, so only the unpaid ones stay on top,
101
+ * a **round tick** in every row – costs: *paid*, revenue: *received*; click it on the page, it is saved in Node-RED
102
+ (separate file, survives restarts), click again to undo; invoices marked as paid in their XML are ticked for good.
103
+ Paid costs and received revenue fold under a **Zapłacone / Otrzymane** bar in the tables and under a
104
+ **Pokaż zapłacone** button in the transfer list – only what is still open stays in view; the *Data wyst.* and
105
+ *Termin* headers sort,
106
+ * **unreceived revenue from earlier months** stays at the very top (*Nieotrzymane z poprzednich miesięcy*) until you
107
+ tick it as received,
108
+ * **settlement on the invoice** (`Rozliczenie` – e.g. an instalment for a phone, housing-community charges): the amount
109
+ to pay is the invoice's *DoZaplaty*, not its gross value – the transfer card says *Do zapłaty* with
110
+ "faktura … + obciążenia … = …", the table shows a *do zapłaty* badge, the SMS says it. In the tiles *paid / to pay*
111
+ are transfers (with the settlement), while **costs and operating profit stay at the invoice value** – a lease
112
+ invoice for 90,08 zł interest with a 3 221,52 zł capital instalment is a 90,08 zł cost and a 3 311,60 zł transfer;
113
+ an overpayment (*DoRozliczenia*) means nothing to pay,
99
114
  * **PDF** and **XML** for every invoice: *PDF* opens a readable invoice (parties, items, VAT summary, settlement,
100
115
  payment, notes, attachment, KSeF verification link) with *Save PDF / print*; amounts in payment notes are
101
116
  highlighted. *XML* shows / downloads the KSeF file. Downloaded XML is **cached for 30 days**,
102
117
  * **⚠ different amount in the notes** – when a note on the invoice (additional description, payment description,
103
118
  attachment) mentions an amount to pay that is not the invoice amount, the row and the transfer card warn you,
104
- * **Do przelewu** under the costs: recipient, **bank account**, **amount**, **title** (invoice number), each with a
119
+ * **Do przelewu** under the costs – big cards, 2 per row: issue date, a **big due date** with a badge (red **PO TERMINIE ·
120
+ N days**, *pay today*, *tomorrow*, *in N days*, *paid*), then amount, title, KSeF number and account. Ticking paid
121
+ happens in place – the card turns grey, nothing reloads or jumps; each card lists the recipient, **bank account**, **amount**, **title** (invoice number), each with a
105
122
  *kopiuj* button; due date (overdue in red), paid invoices dimmed, split payment (MPP) with the VAT amount,
106
123
  factor account, payment link; a wrong account checksum is flagged,
107
124
  * clicking an amount in the tables copies it as `1518.44` (or `1518,44`),
108
125
  * arrows switch between the stored months (up to 13), badges for new invoices (last 48 h) and corrections,
109
126
  * works on a phone and in dark mode, refreshes itself every 15 minutes.
110
127
 
111
- Copying works over plain `http://` in the local network too (where the browser blocks the clipboard API).
128
+ Copying works over plain `http://` in the local network too (where the browser blocks the clipboard API). At the bottom: the dobry.doctor logo and link and the author's ORCID iD.
112
129
 
113
130
  Access – exactly like the Librus page: a **password** (login form, `HttpOnly` cookie for 30 days, changing the
114
131
  password logs everyone out) and/or an **access token** (`…/afya/ksef?token=…`, no login – keep the link like a
@@ -124,7 +141,7 @@ Put the page behind HTTPS / VPN when it is reachable from the internet – it sh
124
141
  | `tekstPrzychody`, `tekstKoszty`, `tekst` | ready SMS texts; empty when nothing is new |
125
142
  | `przychody`, `koszty` | this month's journal: `ksef` (KSeF number), `numer` (invoice number), `data`, `otrzymana`, `kontrahent`, `nipKontrahenta`, `netto`, `vat`, `brutto`, `vatPln`, `waluta`, `typ`, `korekta`, `miesiac`; costs also `platnosc` (`konta`, `termin`, `forma`, `zaplacono`, `mpp`, …) |
126
143
  | `sumy` | `{ przychody: { PLN: { ile, netto, vat, brutto } }, koszty: {…}, wynik: {…} }` |
127
- | `rozliczenie` | per currency: `otrzymano`, `czekamy`, `wydano`, `doWydania`, `zyskObecny`, `zyskOczekiwany` (`{ netto, vat, brutto }`) |
144
+ | `rozliczenie` | per currency (`{ netto, vat, brutto }`): `otrzymano`, `czekamy`, `wydano`, `doWydania` – money (transfers, with settlements from the invoices); `przychody`, `koszty`, `zyskObecny`, `zyskOczekiwany` – invoice values; `rozliczenia` (`{ przychody, koszty }`) – what settlements add to the transfers |
128
145
  | `miesiace` | the checked months with their journals and totals |
129
146
  | `firma`, `nip`, `miesiac`, `srodowisko`, `kwoty`, `typDaty` | context of the check |
130
147
  | `pierwszyOdczyt` | `true` on the very first check – invoices are only remembered |
@@ -211,18 +228,33 @@ ostrzeżenie po 3 godz. bez sprawdzenia), kafle **przychody** (otrzymano / czeka
211
228
  i **zysk operacyjny** – obecny (otrzymano − wydano) i oczekiwany (przychody − koszty), tabele **Przychody** i **Koszty**
212
229
  (data wystawienia, **termin płatności**, numer faktury z linkami **PDF** i **XML**, kontrahent z NIP-em – w kosztach
213
230
  też **konto z przyciskiem kopiuj** – **numer KSeF z przyciskiem kopiuj**, kwoty, wiersz „Razem”), **sortowanie po dacie
214
- wystawienia albo terminie płatności**, **odhaczanie ☐/☑** – koszty „zapłacona”, przychody „otrzymana” (zapisywane
231
+ wystawienia albo terminie płatności** (też klikając nagłówki „Data wyst.” / „Termin”), **odhaczanie kółkiem** – koszty „zapłacona”, przychody „otrzymana” (zapisywane
215
232
  w Node-RED) i pod nimi
216
233
  **Do przelewu**: odbiorca, **konto**, **kwota**, **tytuł**, **numer KSeF** (także „tytuł + nr KSeF”) – wszystko z przyciskiem
217
- *kopiuj*; zapłacone zjeżdżają pod kreskę; termin (po terminie na
234
+ *kopiuj*; karty po 2 w rzędzie z dużym terminem płatności i znaczkiem (czerwone **PO TERMINIE · N dni**, „zapłać dziś”,
235
+ „jutro”, „za N dni”); odhaczenie działa w miejscu – karta szarzeje, strona się nie przeładowuje; zapłacone zjeżdżają pod
236
+ kreskę przy następnym otwarciu; termin (po terminie na
218
237
  czerwono), zapłacone wyszarzone, split payment z kwotą VAT, konto faktora. Kliknięcie kwoty w tabeli kopiuje ją jako
219
238
  `1518.44`. Kopiowanie działa też przez zwykłe `http://` w sieci lokalnej. Strzałki – poprzednie miesiące (do 13).
239
+ Zapłacone koszty i otrzymane przychody chowają się pod paskiem **Zapłacone / Otrzymane** (w tabelach) i pod przyciskiem
240
+ **Pokaż zapłacone** (w przelewach) – na wierzchu zostaje tylko to, co otwarte. **Nieotrzymane przychody z poprzednich
241
+ miesięcy** są na samej górze strony, dopóki nie odhaczysz ich jako otrzymanych.
242
+
243
+ **Rozliczenie na fakturze** (`Rozliczenie` – np. rata za telefon, opłaty wspólnoty): do przelewu idzie kwota
244
+ **do zapłaty** z faktury, a nie samo brutto – karta pokazuje „faktura … + obciążenia … = …”, w tabeli jest znaczek
245
+ „do zapłaty”, SMS też to mówi. W kaflach „wydano / do wydania” to przelewy (z rozliczeniem), a **koszty i zysk
246
+ operacyjny – z wartości faktur**: faktura leasingowa na 90,08 zł odsetek z ratą kapitałową 3 221,52 zł to 90,08 zł
247
+ kosztu i 3 311,60 zł przelewu. Nadpłata „do rozliczenia” = nic do zapłaty.
248
+
249
+ Na dole strony: logo i link dobry.doctor oraz ORCID autora.
220
250
 
221
251
  **PDF** otwiera czytelną fakturę (strony, pozycje, VAT, rozliczenie, płatność, **uwagi i załącznik**, link weryfikacyjny
222
252
  KSeF) z przyciskiem *Zapisz PDF / drukuj*; kwoty w uwagach o płatności są podświetlone, a gdy w opisie jest **inna kwota
223
253
  niż na fakturze** – ostrzeżenie ⚠ w tabeli, w karcie przelewu i w SMS-ie. **XML** pokazuje / pobiera plik z KSeF.
224
254
  Pobrany XML jest trzymany **30 dni** (`~/.node-red/afya-ksef/<id-węzła>-xml/`), potem pobierany od nowa.
225
255
 
256
+ ![Transfer cards – fictional data](https://raw.githubusercontent.com/mchuc/node-red-contrib-afya-ksef/main/docs/transfers.png)
257
+
226
258
  Dostęp jak w Librusie: **hasło** (logowanie na 30 dni) i/lub **token** w linku `?token=…`; bez nich strona jest
227
259
  wyłączona, 10 błędnych prób w 15 minut blokuje adres na chwilę. Wystawiając stronę do internetu – tylko przez HTTPS / VPN.
228
260
 
@@ -232,6 +264,8 @@ wyłączona, 10 błędnych prób w 15 minut blokuje adres na chwilę. Wystawiaj
232
264
  osobnymi SMS-ami (przychody do właściciela, koszty do właściciela i księgowej), bramka SMS po HTTP z tokenem
233
265
  w nagłówku, cały wynik do MQTT `afya/ksef/dane`. Pierwsze sprawdzenie tylko zapamiętuje faktury.
234
266
 
267
+ Biblioteka przepływów Node-RED: [`library/flow.json`](library/flow.json) – harmonogram afya-week-calendar co 2 h (8–20) → KSeF → SMS o przychodzie i koszcie → bramka SMS po HTTP ([opis](library/README.md)).
268
+
235
269
  ### Testy
236
270
 
237
271
  `npm install && npm test` – testy na atrapie KSeF, która sprawdza szyfrowanie tokenu, podpis XAdES (RSA i EC),
package/afya-ksef.html CHANGED
@@ -62,7 +62,7 @@
62
62
  en: {
63
63
  name: 'Name', namePh: 'e.g. KSeF – clinic', lang: 'Labels', langAuto: 'system language ({l})',
64
64
  secAccount: 'KSeF account', env: 'Environment', envProd: 'Production (real invoices)',
65
- envDemo: 'Demo (pre-production)', envTest: 'Test', nip: 'Company NIP', nipPh: '10 digits, e.g. 5265877635',
65
+ envDemo: 'Demo (pre-production)', envTest: 'Test', nip: 'Company NIP', nipPh: '10 digits, e.g. 1111111111',
66
66
  method: 'Log in with', methodToken: 'KSeF token', methodCert: 'KSeF certificate (.crt + .key)',
67
67
  token: 'KSeF token', tokenHint: 'Generate it in <i>Aplikacja Podatnika KSeF</i> → <i>Tokeny</i>; reading invoices needs only ' +
68
68
  'the permission <b>przeglądanie faktur</b> (<code>InvoiceRead</code>).',
@@ -116,7 +116,7 @@
116
116
  pl: {
117
117
  name: 'Nazwa', namePh: 'np. KSeF – przychodnia', lang: 'Etykiety', langAuto: 'język systemu ({l})',
118
118
  secAccount: 'Konto KSeF', env: 'Środowisko', envProd: 'Produkcyjne (prawdziwe faktury)',
119
- envDemo: 'Demo (przedprodukcyjne)', envTest: 'Testowe', nip: 'NIP firmy', nipPh: '10 cyfr, np. 5265877635',
119
+ envDemo: 'Demo (przedprodukcyjne)', envTest: 'Testowe', nip: 'NIP firmy', nipPh: '10 cyfr, np. 1111111111',
120
120
  method: 'Logowanie', methodToken: 'token KSeF', methodCert: 'certyfikat KSeF (.crt + .key)',
121
121
  token: 'Token KSeF', tokenHint: 'Wygeneruj go w <i>Aplikacji Podatnika KSeF</i> → <i>Tokeny</i>; do odczytu faktur wystarczy ' +
122
122
  'uprawnienie <b>przeglądanie faktur</b> (<code>InvoiceRead</code>).',
@@ -483,7 +483,7 @@
483
483
  </div>
484
484
  <div class="form-row">
485
485
  <label for="node-input-nip"><i class="fa fa-building"></i> <span data-t="nip">Company NIP</span></label>
486
- <input type="text" id="node-input-nip" data-t-ph="nipPh" placeholder="10 digits, e.g. 5265877635" autocomplete="off" style="width: 65%;">
486
+ <input type="text" id="node-input-nip" data-t-ph="nipPh" placeholder="10 digits, e.g. 1111111111" autocomplete="off" style="width: 65%;">
487
487
  </div>
488
488
  <div class="form-row">
489
489
  <label for="node-input-metoda"><i class="fa fa-sign-in"></i> <span data-t="method">Log in with</span></label>
@@ -718,7 +718,7 @@
718
718
  <p>With <i>Show a web page</i> the node serves <code>http://&lt;node-red&gt;:1880/&lt;page path&gt;</code>
719
719
  (under <code>httpNodeRoot</code>): totals of revenue, costs and the result, and two tables like a journal –
720
720
  date, invoice number, counterparty with NIP, the <b>KSeF number</b> and amounts (net, gross or both) with a
721
- total row. Each row also has the <b>due date</b> (sort by issue date or due date), a <b>☐ / ☑ paid</b> tick
721
+ total row. Each row also has the <b>due date</b> (sort by issue date or due date), a round <b>paid</b> tick (paid ones fold away)
722
722
  (saved in Node-RED) and links <b>PDF</b> (readable invoice – <i>Save PDF / print</i>; notes and attachment
723
723
  included, amounts in notes highlighted) and <b>XML</b>. Downloaded XML is cached for 30 days. Purchase rows show
724
724
  the bank account under the seller. Under the costs, <b>Do przelewu</b> lists each purchase invoice with the recipient, bank account,
@@ -745,7 +745,7 @@
745
745
  <p><b>Strona z fakturami</b> – dwie tabele jak w dzienniku (przychody i koszty) z numerami KSeF, sumami
746
746
  i wynikiem miesiąca, a pod kosztami <b>Do przelewu</b>: odbiorca, konto, kwota (brutto albo netto, z kropką
747
747
  albo przecinkiem) i tytuł – wszystko z przyciskiem <i>kopiuj</i>. W tabelach: data wystawienia i <b>termin
748
- płatności</b> (sortowanie po jednym albo drugim), <b>odhaczanie ☐/☑ zapłaconych</b>, konto pod sprzedawcą,
748
+ płatności</b> (sortowanie po jednym albo drugim), <b>odhaczanie zapłaconych kółkiem</b> (zapłacone się zwijają), konto pod sprzedawcą,
749
749
  linki <b>PDF</b> (czytelna faktura z uwagami i załącznikiem – zapisz jako PDF) i <b>XML</b> (cache 30 dni).
750
750
  Gdy w opisie faktury jest inna kwota niż na fakturze – ostrzeżenie ⚠. Dostęp po haśle albo z linku z tokenem.</p>
751
751
 
package/change.log CHANGED
@@ -1,3 +1,25 @@
1
+ 1.2.1 (2026-11-30):
2
+ - Page footer: dobry.doctor logo and link, author's ORCID iD (inline SVG, light and dark theme, hidden when printing)
3
+ - Invoices with a settlement (Fa/Rozliczenie – instalments, housing-community charges): transfer amount = DoZaplaty
4
+ (netto mode: DoZaplaty − VAT), card "Do zapłaty" with "faktura + obciążenia = …", "do zapłaty" badge in the table,
5
+ paid / to pay in the tiles are transfers (with the settlement), costs and operating profit stay at invoice value
6
+ (lease: 90,08 interest = cost, 3 311,60 = transfer); SMS %platnosc% says it; DoRozliczenia = nothing to pay
7
+ - Seller's footer about payment (e.g. "pay the amount from the visualisation") shown in the transfer card; share-capital
8
+ boilerplate ("kapitał zakładowy … wpłacony") is not treated as a payment note
9
+ - Unreceived revenue from earlier months at the top of the page until ticked as received
10
+ - Paid costs / received revenue folded under a bar in the tables and under a "Pokaż zapłacone" button in the transfers;
11
+ "Data wyst." and "Termin" headers sort
12
+ - Bigger round ticks instead of ☐ / ☑; card button "Oznacz jako zapłaconą" / "Zapłacona · cofnij"
13
+ - Example data anonymised (tests, help, examples); flow for the Node-RED flow library (library/) and README screenshots
14
+ with fictional data (docs/)
15
+
16
+ 1.2.0 (2026-11-30):
17
+ - Ticking paid / received no longer reloads the page: the row and the card turn grey and the button is ticked in place,
18
+ tiles and "to pay" sum update at once (fetch + JSON; plain form still works without JavaScript)
19
+ - Transfer cards redesigned: 2 per row and bigger; issue date, a big due date and a clear badge – red PO TERMINIE
20
+ (with days), PAY TODAY, tomorrow, in N days, paid; then amount, title (+ KSeF number), KSeF number and account
21
+ - Page uses the full width of the screen
22
+
1
23
  1.1.0 (2026-11-30):
2
24
  - Page: due date column and sorting by issue date or due date; bank account (with copy) under the seller in the costs table
3
25
  - Page: ☐ / ☑ "paid" tick in every row and in the transfer cards – saved in Node-RED (separate file), in payload as zaplacona
@@ -0,0 +1,385 @@
1
+ [
2
+ {
3
+ "id": "cab88d994496e129",
4
+ "type": "comment",
5
+ "name": "KSeF co 2 h z kalendarza AFYA → SMS · przychody i koszty osobno · przeczytaj mnie",
6
+ "info": "## KSeF → SMS: przychody i koszty osobno\n\nWęzeł **KSeF – przychodnia** sprawdza co 2 godziny faktury z KSeF bieżącego i poprzedniego miesiąca:\nsprzedaż = **przychody**, zakupy = **koszty**. Nowa faktura sprzedaży i nowa faktura zakupu idą **osobnymi SMS-ami**\n(`payload.tekstPrzychody` i `payload.tekstKoszty`), każdy według własnego szablonu – z numerem faktury i numerem KSeF.\n\n* **pytaj KSeF co 2 h** – kalendarz AFYA (node-red-contrib-afya-week-calendar ≥ 0.3.0): ON codziennie 8:00–20:00, *Ustawienia → Tik* co 2 h – 2. wyjście „puka” do KSeF o 8:00, 10:00 … 18:00, także po restarcie w środku dnia. Godziny malujesz na tygodniu. Przycisk po lewej stronie kalendarza pyta KSeF od razu. KSeF pozwala na 20 zapytań o faktury na godzinę (jedno sprawdzenie to 4 zapytania), więc co 2 h jest bezpiecznie,\n* **nowy przychód? / nowy koszt?** – przepuszczają tylko niepusty tekst, więc SMS idzie tylko gdy coś nowego,\n* **SMS przychód / SMS koszt** – w `msg.payload` zostaje sam tekst,\n* **Właściciel, Księgowa** – jedna funkcja = jeden numer; np. przychody do właściciela, koszty do obu,\n* **bramka SMS** – zapytanie HTTP z tokenem w nagłówku `X-SMS-Token`,\n* **afya/ksef/dane** – cały wynik do MQTT (retain), np. dla Home Assistanta.\n\n## Do ustawienia\n\n1. W węźle **KSeF – przychodnia**: NIP firmy i **token KSeF** (Aplikacja Podatnika KSeF → Tokeny, uprawnienie\n *przeglądanie faktur*) albo **certyfikat KSeF** (pliki `.crt` i `.key` + hasło klucza). Hasło lub token strony z fakturami.\n2. Numery w funkcjach **Właściciel** i **Księgowa** oraz adres bramki (`BRAMKA`).\n3. Token w węźle **bramka SMS** (nagłówek `X-SMS-Token`) – albo nagłówki, jakich wymaga Twoja bramka.\n4. Adres brokera w węźle MQTT.\n5. Kliknij **test SMS (msg.test)** – przyjdzie najnowsza faktura sprzedaży i zakupu.\n\nPierwsze sprawdzenie po wdrożeniu tylko zapamiętuje faktury – SMS-y przychodzą od drugiego.\nStrona z fakturami (dwie tabele + **Do przelewu** z kontami do skopiowania): `http://<node-red>:1880/afya/ksef`.",
7
+ "x": 250,
8
+ "y": 40,
9
+ "wires": []
10
+ },
11
+ {
12
+ "id": "ca1e0da70c5e0001",
13
+ "type": "afya-week-calendar",
14
+ "name": "pytaj KSeF co 2 h",
15
+ "schedule": [
16
+ [
17
+ [
18
+ 480,
19
+ 1200,
20
+ 1
21
+ ]
22
+ ],
23
+ [
24
+ [
25
+ 480,
26
+ 1200,
27
+ 1
28
+ ]
29
+ ],
30
+ [
31
+ [
32
+ 480,
33
+ 1200,
34
+ 1
35
+ ]
36
+ ],
37
+ [
38
+ [
39
+ 480,
40
+ 1200,
41
+ 1
42
+ ]
43
+ ],
44
+ [
45
+ [
46
+ 480,
47
+ 1200,
48
+ 1
49
+ ]
50
+ ],
51
+ [
52
+ [
53
+ 480,
54
+ 1200,
55
+ 1
56
+ ]
57
+ ],
58
+ [
59
+ [
60
+ 480,
61
+ 1200,
62
+ 1
63
+ ]
64
+ ]
65
+ ],
66
+ "snap": 15,
67
+ "states": [
68
+ {
69
+ "name": "OFF",
70
+ "value": "",
71
+ "vt": "num"
72
+ },
73
+ {
74
+ "name": "ON",
75
+ "value": "",
76
+ "vt": "num"
77
+ }
78
+ ],
79
+ "timezone": "",
80
+ "randomize": 0,
81
+ "periodMode": "always",
82
+ "periods": [],
83
+ "outputType": "bool",
84
+ "topic": "",
85
+ "sendOnStart": true,
86
+ "tick": true,
87
+ "tickEvery": 2,
88
+ "tickUnit": "h",
89
+ "outputs": 2,
90
+ "lang": "auto",
91
+ "variableName": "",
92
+ "scope": "global",
93
+ "x": 160,
94
+ "y": 120,
95
+ "wires": [
96
+ [],
97
+ [
98
+ "ca43d38e2bc2f49a"
99
+ ]
100
+ ]
101
+ },
102
+ {
103
+ "id": "ca1aa0c48e83fd9e",
104
+ "type": "inject",
105
+ "name": "test SMS (msg.test)",
106
+ "props": [
107
+ {
108
+ "p": "test",
109
+ "v": "true",
110
+ "vt": "bool"
111
+ }
112
+ ],
113
+ "repeat": "",
114
+ "crontab": "",
115
+ "once": false,
116
+ "onceDelay": 0.1,
117
+ "topic": "",
118
+ "x": 160,
119
+ "y": 170,
120
+ "wires": [
121
+ [
122
+ "ca43d38e2bc2f49a"
123
+ ]
124
+ ]
125
+ },
126
+ {
127
+ "id": "ca43d38e2bc2f49a",
128
+ "type": "afya-ksef",
129
+ "name": "KSeF – przychodnia",
130
+ "lang": "auto",
131
+ "srodowisko": "prod",
132
+ "nip": "",
133
+ "metoda": "token",
134
+ "identyfikator": "certificateSubject",
135
+ "nazwaCert": "",
136
+ "nazwaKlucza": "",
137
+ "kwoty": "brutto",
138
+ "typDaty": "Issue",
139
+ "poprzedni": true,
140
+ "przychody": true,
141
+ "szablonPrzychody": "",
142
+ "koszty": true,
143
+ "szablonKoszty": "Koszt %przelew% – %kontrahent%, termin %termin%, FV %numer%, KSeF %ksef%",
144
+ "zSuma": false,
145
+ "bezPl": false,
146
+ "przelewy": true,
147
+ "kwotaPrzelewu": "brutto",
148
+ "separator": ".",
149
+ "variableName": "ksef",
150
+ "scope": "global",
151
+ "strona": true,
152
+ "tytulStrony": "",
153
+ "sciezka": "afya/ksef",
154
+ "x": 400,
155
+ "y": 140,
156
+ "wires": [
157
+ [
158
+ "cabe77a9861d5685",
159
+ "caa38f69675b8a93",
160
+ "ca2b78b655859dec"
161
+ ]
162
+ ]
163
+ },
164
+ {
165
+ "id": "cabe77a9861d5685",
166
+ "type": "switch",
167
+ "name": "nowy przychód?",
168
+ "property": "payload.tekstPrzychody",
169
+ "propertyType": "msg",
170
+ "rules": [
171
+ {
172
+ "t": "nempty"
173
+ }
174
+ ],
175
+ "checkall": "true",
176
+ "repair": false,
177
+ "outputs": 1,
178
+ "x": 640,
179
+ "y": 100,
180
+ "wires": [
181
+ [
182
+ "ca66672633ec0dcc"
183
+ ]
184
+ ]
185
+ },
186
+ {
187
+ "id": "ca66672633ec0dcc",
188
+ "type": "change",
189
+ "name": "SMS przychód",
190
+ "rules": [
191
+ {
192
+ "t": "set",
193
+ "p": "payload",
194
+ "pt": "msg",
195
+ "to": "payload.tekstPrzychody",
196
+ "tot": "msg"
197
+ }
198
+ ],
199
+ "action": "",
200
+ "property": "",
201
+ "from": "",
202
+ "to": "",
203
+ "reg": false,
204
+ "x": 830,
205
+ "y": 100,
206
+ "wires": [
207
+ [
208
+ "ca08503a9c81cc25"
209
+ ]
210
+ ]
211
+ },
212
+ {
213
+ "id": "caa38f69675b8a93",
214
+ "type": "switch",
215
+ "name": "nowy koszt?",
216
+ "property": "payload.tekstKoszty",
217
+ "propertyType": "msg",
218
+ "rules": [
219
+ {
220
+ "t": "nempty"
221
+ }
222
+ ],
223
+ "checkall": "true",
224
+ "repair": false,
225
+ "outputs": 1,
226
+ "x": 630,
227
+ "y": 160,
228
+ "wires": [
229
+ [
230
+ "ca9c0862e17cd951"
231
+ ]
232
+ ]
233
+ },
234
+ {
235
+ "id": "ca9c0862e17cd951",
236
+ "type": "change",
237
+ "name": "SMS koszt",
238
+ "rules": [
239
+ {
240
+ "t": "set",
241
+ "p": "payload",
242
+ "pt": "msg",
243
+ "to": "payload.tekstKoszty",
244
+ "tot": "msg"
245
+ }
246
+ ],
247
+ "action": "",
248
+ "property": "",
249
+ "from": "",
250
+ "to": "",
251
+ "reg": false,
252
+ "x": 820,
253
+ "y": 160,
254
+ "wires": [
255
+ [
256
+ "ca08503a9c81cc25",
257
+ "cac928c3d7b12165"
258
+ ]
259
+ ]
260
+ },
261
+ {
262
+ "id": "ca08503a9c81cc25",
263
+ "type": "function",
264
+ "name": "Właściciel",
265
+ "func": "// SMS do jednej osoby – tekst przychodzi w msg.payload (z „SMS przychód” albo „SMS koszt”).\nconst NUMER = '48600000001'; // numer odbiorcy: 48 + 9 cyfr\nconst BRAMKA = 'https://bramka-sms.example/send/'; // adres Twojej bramki SMS\nconst tekst = typeof msg.payload === 'string' ? msg.payload : '';\nif (!tekst) return null; // nigdy nie wysyłaj pustego SMS-a\nmsg.method = 'GET';\nmsg.url = BRAMKA + NUMER + '?text=' + encodeURIComponent(tekst);\nreturn msg;",
266
+ "outputs": 1,
267
+ "timeout": 0,
268
+ "noerr": 0,
269
+ "initialize": "",
270
+ "finalize": "",
271
+ "libs": [],
272
+ "x": 1010,
273
+ "y": 100,
274
+ "wires": [
275
+ [
276
+ "caa4f21c6b8044cc"
277
+ ]
278
+ ]
279
+ },
280
+ {
281
+ "id": "cac928c3d7b12165",
282
+ "type": "function",
283
+ "name": "Księgowa",
284
+ "func": "// SMS do jednej osoby – tekst przychodzi w msg.payload (z „SMS przychód” albo „SMS koszt”).\nconst NUMER = '48600000002'; // numer odbiorcy: 48 + 9 cyfr\nconst BRAMKA = 'https://bramka-sms.example/send/'; // adres Twojej bramki SMS\nconst tekst = typeof msg.payload === 'string' ? msg.payload : '';\nif (!tekst) return null; // nigdy nie wysyłaj pustego SMS-a\nmsg.method = 'GET';\nmsg.url = BRAMKA + NUMER + '?text=' + encodeURIComponent(tekst);\nreturn msg;",
285
+ "outputs": 1,
286
+ "timeout": 0,
287
+ "noerr": 0,
288
+ "initialize": "",
289
+ "finalize": "",
290
+ "libs": [],
291
+ "x": 1010,
292
+ "y": 160,
293
+ "wires": [
294
+ [
295
+ "caa4f21c6b8044cc"
296
+ ]
297
+ ]
298
+ },
299
+ {
300
+ "id": "caa4f21c6b8044cc",
301
+ "type": "http request",
302
+ "name": "bramka SMS",
303
+ "method": "GET",
304
+ "ret": "txt",
305
+ "paytoqs": "ignore",
306
+ "url": "",
307
+ "tls": "",
308
+ "persist": false,
309
+ "proxy": "",
310
+ "insecureHTTPParser": false,
311
+ "authType": "",
312
+ "senderr": false,
313
+ "headers": [
314
+ {
315
+ "keyType": "other",
316
+ "keyValue": "X-SMS-Token",
317
+ "valueType": "other",
318
+ "valueValue": "TWOJ_TOKEN"
319
+ }
320
+ ],
321
+ "x": 1190,
322
+ "y": 130,
323
+ "wires": [
324
+ [
325
+ "caa828e17f69b5cd"
326
+ ]
327
+ ]
328
+ },
329
+ {
330
+ "id": "caa828e17f69b5cd",
331
+ "type": "debug",
332
+ "name": "odpowiedź bramki",
333
+ "active": true,
334
+ "tosidebar": true,
335
+ "console": false,
336
+ "tostatus": false,
337
+ "complete": "payload",
338
+ "targetType": "msg",
339
+ "statusVal": "",
340
+ "statusType": "auto",
341
+ "x": 1370,
342
+ "y": 130,
343
+ "wires": []
344
+ },
345
+ {
346
+ "id": "ca2b78b655859dec",
347
+ "type": "mqtt out",
348
+ "name": "afya/ksef/dane",
349
+ "topic": "afya/ksef/dane",
350
+ "qos": "1",
351
+ "retain": "true",
352
+ "respTopic": "",
353
+ "contentType": "",
354
+ "userProps": "",
355
+ "correl": "",
356
+ "expiry": "",
357
+ "broker": "cadb518ce8499698",
358
+ "x": 640,
359
+ "y": 220,
360
+ "wires": []
361
+ },
362
+ {
363
+ "id": "cadb518ce8499698",
364
+ "type": "mqtt-broker",
365
+ "name": "broker MQTT",
366
+ "broker": "cacalhost",
367
+ "port": "1883",
368
+ "clientid": "",
369
+ "autoConnect": true,
370
+ "usetls": false,
371
+ "protocolVersion": "4",
372
+ "keepalive": "60",
373
+ "cleansession": true,
374
+ "autoUnsubscribe": true,
375
+ "birthTopic": "",
376
+ "birthQos": "0",
377
+ "birthPayload": "",
378
+ "closeTopic": "",
379
+ "closeQos": "0",
380
+ "closePayload": "",
381
+ "willTopic": "",
382
+ "willQos": "0",
383
+ "willPayload": ""
384
+ }
385
+ ]
@@ -56,7 +56,7 @@
56
56
  "name": "KSeF – przychodnia",
57
57
  "lang": "auto",
58
58
  "srodowisko": "prod",
59
- "nip": "5265877635",
59
+ "nip": "",
60
60
  "metoda": "token",
61
61
  "identyfikator": "certificateSubject",
62
62
  "nazwaCert": "",