From f8ff1d0fd1bfdbb08d7dec91e3480532a755f887 Mon Sep 17 00:00:00 2001 From: elgekko Date: Mon, 18 Sep 2023 17:24:02 +0200 Subject: [PATCH] NAV model added, parser created, invoice import modified --- .idea/compiler.xml | 24 +- .idea/encodings.xml | 2 +- .idea/modules.xml | 8 + TODO.txt | 18 +- lis-app/pom.xml | 14 +- .../src/main/resources/application-dev.yaml | 13 +- lis-app/src/main/resources/application.yaml | 8 + .../test/java/hu/user/lis/ReflectionsIT.java | 2 +- .../test/java/hu/user/lis/RepositoryIT.java | 4 +- .../lis/workflow/DeserializeInvoiceIT.java | 95 + ...di devizas vegszamla tobb eloleg tetel.xml | 185 ++ .../nav/invoice/Belfoldi vegszamla.xml | 140 + lis-service/pom.xml | 88 + .../user/lis/service}/api/AssociateApi.java | 4 +- .../java/hu/user/lis/service}/api/DbApi.java | 4 +- .../hu/user/lis/service}/api/GenerateApi.java | 4 +- .../hu/user/lis/service}/api/InvoiceApi.java | 4 +- .../hu/user/lis/service}/api/PartnerApi.java | 4 +- .../hu/user/lis/service}/api/ProjectApi.java | 4 +- .../lis/service}/api/ProjectAssociateApi.java | 4 +- .../lis/service}/api/ProjectStatusApi.java | 4 +- .../lis/service}/api/ServiceRecordApi.java | 4 +- .../hu/user/lis/service}/api/TreasuryApi.java | 4 +- .../lis/service}/data/AssociateService.java | 2 +- .../service}/data/AssociateServiceImpl.java | 2 +- .../service}/data/DataGeneratorService.java | 2 +- .../user/lis/service}/data/DataService.java | 2 +- .../lis/service}/data/DataServiceImpl.java | 2 +- .../lis/service}/data/EDocumentService.java | 2 +- .../service}/data/EDocumentServiceImpl.java | 2 +- .../lis/service}/data/EntityDataService.java | 2 +- .../service}/data/EntityDataServiceBase.java | 2 +- .../lis/service}/data/InvoiceService.java | 2 +- .../lis/service}/data/InvoiceServiceImpl.java | 2 +- .../lis/service}/data/PartnerService.java | 2 +- .../lis/service}/data/PartnerServiceImpl.java | 2 +- .../data/ProjectAssociateService.java | 2 +- .../data/ProjectAssociateServiceImpl.java | 2 +- .../lis/service}/data/ProjectService.java | 2 +- .../lis/service}/data/ProjectServiceImpl.java | 2 +- .../service}/data/ProjectStatusService.java | 2 +- .../data/ProjectStatusServiceImpl.java | 2 +- .../user/lis/service}/data/ReflectEntity.java | 2 +- .../service}/data/ServiceRecordService.java | 2 +- .../data/ServiceRecordServiceImpl.java | 2 +- .../lis/service}/data/SupplierService.java | 2 +- .../service}/data/SupplierServiceImpl.java | 2 +- .../lis/service}/data/TreasuryService.java | 2 +- .../service}/data/TreasuryServiceImpl.java | 2 +- .../nav/TaxOfficeDataDeserializer.java | 76 + .../lis/service/nav/mapper/InvoiceMapper.java | 37 + .../lis/service/nav/mapper/PartnerMapper.java | 36 + lis-service/src/main/resources/global.xjb | 13 + .../schemas/nav/gov/hu/NTCA/common.xsd | 783 ++++++ .../schemas/nav/gov/hu/OSA/CHANGELOG_2.0.md | 308 +++ .../schemas/nav/gov/hu/OSA/CHANGELOG_3.0.md | 559 ++++ .../schemas/nav/gov/hu/OSA/catalog.xml | 19 + .../nav/gov/hu/OSA/invoiceAnnulment.xsd | 86 + .../schemas/nav/gov/hu/OSA/invoiceApi.xsd | 2277 ++++++++++++++++ .../schemas/nav/gov/hu/OSA/invoiceBase.xsd | 329 +++ .../schemas/nav/gov/hu/OSA/invoiceData.xsd | 2368 +++++++++++++++++ .../schemas/nav/gov/hu/OSA/serviceMetrics.xsd | 217 ++ lis-services/pom.xml | 41 - lis-ui/pom.xml | 2 +- .../converter/AssociateIdToNameConverter.java | 2 +- .../user/lis/ui/data/AssociatesDataModel.java | 4 +- .../hu/user/lis/ui/data/InvoiceDataModel.java | 4 +- .../user/lis/ui/data/PartnersDataModel.java | 4 +- .../lis/ui/data/ProjectStatusDataModel.java | 2 +- .../user/lis/ui/data/ProjectsDataModel.java | 2 +- .../lis/ui/data/ServiceRecordsDataModel.java | 4 +- .../user/lis/ui/data/SuppliersDataModel.java | 2 +- .../lis/ui/data/SuppliersSimpleDataModel.java | 2 +- .../user/lis/ui/data/TreasuryDataModel.java | 4 +- .../ui/data/common/CachedSpringDataModel.java | 2 +- .../ui/editor/common/EntityEditorModel.java | 2 +- .../editor/selector/EntitySelectorModel.java | 2 +- .../java/hu/user/lis/ui/event/EventBus.java | 13 +- .../ApplicationUIProperties.java} | 6 +- .../hu/user/lis/ui/view/LoginViewModel.java | 4 +- .../lis/ui/view/common/EntityViewModel.java | 2 +- lis-ui/src/main/resources/web/login.zul | 4 +- lis-workflow/pom.xml | 2 +- .../workflow/invoice/DownloadInvoiceData.java | 11 +- .../lis/workflow/invoice/ListNewInvoices.java | 9 +- .../IncomingInvoiceFetcherService.java | 32 +- .../properties/WorkflowProperties.java | 22 + pom.xml | 44 +- runConfigurations/server-dev.run.xml | 18 + 89 files changed, 7903 insertions(+), 144 deletions(-) create mode 100644 .idea/modules.xml create mode 100644 lis-app/src/test/java/hu/user/lis/workflow/DeserializeInvoiceIT.java create mode 100644 lis-app/src/test/resources/nav/invoice/Belfoldi devizas vegszamla tobb eloleg tetel.xml create mode 100644 lis-app/src/test/resources/nav/invoice/Belfoldi vegszamla.xml create mode 100644 lis-service/pom.xml rename {lis-services/src/main/java/hu/user/lis/services => lis-service/src/main/java/hu/user/lis/service}/api/AssociateApi.java (90%) rename {lis-services/src/main/java/hu/user/lis/services => lis-service/src/main/java/hu/user/lis/service}/api/DbApi.java (94%) rename {lis-services/src/main/java/hu/user/lis/services => lis-service/src/main/java/hu/user/lis/service}/api/GenerateApi.java (97%) rename {lis-services/src/main/java/hu/user/lis/services => lis-service/src/main/java/hu/user/lis/service}/api/InvoiceApi.java (90%) rename {lis-services/src/main/java/hu/user/lis/services => lis-service/src/main/java/hu/user/lis/service}/api/PartnerApi.java (90%) rename {lis-services/src/main/java/hu/user/lis/services => lis-service/src/main/java/hu/user/lis/service}/api/ProjectApi.java (96%) rename {lis-services/src/main/java/hu/user/lis/services => lis-service/src/main/java/hu/user/lis/service}/api/ProjectAssociateApi.java (90%) rename {lis-services/src/main/java/hu/user/lis/services => lis-service/src/main/java/hu/user/lis/service}/api/ProjectStatusApi.java (90%) rename {lis-services/src/main/java/hu/user/lis/services => lis-service/src/main/java/hu/user/lis/service}/api/ServiceRecordApi.java (90%) rename {lis-services/src/main/java/hu/user/lis/services => lis-service/src/main/java/hu/user/lis/service}/api/TreasuryApi.java (90%) rename {lis-services/src/main/java/hu/user/lis/services => lis-service/src/main/java/hu/user/lis/service}/data/AssociateService.java (91%) rename {lis-services/src/main/java/hu/user/lis/services => lis-service/src/main/java/hu/user/lis/service}/data/AssociateServiceImpl.java (99%) rename {lis-services/src/main/java/hu/user/lis/services => lis-service/src/main/java/hu/user/lis/service}/data/DataGeneratorService.java (86%) rename {lis-services/src/main/java/hu/user/lis/services => lis-service/src/main/java/hu/user/lis/service}/data/DataService.java (70%) rename {lis-services/src/main/java/hu/user/lis/services => lis-service/src/main/java/hu/user/lis/service}/data/DataServiceImpl.java (97%) rename {lis-services/src/main/java/hu/user/lis/services => lis-service/src/main/java/hu/user/lis/service}/data/EDocumentService.java (82%) rename {lis-services/src/main/java/hu/user/lis/services => lis-service/src/main/java/hu/user/lis/service}/data/EDocumentServiceImpl.java (95%) rename {lis-services/src/main/java/hu/user/lis/services => lis-service/src/main/java/hu/user/lis/service}/data/EntityDataService.java (98%) rename {lis-services/src/main/java/hu/user/lis/services => lis-service/src/main/java/hu/user/lis/service}/data/EntityDataServiceBase.java (97%) rename {lis-services/src/main/java/hu/user/lis/services => lis-service/src/main/java/hu/user/lis/service}/data/InvoiceService.java (93%) rename {lis-services/src/main/java/hu/user/lis/services => lis-service/src/main/java/hu/user/lis/service}/data/InvoiceServiceImpl.java (99%) rename {lis-services/src/main/java/hu/user/lis/services => lis-service/src/main/java/hu/user/lis/service}/data/PartnerService.java (91%) rename {lis-services/src/main/java/hu/user/lis/services => lis-service/src/main/java/hu/user/lis/service}/data/PartnerServiceImpl.java (99%) rename {lis-services/src/main/java/hu/user/lis/services => lis-service/src/main/java/hu/user/lis/service}/data/ProjectAssociateService.java (92%) rename {lis-services/src/main/java/hu/user/lis/services => lis-service/src/main/java/hu/user/lis/service}/data/ProjectAssociateServiceImpl.java (98%) rename {lis-services/src/main/java/hu/user/lis/services => lis-service/src/main/java/hu/user/lis/service}/data/ProjectService.java (91%) rename {lis-services/src/main/java/hu/user/lis/services => lis-service/src/main/java/hu/user/lis/service}/data/ProjectServiceImpl.java (99%) rename {lis-services/src/main/java/hu/user/lis/services => lis-service/src/main/java/hu/user/lis/service}/data/ProjectStatusService.java (90%) rename {lis-services/src/main/java/hu/user/lis/services => lis-service/src/main/java/hu/user/lis/service}/data/ProjectStatusServiceImpl.java (98%) rename {lis-services/src/main/java/hu/user/lis/services => lis-service/src/main/java/hu/user/lis/service}/data/ReflectEntity.java (98%) rename {lis-services/src/main/java/hu/user/lis/services => lis-service/src/main/java/hu/user/lis/service}/data/ServiceRecordService.java (93%) rename {lis-services/src/main/java/hu/user/lis/services => lis-service/src/main/java/hu/user/lis/service}/data/ServiceRecordServiceImpl.java (99%) rename {lis-services/src/main/java/hu/user/lis/services => lis-service/src/main/java/hu/user/lis/service}/data/SupplierService.java (74%) rename {lis-services/src/main/java/hu/user/lis/services => lis-service/src/main/java/hu/user/lis/service}/data/SupplierServiceImpl.java (96%) rename {lis-services/src/main/java/hu/user/lis/services => lis-service/src/main/java/hu/user/lis/service}/data/TreasuryService.java (89%) rename {lis-services/src/main/java/hu/user/lis/services => lis-service/src/main/java/hu/user/lis/service}/data/TreasuryServiceImpl.java (99%) create mode 100644 lis-service/src/main/java/hu/user/lis/service/nav/TaxOfficeDataDeserializer.java create mode 100644 lis-service/src/main/java/hu/user/lis/service/nav/mapper/InvoiceMapper.java create mode 100644 lis-service/src/main/java/hu/user/lis/service/nav/mapper/PartnerMapper.java create mode 100644 lis-service/src/main/resources/global.xjb create mode 100644 lis-service/src/main/resources/schemas/nav/gov/hu/NTCA/common.xsd create mode 100644 lis-service/src/main/resources/schemas/nav/gov/hu/OSA/CHANGELOG_2.0.md create mode 100644 lis-service/src/main/resources/schemas/nav/gov/hu/OSA/CHANGELOG_3.0.md create mode 100644 lis-service/src/main/resources/schemas/nav/gov/hu/OSA/catalog.xml create mode 100644 lis-service/src/main/resources/schemas/nav/gov/hu/OSA/invoiceAnnulment.xsd create mode 100644 lis-service/src/main/resources/schemas/nav/gov/hu/OSA/invoiceApi.xsd create mode 100644 lis-service/src/main/resources/schemas/nav/gov/hu/OSA/invoiceBase.xsd create mode 100644 lis-service/src/main/resources/schemas/nav/gov/hu/OSA/invoiceData.xsd create mode 100644 lis-service/src/main/resources/schemas/nav/gov/hu/OSA/serviceMetrics.xsd delete mode 100644 lis-services/pom.xml rename lis-ui/src/main/java/hu/user/lis/ui/{SlyCrmUIProperties.java => properties/ApplicationUIProperties.java} (65%) create mode 100644 lis-workflow/src/main/java/hu/user/lis/workflow/properties/WorkflowProperties.java create mode 100644 runConfigurations/server-dev.run.xml diff --git a/.idea/compiler.xml b/.idea/compiler.xml index 6773a7a..bd0c653 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -19,21 +19,33 @@ + + + + + + + + + + + - + \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml index 41e5117..37ee406 100644 --- a/.idea/encodings.xml +++ b/.idea/encodings.xml @@ -5,7 +5,7 @@ - + diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..ef24de5 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/TODO.txt b/TODO.txt index 42894b3..9c45aea 100644 --- a/TODO.txt +++ b/TODO.txt @@ -1,3 +1,20 @@ +0.1.6 +Számla import = Számlák (dinamikus, jelezzen ha van feladat bárhol) + -Számla iktatás + -Iktatandó számlák (dinamikus, jelezzen ha van feladat) + -Jóváhagyandó számlák (dinamikus, jelezzen ha van feladat) + +NAV xml mit tartalmaz? +XML-ből jöjjenek létre a tesztadatok +Kiállító adószám=partner: ha nincs ilyen, akkor egy partner rögzítésre menjen (előre kitölve) +NAV adatok nem átírhatóak +Először 3.1.3 végszámlák kezelődjenek: Online-Invoice\sample\Data sample\2020-12-07-Példaszámlák_v3.0-hoz.pdf" +1HUF, EUR, USD számla legyen, ebből egy amihez nincs partner +Megjegyzésben mi található (projekt ID kellene), csinálni egyet amiben van projektszám (Lauratol pelda) + +0.1.5 + + 0.0.6 * Projektek táblázat oszlopok sorrendje: Azonosító, Partner (inkább ügyfél), Név (inkább megnevezés), Kapcsolattartó. Értelemszerűen a projekt részletezésben s ügyfél és megnevezés legyen. * A projekt részletek képernyőn össze lehetne csukni a be és a kimenő számla táblázatokat. @@ -102,7 +119,6 @@ ld. associates --mindenhol lehessen törölni, legfejlebb a db szól -zkoss riporting!! -call árpi 14! diff --git a/lis-app/pom.xml b/lis-app/pom.xml index 5558872..557701d 100644 --- a/lis-app/pom.xml +++ b/lis-app/pom.xml @@ -131,7 +131,7 @@ hu.user - lis-services + lis-service 0.0.1-SNAPSHOT @@ -144,6 +144,18 @@ assertj-core 3.24.2 + + jakarta.xml.bind + jakarta.xml.bind-api + 3.0.1 + test + + + jakarta.activation + jakarta.activation-api + 2.0.1 + test + junit junit diff --git a/lis-app/src/main/resources/application-dev.yaml b/lis-app/src/main/resources/application-dev.yaml index adea4f1..d8c4c19 100644 --- a/lis-app/src/main/resources/application-dev.yaml +++ b/lis-app/src/main/resources/application-dev.yaml @@ -48,12 +48,13 @@ camunda.bpm: logging: level: org.hibernate.engine.jdbc.spi.SqlExceptionHelper: ERROR -hu: - user-ibm: - sly-crm: - ui: - user-name: user - password: password +application: + ui: + user-name: user + password: password + workflow: + import-invoice: + input-path: /temp/invoice-import # org.springframework.security.web: INFO # pattern: # console: "%d %-5level %logger : %msg%n" diff --git a/lis-app/src/main/resources/application.yaml b/lis-app/src/main/resources/application.yaml index 77ec089..58fe103 100644 --- a/lis-app/src/main/resources/application.yaml +++ b/lis-app/src/main/resources/application.yaml @@ -13,6 +13,8 @@ spring: properties: hibernate: format_sql: true + main: + banner-mode: off output: ansi: enabled: always @@ -22,6 +24,12 @@ spring: username: db2admin password: password camunda.bpm: + generic-properties.properties: + telemetry-reporter-activate: false + job-executor-acquire-by-priority: true + job-execution: + core-pool-size: 10 + #lock-time-in-millis: 600000 database: type: db2 schema-update: false diff --git a/lis-app/src/test/java/hu/user/lis/ReflectionsIT.java b/lis-app/src/test/java/hu/user/lis/ReflectionsIT.java index fbdfb3a..87d2166 100644 --- a/lis-app/src/test/java/hu/user/lis/ReflectionsIT.java +++ b/lis-app/src/test/java/hu/user/lis/ReflectionsIT.java @@ -9,7 +9,7 @@ import com.google.common.collect.Sets; import hu.user.lis.db.Associate; import hu.user.lis.db.Project; import hu.user.lis.db.Treasury; -import hu.user.lis.services.data.EntityDataService; +import hu.user.lis.service.data.EntityDataService; import lombok.extern.log4j.Log4j2; import org.apache.commons.lang3.SerializationUtils; import org.junit.Test; diff --git a/lis-app/src/test/java/hu/user/lis/RepositoryIT.java b/lis-app/src/test/java/hu/user/lis/RepositoryIT.java index 25bed1a..e04f850 100644 --- a/lis-app/src/test/java/hu/user/lis/RepositoryIT.java +++ b/lis-app/src/test/java/hu/user/lis/RepositoryIT.java @@ -9,8 +9,8 @@ import hu.user.lis.db.*; import hu.user.lis.db.repository.ProjectRepository; import hu.user.lis.db.repository.ServiceRecordRepository; import hu.user.lis.db.repository.TreasuryRepository; -import hu.user.lis.services.data.ProjectService; -import hu.user.lis.services.data.TreasuryService; +import hu.user.lis.service.data.ProjectService; +import hu.user.lis.service.data.TreasuryService; import lombok.extern.log4j.Log4j2; import org.junit.Test; import org.junit.runner.RunWith; diff --git a/lis-app/src/test/java/hu/user/lis/workflow/DeserializeInvoiceIT.java b/lis-app/src/test/java/hu/user/lis/workflow/DeserializeInvoiceIT.java new file mode 100644 index 0000000..f00b221 --- /dev/null +++ b/lis-app/src/test/java/hu/user/lis/workflow/DeserializeInvoiceIT.java @@ -0,0 +1,95 @@ +package hu.user.lis.workflow; + +import hu.gov.nav.schemas.osa._3_0.data.InvoiceData; +import hu.gov.nav.schemas.osa._3_0.data.InvoiceDetailType; +import hu.gov.nav.schemas.osa._3_0.data.SupplierInfoType; +import hu.user.lis.db.IncomingInvoice; +import hu.user.lis.db.Partner; +import hu.user.lis.service.nav.TaxOfficeDataDeserializer; +import lombok.extern.log4j.Log4j2; +import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.test.context.junit4.SpringRunner; + +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.Optional; + + +@Log4j2 +@SpringBootTest +@ComponentScan("hu.user.lis") +@RunWith(SpringRunner.class) +public class DeserializeInvoiceIT { + public static final String BELFOLDI_DEVIZAS_VEGSZAMLA_TOBB_ELOLEG_TETEL_XML = "Belfoldi devizas vegszamla tobb eloleg tetel.xml"; + public static final String BELFOLDI_VEGSZAMLA_XML = "Belfoldi vegszamla.xml"; + @Autowired + private TaxOfficeDataDeserializer taxOfficeDataDeserializer; + + @Test + public void deserializeFinalDomesticInvoiceTest() { + Path domesticInvoiceFile = Paths.get("src/test/resources/nav/invoice", "Belfoldi vegszamla.xml"); + Optional invoice = taxOfficeDataDeserializer.fromFile(domesticInvoiceFile, InvoiceData.class); + Assert.assertTrue(invoice.isPresent()); + + InvoiceData invoiceData = invoice.get(); + + InvoiceDetailType invoiceDetail = invoiceData.getInvoiceMain().getInvoice().getInvoiceHead().getInvoiceDetail(); + log.info("Számla {} kiállítás {} pénznem {} fizetési határidő {}", invoiceData.getInvoiceNumber(), + invoiceData.getInvoiceIssueDate(), invoiceDetail.getCurrencyCode(), invoiceDetail.getPaymentDate()); + + SupplierInfoType supplierInfo = invoiceData.getInvoiceMain().getInvoice().getInvoiceHead().getSupplierInfo(); + log.info("Szállító {} {} {}", supplierInfo.getSupplierName(), supplierInfo.getSupplierAddress().getDetailedAddress(), + supplierInfo.getSupplierTaxNumber().getVatCode()); + + } + + @Test + public void deserializeFinalDomesticForeignCurrencyInvoiceTest() { + Path domesticInvoiceFile = Paths.get("src/test/resources/nav/invoice", BELFOLDI_DEVIZAS_VEGSZAMLA_TOBB_ELOLEG_TETEL_XML); + Optional invoice = taxOfficeDataDeserializer.fromFile(domesticInvoiceFile, InvoiceData.class); + Assert.assertTrue(invoice.isPresent()); + + InvoiceData invoiceData = invoice.get(); + + InvoiceDetailType invoiceDetail = invoiceData.getInvoiceMain().getInvoice().getInvoiceHead().getInvoiceDetail(); + log.info("Számla {} kiállítás {} pénznem {} fizetési határidő {}", invoiceData.getInvoiceNumber(), + invoiceData.getInvoiceIssueDate(), invoiceDetail.getCurrencyCode(), invoiceDetail.getPaymentDate()); + + SupplierInfoType supplierInfo = invoiceData.getInvoiceMain().getInvoice().getInvoiceHead().getSupplierInfo(); + log.info("Szállító {} {} {}", supplierInfo.getSupplierName(), supplierInfo.getSupplierAddress().getDetailedAddress(), + supplierInfo.getSupplierTaxNumber().getVatCode()); + } + + @Test + public void finalDomesticInvoiceTest() { + Path domesticInvoiceFile = Paths.get("src/test/resources/nav/invoice", BELFOLDI_VEGSZAMLA_XML); + IncomingInvoice entity = taxOfficeDataDeserializer.getIncomingInvoice(domesticInvoiceFile); + Assert.assertNotNull(entity); + } + + @Test + public void invoicePartnerTest() { + Path domesticInvoiceFile = Paths.get("src/test/resources/nav/invoice", BELFOLDI_VEGSZAMLA_XML); + Partner entity = taxOfficeDataDeserializer.getPartner(domesticInvoiceFile); + Assert.assertNotNull(entity); + } + + @Test + public void finalDomesticForeignCurrencyInvoiceTest() { + Path domesticInvoiceFile = Paths.get("src/test/resources/nav/invoice", BELFOLDI_DEVIZAS_VEGSZAMLA_TOBB_ELOLEG_TETEL_XML); + IncomingInvoice entity = taxOfficeDataDeserializer.getIncomingInvoice(domesticInvoiceFile); + Assert.assertNotNull(entity); + } + + @Test + public void invoiceForeignCurrencyPartnerTest() { + Path domesticInvoiceFile = Paths.get("src/test/resources/nav/invoice", BELFOLDI_DEVIZAS_VEGSZAMLA_TOBB_ELOLEG_TETEL_XML); + Partner entity = taxOfficeDataDeserializer.getPartner(domesticInvoiceFile); + Assert.assertNotNull(entity); + } +} diff --git a/lis-app/src/test/resources/nav/invoice/Belfoldi devizas vegszamla tobb eloleg tetel.xml b/lis-app/src/test/resources/nav/invoice/Belfoldi devizas vegszamla tobb eloleg tetel.xml new file mode 100644 index 0000000..a7803cb --- /dev/null +++ b/lis-app/src/test/resources/nav/invoice/Belfoldi devizas vegszamla tobb eloleg tetel.xml @@ -0,0 +1,185 @@ + + + 2021/00345 + 2021-05-15 + false + + + + + + 99999999 + 2 + 41 + + Értékesítő Kft + + + HU + 1234 + Budapest + Hármas + utca + 1 + + + 12345678-12345678-12345678 + + + DOMESTIC + + + 99887764 + 2 + 02 + + + Beszerző Kft + + + HU + 7600 + Pécs + Északi + sugárút + 123 + + + + + NORMAL + 2021-05-10 + EUR + 343.00 + TRANSFER + 2021-05-30 + PAPER + + + + false + + 1 + + + VTSZ + 16010091 + + + true + PRODUCT + Érlelt szalámi + 1600.00 + KILOGRAM + 10.00 + 3430.00 + + + 16000.00 + 5488000.00 + + + 0.27 + + + 4320.00 + 1481760.00 + + + 20320.00 + 6969760 + + + + + 2 + + true + + ESZ-01 + 2021-05-02 + 340.00 + + + false + PRODUCT + Előleg 1 (2021.05.02 Árf: 340 HUF/EUR) + + + -7000.00 + -2401000.00 + + + 0.27 + + + -1890.00 + -648270.00 + + + -8890.00 + -3049270.00 + + + + + 3 + + true + + ESZ-02 + 2021-05-10 + 348.00 + + + false + PRODUCT + Előleg 1 (2021.05.10 Árf: 342 HUF/EUR) + + + -5000.00 + -1715000.00 + + + 0.27 + + + -1350.00 + -463050.00 + + + -6350.00 + -2178050.00 + + + + + + + + + 0.27 + + + 4000.00 + 1372000 + + + 1080.00 + 370440.00 + + + 4000.00 + 1372000.00 + 1080.00 + 370440.00 + + + 5080.00 + 1742440.00 + + + + + diff --git a/lis-app/src/test/resources/nav/invoice/Belfoldi vegszamla.xml b/lis-app/src/test/resources/nav/invoice/Belfoldi vegszamla.xml new file mode 100644 index 0000000..0588d0b --- /dev/null +++ b/lis-app/src/test/resources/nav/invoice/Belfoldi vegszamla.xml @@ -0,0 +1,140 @@ + + + AAA000568 + 2021-06-01 + false + + + + + + 99999999 + 2 + 41 + + Értékesítő Kft + + + HU + 1234 + Budapest + Hármas + utca + 1 + + + 12345678-12345678-12345678 + + + DOMESTIC + + + 99887764 + 2 + 02 + + + Beszerző Kft + + + HU + 7600 + Pécs + Északi + sugárút + 123 + + + + + NORMAL + 2021-06-01 + true + HUF + 1 + TRANSFER + 2021-06-09 + PAPER + + + + false + + + 1 + + + OWN + 112166 + + + true + PRODUCT + konyhabútor + 1 + PIECE + 600000 + 600000 + + + 600000.00 + 600000.00 + + + 0.27 + + + + + 2 + + true + + AAA000567 + 2021-05-10 + 1.00 + + + false + Előleg (AAA000567 számla) + + + -500000 + -500000 + + + 0.27 + + + + + + + + + 0.27 + + + 100000.00 + 100000.00 + + + 27000.00 + 27000.00 + + + 100000 + 100000 + 27000 + 27000 + + + 127000 + 127000 + + + + + diff --git a/lis-service/pom.xml b/lis-service/pom.xml new file mode 100644 index 0000000..ddfcdef --- /dev/null +++ b/lis-service/pom.xml @@ -0,0 +1,88 @@ + + + 4.0.0 + lis-service + + hu.user + lis + 0.0.1-SNAPSHOT + + + + + org.codehaus.mojo + jaxb2-maven-plugin + 3.1.0 + + + xjc + + xjc + + + + + + + + + src/main/resources/schemas/nav/gov/hu/NTCA/common.xsd + src/main/resources/schemas/nav/gov/hu/OSA/serviceMetrics.xsd + src/main/resources/schemas/nav/gov/hu/OSA/invoiceBase.xsd + src/main/resources/schemas/nav/gov/hu/OSA/invoiceData.xsd + + + + + + + + + + + org.springframework + spring-web + 5.3.24 + + + com.github.javafaker + javafaker + 1.0.2 + + + hu.user + lis-db + 0.0.1-SNAPSHOT + + + org.springframework + spring-context + 5.3.24 + + + com.fasterxml.jackson.core + jackson-databind + + + org.skyscreamer + jsonassert + + + jakarta.xml.bind + jakarta.xml.bind-api + 3.0.1 + + + jakarta.activation + jakarta.activation-api + 2.0.1 + + + com.sun.xml.bind + jaxb-impl + 3.0.1 + runtime + + + diff --git a/lis-services/src/main/java/hu/user/lis/services/api/AssociateApi.java b/lis-service/src/main/java/hu/user/lis/service/api/AssociateApi.java similarity index 90% rename from lis-services/src/main/java/hu/user/lis/services/api/AssociateApi.java rename to lis-service/src/main/java/hu/user/lis/service/api/AssociateApi.java index 3b2e8e3..f138349 100644 --- a/lis-services/src/main/java/hu/user/lis/services/api/AssociateApi.java +++ b/lis-service/src/main/java/hu/user/lis/service/api/AssociateApi.java @@ -1,8 +1,8 @@ -package hu.user.lis.services.api; +package hu.user.lis.service.api; import hu.user.lis.db.Associate; import hu.user.lis.db.repository.AssociateRepository; -import hu.user.lis.services.data.AssociateService; +import hu.user.lis.service.data.AssociateService; import lombok.extern.log4j.Log4j2; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestMapping; diff --git a/lis-services/src/main/java/hu/user/lis/services/api/DbApi.java b/lis-service/src/main/java/hu/user/lis/service/api/DbApi.java similarity index 94% rename from lis-services/src/main/java/hu/user/lis/services/api/DbApi.java rename to lis-service/src/main/java/hu/user/lis/service/api/DbApi.java index e8ddd6e..4bf1187 100644 --- a/lis-services/src/main/java/hu/user/lis/services/api/DbApi.java +++ b/lis-service/src/main/java/hu/user/lis/service/api/DbApi.java @@ -1,6 +1,6 @@ -package hu.user.lis.services.api; +package hu.user.lis.service.api; -import hu.user.lis.services.data.DataService; +import hu.user.lis.service.data.DataService; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.data.jpa.repository.JpaRepository; diff --git a/lis-services/src/main/java/hu/user/lis/services/api/GenerateApi.java b/lis-service/src/main/java/hu/user/lis/service/api/GenerateApi.java similarity index 97% rename from lis-services/src/main/java/hu/user/lis/services/api/GenerateApi.java rename to lis-service/src/main/java/hu/user/lis/service/api/GenerateApi.java index 4126745..1961313 100644 --- a/lis-services/src/main/java/hu/user/lis/services/api/GenerateApi.java +++ b/lis-service/src/main/java/hu/user/lis/service/api/GenerateApi.java @@ -1,4 +1,4 @@ -package hu.user.lis.services.api; +package hu.user.lis.service.api; import lombok.extern.log4j.Log4j2; import org.springframework.beans.factory.annotation.Autowired; @@ -37,7 +37,7 @@ public class GenerateApi { projectApi.deleteAll(); partnerApi.deleteAll(); projectStatusApi.deleteAll(); - + log.info("projectStatus"); projectStatusApi.generate(); log.info("partner"); diff --git a/lis-services/src/main/java/hu/user/lis/services/api/InvoiceApi.java b/lis-service/src/main/java/hu/user/lis/service/api/InvoiceApi.java similarity index 90% rename from lis-services/src/main/java/hu/user/lis/services/api/InvoiceApi.java rename to lis-service/src/main/java/hu/user/lis/service/api/InvoiceApi.java index b0b7d33..91bbee7 100644 --- a/lis-services/src/main/java/hu/user/lis/services/api/InvoiceApi.java +++ b/lis-service/src/main/java/hu/user/lis/service/api/InvoiceApi.java @@ -1,8 +1,8 @@ -package hu.user.lis.services.api; +package hu.user.lis.service.api; import hu.user.lis.db.Invoice; import hu.user.lis.db.repository.InvoiceRepository; -import hu.user.lis.services.data.InvoiceService; +import hu.user.lis.service.data.InvoiceService; import lombok.extern.log4j.Log4j2; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestMapping; diff --git a/lis-services/src/main/java/hu/user/lis/services/api/PartnerApi.java b/lis-service/src/main/java/hu/user/lis/service/api/PartnerApi.java similarity index 90% rename from lis-services/src/main/java/hu/user/lis/services/api/PartnerApi.java rename to lis-service/src/main/java/hu/user/lis/service/api/PartnerApi.java index dc96d5c..fe8b541 100644 --- a/lis-services/src/main/java/hu/user/lis/services/api/PartnerApi.java +++ b/lis-service/src/main/java/hu/user/lis/service/api/PartnerApi.java @@ -1,8 +1,8 @@ -package hu.user.lis.services.api; +package hu.user.lis.service.api; import hu.user.lis.db.Partner; import hu.user.lis.db.repository.PartnerRepository; -import hu.user.lis.services.data.PartnerService; +import hu.user.lis.service.data.PartnerService; import lombok.extern.log4j.Log4j2; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestMapping; diff --git a/lis-services/src/main/java/hu/user/lis/services/api/ProjectApi.java b/lis-service/src/main/java/hu/user/lis/service/api/ProjectApi.java similarity index 96% rename from lis-services/src/main/java/hu/user/lis/services/api/ProjectApi.java rename to lis-service/src/main/java/hu/user/lis/service/api/ProjectApi.java index 2ba6d76..ec1767f 100644 --- a/lis-services/src/main/java/hu/user/lis/services/api/ProjectApi.java +++ b/lis-service/src/main/java/hu/user/lis/service/api/ProjectApi.java @@ -1,4 +1,4 @@ -package hu.user.lis.services.api; +package hu.user.lis.service.api; import hu.user.lis.db.IncomingInvoice; import hu.user.lis.db.OutgoingInvoice; @@ -7,7 +7,7 @@ import hu.user.lis.db.Treasury; import hu.user.lis.db.repository.InvoiceRepository; import hu.user.lis.db.repository.ProjectRepository; import hu.user.lis.db.repository.TreasuryRepository; -import hu.user.lis.services.data.ProjectService; +import hu.user.lis.service.data.ProjectService; import lombok.extern.log4j.Log4j2; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestMapping; diff --git a/lis-services/src/main/java/hu/user/lis/services/api/ProjectAssociateApi.java b/lis-service/src/main/java/hu/user/lis/service/api/ProjectAssociateApi.java similarity index 90% rename from lis-services/src/main/java/hu/user/lis/services/api/ProjectAssociateApi.java rename to lis-service/src/main/java/hu/user/lis/service/api/ProjectAssociateApi.java index 46f3625..96f1974 100644 --- a/lis-services/src/main/java/hu/user/lis/services/api/ProjectAssociateApi.java +++ b/lis-service/src/main/java/hu/user/lis/service/api/ProjectAssociateApi.java @@ -1,8 +1,8 @@ -package hu.user.lis.services.api; +package hu.user.lis.service.api; import hu.user.lis.db.ProjectAssociate; import hu.user.lis.db.repository.ProjectAssociateRepository; -import hu.user.lis.services.data.ProjectAssociateService; +import hu.user.lis.service.data.ProjectAssociateService; import lombok.extern.log4j.Log4j2; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestMapping; diff --git a/lis-services/src/main/java/hu/user/lis/services/api/ProjectStatusApi.java b/lis-service/src/main/java/hu/user/lis/service/api/ProjectStatusApi.java similarity index 90% rename from lis-services/src/main/java/hu/user/lis/services/api/ProjectStatusApi.java rename to lis-service/src/main/java/hu/user/lis/service/api/ProjectStatusApi.java index a49794e..7b9ef43 100644 --- a/lis-services/src/main/java/hu/user/lis/services/api/ProjectStatusApi.java +++ b/lis-service/src/main/java/hu/user/lis/service/api/ProjectStatusApi.java @@ -1,8 +1,8 @@ -package hu.user.lis.services.api; +package hu.user.lis.service.api; import hu.user.lis.db.ProjectStatus; import hu.user.lis.db.repository.ProjectStatusRepository; -import hu.user.lis.services.data.ProjectStatusService; +import hu.user.lis.service.data.ProjectStatusService; import lombok.extern.log4j.Log4j2; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestMapping; diff --git a/lis-services/src/main/java/hu/user/lis/services/api/ServiceRecordApi.java b/lis-service/src/main/java/hu/user/lis/service/api/ServiceRecordApi.java similarity index 90% rename from lis-services/src/main/java/hu/user/lis/services/api/ServiceRecordApi.java rename to lis-service/src/main/java/hu/user/lis/service/api/ServiceRecordApi.java index 3c731a2..63327cd 100644 --- a/lis-services/src/main/java/hu/user/lis/services/api/ServiceRecordApi.java +++ b/lis-service/src/main/java/hu/user/lis/service/api/ServiceRecordApi.java @@ -1,8 +1,8 @@ -package hu.user.lis.services.api; +package hu.user.lis.service.api; import hu.user.lis.db.ServiceRecord; import hu.user.lis.db.repository.ServiceRecordRepository; -import hu.user.lis.services.data.ServiceRecordService; +import hu.user.lis.service.data.ServiceRecordService; import lombok.extern.log4j.Log4j2; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestMapping; diff --git a/lis-services/src/main/java/hu/user/lis/services/api/TreasuryApi.java b/lis-service/src/main/java/hu/user/lis/service/api/TreasuryApi.java similarity index 90% rename from lis-services/src/main/java/hu/user/lis/services/api/TreasuryApi.java rename to lis-service/src/main/java/hu/user/lis/service/api/TreasuryApi.java index b200a0c..6bbee50 100644 --- a/lis-services/src/main/java/hu/user/lis/services/api/TreasuryApi.java +++ b/lis-service/src/main/java/hu/user/lis/service/api/TreasuryApi.java @@ -1,8 +1,8 @@ -package hu.user.lis.services.api; +package hu.user.lis.service.api; import hu.user.lis.db.Treasury; import hu.user.lis.db.repository.TreasuryRepository; -import hu.user.lis.services.data.TreasuryService; +import hu.user.lis.service.data.TreasuryService; import lombok.extern.log4j.Log4j2; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestMapping; diff --git a/lis-services/src/main/java/hu/user/lis/services/data/AssociateService.java b/lis-service/src/main/java/hu/user/lis/service/data/AssociateService.java similarity index 91% rename from lis-services/src/main/java/hu/user/lis/services/data/AssociateService.java rename to lis-service/src/main/java/hu/user/lis/service/data/AssociateService.java index b169cb0..5055df6 100644 --- a/lis-services/src/main/java/hu/user/lis/services/data/AssociateService.java +++ b/lis-service/src/main/java/hu/user/lis/service/data/AssociateService.java @@ -1,4 +1,4 @@ -package hu.user.lis.services.data; +package hu.user.lis.service.data; import hu.user.lis.db.Associate; diff --git a/lis-services/src/main/java/hu/user/lis/services/data/AssociateServiceImpl.java b/lis-service/src/main/java/hu/user/lis/service/data/AssociateServiceImpl.java similarity index 99% rename from lis-services/src/main/java/hu/user/lis/services/data/AssociateServiceImpl.java rename to lis-service/src/main/java/hu/user/lis/service/data/AssociateServiceImpl.java index be5cf89..e9e21d7 100644 --- a/lis-services/src/main/java/hu/user/lis/services/data/AssociateServiceImpl.java +++ b/lis-service/src/main/java/hu/user/lis/service/data/AssociateServiceImpl.java @@ -1,4 +1,4 @@ -package hu.user.lis.services.data; +package hu.user.lis.service.data; import hu.user.lis.db.Associate; import lombok.extern.log4j.Log4j2; diff --git a/lis-services/src/main/java/hu/user/lis/services/data/DataGeneratorService.java b/lis-service/src/main/java/hu/user/lis/service/data/DataGeneratorService.java similarity index 86% rename from lis-services/src/main/java/hu/user/lis/services/data/DataGeneratorService.java rename to lis-service/src/main/java/hu/user/lis/service/data/DataGeneratorService.java index a89356c..77419f4 100644 --- a/lis-services/src/main/java/hu/user/lis/services/data/DataGeneratorService.java +++ b/lis-service/src/main/java/hu/user/lis/service/data/DataGeneratorService.java @@ -1,4 +1,4 @@ -package hu.user.lis.services.data; +package hu.user.lis.service.data; import com.github.javafaker.Faker; import org.springframework.stereotype.Service; diff --git a/lis-services/src/main/java/hu/user/lis/services/data/DataService.java b/lis-service/src/main/java/hu/user/lis/service/data/DataService.java similarity index 70% rename from lis-services/src/main/java/hu/user/lis/services/data/DataService.java rename to lis-service/src/main/java/hu/user/lis/service/data/DataService.java index c842c5c..5f0b564 100644 --- a/lis-services/src/main/java/hu/user/lis/services/data/DataService.java +++ b/lis-service/src/main/java/hu/user/lis/service/data/DataService.java @@ -1,4 +1,4 @@ -package hu.user.lis.services.data; +package hu.user.lis.service.data; import java.util.List; diff --git a/lis-services/src/main/java/hu/user/lis/services/data/DataServiceImpl.java b/lis-service/src/main/java/hu/user/lis/service/data/DataServiceImpl.java similarity index 97% rename from lis-services/src/main/java/hu/user/lis/services/data/DataServiceImpl.java rename to lis-service/src/main/java/hu/user/lis/service/data/DataServiceImpl.java index 43cbe5b..d83bb83 100644 --- a/lis-services/src/main/java/hu/user/lis/services/data/DataServiceImpl.java +++ b/lis-service/src/main/java/hu/user/lis/service/data/DataServiceImpl.java @@ -1,4 +1,4 @@ -package hu.user.lis.services.data; +package hu.user.lis.service.data; import com.fasterxml.jackson.databind.ObjectMapper; import lombok.extern.log4j.Log4j2; diff --git a/lis-services/src/main/java/hu/user/lis/services/data/EDocumentService.java b/lis-service/src/main/java/hu/user/lis/service/data/EDocumentService.java similarity index 82% rename from lis-services/src/main/java/hu/user/lis/services/data/EDocumentService.java rename to lis-service/src/main/java/hu/user/lis/service/data/EDocumentService.java index 5883770..975169a 100644 --- a/lis-services/src/main/java/hu/user/lis/services/data/EDocumentService.java +++ b/lis-service/src/main/java/hu/user/lis/service/data/EDocumentService.java @@ -1,4 +1,4 @@ -package hu.user.lis.services.data; +package hu.user.lis.service.data; import hu.user.lis.db.EDocument; diff --git a/lis-services/src/main/java/hu/user/lis/services/data/EDocumentServiceImpl.java b/lis-service/src/main/java/hu/user/lis/service/data/EDocumentServiceImpl.java similarity index 95% rename from lis-services/src/main/java/hu/user/lis/services/data/EDocumentServiceImpl.java rename to lis-service/src/main/java/hu/user/lis/service/data/EDocumentServiceImpl.java index 530b619..3fd291a 100644 --- a/lis-services/src/main/java/hu/user/lis/services/data/EDocumentServiceImpl.java +++ b/lis-service/src/main/java/hu/user/lis/service/data/EDocumentServiceImpl.java @@ -1,4 +1,4 @@ -package hu.user.lis.services.data; +package hu.user.lis.service.data; import hu.user.lis.db.EDocument; import lombok.extern.log4j.Log4j2; diff --git a/lis-services/src/main/java/hu/user/lis/services/data/EntityDataService.java b/lis-service/src/main/java/hu/user/lis/service/data/EntityDataService.java similarity index 98% rename from lis-services/src/main/java/hu/user/lis/services/data/EntityDataService.java rename to lis-service/src/main/java/hu/user/lis/service/data/EntityDataService.java index 58697ba..8384882 100644 --- a/lis-services/src/main/java/hu/user/lis/services/data/EntityDataService.java +++ b/lis-service/src/main/java/hu/user/lis/service/data/EntityDataService.java @@ -1,4 +1,4 @@ -package hu.user.lis.services.data; +package hu.user.lis.service.data; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/lis-services/src/main/java/hu/user/lis/services/data/EntityDataServiceBase.java b/lis-service/src/main/java/hu/user/lis/service/data/EntityDataServiceBase.java similarity index 97% rename from lis-services/src/main/java/hu/user/lis/services/data/EntityDataServiceBase.java rename to lis-service/src/main/java/hu/user/lis/service/data/EntityDataServiceBase.java index 4794792..4e469fb 100644 --- a/lis-services/src/main/java/hu/user/lis/services/data/EntityDataServiceBase.java +++ b/lis-service/src/main/java/hu/user/lis/service/data/EntityDataServiceBase.java @@ -1,4 +1,4 @@ -package hu.user.lis.services.data; +package hu.user.lis.service.data; import lombok.extern.log4j.Log4j2; import org.springframework.stereotype.Service; diff --git a/lis-services/src/main/java/hu/user/lis/services/data/InvoiceService.java b/lis-service/src/main/java/hu/user/lis/service/data/InvoiceService.java similarity index 93% rename from lis-services/src/main/java/hu/user/lis/services/data/InvoiceService.java rename to lis-service/src/main/java/hu/user/lis/service/data/InvoiceService.java index a2043c9..886a02d 100644 --- a/lis-services/src/main/java/hu/user/lis/services/data/InvoiceService.java +++ b/lis-service/src/main/java/hu/user/lis/service/data/InvoiceService.java @@ -1,4 +1,4 @@ -package hu.user.lis.services.data; +package hu.user.lis.service.data; import hu.user.lis.db.Invoice; diff --git a/lis-services/src/main/java/hu/user/lis/services/data/InvoiceServiceImpl.java b/lis-service/src/main/java/hu/user/lis/service/data/InvoiceServiceImpl.java similarity index 99% rename from lis-services/src/main/java/hu/user/lis/services/data/InvoiceServiceImpl.java rename to lis-service/src/main/java/hu/user/lis/service/data/InvoiceServiceImpl.java index 1c6cc2e..37663fe 100644 --- a/lis-services/src/main/java/hu/user/lis/services/data/InvoiceServiceImpl.java +++ b/lis-service/src/main/java/hu/user/lis/service/data/InvoiceServiceImpl.java @@ -1,4 +1,4 @@ -package hu.user.lis.services.data; +package hu.user.lis.service.data; import hu.user.lis.db.Currency; import hu.user.lis.db.Invoice; diff --git a/lis-services/src/main/java/hu/user/lis/services/data/PartnerService.java b/lis-service/src/main/java/hu/user/lis/service/data/PartnerService.java similarity index 91% rename from lis-services/src/main/java/hu/user/lis/services/data/PartnerService.java rename to lis-service/src/main/java/hu/user/lis/service/data/PartnerService.java index 79e85e4..9f5e59d 100644 --- a/lis-services/src/main/java/hu/user/lis/services/data/PartnerService.java +++ b/lis-service/src/main/java/hu/user/lis/service/data/PartnerService.java @@ -1,4 +1,4 @@ -package hu.user.lis.services.data; +package hu.user.lis.service.data; import hu.user.lis.db.Partner; diff --git a/lis-services/src/main/java/hu/user/lis/services/data/PartnerServiceImpl.java b/lis-service/src/main/java/hu/user/lis/service/data/PartnerServiceImpl.java similarity index 99% rename from lis-services/src/main/java/hu/user/lis/services/data/PartnerServiceImpl.java rename to lis-service/src/main/java/hu/user/lis/service/data/PartnerServiceImpl.java index ef51bdb..0410609 100644 --- a/lis-services/src/main/java/hu/user/lis/services/data/PartnerServiceImpl.java +++ b/lis-service/src/main/java/hu/user/lis/service/data/PartnerServiceImpl.java @@ -1,4 +1,4 @@ -package hu.user.lis.services.data; +package hu.user.lis.service.data; import com.fasterxml.jackson.databind.ObjectMapper; import com.github.javafaker.Address; diff --git a/lis-services/src/main/java/hu/user/lis/services/data/ProjectAssociateService.java b/lis-service/src/main/java/hu/user/lis/service/data/ProjectAssociateService.java similarity index 92% rename from lis-services/src/main/java/hu/user/lis/services/data/ProjectAssociateService.java rename to lis-service/src/main/java/hu/user/lis/service/data/ProjectAssociateService.java index 89a10fc..ee7286d 100644 --- a/lis-services/src/main/java/hu/user/lis/services/data/ProjectAssociateService.java +++ b/lis-service/src/main/java/hu/user/lis/service/data/ProjectAssociateService.java @@ -1,4 +1,4 @@ -package hu.user.lis.services.data; +package hu.user.lis.service.data; import hu.user.lis.db.Associate; import hu.user.lis.db.Project; diff --git a/lis-services/src/main/java/hu/user/lis/services/data/ProjectAssociateServiceImpl.java b/lis-service/src/main/java/hu/user/lis/service/data/ProjectAssociateServiceImpl.java similarity index 98% rename from lis-services/src/main/java/hu/user/lis/services/data/ProjectAssociateServiceImpl.java rename to lis-service/src/main/java/hu/user/lis/service/data/ProjectAssociateServiceImpl.java index 2746568..d2eb544 100644 --- a/lis-services/src/main/java/hu/user/lis/services/data/ProjectAssociateServiceImpl.java +++ b/lis-service/src/main/java/hu/user/lis/service/data/ProjectAssociateServiceImpl.java @@ -1,4 +1,4 @@ -package hu.user.lis.services.data; +package hu.user.lis.service.data; import hu.user.lis.db.Associate; import hu.user.lis.db.Project; diff --git a/lis-services/src/main/java/hu/user/lis/services/data/ProjectService.java b/lis-service/src/main/java/hu/user/lis/service/data/ProjectService.java similarity index 91% rename from lis-services/src/main/java/hu/user/lis/services/data/ProjectService.java rename to lis-service/src/main/java/hu/user/lis/service/data/ProjectService.java index 54b99e9..29f4579 100644 --- a/lis-services/src/main/java/hu/user/lis/services/data/ProjectService.java +++ b/lis-service/src/main/java/hu/user/lis/service/data/ProjectService.java @@ -1,4 +1,4 @@ -package hu.user.lis.services.data; +package hu.user.lis.service.data; import hu.user.lis.db.Project; diff --git a/lis-services/src/main/java/hu/user/lis/services/data/ProjectServiceImpl.java b/lis-service/src/main/java/hu/user/lis/service/data/ProjectServiceImpl.java similarity index 99% rename from lis-services/src/main/java/hu/user/lis/services/data/ProjectServiceImpl.java rename to lis-service/src/main/java/hu/user/lis/service/data/ProjectServiceImpl.java index a8b78a4..39e5b14 100644 --- a/lis-services/src/main/java/hu/user/lis/services/data/ProjectServiceImpl.java +++ b/lis-service/src/main/java/hu/user/lis/service/data/ProjectServiceImpl.java @@ -1,4 +1,4 @@ -package hu.user.lis.services.data; +package hu.user.lis.service.data; import hu.user.lis.db.Partner; import hu.user.lis.db.Project; diff --git a/lis-services/src/main/java/hu/user/lis/services/data/ProjectStatusService.java b/lis-service/src/main/java/hu/user/lis/service/data/ProjectStatusService.java similarity index 90% rename from lis-services/src/main/java/hu/user/lis/services/data/ProjectStatusService.java rename to lis-service/src/main/java/hu/user/lis/service/data/ProjectStatusService.java index dec8b54..e7262d4 100644 --- a/lis-services/src/main/java/hu/user/lis/services/data/ProjectStatusService.java +++ b/lis-service/src/main/java/hu/user/lis/service/data/ProjectStatusService.java @@ -1,4 +1,4 @@ -package hu.user.lis.services.data; +package hu.user.lis.service.data; import hu.user.lis.db.ProjectStatus; diff --git a/lis-services/src/main/java/hu/user/lis/services/data/ProjectStatusServiceImpl.java b/lis-service/src/main/java/hu/user/lis/service/data/ProjectStatusServiceImpl.java similarity index 98% rename from lis-services/src/main/java/hu/user/lis/services/data/ProjectStatusServiceImpl.java rename to lis-service/src/main/java/hu/user/lis/service/data/ProjectStatusServiceImpl.java index 944851e..d723e2f 100644 --- a/lis-services/src/main/java/hu/user/lis/services/data/ProjectStatusServiceImpl.java +++ b/lis-service/src/main/java/hu/user/lis/service/data/ProjectStatusServiceImpl.java @@ -1,4 +1,4 @@ -package hu.user.lis.services.data; +package hu.user.lis.service.data; import hu.user.lis.db.ProjectStatus; import lombok.extern.log4j.Log4j2; diff --git a/lis-services/src/main/java/hu/user/lis/services/data/ReflectEntity.java b/lis-service/src/main/java/hu/user/lis/service/data/ReflectEntity.java similarity index 98% rename from lis-services/src/main/java/hu/user/lis/services/data/ReflectEntity.java rename to lis-service/src/main/java/hu/user/lis/service/data/ReflectEntity.java index 099a13e..097cc7b 100644 --- a/lis-services/src/main/java/hu/user/lis/services/data/ReflectEntity.java +++ b/lis-service/src/main/java/hu/user/lis/service/data/ReflectEntity.java @@ -1,4 +1,4 @@ -package hu.user.lis.services.data; +package hu.user.lis.service.data; import org.springframework.stereotype.Service; diff --git a/lis-services/src/main/java/hu/user/lis/services/data/ServiceRecordService.java b/lis-service/src/main/java/hu/user/lis/service/data/ServiceRecordService.java similarity index 93% rename from lis-services/src/main/java/hu/user/lis/services/data/ServiceRecordService.java rename to lis-service/src/main/java/hu/user/lis/service/data/ServiceRecordService.java index 81d22db..612e1c8 100644 --- a/lis-services/src/main/java/hu/user/lis/services/data/ServiceRecordService.java +++ b/lis-service/src/main/java/hu/user/lis/service/data/ServiceRecordService.java @@ -1,4 +1,4 @@ -package hu.user.lis.services.data; +package hu.user.lis.service.data; import hu.user.lis.db.Project; import hu.user.lis.db.ServiceRecord; diff --git a/lis-services/src/main/java/hu/user/lis/services/data/ServiceRecordServiceImpl.java b/lis-service/src/main/java/hu/user/lis/service/data/ServiceRecordServiceImpl.java similarity index 99% rename from lis-services/src/main/java/hu/user/lis/services/data/ServiceRecordServiceImpl.java rename to lis-service/src/main/java/hu/user/lis/service/data/ServiceRecordServiceImpl.java index fa2f33b..035f97f 100644 --- a/lis-services/src/main/java/hu/user/lis/services/data/ServiceRecordServiceImpl.java +++ b/lis-service/src/main/java/hu/user/lis/service/data/ServiceRecordServiceImpl.java @@ -1,4 +1,4 @@ -package hu.user.lis.services.data; +package hu.user.lis.service.data; import hu.user.lis.db.Project; import hu.user.lis.db.ProjectAssociate; diff --git a/lis-services/src/main/java/hu/user/lis/services/data/SupplierService.java b/lis-service/src/main/java/hu/user/lis/service/data/SupplierService.java similarity index 74% rename from lis-services/src/main/java/hu/user/lis/services/data/SupplierService.java rename to lis-service/src/main/java/hu/user/lis/service/data/SupplierService.java index 853356d..2365833 100644 --- a/lis-services/src/main/java/hu/user/lis/services/data/SupplierService.java +++ b/lis-service/src/main/java/hu/user/lis/service/data/SupplierService.java @@ -1,4 +1,4 @@ -package hu.user.lis.services.data; +package hu.user.lis.service.data; import hu.user.lis.db.Supplier; diff --git a/lis-services/src/main/java/hu/user/lis/services/data/SupplierServiceImpl.java b/lis-service/src/main/java/hu/user/lis/service/data/SupplierServiceImpl.java similarity index 96% rename from lis-services/src/main/java/hu/user/lis/services/data/SupplierServiceImpl.java rename to lis-service/src/main/java/hu/user/lis/service/data/SupplierServiceImpl.java index 678cd6f..57b6cc5 100644 --- a/lis-services/src/main/java/hu/user/lis/services/data/SupplierServiceImpl.java +++ b/lis-service/src/main/java/hu/user/lis/service/data/SupplierServiceImpl.java @@ -1,4 +1,4 @@ -package hu.user.lis.services.data; +package hu.user.lis.service.data; import hu.user.lis.db.Supplier; import org.apache.commons.lang3.RandomStringUtils; diff --git a/lis-services/src/main/java/hu/user/lis/services/data/TreasuryService.java b/lis-service/src/main/java/hu/user/lis/service/data/TreasuryService.java similarity index 89% rename from lis-services/src/main/java/hu/user/lis/services/data/TreasuryService.java rename to lis-service/src/main/java/hu/user/lis/service/data/TreasuryService.java index c91e7bc..c1a3a08 100644 --- a/lis-services/src/main/java/hu/user/lis/services/data/TreasuryService.java +++ b/lis-service/src/main/java/hu/user/lis/service/data/TreasuryService.java @@ -1,4 +1,4 @@ -package hu.user.lis.services.data; +package hu.user.lis.service.data; import hu.user.lis.db.Treasury; diff --git a/lis-services/src/main/java/hu/user/lis/services/data/TreasuryServiceImpl.java b/lis-service/src/main/java/hu/user/lis/service/data/TreasuryServiceImpl.java similarity index 99% rename from lis-services/src/main/java/hu/user/lis/services/data/TreasuryServiceImpl.java rename to lis-service/src/main/java/hu/user/lis/service/data/TreasuryServiceImpl.java index f952ba7..455d6ba 100644 --- a/lis-services/src/main/java/hu/user/lis/services/data/TreasuryServiceImpl.java +++ b/lis-service/src/main/java/hu/user/lis/service/data/TreasuryServiceImpl.java @@ -1,4 +1,4 @@ -package hu.user.lis.services.data; +package hu.user.lis.service.data; import hu.user.lis.db.Currency; import hu.user.lis.db.Treasury; diff --git a/lis-service/src/main/java/hu/user/lis/service/nav/TaxOfficeDataDeserializer.java b/lis-service/src/main/java/hu/user/lis/service/nav/TaxOfficeDataDeserializer.java new file mode 100644 index 0000000..a4b3b83 --- /dev/null +++ b/lis-service/src/main/java/hu/user/lis/service/nav/TaxOfficeDataDeserializer.java @@ -0,0 +1,76 @@ +package hu.user.lis.service.nav; + +import hu.gov.nav.schemas.osa._3_0.data.InvoiceData; +import hu.gov.nav.schemas.osa._3_0.data.SupplierInfoType; +import hu.user.lis.db.IncomingInvoice; +import hu.user.lis.db.Partner; +import hu.user.lis.service.nav.mapper.InvoiceMapper; +import hu.user.lis.service.nav.mapper.PartnerMapper; +import jakarta.xml.bind.JAXBContext; +import jakarta.xml.bind.Unmarshaller; +import jakarta.xml.bind.annotation.adapters.NormalizedStringAdapter; +import lombok.extern.log4j.Log4j2; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.io.StringReader; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Optional; + +@Log4j2 +@Service +public class TaxOfficeDataDeserializer { + @Autowired + PartnerMapper partnerMapper; + + @Autowired + InvoiceMapper invoiceMapper; + + public Partner getPartner(Path file) { + InvoiceData invoiceData = fromFile(file, InvoiceData.class).orElseThrow(NullPointerException::new); + SupplierInfoType supplierInfo = invoiceData.getInvoiceMain().getInvoice().getInvoiceHead().getSupplierInfo(); + return partnerMapper.toEntity(supplierInfo); + } + + public Partner getPartner(String xml) { + InvoiceData invoiceData = fromXml(xml, InvoiceData.class).orElseThrow(NullPointerException::new); + SupplierInfoType supplierInfo = invoiceData.getInvoiceMain().getInvoice().getInvoiceHead().getSupplierInfo(); + return partnerMapper.toEntity(supplierInfo); + } + + public IncomingInvoice getIncomingInvoice(Path file) { + InvoiceData invoiceData = fromFile(file, InvoiceData.class).orElseThrow(NullPointerException::new); + return invoiceMapper.toEntity(invoiceData); + } + + public IncomingInvoice getIncomingInvoice(String xml) { + InvoiceData invoiceData = fromXml(xml, InvoiceData.class).orElseThrow(NullPointerException::new); + return invoiceMapper.toEntity(invoiceData); + } + + public Optional fromFile(Path file, Class clazz) { + Optional result = Optional.empty(); + try { + String xml = new String(Files.readAllBytes(file), StandardCharsets.UTF_8); + result = fromXml(xml, clazz); + } catch (Exception e) { + log.error("Error while deserializing the file {} to Object of type {}. System message: {}", file, clazz, e.getMessage()); + } + return result; + } + + public Optional fromXml(String xml, Class clazz) { + Optional result = Optional.empty(); + try { + Unmarshaller unmarshaller = JAXBContext.newInstance(clazz).createUnmarshaller(); + unmarshaller.setAdapter(new NormalizedStringAdapter()); + result = Optional.ofNullable(clazz.cast(unmarshaller.unmarshal(new StringReader(xml)))); + } catch (Exception e) { + log.error("Error while deserializing a XML text to Object of type {}. System message: {}", clazz, e.getMessage()); + } + return result; + } + +} diff --git a/lis-service/src/main/java/hu/user/lis/service/nav/mapper/InvoiceMapper.java b/lis-service/src/main/java/hu/user/lis/service/nav/mapper/InvoiceMapper.java new file mode 100644 index 0000000..7604b50 --- /dev/null +++ b/lis-service/src/main/java/hu/user/lis/service/nav/mapper/InvoiceMapper.java @@ -0,0 +1,37 @@ +package hu.user.lis.service.nav.mapper; + +import hu.gov.nav.schemas.osa._3_0.data.InvoiceData; +import hu.gov.nav.schemas.osa._3_0.data.LineType; +import hu.gov.nav.schemas.osa._3_0.data.LinesType; +import hu.user.lis.db.IncomingInvoice; +import org.mapstruct.AfterMapping; +import org.mapstruct.Mapper; +import org.mapstruct.Mapping; +import org.mapstruct.MappingTarget; + +import java.util.stream.Collectors; + +@Mapper +public interface InvoiceMapper { + @Mapping(target = "id", ignore = true) + @Mapping(target = "humanId", source = "invoiceNumber") + @Mapping(target = "createDate", source = "invoiceIssueDate") + @Mapping(target = "completionDate", source = "invoiceMain.invoice.invoiceHead.invoiceDetail.invoiceDeliveryDate") + @Mapping(target = "paymentDeadline", source = "invoiceMain.invoice.invoiceHead.invoiceDetail.paymentDate") + @Mapping(target = "currency", source = "invoiceMain.invoice.invoiceHead.invoiceDetail.currencyCode") + @Mapping(target = "netAmount", source = "invoiceMain.invoice.invoiceSummary.summaryNormal.invoiceNetAmount") + @Mapping(target = "vatAmount", source = "invoiceMain.invoice.invoiceSummary.summaryNormal.invoiceVatAmount") + @Mapping(target = "grossAmount", source = "invoiceMain.invoice.invoiceSummary.summaryGrossData.invoiceGrossAmount") + @Mapping(target = "title", ignore = true) + @Mapping(target = "income", constant = "true") + @Mapping(target = "planned", ignore = true) + IncomingInvoice toEntity(InvoiceData source); + + @AfterMapping + default void afterMapping(@MappingTarget IncomingInvoice.IncomingInvoiceBuilder builder, InvoiceData invoiceData) { + LinesType invoiceLines = invoiceData.getInvoiceMain().getInvoice().getInvoiceLines(); + String title = invoiceLines.getLine().stream().map(LineType::getLineDescription) + .collect(Collectors.joining(", ")); + builder.title(title); + } +} \ No newline at end of file diff --git a/lis-service/src/main/java/hu/user/lis/service/nav/mapper/PartnerMapper.java b/lis-service/src/main/java/hu/user/lis/service/nav/mapper/PartnerMapper.java new file mode 100644 index 0000000..35f4dcb --- /dev/null +++ b/lis-service/src/main/java/hu/user/lis/service/nav/mapper/PartnerMapper.java @@ -0,0 +1,36 @@ +package hu.user.lis.service.nav.mapper; + +import hu.gov.nav.schemas.osa._3_0.base.DetailedAddressType; +import hu.gov.nav.schemas.osa._3_0.base.TaxNumberType; +import hu.gov.nav.schemas.osa._3_0.data.SupplierInfoType; +import hu.user.lis.db.Partner; +import org.mapstruct.AfterMapping; +import org.mapstruct.Mapper; +import org.mapstruct.Mapping; +import org.mapstruct.MappingTarget; + +@Mapper +public interface PartnerMapper { + String ADDRESS_FORMAT = "%s %s, %s %s %s"; + String VATNR_FORMAT = "%s-%s-%s"; + + @Mapping(target = "id", ignore = true) + @Mapping(target = "address", ignore = true) + @Mapping(target = "name", source = "supplierName") + @Mapping(target = "vatNr", source = "supplierTaxNumber.vatCode") + @Mapping(target = "active", constant = "true") + Partner toEntity(SupplierInfoType source); + + @AfterMapping + default void setPartnerCompositeFields(@MappingTarget Partner.PartnerBuilder builder, SupplierInfoType source) { + DetailedAddressType detailedAddress = source.getSupplierAddress().getDetailedAddress(); + String address = String.format(ADDRESS_FORMAT, detailedAddress.getCity(), detailedAddress.getPostalCode(), + detailedAddress.getStreetName(), detailedAddress.getPublicPlaceCategory(), detailedAddress.getNumber()); + builder.address(address); + + TaxNumberType supplierTaxNumber = source.getSupplierTaxNumber(); + String vatNr = String.format(VATNR_FORMAT, supplierTaxNumber.getTaxpayerId(), supplierTaxNumber.getVatCode(), + supplierTaxNumber.getCountyCode()); + builder.vatNr(vatNr); + } +} \ No newline at end of file diff --git a/lis-service/src/main/resources/global.xjb b/lis-service/src/main/resources/global.xjb new file mode 100644 index 0000000..3cda00b --- /dev/null +++ b/lis-service/src/main/resources/global.xjb @@ -0,0 +1,13 @@ + + + + + + + + + \ No newline at end of file diff --git a/lis-service/src/main/resources/schemas/nav/gov/hu/NTCA/common.xsd b/lis-service/src/main/resources/schemas/nav/gov/hu/NTCA/common.xsd new file mode 100644 index 0000000..bc76bf2 --- /dev/null +++ b/lis-service/src/main/resources/schemas/nav/gov/hu/NTCA/common.xsd @@ -0,0 +1,783 @@ + + + + + + + Atomi string típus 100 hosszra + Atomic string type for 100 length + + + + + + + + + Atomi string típus 1024 hosszra + Atomic string type for 1024 length + + + + + + + + + Atomi string típus 128 hosszra + Atomic string type for 128 length + + + + + + + + + Atomi string típus 15 hosszra + Atomic string type for 15 length + + + + + + + + + Atomi string típus 16 hosszra + Atomic string type for 16 length + + + + + + + + + Atomi string típus 2 hosszra + Atomic string type for 2 length + + + + + + + + + Atomi string típus 200 hosszra + Atomic string type for 200 length + + + + + + + + + Atomi string típus 2048 hosszra + Atomic string type for 2048 length + + + + + + + + + Atomi string típus 255 hosszra + Atomic string type for 255 length + + + + + + + + + Atomi string típus 256 hosszra + Atomic string type for 256 length + + + + + + + + + Atomi string típus 32 hosszra + Atomic string type for 32 length + + + + + + + + + Atomi string típus 4 hosszra + Atomic string type for 4 length + + + + + + + + + Atomi string típus 4000 hosszra + Atomic string type for 4000 length + + + + + + + + + Atomi string típus 50 hosszra + Atomic string type for 50 length + + + + + + + + + Atomi string típus 512 hosszra + Atomic string type for 512 length + + + + + + + + + Atomi string típus 64 hosszra + Atomic string type for 64 length + + + + + + + + + Atomi string típus 8 hosszra + Atomic string type for 8 length + + + + + + + + + Általános UTC dátum + Generic UTC date + + + + + + + + Általános lebegőpontos érték + Generic float point value + + + + + + Általános UTC időbélyeg + Generic UTC timestamp + + + + + + + + Általános egész szám típus + Generic unsigned integer type + + + + + + + + SHA256 kód megadására szolgáló típus + Field type for holding an SHA256 code + + + + + + + + SHA512 kód megadására szolgáló típus + Field type for holding an SHA512 code + + + + + + + + Legfeljebb 100 karaktert tartalmazó szöveg típus + String of maximum 100 characters + + + + + + + + Legfeljebb 1024 karaktert tartalmazó szöveg típus + String of maximum 1024 characters + + + + + + + + Legfeljebb 15 karaktert tartalmazó szöveg típus + String of maximum 15 characters + + + + + + + + Legfeljebb 200 karaktert tartalmazó szöveg típus + String of maximum 200 characters + + + + + + + + Legfeljebb 255 karaktert tartalmazó szöveg típus + String of maximum 255 characters + + + + + + + + Legfeljebb 50 karaktert tartalmazó szöveg típus + String of maximum 50 characters + + + + + + + + Legfeljebb 512 karaktert tartalmazó szöveg típus + String of maximum 512 characters + + + + + + + + + Bankszámla megadására szolgáló típus + Type of bank account number + + + + + + + + + + Közösségi adószám típus + Community VAT registration number + + + + + + + + + + Országkód típus ISO 3166 alpha-2 szabvány szerint + Country code type (ISO 3166 alpha-2) + + + + + + + + + Megyekód + County code + + + + + + + + + Pénznem típus (ISO 4217 szabvány szerinti 3 hosszú pénznem kód) + Currency type (three digit ISO 4217 currency code) + + + + + + + + + Kereskedelmi gépjármű forgalmi rendszáma (csak betűk és számok) + Registration number of commercial motor vehicle (letters and numbers only) + + + + + + + + + + Irányítószám típus + ZIP code type + + + + + + + + + + SWIFT kódot leíró típus + SWIFT code type + + + + + + + + + + Adóazonosító jel típus + Tax identification number type + + + + + + + + + Az adószám nyolc jegyű törzsszám része + The 8-digit core number section of the tax number + + + + + + + + + ÁFA kód + VAT code + + + + + + + + + + Üzleti eredmény kód típus + Business result code type + + + + + Hiba + Error + + + + + Figyelmeztetés + Warn + + + + + Tájékoztatás + Information + + + + + + + Generált azonosító típus + Generated ID type + + + + + + + + + + Funkciókód típus + Function code type + + + + + Sikeres művelet + Successful operation + + + + + Hiba + Error + + + + + + + Lokalizációt jelölő típus + Localization type + + + + + Magyar + Hungarian + + + + + Angol + English + + + + + Német + German + + + + + + + Felhasználónév típus + Login type + + + + + + + + + + Lapozó paraméter típus kérések számára + Page parameter type for requests + + + + + + + + Lapozó paraméter típus válaszok számára + Page parameter type for responses + + + + + + + + Technikai eredmény kód típus + Technical result code type + + + + + Kritikus hiba + Critical error + + + + + Hiba + Error + + + + + + + A kérés tranzakcionális adatai + Transactional data of the request + + + + + A kérés/válasz azonosítója, minden üzenetváltásnál - adószámonként - egyedi + Identifier of the request/response, unique with the taxnumber in every data exchange transaction + + + + + A kérés/válasz keletkezésének UTC ideje + UTC time of the request/response + + + + + A kérés/válasz verziószáma, hogy a hívó melyik interfész verzió szerint küld adatot és várja a választ + Request version number, indicating which datastructure the client sends data in, and in which the response is expected + + + + + A header verziószáma + Header version number + + + + + + + Alap kérés adatok + Basic request data + + + + + A kérés tranzakcionális adatai + Transactional data of the request + + + + + A kérés authentikációs adatai + Authentication data of the request + + + + + + + Alap válasz adatok + Basic response data + + + + + A válasz tranzakcionális adatai + Transactional data of the response + + + + + Alap válaszeredmény adatok + Basic result data + + + + + + + Alap válaszeredmény adatok + Basic result data + + + + + Feldolgozási eredmény + Processing result + + + + + A feldolgozási hibakód + Processing error code + + + + + Feldolgozási üzenet + Processing message + + + + + Egyéb értesítések + Miscellaneous notifications + + + + + + + Kriptográfiai metódust leíró típus + Denoting type of cryptographic method + + + + + + + + + + Általános hibatípus minden REST operációra + Generic fault type for every REST operation + + + + + + + + Egyéb értesítések + Miscellaneous notifications + + + + + Értesítés + Notification + + + + + + + Értesítés + Notification + + + + + Értesítés kód + Notification code + + + + + Értesítés szöveg + Notification text + + + + + + + Technikai validációs választípus + Technical validation response type + + + + + Validációs eredmény + Validation result + + + + + Validációs hibakód + Validation error code + + + + + Feldolgozási üzenet + Processing message + + + + + + + A kérés authentikációs adatai + Authentication data of the request + + + + + A technikai felhasználó login neve + Login name of the technical user + + + + + A technikai felhasználó jelszavának hash értéke + Hash value of the technical user's password + + + + + A rendszerben regisztrált adózó adószáma, aki nevében a technikai felhasználó tevékenykedik + The taxpayer's tax number, whose name the technical user operates in + + + + + A kérés aláírásának hash értéke + Hash value of the request's signature + + + + + + + + Az összes REST operációra vonatkozó hibaválasz generikus elementje + General error response of every REST operation + + + + + + + + + + Az összes REST operációra vonatkozó kivétel válasz generikus elementje + General exception response of every REST operation + + + + + + + + diff --git a/lis-service/src/main/resources/schemas/nav/gov/hu/OSA/CHANGELOG_2.0.md b/lis-service/src/main/resources/schemas/nav/gov/hu/OSA/CHANGELOG_2.0.md new file mode 100644 index 0000000..66d9631 --- /dev/null +++ b/lis-service/src/main/resources/schemas/nav/gov/hu/OSA/CHANGELOG_2.0.md @@ -0,0 +1,308 @@ +# Changelog 2.0 + +`scroll down for English version` + +Változtatások 1.1-ről 2.0-ra. + +## 1) A módosítás igénye általánosságban +A 2.0-ás interfész verzió bevezetésének igénye kettős. Egyrészről, a rendszer 2018 júliusi éles indulása óta eltelt idő keletkeztetett annyi új lehetőséget és igényt, hogy megérje a számlabejelentő interfészből egy új nagy verzióban gondolkodni, másrészt az 1.0 verzió számos inkonzisztenciát és hiányosságot tartalmaz, melyeknek a kivezetésére megérett az idő. A 2.0-ás verzió tehát egyaránt tartalmaz új funkcionalitást és refaktot is. Figyelemmel arra, hogy nagy verzióról van szó és a változások breaking change-t jelentenek mind szerver mind kliens oldalon, a 2.0-ás séma új namespace-t kap. Nagy valószínűséggel számítani kell arra is, hogy a 2.0-ás üzeneteket a rendszer más URL-en fogadja majd mint jelenleg. + +### 1.1) Megoldani kívánt főbb problémák: + +- A technikai érvénytelenítés osztozik a számlabeküldésre használt /manageInvoice operációval az API struktúrában (ami miatt például lehet tömörítve is beküldeni, ami teljesen értelmetlen) miközben a belső tartalom függ a Data XSD-től is. Az összekapcsolás felesleges tageket (pl: technicalAnnulment boolean megadása) vagy más inkonzisztenciát (pl számla lekérdezésben lehetséges az ANNUL, mint operációs paraméter használata, amire sosincs találat) eredményez, és ellehetetleníti hosszútávon a /manageInvoice operáció moduláris bővítését. +- A számla lekérdezésben használt /queryInvoiceData operációban a bemenet és a kimenet is choice ami antipattern, továbbá ez miatt a válaszban nem lehet azt a méretkorlátot garantálni, ami a beküldések során a POST body méretére vonatkozik. +- A feldolgozás státusz lekérdezésre használt /queryInvoiceStatus operáció válaszában nem látszik a mentés ténye, azaz nem lehet tudni, mikortól lehet a módosító számláról adatot szolgáltatni. Ez eredményez olyan paradox eseteket, hogy a tranzakció még nincs teljesen feldolgozva, de az egyes számlák már lekérdezhetők mentett számlaként akár a felületen, akár az interfészen. +- A technikai érvénytelenítés jóváhagyási státusza nem kérdezhető le az API-n keresztül, így sem az újraküldés, sem más erre épülő folyamat nem automatizálható kliens oldalon. +- A vevő oldali számlalekérdezés nem lehetséges API-n keresztül. +- Az egyes módosító számlák modificationTimestamp alapján sorrendezhetők, de sem egyediséget, sem sorfolytonosságot nem lehet vizsgálni. +- Nem lehet 1 számlával több számlát módosítani. +- A számla kelte és a módosító okirat kelte 2 külön tag a sémaleíróban, ami a lekérdezésekben felesleges bonyodalmakat okoz. +- A frontendes és az API-s keresés nem egységes az egyenlőség és a kisebb-nagyobb relációk keresésében, plusz a kisebb-mint és nagyobb-mint keresőmezők XML struktúrája indokolatlanul terjengős. +- Az API XSD-ben rossz a típusosság számos kérés-és válasz elemre, az objektumok nem minden esetben generálhatók le helyesen. +- A CRC32 ellenőrző algoritmust le kell váltani egy kritográfiai hash függvénnyel, ami a teljes üzleti tartalmat védi. +- Nincs a rendszer működéséről metrika lekérdezési lehetőség. + +### 1.2) A tervezett megoldások + +- A technikai érvénytelenítés leválasztásra kerül a /manageInvoice operációról és saját operációt kap, melynek neve /manageAnnulment. Az operációhoz előzetesen ugyanúgy tokent kell kérni, mint a számlabeküldéshez. Az operáción belül ugyan úgy legfeljebb 100 indexig küldhető be technikai érvénytelenítés. Az egyes tételekhez kapcsolódó operáció külön singleType-ot kap, jelenleg egyetlen felvehető értékkel, az ANNUL enummal. Azon tranzakciók, amelyek tartalmaznak az ANNUL operáción kívül más műveletet is, szinkron ERROR hibával elutasításra kerülnek, tehát a tranzakciók homogenitását (vagy kizárólag adatszolgáltatás, vagy kizárólag technikai érvénytelenítés) továbbra is be kell tartani. Az érvénytelenítési adatokat ugyan úgy base64 kódoltan kell küldeni. A technikai érvénytelenítés adatai külön sémaleíróba, az invoiceAnnulment.XSD-be kerülnek, így az már független a data sémaleírótól. A szerver a kérésre ugyan úgy tranzakció azonosítót válaszol. Ezzel párhuzamosan a /manageInvoice kérésben a technicalAnnulment boolean törlésre kerül, és operációként csak CREATE, MODIFY, STORNO adható meg, ANNUL már nem. +- A korábbi homogén /queryInvoiceData operációból leválasztásra kerül a paraméteres keresés. A jelenlegi sémában a /queryInvoiceData keresőparaméterként csak számlaszámot fogad el, ezen felül kötelező egy új, invoiceDirection nevű tagban megadni, hogy a számlát kiállítóként vagy vevőként akarjuk-e lekérdezni. Ez rendezi a vevő oldali számla lekérdezés egyik felét is. A válaszban csak a lekérdezett számlaszám teljes adattartalma kerül visszaadásra, plusz az eddigi csomópontok (auditData, invoiceReference, compressedContentIndicator). +> Felhívjuk a figyelmet, hogy vevő oldali számlalekérdezés az interfészen is csak akkor lehetséges, ha a vevő adószáma ki van töltve az adatszolgáltatásban. A vevői adószámot nem tartalmazó számlák nem kereshetők! +- A paraméteres lekérdezés új operációja a /queryInvoiceDigest lesz. Mivel invoiceDirection ebben a kérésben is szerepel, ezzel egyben lehetőség van a vevő oldali számlák paraméteres lekérdezésére is. A keresőparaméterek teljesen új struktúrában adhatók meg, külön csomópontja van a kötelező, az opcionális, a relációs és a tranzakciós paramétereknek is. Az operáció válaszként csak digestet ad vissza, teljes tartalmat már sosem. Ha a listából szükség van valamely számlának a teljes tartalmára, akkor azt a /queryInvoiceData operációval le kell kérdezni. +> Felhívjuk a figyelmet, hogy vevő oldali számlalekérdezés az interfészen is csak akkor lehetséges, ha a vevő adószáma ki van töltve az adatszolgáltatásban. A vevői adószámot nem tartalmazó számlák nem kereshetők! +* Kötelező kereső paraméternek vagy kiállítási dátum tartományt, a beszúrás (feldolgozás) dátum tartományt, vagy az alapbizonylat sorszámát kell megadni. +* Dátum tartomány megadása esetén a működés és a válasz az eddigieknek megfelelő, míg az alapbizonylat sorszám megadásakor az összes olyan számla kivonat visszaadásra kerül, amely az adott számlaszámra hivatkozik. +* Az opcionális kereső paraméterek közé bekerült az ÁFA csoport tagjának adószáma és az adózó neve, melyet szintén vevői és kiállítói oldalon is meg lehet adni. +* A relációs kereső paraméterek listaszerűen tartalmazzák a korábban kisebb-mint, nagyobb-mint relációkban kereshető értékeket. Az újdonság, hogy a keresett érték mellett egy ötös listából lehet kiválasztani a relációs operátort. (egyenlő, kisebb, nagyobb, kisebb-mint, nagyobb-mint) A jelenlegi struktúra a jövőbeni bővítéseket is sokkal egyszerűbbé teszi. +* A relációs kereső paraméterek közé bekerül a fizetési határidő. +* A tranzakciós kereső paraméterekben az átrendezésen kívül csak annyi a változás, hogy összhangban a /manageInvoice operációban kieső ANNUL értékre, keresőparaméternek itt is csak a CREATE, MODIFY, STORNO értékek adhatók már meg. +* A digest lekérdezés lapozása 10 tételről 100 tételre változik. +- A /queryInvoiceStatus válasza opcionálisan visszaad egy annulmentVerificationStatus taget, amely a technikai érvénytelenítés jóváhagyási státuszait tartalmazza, ha a kérésben megadott transactionId egy technikai érvénytelenítést tartalmazó tranzakcióra mutat. +- A /queryInvoiceStatus operációban visszaadott invoiceStatus tag értékkészlete új elemmel, a SAVED értékkel bővült. A SAVED státusz sorrendben a PROCESSING és a DONE között áll, ekkor a tranzakció feldolgozása még nem fejeződött be, de az adott indexen lévő számla már elmentésre került, tehát az adatai lekérdezhetők, a rá módosító vagy stornó adatszolgáltatás már küldhető. +> Felhívjuk a figyelmet, hogy a SAVED státusz visszaadása nem egyenlő azzal, hogy az adatszolgáltatási kötelezettség teljesült, ezt továbbra is kizárólag a DONE státusz jelzi! Ezért a feldolgozás státusz lekérdezést egészen addig folytatni kell, amíg a tranzakció alatt minden tétel DONE vagy ABORTED nem lesz! +- Az API sémaleíróban minden kérés és válasz saját típust kapott. +- A módosító számlák kezelése átalakul a data sémaleíróban. Az invoiceReference csomópontból törlésre kerül a modificationIssueDate, a modificationTimestamp és a lastModificationReference. A törlendők közül a modificationIssueDate fogalmilag összevonásra kerül az invoiceIssueDate taggel, így az a 2.0-tól a számla VAGY a módosító okirat kiállítását jelenti. A többi törölt taget a 2.0-ban nem kell küldeni. Új elemként megjelenik a modificationIndex, amelyben a kliens oldalnak kell a módosítás sorrendiségét jelezni. A tag értéke 1-től kezdődik, logikailag az első módosító vagy stornó számlának kell az 1-es értéket kapnia. A szerver oldalon az egyediség vizsgálatra biztosan ERROR kerül bevezetésre, a sorfolytonosság ellenőrzésének lehetőségét még vizsgáljuk. Amennyiben megvalósításra kerül a sorfolytonosság ellenőrzése is, úgy elképzelhető, hogy a szerver oldali feldolgozásba késleltetés kerül be, ekkor - feltéve, hogy az alapszámla már beérkezett a rendszerbe-, adott időkeret állna rendelkezésre az egyes módosító okirat adatszolgáltatására, és a sorfolytonosság csak a késleltetési idő leteltét követően kerülne vizsgálatra. A modificationIndex a /queryInvoiceDigest válaszában visszaadásra kerül arra az esetre, ha az alapbizonylatra több módosító okiratot állítottak volna ki eltérő számlázó rendszerekből, és a módosításkor nem ismert a helyes következő érték. +* A törölt tagekkel egyidejűleg törlésre kerülnek azok a WARNING üzenetek, melyek ezek összefüggéseit vizsgálták. +- Lehetőség nyílik egy számlával több számlát módosítani. +* Ehhez elsőként szükség van arra, hogy a számlaszám és a számla kiállítának időpontja kikerüljön a jelenlegi helyéről, és az invoiceHead/invoiceData helyett rögtön legfelül, a root element után szerepeljen. A kiemelés azt is jelenti, hogy helytelen kiállítási dátum esetén logikailag nincs lehetőség a módosításra, ezért ennek javítására új technikai érvénytelenítési okot vezettünk be ERRATIC_INVOICE_ISSUE_DATE néven. +* A kiemelést követően lehetőség van a sémában egy choice szerint eldönteni, hogy 'egyes' adatszolgáltatást vagy kötegelt adatszolgáltatást írunk le. Az egyes adatszolgáltatás struktúrája ugyan az, mint az 1.1-ben. A kötegelt adatszolgáltatást batchInvoice néven lehet megképezni. A batchInvoice alatt egy megszámlálhatatlan listaelemben bárhányszor lehet ismételni az 'egyes' adatszolgáltatás szerinti struktúrát, egy batchIndex képzésével. +* A belső tartalomban batchInvoice taget értelemszerűen csak MODIFY vagy STORNO operációkban szabad képezni. További megkötés, hogy az ilyen adatszolgáltatásoknak kívül az API XML-ben csak 1 indexe lehet, tehát a kérés 100 helyett legfeljebb csak 1 adatszolgáltatást tartalmazhat ebben az esetben. Mindkét eset vizsgálatára új aszinkron ERROR kerül majd bevezetésre. +> Egyelőre nem látjuk indokoltnak, hogy bevezessünk 2 új operációt erre az esetre, (pl: BATCH_MODIFY és BATCH_STORNO) de ez a jövőben még változhat. +* A kötegelt módosítás feldolgozására vonatkozó hibaüzenetek könnyebb keresése miatt a /queryInvoiceStatus válaszában visszaadásra kerül az index mellett a batchIndex is, továbbá a pointerekbe mindenhol bekerül a hivatkozott számla száma, az originalInvoiceNumber is. +* A kötegelt módosítás feldolgozása a technikai érvénytelenítés szabályai szerint fog történni, azaz amennyiben bármely batchIndex alatti tétel ERROR miatt elbukik, úgy az egész adatszolgáltatás is el fog bukni az ellenőrzésen. +- Az adózó lekérdezésre használt /queryTaxpayer operáció visszaadja a lekérdezett adózó ÁFA csoport tagságát, valamint séma szinten tartalmazza az adózó rövid nevét. +* A kliens oldali lekérdezések gyakorisága alkalmazás oldalon korlátozva lesz. Ennek kialakításánál a metrika visszaadás költsége is szempont lesz, így ennek hiányában pontos értéket még nem tudunk mondani. +> Az operáció válasza egyelőre base64Binary, amint látjuk pontosan mi lesz benne, adunk ki külön XSD-t a tartalomhoz. Ez nem feltétlenül lesz a 2.0 része időben, de szeretnénk megteremteni már most a lehetőséget rá a sémában. +- Az API-ban új operációként megjelenik egy /queryInvoiceCheck operáció. A szolgáltatáshoz alap authentikációt kell végezni, mint a token kérésnél. Siker esetén a rendszer visszaadja, hogy a lekérdetett számlaszám létezik-e érvényesként a rendszerben, feltéve, hogy a lekérdezést végző adózó szerepel a számlán kiállítóként vagy vevőként. + +### 1.3) A requestSignature számítása a 2.0 verziótól +A requestSignature értékét a 2.0 verziótól minden operációban SHA2-512 helyett SHA3-512 függvénynel kell számolni. + +A /manageInvoice és a /manageAnnulment operációk alatt a requestSignature számítása továbbra is speciális. A változás az 1.1-hez képest, hogy ezekben az operációkban az indexenkénti részleges értékeket CRC32 helyett már SHA3-512 függvénnyel kell számolni, és az egyes indexek alatti operation és invoice tagek teljes tartalmát össze kell fűzni a számítás előtt. +Például az alábbi index +```xml + + false + + 1 + CREATE + QWJjZDEyMzQ= + + + +``` +részleges hash értéke a következő +```java +'CREATE' + 'QWJjZDEyMzQ=' -> SHA3-512(CREATEQWJjZDEyMzQ=) -> 4317798460962869bc67f07c48ea7e4a3afa301513ceb87b8eb94ecf92bc220a89c480f87f0860e85e29a3b6c0463d4f29712c5ad48104a6486ce839dc2f24cb +``` +A részleges hasheket index szerint monoton növekvő sorrendben össze kell fűzni, és az így képzett requestId+timestamp+signkey+konkatenált részleges hashekre kiszámolni a requestSignate értékét. +> Egy későbbi pull requestben adni fogunk példa XML-eket is. + +## 2) Egyéb Módosítások +A felsorolt főbb problémákon felül több adózói igény is érkezett egyes mezők hosszának vagy értékkészletének bővítésére, illetve számos más refakt elem is bekerül a sémaleírókba, az alábbiak szerint. Az összes módosítás tételes vizsgálatához össze lehet DIFF-elni a pull requestben szereplő 2.0-át az 1.1-es állapottal. + +### 2.1) API sémaleíró + +- software adatok küldése minden requestben kötelező, a belső elemekre új kötelezőségek kerültek +- a queryInvoiceData request teljesen új típusra változott (InvoiceQueryType) +- InvoiceResultType átnevezés -> InvoiceDataResultType +- InvoiceQueryParamsType típus bővítése a csoport tag adószámával (groupMemberTaxNumber) +- InvoiceQueryParamsType típusból az adószám paraméter törlése +- InvoiceQueryResultType típus törlése +- TaxpayerAddressType törlésre került, az adószám lekérdező válasza a data:DetailedAddressType típust használja a címadatokhoz +- A beszúrás időpontja data:TimestampType típusra változott és UTC időre kerül konvertálásra a válaszban +- batchIndex opcionálisan megadható az egyes számla lekérdezésekben +- névkonvenció miatt a korábbi /queryInvoiceStatus operáció átnevezésre került /queryTransactionStatus operációra +- a /queryTransactionStatus operáció válaszában szereplő processingResult listaelem számossága unbounded értékre módosult + +### 2.2) DATA sémaleíró + +- a lineExpressionIndicator tag kötelező, a LINE_EXPRESSION_INDICATOR_MISSING ellenőrzés 2.0-nál törölhető +* a lineExpressionIndicator tag default értéke false +- PostalCodeType új patternt kap, mostantól a szóköz és a kötőjel engedélyezett karakter (ha az nem a string elején vagy végén áll), a minimum hossz 3 karakterre csökkent +- lineDescription tag bővítésre kerül 512 hosszúra +- ProductCodeCategoryType új enum értéket kap (TESZOR), az új pattern hossz 5-ről 6-ra nő +- productCodeOwnValue tag bővítésre kerül 255 hosszúra +- invoiceDeliveryDate kötelező, a MANDATORY_CONTENT_MISSING ellenőrzés 2.0-nál törölhető +- InvoiceDataType átnevezése -> InvoiceDetailType +- IndexType kikerült az API-ból és a Data része lett +- LineNumberType típusban korlátozásra került a megadható hossz 20 helyiértékre +- QuantityType típus kiterjesztésre került 6-ról 10 tizedes jegyre +- ExchangeRateType típus minimum értéke 0.00-ról 0-ra változott +- TimestampType típusban opcionálissá vált a tört másodperc +- az árrés adózáshoz a sémában fogalmilag összevonásra kerül az ellenérték és a nettó érték + +### 3) ÁFA analitika előkészítés + +A megfelelő bázis időszaki adatok előállításához a 3.0-ás interfész előtt már szükség van arra, ha a bejövő számlaadatok tartalmazzanak alap ÁFA analitikához szükséges információkat is. + +Ennek jegyében a számlasorokba új, opcionális minősítő tag került, a neve lineNatureIndicator. A tag értékkészlete alapján az egyes számlasorokban szereplő tételeket minősíteni kell a szerint, hogy a tétel termékértékesítésnek, szolgáltatás nyújtásnak vagy egyéb besorolásúnak minősül-e. + +Ezen felül, minden QuantityType és MonetaryType típusú elemben, az érték kifejezhető volt a számla pénznemében és forintban is, a nevezett elemek kiegészítésre kerültek a megfelelő párjukkal, az alábbiak szerint: + +- egységár forintban (line/unitPriceHUF) +- tétel nettó összege forintban (invoiceLines/line/lineAmountsNormal/lineNetAmountData/lineNetAmountHUF) +- tétel bruttó összege forintban (invoiceLines/line/lineAmountsNormal/lineGrossAmountData/lineGrossAmountNormalHUF) +- tétel bruttó összege forintban (invoiceLines/line/lineAmountsSimplified/lineGrossAmountSimplifiedHUF) +- számla bruttó összege forintban (invoiceSummary/summaryGrossData/invoiceGrossAmountHUF) +- számla nettó összege forintban (invoiceSummary/summaryNormal/invoiceNetAmountHUF) +- számla adótartalom bruttó összege forintban (invoiceSummary/summarySimplified/vatContentGrossAmountHUF) +- adómérték nettó összege forintban (invoiceSummary/summaryNormal/summaryByVatRate/vatRateNetData/vatRateNetAmountHUF) +- adómérték bruttó összege forintban (invoiceSummary/summaryNormal/summaryByVatRate/vatRateGrossData/vatRateGrossAmountHUF) + +Az elemek kötelezősége öröklődik a sémában már korábban definiált párjukból. + +4) Változások 2020.02.06-án + +### 4.1) API sémaleíró + +- a requestVersion és headerVersion tagekről lekerültek a default értékek, mostantól nem lehet önbezárt taget küldeni ezeknél +- a /queryTaxpayer válaszában új elemek kerültek (infoDate, taxNumberDetail) +- a /queryTaxpayer válaszában a címadat listatípusra módosult (taxpayerAddressItem), a címadatok mellett a taxpayerAddressType elemben a cím típusa (székhely, telephely, fióktelep) +- a /queryInvoiceDigest kérésében az OriginalInvoiceNumberQueryType típus törlésre került, a mandatoryQueryParams/originalInvoiceNumber útvonal mostantól element, nem komplex típus +- a /queryInvoiceDigest kérésében az additionalQueryParams típus bővítésre került a taxNumber paraméterrel, amely a megtalált eredményeket szűkíti a megadott adószámmal (a keresett mező a keresés irányától függ ugyan úgy, ahogy a csomópont többi eleménél). Ezt kell használni a korábbi originalInvoiceNumber/supplierTaxNumber szűrés megadására vevő oldali lekérdezéskor. +- bevezetésre került a /queryInvoiceChainDigest operáció és a hozzá kapcsolódó request/response elemek +- bevezetésre került a /queryTransactionList operáció és a hozzá kapcsolódó request/response elemek + +### 4.2) serviceMetrics sémaleíró + +- a rendszer publikus működési metrikáit és a lekérdezések válaszstruktúráját tartalmazó séma publikálásra került + +-------------------------------------------------------------------------------------------------------------------------------------------- + +# Changelog 2.0 + +Comprehensive changes from 1.1 to 2.0. + +## 1) Reasons for the change in general + +There were two reasons for introducing the new 2.0 interface. First, many new opportunities and demands presented themselves since the actual launch of the system in July 2018, enough to justify considering a new major version for the invoicing interface. Second, Version 1.0 has a number of inconsistencies and shortcomings, and it is time to move beyond them. In other words, Version 2.0 contains both a new +functionality and refactorations. As this is a major version and it involves breaking changes on both the server and client sides, the 2.0 schema will receive its own namespace. It is also quite probable that the system will use a different URL to receive 2.0 messages than the one used currently. + +### 1.1) Main problems requiring solutions: + +- Technical annulment shares the /manageInvoice operation in the API structure used for submitting invoices (which allows it to be submitted in a compressed format, for example, even though doing so is completely pointless) while the internal content also depends on Data XSD. Linking results in unnecessary tags (e.g. boolean for technicalAnnulment) or other inconsistencies (e.g. ANNUL can be used as an operational parameter when querying invoices, but will never find any matches) and will make it impossible to extend the /manageInvoice operation in a modular fashion in the long run. +- The /queryInvoiceData operation used for querying invoices has both the input and output as choice. This is antipattern, and means that it is impossible to guarantee the POST body size limit for the response, as defined in the submissions. +- The response to the /queryInvoiceStatus operation used for querying the processing status does not show whether the invoice has been saved, meaning that it is impossible to know from when data can be provided regarding the modifying invoice. This can result in paradoxical cases, where the transaction is not yet fully processed, but the individual invoices can nonetheless be queried as saved invoices, either on the screen or through the interface. +- The approval status of technical annulment cannot be queried using the API, meaning that neither resubmission nor other processes conditional on resubmission can be automated on the client-side. +- Invoices cannot be queried through the API customer-side. +- While it is possible to sort the individual modifying invoices based on modificationTimestamp, it is not possible to verify uniqueness or sequentiality. +- It is not possible to modify multiple invoices using a single invoice. +- The issue date of the invoice and the issue date of the modifying document are two separate tags in the schema definition, which causes unnecessary complications in the queries. +- The equality, smaller-than and greater-than relations used in searches done through the frontend and through the API are not consistent. In addition, the XML structure for the smaller-than and larger-than search fields is unnecessarily verbose. +- The typing is incorrect for a number of request and response elements in the API XSD, meaning that it is not always possible to generate the objects correctly. +- The CRC32 checksum code needs to be replaced with a cryptographic hash function capable of fully protecting the business-related content. +- There is no metric query option regarding the system’s operation. + +### 1.2) Planned solutions + +- Technical annulment will be separated from the /manageInvoic operation, and will receive its own operation named /manageAnnulment. A token will need to be requested for the operation in advance, the same way as for submitting an invoice. Just as before, it will be possible to submit a technical annulment using the operation, up to 100 indexes. The operation associated with individual items will be given a separate singleType, currently with a single assignable value, which is the ANNUL enum. Transactions containing operations other than ANNUL will be rejected with a synchronous ERROR message, meaning that the transactions must still remain homogenous (purely data exchange, or purely technical annulment.) Annulment data must be sent coded in base64, just as before. A separate schema definition, invoiceAnnulment.XSD will be used for technical annulment data, meaning that it will be independent of the data schema definition. The server will still respond to the request with a transaction identifier, as before. In addition, the technicalAnnulment boolean will be deleted from the /manageInvoice request, meaning that only CREATE, MODIFY, and STORNO can be entered as operations, ANNUL is no longer valid. +- Parametric search will be separated from the previously homogeneous /queryInvoiceData operation. In the current schema, /queryInvoiceData only accepts an invoice number as a search parameter. In addition, there is a new invoiceDirection tag, in which it is mandatory to specify whether you wish to query the invoice as an issuer or a customer. This also settles one half of customer-side invoice queries. The response will only include the total data content of the queried invoice number, plus the previous nodes (auditData, invoiceReference, compressedContentIndicator). +> Please note that the interface will also only allow customer-side invoice queries if the customer’s tax number is filled out in the data exchange. Invoices without customer tax numbers cannot be queried! +- There will be a new operation for parametric queries, /queryInvoiceDigest. As this request also includes invoiceDirection, it will also be possible to perform a customer-side parametric query of the invoices. Search parameters can be structured completely differently. Mandatory, optional, relational and transactional parameters will all have different nodes. The operation will only provide a digest as a response, never the full content any more. If you need the full content for one of the invoices from the list, you can use the /queryInvoiceData operation to query it. +> Please note that the interface will also only allow customer-side invoice queries if the customer’s tax number is filled out in the data exchange. Invoices without customer tax numbers cannot be queried! +- You must provide either an issue or insert date range or the invoice number of the base document as a mandatory search parameter. +- When providing an issue data range, both the operation and the response will work the same way as they have before, whereas when providing the invoice number of the base document, all invoices referencing the provided invoice number will be returned. +- The optional search parameters now include the tax number for the VAT group member and the name of the taxpayer, which can also be entered either as a customer or as an issuer. +- The relational search parameters will now list the search values that could be searched previously in smaller-than and greater-than relations. What is new is that you can now select a relational operator from a list of five, in addition to the value searched (equal, smaller, greater, smaller-than, greater-than.) The current structure also makes future extensions much simpler. +- Relational query for invoice payment date is now possible. +- The paging parameter of the digest query is increased from 10 to 100 items. +- In addition to the reorganisation, the only change made to the transactional search parameters is that much like the way the ANNUL value was removed from the /manageInvoice operation, only the CREATE, MODIFY, STORNO values can now be provided as search parameters here as well. +- The response for /queryInvoiceStatus can optionally include an annulmentVerificationStatus tag containing the approval status of the technical annulment, as long as the transactionId provided in the request references a transaction containing a technical annulment. +- The invoiceStatus tag value set returned in the /queryInvoiceStatus operation now has a new element, the value SAVED. The SAVED status is sequentially between PROCESSING and DONE, when the processing of the transaction is not yet completed, but the invoice for the index provided has already been saved, meaning that its data can be queried, and it is ready for data exchange modifying or cancelling it. +> Please note that a returned status of SAVED does not mean that data exchange obligations have been met, DONE is still the only status signifying that! Accordingly, the processing status queries should continue until all line items for the transaction are DONE or ABORTED. +- All requests and responses in the API schema definition have been assigned their own type. +- Modifying invoices will be handled differently in the data schema definition. The modificationIssueDate, modificationTimestamp and lastModificationReference tags will be deleted from the invoiceReference node. Of these, modificationIssueDate will be conceptually merged with the invoiceIssueDate tag, meaning that as of Version 2.0, it will refer to the issue date of the invoice OR the modifying document. The other deleted tags will no longer need to be submitted in Version 2.0. There will also be a new element, modificationIndex, which should be filled out client-side to define the sequence of the modification. The value of the tag starts with 1, meaning that logically, the first modifying or cancelling invoice should be assigned a modificationIndex of 1. Uniqueness verification will definitely return an ERROR server-side, we are still investigating the possibility of sequentiality verification. If sequentiality verification is implemented, we may introduce a delay into server-side processing. In this case – provided that the system has already received the base invoice – there would be a predefined time frame available for the data exchange for the individual modification document, and sequentiality would only be tested after the expiry of the delay time. The /queryInvoiceDigest response will return the modificationIndex if several modifying documents were issued for the base document from different invoicing systems, and the correct next value in the sequence is not known at the time of modification. +- Along with the deleted tags, the WARNING messages used for investigating these relationships will also be deleted. +- It will be possible to modify multiple invoices using a single invoice. +- To do this, the first step is to move the invoice number and the invoice issue date from their current location, invoiceHead/invoiceData, and to include them right at the top, after the root element. This will also mean that the logic will not permit modifying an incorrect issue date. Therefore, to allow for doing so, we have introduced a new technical annulment reason, named ERRATIC_INVOICE_ISSUE_DATE. +- After moving the invoice number and the invoice issue date up to the top, the schema includes a choice defining whether it is a “singular” or a batch data exchange. The structure for a singular data exchange is identical to that in Version 1.1. Batch data exchanges can be created under the name batchInvoice. Under a batchInvoice element, you can repeat the “singular” data exchange structure any number of times in a non-enumerated list, by generating a batchIndex. +- In internal content, the batchInvoice tag should, of course, only be generated for MODIFY or STORNO operations. There is an additional restriction: data exchanges of this nature can only have 1 external index in the API XML, meaning that in these cases, the request can only include 1 data exchange instead of the usual 100. A new asynchronous ERROR will be introduced for both cases. +> We do not currently see a justification for introducing 2 new operations to handle these cases (e.g. BATCH_MODIFY and BATCH_STORNO), but this could change in the future. +- To allow for searching batch processing error messages more easily, the response to /queryInvoiceStatus will return both index and batchIndex. In addition, all of the pointers will also include the referenced invoice number, originalInvoiceNumber. +- Batch modifications will be processed according to the rules of technical annulment, i.e. if any batchIndex item fails due to an ERROR, the entire data exchange will fail verification. +- The /queryTaxpayer operation used for taxpayer query now will return the VAT group membership of the taxpayer, and now contains the shortened name on schema level. +- The frequency of client-side queries will be restricted on the application side. When designing this function, the cost of returning metrics will also be an aspect, therefore we cannot provide an precise value yet in the absence thereof. +> The response of the operation is currently base64Binary, and we will provide a separate XSD for the content as soon as we know exactly what will be included in it. This functionality will not necessarily be ready in time to make it into Version 2.0, but we would already like to create an option in the schema for it. +- The API will include a new operation, /queryInvoiceCheck. Using the service will require basic authentication, much like in the case of token requests. If successful, the system will return the fact of existence of the invoice, provided the invoice is valid and the tax number of the querying entity is present on the invoice as supplier or customer. + +### 1.3) The calculation of requestSignature, as of Version 2.0 + +As of Version 2.0, the value of requestSignature should be calculated using SHA3-512 instead of SHA2-512 for all operations. + +The calculation of requestSignature for the /manageInvoice and /manageAnnulment operations is still an exception. The difference, in +comparison to Version 1.1, is that the indexwise partial values for these operations should be calculated using SHA3-512 instead of CRC32, +and the full content of the operation and invoice tags under the individual indexes should be concatenated before calculating. For example, the partial hash value for index 1, given the following + +```xml + + false + + 1 + CREATE + QWJjZDEyMzQ= + + + +``` + +will be + +```java +'CREATE' + 'QWJjZDEyMzQ=' -> SHA3-512(CREATEQWJjZDEyMzQ=) -> 4317798460962869bc67f07c48ea7e4a3afa301513ceb87b8eb94ecf92bc220a89c480f87f0860e85e29a3b6c0463d4f29712c5ad48104a6486ce839dc2f24cb +``` + +The partial hashes should be concatenated in ascending order of index, then the requestSignate value for the resulting requestId+timestamp+signkey+concatenated partial hashes should be calculated. +> We will provide example XMLs as well in a future pull request. + +## 2) Other changes + +In addition to the main problems listed, we have received a number of taxpayer requests for extending the length or value set of various +fields, and a number of other refactored elements will also be included in the schema definitions, as per the following. To check all the +changes in detail, simply DIFF Version 2.0 and Version 1.1 in the pull request. + +### 2.1) API schema definition + +- software data must be sent in all requests, and there are new mandatory requirements for the internal elements +- the queryInvoiceData request has been changed to a completely new type (InvoiceQueryType) +- InvoiceResultType renamed -> InvoiceDataResultType +- InvoiceQueryParamsType was extended with the tax number for the group member (groupMemberTaxNumber) +- the tax number parameter was deleted from InvoiceQueryParamsType +- InvoiceQueryResultType was deleted +- TaxpayerAddressType was deleted, the response to tax number queries will use data:DetailedAddressType for address data (if the tagged address cannot be returned due to the requirements described by the response, we will fill out the missing tags with a uniform signifier defined in the specification, e.g. N/A) +- insert date is now changed to data:TimestampType and the value is converted to UTC time in the response +- batchIndex may be optionaly provided in single invoice queries +- the previous /queryInvoiceStatus operation is now renamed to /queryTransactionStatus operation due to naming convention +- the cardinality of the processingRequest list element in the response of /queryTransactionStatus operation is now unbounded + +### 2.2) DATA schema definition + +- the lineExpressionIndicator tag is mandatory, the LINE_EXPRESSION_INDICATOR_MISSING verification can be deleted in Version 2.0 +- the default value of the lineExpressionIndicator tag is false +- PostalCodeType will be given a new pattern: from now on, space and hyphen characters are allowed (as long as they are not at the start or the end of a string), and the minimum length has now been reduced to 3 characters +- the lineDescription tag is extended to a length of 512 characters +- ProductCodeCategoryType now has a new enum value (TESZOR), the length of the new pattern is extended from 5 to 6 +- the productCodeOwnValue tag is extended to a length of 255 characters +- invoiceDeliveryDate tag is mandatory, the MANDATORY_CONTENT_MISSING verification can be deleted in Version 2.0 +- InvoiceDataType renamed -> InvoiceDetailType +- IndexType was removed from the API, and is now a part of Data +- LineNumberType is now restricted to 20 digits length +- QuantityType is extended from 6 to 10 fracture digits +- ExchangeRateType lower bound is changed from 0.00 to 0 +- Fraction seconds in TimestampType are now optional +- For margin scheme taxation, consideration and net amount is now treated as identical notions in the schema + +### 3) VAT analytics preparation + +In order to have adequate base interval data it is necessary to have the incoming data to carry basic VAT analytics related data even before interface version 3.0. + +In light of this endeavour, line data has been supplemented with a new optional qualifier tag named lineNatureIndicator. Based on its values, all lines need to be classified whether they are supply of goods, supply of services or other . + +Furthermore, every QuantityType és MonetaryType element - where it is possible to express the value in the currency of the invoice or in HUF - have been supplemented with their corresponding pair as follows: + +- unit price in HUF (line/unitPriceHUF) +- line net amount in HUF (invoiceLines/line/lineAmountsNormal/lineNetAmountData/lineNetAmountHUF) +- line gross amount in HUF (invoiceLines/line/lineAmountsNormal/lineGrossAmountData/lineGrossAmountNormalHUF) +- line gross amount in HUF (invoiceLines/line/lineAmountsSimplified/lineGrossAmountSimplifiedHUF) +- summary gross amount in HUF (invoiceSummary/summaryGrossData/invoiceGrossAmountHUF) +- summary net amount in HUF (invoiceSummary/summaryNormal/invoiceNetAmountHUF) +- gross content summary in HUF (invoiceSummary/summarySimplified/vatContentGrossAmountHUF) +- VAT rate net amount in HUF (invoiceSummary/summaryNormal/summaryByVatRate/vatRateNetData/vatRateNetAmountHUF) +- VAT rate gross amount in HUF (invoiceSummary/summaryNormal/summaryByVatRate/vatRateGrossData/vatRateGrossAmountHUF) + +Cardinality of the new elements is inherited from their pair previously defined in the schema. + +4) Changes on 06.02.2020 + +### 4.1) API schema definition + +- default values of requestVersion and headerVersion elements are discarded, it not possible from now on to send self-closed tags +- the response of /queryTaxpayer now contains new elements (infoDate, taxNumberDetail) +- the address element in the response of /queryTaxpayer is now a list type (taxpayerAddressItem), and the qualifier of the addresses (hq, branch, site) is also returned +- OriginalInvoiceNumberQueryType in the request of /queryInvoiceDigest is deleted, the mandatoryQueryParams/originalInvoiceNumber path is now an element, not a complex type +- the additionalQueryParams type in the request of /queryInvoiceDigest is now extended with the taxNumber param, which filters the found invoices with the provided tax number. (the searched field is depending on the direction of the query, just like in case of the other similar elements) This tag must be used for setting the previous originalInvoiceNumber/supplierTaxNumber serch criteria in case of an inbound query. +- /queryInvoiceChainDigest operation is now added, along with it's own request/response elements +- /queryTransactionList operation is now added, along with it's own request/response elements + +### 4.2) serviceMetrics schema definition + +- the schema containing the response structure of the system's public operational metrics is now public \ No newline at end of file diff --git a/lis-service/src/main/resources/schemas/nav/gov/hu/OSA/CHANGELOG_3.0.md b/lis-service/src/main/resources/schemas/nav/gov/hu/OSA/CHANGELOG_3.0.md new file mode 100644 index 0000000..3c94b4a --- /dev/null +++ b/lis-service/src/main/resources/schemas/nav/gov/hu/OSA/CHANGELOG_3.0.md @@ -0,0 +1,559 @@ +# Changelog 3.0 + +`scroll down for English version` + +Változtatások 2.0-ról 3.0-ra. + +## 1) A módosítás igénye általánosságban + +A módosítási igények - ahogy a 2.0 esetében is voltak - ezúttal is többrétűek. Egyrészről szükséges biztosítani azt, hogy 2021.01.04-től a rendszer képes legyen fogadni API-n keresztül a magánszemélyeknek kiállított, közösségi és az export számlákat is. Másrészről az Online számla projekt elérkezett ahhoz a szakaszához, ahol már - tervezetten - nem akarunk a 3.0-ás állapothoz képest új XML API verziót kiadni (csak jogszabályi változás vagy nagyobb horderejű igény jövőbeni megjelenése esetén, és akkor sem biztos hogy ez nagy verzió lesz), ezért fenntarthatósági és hosszú távon fontos egyéb szempontokat is figyelembe akartunk venni. Ennek okán megkíséreltük kisimítani az összes olyan problémát az API-ból, ami eddig üzletileg vagy technikailag problémaként felmerült és olyan megoldást találni rá, amely mindkét oldal számára kielégítő. Legvégül de nem utolsó sorban pedig szükség van azon hiányzó adatok pótlására vagy nevesítésére, amelyek birtokában az ÁFA bevallási tervezetek pontosabban elkészíthetők. + +### 1.1) A tervezett megoldások + +- A 3.0-ás API egyik fő sarokköve az elektronikus számlázás katalizálása és használhatóbbá tétele. Ennek érdekében az API XML-ben megadható lesz az electronicInvoiceHash elem, amely az elektronikus számlák hash lenyomatát tartalmazza. Ez a módosítás még csak azt biztosítja, hogy a számla kiállítás és a számla módosítás során az üzleti adatok és a hash lenyomatok elválaszthatók lesznek egymástól. A módosítással az is kimondásra került, hogy az API nem támogatja azt a használati esetet, amikor csak az eredeti számla hash helyesbítése miatt érkezne be módosító adatszolgáltatás, ezért erre nem is biztosítunk beviteli lehetőséget. Az elektronikus hash miatt hibás adatszolgáltatások csak technikai érvénytelenítéssel javíthatók, ez miatt új érvénytelenítési ok került az Annulment sémába. +- Az elektronikus számlázás támogatását érintő másik fő változás, hogy a sémába bekerül egy olyan kötelező, completenessIndicator nevű jelölő, amelyben nyilatkozni lehet arról, hogy a 3.0-ás adatszolgáltatás keretében - az adózó saját döntése alapján - maga az elektronikus számla lesz beküldve, a séma szerinti XML formátumban, teljes adattartalommal. Ily módon a vevő már az adatszolgáltatás birtokában befogadhatja és kontírozhatja a számlát, nincs szükség további kézbesítésre, sem pedig az adatszolgáltatás és a számla későbbi (akár manuális) összehasonlítására. A jogszabályi környezet igazodni fog ehhez a változáshoz, a NAV ki fogja kényszeríteni ezen adatszolgáltatások esetében hogy az adatok integritása ne sérülhessen. Ezen számlák esetében az electronicInvoiceHash elemet az interfész dokumentációban meghatározott módon kell majd számolni és annak helyesnek is kell lennie. Ezen adatszolgáltatásokat továbbá nem lehet majd technikailag érvényteleníteni, tekintettel arra hogy a számla és az adatszolgáltatás között nem lehet eltérés, mivel az adatszolgáltatás maga a számla. Az ilyen számlákból készült számlaláncokra a NAV ezt a szolgáltatást csak bizonyos megkötésekkel biztosítja. (ld. ERROR módosítások fejezet) A funkciót csak 2021.01.04-től lehet igénybe venni, ezt megelőzően a feldolgozás átmeneti hibakóddal el lesz utasítva. +- A projekt indulása óta érdemben megoldatlan az ún. nagyméretű adatszolgáltatások problémája, amikor a POST body size meghaladja a 10 MB-t. Ez jellemzően olyan számlakiállítók esetében fordul elő kis számban, akik szektorális jogszabály alapján nagyon részletes számlát kell hogy kiállítsanak, pl telekommunikációs és közüzemi szolgáltatók. Ugyanakkor az ÁFA törvény messze nem vár el ilyen részletezettségű számlaadatokat, és az adatszolgáltatási kötelezettség is kizárólag az ÁFA törvény által előírt kötelező adattartalomra vonatkozik. Az interfész dokumentációt bővítjük egy olyan módszertani útmutatóval, amely segítségével ezeket az adatszolgáltatásokat termék és szolgáltatás alapján össze lehet vonni, miáltal a méret lecsökkenthető 10 Mb alá, a NAV számára releváns üzleti adat elvesztése nélkül. Az ilyen adatszolgáltatásokat a számlasorok felett egy új, mergedItemIndicator nevű kötelező jelölővel kell ellátni. +- 2021.01.04-től kötelező adatot szolgáltatni a közösségi export számlákról, illetve a nem ÁFA alanyok számára kiállított számlákról is. Ezeknek a fogadásához a customerInfo csomópont átalakul, ennek segítségével elkülöníthetők a belföldi, közösségi valamint harmadik országos számlák illetve a magánszemély vevőknek szóló számlák is. Szintén változás, hogy a 3.0-ban a magyar, közösségi és harmadik országos adószámok nem írhatók fel egymás mellé, kizárólag egyet lehet közülük megadni. (technikailag a korábbi sequence choice stuktúrává alakul) A magánszemélynek (ide nem értve az adószámos magánszemélyt, illetve az egyéni vállalkozót) kiállított számla adatszolgáltatása nem tartalmazhat név-és címadatokat, ezért a sémában ezen elemek opcionálissá váltak. A fenti szabálynak nem megfelelő adatszolgáltatásokat a rendszer blokkoló validációval elutasítja. (a nem magánszemélynek szóló adatszolgáltatásokon pedig továbbra is kötelező elem a név és a cím) +- Az exchangeRate tagban a 3.0-tól kezdődően megadható 0 értékű árfolyam, mert azon devizás ügyletek esetében amelyek felszámított adót nem tartalmaznak az árfolyam nem számítható ki helyesen. A rendszer WARNING-ot fog visszaadni azon esetekre, ahol az árfolyam = 0 de a számla pénznemében számított ÁFA összege bárhol nagyobb mint 0. Ezzel a módosítással egyidejűleg a korábbi ún. "6-os choice", hivatalosabb nevén VatRateType, amely az áthárított adó összegét (vagy az ÁFA mentesség okát, hatályon kívüliségét stb) tartalmazta kibővül egy 7-ik esettel, melynek a neve vatAmountMismatch. A vatAmountMismatch elemet akkor lehet megadni, amikor van adóalap, de nincs ÁFA összeg (vagy fordítva), például az ingyenes ügyletek esetében. Ugyancsak változás, hogy a vatRate csomópont megadható lesz egyszerűsített számlák esetén is. +- Az egyszerűsített számlák adótartalma mellett taxatíve megadhatók ugyan azok a speciális esetek is (mentesség, hatályon kívül, fordított adózás stb.) amelyek a normál és a gyűjtőszámlák esetében is használhatók. Az egységesítés miatt az egyszerűsített számlákban megadható adótartalom a VatRateType részévé válik, ezzel az elem "8-as choice" értékűre bővül. A rendszer blokkoló validációval el fogja utasítani azon adatszolgáltatásokat, amelyeknél a normál és gyűjtőszámlákban használt adómérték (vatPercentage) és az egyszerűsített számlákban használt adótartalom (vatContent) keveredik. A módosítás számlasor és számla összesítő szintjén is megjelenik. +- További változás a VatRateType esetében, hogy az ÁFA bevallások pontosításához az ÁFA mentesség(vatExemption) és a hatályon kívüliség (vatOutOfScope), valamint a vatAmountMismatch eseteiben az API külön kódot és indokolást fog elvárni. A kódot (pl: TAM, AAM stb) az interfész dokumentáció fogja tartalmazni és blokkoló validáció fogja kikényszeríteni a helyességét. Az indokolás pedig szabadon kitölthető ahogy a számlán az szerepel, a megadható hosszat pedig megduplázzuk. +- Az ÁFA bevallások készítéséhez szükség van az előlegszámla-végszámla kérdés rendezésére is. A 3.0-ás sémában sorszinten átalakul az előleg jelzés kezelése, és egy új, advanceData csomópontban lehetőség lesz megadni végszámla esetén - sorszinten - az előleget tartalmazó számla sorszámát, a teljesítés időpontját, valamint az alkalmazott árfolyamot. +- A közszolgáltatói elszámolószámlákra vonatkozó speciális szabályok miatt a sémába bekerült egy új, utilitySettlementIndicator nevű opcionális jelölő. A tag működését az interfész dokumentáció fogja tartalmazni. +- Azért, hogy a számlák automatikus feldolgozása minél univerzálisabb lehessen, számlafej szintre bekerül egy conventionalInvoiceInfo nevű, míg számla sor szintre egy conventionalLineInfo nevű csomópont. A 3.0-ás séma ez alatt a piaci gyakorlat szerint használt leggyakoribb egyezményes egyéb adatokat tartalmazza (pl: megrendelés számok, szállítólevél számok, szerződésszámok, főkönyvi számlaszámok, vállalat kódok, költséghelyek, cikkszámok stb) amiknek az egyezményes névvel ellátása segítheti a gépi feldolgozás elterjedését. +- Figyelemmel arra, hogy a 2020.07.01 óta történt értékhatár eltörlés miatt az Online számla API egy olyan közös nyelv és kommunikációs platform lett, amelyet országosan minden jogszabályok szerint működő számlázó szoftvernek ismernie kell, a NAV informatikailag továbbviszi ezt a koncepciót. Az Online számla saját sémáiból kiemelésre kerülnek azon generikus, üzleti katalógus jellegű, valamint a kommunikációt leíró típusok, amelyek más projektben is felhasználhatóak és átkerülnek egy új common XSD-be. A common XSD-nek saját névtere van és külön is verziózzuk, ami okán a Githubon is külön projektben található. (https://github.com/nav-gov-hu/Common) A kiemelés rengeteg namespace változással és átnevezéssel is jár az Online számla sémáiban, azonban a kiemelés azt eredményezi, hogy más, jövőben készülő NAV-os XML API-hoz nem kell új technikai felhasználókat létrehozni az adózóknak, az Online számla alatt regisztrált technikai felhasználók ugyan azokkal az authentikációs adatokkal és kulcsokkal, ugyan azon alap XML szerkezetben, ugyan azon (vagy hasonló) kriptográfiai metódusokkal képesnek lesznek más projekt API-t is megszólítani. Példaként a folyamatban lévő e-ÁFA projekt XML API-ját lehetne felhozni, amely képes lesz ezen működés támogatására. +- Tekintettel arra, hogy a common XSD esetében az Online számla projekt sémái már olyan névteret is importálnak amely már nem a projekt része, bevezetésre kerül a catalog XSD mint technológia (https://www.oasis-open.org/committees/download.php/14809/xml-catalogs.html#s.using.catalogs). Ez azt eredményezi, hogy minden tag elveszíti a "schemaLocation" attribútumát, az importok helyét NAV által szerkesztett sémában a catalog határozza meg. A legtöbb XML processzor az importált sémákat ugyan azon a filepath-on keresi mint ahol a feldolgozandó séma definíció is van, ezért minden fejlesztőnek el kell dönteni, hogy vagy visszaírja a "schemaLocation" értékeket a NAV-tól letöltött sémába saját magánál, vagy catalogot használ. Mindkét megoldás elfogadható. A common XSD esetében a catalog használatát azért javasoljuk mindenkinek, mert ha már több saját projektben fogja a common-os sémát használni akkor elég lesz csak egy helyen frissíteni ha a fenti séma változik. A catalogra adunk template fájlt, amit fel lehet majd használni. A template-ben lesz uri name és publicId támogatás is, valamint működni fog lokálból és webes resource eléréssel is a Github repón keresztül. +- Rendezésre kerül az XSD hierarchia, mi által megszűnik az invoiceData elsődlegessége az importok tekintetében. Ezt úgy lehet elérni, hogy az Online számla rendszerre nézve több sémában felhasznált azon típusok, amelyek túl speciálisak ahhoz hogy a common XSD-be kerüljenek kikerülnek egy új, invoiceBase nevű sémába. Az Online számla rendszer 3.0-ás sémái (Api, Data, Annulment, Metrics) már csak a common-t és az invoiceBase sémát importálják, ez által a függési struktúra tisztul. +- A hosszútávú fenntarthatóság érdekében a commonban bevezetésre kerül a CryptoType nevű típus. A típus lehetővé teszi, hogy az API alatt úgy lehessen hash és kriptográfiai algoritmust váltani, hogy ahhoz a sémát nem kell megváltoztatni. A cryptoType nevű attribútumot minden hash értéket tartalmazó elemnél kötelező lesz feltüntetni (passwordHash, requestSignature, electronicInvoiceHash). Az attribútum használható értékeit az interfész dokumentáció fogja tartalmazni. A hash értéket tartalmazó elemek hosszát jelentősen megnöveltük azért, hogy a későbbi algoritmusok kimenetei is elférjenek bennük, a validációs patterneket pedig hasonló okból fellazítottuk. (már nem csak hexadecimális érték adható meg) +- Az API szolgáltatásait bővítjük a Githubon beérkezett javaslatok alapján, az adózó lekérdező válasza visszaadja a lekérdezett adószám típusát (cég vagy egyéni vállalkozó), illetve a tranzakció listázó válasza visszaadja a listában lévő tranzakciók feldolgozási státuszát, ennek segítségével API-n keresztül is ellenőrizhető, hogy van-e az adózónak még nem lekérdezett adatszolgáltatási tranzakciója. +- INFO szintre átkerülnek azok a WARNING-ok, ahol a javítás az adózó részéről esetleges módosítás során sem lehetséges. + +### 1.2) Átállás, fejlesztői támogatás + +- Úgy becsüljük, hogy a 3.0-ás XML API-t tartalmazó fejlesztés szeptember végére lesz elérhető a teszt környezeten, a hozzá kapcsolódó magyar nyelvű interfész dokumentációval együtt. +- Okulva a 2.0-ás átállás tapasztalataiból felkészítettük a belső feldolgozó rendszereinket arra, hogy egyszerre kaphatnak éles adatot a 2.0-ás és a 3.0-ás számla adatokkal is. Így a 3.0-ás XML API már nem csak teszt rendszeren, hanem rögtön az éles környezetben is fogadhat adatot. Ettől azt reméljük, hogy akit verziókezelési okokból blokkol ha a NAV API nem működik az éles környezetben, azok tudni fognak haladni az átállással. A hardveres környezet elkészül a 3.0 élesítésére, ezért azonos performanciával fogjuk tudni kiszolgálni mindkét verziójú API kéréseit. +- Régóta tervezett fejlesztésünk valósul meg az által, hogy most már az XML API-hoz online elérhető openapi dokumentációt és swagger UI-t tudunk biztosítani. A swagger URL hamarosan elérhető lesz a teszt és éles rendszereken, de a Github readme is tartalmazni fogja amint a fejlesztés kikerül a publikus környezetekre. Az API definíció elérhető lesz a 2.0-ra és a 3.0-ra is egyaránt. A swaggerben a try-out funkciót is aktiváljuk, így felületről, kézzel összerakott XML beküldését ki is lehet majd próbálni. Az openapi dokumentáció generálását CI tool végzi automatikusan a release részeként, ezért garantálni tudjuk hogy mindig naprakész információ lesz elérhető. A funkció élesedéséről külön hírt fogunk kitenni az Online számla felületen. +- Az interfész dokumentáció a Githubra is felkerül, ez által gyorsabban - és aki követi a projektet, az automatikusan is, email útján - értesülhet arról, ha a dokumentáció frissült. +- Továbbra is biztosítjuk a gyors fejlesztői támogatást azon ticketekre, amelyeket DEV supportként adtok fel számunkra a Githubon. +- A séma véleményezésére, XML API-val kapcsolatos javaslatok adására érdemben a NAV oldali fejlesztés ideje alatt van lehetőség, utána már (szeptember végén elindul a műszaki notifikáció) csak korlátozottan, ezért ha van még nem kezelt eset vagy fejlesztési kérés, akkor kérjük azokat mielőbb tudassátok velünk, minden észrevételt szívesen fogadunk! + +FELHÍVJUK a figyelmet, hogy az Online számla felületről a 3.0-ás séma zipként, egyben lesz elérhető, de a Githubon a common XSD-t verziókezelési okok miatt nem tudjuk az Online számla projekt részévé tenni. Ezért aki Githubos forrás alapján akar dolgozni, annak külön kell letölteni a két sémát! (A tartalom természetesen ugyan az lesz, letöltési forrástól függetlenül.) + +## 2) Egyéb Módosítások + +### 2.1) Common és base sémaleíró (új sémák) + +- A commonban új típusként megjelenik az AtomicStringType, a SimpleTextNotBlank típusok ebből öröklődnek. Hasonlóan új típus a GenericDecimalType, amelyből a lebegőpontos értékek származnak. +- Minden Online számla sémában (Api, Data, Annulment, Metrics) egységesen a primitív xs:string típusok kivezetésre kerültek. Ezek a típusok már a common:AtomicStringType megfelelő hosszúságú típusait használják. Hasonlóképp a xs:decimal típusok is változnak GenericDecimalType-ra. +- A commonban használt request struktúrákban nincsenek software adatok, mivel azok Online számlához köthető, specifikus típusok. Azonban a software adatok megadása a 3.0-ban is kötelezők, azokat az API sémaleíróban öröklődéssel a BasicOnlineInvoiceRequestType típus terjeszti ki. +- A commonban a headerVersion, requestVersion elemek régi, 2.0-ás típusai törlése kerültek. Az elemek új típusa AtomicString15, és nincsenek enumjaik. (nem biztos hogy minden NAV projekt úgy fog/akar verziózni, ahogy az Online számla teszi) A verzió értékeket az intefész dokumentáció fogja tartalmazni, és a helyes értékeket a rendszer ki fogja kényszeríteni. (lényegi változás nincs kliens oldalon, az ellenőrzés a sémából átkerül szolgáltatás szintre, ez azoknak fontos aki generált XML-t használ mert ott már nem lesz automatikusan requestVersion 3.0) +- A BasicResultType egy új opcionális, notification nevű válaszelemmel bővült. Ezt a NAV a jövőben egyéb, API hívásokban értelmezhető tájékoztató üzenetek közlésére fogja használni. +- A base XSD-ben az alábbi típusok nevei megváltoznak, mivel túlságosan általánosak: +DateType -> InvoiceDateType +TimestampType -> InvoiceTimestampType +IndexType -> InvoiceIndexType +UnboundedIndexType -> InvoiceUnboundedIndexType + +### 2.2) API sémaleíró + +- TaxPayerDataType új elemmel bővül: incorporation, amely megmondja hogy az adószám gazdasági társaság vagy egyéni vállalkozó-e +- TransactionType kibővül a tranzakció státuszával (requestStatus) és a technikai érvénytelenítés (technicalAnnulment) tényével +- A /queryInvoiceDigest operáció válasza visszaadja a completenessIndicator értékét +- A /queryInvoiceDigest operáció válaszában pontosításra kerültek az ÁFA csoport tagok adószámait tartalmazó elemek nevei: supplierGroupTaxNumber -> supplierGroupMemberTaxNumber, customerGroupTaxNumber -> customerGroupMemberTaxNumber. Ezen kívül a válasz opcionálisan tartalmazza a beküldött electronicInvoiceHash tag értékét is. + +### 2.3) Annulment sémaleíró + +- az AnnulmentCodeType típus kibővült egy új technikai érvénytelenítési okkal: ERRATIC_ELECTRONIC_HASH_VALUE + +### 2.4) DATA sémaleíró + +- data:RegNumType -> common:PlateNumberType, és új a patternje, az EKÁER-rel azonosan (ÖÜŐ is megengedett) +- ekaerId-t átmozgatásra kerül az új egyezményes (conventionalInvoiceInfo) adatok közé, ez által fej és tétel szinten is megadható + +### 2.5) ERROR módosítások + +- új ERROR: a requestVersion és (ha meg van adva akkor) a headerVersion tag értéke csak az interfész dokumentációban engedélyezett lehet +- új ERROR: a timestamp értéke nem lehet kisebb mint 2010-01-01T00:00:00Z +- új ERROR: ha az alapszámlában a completenessIndicator értéke false, akkor egy módosító okiraté sem lehet true (az API nem támogatja az ilyen irányba történő váltást a számlaláncon belül, de a másik irányba történő váltás megengedett) +- új ERROR: ha privatePersonIndicator értéke false, akkor a customerName ÉS a customerAddress megadása kötelező (B2B számla) +- új ERROR: ha privatePersonIndicator értéke true, akkor sem a customerName sem a customerAddress, sem a customerVatData nem adható meg (B2C számla) +- új ERROR: ha a completenessIndicator értéke true, az invoiceAppearance értéke csak ELECTRONIC lehet +- új ERROR: az electronicInvoicehash megadása kötelező, ha a completenessIndicator értéke true +- új ERROR, ha az electronicInvoicehash értéke helytelen és a completenessIndicator értéke true +- új ERROR: ha a completenessIndicator értéke true akkor a mergedItemIndicator értéke nem lehet true +- új ERROR: ha a completenessIndicator értéke true akkor a vevő nem lehet magánszemély +- új ERROR: NORMAL vagy AGGREGATE számlának nem lehet lineAmountsSimplified sora vagy SIMPLIFIED számlának nem lehet lineAmountsNormal sora +- új ERROR: NORMAL vagy AGGREGATE számlában nem lehet vatContent értéket adni vagy SIMPLIFIED számlában nem lehet vatPercentage értéket adni a VatRateType típuson belül +- új ERROR: egy általános átmeneti hibakód is bekerül a rendszerbe, melyet első alkalommal a rendszer akkor fog visszaadni, amikor az elektronikus számlával egyenértékű 3.0-ás adatszolgáltatás érkezik 2021.01.04. előtt +- vatContent értéke már nem lehet 0, mivel a mentességi okok a VatRateType típuson belül taxatíve megadhatók + +### 2.6) WARNING módosítások + +- új WARNING: az exchangeRate értéke nem lehet 0, ha van bárhol (fej vagy sorszinten) olyan ÁFA összeg a számla pénznemében, aminek az értéke != 0 +- új WARNING: ha az mergedItemIndicator a számlaláncon belül bárhol true lett, onnantól végig true értéket kell kapjon a további módosítások során +- INFO szintre történő átsorolások felülvizsgálata folyamatban van +- a meglévő WARNING logika felülvizsgálata folyamatban van, ma leglévő észrevételek mellett az új felvetéseket is várjuk a Githubon + +### 2.7) Uppercase konverzió megszüntetése + +A 3.0-ás adatszolgáltatások feldolgozása során minden korábbi nagybetűsítés megszűnik a rendszerben. Minden string típus úgy kerül mentésre ahogy az az adatszolgáltatásban beérkezett. + +### 2.8) Séma- és üzleti változások az eddig publikált verzióhoz képest (2020.11.**) + +#### 2.8.1) Vevő státusza a számlával bizonylatolt ügyletben + +Több jelzés érkezett githubon és egyéb fórumokon, hogy az eddigi privatePersonIndicator magánszemély jelölővel nem minden üzleti eset megkülönböztethető. A jelölő helyett a customerVatStatus tag lett bevezetve, ebben a kötelező mezőben kell jelölni a vevő státuszát az adott ügyletben. Ennek lehetséges értékei a következők: +- DOMESTIC: Belföldi ÁFA alany. Ilyenkor a vevő nevének és címének (customerName, customerAddress) megadása kötelező. Adószámok közül csak a magyar adószám (customerVatData/customerTaxNumber) adható meg. Ez a megadás minden esetben kötelező, kivéve egy esetet, amikor az értékesítő(eladó) csak áfa regisztrált és nem belföldi fordított adózású az ügylet. +- OTHER: Egyéb (belföldi nem ÁFA alany, nem természetes személy, külföldi ÁFA alany és külföldi nem ÁFA alany, nem természetes személy). Ilyenkor a vevő nevének és címének (customerName, customerAddress) megadása kötelező. Adószámok közül (customerVatData) a háromból egy megadható, de nem kötelező. +- PRIVATE_PERSON: Nem ÁFA alany (belföldi vagy külföldi) természetes személy. Ilyenkor a vevői adatok közül a customerVatData, customerName, customerAddress megadása tilos, ezt blokkoló validáció ellenőrzi. + +#### 2.8.2) Adómérték (VatRateType) nyolcas choice átalakítása + +- az eddigi különbözet szerinti adózás jelölők (marginSchemeVat és marginSchemeNoVat) összevonásra kerültek egy mezőbe, melynek neve marginSchemeIndicator, típusa MarginSchemeType. Ez az egyszerűsítés azért lehetséges, mert a típus korábban is létezett tétel szinten, és lefedi az összes különbözet szerinti adózást (Vat és NoVat eseteket). Séma szintű enum értékek: TRAVEL_AGENCY, SECOND_HAND, ARTWORK, ANTIQUES. Az egyszerűsítés következtében a LineType complex típusból kikerült a marginSchemeIndicator (tehát a line/marginSchemeIndicator tag megszűnt), mivel annak megadása ezentúl az érték adatoknál (lineAmountsNormal/lineAmountsSimplified) történik meg. +- vatAmountMismatch átalakítása: mivel ezen eseteknél is létezik az adómérték fogalma, így a csomópontben szereplő korábbi case/reason átalakításra került vatRate/case bontásra. A vatRate-ben megadható értékek: 0.27, 0.18, 0.05, 0.2126, 0.1525, 0.0426. Értékét blokkoló üzleti validáció ellenőrzi. +- az előző pont miatt a vatAmountMismatch case értékek közül kikerült egy külön tagbe a noVatCharge eset (Nincs felszámított áfa a 17. § alapján), mivel ilyenkor nincs értelmezhető adómérték. Az új noVatCharge mező típusa boolean. +- UNKNOWN érték bevezetése a case értékek közé: előzmény nélküli és olyan módosító/sztornó számláknál, melyek 3.0 előtti verziójú számlára hivatkoznak, nem minden esetben határozható meg a pontos case érték a vatExemption/vatOutOfScope/vatAmountMismatch esetekben. Az UNKNOWN értékkel így bővült mindhárom esetben a case értékkészlet. Ez az érték kizárólag ilyen esetekben megadható. +- vatExemption és vatOutOfScope esetekben a reason mező hossza 100-ról 200-ra változott +- a boolean típusú adómértékeknél (vatDomesticReverseCharge, noVatCharge) csak a logikai igaz (true vagy 1) érték elfogadott séma szinten (fixed:true attribútum), hiszen üzletileg csak ekkor van értelme az adott módozat jelölésének. +- THK érték kivezetése a vatOutOfScope/case elfogadott értékek közül tétel és összesítő szinten is + +#### 2.8.3) ERROR módosítások + +- módosított ERROR: ha a vevő nem magánszemély (customerVatStatus értéke nem PRIVATE_PERSON), akkor a customerName ÉS a customerAddress megadása kötelező (B2B számla) +- módosított ERROR: ha a vevő magánszemély (customerVatStatus értéke PRIVATE_PERSON), akkor a customerName, customerAddress és a customerVatData nem adható meg (B2C számla) +- módosított ERROR: a passwordHash cryptoType attribútumának elfogadott értéke SHA-512 értékre módosult (a korábbi helytelenül definiált SHA2-512 helyett) +- módosított ERROR: vatExemption/vatOutOfScope/vatAmountMismatch esetén a case mezőben elfogadható az UNKNOWN érték, de csak előzmény nélküli és olyan módosító/sztornó számláknál, melyek 3.0 előtti verziójú számlára hivatkoznak +- törölt ERROR: ha van előleg adat az adott tételnél(advanceIndicator=true), akkor az advancePaymentData csomópont megadása nem kötelező, mivel előleg számlánál ezen adatok még nem állnak rendelkezésre +- új ERROR: ha a vevő belföldi áfa alany (customerVatStatus értéke DOMESTIC), akkor a magyar adószám megadása kötelező, kivéve egy esetet, amikor az értékesítő(eladó) csak áfa regisztrált és nem belföldi fordított adózású az ügylet +- új ERROR: ha a vevő belföldi áfa alany (customerVatStatus értéke DOMESTIC), akkor a közösségi adószám (communityVatNumber) megadása tilos +- új ERROR: ha a vevő belföldi áfa alany (customerVatStatus értéke DOMESTIC), akkor a harmadik országbeli adószám (thirdStateTaxId) megadása tilos +- új ERROR: tétel vagy összesítő szinten, ha az adóalap és felszámított adó eltér (vatAmountMismatch), akkor a vatAmountMismatch/vatRate értéke csak a következők valamelyike lehet: 0.27, 0.18, 0.05, 0.2126, 0.1525, 0.0426. +- új ERROR: az összes API-s kérésben megadott timestamp érték a szerveridő +- 1 nap intervallumon belül kell, hogy essen + + + +#### 2.8.4) Egyéb, kisebb mértékű változtatások + +- a /queryTransactionList operáció request része kiegészült az opcionális requestStatus mezővel, mellyel a tranzakció státuszára lehet szűrni. +- a common XSD-ben lévő PageType kettébontásra került RequestPageType és ResponsePageType típusokra. Erre azért volt szükség, mert 0 találat esetén a válaszban availablePage értéke 0. +- új közlekedési eszköz első forgalomba helyezés időpontja (firstEntryIntoService) opcionális lett a NewTransportMeanType típusban. +- az egyezményes, nevesített adatokat tartalmazó ConventionalInvoiceInfoType típusban a glnNumbers kettébontásra került glnNumbersSupplier és glnNumbersCustomer csomópontokra. +- az árfolyam az adatszolgáltatásnak általános kötelező adattartalmává vált. Így nem csupán az áthárított adót tartalmazó számlák esetén, hanem minden esetben valós árfolyammal szükséges tölteni ezt a mezőt. Ennek következtében az eddig a dokumentációban is szereplő nulla forintos árfolyam már nem lesz használható, melyet sémaszinten is kikényszerítjük. +- a queryTaxpayer adózói lekérdezés válaszában kibővült a gazdagási típus (IncorporationType) értékkészlete. Az új érték a TAXABLE_PERSON, mellyel az adószámos adózókat jelöljük, ezzel külön kezelve az egyéni vállalkozóktól. + +## 3) 3.0 átállási útmutató lépésről lépésre + +### 3.1) API + +#### 3.1.1) Kötelező API módosítások + +- Minden hívott URL-ben vezesd át a főverzió változást, '/v2/' helyett '/v3/' legyen mindenhol. +- Minden root elementnél emeld 3.0-ra az API-s séma namespace értékét, illetve kösd be a common XSD-t. Egy lehetséges példa: 'xmlns="http://schemas.nav.gov.hu/OSA/3.0/api" xmlns:common="http://schemas.nav.gov.hu/NTCA/1.0/common"'. +- Minden requestVersion tagban emeld a verzió értéket 3.0-ra. +- A header és user csomópontokban mindenhová (nyitó és zárótagekbe, illetve a gyermek tagekbe is) tedd bele a common XSD-re általad definiált namespace taget. Ha a példa szerinti ns-t használod, akkor ez a 'common:' lesz. +- A user/passwordHash tagba tedd bele a 'cryptoType="SHA-512"' attribútumot. +- A user/requestSignature tagba tedd bele a 'cryptoType="SHA3-512"' attribútumot. + +#### 3.1.2) Használatfüggő API módosítások + +- Ha használsz DTO generálást a projektedben, akkor az új sémákkal a projekt már nem fog fordulni. Vagy használj catalog XSD-t a common és a base sémák importálására és ezt kösd be a projekthez, vagy írd be a letöltött sémákba a schemaLocation attribútumot olyan filepath értékkel, ami neked megfelelő. (egy 2.0 szerinti séma deklarációs részét meg tudod nézni, hogyan szerepelt ez az attribútum pontosan a sémában korábban, ha szükséged van rá) A common XSD projektet itt éred el: https://github.com/nav-gov-hu/Common +- Ha használsz response validációt a projektedben, akkor ha szükséges készülj fel arra, hogy az API üzleti válaszait nem minden esetben (pl token kérésnél az encodedExchangeToken, számlabeküldésnél a transactionId vagy a lekérdezéseknél a válasz adatok) a default, hanem esetlegesen más namespace alatt fogod visszakapni mint ahogy az korábban a 2.0 alatt történt. Ez a common XSD importálásának egyik következménye. +- Ha a programod riportálja az elektronikus számlák ellenőrző hash értékét, akkor ezt a 3.0-ban már nem belül a Data XML-ben, hanem kívül, az API XML-ben kell megadnod. Az ehhez szükséges tag neve változatlanul electronicInvoiceHash, de a helye már a ManageInvoiceRequest/invoiceOperations/invoiceOperation/electronicInvoiceHash Xpath útvonalon található. Ne feledd, hogy ehhez a taghoz is tartozik cryptoType attribútum. A hash típusa completenessIndicator=false esetben csak SHA3-512 vagy SHA-256 lehet, de a hash értéke ekkor nem történik szerver oldali validáció. +- Ha használni szeretné a programod a 3.0 újdonsága szerinti elektronikus számlázást (completenessIndicator=true) akkor a cryptoType attribútumban a hash típusa csak SHA3-512 lehet, az értékét pedig az API XML-ben szereplő invoiceData objektumból kell kiszámolni, melynek helyességére a szerver validál. +- Ha a programod használja az adózó lekérdező /queryTaxpayer szolgáltatást, akkor készülj fel a válaszban az incorporation tag feldolgozására. +- Ha a programod használja a tranzakció listázó /queryTransactionList szolgáltatást, akkor készülj fel a válaszban a requestStatus és a technicalAnnulment tagek feldolgozására. +- Ha a programod használja a teljes adattartalmú számla lekérdező /queryInvoiceData szolgáltatást, akkor készülj fel hogy a válaszban már visszakaphatsz 3.0-ás számla XML-t is. Az ehhez kapcsolódó parsolási, üzleti, megjelenítési és egyéb program módosításokat kezeld le magadnál. Szintén készülj fel arra, hogy az operáció visszaadhatja az electronicInvoiceHash értékét is, amikor az ki volt töltve a beküldésnél. +- Ha a programod használja a kivonatos számla lekérdező /queryInvoiceDigest szolgáltatást, akkor készülj fel a válaszban a completenessIndicator tag feldolgozására, illetve készülj fel, hogy az eladó és a vevő csoportos adószámát már más néven fogod visszakapni. (ld: 2.2 fejezet) +- Javasoljuk, hogy készülj fel a válaszokban opcionálisan érkező notification tag értékének feldolgozására és megjelenítésére a felhasználók felé! A szerver még nem ad vissza a tagban értéket (a használatba vétel külön fejlesztés lesz), unit teszttel vagy debugban tudod kipróbálni hogy a program jól működik-e. +- Gondold végig, hogy az uppercase konverzió megszüntetése okoz-e bármiféle törést vagy nem várt változást a programodban (pl /queryInvoiceData és /queryInvoiceDigest válaszának változásai miatt) és ha szükséges akkor kezeld le őket! + +### 3.2) Data + +#### 3.2.1) Kötelező Data módosítások + +- az InvoiceData root elementnél emeld 3.0-ra az Data séma namespace értékét, illetve kösd be a Base XSD-t. Egy lehetséges példa: 'xmlns="http://schemas.nav.gov.hu/OSA/3.0/data" xmlns:base="http://schemas.nav.gov.hu/OSA/3.0/base"' +- A számla felső szintű adatainál meg kell adnod a completenessIndicator tag értékét, ez határozza meg hogy az adatszolgáltatás egyenértékű-e a kibocsátott elektronikus számlával. Az új tag helye az invoiceIssueDate tag után következik. Javasoljuk, hogy egyelőre mindenki használja default false értékkel, mivel 2021.01.04-ig a szerver nem fogadhat el adatszolgáltatásokat true értékkel. Az üzleti funkció használatát pedig javasoljuk valamilyen dinamikusan változtatható üzleti vagy konfigurációs paraméterhez kötni, hogy csak az aktiválásához ne kelljen külön kliens oldali release-t kiadni, amikor majd itt az idő. +- Három komplex adattípus esetében át kell vezetned a Base XSD namespace értékét a gyermek tagekben. Ezek a magyar adószámot leíró TaxNumberType (törzsszám, ÁFA kód, megyekód) illetve a címtípusok, függetlenül attól hogy egyszerűsített (SimpleAddressType) vagy tagolt (DetailedAddressType) címekről van-e szó. Ezt a módosítást minden olyan helyen át kell vezetned, ahol a felsorolt típusok a Data XML-ben előfordulhatnak. Figyelj rá, hogy ez nem olyan namespace módosítás mint ami az API-nál van, itt a szülő tag nem kaphat új namespace értéket! Tehát, amíg az API esetében így néz ki a helyes ns: + +```xml + + + + String + 2020-09-06T12:09:24.901Z + 3.0 + 1.0 + +``` +addig a Data esetében, például a kiállító adatainál már így (feltéve hogy a példa szerinti ns-t, a 'base:' értéket használod): + +```xml + + + 2021/1 + 2020-09-06 + false + + + + + + 88888888 + 5 + 41 + + + 44444444 + 4 + 42 + + Supplier Ltd. + + + HU + 1031 + Budapest + Example street 1. + + + +``` + +Látható, hogy amíg az API-ban a header tag is új ns-t kapott (nem csak az alatta lévő gyermek tagek), addig a supplierTaxNumber és a supplierAddress tagek maradtak a default namespace alatt, csak a gyermek tagek kaptak új ns értéket. +- A vevő adatainak felírását már úgy kell kezdened, hogy a customerVatStatus tagban megadod, hogy a számla vevője belföldi ÁFA alany/nem ÁFA alany természetes személy/ egyéb. A tag helye sorrendben legelöl van a customerInfo tagen belül. Javasoljuk, hogy ennek az információnak a bevitelére legyen UI beviteli funkció (amennyiben más üzleti logika alapján ez nem derül ki) és ezt a számlát készítő felhasználó adja meg, mert a vevő adószámának hiánya nem feltétlen jelenti azt, hogy a vevő egyben magánszemély is, nehéz az algoritmizáció. (pl. egyéni vállalkozó vevők számlái) +- Minden nem magánszemélyes számlánál a vevői adószámot új Xpath alatt, a customerInfo/customerVatData alatt lehet megadni, ezt kezeld le magadnál. Figyelj rá, hogy nem lesz feltétlenül minden nem magánszemélyes számlánál adószám (pl. gazdasági tevékenységet nem folytató társasház, egyesület stb.) +- Építs kitöltési logikát a vevői adatok XML-ben történő szerepeltetésére: + - ha a vevő belföldi ÁFA alany, akkor + - a magyar (plusz opcionálisan az ÁFA csoport) adószám (customerTaxNumber+groupMemberTaxNumber) megadása kötelező, kivéve, ha az eladó ÁFA regisztrált + - név (customerName) és cím (customerAddress) megadása kötelező + - ha a vevő nem ÁFA alany (belföldi vagy külföldi) természetes személy, akkor + - sem név (customerName), sem cím (customerAddress), sem pedig vevő adószámot (customerVatData) tartalmazó csomópont nem adható meg + - ha a vevő egyéb (belföldi nem ÁFA alany, nem természetes személy, külföldi Áfa alany és külföldi nem ÁFA alany, nem természetes személy), akkor + - a magyar (plusz opcionálisan az ÁFA csoport) adószám (customerTaxNumber+groupMemberTaxNumber), a közösségi adószám (communityVatNumber) és a harmadik országos adószám (thirdStateTaxId) közül kizárólag egyet lehet megadni, de azt nem kötelező. + - név (customerName) és cím (customerAddress) megadása kötelező + +FIGYELEM: a kitöltési logika azt jelenti, hogy magánszemély esetén a névnek és címadatnak a számlán rajta kell lennie, de az adatszolgáltatásban használt XML-ben már nem! +- Ha az adatszolgáltatás tartalmaz számlasort, akkor a mergedItemIndicator megadása kötelező. A tag helye még a sorok felsorolása előtti szinten (invoiceLines) található, sorrendben legelől. +- Ha a számlasor előleg adotokat tartalmaz, akkor azokat új Xpath alatt, a line/advanceData alatt adhatod meg. Ha van előleg adat (advanceIndicator=true), akkor az advancePaymentData csomópont alatt megadhatod az előleg számla sorszámát (advanceOriginalInvoice), az előleg fizetés időpontját (advancePaymentDate) és az alkalmazott árfolyamot (advanceExchangeRate). A félreértések elkerülése érdekében hangsúlyozzuk, hogy az advanceOriginalInvoice tagba az előleget tartalmazó számla invoiceNumber értéket kell szerepeltetni, tehát ez nem számlasor szintű hivatkozás, hanem számla szintű! +- Figyelj rá, hogy nem egyszerűsített számla esetén (NORMAL és AGGREGATE típusokban) se számlasor, se számlaösszesítő szinten a VatRateType által leírt csomópontokban ne lehessen megadni a számlázóprogramban az egyszerűsített számlákban használt ÁFA tartalmat (vatContent), mert ez ilyen adatszolgáltatások ERROR miatt bukni fognak! +- Figyelj rá, hogy egyszerűsített számla esetén (SIMPLIFIED típus) se számlasor, se számlaösszesítő szinten a VatRateType által leírt csomópontokban ne lehessen megadni a számlázóprogramban a normál/gyűjtő számlákban használt ÁFA tartalmat (vatPercentage), mert ez ilyen adatszolgáltatások ERROR miatt bukni fognak! + +#### 3.2.2) Használatfüggő Data módosítások + +- Ha használni szeretné a programod a 3.0 újdonsága szerinti elektronikus számlázást, akkor: + - ne engedj olyan elektronikus (completenessIndicator=true) számlát (CREATE) vagy módosító okiratot (MODIFY, STORNO) kiállítani akkor, ha + - a számla vagy módosító okirat magánszemélynek szól (customerVatStatus=PRIVATE_PERSON), + - a számla vagy módosító okirat méretcsökkentés miatt összevont soradatokat tartalmaz (mergedItemIndicator=true), + - a számla vagy módosító okirat megjelenési formája nem elektronikus (invoiceAppearance != ELECTRONIC) + - a számla vagy módosító okirat kiállítási dátuma (invoiceIssueDate) 2021.01.04 előtti + - sysdate 2021.01.04 előtti vagy az erre a célra létrehozott üzleti paraméter állása a funkció használatát nem engedi + - fenti szabályokon felül ne engedj olyan elektronikus (completenessIndicator=true) módosító okiratot kiállítani (MODIFY, STORNO), amelynek az alapszámlája létezik a rendszerben (modifyWithoutMaster=false) és abban a completenessIndicator tag értéke false + - az API XML-ben tüntesd fel az electronicInvoiceHash taget helyes cryptoType és hash értékkel, az interfész dokumentáció szerint +Ha a fenti szabályokat a programod nem tartja be, akkor az adatszolgáltatás ERROR miatt bukni fog, ami jelen esetben meghiúsítja az elektronikus számla vagy a módosító okirat kibocsátását is! +- Ha a programod kezel ÁFA mentes (vatExemption) és ÁFA hatályon kívüli (vatOutOfScope) számlákat, akkor a különböző esetekre az interfész dokumentáció által meghatározott értékkészlet alapján kínálj fel listás beviteli lehetőséget a UI-on, vagy a felhasználó által transzparensen feleltesd meg a saját értékeid ennek az értékkészletnek, ha erre lehetőséged van. Az enumerált értéket a case tagban, a felhasználó által a számlára felvitt értéket pedig a reason tagba helyezd el az XML-en belül mind számlasor, mind számlaösszesítő szinten. (értékkészlethez ld: PDF 2.2.3.2.1 vatRate fejezet) +- Ha a programod kezeli az adóalap és a felszámított adó eltérésének - interfész dokumentáció szerint felsorolt - eseteit, akkor gondoskodj a vatAmountMismatch tag megfelelő töltéséről mind számlasor, mind számlaösszesítő szinten. Amennyiben az átváltási árfolyam ezen esetek miatt nem számítható ki, akkor az exchangeRate tag értékét állítsd 0-ra. (értékkészlethez ld: PDF 2.2.3.2.1 vatRate fejezet) +- Ha a programod nem tudja meghatározni előzmény nélküli vagy 3.0 előtti számlákra hivatkozott módosító/sztornó számláknál a case értékeket, akkor használd az UNKNOWN-t. +- Ha a programod kezeli a különbözet szerinti adózású számlákat, akkor a korábbi marginSchemeVat és margonSchemeNoVat jelölők helyett a marginSchemeIndicator-ban kell megadni a konkrét esetet +- Ha a programod kezel egyszerűsített számlákat, akkor az ÁFA tartalmat (vatContent) számla sor szinten már új Xpath alatt, a lineAmountsSimplified/lineVatRate alatt tudod megadni. A módosítás a számlaösszesítőben is megjelenik, itt az új útvonal a summarySimplified/vatRate alatt található. Hasonlóképp itt tudod megadni az összes olyan mentességet, amelyeket eddig csak nem egyszerűsített számlánál lehetett megadni. A mentességek helyes kezelése azért fontos, mert a 2.0-ig a vatContent lehetett 0, azonban a 3.0-ban ez a lehetőség már megszűnik, az új ellenőrzés már ERROR-t ad erre az esetre! Az említett módosításokat vezesd át magadnál. Figyelj rá, hogy a programodban egyszerűsített számla esetében adó mértéket (vatPercentage) sem számlasor, szem számlaösszesítő szinten ne lehessen megadni, mert ez ilyen adatszolgáltatások ERROR miatt bukni fognak! +- Ha a programod töltötte számlasor szinten a tételhez tartozó EKÁER számokat, akkor ezt a taget már új Xpath alatt, a line/conventionalInvoiceInfo találod meg. EKÁER szám a 3.0-tól megadható számlafej szinten is, nem csak számlasorban. +- Ha az ügyfeleidnél van igény az adatmodellben megjelenő új, ügylethez tartozó azonosítók töltésére akár kiállítói, akár vevői oldalról (megrendelésszám, szerződésszám, szállítólevélszám stb.) akkor ezekre az adatokra biztosíts a UI-on bevitelt, illetve helyezd el a bevitt adatokat az XML-ben számlafej vagy számlasor szintjén a /conventionalInvoiceInfo vagy /conventionalLineInfo csomópont alatt. Minden tag kardinalitása korlátlan, tehát bármiből bárhány adat felírható. +- Ha a programod kezeli azt az esetet, amikor az adatszolgáltatás túl nagy méretű (HTTP content-length >= 10.485.760 bájt), akkor az interfész dokumentáció által meghatározott logika szerint vond össze a számlasorokat tétel-szolgáltatás szinten és aggregáld a megfelelő számszaki értékeket! Az összevonás tényét az adatszolgáltatásban jelezd a számlasor szint felett, a mergedItemIndicator=true kifejezéssel. Figyelj rá, hogy ha ez a tag a számlaláncban bárhol true lett, az onnantól következő módosításokban (következő modificationIndexek alatt) már sosem lehet false! (ellenkező esetben az adatszolgáltatás WARNING-ot kap) Felhívjuk a figyelmet, hogy nem felel meg a törvényi szabályozásnak az a megoldás, ami ezeket a számla adatszolgáltatásokat kiemeli kézi feldolgozásba, mindenképpen a számlázóprogramnak kell az összevonási logikát implementálni. +- Ha a programod kezel közüzemi elszámolószámlákat, akkor kezeld a utilitySettlementIndicator tag megfelelő értékadását. + +### 3.3) Annulment + +#### 3.3.1) Kötelező Annulment módosítások + +N/A + +#### 3.3.2) Használatfüggő Annulment módosítások + +- Ha a programod használja a technikai érvénytelenítési funkcióját az API-nak, akkor a belső XML-ben az InvoiceAnnulment root elementnél javítsd a namespace értékét: 'xmlns="http://schemas.nav.gov.hu/OSA/3.0/annul"' +- Ha a programod riportálja az elektronikus számlák ellenőrző hash értékét, akkor helytelen hash érték esetén már nincs lehetőség módosítani az adatszolgáltatást, technikai érvénytelenítést kell kezdeményezni. Ehhez a használati esethez új annulmentCode érték tartozik, ezért a technikai érvénytelenítő kérésbe az 'ERRATIC_ELECTRONIC_HASH_VALUE' értéket tedd. Fontos kihangsúlyozni, hogy ez a kód csak completenessIndicator=false esetén használható, jelen bejegyzés is csak ezzel a logikai esettel foglalkozik. (completenessIndicator=true esetén nincs technikai érvénytelenítési lehetőség, noha az is igaz, hogy ott helytelen hash érték sem lehet, mert a szerver a hibás hashel érkező ilyen adatszolgáltatásokat elutasítja) + +### 3.4) ServiceMetrics + +#### 3.4.1) Kötelező ServiceMetrics módosítások + +N/A + +#### 3.4.2) Használatfüggő ServiceMetrics módosítások + +- Ha a programod használja a metrika lekérdező funkcióit az API-nak, akkor ld: 3.1.2 fejezet DTO generálással és response validációval foglalkozó bejegyzések. +-------------------------------------------------------------------------------------------------------------------------------------------- + +# Changelog 3.0 + +Comprehensive changes from 2.0 to 3.0. + +## 1) Overview of reasons for changes + +Similarly to version 2.0, change requests of multiple kinds have been incorporated. First, the system’s API shall be capable of receiving EU invoices, invoices for export transactions and invoices issued to natural persons from 04.01.2021. On the other hand, the Online Invoicing project reached a phase where no new versions (compared to version 3.0) of the XML API are scheduled for release according to our plans, except for legislation changes and for eventual significant future demand. Even if changes will be made, those may be incorporated in a minor version instead of a major one. For all of these reasons, sustainability and other relevant aspects have also been considered in this release. We have, therefore, tried to eliminate all business and technical issues found in the API, and find solutions satisfying both parties. At last, but not at least, data missing for creating more accurate VAT return report drafts can now be identified and provided. + +### 1.1) Planned solutions + +- A cornerstone of v3.0 of the API is to catalyse electronic invoicing and it’s usability. For this reason, you’ll be able to specify the electronicInvoiceHash element in the API XML to contain the hash fingerprint of an e-invoice. This change only ensures the separation of business data and fingerprints during invoice creation and amendment. The change incorporated the decision to not support use cases when corrective data exchange (amendment) is received solely for the purpose of correcting the fingerprint of the original invoice, and therefore no feature is provided to do so. Data exchange treated deficient for a wrong fingerprint can only be corrected in the form of technical invalidation (annulment). The Annulment schema has been extended with a new annulment reason to support this. +- Another key change in the support of e-invoicing is the new required flag, completenessIndicator, added to the schema. You can use completenessIndicator to declare the e-invoice itself will be submitted as the means of performing v3.0 data exchange based on the sole decision of the taxpayer, using the XML format based on the schema and containing all data. Purchasing parties can then receive and process invoices in their books right after receiving the data exchange, without the need for further invoice delivery and later manual or automated comparison of supplied data and invoice data. Legislation will be adjusted to accommodate this change, and NTCA will enforce the integrity of data in such data exchange scenarios. The electronicInvoiceHash element for such invoices shall be computed as specified in the interface documentation, and the fingerprint shall be correct. Furthermore, you will not be able to perform technical annulment on such instances of data exchange, because the contents of the data exchange will practically form and incarnate the invoice itself, and therefore the two shall be identical. NAV imposes certain restrictions on invoice chains formed of such invoices (see section ERROR changes). The feature can only be used from 04.01.2021. Attempts to use it sooner will result in the rejection of the processing request in the company of a temporary error code. +- The issue of large-sized data exchanges with a POST body size larger than 10MB was practically left unaddressed since the beginning of the project. The issue typically affects a small amount of invoices issued by invoicing parties required to create very detailed invoices to conform to industry legislation, such as telecommunication and public utility service providers. The VAT act, however, is far from expecting such detailed invoice data, and the scope of data exchange obligation only includes data classified as mandatory in the VAT act. The interface documentation have been extended with a methodology guide to help you consolidate such data exchange on the basis of products and services sold in order to create a package for NAV that is less than 10MB, without losing any relevant business data. Data exchanges of this kind shall be indicated using the mandatory mergedItemIndicator flag inserted above the invoice item lines. +- Effective from 04.01.2021, data is required to be supplied about EU export invoices, and invoices issued to parties not considered VAT tax payers. In order to accommodate this, the customerInfo node has been changed to allow separation of invoices submitted to domestic parties, EU parties and parties in other foreign countries, as well as invoices issued to natural persons. Just another change in v3.0 is that you cannot display all of the Hungarian VAT ID, the EU VAT ID and the VAT ID from another country’s system next to each other, instead you can only pick one. At implementation level, the previously used sequence element is converted to a choice construct. Data exchange about invoices issued to natural persons (not including natural persons holding a VAT ID and individual entrepreneurs) shall not contain name and address data, and therefore the schema elements to hold such data have been made optional. Data exchanges not conforming to this rule are rejected in the form of a blocking validation. Note that name and address are still mandatory for invoices issued to others than natural persons. +- An exchange rate of 0 can be specified in the exchangeRate tag from version 3.0, since the exchange rate for transactions in foreign currency without incorporated tax cannot be calculated properly. You will receive a WARNING if the exchange rate is 0, and the VAT amount expressed in the currency of the invoice is greater than 0 anywhere. In concert with this change, VatRateType, the choice with 6 options and containing the amount of shifted taxes (or the reason of exemption or out-of-scope status) has been extended with a 7th option, called vatAmountMismatch. You can specify the vatAmountMismatch element when the transaction contains a tax base, however there’s no VAT amount (or vice versa), such as in case of free transactions. Yet another change is that you can add the vatRate node to simplified invoices, too. +- In addition to the tax amount for simplified invoices, you can also specify all the special cases (exemption, out of scope, reverse charge and so on) that you can specify for normal and summary invoices. As a consequence of this homogenization effort, the tax amount you can specify for simplified invoices becomes part of VatRateType, so it becomes a choice of 8 options. The system will apply blocking validation to reject data exchange attempts containing a mix of the VAT rate (vatPercentage) used in normal and aggregate invoices, and the VAT amount used in simplified invoices (vatContent). The change has been implemented at item and invoice summary levels as well. +- Another change affecting VatRateType is that the API expects a separate code and reason for vatExemption, vatOutOfScope and vatAmountMismatch to refine VAT return reports. The documentation of the interface discloses the codes (such as TAM for exempt by transaction, or AAM for not subject to VAT), and will be enforced using blocking validation. The reason is just a free text, and you can use the same text that is shown on the invoice. The length of the attribute have been doubled. +- The issues about the relation of advance payment invoices and final invoices had to be settled to be able to create VAT returns. Handling of advance payments have been restructured at item level in version 3.0 of the schema, and you can use a new item-level node in final invoices, called advanceData, to include the number of the corresponding advance payment invoice, the date of performance and the exchange rate used. +- A new, optional flag named utilitySettlementIndicator has been added to the schema to respond to special rules governing public utility settlement invoices. Please see the interface documentation for the rules of usage. +- In an effort to unify automated processing of invoices as much as possible, a node named conventionalInvoiceInfo to invoice level, and a node named conventionalLineInfo to invoice line level has been added. Version 3.0 of the schema supports most frequently used common data, such as PO numbers, delivery note numbers, agreement IDs, G/L account codes, company codes, cost centre codes, item numbers etc. in the faith that giving a common and conventional name to such data can help spreading automated processing. +- With respect to that after abolishing the VAT value limit for invoice riporting with the effect of 01.07.2020, the Online Invoicing API became a common language and communication platform that all invoicing solutions across the country conforming to legislation have to support, NTCA takes this IT concept further. Generic types, as well as types of a business catalogue nature and those describing communications which can be used in other projects have been extracted and refactored into a new common XSD from the schemas of Online Invoicing. The common XSD received its own namespace and versioning schema, and is therefore stored in a separate GitHub project at https://github.com/nav-gov-hu/Common. Extraction came at the cost of a substantial amount of namespace changes, however taxpayers will not need to create new technical users for future NTCA XML APIs in exchange, since the technical users registered in Online Invoicing will be able to use the same authentication data and keys, the same base XML structure and the same or similar cryptographic methods to invoke services of APIs of other projects. A great example is the XML API of the ongoing e-VAT project, which will support this platform and mechanism. +- Since schemas of the Online Invoicing project import a namespace to support the common XSD that is no longer part of the project, the catalogue XSD technology (https://www.oasis-open.org/committees/download.php/14809/xml-catalogs.html#s.using.catalogs) has been implemented. This causes all tags to lose their schemaLocation attributes, and the catalogue defines the location of imports in the schema maintained by NTCA. Most XML processors look for imported schemas in the same file path where the schema definition to process is stored, therefore all developer parties shall decide to either reinsert the schemaLocation tag to the schema downloaded from NTCA, or switch to using the catalogue. Both solutions are adequate. Using the catalogue for the common XSD is generally recommended for the reason that once you use the common schema in multiple projects of yours, you only need to make updates in one location in response to schema changes. A template file is provided for the catalogue for convenience. The template will support URI name and publicId, too, and you will be able to use it with local and web resource access as well, via the GitHub repo. +- The XSD hierarchy has been cleared, and invoiceData is no longer preferred in the sequence of imports. To achieve this, types used in multiple schemas of the Online Invoicing System, yet too specific to be included in the common XSD, are extracted to a new schema named invoiceBase. Version 3.0 schemas of the Online Invoicing System (API, Data, Annulment, Metrics) all import the common XSD and the invoiceBase schema only, clearing the dependency hierarchy. +- A new type named CryptoType has been implemented for long-term sustainability in the common XSD. This enables changing hash and cryptographic algorithms for the API without the need to change the schema. The cryptoType attribute is mandatory for elements containing hash values. These include passwordHash, requestSignature and electronicInvoiceHash. The set of values valid for the attribute are disclosed in the interface documentation. The max length of elements containing hash values have been extended significantly to accommodate room for the values generated by future algorithms, and the validation patterns have been weakened for the same reason. From now on, not only hexadecimal values can be specified. +- The set and features of API services have been improved in response to feature requests received on GitHub: the response to taxpayer query contains the type of queried VAT ID (business or private entrepreneur); furthermore the response to getting the list of transactions contains the processing status of enlisted transactions, so you can use the API to check if the taxpayer has any data exchange transaction not yet queried. +- The level of severity have been changed from WARNING to INFO for all validation errors which cannot be corrected by the taxpayer, even by submitting amendments. + +### 1.2) Transition and developer support + +- Developments containing the XML API 3.0 are expected to be ready by the end of September in the test environment, in the company of the interface documentation in Hungarian. +- Based on our experiences with upgrading to 2.0, our internal processing systems have been prepared to receive production data using v2.0 and v3.0 format in parallel. For this reason, XML API 3.0 can not only receive data in the test environment, but in the production environment, too, immediately. It is expected that parties who would otherwise be blocked by versioning issues if the NTCA API would not work in production environment can still proceed with their upgrade processes. The hardware environment will be ready by the time 3.0 is deployed, therefore requests conforming to either version of the API will be served at the same performance. +- A long-desired development has come to fruition since online OpenAPI documentation and Swagger UI are both provided for the XML API. Swagger’s URL will soon be disclosed in the test and the production environments and, in addition, GitHub’s Readme will also publish it once the development is released to the public. The API definition will be available for both 2.0 and 3.0. Swagger’s try-out feature will be activated, so you will be able to try to submit XML payloads assembled manually on the user interface. OpenAPI documentation is generated automatically by our CI tool as part of the release process, making availability of up-to-date information guaranteed. Go-live of this feature will be announced on Online Invoicing’s website. +- Interface documentation will also be published on GitHub, so people, especially those tracking the project, can receive email notifications more quickly and automatically about updates to the documentation. +- Rapid developer support is kept to be continued for tickets submitted to DEV support on GitHub. +- You have the option to review the schema and provide feedback for improving the XML API until NTCA finishes this development phase. Afterwards (with the technical notification scheduled to the end of September) such options become really limited, so we kindly ask you to let us know as soon as possible if you find any unhandled cases or unaddressed feature requests. We appreciate all of your feedbacks. + +NOTE that version 3.0 of the schema will be published on the website of Online Invoicing as a single ZIP file. For versioning issues, however, we cannot add the common XSD to the Online Invoicing project on GitHub. Those who would like to use the GitHub source need to download both schemas separately. (The contents of the schemas are identical, obviously, independently of the download source.) + +## 2) Other changes + +### 2.1) Common and base schema definitions (new schemas) + +- A new type, AtomicStringType, is implemented in the common XSD, and SimpleTextNotBlank types are inherited from it. GenericDecimalType is another new type of the similar pattern for floating point types. +- Primitive xs:string types have been retired uniformly in all Online Invoicing schemas (API, Data, Annulment, Metrics), and have been replaced by the subtypes of the corresponding length variant of the common:AtomicStringType type family. Similarly, xs:decimal types have been changed to GenericDecimalType. +- Request structures used in the common schema do not contain software information, since such information is considered specific to Online Invoicing. Specifying software information is still required in version 3.0 as well, and are implemented in the BasicOnlineInvoiceRequestType subtype in the API schema definition. +- Legacy 2.0 types of the headerVersion and requestVersion elements have been deleted from the common schema. The new type of these elements is AtomicString15, and these have no enums defined (because other NTCA projects may want to employ a different versioning scheme than that used by Online Invoicing). Version values can be found in the interface documentation, and valid values will be enforced by the system. (There’s no material change on the client side with regards to this, only that validation is relocated from the schema to the service layer. This is only important for those using generated XML payload, since it will not automatically contain 3.0 as the value of requestVersion.) +- The type BasicResultType has been extended with a new optional response element, ‘notification’. NTCA will use this to convey informational messages via API calls in the future. +- The following type names have been changed to make them less generic: +DateType -> InvoiceDateType +TimestampType -> InvoiceTimestampType +IndexType -> InvoiceIndexType +UnboundedIndexType -> InvoiceUnboundedIndexType + +### 2.2) API schema definition + +- A new element, incorporation, has been added to TaxPayerDataType to tell whether the VAT ID belongs to a business or a private entrepreneur. +- TransactionType have been extended by information on transaction status (requestStatus) and the indication of technical annulment (technicalAnnulment). +- From now on, the /queryInvoiceDigest operation returns the value of completenessIndicator. +- Names of elements containing VAT IDs of tax group members in the response of the /queryInvoiceDigest operation have been refined: supplierGroupTaxNumber -> supplierGroupMemberTaxNumber, customerGroupTaxNumber -> customerGroupMemberTaxNumber. The response may optionally include the value of the electronicInvoiceHash tag submitted, too. + +### 2.3) Annulment schema definition + +- A new technical annulment reason has been added to the AnnulmentCodeType type: ERRATIC_ELECTRONIC_HASH_VALUE + +### 2.4) DATA schema definition + +- As a result of switching from data:RegNumType to common:PlateNumberType and of using the according new pattern, you can also use ÖÜŐ characters as well, just as in EKÁER. +- ekaerId has been moved to the common information section (conventionalInvoiceInfo), and therefore you can specify it at both header and item level. + +### 2.5) ERROR changes + +- New ERROR: The value of requestVersion and headerVersion (if specified) tags shall fit the range disclosed in the interface documentation. +- New ERROR: Timestamps shall not be less than 2010-01-01T00:00:00Z. +- New ERROR: If the value of completenessIndicator is false in a base invoice, it cannot be true in amending documents (since the API does not support this kind of change within an invoice chain, however it is supported the other way around). +- New ERROR: If privatePersonIndicator is false, customerName AND customerAddress becomes required (B2B invoices). +- New ERROR: If privatePersonIndicator is true, you are not allowed to specify customerName, customerAddress and customerVatData (B2C invoices). +- New ERROR: If completenessIndicator is set to true, the only valid value for invoiceAppearance is ELECTRONIC. +- New ERROR: Specifying a value for electronicInvoicehash becomes required if completenessIndicator is set to true. +- New ERROR: If electronicInvoicehash has an invalid value, and completenessIndicator is set to true. +- New ERROR: If completenessIndicator is set to true, mergedItemIndicator shall not be true. +- New ERROR: If completenessIndicator is set to true, the purchasing party shall not be a natural person. +- New ERROR: NORMAL and AGGREGATE (consolidated) invoices shall not contain lines of the lineAmountsSimplified type, just as SIMPLIFIED invoices shall not contain lines of the lineAmountsNormal type. +- New ERROR: You shall not specify a vatContent value for NORMAL and AGGREGATE (consolidated) invoices, just as you shall not specify a vatPercentage value within the VatRateType type for SIMPLIFIED invoices. +- New ERROR: A new generic temporary error code has been added to be returned the first time when a v3.0 data exchange equivalent to an electronic invoice is received before 04.01.2021. +- The value of vatContent must not be 0 from now on, since exemption reasons can be specified taxonomically using VatRateType. + +### 2.6) WARNING changes + +- New WARNING: The value of exchangeRate shall not be 0 if there’s a VAT amount anywhere in the invoice (either in the header or at item level) with a non-zero value, expressed in the currency of the invoice. +- New WARNING: If mergedItemIndicator has been set to true anywhere in an invoice chain, it shall keep this value from that point on during later amendments. +- Moving some items down to INFO level is in progress. +- Review of the current WARNING logic is in progress. We encourage you to submit your feedbacks and suggestions on GitHub in the course of this review process. + +### 2.7) Retiring uppercase conversion + +No data is converted to uppercase while processing data supplies conforming to version 3.0. String values are persisted in the exact form they had in data exchange records. + +### 2.8) Schema and business logic changes since the last published version (**-11-2020) + +#### 2.8.1) Customer status in the transaction evidenced by the invoice + +There have been several indications on github and other forums that not all business cases can be distinguished with the privatePersonIndicator marker so far. Instead of the indicator, the customerVatStatus tag has been introduced, in this mandatory field the status of the customer in the given transaction must be indicated. The possible values ​ are the following: +- DOMESTIC: domestic VAT subject. In this case, the customer's name and address (customerName, customerAddress) must be specified. Of the tax numbers, only the Hungarian tax number (customerVatData / customerTaxNumber) can be entered. This entry is mandatory in all cases, except in the case where the supplier (seller) is only VAT registered and the transaction is not subject to domestic reverse charge. +- OTHER: other (domestic non - VAT subject, non - natural person, foreign VAT subject and foreign non - VAT subject, non - natural person). In this case, the customer's name and address (customerName, customerAddress) must be specified. One of the three tax numbers (customerVatData) can be entered, but is optional. +- PRIVATE_PERSON: non-VAT subject (domestic or foreign) natural person. In this case, the customerVatData, customerName, customerAddress are forbidden from the customer data, this is checked by blocking business validation. + +#### 2.8.2) Vat rate (VatRateType) choice conversion + +- the margin-scheme taxation markers (marginSchemeVat and margonSchemeNoVat) have been merged into a field called marginSchemeIndicator, type MarginSchemeType. This simplification is possible because the type already existed at the item level and covers all differences in taxation (Vat and NoVat cases). Schema level enum values: TRAVEL_AGENCY, SECOND_HAND, ARTWORK, ANTIQUES. As a result of the simplification, the marginSchemeIndicator has been removed from the LineType complex type (so the line/marginSchemeIndicator tag has been removed), as it is now specified in the values data (lineAmountsNormal / lineAmountsSimplified). +- vatAmountMismatch conversion: since the concept of vat rate also exists in these cases, the previous case / reason structure in the node has been converted to vatRate / case. Values ​​that can be specified in vatRate are 0.27, 0.18, 0.05, 0.2126, 0.1525, 0.0426. Its value is checked by blocking business validation. +- due to the previous point, the noVatCharge case was excluded from the vatAmountMismatch case values ​​(No VAT was charged under §17), as there is no interpretable vat rate in this case. The new noVatCharge field's type is boolean. +- Introduction of UNKNOWN value among case values: for modify / storno invoices referenced to invoices without previous data deport or having version pre-3.0, the exact case value cannot be determined in all cases in the vatExemption / vatOutOfScope / vatAmountMismatch cases. In this case, the case value set was expanded with the UNKNOWN value in all three cases. This value can only be specified in such cases. +- in vatExemption and vatOutOfScope nodes the reason field length changed from 100 to 200 +- for boolean vat rates (vatDomesticReverseCharge, noVatCharge) only the logical true value (true or 1) is accepted at the schema level (fixed: true attribute), since only then does it make sense to indicate the given mode in business. +- remove THK value from vatOutOfScope / case accepted values at both item and summary level. + +#### 2.8.3) ERROR modifications + +- modified ERROR: if the customer is not a private person (customerVatStatus is not PRIVATE_PERSON), then customerName AND customerAddress are required (B2B invoice) +- modified ERROR: if the customer is a private person (customerVatStatus is PRIVATE_PERSON), then customerName, customerAddress and customerVatData cannot be specified (B2C invoice) +- modified ERROR: the accepted value of the passwordHash cryptoType attribute has been changed to SHA-512 (instead of the previously incorrectly defined SHA2-512) +- modified ERROR: for vatExemption / vatOutOfScope / vatAmountMismatch, the UNKNOWN value in the case field is acceptable, but only for modify / storno invoices referenced to invoices without previous data deport or having version pre-3.0 +- deleted ERROR: if there is advance data for the given item (advanceIndicator = true), then the advancePaymentData node is not mandatory, because this data is not yet available for the advance invoice +- new ERROR: if the customer is a domestic VAT subject (customerVatStatus is DOMESTIC), the Hungarian tax number is mandatory, except in the case when the supplier (seller) is only registered for VAT and the transaction is not subject to domestic reverse charge +- new ERROR: if the customer is a domestic VAT subject (customerVatStatus is DOMESTIC), the provision of the communityVatNumber is prohibited +- new ERROR: if the customer is a domestic VAT subject (customerVatStatus is DOMESTIC), the third country tax number (thirdStateTaxId) is prohibited +- new ERROR: at item or aggregate level, if the tax base and levied tax are different (vatAmountMismatch), the value of vatAmountMismatch / vatRate can only be one of the following: 0.27, 0.18, 0.05, 0.2126, 0.1525, 0.0426. +- new ERROR: all timestamp values ​​specified in the API request must fall within the server time +- 1 day interval + +#### 2.8.4) Other minor changes + +- The request part of the /queryTransactionList operation has been supplemented with an optional requestStatus field to filter the status of the transaction. +- PageType in the common XSD has been split into RequestPageType and ResponsePageType. This was necessary because in case of 0 hits, the value of availablePage in the response is 0. +- the date of first entry into service of a new means of transport (firstEntryIntoService) has become optional in the NewTransportMeanType type. +- in the ConventionalInvoiceInfoType type containing named data, glnNumbers field has been split into glnNumbersSupplier and glnNumbersCustomer nodes. +- the exchange rate has become the general mandatory data content for data provision. Thus, it is necessary to fill in this field at the real exchange rate not only for invoices containing vat passed on, but in all cases. As a result, the zero exchange rate previously included in the documentation will no longer be usable, which will be enforced at the schema level as well. +- the IncorporationType value set has been expanded in response to the queryTaxpayer operation. The new value is TAXABLE_PERSON, which identifies taxpayers with tax numbers, treating them separately from self employed private entrepreneurs. + +## 3) Step by step developer guide for v3.0 + +### 3.1) API + +#### 3.1.1) Mandatory changes related to the API schema + +- Increase the version tag in all invoked URLs. Make sure you replace all instances of ‘/v2/’ with ‘/v3/’. +- Increase the version number in the namespace the API schema reference to 3.0 in all root elements, and make a reference to the common XSD. Example: 'xmlns="http://schemas.nav.gov.hu/OSA/3.0/api" xmlns:common="http://schemas.nav.gov.hu/NTCA/1.0/common"'. +- Increase the value of ‘version’ to 3.0 in all requestVersion tags. +- Include the namespace tag you defined for the common XSD in all opening, closing and child tags of the header and user nodes. If you use the example namespace we provided, it will be 'common:'. +- Include the 'cryptoType="SHA-512"' attribute in the user/passwordHash tag. +- Include the 'cryptoType="SHA3-512"' attribute in the user/requestSignature tag. + +#### 3.1.2) Scenario-specific changes related to the API schema + +- If you employ DTO generation in your project, you will not be able to compile/build it with the new schemas. You can either use catalog XSD to import the common and the base schemas, and reference them in your project; or re-insert a schemaLocation attribute to the downloaded schemas with a filepath value of your choice. (You can simply view the declaration of a v2.0 schema to learn how the attribute was used previously.) You can access the common XSD’s project on page https://github.com/nav-gov-hu/Common. +- If you validate responses in your project, be prepared, if necessary, that business responses from the API will not always be placed in the default namespace, since it may be placed in a different one than in v2.0. For example, encodedExchangeToken for tokenExchange, transactionId for manageInvoice response and other query results will be returned in a different namespace. This is a consequence of importing the common XSD. +- If your software reports the verification hash of the electronic invoices, you have to specify it in API XML instead of Data XML in v3.0. The name of the tag is still electronicInvoiceHash, however it is now located on XPath ManageInvoiceRequest/invoiceOperations/invoiceOperation/electronicInvoiceHash. Do not forget that even this tag has a cryptoType attribute. When completenessIndicator is false, the hash method needs to be SHA3-512 or SHA-256. Hovewer, there is no server side validation for the hash value in this case. +- If you want your software to use the new v3.0 electronic invoicing feature set completenessIndicator to true, provide SHA3-512 for the method of cryptoType and calculate the correct hash value based on the input of the invoiceData object found in the API XML. The server validates the correct hash value in this case. +- If your software uses the /queryTaxpayer service to retrieve taxpayer information, prepare it for processing the ‘incorporation’ tag contained in the response. +- If your software uses the /queryTransactionList service to list transactions, prepare it for processing the requestStatus and the technicalAnnulment tags contained in the response. +- If your software uses the /queryInvoiceData service to retrieve complete invoice data, prepare it to accept v3.0 invoice XML payloads in the responses. Be sure to properly adjust parser logic, business logic, presentation and other components in your software. Be also prepared that the operation may return the value of the electronicInvoiceHash, if it was specified in the submission. +- If your software uses the /queryInvoiceDigest service to get key invoice information, prepare it for processing the completenessIndicator tag contained in the response. Be also prepared that the group VAT ID of sellers and customers will be returned under new names (see section 2.2). +- It is recommended to prepare your software to process and display the value of the ‘notification’ tag optionally included in responses. The server will not return any values in the tag yet (populating it with values is subject to a different development effort), so you may want to use unit tests or debug mode to check the soundness of your software. +- Examine whether retiring uppercase conversion causes any break or unexpected change in your software (for the changes of the responses of the /queryInvoiceData and /queryInvoiceDigest services, for example), and adjust your software if necessary. + +### 3.2) Data + +#### 3.2.1) Mandatory changes related to the Data schema + +- Increase the version number in the namespace of the Data schema reference to 3.0 in root element InvoiceData, and reference the base XSD. Example: 'xmlns="http://schemas.nav.gov.hu/OSA/3.0/data" xmlns:base="http://schemas.nav.gov.hu/OSA/3.0/base"'. +- Top level invoice data shall include the value of the completenessIndicator tag, which decides whether a data exchange instance is equivalent to an issued electronic invoice or not. You have to specify the new tag after the invoiceIssueDate tag. It is recommended to specify the default false value, since the server shall not accept data exchange submissions with this tag set to true before 04.01.2021. It is recommended to govern the behaviour of the related business logic via a business or configuration parameter that can be changed dynamically so that you do not need to publish a new version of the client just for activating this feature when time is up. +- You have to implement the changes made to the value of the base XSD namespace in the child tags for three complex data types. This includes TaxNumberType (tax number, VAT code, county code) describing Hungarian VAT numbers, as well as address types, namely SimpleAddressType for simple addressing and DetailedAddressType for more structured address information. Make sure to implement these changes in every location where these types may occur in the Data XML. Be warned that this change to the namespace is different from that made to the API schema, since the parent tag in this case is not allowed to get a new namespace value. The sound namespace for the API: + +```xml + + + + String + 2020-09-06T12:09:24.901Z + 3.0 + 1.0 + +``` +For the Data schema, you have to specify supplier data like this (provided that you use the namespace name from the example, 'base:'): + +```xml + + + 2021/1 + 2020-09-06 + false + + + + + + 88888888 + 5 + 41 + + + 44444444 + 4 + 42 + + Supplier Ltd. + + + HU + 1031 + Budapest + Example street 1. + + + +``` + +While the header tag also received a new namespace in addition to its children in case of the API schema, the supplierTaxNumber and the supplierAddress tag remained in the default namespace, and the new namespace was only added to their child tags. +- When you provide customer data you need to start by specifying in the customerVatStatus tag whether the customer in the invoice is domestic VAT subject/ other (domestic non-VAT subject, non-natural person, foreign VAT subject and foreign non-VAT subject, non-natural person)/ non-VAT subject (domestic or foreign) natural person. This tag shall come first within the customerInfo tag. Unless this information can be computed using some business logic, it is recommended to add an option for the users to mandatorily specify it on the UI, since the absence of the customer’s VAT ID on an invoice does not necessarily imply that the customer is a private person (just think of invoices issued to private entrepreneurs). This is hard to tell apart algorithmically. +- For invoices issued to others than private persons the customer VAT ID shall be specified on a new XPath, customerInfo/customerVatData. You have to prepare your software for this. Do not forget that some invoices will not include a VAT ID even if the particular invoice is issued to someone else than a private person (such as to a block of flats or an association not engaged in any economical or business activity). +- Add business rules to properly specify and validate customer data in XML: + - if the customer is a domestic VAT subject + - the following VAT ID must be specified: Hungarian VAT ID (optionally including the VAT group, customerTaxNumber+groupMemberTaxNumber), except when the supplier is VAT registered only + - if the customer is a non-VAT subject (domestic or foreign) natural person + - you cannot specify any nodes containing a name (customerName), an address (customerAddress) or a customer VAT ID (customerVatData) + - if the customer is other (domestic non-VAT subject, non-natural person, foreign VAT subject and foreign non-VAT subject, non-natural person) + - only one of the following VAT IDs can be specified, but it's not mandatory: Hungarian VAT ID (optionally including the VAT group, customerTaxNumber+groupMemberTaxNumber), the EU VAT ID (communityVatNumber) and the VAT ID of other countries (thirdStateTaxId) + - the following nodes must be specified: name (customerName) and address (customerAddress) + +WARNING: According to the business rules, name and address information shall be included in the invoice for private persons, however such data must not be included in the XML submitted as the means of data exchange. +- If the data exchange payload includes an invoice item, you must specify mergedItemIndicator. The tag shall be placed in front of item data (invoiceLines), and it must be the first one. +- If the invoice contains advance payment information, you have to specify such information on a new XPath, line/advanceData. In the presence of advance payment information (advanceIndicator=true), you can specify the number of the original invoice for the advance payment (advanceOriginalInvoice), the date of the advance payment (advancePaymentDate) and the exchange rate used (advanceExchangeRate) under node advancePaymentData. Pay attention that you must include the value of invoiceNumber of the invoice containing the advance payment in the advanceOriginalInvoice tag, that is, this reference is invoice-level information, not an item-level one. +- Keep in mind that your software shall not allow specifying VAT amount (vatContent) used in simplified invoices on invoice or item level (i.e., in nodes described by VatRateType) in invoices of other types (NORMAL and AGGREGATE types), or your data exchange will fail for an ERROR. +- Keep in mind that your software shall not allow specifying VAT amount (vatPercentage) used in normal/aggregate invoices on invoice or item level (i.e., in nodes described by VatRateType) in invoices of other types (SIMPLIFIED type), or your data exchange will fail for an ERROR. + +#### 3.2.2) Scenario-specific changes related to the Data schema + +- If you want your software to use the new v3.0 electronic invoicing feature, consider the followings: + - do not allow issuing (CREATE operation) electronic invoices (with completenessIndicator=true) or corrective financial documents (MODIFY operation for amendments, STORNO operation for void invoices), when: + - the invoice or the corrective financial document is issued to private persons (customerVatStatus=PRIVATE_PERSON), + - the invoice or the corrective financial document contains item data aggregated for size decrease (mergedItemIndicator=true), + - the type of the invoice or the corrective financial document is not an electronic invoice (invoiceAppearance != ELECTRONIC), + - the issue date (invoiceIssueDate) of the invoice or the corrective financial document is before 04.01.2021, + - the system date is before 04.01.2021, or a business parameter created for this purpose disables the feature + - in addition to the rules above, make sure to disable creating corrective electronic financial documents (with completenessIndicator=true) with MODIFY and STORNO operations for amendments and voids, respectively, with base invoices existing in the system (modifyWithoutMaster=false) with completenessIndicator set to false + - include the electronicInvoiceHash tag with the proper cryptoType and fingerprint (hash value) in the API XML, according to the interface documentation. +Software not conforming to these rules will fail to supply data for an ERROR, and therefore it may not be able to issue the electronic invoice or the amending financial document. +- If your software supports invoices with parties exempt to VAT (vatExemption) and invoices issued to regions out of the territory of the VAT act (vatOutOfScope), offer a list to the users on the UI for the various scenarios, based on the valid values found in the interface documentation, or map your values to these values behind the scenes, transparently to the user. Place enumeration value in the case tag, and the value specified by the user on the invoice in the reason tag within the XML, both on item and invoice summary level. (for accepted valueset see: PDF 2.2.3.2.1 vatRate chapter) +- If your software manages the cases to handle differences of tax base and accumulated tax enlisted in the interface documentation, make sure to properly specify the value of the vatAmountMismatch tag, both on item and invoice summary level. If the exchange rate cannot be computed in any of these cases, set the value of the exchangeRate tag to 0. (for accepted valueset see: PDF 2.2.3.2.1 vatRate chapter) +- If your software supports cannot determine case values for modify / storno invoices referenced to invoices without previous data deport or having version pre-3.0, use UNKNOWN value. +- If your software supports invoices with items marking the margin-scheme taxation as per section 169 (p)(q), make sure to use the new marginSchemeIndicator tag and specify the value, instead of using the previous marginSchemeVat and margonSchemeNoVat indicators +- If your software supports simplified invoices, the amount of VAT (vatContent) for items shall be specified on a new XPath, lineAmountsSimplified/lineVatRate. The summary section is also affected, and the new XPath for summary VAT amount information is summarySimplified/vatRate. This is also the location to specify all reasons of exempt which you could only specify for non-simplified invoices in the past. Proper management of exempts is especially important, since vatContent could have a value of 0 until v2.0 of the API, however this option is retired in v3.0, and the new validation will trigger an error for this value. Implement all the changes in your software. Make sure to disable specifying VAT rate (vatPercentage) on item and summary level for simplified invoices, or your data exchange will fail due to an ERROR. +- If your software included EKÁER codes on item level, you have to include this data on a new XPath, line/conventionalInvoiceInfo. From v3.0, EKÁER codes can be included in the invoice header, too, not only in item lines. +- If you want to support specifying additional transaction information just introduced to the data model (such as PO number, agreement ID, delivery note number etc.) on invoices either for customer or supplier role, create the corresponding data entry UIs, and include the specified data at invoice header level or at item level in the XML file, under the /conventionalInvoiceInfo or /conventionalLineInfo nodes. Cardinality of the tags is unbounded, so you can repeat tags as many times as necessary. +- If your software supports oversize data exchange (when HTTP content-length >= 10,485,760 bytes), merge items lines at item/service level according to the interface documentation, and aggregate the corresponding values. Do not forget to indicate the fact of merging by adding mergedItemIndicator=true above the item level in the data exchange payload. Note that once this item becomes true anywhere in an invoice chain, it cannot be reverted to false any more in subsequent corrective documents (with higher modificationIndex values), or the data exchange will receive a WARNING. Be warned that escalating data exchange regarding such documents for manual processing is against the law, and the invoicing software must implement the merging logic itself. +- If your software supports public utility settlement invoices, and make sure to set utilitySettlementIndicator the correct value. + +### 3.3) Annulment + +#### 3.3.1) Mandatory changes related to the Annulment schema + +N/A + +#### 3.3.2) Scenario-specific changes related to the Annulment schema + +- If your software supports the technical annulment feature of the API, change the namespace URI of the InvoiceAnnulment root element to 'xmlns="http://schemas.nav.gov.hu/OSA/3.0/annul"' in the inner XML. +- If your software reports verification hash values of electronic invoices, presence of an invalid hash prevents further correction of the data exchange, and therefore you have to submit a technical annulment. You have to use a new annulmentCode value in this scenario, so be sure to add the 'ERRATIC_ELECTRONIC_HASH_VALUE' value to the technical annulment request. Note that this code can only be used when completenessIndicator=false, and therefore this note also regards this precious case only. (If completenessIndicator is set to true, there is no possibility for technical annulment. On the other side, the hash cannot be invalid in that case, since the server rejects data supplies of this kind if the hash is invalid.) + +### 3.4) ServiceMetrics + +#### 3.4.1) Mandatory changes related to the ServiceMetrics schema + +N/A + +#### 3.4.2) Scenario-specific changes related to the ServiceMetrics schema + +- If your software uses the metrics query feature of the API, please refer to section 3.1.2 for notes on DTO generation and response validation. \ No newline at end of file diff --git a/lis-service/src/main/resources/schemas/nav/gov/hu/OSA/catalog.xml b/lis-service/src/main/resources/schemas/nav/gov/hu/OSA/catalog.xml new file mode 100644 index 0000000..3886fa4 --- /dev/null +++ b/lis-service/src/main/resources/schemas/nav/gov/hu/OSA/catalog.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/lis-service/src/main/resources/schemas/nav/gov/hu/OSA/invoiceAnnulment.xsd b/lis-service/src/main/resources/schemas/nav/gov/hu/OSA/invoiceAnnulment.xsd new file mode 100644 index 0000000..791fa1e --- /dev/null +++ b/lis-service/src/main/resources/schemas/nav/gov/hu/OSA/invoiceAnnulment.xsd @@ -0,0 +1,86 @@ + + + + + + + + Technikai érvénytelenítés kód típusa + Technical annulment code type + + + + + Hibás adattartalom miatti technikai érvénytelenítés + Technical annulment due to erratic data content + + + + + Hibás számlaszám miatti technikai érvénytelenítés + Technical annulment due to erratic invoice number + + + + + Hibás számla kiállítási dátum miatti technikai érvénytelenítés + Technical annulment due to erratic invoice issue date + + + + + Hibás elektronikus számla hash érték miatti technikai érvénytelenítés + Technical annulment due to erratic electronic invoice hash value + + + + + + + Korábbi adatszolgáltatás technikai érvénytelenítésének adatai + Data of technical annulment concerning previous data exchange + + + + + A technikai érvénytelenítéssel érintett számla vagy módosító okirat sorszáma + Sequential number of the invoice or modification document to be annuled + + + + + A technikai érvénytelenítés időbélyege a forrásrendszerben UTC idő szerint + Timestamp of the technical annulment in UTC time + + + + + A technikai érvénytelenítés kódja + Technical annulment code + + + + + A technikai érvénytelenítés oka + Technical annulment reason + + + + + + + XML root element, a technikai érvénytelenítés adatait leíró típus, amelyet BASE64 kódoltan tartalmaz az invoiceApi sémaleíró invoiceAnnulment elementje + XML root element, technical annulment data type in BASE64 encoding, equivalent with the invoiceApi schema definition's invoiceAnnulment element + + + + + + + + diff --git a/lis-service/src/main/resources/schemas/nav/gov/hu/OSA/invoiceApi.xsd b/lis-service/src/main/resources/schemas/nav/gov/hu/OSA/invoiceApi.xsd new file mode 100644 index 0000000..53d1209 --- /dev/null +++ b/lis-service/src/main/resources/schemas/nav/gov/hu/OSA/invoiceApi.xsd @@ -0,0 +1,2277 @@ + + + + + + + + Technikai érvénytelenítő kérések jóváhagyási státusza + Verification status of technical annulment requests + + + + + A technikai érvénytelenítés kliens hiba miatt nem hagyható jóvá + The technical annulment is not verifiable due to client error + + + + + A technikai érvénytelenítés jóváhagyásra vár + The technical annulment is awaiting verification + + + + + A technikai érvénytelenítés jóváhagyásra került + The technical annulment has been verified + + + + + A technikai érvénytelenítés elutasításra került + The technical annulment has been rejected + + + + + + + Gazdasági típus + Incorporation type + + + + + Gazdasági társaság + Economical company + + + + + Egyéni vállalkozó + Self employed private entrepreneur + + + + + Adószámos magánszemély + Private person with tax number + + + + + + + Kimenő vagy bejövő számla keresési paramétere + Inbound or outbound invoice query parameter + + + + + Bejövő (vevő oldali) számla keresési paramétere + Inbound (customer side) invoice query parameter + + + + + Kimenő (kiállító oldali) számla keresési paramétere + Outbound (supplier side) invoice query parameter + + + + + + + A számla feldolgozási státusza + Processing status of the invoice + + + + + Befogadva + Received + + + + + Feldolgozás alatt + Processing + + + + + Elmentve + Saved + + + + + Kész + Done + + + + + Kihagyva + Aborted + + + + + + + Technikai érvénytelenítés műveleti típus + Technical annulment operation type + + + + + Korábbi adatszolgáltatás technikai érvénytelenítése + Technical annulment of previous exchange + + + + + + + Számlaművelet típus + Invoice operation type + + + + + Adatszolgáltatás eredeti számláról + Original invoice exchange + + + + + Adatszolgáltatás az eredeti számlát módosító okiratról + Modification invoice exchange + + + + + Adatszolgáltatás az eredeti számla érvénytelenítéséről + Exchange concerning invoice invalidation + + + + + + + A lekérdezett számla requestVersion értéke + Request version value of the queried invoice + + + + + + + + + + + Név kereső paraméter típus + Name query parameter type + + + + + + + + Relációs művelet típus + Relational operator type + + + + + Egyenlőség + Equals + + + + + Nagyobb mint reláció + Greater than relation + + + + + Nagyobb vagy egyenlő reláció + Greater or equals relation + + + + + Kisebb mint reláció + Less than relation + + + + + Kisebb vagy egyenlő reláció + Less or equals relation + + + + + + + A kérés feldolgozási státusza + Processing status of the request + + + + + Befogadva + Received + + + + + Feldolgozás alatt + Processing + + + + + Elmentve + Saved + + + + + Feldolgozás befejezve + Finished processing + + + + + Lekérdezve + Notified + + + + + + + A számlázóprogram azonosítója + Billing software ID + + + + + + + + + A számlázóprogram működési típusa (lokális program vagy online számlázó szolgáltatás) + Billing operation type (local program or online billing service) + + + + + Lokális program + Local program + + + + + Online számlázó szolgáltatás + Online billing service + + + + + + + Az adatszolgáltatás forrása + Data exchange source + + + + + Webes adatszolgáltatás + Web exchange + + + + + Kézi XML feltöltés + Manual XML upload + + + + + Gép-gép adatkapcsolati adatszolgáltatás + Machine-to-machine exchange + + + + + Online pénztárgépes adatszolgáltatás + Online cash register exchange + + + + + NAV online számlázó + NTCA online invoicing + + + + + + + Adózói cím típus + Taxpayer address type + + + + + Székhely + Headquarter + + + + + Telephely + Site office + + + + + Fióktelep + Branch office + + + + + + + A számla lekérdezés kiegészítő paraméterei + Additional params of the invoice query + + + + + A számla kiállítójának vagy vevőjének adószáma (a keresési feltétel az invoiceDirection tag értékétől függ) + Tax number of the supplier or the customer of the invoice (the search criteria depends on the value of the invoiceDirection tag) + + + + + A számla kiállítójának vagy vevőjének csoport tag adószáma (a keresési feltétel az invoiceDirection tag értékétől függ) + Tax number of group member of the supplier or the customer of the invoice (the search criteria depends on the value of the invoiceDirection tag) + + + + + A számla kiállítójának vagy vevőjének keresőparamétere szó eleji egyezőségre (a keresési feltétel az invoiceDirection tag értékétől függ) + Query param of the supplier or the customer of the invoice for leading match pattern (the search criteria depends on the value of the invoiceDirection tag) + + + + + A számla típusa + Type of invoice + + + + + Fizetés módja + Method of payment + + + + + A számla megjelenési formája + Form of appearance of the invoice + + + + + Az adatszolgáltatás forrása + Data exchange source + + + + + A számla pénzneme + Currency of the invoice + + + + + + + Technikai érvénytelenítés státusz adatai + Status data of technical annulment + + + + + Technikai érvénytelenítő kérések jóváhagyási státusza + Verification status of technical annulment requests + + + + + A technikai érvénytelenítés jóváhagyásának vagy elutasításának időpontja UTC időben + Date of verification or rejection of the technical annulment in UTC time + + + + + A technikai érvénytelenítést jóváhagyó vagy elutasító felhasználó neve + Login name of the user deciding over the technical annulment's verification or rejection + + + + + + + A kéréshez tartozó kötegelt technikai érvénytelenítések + Batch technical annulment operations of the request + + + + + A kéréshez tartozó technikai érvénytelenítő művelet + Technical annulment operation of the request + + + + + + + A kéréshez tartozó technikai érvénytelenítő művelet + Technical annulment operation of the request + + + + + A technikai érvénytelenítés sorszáma a kérésen belül + Sequence number of the technical annulment within the request + + + + + A kért technikai érvénytelenítés művelet típusa + Type of the desired technical annulment operation + + + + + Technikai érvénytelenítés adatok BASE64-ben kódolt tartalma + Technical annulment data in BASE64 encoded form + + + + + + + A számla audit adatai + Invoice audit data + + + + + A beszúrás időpontja UTC időben + Insert date in UTC time + + + + + A beszúrást végző technikai felhasználó + Inserting technical user name + + + + + Az adatszolgáltatás forrása + Data exchange source + + + + + A számla tranzakció azonosítója, ha az gépi interfészen került beküldésre + Transaction ID of the invoice if it was exchanged via M2M interface + + + + + A számla sorszáma a kérésen belül + Sequence number of the invoice within the request + + + + + A módosító okirat sorszáma a kötegen belül + Sequence number of the modification document within the batch + + + + + Az adatszolgáltatás requestVersion értéke + requestVersion value of the invoice exchange + + + + + + + Online Számla rendszerre specifikus általános kérés adatok + Online Invoice specific basic request data + + + + + + + A számlázóprogram adatai + Billing software data + + + + + + + + + Online Számla rendszerre specifikus általános válasz adatok + Online Invoice specific basic response data + + + + + + + A számlázóprogram adatai + Billing software data + + + + + + + + + Üzleti validációs választípus + Business validation response type + + + + + Validációs eredmény + Validation result + + + + + Validációs hibakód + Validation error code + + + + + Feldolgozási üzenet + Processing message + + + + + Feldolgozási kurzor adatok + Processing cursor data + + + + + + + Dátumos számla kereső paraméter + Date query params of invoice + + + + + Dátum intervallum nagyobb vagy egyenlő paramétere + Date interval greater or equals parameter + + + + + Dátum intervallum kisebb vagy egyenlő paramétere + Date interval less or equals parameter + + + + + + + Időpontos számla kereső paraméter + Datestamp query params of invoice + + + + + Időpontos intervallum nagyobb vagy egyenlő paramétere UTC idő szerint + Datetime interval greater or equals parameter + + + + + Időpontos intervallum kisebb vagy egyenlő paramétere UTC idő szerint + Datetime interval less or equals parameter + + + + + + + Online Számla rendszerre specifikus általános hibaválasz típus + Online Invoice specific general error response type + + + + + + + A számlázóprogram adatai + Billing software data + + + + + Technikai validációs üzenetek + Technical validation messages + + + + + + + + + Számlalánc kivonat lekérdezés eredményei + Invoice chain digest query result + + + + + A jelenleg lekérdezett lapszám + The currently queried page count + + + + + A lekérdezés eredménye szerint elérhető utolsó lapszám + The highest available page count matching the query + + + + + Számlalánc elem + Invoice chain element + + + + + + + Számlalánc kivonat adatok + Invoice chain digest data + + + + + Számla vagy módosító okirat sorszáma - ÁFA tv. 169. § b) vagy 170. § (1) bek. b) pont + Sequential number of the original invoice or modification document - section 169 (b) or section 170 (1) b) of the VAT law + + + + + A módosító okirat sorszáma a kötegen belül + Sequence number of the modification document within the batch + + + + + Számlaművelet típus + Invoice operation type + + + + + A kibocsátó adószáma + The supplier's tax number + + + + + A vevő adószáma + The buyer's tax number + + + + + A beszúrás időpontja UTC időben + Insert date in UTC time + + + + + Az adatszolgáltatás requestVersion értéke + requestVersion value of the invoice exchange + + + + + + + Számlalánc elem + Invoice chain element + + + + + Számlalánc kivonat adatok + Invoice chain digest data + + + + + A számlán vagy módosító okiraton szereplő tételek kivonatos adatai + Product/service digest data appearing on the invoice or the modification document + + + + + A módosítás vagy érvénytelenítés adatai + Modification or cancellation data + + + + + + + Számlalánc kivonat lekérdezés számlaszám paramétere + Invoice number param of the invoice chain digest query + + + + + Számla vagy módosító okirat sorszáma + Sequential number of the original or modification invoice + + + + + Kimenő vagy bejövő számla keresési paramétere + Inbound or outbound invoice query parameter + + + + + A számla kiállítójának vagy vevőjének adószáma (a keresési feltétel az invoiceDirection tag értékétől függ) + Tax number of the supplier or the customer of the invoice (the search criteria depends on the value of the invoiceDirection tag) + + + + + + + Számlaszámra történő lekérdezés eredménye + Invoice number based query result + + + + + Számla adatok BASE64-ben kódolt tartalma + Invoice data in BASE64 encoded form + + + + + A számla audit adatai + Invoice audit data + + + + + Jelöli, ha az invoice tartalmát a BASE64 dekódolást követően még ki kell tömöríteni az olvasáshoz + Indicates if the content of the invoice needs to be decompressed to be read following the BASE64 decoding + + + + + Elektronikus számla vagy módosító okirat állomány hash lenyomata + Electronic invoice or modification document file hash value + + + + + + + Számla lekérdezési eredmények + Invoice query results + + + + + A jelenleg lekérdezett lapszám + The currently queried page count + + + + + A lekérdezés eredménye szerint elérhető utolsó lapszám + The highest available page count matching the query + + + + + Számla kivonat lekérdezési eredmény + Invoice digest query result + + + + + + + Kivonatos lekérdezési eredmény + Digest query result + + + + + Számla vagy módosító okirat sorszáma - ÁFA tv. 169. § b) vagy 170. § (1) bek. b) pont + Sequential number of the original invoice or modification document - section 169 (b) or section 170 (1) b) of the VAT law + + + + + A módosító okirat sorszáma a kötegen belül + Sequence number of the modification document within the batch + + + + + Számlaművelet típus + Invoice operation type + + + + + A számla típusa + Type of invoice + + + + + Számla vagy módosító okirat kiállításának dátuma + Invoice or modification document issue date + + + + + A kibocsátó adószáma + The supplier's tax number + + + + + A kibocsátó csoporttag száma + The supplier's group tax number + + + + + Az eladó (szállító) neve + Name of the seller (supplier) + + + + + A vevő adószáma + The buyer's tax number + + + + + A vevő csoporttag száma + The buyer's group tax number + + + + + A vevő neve + Name of the customer + + + + + Fizetés módja + Method of payment + + + + + Fizetési határidő + Deadline for payment + + + + + A számla megjelenési formája + Form of appearance of the invoice + + + + + Az adatszolgáltatás forrása + Data exchange source + + + + + Számla teljesítési dátuma + Invoice delivery date + + + + + A számla pénzneme + Currency of the invoice + + + + + A számla nettó összege a számla pénznemében + Invoice net amount expressed in the currency of the invoice + + + + + A számla nettó összege forintban + Invoice net amount expressed in HUF + + + + + A számla ÁFA összege a számla pénznemében + Invoice VAT amount expressed in the currency of the invoice + + + + + A számla ÁFA összege forintban + Invoice VAT amount expressed in HUF + + + + + Az adatszolgáltatás tranzakció azonosítója + Transaction identifier of the data exchange + + + + + A számla sorszáma a kérésen belül + Sequence number of the invoice within the request + + + + + Az eredeti számla sorszáma, melyre a módosítás vonatkozik + Sequence number of the original invoice, on which the modification occurs + + + + + A számlára vonatkozó módosító okirat egyedi sorszáma + The unique sequence number referring to the original invoice + + + + + A beszúrás időpontja UTC időben + Insert date in UTC time + + + + + Jelöli, ha az adatszolgáltatás maga a számla (a számlán nem szerepel több adat) + Indicates whether the data exchange is identical with the invoice (the invoice does not contain any more data) + + + + + + + A számlán vagy módosító okiraton szereplő tételek kivonatos adatai + Product/service digest data appearing on the invoice or the modification document + + + + + A sorok száma közül a legmagasabb, amit a számla tartalmaz + The highest line number value the invoice contains + + + + + A módosító okirat által újként létrehozott számlasorok + New invoice lines created by the modification document + + + + + + + Számla lekérdezés számlaszám paramétere + Invoice number param of the Invoice query + + + + + Számla vagy módosító okirat sorszáma + Sequential number of the original or modification invoice + + + + + Kimenő vagy bejövő számla keresési paramétere + Inbound or outbound invoice query parameter + + + + + A módosító okirat sorszáma a kötegen belül + Sequence number of the modification document within the batch + + + + + Vevő oldali lekérdezés esetén a számla kiállítójának adószáma, ha több érvényes számla is megtalálható azonos sorszámmal + The supplier's tax number in case of querying as customer, if the query result found more than one valid invoices with the same invoice number + + + + + + + A kéréshez tartozó kötegelt számlaműveletek + Batch invoice operations of the request + + + + + Tömörített tartalom jelzése a feldolgozási folyamat számára + Compressed content indicator for the processing flow + + + + + A kéréshez tartozó számlaművelet + Invoice operation of the request + + + + + + + A kéréshez tartozó számlaművelet + Invoice operation of the request + + + + + A számla sorszáma a kérésen belül + Sequence number of the invoice within the request + + + + + A kért számla művelet típusa + Type of the desired invoice operation + + + + + Számla adatok BASE64-ben kódolt tartalma + Invoice data in BASE64 encoded form + + + + + Elektronikus számla vagy módosító okirat állomány hash lenyomata + Electronic invoice or modification document file hash value + + + + + + + Számla lekérdezési paraméterek + Invoice query parameters + + + + + A számla lekérdezés kötelező paraméterei + Mandatory params of the invoice query + + + + + A számla lekérdezés kiegészítő paraméterei + Additional params of the invoice query + + + + + A számla lekérdezés relációs paraméterei + Relational params of the invoice query + + + + + A számla lekérdezés tranzakciós paraméterei + Transactional params of the invoice query + + + + + + + A módosítás vagy érvénytelenítés adatai + Modification or cancellation data + + + + + Az eredeti számla sorszáma, melyre a módosítás vonatkozik - ÁFA tv. 170. § (1) c) + Sequence number of the original invoice, on which the modification occurs - section 170 (1) c) of the VAT law + + + + + Annak jelzése, hogy a módosítás olyan alapszámlára hivatkozik, amelyről nem történt és nem is fog történni adatszolgáltatás + Indicates whether the modification references to an original invoice which is not and will not be exchanged + + + + + + A módosító okirat készítésének időbélyege a forrásrendszerben UTC időben + Creation date timestamp of the modification document in UTC time + + + + + A számlára vonatkozó módosító okirat egyedi sorszáma + The unique sequence number referring to the original invoice + + + + + + + + A POST /manageAnnulment REST operáció kérés típusa + Request type of the POST /manageAnnulment REST operation + + + + + + + A tranzakcióhoz kiadott egyedi és dekódolt token + The decoded unique token issued for the current transaction + + + + + A kéréshez tartozó kötegelt technikai érvénytelenítések + Batch technical annulment operations of the request + + + + + + + + + A POST /manageInvoice REST operáció kérés típusa + Request type of the POST /manageInvoice REST operation + + + + + + + A tranzakcióhoz kiadott egyedi és dekódolt token + The decoded unique token issued for the current transaction + + + + + A kéréshez tartozó kötegelt számlaműveletek + Batch invoice operations of the request + + + + + + + + + A számla lekérdezés kötelező paraméterei + Mandatory params of the invoice query + + + + + Számla kiállításának dátumtartománya + Date range of the invoice issue date + + + + + Számla adatszolgáltatás feldolgozásának időpont tartománya UTC idő szerint + Datetime range of processing data exchange in UTC time + + + + + Az eredeti számla sorszáma, melyre a módosítás vonatkozik + Sequence number of the original invoice, on which the modification occurs + + + + + + + A módosító okirat által újként létrehozott számlasorok + New invoice lines created by the modification document + + + + + Számla sor intervallum kezdete + Invoice line interval start + + + + + Számla sor intervallum vége (inkluzív) + Invoice line interval end (inclusive) + + + + + + + Feldolgozási kurzor adatok + Processing cursor data + + + + + Tag hivatkozás + Tag reference + + + + + Érték hivatkozás + Value reference + + + + + Sorhivatkozás + Line reference + + + + + Kötegelt számla művelet esetén az eredeti számla sorszáma, melyre a módosítás vonatkozik + In case of a batch operation, the sequence number of the original invoice, on which the modification occurs + + + + + + + A kéréshez tartozó feldolgozási eredmények + Processing results of the request + + + + + Számla feldolgozási eredmény + Invoice processing result + + + + + Az adatszolgáltatás requestVersion értéke + requestVersion value of the invoice exchange + + + + + Technikai érvénytelenítés státusz adatai + Status data of technical annulment + + + + + + + Számla feldolgozási eredmény + Invoice processing result + + + + + A számla sorszáma a kérésen belül + Sequence number of the invoice within the request + + + + + A módosító okirat sorszáma a kötegen belül + Sequence number of the modification document within the batch + + + + + A számla feldolgozási státusza + Processing status of the invoice + + + + + Technikai validációs üzenetek + Technical validation messages + + + + + Üzleti validációs üzenetek + Business validation messages + + + + + Jelöli, ha az originalRequest tartalmát a BASE64 dekódolást követően még ki kell tömöríteni az olvasáshoz + Indicates if the content of the originalRequest needs to be decompressed to be read following the BASE64 decoding + + + + + Számla adatok BASE64-ben kódolt tartalma + Invoice data in BASE64 encoded form + + + + + + + A POST /queryInvoiceChainDigest REST operáció kérés típusa + Request type of the POST /queryInvoiceChainDigest REST operation + + + + + + + A lekérdezni kívánt lap száma + The queried page count + + + + + Számlalánc kivonat lekérdezés számlaszám paramétere + Invoice number param of the invoice chain digest query + + + + + + + + + A POST /queryInvoiceChainDigest REST operáció válasz típusa + Response type of the POST /queryInvoiceChainDigest REST operation + + + + + + + Számlalánc kivonat lekérdezés eredményei + Invoice chain digest query result + + + + + + + + + A POST /queryInvoiceCheck REST operáció válasz típusa + Response type of the POST /queryInvoiceCheck REST operation + + + + + + + Jelöli, ha a lekérdezett számlaszám érvényesként szerepel a rendszerben és a lekérdező adószáma kiállítóként vagy eladóként szerepel a számlán + Indicates whether the queried invoice number exists in the system as a valid invoice, if the tax number of the querying entity is present on the invoice either as supplier or customer + + + + + + + + + A POST /queryInvoiceData REST operáció kérés típusa + Request type of the POST /queryInvoiceData REST operation + + + + + + + Számla lekérdezés számlaszám paramétere + Invoice number param of the Invoice query + + + + + + + + + A POST /queryInvoiceData REST operáció válasz típusa + Response type of the POST /queryInvoiceData REST operation + + + + + + + A számla lekérdezés eredménye + Invoice data query result + + + + + + + + + A POST /queryInvoiceDigest REST operáció kérés típusa + Request type of the POST /queryInvoiceDigest REST operation + + + + + + + A lekérdezni kívánt lap száma + The queried page count + + + + + Kimenő vagy bejövő számla keresési paramétere + Inbound or outbound invoice query parameter + + + + + Számla lekérdezési paraméterek + Invoice query parameters + + + + + + + + + A POST /queryInvoiceDigest REST operáció válasz típusa + Response type of the POST /queryInvoiceDigest REST operation + + + + + + + A számla kivonat lekérdezés eredményei + Invoice digest query results + + + + + + + + + A POST /queryTaxpayer REST operáció kérés típusa + Request type of the POST /queryTaxpayer REST operation + + + + + + + A lekérdezett adózó adószáma + Tax number of the queried taxpayer + + + + + + + + + A POST /queryTaxpayer REST operáció válasz típusa + Response type of the POST /queryTaxpayer REST operation + + + + + + + Az adatok utolsó változásának időpontja + Last date on which the data was changed + + + + + Jelzi, hogy a lekérdezett adózó létezik és érvényes-e + Indicates whether the queried taxpayer is existing and valid + + + + + Az adózó lekérdezés válasz adatai + Response data of the taxpayer query + + + + + + + + + A POST /queryTransactionList REST operáció kérés típusa + Request type of the POST /queryTransactionList REST operation + + + + + + + A lekérdezni kívánt lap száma + The queried page count + + + + + A lekérdezni kívánt tranzakciók kiadásának szerver oldali ideje UTC időben + The queried transaction's insert date on server side in UTC time + + + + + A kérés feldolgozási státusza + Processing status of the request + + + + + + + + + A POST /queryTransactionList REST operáció válasz típusa + Response type of the POST /queryTransactionList REST operation + + + + + + + Tranzakció lekérdezési eredményei + Transaction query results + + + + + + + + + A POST /queryTransactionStatus REST operáció kérés típusa + Request type of the POST /queryTransactionStatus REST operation + + + + + + + Az adatszolgáltatás tranzakció azonosítója + Transaction identifier of the data exchange + + + + + Jelöli, ha a kliens által beküldött eredeti tartalmat is vissza kell adni a válaszban + Indicates if the original client data should also be returned in the response + + + + + + + + + A POST /queryTransactionStatus REST operáció válasz típusa + Response type of the POST /queryTransactionStatus REST operation + + + + + + + A kérésben szereplő számlák feldolgozási státusza + Processing status of the invoices in the request + + + + + + + + + A számla lekérdezés relációs paraméterei + Relational params of the invoice query + + + + + Számla teljesítési dátumának kereső paramétere + Query parameter of the invoice delivery date + + + + + A számla fizetési határidejének kereső paramétere + Query parameter of the invoice payment date + + + + + A számla nettó összeg kereső paramétere a számla pénznemében + Query parameter of the invoice net amount expressed in the currency of the invoice + + + + + A számla nettó összegének kereső paramétere forintban + Query parameter of the invoice net amount expressed in HUF + + + + + A számla ÁFA összegének kereső paramétere a számla pénznemében + Query parameter of the invoice VAT amount expressed in the currency of the invoice + + + + + A számla ÁFA összegének kereső paramétere forintban + Query parameter of the invoice VAT amount expressed in HUF + + + + + + + Kereső paraméter dátum értékekhez + Query parameter for date values + + + + + Kereső operátor + Query operator + + + + + Kereső érték + Query value + + + + + + + Kereső paraméter monetáris értékekhez + Query parameter for monetary values + + + + + Kereső operátor + Query operator + + + + + Kereső érték + Query value + + + + + + + A számlázóprogram adatai + Billing software data + + + + + A számlázóprogram azonosítója + Billing software ID + + + + + A számlázóprogram neve + Billing software name + + + + + A számlázóprogram működési típusa (lokális program vagy online számlázó szolgáltatás) + Billing software operation type (local program or online billing service) + + + + + A számlázóprogram főverziója + Billing software main version + + + + + A számlázóprogram fejlesztőjének neve + Name of the billing software's developer + + + + + A számlázóprogram fejlesztőjének elektronikus elérhetősége + Electronic contact of the billing software's developer + + + + + A számlázóprogram fejlesztőjének ISO-3166 alpha2 országkódja + ISO-3166 alpha2 country code of the billing software's developer + + + + + A számlázóprogram fejlesztőjének adószáma + Tax number of the billing software's developer + + + + + + + Adózói címsor adat + Taxpayer address item + + + + + Adózói cím típus + Taxpayer address type + + + + + Az adózó címadatai + Address data of the taxpayer + + + + + + + Adózói cím lista típus + Taxpayer address list type + + + + + Adózói címsor adat + Taxpayer address item + + + + + + + Az adózó lekérdezés válasz adatai + Response data of the taxpayer query + + + + + Az adózó neve + Name of the taxpayer + + + + + Az adózó rövidített neve + Shortened name of the taxpayer + + + + + Az adószám részletes adatai + Detailed data of the tax number + + + + + Gazdasági típus + Incorporation type + + + + + Az adózó ÁFA csoport tagsága + VAT group membership of the taxpayer + + + + + Adózói cím lista típus + Taxpayer address list type + + + + + + + A POST /tokenExchange REST operáció válasz típusa + Response type of the POST /tokenExchange REST operation + + + + + + + A kiadott exchange token AES-128 ECB algoritmussal kódolt alakja + The issued exchange token in AES-128 ECB encoded form + + + + + A kiadott token érvényességének kezdete + Validity start of the issued exchange token + + + + + A kiadott token érvényességének vége + Validity end of the issued exchange token + + + + + + + + + Tranzakció lekérdezési eredményei + Transaction query results + + + + + A jelenleg lekérdezett lapszám + The currently queried page count + + + + + A lekérdezés eredménye szerint elérhető utolsó lapszám + The highest available page count matching the query + + + + + Tranzakció lekérdezési eredmény + Transaction query result + + + + + + + A számla lekérdezés tranzakciós paraméterei + Transactional params of the invoice query + + + + + Az adatszolgáltatás tranzakció azonosítója + Transaction identifier of the data exchange + + + + + A számla sorszáma a kérésen belül + Sequence number of the invoice within the request + + + + + Számlaművelet típus + Invoice operation type + + + + + + + A POST /manageInvoice és a POST /manageAnnulment REST operáció közös válasz típusa + Common response type of the POST /manageInvoice and the POST /manageAnnulment REST operation + + + + + + + A kért operáció tranzakció azonosítója + Transaction identifier of the requested operation + + + + + + + + + Tranzakció lekérdezési eredmény + Transaction query result + + + + + A beszúrás időpontja UTC időben + Insert date in UTC time + + + + + A beszúrást végző felhasználó + Inserting user name + + + + + Az adatszolgáltatás forrása + Data exchange source + + + + + A számla tranzakció azonosítója + Transaction ID of the invoice + + + + + A kérés feldolgozási státusza + Processing status of the request + + + + + Jelöli ha a tranzakció technikai érvénytelenítést tartalmaz + Indicates whether the transaction contains technical annulment + + + + + Az adatszolgáltatás requestVersion értéke + requestVersion value of the invoice exchange + + + + + Az adatszolgáltatás tételeinek száma + Item count of the invoiceExchange + + + + + + + Online Számla rendszerre specifikus általános hibaválasz + Online Invoice specific general error response + + + + + + + + + + A POST /manageAnnulment REST operáció kérésének root elementje + Request root element of the POST /manageAnnulment REST operation + + + + + + + + + + A POST /manageAnnulment REST operáció válaszának root elementje + Response root element of the POST /manageAnnulment REST operation + + + + + + + + + + A POST /manageInvoice REST operáció kérésének root elementje + Request root element of the POST /manageInvoice REST operation + + + + + + + + + + A POST /manageInvoice REST operáció válaszának root elementje + Response root element of the POST /manageInvoice REST operation + + + + + + + + + + A POST /queryInvoiceChainDigest REST operáció kérésének root elementje + Request root element of the POST /queryInvoiceChainDigest REST operation + + + + + + + + + + A POST /queryInvoiceChainDigest REST operáció válaszának root elementje + Response root element of the POST /queryInvoiceChainDigest REST operation + + + + + + + + + + A POST /queryInvoiceCheck REST operáció kérésének root elementje + Request root element of the POST /queryInvoiceCheck REST operation + + + + + + + + + + A POST /queryInvoiceCheck REST operáció válaszának root elementje + Response root element of the POST /queryInvoiceCheck REST operation + + + + + + + + + + A POST /queryInvoiceData REST operáció kérésének root elementje + Request root element of the POST /queryInvoiceData REST operation + + + + + + + + + + A POST /queryInvoiceData REST operáció válaszának root elementje + Response root element of the POST /queryInvoiceData REST operation + + + + + + + + + + A POST /queryInvoiceDigest REST operáció válaszának root elementje + Response root element of the POST /queryInvoiceDigest REST operation + + + + + + + + + + A POST /queryInvoiceDigest REST operáció válaszának root elementje + Response root element of the POST /queryInvoiceDigest REST operation + + + + + + + + + + A POST /queryTaxpayer REST operáció kérésének root elementje + Request root element of the POST /queryTaxpayer REST operation + + + + + + + + + + A POST /queryTaxpayer REST operáció válaszának root elementje + Response root element of the POST /queryTaxpayer REST operation + + + + + + + + + + A POST /queryTransactionList REST operáció kérésének root elementje + Request root element of the POST /queryTransactionList REST operation + + + + + + + + + + A POST /queryTransactionList REST operáció válaszának root elementje + Response root element of the POST /queryTransactionList REST operation + + + + + + + + + + A POST /queryTransactionStatus REST operáció kérésének root elementje + Request root element of the POST /queryTransactionStatus REST operation + + + + + + + + + + A POST /queryTransactionStatus REST operáció válaszának root elementje + Response root element of the POST /queryTransactionStatus REST operation + + + + + + + + + + A POST /tokenExchange REST operáció kérésének root elementje + Request root element of the POST /tokenExchange REST operation + + + + + + + + + + A POST /tokenExchange REST operáció válaszának root elementje + Response root element of the POST /tokenExchange REST operation + + + + + + + + diff --git a/lis-service/src/main/resources/schemas/nav/gov/hu/OSA/invoiceBase.xsd b/lis-service/src/main/resources/schemas/nav/gov/hu/OSA/invoiceBase.xsd new file mode 100644 index 0000000..f3484ff --- /dev/null +++ b/lis-service/src/main/resources/schemas/nav/gov/hu/OSA/invoiceBase.xsd @@ -0,0 +1,329 @@ + + + + + + + Számla megjelenési formája típus + Form of appearance of the invoice type + + + + + Papír alapú számla + Invoice issued on paper + + + + + Elektronikus formában előállított, nem EDI számla + Electronic invoice (non-EDI) + + + + + EDI számla + EDI invoice + + + + + A szoftver nem képes azonosítani vagy a kiállításkor nem ismert + The software cannot be identify the form of appearance of the invoice or it is unknown at the time of issue + + + + + + + A számla típusa + Type of invoice + + + + + Normál (nem egyszerűsített és nem gyűjtő) számla + Normal (not simplified and not aggregate) invoice + + + + + Egyszerűsített számla + Simplified invoice + + + + + Gyűjtőszámla + Aggregate invoice + + + + + + + Dátum típus az Online Számla rendszerben + Date type in the Online Invoice system + + + + + + + + + Sorszám típus az Online Számla rendszerben + Index type in the Online Invoice system + + + + + + + + + Időbélyeg típus az Online Számla rendszerben + Timestamp type in the Online Invoice system + + + + + + + + + Sorszám típus kötegelt számlaművelethez az Online Számla rendszerben + Index type for batch invoice operation in the Online Invoice system + + + + + + + + Tételszám típus + Line number type + + + + + + + + + Pénzérték típus. Maximum 18 számjegy, ami 2 tizedesjegyet tartalmazhat + Field type for money value input. Maximum 18 digits that may include 2 decimal places + + + + + + + + + Fizetés módja + Method of payment + + + + + Banki átutalás + Bank transfer + + + + + Készpénz + Cash + + + + + Bankkártya, hitelkártya, egyéb készpénz helyettesítő eszköz + Debit card, credit card, other cash-substitute payment instrument + + + + + Utalvány, váltó, egyéb pénzhelyettesítő eszköz + Voucher, bill of exchange, other non-cash payment instrument + + + + + Egyéb + Other + + + + + + + Cím típus, amely vagy egyszerű, vagy részletes címet tartalmaz + Format of address that includes either a simple or a detailed address + + + + + Egyszerű cím + Simple address + + + + + Részletes cím + Detailed address + + + + + + + Részletes címadatok + Detailed address data + + + + + Az országkód ISO 3166 alpha-2 szabvány szerint + ISO 3166 alpha-2 country code + + + + + Tartomány kódja (amennyiben értelmezhető az adott országban) az ISO 3166-2 alpha 2 szabvány szerint + ISO 3166 alpha-2 province code (if appropriate in a given country) + + + + + Irányítószám (amennyiben nem értelmezhető, 0000 értékkel kell kitölteni) + ZIP code (If can not be interpreted, need to be filled "0000") + + + + + Település + Settlement + + + + + Közterület neve + Name of public place + + + + + Közterület jellege + Category of public place + + + + + Házszám + House number + + + + + Épület + Building + + + + + Lépcsőház + Staircase + + + + + Emelet + Floor + + + + + Ajtó + Door number + + + + + Helyrajzi szám + Lot number + + + + + + + Egyszerű címtípus + Simple address type + + + + + Az országkód az ISO 3166 alpha-2 szabvány szerint + ISO 3166 alpha-2 country code + + + + + Tartomány kódja (amennyiben értelmezhető az adott országban) az ISO 3166-2 alpha 2 szabvány szerint + ISO 3166 alpha-2 province code (if appropriate in a given country) + + + + + Irányítószám (amennyiben nem értelmezhető, 0000 értékkel kell kitölteni) + ZIP code (If can not be interpreted, need to be filled "0000") + + + + + Település + Settlement + + + + + További címadatok (pl. közterület neve és jellege, házszám, emelet, ajtó, helyrajzi szám, stb.) + Further address data (name and type of public place, house number, floor, door, lot number, etc.) + + + + + + + Adószám típus + Tax number type + + + + + Az adóalany adó törzsszáma. Csoportos adóalany esetén csoportazonosító szám + Core tax number of the taxable person. In case of group taxation arrangement the group identification number + + + + + ÁFA kód az adóalanyiság típusának jelzésére. Egy számjegy + VAT code to indicate taxation type of the taxpayer. One digit + + + + + Megyekód, két számjegy + County code, two digits + + + + + diff --git a/lis-service/src/main/resources/schemas/nav/gov/hu/OSA/invoiceData.xsd b/lis-service/src/main/resources/schemas/nav/gov/hu/OSA/invoiceData.xsd new file mode 100644 index 0000000..c644a71 --- /dev/null +++ b/lis-service/src/main/resources/schemas/nav/gov/hu/OSA/invoiceData.xsd @@ -0,0 +1,2368 @@ + + + + + + + + Vevő ÁFA szerinti státusz típusa + Customers status type by VAT + + + + + Belföldi ÁFA alany + Domestic VAT subject + + + + + Egyéb (belföldi nem ÁFA alany, nem természetes személy, külföldi ÁFA alany és külföldi nem ÁFA alany, nem természetes személy) + Other (domestic non-VAT subject, non-natural person, foreign VAT subject and foreign non-VAT subject, non-natural person) + + + + + Nem ÁFA alany (belföldi vagy külföldi) természetes személy + Non-VAT subject (domestic or foreign) natural person + + + + + + + Az adatmező egyedi azonosító típusa + Unique identification type of the data field + + + + + + + + + + EKÁER szám azonosító típus + EKÁER number identifier type + + + + + + + + Árfolyam adat típus + Exchange rate data type + + + + + + + + + + Adott tételsor termékértékesítés vagy szolgáltatás nyújtás jellegének jelzése + Indication of the nature of the supply of goods or services on a given line + + + + + Termékértékesítés + Supply of goods + + + + + Szolgáltatás nyújtás + Supply of services + + + + + Egyéb, nem besorolható + Other, non-qualifiable + + + + + + + A számlatétel módosítás típusa + Invoice line modification type + + + + + + + + + Különbözet szerinti szabályozás típus + Field type for inputting margin-scheme taxation + + + + + Utazási irodák + Travel agencies + + + + + Használt cikkek + Second-hand goods + + + + + Műalkotások + Works of art + + + + + Gyűjteménydarabok és régiségek + Collector’s items and antiques + + + + + + + A termékkód fajtájának jelölésére szolgáló típus + The type used to mark the kind of product code + + + + + + + Vámtarifa szám VTSZ + Customs tariff number CTN + + + + + Szolgáltatás jegyzék szám SZJ + Business service list number BSL + + + + + KN kód (Kombinált Nómenklatúra, 2658/87/EGK rendelet I. melléklete) + CN code (Combined Nomenclature, 2658/87/ECC Annex I) + + + + + A Jövedéki törvény (2016. évi LXVIII. tv) szerinti e-TKO adminisztratív hivatkozási kódja AHK + Administrative reference code of e-TKO defined in the Act LXVIII of 2016 on Excise Duties + + + + + A termék 343/2011. (XII. 29) Korm. rendelet 1. sz. melléklet A) cím szerinti csomagolószer-katalógus kódja (CsK kód) + Packaging product catalogue code of the product according to the Title A) in the Schedule No.1 of the Government Decree No. 343/2011. (XII. 29.) + + + + + A termék 343/2011. (XII. 29) Korm. rendelet 1. sz. melléklet B) cím szerinti környezetvédelmi termékkódja (Kt kód) + Environmental protection product code of the product according to the Title B) in the Schedule No.1 of the Government Decree No. 343/2011. (XII. 29.) + + + + + Építményjegyzék szám + Classification of Inventory of Construction + + + + + A Termékek és Szolgáltatások Osztályozási Rendszere (TESZOR) szerinti termékkód - 451/2008/EK rendelet + Product code according to the TESZOR (Hungarian Classification of Goods and Services), Classification of Product by Activity, CPA - regulation 451/2008/EC + + + + + A vállalkozás által képzett termékkód + The own product code of the enterprise + + + + + Egyéb termékkód + Other product code + + + + + + + Termékkód típus + Field type for inputting product codes + + + + + + + + + + Díjtétel egység típus + Unit of the rate type + + + + + Darab + Piece + + + + + Kilogramm + Kilogram + + + + + + + Termékdíj összesítés típus + Product fee summary type + + + + + Visszaigénylés + Refund + + + + + Raktárba szállítás + Deposit + + + + + + + Termékáram típus + Product stream + + + + + Akkumulátor + Battery + + + + + Csomagolószer + Packaging products + + + + + Egyéb kőolajtermék + Other petroleum product + + + + + Az elektromos, elektronikai berendezés + The electric appliance, electronic equipment + + + + + Gumiabroncs + Tire + + + + + Reklámhordozó papír + Commercial printing paper + + + + + Az egyéb műanyag termék + Other plastic product + + + + + Egyéb vegyipari termék + Other chemical product + + + + + Irodai papír + Paper stationery + + + + + + + Mennyiségi érték típus. Maximum 22 számjegy, ami 10 tizedesjegyet tartalmazhat + Field type for quantity values. Maximum 22 digits that may include 10 decimal places + + + + + + + + + Arány megadására szolgáló típus. 0 és 1 közötti szám, legfeljebb 4 tizedesjegy pontossággal + Rate type. A number between 0 and 1, may include maximum 4 decimal places + + + + + + + + + + + Az átvállalás adatait tartalmazó típus + Field type for data of takeover + + + + + A 2011. évi LXXXV. tv. 14. § (4) bekezdés szerint az eladó (első belföldi forgalomba hozó) vállalja át a vevő termékdíj-kötelezettségét + The supplier takes over buyer’s product fee liability on the basis of Paragraph (4), Section 14 of the Act LXXXV of 2011 + + + + + A 2011. évi LXXXV. tv. 14. § (5) aa) alpontja szerint a vevő szerződés alapján átvállalja az eladó termékdíj-kötelezettségét + On the basis of contract, the buyer takes over supplier’s product fee liability on the basis of sub-point aa), Paragraph (5), Section 14 of the Act LXXXV of 2011 + + + + + + + + + + + + + + + + + Mennyiség egység típus + Unit of measure type + + + + + Darab + Piece + + + + + Kilogramm + Kilogram + + + + + Metrikus tonna + Metric ton + + + + + Kilowatt óra + Kilowatt hour + + + + + Nap + Day + + + + + Óra + Hour + + + + + Perc + Minute + + + + + Hónap + Month + + + + + Liter + Liter + + + + + Kilométer + Kilometer + + + + + Köbméter + Cubic meter + + + + + Méter + Meter + + + + + Folyóméter + Linear meter + + + + + Karton + Carton + + + + + Csomag + Pack + + + + + Saját mennyiségi egység megnevezés + Own unit of measure + + + + + + + További adat leírására szolgáló típus + Type for additional data description + + + + + Az adatmező egyedi azonosítója + Unique identification of the data field + + + + + Az adatmező tartalmának szöveges leírása + Description of content of the data field + + + + + Az adat értéke + Value of the data + + + + + + + Előleghez kapcsolódó adatok + Advance related data + + + + + Értéke true, ha a számla tétel előleg jellegű + The value is true if the invoice item is a kind of advance charge + + + + + Előleg fizetéshez kapcsolódó adatok + Advance payment related data + + + + + + + Előlegfizetéshez kapcsolódó adatok + Advance payment related data + + + + + Az előlegszámlának a sorszáma, amelyben az előlegfizetés történt + Invoice number containing the advance payment + + + + + Az előleg fizetésének dátuma + Payment date of the advance + + + + + Az előlegfizetés során alkalmazott árfolyam + Applied exchange rate of the advance + + + + + + + A gyűjtő számlára vonatkozó speciális adatokat tartalmazó típus + Field type including aggregate invoice special data + + + + + A tételhez tartozó árfolyam, 1 (egy) egységre vonatkoztatva. Csak külföldi pénznemben kiállított gyűjtő számla esetén kitöltendő + The exchange rate applied to the item, pertaining to 1 (one) unit. This should be filled in only if an aggregate invoice in foreign currency is issued + + + + + Gyűjtőszámla esetén az adott tétel teljesítési dátuma + Delivery date of the given item in the case of an aggregate invoice + + + + + + + Légi közlekedési eszköz + Aircraft + + + + + Felszállási tömeg kilogrammban + Take-off weight in kilogram + + + + + Értéke true ha a jármű az ÁFA tv. 259.§ 25. c) szerinti kivétel alá tartozik + The value is true if the means of transport is exempt from VAT as per section 259 [25] (c) + + + + + Repült órák száma + Number of aviated hours + + + + + + + Kötegelt módosító okirat adatai + Data of a batch of modification documents + + + + + A módosító okirat sorszáma a kötegen belül + Sequence number of the modification document within the batch + + + + + Egy számla vagy módosító okirat adatai + Data of a single invoice or modification document + + + + + + + Szerződésszámok + Contract numbers + + + + + Szerződésszám + Contract number + + + + + + + A számlafeldolgozást segítő, egyezményesen nevesített egyéb adatok + Other conventionally named data to assist in invoice processing + + + + + Megrendelésszám(ok) + Order numbers + + + + + Szállítólevél szám(ok) + Delivery notes + + + + + Szállítási dátum(ok) + Shipping dates + + + + + Szerződésszám(ok) + Contract numbers + + + + + Az eladó vállalati kódja(i) + Company codes of the supplier + + + + + A vevő vállalati kódja(i) + Company codes of the customer + + + + + Beszállító kód(ok) + Dealer codes + + + + + Költséghely(ek) + Cost centers + + + + + Projektszám(ok) + Project numbers + + + + + Főkönyvi számlaszám(ok) + General ledger account numbers + + + + + Kiállítói globális helyazonosító szám(ok) + Supplier's global location numbers + + + + + Vevői globális helyazonosító szám(ok) + Customer's global location numbers + + + + + Anyagszám(ok) + Material numbers + + + + + Cikkszám(ok) + Item number(s) + + + + + EKÁER azonosító(k) + EKAER ID-s + + + + + + + Költséghelyek + Cost centers + + + + + Költséghely + Cost center + + + + + + + A vevő vállalati kódjai + Company codes of the customer + + + + + A vevő vállalati kódja + Company code of the customer + + + + + + + Ha az eladó a vevő nyilatkozata alapján mentesül a termékdíj megfizetése alól, akkor az érintett termékáram + Should the supplier, based on statement given by the purchaser, be exempted from paying product fee, then the product stream affected + + + + + Termékáram + Product stream + + + + + Termékdíj köteles termék tömege kilogrammban + Weight of product fee obliged product in kilogram + + + + + + + A vevő adatai + Customer data + + + + + Vevő ÁFA szerinti státusza + Customers status by VAT + + + + + A vevő ÁFA alanyisági adatai + VAT subjectivity data of the customer + + + + + A vevő neve + Name of the customer + + + + + A vevő címe + Address of the customer + + + + + Vevő bankszámlaszáma + Bank account number of the customer + + + + + + + Adószám, amely alatt a számlán szereplő termékbeszerzés vagy szolgáltatás igénybevétele történt. Lehet csoportazonosító szám is + Tax number or group identification number, under which the purchase of goods or services is done + + + + + + + Csoport tag adószáma, ha a termékbeszerzés vagy szolgáltatás igénybevétele csoportazonosító szám alatt történt + Tax number of group member, when the purchase of goods or services is done under group identification number + + + + + + + + + A vevő ÁFA alanyisági adatai + VAT subjectivity data of the customer + + + + + Belföldi adószám, amely alatt a számlán szereplő termékbeszerzés vagy szolgáltatás igénybevétele történt. Lehet csoportazonosító szám is + Domestic tax number or group identification number, under which the purchase of goods or services is done + + + + + Közösségi adószám + Community tax number + + + + + Harmadik országbeli adóazonosító + Third state tax identification number + + + + + + + Beszállító kódok + Dealer codes + + + + + Beszállító kód + Dealer code + + + + + + + Szállítólevél számok + Delivery notes + + + + + Szállítólevél szám + Delivery note + + + + + + + Mentesség, kivétel részletes indokolása + Detailed justification of exemption + + + + + Az eset leírása kóddal + Case notation with code + + + + + Az eset leírása szöveggel + Case notation with text + + + + + + + Gázolaj adózottan történő beszerzésének adatai – 45/2016 (XI. 29.) NGM rendelet 75. § (1) a) + Data of gas oil acquisition after taxation – point a), paragraph (1) of Section 75 of the NGM Decree No. 45/2016. (XI. 29.) + + + + + Gázolaj beszerzés helye + Place of purchase of the gas oil + + + + + Gázolaj beszerzés dátuma + Date of purchase of gas oil + + + + + Kereskedelmi jármű forgalmi rendszáma (csak betűk és számok) + Registration number of vehicle (letters and numbers only) + + + + + Gépi bérmunka-szolgáltatás során felhasznált gázolaj mennyisége literben – Jöt. 117. § (2) + Fordítandó helyett: Quantity of diesel oil used for contract work and machinery hire service in liter – Act LXVIII of 2016 on Excise Tax section 117 (2) + + + + + + + Árengedmény adatok + Discount data + + + + + Az árengedmény leírása + Description of the discount + + + + + Tételhez tartozó árengedmény összege a számla pénznemében, ha az egységár nem tartalmazza + Total amount of discount per item expressed in the currency of the invoice if not included in the unit price + + + + + Tételhez tartozó árengedmény aránya, ha az egységár nem tartalmazza + Rate of discount per item expressed in the currency of the invoice if not included in the unit price + + + + + + + EKÁER azonosító(k) + EKAER ID-s + + + + + EKÁER azonosító + EKAER numbers; EKAER stands for Electronic Trade and Transport Control System + + + + + + + A pénzügyi képviselő adatai + Fiscal representative data + + + + + A pénzügyi képviselő adószáma + Tax number of the fiscal representative + + + + + A pénzügyi képviselő neve + Name of the fiscal representative + + + + + Pénzügyi képviselő címe + Address of the fiscal representative + + + + + Pénzügyi képviselő által a számla kibocsátó (eladó) számára megnyitott bankszámla bankszámlaszáma + Bank account number opened by the fiscal representative for the issuer of the invoice (supplier) + + + + + + + Főkönyvi számlaszámok + General ledger account numbers + + + + + Főkönyvi számlaszám + General ledger account number + + + + + + + Globális helyazonosító számok + Global location numbers + + + + + Globális helyazonosító szám + Global location number + + + + + + + Számla részletező adatok + Invoice detail data + + + + + A számla típusa, módosító okirat esetén az eredeti számla típusa + Type of invoice. In case of modification document the type of original invoice + + + + + Teljesítés dátuma (ha nem szerepel a számlán, akkor azonos a számla keltével) - ÁFA tv. 169. § g) + Delivery date (if this field does not exist on the invoice, the date of the invoice should be considered as such) - section 169 (g) of the VAT law + + + + + Amennyiben a számla egy időszakra vonatkozik, akkor az időszak első napja + The first day of the delivery, if the invoice delivery is a period + + + + + Amennyiben a számla egy időszakra vonatkozik, akkor az időszak utolsó napja + The last day of the delivery, if the invoice delivery is a period + + + + + Számviteli teljesítés dátuma. Időszak esetén az időszak utolsó napja + Date of accounting accomplishment. In the event of a period, the last day of the period + + + + + Annak jelzése, ha a felek a termékértékesítés, szolgáltatás nyújtás során időszakonkénti elszámolásban vagy fizetésben állapodnak meg, vagy a termékértékesítés, szolgáltatás nyújtás ellenértékét meghatározott időpontra állapítják meg. + Indicates where by agreement of the parties it gives rise to successive statements of account or successive payments relating to the supply of goods, or the supply of services, or if the consideration agreed upon for such goods and/or services applies to specific periods. + + + + + Kisadózó jelzése + Marking of low tax-bracket enterprise + + + + + A számla pénzneme az ISO 4217 szabvány szerint + ISO 4217 currency code on the invoice + + + + + HUF-tól különböző pénznem esetén az alkalmazott árfolyam: egy egység értéke HUF-ban + In case any currency is used other than HUF, the applied exchange rate should be mentioned: 1 unit of the foreign currency expressed in HUF + + + + + Közmű elszámoló számla jelölése (2013.évi CLXXXVIII törvény szerinti elszámoló számla) + Marking the fact of utility settlement invoice (invoice according to Act CLXXXVIII of 2013) + + + + + Önszámlázás jelölése (önszámlázás esetén true) + Marking the fact of self-billing (in the case of self-billing the value is true) + + + + + Fizetés módja + Method of payment + + + + + Fizetési határidő + Deadline for payment + + + + + Pénzforgalmi elszámolás jelölése, ha az szerepel a számlán - ÁFA tv. 169. § h). Értéke true pénzforgalmi elszámolás esetén + Marking the fact of cash accounting if this is indicated on the invoice - section 169 (h) of the VAT law. The value is true in case of cash accounting + + + + + A számla vagy módosító okirat megjelenési formája + Form of appearance of the invoice or modification document + + + + + A számlafeldolgozást segítő, egyezményesen nevesített egyéb adatok + Other conventionally named data to assist in invoice processing + + + + + A számlára vonatkozó egyéb adat + Other data in relation to the invoice + + + + + + + A számla adatszolgáltatás adatai + Invoice exchange data + + + + + Számla vagy módosító okirat sorszáma - ÁFA tv. 169. § b) vagy 170. § (1) bek. b) pont + Sequential number of the original invoice or modification document - section 169 (b) or section 170 (1) b) of the VAT law + + + + + Számla vagy módosító okirat kelte - ÁFA tv. 169. § a), ÁFA tv. 170. § (1) bek. a) + Date of issue of the invoice or the modification document - section 169 (a) of the VAT law, section 170 (1) a) of the VAT law + + + + + Jelöli, ha az adatszolgáltatás maga a számla (a számlán nem szerepel több adat) + Indicates whether the data exchange is identical with the invoice (the invoice does not contain any more data) + + + + + Számlaadatok leírására szolgáló közös típus + A common type to describe invoice information + + + + + + + Számla fejléc adatai + Data in header of invoice + + + + + Számla kibocsátó (eladó) adatai + Data related to the issuer of the invoice (supplier) + + + + + Vevő adatai + Data related to the customer + + + + + Pénzügyi képviselő adatai + Data related to the fiscal representative + + + + + Számla részletező adatok + Invoice detail adata + + + + + + + Számlaadatok leírására szolgáló közös típus + A common type to describe invoice information + + + + + Egy számla vagy módosító okirat adatai + Data of a single invoice or modification document + + + + + Kötegelt módosító okirat adatai + Data of a batch of modification documents + + + + + + + A módosítás vagy érvénytelenítés hivatkozási adatai + Modification or cancellation reference data + + + + + Az eredeti számla sorszáma, melyre a módosítás vonatkozik - ÁFA tv. 170. § (1) c) + Sequence number of the original invoice, on which the modification occurs - section 170 (1) c) of the VAT law + + + + + Annak jelzése, hogy a módosítás olyan alapszámlára hivatkozik, amelyről nem történt és nem is fog történni adatszolgáltatás + Indicates whether the modification references to an original invoice which is not and will not be exchanged + + + + + A számlára vonatkozó módosító okirat egyedi sorszáma + The unique sequence number referring to the original invoice + + + + + + + Egy számla vagy módosító okirat adatai + Data of a single invoice or modification document + + + + + A módosítás vagy érvénytelenítés adatai + Modification or cancellation data + + + + + A számla egészét jellemző adatok + Data concerning the whole invoice + + + + + A számlán szereplő tételek adatai + Product/service data appearing on the invoice + + + + + Termékdíjjal kapcsolatos összesítő adatok + Summary data of product charges + + + + + Az ÁFA törvény szerinti összesítő adatok + Summary data according to VAT law + + + + + + + Cikkszámok + Item numbers + + + + + Cikkszám + Item number + + + + + + + Normál vagy gyűjtő számla esetén kitöltendő tétel érték adatok + Item value data to be completed in case of normal or aggregate invoice + + + + + Tétel nettó adatok + Line net data + + + + + Adómérték vagy adómentesség jelölése + Tax rate or tax exemption marking + + + + + Tétel ÁFA adatok + Line VAT data + + + + + Tétel bruttó adatok + Line gross data + + + + + + + Egyszerűsített számla esetén kitöltendő tétel érték adatok + Item value data to be completed in case of simplified invoice + + + + + Adómérték vagy adómentesség jelölése + Tax rate or tax exemption marking + + + + + Tétel bruttó értéke a számla pénznemében + Gross amount of the item expressed in the currency of the invoice + + + + + Tétel bruttó értéke forintban + Gross amount of the item expressed in HUF + + + + + + + Tétel bruttó adatok + Line gross data + + + + + Tétel bruttó értéke a számla pénznemében. ÁFA tartalmú különbözeti adózás esetén az ellenérték. + Gross amount of the item expressed in the currency of the invoice. In case of margin scheme taxation containing VAT, the amount of consideration expressed in the currency of the invoice. + + + + + Tétel bruttó értéke forintban + Gross amount of the item expressed in HUF + + + + + + + Módosításról történő adatszolgáltatás esetén a tételsor módosítás jellegének jelölése + Marking the goal of modification of the line (in the case of data supply about changes/updates only) + + + + + Az eredeti számla módosítással érintett tételének sorszáma (lineNumber). Új tétel létrehozása esetén az új tétel sorszáma, a meglévő tételsorok számozásának folytatásaként + Line number of the original invoice, which the modification occurs with. In case of create operation the tag shall contain the new line number, as a sequential increment of the the existing lines set + + + + + A számlatétel módosításának jellege + Line modification type + + + + + + + Tétel nettó adatok + Line net data + + + + + Tétel nettó összege a számla pénznemében. ÁFA tartalmú különbözeti adózás esetén az ellenérték áfa összegével csökkentett értéke a számla pénznemében. + Net amount of the item expressed in the currency of the invoice. In case of margin scheme taxation containing VAT, the amount of consideration reduced with the amount of VAT, expressed in the currency of the invoice. + + + + + Tétel nettó összege forintban. ÁFA tartalmú különbözeti adózás esetén az ellenérték áfa összegével csökkentett értéke forintban. + Net amount of the item expressed in HUF. Net amount of the item expressed in the currency of the invoice. In case of margin scheme taxation containing VAT, the amount of consideration reduced with the amount of VAT, expressed in HUF. + + + + + + + Termék/szolgáltatás tételek + Product / service items + + + + + Jelöli, ha az adatszolgáltatás méretcsökkentés miatt összevont soradatokat tartalmaz + Indicates whether the data exchange contains merged line data due to size reduction + + + + + Termék/szolgáltatás tétel + Product / service item + + + + + + + A számla tételek (termék vagy szolgáltatás) adatait tartalmazó típus + Field type including data of invoice items (product or service) + + + + + A tétel sorszáma + Sequential number of the item + + + + + Módosításról történő adatszolgáltatás esetén a tételsor módosítás jellegének jelölése + Marking the goal of modification of the line (in the case of data supply about changes/updates only) + + + + + Hivatkozások kapcsolódó tételekre, ha ez az ÁFA törvény alapján szükséges + References to connected items if it is necessary according to VAT law + + + + + Előleghez kapcsolódó adatok + Advance related data + + + + + Termékkódok + Product codes + + + + + Értéke true, ha a tétel mennyiségi egysége természetes mértékegységben kifejezhető + The value is true if the unit of measure of the invoice item is expressible in natural unit + + + + + Adott tételsor termékértékesítés vagy szolgáltatás nyújtás jellegének jelzése + Indication of the nature of the supply of goods or services on a given line + + + + + A termék vagy szolgáltatás megnevezése + Name / description of the product or service + + + + + Mennyiség + Quantity + + + + + A számlán szereplő mennyiségi egység kanonikus kifejezése az interfész specifikáció szerint + Canonical representation of the unit of measure of the invoice, according to the interface specification + + + + + A számlán szereplő mennyiségi egység literális kifejezése + Literal unit of measure of the invoice + + + + + Egységár a számla pénznemében. Egyszerűsített számla esetén bruttó, egyéb esetben nettó egységár + Unit price expressed in the currency of the invoice In the event of simplified invoices gross unit price, in other cases net unit price + + + + + Egységár forintban + Unit price expressed in HUF + + + + + A tételhez tartozó árengedmény adatok + Discount data in relation to the item + + + + + + Normál (nem egyszerűsített) számla esetén (beleértve a gyűjtőszámlát) kitöltendő tétel érték adatok. + Item value data to be completed in case of normal (not simplified, but including aggregated) invoice + + + + + Egyszerűsített számla esetén kitöltendő tétel érték adatok + Item value data to be completed in case of simplified invoice + + + + + + Értéke true ha a tétel közvetített szolgáltatás - Számviteli tv. 3.§ (4) 1 + The value is true if the item is an intermediated service - paragraph (4) 1 of the Article 3 of Accounting Act + + + + + Gyűjtő számla adatok + Aggregate invoice data + + + + + Új közlekedési eszköz értékesítés ÁFA tv. 89 § ill. 169 § o) + Supply of new means of transport - section 89 § and 169 (o) of the VAT law + + + + + Értéke true, ha a tétel betétdíj jellegű + The value is true if the item is bottle/container deposit + + + + + Értéke true ha a tételt termékdíj fizetési kötelezettség terheli + The value is true if the item is liable to product fee + + + + + Földgáz, villamos energia, szén jövedéki adója forintban - Jöt. 118. § (2) + Excise duty on natural gas, electricity and coal in Hungarian forints – paragraph (2), Section 118 of the Act on Excise Duties + + + + + Gázolaj adózottan történő beszerzésének adatai – 45/2016 (XI. 29.) NGM rendelet 75. § (1) a) + Data of gas oil acquisition after taxation – point a), paragraph (1) of Section 75 of the NGM Decree No. 45/2016. (XI. 29.) + + + + + Értéke true, ha a Neta tv-ben meghatározott adókötelezettség az adó alanyát terheli. 2011. évi CIII. tv. 3.§(2) + Value is true, if the taxable person is liable for tax obligation determined in the Act on Public Health Product Tax (Neta tv.). Paragraph (2), Section 3 of the Act CIII of 2011 + + + + + A környezetvédelmi termékdíjról szóló 2011. évi LXXXV. tv. szerinti, tételre vonatkozó záradékok + Clauses according to the Act LXXXV of 2011 on Environmental Protection Product Fee (related to the item) + + + + + A tétel termékdíj tartalmára vonatkozó adatok + Data on the content of the line's product charge + + + + + A számlafeldolgozást segítő, egyezményesen nevesített egyéb adatok + Other conventionally named data to assist in invoice processing + + + + + A termék/szolgáltatás tételhez kapcsolódó, további adat + Other data in relation to the product / service item + + + + + + + Tétel ÁFA adatok + Line VAT data + + + + + Tétel ÁFA összege a számla pénznemében + VAT amount of the item expressed in the currency of the invoice + + + + + Tétel ÁFA összege forintban + VAT amount of the item expressed in HUF + + + + + + + Anyagszámok + Material numbers + + + + + Anyagszám + Material number + + + + + + + Új közlekedési eszköz értékesítés ÁFA tv. 89 § ill. 169 § o) + Supply of new means of transport - section 89 § and 169 (o) of the VAT law + + + + + Gyártmány/típus + Product / type + + + + + Alvázszám/gyári szám/Gyártási szám + Chassis number / serial number / product number + + + + + Motorszám + Engine number + + + + + Első forgalomba helyezés időpontja + First entry into service + + + + + + Szárazföldi közlekedési eszköz további adatai + Other data in relation to motorised land vehicle + + + + + Vízi jármű adatai + Data of vessel + + + + + Légi közlekedési eszköz + Aircraft + + + + + + + + Megrendelésszámok + Order numbers + + + + + Megrendelésszám + Order number + + + + + + + A termékdíj bevallását igazoló dokumentum adatai a 2011. évi LXXXV. tv. 13. § (3) szerint és a 25. § (3) szerint + Data of the document verifying the declaration submitted on the product fee according to the Paragraph (3), Section 13 and the Paragraph (3) Section 25 of the Act LXXXV of 2011 + + + + + Számla sorszáma vagy egyéb okirat azonosító száma + Sequential number of the invoice, or other document considered as such + + + + + Számla kelte + Date of issue of the invoice + + + + + Kötelezett neve + Name of obligator + + + + + Kötelezett címe + Address of obligator + + + + + A kötelezett adószáma + Tax number of obligated + + + + + + + Termékkódok + Product codes + + + + + Termékkód + Product code + + + + + + + Különböző termék- vagy szolgáltatáskódokat tartalmazó típus + Field type including the different product and service codes + + + + + A termékkód fajtájának (pl. VTSZ, CsK, stb.) jelölése + The kind of product code (f. ex. VTSZ, CsK, etc.) + + + + + + A termékkód értéke nem saját termékkód esetén + The value of (not own) product code + + + + + Saját termékkód értéke + Own product code value + + + + + + + + A környezetvédelmi termékdíjról szóló 2011. évi LXXXV. tv. szerinti, tételre vonatkozó záradékok + Clauses according to the Act LXXXV of 2011 on Environmental Protection Product Fee (related to the item) + + + + + A környezetvédelmi termékdíj kötelezettség átvállalásával kapcsolatos adatok + Data in connection with takeover of environmental protection product fee + + + + + Ha az eladó a vevő nyilatkozata alapján mentesül a termékdíj megfizetése alól, akkor az érintett termékáram + Should the supplier, based on statement given by the purchaser, be exempted from paying product fee, then the product stream affected + + + + + + + Termékdíj adatok + Product charges data + + + + + Termékdíj kód (Kt vagy Csk) + Product charges code (Kt or Csk code) + + + + + A termékdíjjal érintett termék mennyisége + Quantity of product, according to product charge + + + + + A díjtétel egysége (kg vagy darab) + Unit of the rate (kg or piece) + + + + + A termékdíj díjtétele (HUF/egység) + Product fee rate (HUF/unit) + + + + + Termékdíj összege forintban + Amount in Hungarian forints of the product fee + + + + + + + Termékdíj összegzés adatok + Summary of product charges + + + + + Annak jelzése, hogy a termékdíj összesítés visszaigénylésre (REFUND) vagy raktárba történő beszállításra (DEPOSIT) vonatkozik + Indicating whether the the product fee summary concerns refund or deposit + + + + + Termékdíj adatok + Product charges data + + + + + Termékdíj összesen + Aggregate product charges + + + + + A termékdíj bevallását igazoló dokumentum adatai a 2011. évi LXXXV. tv. 13. § (3) szerint és a 25. § (3) szerint + Data of the document verifying the declaration submitted on the product fee according to the Paragraph (3), Section 13 and the Paragraph (3) Section 25 of the Act LXXXV of 2011 + + + + + + + A környezetvédelmi termékdíj kötelezettség átvállalásával kapcsolatos adatok + Data in connection with takeover of environmental protection product fee + + + + + Az átvállalás iránya és jogszabályi alapja + Direction and legal base of takeover + + + + + Az átvállalt termékdíj összege forintban, ha a vevő vállalja át az eladó termékdíj-kötelezettségét + Amount in Hungarian forints of the product fee taken over if the purchaser takes over the supplier’s product fee liability + + + + + + + Projektszámok + Project numbers + + + + + Projektszám + Project number + + + + + + + Hivatkozások kapcsolódó tételekre, ha ez az ÁFA törvény alapján szükséges + References to connected items if it is necessary according to VAT law + + + + + Hivatkozások kapcsolódó tételekre, ha ez az ÁFA törvény alapján szükséges + References to connected items if it is necessary according to VAT law + + + + + + + Szállítási dátumok + Shipping dates + + + + + Szállítási dátum + Shipping date + + + + + + + ÁFA mértékek szerinti összesítés + Summary according to VAT rates + + + + + Adómérték vagy adómentesség jelölése + Marking the tax rate or the fact of tax exemption + + + + + Adott adómértékhez tartozó nettó adatok + Net data of given tax rate + + + + + Adott adómértékhez tartozó ÁFA adatok + VAT data of given tax rate + + + + + Adott adómértékhez tartozó bruttó adatok + Gross data of given tax rate + + + + + + + A számla összesítő bruttó adatai + Gross data of the invoice summary + + + + + A számla bruttó összege a számla pénznemében + Gross amount of the invoice expressed in the currency of the invoice + + + + + A számla bruttó összege forintban + Gross amount of the invoice expressed in HUF + + + + + + + Számla összesítés (nem egyszerűsített számla esetén) + Calculation of invoice totals (not simplified invoice) + + + + + Összesítés ÁFA-mérték szerint + Calculation of invoice totals per VAT rates + + + + + A számla nettó összege a számla pénznemében + Net amount of the invoice expressed in the currency of the invoice + + + + + A számla nettó összege forintban + Net amount of the invoice expressed in HUF + + + + + A számla ÁFA összege a számla pénznemében + VAT amount of the invoice expressed in the currency of the invoice + + + + + A számla ÁFA összege forintban + VAT amount of the invoice expressed in HUF + + + + + + + Egyszerűsített számla összesítés + Calculation of simplified invoice totals + + + + + Adómérték vagy adómentesség jelölése + Marking the tax rate or the fact of tax exemption + + + + + Az adott adótartalomhoz tartozó értékesítés vagy szolgáltatásnyújtás bruttó összege a számla pénznemében + The gross amount of the sale or service for the given tax amount in the currency of the invoice + + + + + Az adott adótartalomhoz tartozó értékesítés vagy szolgáltatásnyújtás bruttó összege forintban + The gross amount of the sale or service for the given tax amount in HUF + + + + + + + Számla összesítés adatai + Data of calculation of invoice totals + + + + + + Számla összesítés (nem egyszerűsített számla esetén) + Calculation of invoice totals (not simplified invoice) + + + + + Egyszerűsített számla összesítés + Calculation of simplified invoice totals + + + + + + A számla összesítő bruttó adatai + Gross data of the invoice summary + + + + + + + Az eladó vállalati kódjai + Company codes of the supplier + + + + + Az eladó vállalati kódja + Company code of the supplier + + + + + + + A szállító (eladó) adatai + Invoice supplier (seller) data + + + + + Belföldi adószám vagy csoportazonosító szám + Tax number or group identification number + + + + + Csoport tag adószáma, ha a termékbeszerzés vagy szolgáltatás nyújtása csoportazonosító szám alatt történt + Tax number of group member, when the supply of goods or services is done under group identification number + + + + + Közösségi adószám + Community tax number + + + + + Az eladó (szállító) neve + Name of the seller (supplier) + + + + + Az eladó (szállító) címe + Address of the seller (supplier) + + + + + Az eladó (szállító) bankszámlaszáma + Bank account number of the seller (supplier) + + + + + Értéke true, amennyiben az eladó (szállító) alanyi ÁFA mentes + Value is true if the seller (supplier) is individually exempted from VAT + + + + + Az eladó adóraktári engedélyének vagy jövedéki engedélyének száma (2016. évi LXVIII. tv.) + Number of supplier’s tax warehouse license or excise license (Act LXVIII of 2016) + + + + + + + Adóalap és felszámított adó eltérésének adatai + Data of mismatching tax base and levied tax + + + + + Adómérték, adótartalom + VAT rate, VAT content + + + + + Az eset leírása kóddal + Case notation with code + + + + + + + Adott adómértékhez tartozó bruttó adatok + Gross data of given tax rate + + + + + Az adott adómértékhez tartozó értékesítés vagy szolgáltatásnyújtás bruttó összege a számla pénznemében + Gross amount of sales or service delivery under a given tax rate expressed in the currency of the invoice + + + + + Az adott adómértékhez tartozó értékesítés vagy szolgáltatásnyújtás bruttó összege forintban + Gross amount of sales or service delivery under a given tax rate expressed in HUF + + + + + + + Adott adómértékhez tartozó nettó adatok + Net data of given tax rate + + + + + Az adott adómértékhez tartozó értékesítés vagy szolgáltatásnyújtás nettó összege a számla pénznemében + Net amount of sales or service delivery under a given tax rate expressed in the currency of the invoice + + + + + Az adott adómértékhez tartozó értékesítés vagy szolgáltatásnyújtás nettó összege forintban + Net amount of sales or service delivery under a given tax rate expressed in HUF + + + + + + + Az adómérték vagy az adómentes értékesítés jelölése + Marking tax rate or tax exempt supply + + + + + Az alkalmazott adó mértéke - ÁFA tv. 169. § j) + Applied tax rate - section 169 (j) of the VAT law + + + + + ÁFA tartalom egyszerűsített számla esetén + VAT content in case of simplified invoice + + + + + Az adómentesség jelölése - ÁFA tv. 169. § m) + Marking tax exemption - section 169 (m) of the VAT law + + + + + Az ÁFA törvény hatályán kívüli + Out of scope of the VAT law + + + + + A belföldi fordított adózás jelölése - ÁFA tv. 142. § + Marking the national is reverse charge taxation - section 142 of the VAT law + + + + + Különbözet szerinti szabályozás jelölése - ÁFA tv. 169. § p) q) + Marking the margin-scheme taxation as per section 169 (p)(q) + + + + + Adóalap és felszámított adó eltérésének esetei + Different cases of mismatching tax base and levied tax + + + + + Nincs felszámított áfa a 17. § alapján + No VAT charged under Section 17 + + + + + + + Adott adómértékhez tartozó ÁFA adatok + VAT data of given tax rate + + + + + Az adott adómértékhez tartozó értékesítés vagy szolgáltatásnyújtás ÁFA összege a számla pénznemében + VAT amount of sales or service delivery under a given tax rate expressed in the currency of the invoice + + + + + Az adott adómértékhez tartozó értékesítés vagy szolgáltatásnyújtás ÁFA összege forintban + VAT amount of sales or service delivery under a given tax rate expressed in HUF + + + + + + + Szárazföldi közlekedési eszköz további adatai + Other data in relation to motorised land vehicle + + + + + Hengerűrtartalom köbcentiméterben + Engine capacity in cubic centimetre + + + + + Teljesítmény kW-ban + Engine power in kW + + + + + Futott kilométerek száma + Travelled distance in km + + + + + + + Vízi jármű adatai + Data of vessel + + + + + Hajó hossza méterben + Length of hull in metre + + + + + Értéke true, ha a jármű az ÁFA tv. 259.§ 25. b) szerinti kivétel alá tartozik + The value is true if the means of transport is exempt from VAT as per section 259 [25] (b) + + + + + Hajózott órák száma + Number of sailed hours + + + + + + + XML root element, számla vagy módosítás adatait leíró típus, amelyet BASE64 kódoltan tartalmaz az invoiceApi sémaleíró invoiceData elementje + XML root element, invoice or modification data type in BASE64 encoding, equivalent with the invoiceApi schema definition's invoiceData element + + + + + + + + diff --git a/lis-service/src/main/resources/schemas/nav/gov/hu/OSA/serviceMetrics.xsd b/lis-service/src/main/resources/schemas/nav/gov/hu/OSA/serviceMetrics.xsd new file mode 100644 index 0000000..c0ce0bc --- /dev/null +++ b/lis-service/src/main/resources/schemas/nav/gov/hu/OSA/serviceMetrics.xsd @@ -0,0 +1,217 @@ + + + + + + + + Nyelv megnevezés típus + Language naming type + + + + + Magyar nyelv + Hungarian language + + + + + Angol nyelv + English language + + + + + Német nyelv + German language + + + + + + + Metrika típusának leírója + Metric's descriptor type + + + + + Növekmény típusú metrika + Incremental type metric + + + + + Pillanatkép típusú metrika + Snapshot type metric + + + + + Kvantilis típusú, eloszlást mérő metrika + Quantile type, dispersion sampler metric + + + + + Összegző érték típusú metrika + Sum value type metric + + + + + + + Metrika definíció típus + Metric definition type + + + + + Metrika neve + Metric's name + + + + + Metrika típusa + Metric's type + + + + + Metrika leírása + Metric's description + + + + + + + Metrika leírás típus + Metric description type + + + + + Nyelv megnevezés + Language naming + + + + + Lokalizált leírás + Localized description + + + + + + + Metrika típus + Metric data type + + + + + Metrika definíció + Metric definition + + + + + Metrika értékek + Metric values + + + + + + + Metrika érték típus + Metric value type + + + + + Metrika értéke + Metric's value + + + + + Metrika értékének időpontja UTC időben + Time of metric value in UTC time + + + + + + + A GET /queryServiceMetrics/list REST operáció válasz típusa + Response type of the GET /queryServiceMetrics/list REST operation + + + + + Metrika definíciói + Metric definitions + + + + + + + A GET /queryServiceMetrics REST operáció válasz típusa + Response type of the GET /queryServiceMetrics REST operation + + + + + Alap válaszeredmény adatok + Basic result data + + + + + A metrikák utolsó frissítésének időpontja UTC időben + Last update time of metrics in UTC time + + + + + Metrika adatai + Metric data + + + + + + + A GET /queryServiceMetrics/list REST operáció válaszának root elementje + Response root element of the GET /queryServiceMetrics/list REST operation + + + + + + + + + + A GET /queryServiceMetrics REST operáció válaszának root elementje + Response root element of the GET /queryServiceMetrics REST operation + + + + + + + + diff --git a/lis-services/pom.xml b/lis-services/pom.xml deleted file mode 100644 index f83f053..0000000 --- a/lis-services/pom.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - 4.0.0 - lis-services - - hu.user - lis - 0.0.1-SNAPSHOT - - - - org.springframework - spring-web - 5.3.24 - - - com.github.javafaker - javafaker - 1.0.2 - - - hu.user - lis-db - 0.0.1-SNAPSHOT - - - org.springframework - spring-context - 5.3.24 - - - com.fasterxml.jackson.core - jackson-databind - - - org.skyscreamer - jsonassert - - - diff --git a/lis-ui/pom.xml b/lis-ui/pom.xml index fec1ded..492890d 100644 --- a/lis-ui/pom.xml +++ b/lis-ui/pom.xml @@ -114,7 +114,7 @@ hu.user - lis-services + lis-service 0.0.1-SNAPSHOT diff --git a/lis-ui/src/main/java/hu/user/lis/ui/converter/AssociateIdToNameConverter.java b/lis-ui/src/main/java/hu/user/lis/ui/converter/AssociateIdToNameConverter.java index 4d1e8e3..a438dd8 100644 --- a/lis-ui/src/main/java/hu/user/lis/ui/converter/AssociateIdToNameConverter.java +++ b/lis-ui/src/main/java/hu/user/lis/ui/converter/AssociateIdToNameConverter.java @@ -1,7 +1,7 @@ package hu.user.lis.ui.converter; import hu.user.lis.db.Associate; -import hu.user.lis.services.data.AssociateService; +import hu.user.lis.service.data.AssociateService; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; diff --git a/lis-ui/src/main/java/hu/user/lis/ui/data/AssociatesDataModel.java b/lis-ui/src/main/java/hu/user/lis/ui/data/AssociatesDataModel.java index 2064cf8..4570d75 100644 --- a/lis-ui/src/main/java/hu/user/lis/ui/data/AssociatesDataModel.java +++ b/lis-ui/src/main/java/hu/user/lis/ui/data/AssociatesDataModel.java @@ -2,8 +2,8 @@ package hu.user.lis.ui.data; import hu.user.lis.db.Associate; import hu.user.lis.db.repository.AssociateRepository; -import hu.user.lis.services.data.AssociateService; -import hu.user.lis.services.data.EntityDataService; +import hu.user.lis.service.data.AssociateService; +import hu.user.lis.service.data.EntityDataService; import hu.user.lis.ui.data.common.CachedSpringDataModel; import lombok.extern.log4j.Log4j2; import org.springframework.beans.factory.annotation.Autowired; diff --git a/lis-ui/src/main/java/hu/user/lis/ui/data/InvoiceDataModel.java b/lis-ui/src/main/java/hu/user/lis/ui/data/InvoiceDataModel.java index 3ea164d..21e580f 100644 --- a/lis-ui/src/main/java/hu/user/lis/ui/data/InvoiceDataModel.java +++ b/lis-ui/src/main/java/hu/user/lis/ui/data/InvoiceDataModel.java @@ -4,8 +4,8 @@ import hu.user.lis.db.IncomingInvoice; import hu.user.lis.db.Invoice; import hu.user.lis.db.OutgoingInvoice; import hu.user.lis.db.repository.InvoiceRepository; -import hu.user.lis.services.data.EntityDataService; -import hu.user.lis.services.data.InvoiceService; +import hu.user.lis.service.data.EntityDataService; +import hu.user.lis.service.data.InvoiceService; import lombok.extern.log4j.Log4j2; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; diff --git a/lis-ui/src/main/java/hu/user/lis/ui/data/PartnersDataModel.java b/lis-ui/src/main/java/hu/user/lis/ui/data/PartnersDataModel.java index 2d3f704..8333d8f 100644 --- a/lis-ui/src/main/java/hu/user/lis/ui/data/PartnersDataModel.java +++ b/lis-ui/src/main/java/hu/user/lis/ui/data/PartnersDataModel.java @@ -2,8 +2,8 @@ package hu.user.lis.ui.data; import hu.user.lis.db.Partner; import hu.user.lis.db.repository.PartnerRepository; -import hu.user.lis.services.data.EntityDataService; -import hu.user.lis.services.data.PartnerService; +import hu.user.lis.service.data.EntityDataService; +import hu.user.lis.service.data.PartnerService; import hu.user.lis.ui.data.common.CachedSpringDataModel; import lombok.extern.log4j.Log4j2; import org.springframework.beans.factory.annotation.Autowired; diff --git a/lis-ui/src/main/java/hu/user/lis/ui/data/ProjectStatusDataModel.java b/lis-ui/src/main/java/hu/user/lis/ui/data/ProjectStatusDataModel.java index 5297d02..9d226d4 100644 --- a/lis-ui/src/main/java/hu/user/lis/ui/data/ProjectStatusDataModel.java +++ b/lis-ui/src/main/java/hu/user/lis/ui/data/ProjectStatusDataModel.java @@ -2,7 +2,7 @@ package hu.user.lis.ui.data; import hu.user.lis.db.ProjectStatus; import hu.user.lis.db.repository.ProjectStatusRepository; -import hu.user.lis.services.data.ProjectStatusService; +import hu.user.lis.service.data.ProjectStatusService; import hu.user.lis.ui.data.common.CachedSpringDataModel; import lombok.extern.log4j.Log4j2; import org.springframework.beans.factory.annotation.Autowired; diff --git a/lis-ui/src/main/java/hu/user/lis/ui/data/ProjectsDataModel.java b/lis-ui/src/main/java/hu/user/lis/ui/data/ProjectsDataModel.java index f9972ff..09498c7 100644 --- a/lis-ui/src/main/java/hu/user/lis/ui/data/ProjectsDataModel.java +++ b/lis-ui/src/main/java/hu/user/lis/ui/data/ProjectsDataModel.java @@ -3,7 +3,7 @@ package hu.user.lis.ui.data; import hu.user.lis.db.Project; import hu.user.lis.db.ProjectStatus; import hu.user.lis.db.repository.ProjectRepository; -import hu.user.lis.services.data.EntityDataService; +import hu.user.lis.service.data.EntityDataService; import hu.user.lis.ui.data.common.CachedSpringDataModel; import lombok.extern.log4j.Log4j2; import org.springframework.beans.factory.annotation.Autowired; diff --git a/lis-ui/src/main/java/hu/user/lis/ui/data/ServiceRecordsDataModel.java b/lis-ui/src/main/java/hu/user/lis/ui/data/ServiceRecordsDataModel.java index 4ad6914..e56221b 100644 --- a/lis-ui/src/main/java/hu/user/lis/ui/data/ServiceRecordsDataModel.java +++ b/lis-ui/src/main/java/hu/user/lis/ui/data/ServiceRecordsDataModel.java @@ -4,8 +4,8 @@ import hu.user.lis.db.Associate; import hu.user.lis.db.Project; import hu.user.lis.db.ServiceRecord; import hu.user.lis.db.repository.ServiceRecordRepository; -import hu.user.lis.services.data.EntityDataService; -import hu.user.lis.services.data.ServiceRecordService; +import hu.user.lis.service.data.EntityDataService; +import hu.user.lis.service.data.ServiceRecordService; import hu.user.lis.ui.data.common.CachedSpringDataModel; import lombok.extern.log4j.Log4j2; import org.springframework.beans.factory.annotation.Autowired; diff --git a/lis-ui/src/main/java/hu/user/lis/ui/data/SuppliersDataModel.java b/lis-ui/src/main/java/hu/user/lis/ui/data/SuppliersDataModel.java index 43ab7a6..f2813d7 100644 --- a/lis-ui/src/main/java/hu/user/lis/ui/data/SuppliersDataModel.java +++ b/lis-ui/src/main/java/hu/user/lis/ui/data/SuppliersDataModel.java @@ -1,7 +1,7 @@ package hu.user.lis.ui.data; import hu.user.lis.db.Supplier; -import hu.user.lis.services.data.SupplierService; +import hu.user.lis.service.data.SupplierService; import hu.user.lis.ui.data.common.CachedDataModel; import lombok.extern.log4j.Log4j2; import org.apache.commons.lang3.StringUtils; diff --git a/lis-ui/src/main/java/hu/user/lis/ui/data/SuppliersSimpleDataModel.java b/lis-ui/src/main/java/hu/user/lis/ui/data/SuppliersSimpleDataModel.java index ef855fb..b8f6784 100644 --- a/lis-ui/src/main/java/hu/user/lis/ui/data/SuppliersSimpleDataModel.java +++ b/lis-ui/src/main/java/hu/user/lis/ui/data/SuppliersSimpleDataModel.java @@ -1,7 +1,7 @@ package hu.user.lis.ui.data; import hu.user.lis.db.Supplier; -import hu.user.lis.services.data.SupplierService; +import hu.user.lis.service.data.SupplierService; import hu.user.lis.ui.data.common.CachedDataModel; import lombok.extern.log4j.Log4j2; import org.apache.commons.lang3.StringUtils; diff --git a/lis-ui/src/main/java/hu/user/lis/ui/data/TreasuryDataModel.java b/lis-ui/src/main/java/hu/user/lis/ui/data/TreasuryDataModel.java index 309b87a..ef8a4d2 100644 --- a/lis-ui/src/main/java/hu/user/lis/ui/data/TreasuryDataModel.java +++ b/lis-ui/src/main/java/hu/user/lis/ui/data/TreasuryDataModel.java @@ -1,8 +1,8 @@ package hu.user.lis.ui.data; import hu.user.lis.db.Treasury; -import hu.user.lis.services.data.EntityDataService; -import hu.user.lis.services.data.TreasuryService; +import hu.user.lis.service.data.EntityDataService; +import hu.user.lis.service.data.TreasuryService; import lombok.extern.log4j.Log4j2; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; diff --git a/lis-ui/src/main/java/hu/user/lis/ui/data/common/CachedSpringDataModel.java b/lis-ui/src/main/java/hu/user/lis/ui/data/common/CachedSpringDataModel.java index ea47302..4ba8666 100644 --- a/lis-ui/src/main/java/hu/user/lis/ui/data/common/CachedSpringDataModel.java +++ b/lis-ui/src/main/java/hu/user/lis/ui/data/common/CachedSpringDataModel.java @@ -1,7 +1,7 @@ package hu.user.lis.ui.data.common; import hu.user.lis.db.Profile; -import hu.user.lis.services.data.EntityDataService; +import hu.user.lis.service.data.EntityDataService; import hu.user.lis.ui.auth.CurrentProfile; import lombok.Getter; import lombok.Setter; diff --git a/lis-ui/src/main/java/hu/user/lis/ui/editor/common/EntityEditorModel.java b/lis-ui/src/main/java/hu/user/lis/ui/editor/common/EntityEditorModel.java index 3670d43..f764afd 100644 --- a/lis-ui/src/main/java/hu/user/lis/ui/editor/common/EntityEditorModel.java +++ b/lis-ui/src/main/java/hu/user/lis/ui/editor/common/EntityEditorModel.java @@ -1,6 +1,6 @@ package hu.user.lis.ui.editor.common; -import hu.user.lis.services.data.EntityDataService; +import hu.user.lis.service.data.EntityDataService; import hu.user.lis.ui.editor.selector.EntitySelectorRouter; import hu.user.lis.ui.event.EventBus; import lombok.Getter; diff --git a/lis-ui/src/main/java/hu/user/lis/ui/editor/selector/EntitySelectorModel.java b/lis-ui/src/main/java/hu/user/lis/ui/editor/selector/EntitySelectorModel.java index 21c8453..5edab56 100644 --- a/lis-ui/src/main/java/hu/user/lis/ui/editor/selector/EntitySelectorModel.java +++ b/lis-ui/src/main/java/hu/user/lis/ui/editor/selector/EntitySelectorModel.java @@ -1,6 +1,6 @@ package hu.user.lis.ui.editor.selector; -import hu.user.lis.services.data.EntityDataServiceBase; +import hu.user.lis.service.data.EntityDataServiceBase; import hu.user.lis.ui.data.common.CachedSpringDataModel; import lombok.Getter; import lombok.extern.log4j.Log4j2; diff --git a/lis-ui/src/main/java/hu/user/lis/ui/event/EventBus.java b/lis-ui/src/main/java/hu/user/lis/ui/event/EventBus.java index 431c476..f8cbc29 100644 --- a/lis-ui/src/main/java/hu/user/lis/ui/event/EventBus.java +++ b/lis-ui/src/main/java/hu/user/lis/ui/event/EventBus.java @@ -8,11 +8,17 @@ import org.zkoss.zk.ui.event.EventListener; import org.zkoss.zk.ui.event.EventQueue; import org.zkoss.zk.ui.event.EventQueues; +import java.util.Objects; + @Service @Log4j2 public class EventBus { private EventQueue getProcessEventQueue() { - return EventQueues.lookup(Constants.PROCESS_EVENT_QUEUE, EventQueues.APPLICATION, true); + try { + return EventQueues.lookup(Constants.PROCESS_EVENT_QUEUE, EventQueues.APPLICATION, true); + } catch (Exception ignored) { + } + return null; } private EventQueue getQueue() { @@ -70,6 +76,9 @@ public class EventBus { } public void refreshImportInvoiceTasks(String eventType) { - getProcessEventQueue().publish(new Event(Constants.REFRESH_INVOICE_IMPORT_TASKS, null, eventType)); + EventQueue processEventQueue = getProcessEventQueue(); + if (Objects.nonNull(processEventQueue)) { + processEventQueue.publish(new Event(Constants.REFRESH_INVOICE_IMPORT_TASKS, null, eventType)); + } } } diff --git a/lis-ui/src/main/java/hu/user/lis/ui/SlyCrmUIProperties.java b/lis-ui/src/main/java/hu/user/lis/ui/properties/ApplicationUIProperties.java similarity index 65% rename from lis-ui/src/main/java/hu/user/lis/ui/SlyCrmUIProperties.java rename to lis-ui/src/main/java/hu/user/lis/ui/properties/ApplicationUIProperties.java index 136c478..c706d93 100644 --- a/lis-ui/src/main/java/hu/user/lis/ui/SlyCrmUIProperties.java +++ b/lis-ui/src/main/java/hu/user/lis/ui/properties/ApplicationUIProperties.java @@ -1,4 +1,4 @@ -package hu.user.lis.ui; +package hu.user.lis.ui.properties; import lombok.Getter; import lombok.Setter; @@ -8,8 +8,8 @@ import org.springframework.stereotype.Component; @Getter @Setter @Component -@ConfigurationProperties(prefix = "hu.user-ibm.sly-crm.ui") -public class SlyCrmUIProperties { +@ConfigurationProperties(prefix = "application.ui") +public class ApplicationUIProperties { String userName; String password; } diff --git a/lis-ui/src/main/java/hu/user/lis/ui/view/LoginViewModel.java b/lis-ui/src/main/java/hu/user/lis/ui/view/LoginViewModel.java index 579cdee..5302f3e 100644 --- a/lis-ui/src/main/java/hu/user/lis/ui/view/LoginViewModel.java +++ b/lis-ui/src/main/java/hu/user/lis/ui/view/LoginViewModel.java @@ -1,6 +1,6 @@ package hu.user.lis.ui.view; -import hu.user.lis.ui.SlyCrmUIProperties; +import hu.user.lis.ui.properties.ApplicationUIProperties; import lombok.Getter; import lombok.extern.log4j.Log4j2; import org.springframework.boot.info.BuildProperties; @@ -15,7 +15,7 @@ public class LoginViewModel { BuildProperties buildProperties; @WireVariable - SlyCrmUIProperties slyCrmUIProperties; + ApplicationUIProperties applicationUIProperties; public LoginViewModel() { diff --git a/lis-ui/src/main/java/hu/user/lis/ui/view/common/EntityViewModel.java b/lis-ui/src/main/java/hu/user/lis/ui/view/common/EntityViewModel.java index 21d319a..dc4b6b1 100644 --- a/lis-ui/src/main/java/hu/user/lis/ui/view/common/EntityViewModel.java +++ b/lis-ui/src/main/java/hu/user/lis/ui/view/common/EntityViewModel.java @@ -1,6 +1,6 @@ package hu.user.lis.ui.view.common; -import hu.user.lis.services.data.EntityDataService; +import hu.user.lis.service.data.EntityDataService; import hu.user.lis.ui.data.common.CachedSpringDataModel; import lombok.Getter; import lombok.Setter; diff --git a/lis-ui/src/main/resources/web/login.zul b/lis-ui/src/main/resources/web/login.zul index fea01b5..8d01027 100644 --- a/lis-ui/src/main/resources/web/login.zul +++ b/lis-ui/src/main/resources/web/login.zul @@ -45,12 +45,12 @@ diff --git a/lis-workflow/pom.xml b/lis-workflow/pom.xml index 18f808b..eda34db 100644 --- a/lis-workflow/pom.xml +++ b/lis-workflow/pom.xml @@ -16,7 +16,7 @@ hu.user - lis-services + lis-service 0.0.1-SNAPSHOT diff --git a/lis-workflow/src/main/java/hu/user/lis/workflow/invoice/DownloadInvoiceData.java b/lis-workflow/src/main/java/hu/user/lis/workflow/invoice/DownloadInvoiceData.java index 9e5415b..88bedc0 100644 --- a/lis-workflow/src/main/java/hu/user/lis/workflow/invoice/DownloadInvoiceData.java +++ b/lis-workflow/src/main/java/hu/user/lis/workflow/invoice/DownloadInvoiceData.java @@ -9,6 +9,8 @@ import org.camunda.bpm.engine.delegate.JavaDelegate; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; +import java.nio.file.Paths; + @Log4j2 @Component public class DownloadInvoiceData implements JavaDelegate { @@ -21,12 +23,11 @@ public class DownloadInvoiceData implements JavaDelegate { @Override public void execute(DelegateExecution delegateExecution) throws Exception { - String humanId = (String) delegateExecution.getVariable("invoice"); - log.info("Processing invoice {}", humanId); - IncomingInvoice invoice = incomingInvoiceFetcherService.getInvoice(humanId); - invoiceRepository.save(invoice); + String invoiceId = (String) delegateExecution.getVariable("invoice"); + log.info("Processing invoice {}", invoiceId); + IncomingInvoice invoice = incomingInvoiceFetcherService.getInvoiceFromPath(Paths.get(invoiceId)); delegateExecution.setVariableLocal("invoiceEntity", invoice); - log.info("Invoice {} processed", humanId); + log.info("Invoice {} processed", invoiceId); } } diff --git a/lis-workflow/src/main/java/hu/user/lis/workflow/invoice/ListNewInvoices.java b/lis-workflow/src/main/java/hu/user/lis/workflow/invoice/ListNewInvoices.java index e07822e..3f98033 100644 --- a/lis-workflow/src/main/java/hu/user/lis/workflow/invoice/ListNewInvoices.java +++ b/lis-workflow/src/main/java/hu/user/lis/workflow/invoice/ListNewInvoices.java @@ -1,24 +1,31 @@ package hu.user.lis.workflow.invoice; import hu.user.lis.workflow.invoice.service.IncomingInvoiceFetcherService; +import hu.user.lis.workflow.properties.WorkflowProperties; import lombok.extern.log4j.Log4j2; import org.camunda.bpm.engine.delegate.DelegateExecution; import org.camunda.bpm.engine.delegate.JavaDelegate; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; +import java.nio.file.Path; +import java.nio.file.Paths; import java.util.List; @Log4j2 @Component public class ListNewInvoices implements JavaDelegate { + @Autowired + WorkflowProperties workflowProperties; + @Autowired IncomingInvoiceFetcherService incomingInvoiceFetcherService; @Override public void execute(DelegateExecution delegateExecution) throws Exception { log.info("Executing"); - List invoices = incomingInvoiceFetcherService.getNewInvoices(); + Path inputPath = Paths.get(workflowProperties.getImportInvoice().getInputPath()); + List invoices = incomingInvoiceFetcherService.getNewInvoicesFromPath(inputPath); delegateExecution.setVariableLocal("invoices", invoices); } } diff --git a/lis-workflow/src/main/java/hu/user/lis/workflow/invoice/service/IncomingInvoiceFetcherService.java b/lis-workflow/src/main/java/hu/user/lis/workflow/invoice/service/IncomingInvoiceFetcherService.java index 8137655..be0d376 100644 --- a/lis-workflow/src/main/java/hu/user/lis/workflow/invoice/service/IncomingInvoiceFetcherService.java +++ b/lis-workflow/src/main/java/hu/user/lis/workflow/invoice/service/IncomingInvoiceFetcherService.java @@ -4,29 +4,42 @@ import hu.user.lis.db.Currency; import hu.user.lis.db.IncomingInvoice; import hu.user.lis.db.Partner; import hu.user.lis.db.repository.PartnerRepository; -import hu.user.lis.services.data.DataGeneratorService; +import hu.user.lis.service.data.DataGeneratorService; +import hu.user.lis.service.nav.TaxOfficeDataDeserializer; import org.apache.commons.lang3.RandomUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; import java.text.SimpleDateFormat; import java.util.Arrays; import java.util.Date; import java.util.List; import java.util.concurrent.TimeUnit; +import java.util.stream.Collectors; +import java.util.stream.Stream; @Service public class IncomingInvoiceFetcherService { private static final SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); + @Autowired private PartnerRepository partnerRepository; + @Autowired private DataGeneratorService dataGeneratorService; + @Autowired + private TaxOfficeDataDeserializer taxOfficeDataDeserializer; + public List getNewInvoices() { return Arrays.asList("Invoice-test-1", "Invoice-test-2", "Invoice-test-3"); } + public IncomingInvoice getInvoice(String humanId) throws Exception { int currencyIndex = RandomUtils.nextInt(0, 3); String title = dataGeneratorService.faker().commerce().productName(); @@ -55,6 +68,23 @@ public class IncomingInvoiceFetcherService { .build(); } + public List getNewInvoicesFromPath(Path inputPath) throws IOException { + try (Stream files = Files.list(inputPath)) { + return files.filter(entry -> !Files.isDirectory(entry)) + .map(Path::toAbsolutePath) + .map(Path::toString) + .collect(Collectors.toList()); + } + } + + public IncomingInvoice getInvoiceFromPath(Path invoiceFile) throws Exception { + String xml = new String(Files.readAllBytes(invoiceFile), StandardCharsets.UTF_8); + IncomingInvoice result = taxOfficeDataDeserializer.getIncomingInvoice(xml); + Partner partner = taxOfficeDataDeserializer.getPartner(xml); + result.setPartner(partner); + return result; + } + private Partner getRandomPartner() { List partners = partnerRepository.findAll(); return partners.get(RandomUtils.nextInt(0, partners.size())); diff --git a/lis-workflow/src/main/java/hu/user/lis/workflow/properties/WorkflowProperties.java b/lis-workflow/src/main/java/hu/user/lis/workflow/properties/WorkflowProperties.java new file mode 100644 index 0000000..f454ac5 --- /dev/null +++ b/lis-workflow/src/main/java/hu/user/lis/workflow/properties/WorkflowProperties.java @@ -0,0 +1,22 @@ +package hu.user.lis.workflow.properties; + +import lombok.Getter; +import lombok.Setter; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.stereotype.Component; + +@Getter +@Setter +@Component +@ConfigurationProperties(prefix = "application.workflow") +public class WorkflowProperties { + + private ImportInvoice importInvoice; + + @Getter + @Setter + public static class ImportInvoice { + private String inputPath; + } + +} diff --git a/pom.xml b/pom.xml index 2ce5709..485f56c 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,7 @@ pom lis-workflow - lis-services + lis-service lis-db lis-ui lis-app @@ -18,6 +18,8 @@ 1.8 1.8 7.19.0 + 1.5.5.Final + 1.18.26 org.springframework.boot @@ -27,13 +29,51 @@ + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.0 + + + + org.mapstruct + mapstruct-processor + ${org.mapstruct.version} + + + org.projectlombok + lombok + ${lombok.version} + + + org.projectlombok + lombok-mapstruct-binding + 0.2.0 + + + + + -Amapstruct.defaultComponentModel=spring + + + + + + org.projectlombok lombok - 1.18.26 + ${lombok.version} provided + + org.mapstruct + mapstruct + ${org.mapstruct.version} + org.apache.logging.log4j log4j-api diff --git a/runConfigurations/server-dev.run.xml b/runConfigurations/server-dev.run.xml new file mode 100644 index 0000000..019df9f --- /dev/null +++ b/runConfigurations/server-dev.run.xml @@ -0,0 +1,18 @@ + + + + + + + \ No newline at end of file -- 2.54.0