From 7813f2db59ebd028b32a82ad224f50bb993a1c54 Mon Sep 17 00:00:00 2001 From: jstaerk Date: Tue, 19 Aug 2025 18:46:42 +0200 Subject: [PATCH] json ignoring some attributes --- History.md | 2 ++ library/src/main/java/org/mustangproject/Invoice.java | 2 ++ library/src/main/java/org/mustangproject/Product.java | 3 +++ 3 files changed, 7 insertions(+) diff --git a/History.md b/History.md index 1efe1d53..917531d5 100644 --- a/History.md +++ b/History.md @@ -1,3 +1,5 @@ +- added JSONIgnore for Products intra community supply, reverse charge and invoice's isValid (which rather means isComplete, by the way) + 2.19.0 ======= 2025-08-12 diff --git a/library/src/main/java/org/mustangproject/Invoice.java b/library/src/main/java/org/mustangproject/Invoice.java index 72d71a6c..b1ec632f 100644 --- a/library/src/main/java/org/mustangproject/Invoice.java +++ b/library/src/main/java/org/mustangproject/Invoice.java @@ -23,6 +23,7 @@ package org.mustangproject; import java.math.BigDecimal; import java.util.*; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import org.mustangproject.ZUGFeRD.*; import org.mustangproject.ZUGFeRD.model.DocumentCodeTypeConstants; @@ -754,6 +755,7 @@ public class Invoice implements IExportableTransaction { * checks if all required items are set in order to be able to export it * @return true if all required items are set */ + @JsonIgnore public boolean isValid() { return (dueDate != null) && (sender != null) && (sender.getTaxID() != null) && (sender.getVATID() != null) && (recipient != null); //contact diff --git a/library/src/main/java/org/mustangproject/Product.java b/library/src/main/java/org/mustangproject/Product.java index 467fbb60..6aca773a 100644 --- a/library/src/main/java/org/mustangproject/Product.java +++ b/library/src/main/java/org/mustangproject/Product.java @@ -214,11 +214,14 @@ public class Product implements IZUGFeRDExportableProduct { return this; } + @JsonIgnore @Override public boolean isReverseCharge() { return isReverseCharge; } + + @JsonIgnore @Override public boolean isIntraCommunitySupply() { return isIntraCommunitySupply;