-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmessages.go
616 lines (512 loc) · 32.7 KB
/
messages.go
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
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
package szamlazzhu
// This file contains the structs describing the xml messages sent and received from szamlazz.hu endpoints
// Note: We want to avoid Hungarian names in our source, but we have to make an exception here.
// The szamlazz.hu API use hard-coded hungarian tags in the XML format, which we will blindly follow.
// Empty is a dummy type that we use for passing in tags data reflections. Ideal, because it does not allocate memory
type Empty struct{}
// Message is an alias of empty interface which we use for passing the endpoint descriptor structs
type Message interface{}
// stringContainer is a magic struct that is used to return simple strings in place of XML structures
type stringContainer struct {
s string
}
// Xmlszamla describes the request of creating new invoices
type Xmlszamla struct {
XMLName Empty `xml:"http://www.szamlazz.hu/xmlszamla xmlszamla"`
// Authentication (Username+Password or AgentKey required)
Felhasznalo string `xml:"beallitasok>felhasznalo,omitempty"`
Jelszo string `xml:"beallitasok>jelszo,omitempty"`
SzamlaAgentKulcs string `xml:"beallitasok>szamlaagentkulcs,omitempty"`
ESzamla bool `xml:"beallitasok>eszamla"` // Whether to issue electronically signed invoices
SzamlaLetoltes bool `xml:"beallitasok>szamlaLetoltes"` // Whether to return the created invoice image
SzamlaLetoltesPld int `xml:"beallitasok>szamlaLetoltesPld,omitempty"` // Number of copies to download
ValaszVerzio uint `xml:"beallitasok>valaszVerzio"` // Format of reply. 1: mixed 2: xml-encapsulated
Aggregator string `xml:"beallitasok>aggregator,omitempty"` // Webshop or aggregator type (undocumented)
Guardian bool `xml:"beallitasok>guardian,omitempty"`
Cikkazoninvoice bool `xml:"beallitasok>cikkazoninvoice,omitempty"` // Display item identifiers on invoice (undocumented)
SzamlaKulsoAzon string `xml:"beallitasok>szamlaKulsoAzon,omitempty"` // External reference for query-back
KeltDatum Date `xml:"fejlec>keltDatum,omitempty"` // Date of creation (YYYY-MM-DD)
TeljesitesDatum Date `xml:"fejlec>teljesitesDatum"` // Date of fullfillment (YYYY-MM-DD)
FizetesiHataridoDatum Date `xml:"fejlec>fizetesiHataridoDatum"` // Payment deadline (YYYY-MM-DD)
FizMod string `xml:"fejlec>fizmod"` // Payment type
Penznem string `xml:"fejlec>penznem"` // Currency
SzamlaNyelve string `xml:"fejlec>szamlaNyelve"` // Language (hu/en/de/it/ro/sk/hr)
Megjegyzes string `xml:"fejlec>megjegyzes,omitempty"` // Comment
ArfolyamBank string `xml:"fejlec>arfolyamBank,omitempty"` // Bank of exchange (MNB)
Arfolyam float64 `xml:"fejlec>arfolyam,omitempty"` // Exchange rate (0.0)
RendelesSzam string `xml:"fejlec>rendelesSzam"` // Order number
DijbekeroSzamlaszam string `xml:"fejlec>dijbekeroSzamlaszam,omitempty"` // ID of Proforma invoice
ElolegSzamla bool `xml:"fejlec>elolegszamla,omitempty"` // Is advance invoice?
VegSzamla bool `xml:"fejlec>vegszamla,omitempty"` // Is settlement invoice?
HelyesbitoSzamla bool `xml:"fejlec>helyesbitoszamla,omitempty"` // Is correction invoice?
HelyesbitettSzamlaszam bool `xml:"fejlec>helyesbitettSzamlaszam,omitempty"` // No of invoice corrected
Dijbekero bool `xml:"fejlec>dijbekero,omitempty"` // Is proforma invoice?
Szallitolevel bool `xml:"fejlec>szallitolevel,omitempty"` // Is delivery bill?
LogoExtra string `xml:"fejlec>logoExtra,omitempty"` // Extra information for logo selection (undocumented)
SzamlaszamElotag string `xml:"fejlec>szamlaszamElotag,omitempty"` // Invoice ID prefix
FizetendoKorrekcio float64 `xml:"fejlec>fizetendoKorrekcio,omitempty"` // Correction of total typically due to rounding of cash (undocumented)
Fizetve bool `xml:"fejlec>fizetve,omitempty"` // Invoice has been paid?
ArresAfa bool `xml:"fejlec>arresAfa,omitempty"` // VAT calculation based on margin
EUsAfa bool `xml:"fejlec>eusAfa,omitempty"` // Indicate no no hungarian VAT on the receipt. Data disclosure towards NTCAs Online Invoice System is not needed.
SzamlaSablon string `xml:"fejlec>szamlaSablon,omitempty"` // Invoice format (SzlaMost/SzlaAlap/SzlaNoEnv/Szla8cm/SzlaTomb)
Elonezetpdf bool `xml:"fejlec>elonezetpdf,omitempty"` // Generate preview PDF instead of issuance?
Bank string `xml:"elado>bank,omitempty"` // Merchant Bank Name
BankszamlaSzam string `xml:"elado>bankszamlaszam,omitempty"` // Merchant Bank Account
EmailReplyTo string `xml:"elado>emailReplyto,omitempty"` // Reply-to header for notification e-mails
EmailTargy string `xml:"elado>emailTargy,omitempty"` // Subject header for notification e-mails
EmailSzoveg string `xml:"elado>emailSzoveg,omitempty"` // Content text of notification e-mails
AlairoNeve string `xml:"elado>alairoNeve,omitempty"` // Name of signer at seller (undocumented)
VevoNev string `xml:"vevo>nev"` // Customer name
VevoOrszag string `xml:"vevo>orszag,omitempty"` // Customer country
VevoIrsz string `xml:"vevo>irsz"` // Customer address zip code
VevoTelepules string `xml:"vevo>telepules"` // Customer address city
VevoCim string `xml:"vevo>cim"` // Customer address line
VevoEmail string `xml:"vevo>email,omitempty"` // Customer e-mail address
VevoSendEmail bool `xml:"vevo>sendEmail,omitempty"` // Send notification e-mail to customer?
VevoAdoalany int `xml:"vevo>adoalany,omitempty"` // Customer VAT status 7:business is based outside of the European Union, 6:business is based in the Europen Union, 1: has a hungarian tax number, 0: we don't know, if the buyer has a tax number, -1: no tax number
VevoAdoszam string `xml:"vevo>adoszam,omitempty"` // Customer VAT number
VevoAdoszamEU string `xml:"vevo>adoszamEU,omitempty"` // Customer VAT number
VevoPostazasiNev string `xml:"vevo>postazasiNev,omitempty"` // Customer mail name
VevoPostazasiOrszag string `xml:"vevo>postazasiOrszag,omitempty"` // Customer mail country
VevoPostazasiIrsz string `xml:"vevo>postazasiIrsz,omitempty"` // Customer mail address zip code
VevoPostazasiTelepules string `xml:"vevo>postazasiTelepules,omitempty"` // Customer mail address city
VevoPostazasiCim string `xml:"vevo>postazasiCim,omitempty"` // Customer mail address line
VevoAzonosito string `xml:"vevo>azonosito,omitempty"` // Customer unique ID
VevoFokonyvKonyvelesDatum Date `xml:"vevo>vevoFokonyv>konyvelesDatum,omitempty"`
VevoFokonyvVevoAzonosito string `xml:"vevo>vevoFokonyv>vevoAzonosito,omitempty"`
VevoFokonyvFokonyviSzam string `xml:"vevo>vevoFokonyv>vevoFokonyviSzam,omitempty"`
VevoFokonyvFolyamatostelj bool `xml:"vevo>vevoFokonyv>folyamatosTelj,omitempty"`
VevoFokonyvElszDatumTol Date `xml:"vevo>vevoFokonyv>elszDatumTol,omitempty"`
VevoFokonyvElszDatumIg Date `xml:"vevo>vevoFokonyv>elszDatumIg,omitempty"`
VevoAlairoNeve string `xml:"vevo>alairoNeve,omitempty"` // Name of signer at customer (undocumented)
VevoTelefonszam string `xml:"vevo>telefonszam,omitempty"` // Customer phone number
VevoMegjegyzes string `xml:"vevo>megjegyzes,omitempty"` // Customer comment
// Note: provider-specific consigment options are not supported by the Go binding yet
FuvarlevelVonalkod string `xml:"fuvarlevel>vonalkod,omitempty"` // Generic barcode of consigment
FuvarlevelMegjegyzes string `xml:"fuvarlevel>megjegyzes,omitempty"` // Generic comment of consigment
Tetelek []XmlszamlaTetel `xml:"tetelek>tetel"` // Invoice content
}
// XmlszamlaTetel describes a line item within an xmlszamla
type XmlszamlaTetel struct {
Megnevezes string `xml:"megnevezes"` // Item name
Azonosito string `xml:"azonosito,omitempty"` // Item identifier
Mennyiseg float64 `xml:"mennyiseg"` // Item quantity
MennyisegiEgyseg string `xml:"mennyisegiEgyseg"` // Quantity specifier
NettoEgysegar float64 `xml:"nettoEgysegar"` // Net unit value
AfaKulcs string `xml:"afakulcs"` // VAT base (TAM/AAM/EU/EUK/MAA/F.AFA/K.AFA/0/5/7/18/19/20/25/27)
ArresAfaAlap float64 `xml:"arresAfaAlap"` // Margin-based VAT base
NettoErtek float64 `xml:"nettoErtek"` // Net value
AfaErtek float64 `xml:"afaErtek"` // VAT value
BruttoErtek float64 `xml:"bruttoErtek"` // Gross value
Megjegyzes string `xml:"megjegyzes,omitempty"` // Comment
FokonyvGazdasagiEsem string `xml:"tetelFokonyv>gazdasagiEsem,omitempty"`
FokonyvGazdasagiEsemAfa string `xml:"tetelFokonyv>gazdasagiEsemAfa,omitempty"`
FokonyvArbevetelFokonyviSzam string `xml:"tetelFokonyv>arbevetelFokonyviSzam,omitempty"`
FokonyvAfaFokonyviSzam string `xml:"tetelFokonyv>afaFokonyviSzam,omitempty"`
FokonyvElszDatumTol Date `xml:"tetelFokonyv>elszDatumTol,omitempty"`
FokonyvElszDatumIg Date `xml:"tetelFokonyv>elszDatumIg,omitempty"`
}
// Xmlszamlavalasz describes the response of creating new invoices
type Xmlszamlavalasz struct {
XMLName Empty `xml:"http://www.szamlazz.hu/xmlszamlavalasz xmlszamlavalasz"`
Sikeres bool `xml:"sikeres"`
Hibakod int `xml:"hibakod,omitempty"` // Note: this is string in the original XSD, parse it as int anyway
Hibauzenet string `xml:"hibauzenet,omitempty"`
Szamlaszam string `xml:"szamlaszam,omitempty"`
SzamlaNetto float64 `xml:"szamlanetto,omitempty"`
SzamlaBrutto float64 `xml:"szamlabrutto,omitempty"`
Kintlevoseg float64 `xml:"kintlevoseg,omitempty"`
Vevoifiokurl string `xml:"vevoifiokurl,omitempty"`
Pdf []byte `xml:"pdf,omitempty"`
}
// Xmlszamlast describes the request of reversing invoices
type Xmlszamlast struct {
XMLName Empty `xml:"http://www.szamlazz.hu/xmlszamlast xmlszamlast"`
Felhasznalo string `xml:"beallitasok>felhasznalo,omitempty"`
Jelszo string `xml:"beallitasok>jelszo,omitempty"`
SzamlaAgentKulcs string `xml:"beallitasok>szamlaagentkulcs,omitempty"`
ESzamla bool `xml:"beallitasok>eszamla"` // Whether to issue electronically signed invoices
KulcstartoJelszo string `xml:"beallitasok>kulcstartojelszo,omitempty"` // Password for electronic signature keyring
SzamlaLetoltes bool `xml:"beallitasok>szamlaLetoltes"` // Whether to return the created invoice image
ValaszVerzio uint `xml:"beallitasok>valaszVerzio"` // Format of reply. 1: mixed 2: xml-encapsulated
Szamlaszam string `xml:"fejlec>szamlaszam"` // To be reversed invoice number
KeltDatum Date `xml:"fejlec>keltDatum,omitempty"` // Date of creation (YYYY-MM-DD)
TeljesitesDatum Date `xml:"fejlec>teljesitesDatum,omitempty"` // Date of fullfillment (YYYY-MM-DD)
Tipus string `xml:"fejlec>tipus,omitempty"` // Type of reversal. Must be SS
SzamlaSablon string `xml:"fejlec>szamlaSablon,omitempty"` // Invoice format (SzlaMost/SzlaAlap/SzlaNoEnv/Szla8cm/SzlaTomb)
EmailReplyTo string `xml:"elado>emailReplyto,omitempty"` // Reply-to header for notification e-mails
EmailTargy string `xml:"elado>emailTargy,omitempty"` // Subject header for notification e-mails
EmailSzoveg string `xml:"elado>emailSzoveg,omitempty"` // Content text of notification e-mails
Email string `xml:"vevo>email,omitempty"` // Customer e-mail address
}
// Xmlszamlakifiz describes the request of updating payment statuses
type Xmlszamlakifiz struct {
XMLName Empty `xml:"http://www.szamlazz.hu/xmlszamlakifiz xmlszamlakifiz"`
// Authentication (Username+Password or AgentKey required)
Felhasznalo string `xml:"beallitasok>felhasznalo"` // API user
Jelszo string `xml:"beallitasok>jelszo"` // API password
SzamlaAgentKulcs string `xml:"beallitasok>szamlaagentkulcs"` // API token
Szamlaszam string `xml:"beallitasok>szamlaszam"` // Number of invoice to be updated
Additiv bool `xml:"beallitasok>additiv"` // Append payment records (true) or overwrite them (false)
Kifizetes []XmlszamlakifizKifizetes `xml:"kifizetes"`
}
// XmlszamlakifizKifizetes describes a line item within an xmlszalakifiz
type XmlszamlakifizKifizetes struct {
Datum Date `xml:"datum"` // Date of creation (YYYY-MM-DD)
Jogcim string `xml:"jogcim"` // Method Of Payment (cash, credit card, etc)
Osszeg float64 `xml:"osszeg"` // Net value
Leiras string `xml:"leiras"` // Description
}
// Xmlszamlapdf describes the request for downloading PDF invoices
type Xmlszamlapdf struct {
XMLName Empty `xml:"http://www.szamlazz.hu/xmlszamlapdf xmlszamlapdf"`
// Authentication (Username+Password or AgentKey required)
Felhasznalo string `xml:"felhasznalo,omitempty"`
Jelszo string `xml:"jelszo,omitempty"`
SzamlaAgentKulcs string `xml:"szamlaagentkulcs,omitempty"`
Szamlaszam string `xml:"szamlaszam,omitempty"` // Id of document to be downloaded
RendelesSzam string `xml:"rendelesSzam,omitempty"` // Order number (undocumented)
SzamlaKulsoAzon string `xml:"szamlaKulsoAzon,omitempty"` // External reference for query-back
ValaszVerzio uint `xml:"valaszVerzio"` // Format of reply. 1: mixed 2: xml-encapsulated
}
// Xmlszamlaxml describes the request of downloading invoice data
type Xmlszamlaxml struct {
XMLName Empty `xml:"http://www.szamlazz.hu/xmlszamlaxml xmlszamlaxml"`
// Authentication (Username+Password or AgentKey required)
Felhasznalo string `xml:"felhasznalo,omitempty"`
Jelszo string `xml:"jelszo,omitempty"`
SzamlaAgentKulcs string `xml:"szamlaagentkulcs,omitempty"`
Szamlaszam string `xml:"szamlaszam"` // Id of document to be downloaded
RendelesSzam string `xml:"rendelesSzam"` // Order number
Pdf bool `xml:"pdf"` // Whether to return the created invoice image
}
// Szamla describes the response of downloading invoice data
type Szamla struct {
XMLName Empty `xml:"http://www.szamlazz.hu/szamla szamla"`
SzallitoId int `xml:"szallito>id"`
SzallitoNev string `xml:"szallito>nev"`
SzallitoCimOrszag string `xml:"szallito>cim>orszag"`
SzallitoCimIrsz string `xml:"szallito>cim>irsz"`
SzallitoCimTelepules string `xml:"szallito>cim>telepules"`
SzallitoCimCim string `xml:"szallito>cim>cim"`
SzallitoPostacimOrszag string `xml:"szallito>postacim>orszag,omitempty"`
SzallitoPostacimIrsz string `xml:"szallito>postacim>irsz,omitempty"`
SzallitoPostacimTelepules string `xml:"szallito>postacim>telepules,omitempty"`
SzallitoPostacimCim string `xml:"szallito>postacim>cim,omitempty"`
SzallitoAdoszam string `xml:"szallito>adoszam"`
SzallitoAdoszameu string `xml:"szallito>adoszameu,omitempty"`
SzallitoBankNev string `xml:"szallito>bank>nev,omitempty"`
SzallitoBankBankszamla string `xml:"szallito>bank>bankszamla,omitempty"`
AlapId int `xml:"alap>id"`
AlapSzamlaszam string `xml:"alap>szamlaszam"`
AlapForras int `xml:"alap>forras,omitempty"`
AlapIktatoszam string `xml:"alap>iktatoszam"`
AlapTipus string `xml:"alap>tipus"`
AlapEszamla int `xml:"alap>eszamla"`
AlapHivszamlaszam string `xml:"alap>hivszamlaszam,omitempty"`
AlapHivdijbekszam string `xml:"alap>hivdijbekszam,omitempty"`
AlapKelt Date `xml:"alap>kelt"`
AlapTelj Date `xml:"alap>telj"`
AlapFizh Date `xml:"alap>fizh"`
AlapFizmod string `xml:"alap>fizmod"`
AlapFizmodunified string `xml:"alap>fizmodunified"` // ENUM: átutalás, készpénz, bankkártya, csekk, utánvét, ajándékutalvány, barion, barter, csoportos beszedés, OTP Simple, kompenzáció, kupon, PayPal, PayU, SZÉP kártya, utalvány, egyéb
AlapKeszpenz bool `xml:"alap>keszpenz"`
AlapRendelesszam string `xml:"alap>rendelesszam,omitempty"`
AlapNyelv string `xml:"alap>nyelv"` // ENUM: hu, en, de, it, ro, sk, hr, fr, es, cz, pl
AlapDevizanem string `xml:"alap>devizanem"`
AlapDevizabank string `xml:"alap>devizabank,omitempty"`
AlapDevizaarf float64 `xml:"alap>devizaarf,omitempty"`
AlapMegjegyzes string `xml:"alap>megjegyzes,omitempty"`
AlapPenzforg bool `xml:"alap>penzforg"`
AlapKata bool `xml:"alap>kata"`
AlapEmail string `xml:"alap>email,omitempty"`
AlapTeszt bool `xml:"alap>teszt"`
VevoId int `xml:"vevo>id,omitempty"`
VevoNev string `xml:"vevo>nev"`
VevoAzonosito string `xml:"vevo>azonosito,omitempty"`
VevoCimOrszag string `xml:"vevo>cim>orszag"`
VevoCimIrsz string `xml:"vevo>cim>irsz"`
VevoCimTelepules string `xml:"vevo>cim>telepules"`
VevoCimCim string `xml:"vevo>cim>cim"`
VevoPostacimOrszag string `xml:"vevo>postacim>orszag,omitempty"`
VevoPostacimIrsz string `xml:"vevo>postacim>irsz,omitempty"`
VevoPostacimTelepules string `xml:"vevo>postacim>telepules,omitempty"`
VevoPostacimCim string `xml:"vevo>postacim>cim,omitempty"`
VevoEmail string `xml:"vevo>email,omitempty"`
VevoAdoszam string `xml:"vevo>adoszam"`
VevoAdoszameu string `xml:"vevo>adoszameu,omitempty"`
VevoLokacio int `xml:"vevo>lokacio"`
VevoFokonyvVevo string `xml:"vevo>fokonyv>vevo,omitempty"`
VevoFokonyvVevoazon string `xml:"vevo>fokonyv>vevoazon,omitempty"`
VevoFokonyvDatum Date `xml:"vevo>fokonyv>datum,omitempty"`
VevoFokonyvFolyamatostelj bool `xml:"vevo>fokonyv>folyamatostelj,omitempty"`
VevoFokonyvElszDatTol Date `xml:"vevo>fokonyv>elszDatTol,omitempty"`
VevoFokonyvElszDatIg Date `xml:"vevo>fokonyv>elszDatIg,omitempty"`
Tetelek []SzamlaTetel `xml:"tetelek>tetel"`
OsszegekAfakulcsossz []SzamlaAfakulcsossz `xml:"osszegek>afakulcsossz"`
OsszegekTotalosszNetto float64 `xml:"osszegek>totalossz>netto"`
OsszegekTotalosszAfa float64 `xml:"osszegek>totalossz>afa"`
OsszegekTotalosszBrutto float64 `xml:"osszegek>totalossz>brutto"`
Kifizetesek []SzamlaKifizetes `xml:"kifizetesek>kifizetes,omitempty"`
Pdf []byte `xml:"pdf"`
}
// SzamlaTetel describes a line item within Szamla
type SzamlaTetel struct {
Nev string `xml:"nev"`
Azonosito string `xml:"azonosito,omitempty"`
Mennyiseg float64 `xml:"mennyiseg"`
Mennyisegiegyseg string `xml:"mennyisegiegyseg"`
Nettoegysegar float64 `xml:"nettoegysegar"`
Afatipus string `xml:"afatipus,omitempty"` // ENUM: TAM, AAM, EU, EUK, MAA, F.AFA, K.AFA, ÁKK, TAHK, TEHK, EUT, EUKT
Afakulcs float64 `xml:"afakulcs"` // schema states int, but field has decimals. Ex: 27.0
Netto float64 `xml:"netto"`
Arresafaalap float64 `xml:"arresafaalap,omitempty"`
Afa float64 `xml:"afa"`
Brutto float64 `xml:"brutto"`
Megjegyzes string `xml:"megjegyzes,omitempty"`
FokonyvArbevetel string `xml:"fokonyv>arbevetel,omitempty"`
FokonyvAfa string `xml:"fokonyv>afa,omitempty"`
FokonyvGazdasagiesemeny string `xml:"fokonyv>gazdasagiesemeny,omitempty"`
FokonyvGazdasagiesemenyafa string `xml:"fokonyv>gazdasagiesemenyafa,omitempty"`
FokonyvElszdattol Date `xml:"fokonyv>elszdattol,omitempty"`
FokonyvElszdatig Date `xml:"fokonyv>elszdatig,omitempty"`
}
// SzamlaAfakulcsossz describes a summary for a VAT key within Szamla
type SzamlaAfakulcsossz struct {
Afatipus string `xml:"afatipus,omitempty"` // ENUM: TAM, AAM, EU, EUK, MAA, F.AFA, K.AFA, ÁKK, TAHK, TEHK, EUT, EUKT
Afakulcs float64 `xml:"afakulcs"` // schema states int, but field has decimals. Ex: 27.0
Netto float64 `xml:"netto"`
Afa float64 `xml:"afa"`
Brutto float64 `xml:"brutto"`
}
// SzamlaKifizetesek describes a payment item within Szamla
type SzamlaKifizetes struct {
Datum Date `xml:"datum"`
Jogcim string `xml:"jogcim"`
Osszeg float64 `xml:"osszeg"`
Megjegyzes string `xml:"megjegyzes,omitempty"`
Bankszamlaszam string `xml:"bankszamlaszam,omitempty"`
Banktranzid int `xml:"banktranzid,omitempty"`
Devizaarf float64 `xml:"devizaarf,omitempty"`
}
// Xmlszamladbkdel describes the request of deleting proforma invoices
type Xmlszamladbkdel struct {
XMLName Empty `xml:"http://www.szamlazz.hu/xmlszamladbkdel xmlszamladbkdel"`
Felhasznalo string `xml:"beallitasok>felhasznalo,omitempty"`
Jelszo string `xml:"beallitasok>jelszo,omitempty"`
SzamlaAgentKulcs string `xml:"beallitasok>szamlaagentkulcs,omitempty"`
Szamlaszam string `xml:"fejlec>szamlaszam,omitempty"`
Rendelesszam string `xml:"fejlec>rendelesszam,omitempty"`
}
// Xmlszamladbkdelvalasz describes the response of deleting proforma invoices
type Xmlszamladbkdelvalasz struct {
XMLName Empty `xml:"http://www.szamlazz.hu/xmlszamladbkdelvalasz xmlszamladbkdelvalasz"` // sic!
Sikeres bool `xml:"sikeres"`
Hibakod int `xml:"hibakod,omitempty"`
Hibauzenet string `xml:"hibauzenet,omitempty"`
}
// Xmlnyugtacreate describes the request of creating receipts
type Xmlnyugtacreate struct {
XMLName Empty `xml:"http://www.szamlazz.hu/xmlnyugtacreate xmlnyugtacreate"`
Felhasznalo string `xml:"beallitasok>felhasznalo,omitempty"`
Jelszo string `xml:"beallitasok>jelszo,omitempty"`
SzamlaAgentKulcs string `xml:"beallitasok>szamlaagentkulcs,omitempty"`
PdfLetoltes bool `xml:"beallitasok>pdfLetoltes"`
HivasAzonosito string `xml:"fejlec>hivasAzonosito"`
Elotag string `xml:"fejlec>elotag"`
Fizmod string `xml:"fejlec>fizmod"`
Penznem string `xml:"fejlec>penznem"`
Devizaarf float64 `xml:"fejlec>devizaarf,omitempty"`
Devizabank string `xml:"fejlec>devizabank,omitempty"`
Megjegyzes string `xml:"fejlec>megjegyzes,omitempty"`
PdfSablon string `xml:"fejlec>pdfSablon,omitempty"`
FokonyvVevo string `xml:"fejlec>fokonyvVevo,omitempty"`
Tetelek []XmlnyugtacreateTetel `xml:"tetelek>tetel"`
Kifizetesek *[]XmlnyugtacreateKifizetes `xml:"kifizetesek>kifizetes,omitempty"`
}
// XmlnyugtacreateTetel is a line item of Xmlnyugtacreate
type XmlnyugtacreateTetel struct {
Megnevezes string `xml:"megnevezes"`
Azonosito string `xml:"azonosito,omitempty"`
Mennyiseg float64 `xml:"mennyiseg"`
MennyisegiEgyseg string `xml:"mennyisegiEgyseg"`
NettoEgysegar float64 `xml:"nettoEgysegar"`
Afakulcs string `xml:"afakulcs"` // ENUM: 0, 5, 10, 27, AAM, TAM, EU, EUK, MAA, F.AFA, K.AFA, ÁKK,HO, EUE, EUFADE, EUFAD37, ATK, NAM, EAM, KBAUK, KBAET
Netto float64 `xml:"netto"`
Afa float64 `xml:"afa"`
Brutto float64 `xml:"brutto"`
FokonyvArbevetel string `xml:"fokonyv>arbevetel,omitempty"`
FokonyvAfa string `xml:"fokonyv>afa,omitempty"`
}
// XmlnyugtacreateKifizetes is a payment line of Xmlnyugtacreate
type XmlnyugtacreateKifizetes struct {
Fizetoeszkoz string `xml:"fizetoeszkoz"`
Osszeg float64 `xml:"osszeg"`
Leiras string `xml:"leiras,omitempty"`
}
// Xmlnyugtavalasz describes the response of creating receipts
type Xmlnyugtavalasz struct {
XMLName Empty `xml:"http://www.szamlazz.hu/xmlnyugtavalasz xmlnyugtavalasz"`
Sikeres bool `xml:"sikeres"`
Hibakod int `xml:"hibakod,omitempty"`
Hibauzenet string `xml:"hibauzenet,omitempty"`
NyugtaPdf []byte `xml:"nyugtaPdf,omitempty"`
Id int `xml:"nyugta>alap>id"`
HivasAzonosito string `xml:"nyugta>alap>hivasAzonosito"`
Nyugtaszam string `xml:"nyugta>alap>nyugtaszam"`
Tipus string `xml:"nyugta>alap>tipus"`
Stornozott bool `xml:"nyugta>alap>stornozott"`
StronozottNyugtaszam string `xml:"nyugta>alap>stornozottNyugtaszam"`
Kelt Date `xml:"nyugta>alap>kelt"`
Fizmod string `xml:"nyugta>alap>fizmod"`
Penznem string `xml:"nyugta>alap>penznem"`
Devizaarf float64 `xml:"nyugta>alap>devizaarf,omitempty"`
Devizabank string `xml:"nyugta>alap>devizabank,omitempty"`
Megjegyzes string `xml:"nyugta>alap>megjegyzes,omitempty"`
FokonyvVevo string `xml:"nyugta>alap>fokonyvVevo,omitempty"`
Teszt bool `xml:"nyugta>alap>teszt"`
Tetelek []XmlnyugtavalaszTetel `xml:"nyugta>tetelek>tetel"`
Kifizetesek *[]XmlnyugtavalaszKifizetes `xml:"nyugta>kifizetesek>kifizetes,omitempty"`
OsszegekAfakulcsossz []XmlnyugtavalaszAfakulcsossz `xml:"nyugta>osszegek>afakulcsossz"`
OsszegekTotalosszNetto float64 `xml:"nyugta>osszegek>totalossz>netto"`
OsszegekTotalosszAfa float64 `xml:"nyugta>osszegek>totalossz>afa"`
OsszegekTotalosszBrutto float64 `xml:"nyugta>osszegek>totalossz>brutto"`
}
// XmlnyugtavalaszTetel is a line item of Xmlnyugtavalasz
type XmlnyugtavalaszTetel struct {
Megnevezes string `xml:"megnevezes"`
Azonosito string `xml:"azonosito,omitempty"`
NettoEgysegar float64 `xml:"nettoEgysegar"`
Mennyiseg float64 `xml:"mennyiseg"`
MennyisegiEgyseg string `xml:"mennyisegiEgyseg"`
Netto float64 `xml:"netto"`
Afatipus string `xml:"afatipus"` // ENUM: TAM, AAM, EU, EUK, MAA, F.AFA, K.AFA, ÁKK, TAHK, TEHK, EUT, EUKT, HO, EUE, EUFADE, EUFADE37, ATK, NAM, EAM, KBAUK, KBAET
Afakulcs float64 `xml:"afakulcs"` // schema states int, but field has decimals. Ex: 27.0
Afa float64 `xml:"afa"`
Brutto float64 `xml:"brutto"`
FokonyvArbevetel string `xml:"fokonyv>arbevetel,omitempty"`
FokonyvAfa string `xml:"fokonyv>afa,omitempty"`
}
// XmlnyugatavalaszKifizetes is a payment item of Xmlnyugtavalasz
type XmlnyugtavalaszKifizetes struct {
Fizetoeszkoz string `xml:"fizetoeszkoz"`
Osszeg float64 `xml:"osszeg"`
Leiras string `xml:"leiras,omitempty"`
}
// XmlnyugtavalaszAfakulcsossz describes a summary for a VAT key within Xmlnyugtavalasz
type XmlnyugtavalaszAfakulcsossz struct {
Afatipus string `xml:"afatipus,omitempty"` // ENUM: TEHK, TAHK, TAM, AAM, EUT, EUKT, MAA, F.AFA, K.AFA, HO, EUE, EUFADE, EUFAD37, ATK, NAM, EAM, KBAUK, KBAET, 0, 5, 7, 18, 19, 20, 25, 27
Afakulcs float64 `xml:"afakulcs"` // schema states int, but field has decimals. Ex: 27.0
Netto float64 `xml:"netto"`
Afa float64 `xml:"afa"`
Brutto float64 `xml:"brutto"`
}
// Xmlnyugtast describes the request of reversing receipts
type Xmlnyugtast struct {
XMLName Empty `xml:"http://www.szamlazz.hu/xmlnyugtast xmlnyugtast"`
Felhasznalo string `xml:"beallitasok>felhasznalo,omitempty"`
Jelszo string `xml:"beallitasok>jelszo,omitempty"`
SzamlaAgentKulcs string `xml:"beallitasok>szamlaagentkulcs,omitempty"`
PdfLetoltes bool `xml:"beallitasok>pdfLetoltes"`
Nyugtaszam string `xml:"fejlec>nyugtaszam"`
PdfSablon string `xml:"fejlec>pdfSablon,omitempty"`
HivasAzonosito string `xml:"fejlec>hivasAzonosito"`
}
// Xmlnyugtaget describes the request of downloading receipts
type Xmlnyugtaget struct {
XMLName Empty `xml:"http://www.szamlazz.hu/xmlnyugtaget xmlnyugtaget"`
Felhasznalo string `xml:"beallitasok>felhasznalo,omitempty"`
Jelszo string `xml:"beallitasok>jelszo,omitempty"`
SzamlaAgentKulcs string `xml:"beallitasok>szamlaagentkulcs,omitempty"`
PdfLetoltes bool `xml:"beallitasok>pdfLetoltes"`
Nyugtaszam string `xml:"fejlec>nyugtaszam"`
PdfSablon string `xml:"fejlec>pdfSablon,omitempty"`
HivasAzonosito string `xml:"fejlec>hivasAzonosito"`
}
// Xmlnyugtasend describes the request of sending receipts via email
type Xmlnyugtasend struct {
XMLName Empty `xml:"http://www.szamlazz.hu/xmlnyugtasend xmlnyugtasend"`
Felhasznalo string `xml:"beallitasok>felhasznalo,omitempty"`
Jelszo string `xml:"beallitasok>jelszo,omitempty"`
SzamlaAgentKulcs string `xml:"beallitasok>szamlaagentkulcs,omitempty"`
Nyugtaszam string `xml:"fejlec>nyugtaszam"`
Email string `xml:"emailKuldes>email,omitempty"`
EmailReplyto string `xml:"emailKuldes>emailReplyto,omitempty"`
EmailTargy string `xml:"emailKuldes>emailTargy,omitempty"`
EmailSzoveg string `xml:"emailKuldes>emailSzoveg,omitempty"`
}
// Xmlnyugtasendvalasz describes the response of sending receipts via email
type Xmlnyugtasendvalasz struct {
XMLName Empty `xml:"http://www.szamlazz.hu/xmlnyugtasendvalasz xmlnyugtasendvalasz"`
Sikeres bool `xml:"sikeres"`
Hibakod int `xml:"hibakod,omitempty"`
Hibauzenet string `xml:"hibauzenet,omitempty"`
}
// Xmltaxpayer describes the request for querying NAV taxpayer details
type Xmltaxpayer struct {
XMLName Empty `xml:"http://www.szamlazz.hu/xmltaxpayer xmltaxpayer"`
// Authentication (Username+Password or AgentKey required)
Felhasznalo string `xml:"beallitasok>felhasznalo,omitempty"`
Jelszo string `xml:"beallitasok>jelszo,omitempty"`
SzamlaAgentKulcs string `xml:"beallitasok>szamlaagentkulcs,omitempty"`
Torzsszam string `xml:"torzsszam"` // VAT no (first 8 chars)
}
// QueryTaxpayerResponse describes the response of querying NAV taxpayer details
// Note: This is a partial implementation based on NAV schema
type QueryTaxpayerResponse struct {
XMLName Empty `xml:"http://schemas.nav.gov.hu/OSA/3.0/api QueryTaxpayerResponse"`
ResultFuncCode string `xml:"result>funcCode"` // ENUM: OK, ERROR
ResultErrorCode string `xml:"result>errorCode,omitempty"`
ResultMessage string `xml:"result>message,omitempty"`
Validity bool `xml:"taxpayerValidity,omitempty"`
Name string `xml:"taxpayerData>taxpayerName"`
ShortName string `xml:"taxpayerData>taxpayerShortName,omitempty"`
TaxpayerId string `xml:"taxpayerData>taxNumberDetail>taxpayerId"`
VatCode string `xml:"taxpayerData>taxNumberDetail>vatCode,omitempty"`
CountyCode string `xml:"taxpayerData>taxNumberDetail>countyCode,omitempty"`
VatGroupMembership string `xml:"taxpayerData>vatGroupMembership,omitempty"`
AddressList []TaxpayerAddressItem `xml:"taxpayerData>taxpayerAddressList>taxpayerAddressItem"`
}
// TaxpayerAddressItem describes a single address within QueryTaxpayerResponse
type TaxpayerAddressItem struct {
Type string `xml:"taxpayerAddressType"` // ENUM: HQ, SITE, BRANCH
Country string `xml:"taxpayerAddress>countryCode"`
PostalCode string `xml:"taxpayerAddress>postalCode"`
City string `xml:"taxpayerAddress>city"`
StreetName string `xml:"taxpayerAddress>streetName"`
PublicPlaceCategory string `xml:"taxpayerAddress>publicPlaceCategory"`
Number string `xml:"taxpayerAddress>number,omitempty"`
Building string `xml:"taxpayerAddress>building,omitempty"`
Staircase string `xml:"taxpayerAddress>staircase,omitempty"`
Floor string `xml:"taxpayerAddress>floor,omitempty"`
Door string `xml:"taxpayerAddress>door,omitempty"`
LotNumber string `xml:"taxpayerAddress>lotNumber,omitempty"`
}
// xmlcegmb describes the request for registering a managed user account
type Xmlcegmb struct {
XMLName Empty `xml:"http://www.szamlazz.hu/xmlcegmb XmlCegMb"`
LoginName string `xml:"login>loginname"` // API user
Password string `xml:"login>password"` // API password
SzamlaAgentKulcs string `xml:"login>szamlaagentkulcs"` // API token
CompanyName string `xml:"cegMb>cegcompanyname"`
TaxNumber string `xml:"cegMb>cegtaxnumber"`
SzamlaszamElotag string `xml:"cegMb>cegszamlaszamelotag"`
Irsz string `xml:"cegMb>cegirsz"`
City string `xml:"cegMb>cegcity"`
Addr string `xml:"cegMb>cegaddr"`
PostIrsz string `xml:"cegMb>cegpostirsz,omitempty"`
PostCity string `xml:"cegMb>cegpostcity,omitempty"`
PostAddr string `xml:"cegMb>cegpostaddr,omitempty"`
Bank string `xml:"cegMb>cegbank"`
BankAccount string `xml:"cegMb>cegbankaccount"`
Email string `xml:"cegMb>cegemail"`
EmailReplyTo string `xml:"cegMb>cegemailreplyto"`
CegPenzforgDatTol string `xml:"cegMb>cegpenzforgdattol,omitempty"`
CegPenzforgDatIg string `xml:"cegMb>cegpenzforgdatig,omitempty"`
CegKataDatTol string `xml:"cegMb>cegkatadattol,omitempty"`
CegKataDatIg string `xml:"cegMb>cegpenzkatadatig,omitempty"`
UsrEmail string `xml:"usrMb>usremail"`
UsrPassword string `xml:"usrMb>usrpassword"`
UsrVezeteknev string `xml:"usrMb>usrvezeteknev"`
UsrKeresztnev string `xml:"usrMb>usrkeresztnev"`
}