Interface IncomingPaymentHandler
- All Known Implementing Classes:
DebitorIncomingPaymentHandler
,DonationIncomingPaymentHandler
public interface IncomingPaymentHandler
This handler provides methods which are used in different places where incoming payments are handled.
An incoming payment for ex. can have a relation to a debitor or to a donation (if debitor- and donation-module are
installed). The handling of some logic in the finance module differs depending on what is set on the incoming payment.
These handlers are used in different services and tasks. An
IncomingPaymentHandler
handler must only be
contributed once to the IncomingPaymentHandlerService
. This service can be injected wherever one of the
methods is used.
Implement this interface if an incoming payment needs a new source of payment (e.g. debitor, donation).-
Method Summary
Modifier and TypeMethodDescriptionvoid
clearRelevantData
(Entity incomingPayment) When the affiliation of the incoming payment changes all the previous set relations and field must be clearedvoid
finalizeIncomingPayment
(Entity incomingPayment, Entity entity) Same asfinalizeIncomingPayment(Entity, String)
but receives the relevant entity (e.g.void
finalizeIncomingPayment
(Entity incomingPayment, @Nullable String referenceCode) During the reading process of the esr file this method is called to check if an entity with the passed reference code exists.finalizeVoucher
(Entity voucher, Entity incomingPayment) Finalizes the passed voucher entity and returns it.boolean
isRelevantRelation
(String relationName) Returnstrue
if the passed relation name is the name of the relevant relation.boolean
relevantRelationIsSet
(Entity incomingPayment) Returnstrue
if the relevant relation is set on the incoming payment.
-
Method Details
-
relevantRelationIsSet
Returnstrue
if the relevant relation is set on the incoming payment. The relevant relation is equal to the source of payment (e.g. relDebitor for orders, relDonation for donations). -
isRelevantRelation
Returnstrue
if the passed relation name is the name of the relevant relation. The relevant relation is equal to the source of payment (e.g. relDebitor for orders, relDonation for donations). -
finalizeVoucher
Finalizes the passed voucher entity and returns it. Needs to- set the relation
relDebit_account
- set the relationrelCredit_account
- set the relationrelCurrency
- set the specific relation which is checked in therelevantRelationIsSet(Entity)
method -
finalizeIncomingPayment
During the reading process of the esr file this method is called to check if an entity with the passed reference code exists. If so, the entity will be set on the incoming payment (e.g. relDebitor or relDonation). Additionally, a handler can set some more entity-specific data. -
finalizeIncomingPayment
Same asfinalizeIncomingPayment(Entity, String)
but receives the relevant entity (e.g. Debitor, Donation) as second argument. This method is used if arelevant
relation is set on an existing incoming payment entity. -
clearRelevantData
When the affiliation of the incoming payment changes all the previous set relations and field must be cleared
-