Class CashDiscount

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.lang.Integer days
      the period (usually days) count how long the percent apply
      protected java.math.BigDecimal percent
      the reduction percent allowed in the period
    • Constructor Summary

      Constructors 
      Constructor Description
      CashDiscount()
      bean contructor
      CashDiscount​(java.math.BigDecimal percent, int days)
      Create a cash discount (skonto) with the specified height in the specified period.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getAsCII()  
      java.lang.String getAsXRechnung()
      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
      java.lang.Integer getDays()  
      java.math.BigDecimal getPercent()  
      CashDiscount setDays​(java.lang.Integer days)  
      CashDiscount setPercent​(java.math.BigDecimal percent)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • percent

        protected java.math.BigDecimal percent
        the reduction percent allowed in the period
      • days

        protected java.lang.Integer days
        the period (usually days) count how long the percent apply
    • Constructor Detail

      • CashDiscount

        public CashDiscount​(java.math.BigDecimal percent,
                            int days)
        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
        Parameters:
        percent - max 3 decimals "behind the dot", more precision is currently ignored
        days - the count of the periods (usually days) the percentage applies
      • CashDiscount

        public CashDiscount()
        bean contructor
    • Method Detail

      • getPercent

        public java.math.BigDecimal getPercent()
      • setPercent

        public CashDiscount setPercent​(java.math.BigDecimal percent)
      • getDays

        public java.lang.Integer getDays()
      • setDays

        public CashDiscount setDays​(java.lang.Integer days)
      • getAsCII

        public java.lang.String getAsCII()
        Specified by:
        getAsCII in interface IZUGFeRDCashDiscount
        Returns:
        this particular cash discount as cross industry invoice XML
      • getAsXRechnung

        public java.lang.String getAsXRechnung()
        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
        Specified by:
        getAsXRechnung in interface IZUGFeRDCashDiscount
        Returns:
        this particular cash discount in proprietary xrechnung format