Interface VoucherService
- All Known Implementing Classes:
VoucherServiceImpl
public interface VoucherService
this service is used when creating voucher
it provides several methods that are needed to complete a voucher
the creation of a voucher itself has to be handled manually, because many things need to be set individually
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic class
bean class containing calculated netto, brutto and vat amounts -
Method Summary
Modifier and TypeMethodDescriptionorg.joda.time.LocalDate
calculateDateForVoucher
(Entity debitor) calculates the date of a voucher that is being created based on the already existing vouchers of this debitorvoid
finalizeIncomingPaymentVoucher
(Entity voucher) sets several fields and relations on voucher that are always calculated the same when creating the voucher is always made with no vatvoid
finalizeVoucher
(Entity voucher) sets several fields and relations on voucher that are always calculated the same when creatingvoid
finalizeVoucher
(Entity voucher, BigDecimal nettoAmount) sets several fields and relations on voucher that are always calculated the same when creatinggetPostingText
(Entity voucher) Returns the posting text created according to the "postingtext" display that is configured on the Voucher entitygetVoucherTotals
(BigDecimal amount, org.joda.time.LocalDate voucherDate, BigDecimal rounding, @Nullable Entity vatCode) calculates the netto, brutto and vat valuesvoid
setFinancialYearIfAvailable
(Entity voucher) if there is a financial year for the given voucher present, set the year on it
-
Method Details
-
getVoucherTotals
VoucherService.VoucherTotals getVoucherTotals(BigDecimal amount, org.joda.time.LocalDate voucherDate, BigDecimal rounding, @Nullable @Nullable Entity vatCode) calculates the netto, brutto and vat values- Parameters:
amount
- the amount to calculate withvoucherDate
- the date, for which the vat dates are pulledrounding
- how to round the valuesvatCode
- the used vatcode- Returns:
- a
VoucherService.VoucherTotals
-
finalizeVoucher
sets several fields and relations on voucher that are always calculated the same when creating- Parameters:
voucher
- the voucher to finalize
-
finalizeVoucher
sets several fields and relations on voucher that are always calculated the same when creating- Parameters:
voucher
- the voucher to finalizenettoAmount
- the desired nettoAmount, this will be enforced so that no rounding errors can happen all rounding differences will be corrected on the vat amount
-
finalizeIncomingPaymentVoucher
sets several fields and relations on voucher that are always calculated the same when creating the voucher is always made with no vat- Parameters:
voucher
- the voucher to finalize
-
setFinancialYearIfAvailable
if there is a financial year for the given voucher present, set the year on it- Parameters:
voucher
- the voucher to get the dates from
-
calculateDateForVoucher
calculates the date of a voucher that is being created based on the already existing vouchers of this debitor- Parameters:
debitor
- the debitor for whom a new voucher is being created
-
getPostingText
Returns the posting text created according to the "postingtext" display that is configured on the Voucher entity- Returns:
- the posting text
-