-
-
Notifications
You must be signed in to change notification settings - Fork 154
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into issues/373-pdfbox
# Conflicts: # library/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRDImporter.java
- Loading branch information
Showing
65 changed files
with
37,263 additions
and
16,138 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,183 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> | ||
<xs:element name="validation"> | ||
<xs:complexType> | ||
<xs:sequence> | ||
<xs:element ref="pdf"/> | ||
<xs:element ref="messages"/> | ||
<xs:element ref="summary"/> | ||
</xs:sequence> | ||
<xs:attribute name="datetime" use="required"/> | ||
<xs:attribute name="filename" use="required" type="xs:NCName"/> | ||
</xs:complexType> | ||
</xs:element> | ||
<xs:element name="pdf"> | ||
<xs:complexType> | ||
<xs:sequence> | ||
<xs:element ref="report"/> | ||
<xs:element ref="info"/> | ||
<xs:element ref="messages"/> | ||
<xs:element ref="summary"/> | ||
</xs:sequence> | ||
</xs:complexType> | ||
</xs:element> | ||
<xs:element name="report"> | ||
<xs:complexType> | ||
<xs:sequence> | ||
<xs:element ref="buildInformation"/> | ||
<xs:element ref="jobs"/> | ||
<xs:element ref="batchSummary"/> | ||
</xs:sequence> | ||
</xs:complexType> | ||
</xs:element> | ||
<xs:element name="buildInformation"> | ||
<xs:complexType> | ||
<xs:sequence> | ||
<xs:element maxOccurs="unbounded" ref="releaseDetails"/> | ||
</xs:sequence> | ||
</xs:complexType> | ||
</xs:element> | ||
<xs:element name="releaseDetails"> | ||
<xs:complexType> | ||
<xs:attribute name="buildDate" use="required" type="xs:dateTime"/> | ||
<xs:attribute name="id" use="required" type="xs:NCName"/> | ||
<xs:attribute name="version" use="required" type="xs:NMTOKEN"/> | ||
</xs:complexType> | ||
</xs:element> | ||
<xs:element name="jobs"> | ||
<xs:complexType> | ||
<xs:sequence> | ||
<xs:element ref="job"/> | ||
</xs:sequence> | ||
</xs:complexType> | ||
</xs:element> | ||
<xs:element name="job"> | ||
<xs:complexType> | ||
<xs:sequence> | ||
<xs:element ref="item"/> | ||
<xs:element ref="validationReport"/> | ||
<xs:element ref="duration"/> | ||
</xs:sequence> | ||
</xs:complexType> | ||
</xs:element> | ||
<xs:element name="item"> | ||
<xs:complexType> | ||
<xs:sequence> | ||
<xs:element ref="name"/> | ||
</xs:sequence> | ||
<xs:attribute name="size" use="required" type="xs:integer"/> | ||
</xs:complexType> | ||
</xs:element> | ||
<xs:element name="name" type="xs:string"/> | ||
<xs:element name="validationReport"> | ||
<xs:complexType> | ||
<xs:sequence> | ||
<xs:element ref="details"/> | ||
</xs:sequence> | ||
<xs:attribute name="isCompliant" use="required" type="xs:boolean"/> | ||
<xs:attribute name="profileName" use="required"/> | ||
<xs:attribute name="statement" use="required"/> | ||
</xs:complexType> | ||
</xs:element> | ||
<xs:element name="details"> | ||
<xs:complexType> | ||
<xs:attribute name="failedChecks" use="required" type="xs:integer"/> | ||
<xs:attribute name="failedRules" use="required" type="xs:integer"/> | ||
<xs:attribute name="passedChecks" use="required" type="xs:integer"/> | ||
<xs:attribute name="passedRules" use="required" type="xs:integer"/> | ||
</xs:complexType> | ||
</xs:element> | ||
<xs:element name="batchSummary"> | ||
<xs:complexType> | ||
<xs:sequence> | ||
<xs:element ref="validationReports"/> | ||
<xs:element ref="featureReports"/> | ||
<xs:element ref="repairReports"/> | ||
<xs:element ref="duration"/> | ||
</xs:sequence> | ||
<xs:attribute name="encrypted" use="required" type="xs:integer"/> | ||
<xs:attribute name="failedToParse" use="required" type="xs:integer"/> | ||
<xs:attribute name="outOfMemory" use="required" type="xs:integer"/> | ||
<xs:attribute name="totalJobs" use="required" type="xs:integer"/> | ||
<xs:attribute name="veraExceptions" use="required" type="xs:integer"/> | ||
</xs:complexType> | ||
</xs:element> | ||
<xs:element name="validationReports"> | ||
<xs:complexType> | ||
<xs:simpleContent> | ||
<xs:extension base="xs:integer"> | ||
<xs:attribute name="compliant" use="required" type="xs:integer"/> | ||
<xs:attribute name="failedJobs" use="required" type="xs:integer"/> | ||
<xs:attribute name="nonCompliant" use="required" type="xs:integer"/> | ||
</xs:extension> | ||
</xs:simpleContent> | ||
</xs:complexType> | ||
</xs:element> | ||
<xs:element name="featureReports"> | ||
<xs:complexType> | ||
<xs:simpleContent> | ||
<xs:extension base="xs:integer"> | ||
<xs:attribute name="failedJobs" use="required" type="xs:integer"/> | ||
</xs:extension> | ||
</xs:simpleContent> | ||
</xs:complexType> | ||
</xs:element> | ||
<xs:element name="repairReports"> | ||
<xs:complexType> | ||
<xs:simpleContent> | ||
<xs:extension base="xs:integer"> | ||
<xs:attribute name="failedJobs" use="required" type="xs:integer"/> | ||
</xs:extension> | ||
</xs:simpleContent> | ||
</xs:complexType> | ||
</xs:element> | ||
<xs:element name="info"> | ||
<xs:complexType> | ||
<xs:sequence> | ||
<xs:element ref="signature"/> | ||
<xs:element ref="duration"/> | ||
</xs:sequence> | ||
</xs:complexType> | ||
</xs:element> | ||
<xs:element name="signature" type="xs:NCName"/> | ||
<xs:element name="duration"> | ||
<xs:complexType> | ||
<xs:simpleContent> | ||
<xs:extension base="xs:NMTOKEN"> | ||
<xs:attribute name="finish" type="xs:integer"/> | ||
<xs:attribute name="start" type="xs:integer"/> | ||
<xs:attribute name="unit" type="xs:NCName"/> | ||
</xs:extension> | ||
</xs:simpleContent> | ||
</xs:complexType> | ||
</xs:element> | ||
<xs:element name="messages"> | ||
<xs:complexType> | ||
<xs:choice> | ||
<xs:element ref="exception"/> | ||
<xs:element minOccurs="0" maxOccurs="unbounded" ref="error"/> | ||
<xs:element minOccurs="0" maxOccurs="unbounded" ref="notice"/> | ||
</xs:choice> | ||
</xs:complexType> | ||
</xs:element> | ||
<xs:element name="exception"> | ||
<xs:complexType mixed="true"> | ||
<xs:attribute name="type" use="required" type="xs:integer"/> | ||
</xs:complexType> | ||
</xs:element> | ||
<xs:element name="error"> | ||
<xs:complexType mixed="true"> | ||
<xs:attribute name="type" use="required" type="xs:integer"/> | ||
</xs:complexType> | ||
</xs:element> | ||
<xs:element name="notice"> | ||
<xs:complexType mixed="true"> | ||
<xs:attribute name="type" use="required" type="xs:integer"/> | ||
</xs:complexType> | ||
</xs:element> | ||
<xs:element name="summary"> | ||
<xs:complexType> | ||
<xs:attribute name="status" use="required" type="xs:NCName"/> | ||
</xs:complexType> | ||
</xs:element> | ||
</xs:schema> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
library/src/main/java/org/mustangproject/CashDiscount.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
package org.mustangproject; | ||
|
||
import org.mustangproject.ZUGFeRD.IZUGFeRDCashDiscount; | ||
|
||
import java.math.BigDecimal; | ||
|
||
/*** | ||
* A class to represent discounts for early payments ("Skonto") | ||
*/ | ||
public class CashDiscount implements IZUGFeRDCashDiscount { | ||
|
||
/*** | ||
* the reduction percent allowed in the period | ||
*/ | ||
protected BigDecimal percent; | ||
/*** | ||
* the period (usually days) count how long the percent apply | ||
*/ | ||
protected Integer days=null; | ||
|
||
/*** | ||
* Create a cash discount (skonto) with the specified height in the specified period. | ||
* Should someone add more period types than just "days" there | ||
* is be space for a (optional) third parameter | ||
* | ||
* @param percent max 3 decimals "behind the dot", more precision is currently ignored | ||
* @param days the count of the periods (usually days) the percentage applies | ||
*/ | ||
public CashDiscount(BigDecimal percent, int days) { | ||
this.percent = percent; | ||
this.days = days; | ||
} | ||
|
||
/*** | ||
* @return this particular cash discount as cross industry invoice XML | ||
*/ | ||
public String getAsCII() { | ||
return "<ram:SpecifiedTradePaymentTerms>"+ | ||
"<ram:Description>Cash Discount</ram:Description>"+ | ||
" <ram:ApplicableTradePaymentDiscountTerms>"+ | ||
" <ram:BasisPeriodMeasure unitCode=\"DAY\">"+days+"</ram:BasisPeriodMeasure>"+ | ||
" <ram:CalculationPercent>"+XMLTools.nDigitFormat(percent,3)+"</ram:CalculationPercent>"+ | ||
" </ram:ApplicableTradePaymentDiscountTerms>"+ | ||
"</ram:SpecifiedTradePaymentTerms>"; | ||
} | ||
|
||
/*** | ||
* since EN16931 voted not to have (or even allow) cash discounts in their core invoice the german | ||
* XRechnung CIUS defined it's own proprietary format for a freetext field | ||
* @return this particular cash discount in proprietary xrechnung format | ||
*/ | ||
public String getAsXRechnung() { | ||
return "#SKONTO#TAGE="+days+"#PROZENT="+XMLTools.nDigitFormat(percent,2)+"#\n"; | ||
} | ||
|
||
|
||
|
||
|
||
} |
Oops, something went wrong.