java.lang.Object
ch.tocco.nice2.optional.finance.impl.service.vouchercreation.VoucherServiceImpl
All Implemented Interfaces:
VoucherService

public class VoucherServiceImpl extends Object implements VoucherService
  • Constructor Details

  • Method Details

    • getVoucherTotals

      public VoucherService.VoucherTotals getVoucherTotals(BigDecimal amount, org.joda.time.LocalDate voucherDate, BigDecimal rounding, @Nullable @Nullable Entity vatCode)
      Description copied from interface: VoucherService
      calculates the netto, brutto and vat values
      Specified by:
      getVoucherTotals in interface VoucherService
      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

      public void finalizeVoucher(Entity voucher)
      Description copied from interface: VoucherService
      sets several fields and relations on voucher that are always calculated the same when creating
      Specified by:
      finalizeVoucher in interface VoucherService
      Parameters:
      voucher - the voucher to finalize
    • finalizeIncomingPaymentVoucher

      public void finalizeIncomingPaymentVoucher(Entity voucher)
      Description copied from interface: VoucherService
      sets several fields and relations on voucher that are always calculated the same when creating the voucher is always made with no vat
      Specified by:
      finalizeIncomingPaymentVoucher in interface VoucherService
      Parameters:
      voucher - the voucher to finalize
    • finalizeVoucher

      public void finalizeVoucher(Entity voucher, BigDecimal fixedBrutto)
      Description copied from interface: VoucherService
      sets several fields and relations on voucher that are always calculated the same when creating
      Specified by:
      finalizeVoucher in interface VoucherService
      Parameters:
      voucher - the voucher to finalize
      fixedBrutto - the desired nettoAmount, this will be enforced so that no rounding errors can happen all rounding differences will be corrected on the vat amount
    • setFinancialYearIfAvailable

      public void setFinancialYearIfAvailable(Entity voucher)
      Description copied from interface: VoucherService
      if there is a financial year for the given voucher present, set the year on it
      Specified by:
      setFinancialYearIfAvailable in interface VoucherService
      Parameters:
      voucher - the voucher to get the dates from
    • calculateDateForVoucher

      public org.joda.time.LocalDate calculateDateForVoucher(Entity entity)
      Description copied from interface: VoucherService
      calculates the date of a voucher that is being created based on the already existing vouchers of this debitor
      Specified by:
      calculateDateForVoucher in interface VoucherService
      Parameters:
      entity - the debitor for whom a new voucher is being created
    • getPostingText

      public String getPostingText(Entity voucher)
      Description copied from interface: VoucherService
      Returns the posting text created according to the "postingtext" display that is configured on the Voucher entity
      Specified by:
      getPostingText in interface VoucherService
      Returns:
      the posting text
    • setFinalizeVoucherMethods

      @Autowired(required=false) public void setFinalizeVoucherMethods(List<FinalizeVoucherMethod> methods)