Class SwicoBillInformation
Swico S1 (see Syntaxdefinition S1)
is one of the supported standards for adding structured billing information to a QR bill
(in the field StrdBkgInf
).
All properties of this bean are optional.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Payment condition detail: a tuple of discount and validity in days.static class
VAT rate detail: a tuple of VAT rate and amount. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic SwicoBillInformation
decodeText
(String text) Decodes the text of structured billing information and creates aSwicoBillInformation
instance.Encodes this bill information as a single text string suitable to be added to a Swiss QR bill.boolean
Gets the customer reference.Gets the payment due date.Gets the invoice date.Gets the invoice number.Gets the payment conditions.Gets the date when the goods or service were supplied.Gets the end date of the period when the service was supplied (e.g.Gets the list of VAT import taxes.Gets the invoicing party's VAT number.Gets the VAT rate in case the same rate applies to the entire invoice.Gets a list of VAT rates.Gets the start date of the period when the service was supplied (e.g.int
hashCode()
void
setCustomerReference
(String customerReference) Sets the customer reference.void
setInvoiceDate
(LocalDate invoiceDate) Sets the invoice date.void
setInvoiceNumber
(String invoiceNumber) Sets the invoice number.void
setPaymentConditions
(List<SwicoBillInformation.PaymentCondition> paymentConditions) Sets the payment conditions.void
setVatDate
(LocalDate vatDate) Sets the date when the goods or service were supplied.void
setVatEndDate
(LocalDate vatEndDate) Sets the end date of the period when the service was supplied (e.g.void
setVatImportTaxes
(List<SwicoBillInformation.RateDetail> vatImportTaxes) Sets the list of VAT import taxes.void
setVatNumber
(String vatNumber) Sets the invoicing party's VAT number.void
setVatRate
(BigDecimal vatRate) Sets the VAT rate in case the same rate applies to the entire invoice.void
setVatRateDetails
(List<SwicoBillInformation.RateDetail> vatRateDetails) Sets a list of VAT rates.void
setVatStartDate
(LocalDate vatStartDate) Sets the start date of the period when the service was supplied (e.g.toString()
-
Constructor Details
-
SwicoBillInformation
public SwicoBillInformation()Creates a new instance withnull
values.
-
-
Method Details
-
getInvoiceNumber
Gets the invoice number.- Returns:
- the invoice number
-
setInvoiceNumber
Sets the invoice number.- Parameters:
invoiceNumber
- the invoice number
-
getInvoiceDate
Gets the invoice date.- Returns:
- the invoice date
-
setInvoiceDate
Sets the invoice date.- Parameters:
invoiceDate
- the invoice date
-
getCustomerReference
Gets the customer reference.- Returns:
- the customer reference
-
setCustomerReference
Sets the customer reference.- Parameters:
customerReference
- the customer reference
-
getVatNumber
Gets the invoicing party's VAT number.The number is supplied without any prefix, white space, separator or suffix, i.e. "106017086" instead of "CHE-106.017.086 MWST".
- Returns:
- the VAT number
-
setVatNumber
Sets the invoicing party's VAT number.The number is supplied without any prefix, white space, separator or suffix, i.e. "106017086" instead of "CHE-106.017.086 MWST".
- Parameters:
vatNumber
- the VAT number
-
getVatDate
Gets the date when the goods or service were supplied.If this VAT date is given, VAT start and end date must be
null
.- Returns:
- the VAT date
-
setVatDate
Sets the date when the goods or service were supplied.If this VAT date is set, VAT start and end date must be
null
.- Parameters:
vatDate
- the VAT date
-
getVatStartDate
Gets the start date of the period when the service was supplied (e.g. a subscription).If this VAT start date is given, the VAT end date must all be given and the VAT date must be
null
.- Returns:
- the VAT start date
-
setVatStartDate
Sets the start date of the period when the service was supplied (e.g. a subscription).If this VAT start date is given, the VAT end date must also be given and the VAT date must be
null
.- Parameters:
vatStartDate
- the VAT start date
-
getVatEndDate
Gets the end date of the period when the service was supplied (e.g. a subscription).If this VAT end date is given, the VAT start date must also be given and the VAT date must be
null
.- Returns:
- the VAT end date
-
setVatEndDate
Sets the end date of the period when the service was supplied (e.g. a subscription).If this VAT end date is given, the VAT start date must also be given and the VAT date must be
null
.- Parameters:
vatEndDate
- the VAT end date
-
getVatRate
Gets the VAT rate in case the same rate applies to the entire invoice.If different rates apply to invoice line items, this property is
null
andgetVatRateDetails()
is used instead.- Returns:
- the VAT rate (in percent)
-
setVatRate
Sets the VAT rate in case the same rate applies to the entire invoice.If different rates apply to invoice line items, this property is
null
andsetVatRateDetails(List)
is used instead.- Parameters:
vatRate
- the VAT rate (in percent)
-
getVatRateDetails
Gets a list of VAT rates.Each element in the list is a tuple of VAT rate and amount. It indicates that the specified VAT rate applies to the specified net amount (partial amount) of the invoice.
If a single VAT rate applies to the entire invoice, this list is
null
andgetVatRate()
is used instead.Example: If the list contained (8, 1000), (2.5, 51.8), (7.7, 250) for an invoice in CHF, a VAT rate of 8% would apply to CHF 1000.00, 2.5% for CHF 51.80 and 7.7% for CHF 250.00.
- Returns:
- the list of VAT rate/amount tuples
-
setVatRateDetails
Sets a list of VAT rates.Each element in the list is a tuple of VAT rate and amount. It indicates that the specified VAT rate applies to the specified net amount (partial amount) of the invoice.
If a single VAT rate applies to the entire invoice, this list is
null
andsetVatRate(BigDecimal)
is used instead.Example: If the list contained (8, 1000), (2.5, 51.8), (7.7, 250) for an invoice in CHF, a VAT rate of 8% would apply to CHF 1000.00, 2.5% for CHF 51.80 and 7.7% for CHF 250.00.
- Parameters:
vatRateDetails
- the list of VAT rate/amount tuples
-
getVatImportTaxes
Gets the list of VAT import taxes.Each element in the list is a tuple of VAT rate and VAT amount. It indicates that the specified VAT rate was applied and resulted in the specified tax amount.
Example: If the list contained (7.7, 48.37), (2.5, 12.4) for an invoice in CHF, a VAT rate of 7.7% has been applied to a part of the items resulting in CHF 48.37 in tax and a rate of 2.5% has been applied to another part of the items resulting in CHF 12.40 in tax.
- Returns:
- the list of VAT rate/amount tuples
-
setVatImportTaxes
Sets the list of VAT import taxes.Each element in the list is a tuple of VAT rate and VAT amount. It indicates that the specified VAT rate was applied and resulted in the specified tax amount.
Example: If the list contained (7.7, 48.37), (2.5, 12.4) for an invoice in CHF, a VAT rate of 7.7% has been applied to a part of the items resulting in CHF 48.37 in tax and a rate of 2.5% has been applied to another part of the items resulting in CHF 12.40 in tax.
- Parameters:
vatImportTaxes
- the list of VAT rate/amount tuples
-
getPaymentConditions
Gets the payment conditions.Each element in the list is a tuple of a payment discount and a deadline (in days from the invoice date).
If the list contained (2, 10), (0, 60), a discount of 2% applies if the payment is made by 10 days after invoice data. The payment is due 60 days after invoice date.
- Returns:
- the list of discount/days tuples
-
setPaymentConditions
Sets the payment conditions.Each element in the list is a tuple of a payment discount and a deadline (in days from the invoice date).
If the list contained (2, 10), (0, 60), a discount of 2% applies if the payment is made by 10 days after invoice data. The payment is due 60 days after invoice date.
- Parameters:
paymentConditions
- the list of discount/days tuples
-
getDueDate
Gets the payment due date.The due date is calculated from the invoice date and the payment condition with a discount of 0.
- Returns:
- the due date (or
null
if the invoice date or the relevant payment condition is missing)
-
encodeAsText
Encodes this bill information as a single text string suitable to be added to a Swiss QR bill.- Returns:
- the encoded text
-
decodeText
Decodes the text of structured billing information and creates aSwicoBillInformation
instance.- Parameters:
text
- he structured billing information encoded according to Swico S1 syntax.- Returns:
- the decoded billing information
-
equals
-
hashCode
public int hashCode() -
toString
-