Class DonationIncomingPaymentHandler
java.lang.Object
ch.tocco.nice2.optional.donationfinance.impl.util.DonationIncomingPaymentHandler
- All Implemented Interfaces:
IncomingPaymentHandler
@Component
public class DonationIncomingPaymentHandler
extends Object
implements IncomingPaymentHandler
-
Constructor Summary
ConstructorDescriptionDonationIncomingPaymentHandler
(QueryBuilderFactory queryBuilderFactory, CopyDonationService copyDonationService, Context context, BookIncomingPaymentService bookIncomingPaymentService) -
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 asIncomingPaymentHandler.finalizeIncomingPayment(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.
-
Constructor Details
-
DonationIncomingPaymentHandler
public DonationIncomingPaymentHandler(QueryBuilderFactory queryBuilderFactory, CopyDonationService copyDonationService, Context context, @Lazy BookIncomingPaymentService bookIncomingPaymentService)
-
-
Method Details
-
relevantRelationIsSet
Description copied from interface:IncomingPaymentHandler
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).- Specified by:
relevantRelationIsSet
in interfaceIncomingPaymentHandler
-
isRelevantRelation
Description copied from interface:IncomingPaymentHandler
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).- Specified by:
isRelevantRelation
in interfaceIncomingPaymentHandler
-
finalizeVoucher
Description copied from interface:IncomingPaymentHandler
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 theIncomingPaymentHandler.relevantRelationIsSet(Entity)
method- Specified by:
finalizeVoucher
in interfaceIncomingPaymentHandler
-
finalizeIncomingPayment
public void finalizeIncomingPayment(Entity incomingPayment, @Nullable @Nullable String referenceCode) Description copied from interface:IncomingPaymentHandler
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.- Specified by:
finalizeIncomingPayment
in interfaceIncomingPaymentHandler
-
finalizeIncomingPayment
Description copied from interface:IncomingPaymentHandler
Same asIncomingPaymentHandler.finalizeIncomingPayment(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.- Specified by:
finalizeIncomingPayment
in interfaceIncomingPaymentHandler
-
clearRelevantData
Description copied from interface:IncomingPaymentHandler
When the affiliation of the incoming payment changes all the previous set relations and field must be cleared- Specified by:
clearRelevantData
in interfaceIncomingPaymentHandler
-