Class VoucherServiceImpl
java.lang.Object
ch.tocco.nice2.optional.finance.impl.service.vouchercreation.VoucherServiceImpl
- All Implemented Interfaces:
VoucherService
-
Nested Class Summary
Nested classes/interfaces inherited from interface ch.tocco.nice2.optional.finance.api.service.vouchercreation.VoucherService
VoucherService.VoucherTotals -
Constructor Summary
ConstructorsConstructorDescriptionVoucherServiceImpl(Context context, DefaultDisplayService defaultDisplayService, QueryBuilderFactory queryBuilderFactory, ActiveVatRateService activeVatRateService, VatCalculationService vatCalculationService, EntityDefaultValueService defaultValueService, SecurityManager securityManager) -
Method Summary
Modifier and TypeMethodDescriptionorg.joda.time.LocalDatecalculateDateForVoucher(Entity entity) calculates the date of a voucher that is being created based on the already existing vouchers of this debitorvoidfinalizeIncomingPaymentVoucher(Entity voucher) sets several fields and relations on voucher that are always calculated the same when creating the voucher is always made with no vatvoidfinalizeVoucher(Entity voucher) sets several fields and relations on voucher that are always calculated the same when creatingvoidfinalizeVoucher(Entity voucher, BigDecimal fixedBrutto) 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 valuesvoidvoidsetFinancialYearIfAvailable(Entity voucher) if there is a financial year for the given voucher present, set the year on it
-
Constructor Details
-
VoucherServiceImpl
public VoucherServiceImpl(Context context, DefaultDisplayService defaultDisplayService, QueryBuilderFactory queryBuilderFactory, ActiveVatRateService activeVatRateService, VatCalculationService vatCalculationService, EntityDefaultValueService defaultValueService, SecurityManager securityManager)
-
-
Method Details
-
getVoucherTotals
public VoucherService.VoucherTotals getVoucherTotals(BigDecimal amount, org.joda.time.LocalDate voucherDate, BigDecimal rounding, @Nullable @Nullable Entity vatCode) Description copied from interface:VoucherServicecalculates the netto, brutto and vat values- Specified by:
getVoucherTotalsin interfaceVoucherService- 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
Description copied from interface:VoucherServicesets several fields and relations on voucher that are always calculated the same when creating- Specified by:
finalizeVoucherin interfaceVoucherService- Parameters:
voucher- the voucher to finalize
-
finalizeIncomingPaymentVoucher
Description copied from interface:VoucherServicesets several fields and relations on voucher that are always calculated the same when creating the voucher is always made with no vat- Specified by:
finalizeIncomingPaymentVoucherin interfaceVoucherService- Parameters:
voucher- the voucher to finalize
-
finalizeVoucher
Description copied from interface:VoucherServicesets several fields and relations on voucher that are always calculated the same when creating- Specified by:
finalizeVoucherin interfaceVoucherService- Parameters:
voucher- the voucher to finalizefixedBrutto- 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
Description copied from interface:VoucherServiceif there is a financial year for the given voucher present, set the year on it- Specified by:
setFinancialYearIfAvailablein interfaceVoucherService- Parameters:
voucher- the voucher to get the dates from
-
calculateDateForVoucher
Description copied from interface:VoucherServicecalculates the date of a voucher that is being created based on the already existing vouchers of this debitor- Specified by:
calculateDateForVoucherin interfaceVoucherService- Parameters:
entity- the debitor for whom a new voucher is being created
-
getPostingText
Description copied from interface:VoucherServiceReturns the posting text created according to the "postingtext" display that is configured on the Voucher entity- Specified by:
getPostingTextin interfaceVoucherService- Returns:
- the posting text
-
setFinalizeVoucherMethods
@Autowired(required=false) public void setFinalizeVoucherMethods(List<FinalizeVoucherMethod> methods)
-