Invoice mapping modified for vat
authorVásáry Dániel <vasary@elgekko.net>
Sat, 17 Feb 2024 23:35:37 +0000 (00:35 +0100)
committerVásáry Dániel <vasary@elgekko.net>
Sat, 17 Feb 2024 23:35:37 +0000 (00:35 +0100)
lis-app/src/main/java/hu/user/lis/build/Exec.java [deleted file]
lis-app/src/test/java/hu/user/lis/workflow/TaxOfficeInvoiceApiIT.java
lis-service/src/main/java/hu/user/lis/service/nav/mapper/InvoiceMapper.java

diff --git a/lis-app/src/main/java/hu/user/lis/build/Exec.java b/lis-app/src/main/java/hu/user/lis/build/Exec.java
deleted file mode 100644 (file)
index caf7390..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-package hu.user.lis.build;
-
-
-import java.util.Arrays;
-
-public class Exec {
-
-    public static void main(String[] args) {
-        System.out.println("Running the main method");
-        if (args.length > 0) {
-            System.out.println("List of arguments: " + Arrays.toString(args));
-        }
-    }
-}
\ No newline at end of file
index dc5bb2c1b1c1ffe50616bf305019c16e2e01dbe8..34753ed54c1e89880629ff2c8916e45b65e6f4d8 100644 (file)
@@ -157,7 +157,7 @@ public class TaxOfficeInvoiceApiIT {
         int availablePages = 1;
         int currentPage = 1;
         while (currentPage <= availablePages) {
-            Optional<QueryInvoiceDigestResponse> response = taxOfficeInvoiceService.queryInboundInvoices(currentPage, 15, 34);
+            Optional<QueryInvoiceDigestResponse> response = taxOfficeInvoiceService.queryInboundInvoices(currentPage, 5, 34);
             if (!response.isPresent()) {
                 break;
             }
@@ -191,10 +191,10 @@ public class TaxOfficeInvoiceApiIT {
                             entity = invoiceMapper.toEntity(invoiceData.get());
                         }
 
-                        log.info("Invoice found: {} {} {} {}", invoiceNumber, entity.getNetAmount(), entity.getGrossAmount(), entity.getVatAmount());
-                        if ("MPHGT-2023-68".equals(invoiceNumber) || "2FBT-2022-29".equals(invoiceNumber)) {
-                            log.info("found");
-                        }
+                        log.info("Invoice found: {} {} {} {} {}", invoiceNumber, entity.getNetAmount(), entity.getGrossAmount(), entity.getCurrency(), entity.getVatAmount());
+//                        if ("SZ/3303005/02810/00005".equals(invoiceNumber)) {
+//                            log.info("found");
+//                        }
 
                     }
                 }
index a9e858b1cb2e24a1962daa39e57228ca441b882e..67b8b50795391a4f6d3bf943fa35b93945986fff 100644 (file)
@@ -19,7 +19,7 @@ public interface InvoiceMapper {
     @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 = "vatAmount", source = "invoiceMain.invoice.invoiceSummary.summaryNormal.invoiceVatAmountHUF")
     @Mapping(target = "grossAmount", source = "invoiceMain.invoice.invoiceSummary.summaryGrossData.invoiceGrossAmount")
     @Mapping(target = "incoming", constant = "true")
     @Mapping(target = "id", ignore = true)