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

    Nested Classes
    Modifier and Type
    Interface
    Description
    static class 
    bean class containing calculated netto, brutto and vat amounts
  • Method Summary

    Modifier and Type
    Method
    Description
    org.joda.time.LocalDate
    calculates the date of a voucher that is being created based on the already existing vouchers of this debitor
    void
    sets several fields and relations on voucher that are always calculated the same when creating the voucher is always made with no vat
    void
    sets several fields and relations on voucher that are always calculated the same when creating
    void
    finalizeVoucher(Entity voucher, BigDecimal nettoAmount)
    sets several fields and relations on voucher that are always calculated the same when creating
    Returns the posting text created according to the "postingtext" display that is configured on the Voucher entity
    getVoucherTotals(BigDecimal amount, org.joda.time.LocalDate voucherDate, BigDecimal rounding, @Nullable Entity vatCode)
    calculates the netto, brutto and vat values
    void
    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 with
      voucherDate - the date, for which the vat dates are pulled
      rounding - how to round the values
      vatCode - the used vatcode
      Returns:
      a VoucherService.VoucherTotals
    • finalizeVoucher

      void finalizeVoucher(Entity voucher)
      sets several fields and relations on voucher that are always calculated the same when creating
      Parameters:
      voucher - the voucher to finalize
    • finalizeVoucher

      void finalizeVoucher(Entity voucher, BigDecimal nettoAmount)
      sets several fields and relations on voucher that are always calculated the same when creating
      Parameters:
      voucher - the voucher to finalize
      nettoAmount - 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

      void 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 vat
      Parameters:
      voucher - the voucher to finalize
    • setFinancialYearIfAvailable

      void setFinancialYearIfAvailable(Entity voucher)
      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

      org.joda.time.LocalDate calculateDateForVoucher(Entity debitor)
      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

      String getPostingText(Entity voucher)
      Returns the posting text created according to the "postingtext" display that is configured on the Voucher entity
      Returns:
      the posting text