Class DebitorIncomingPaymentHandler
java.lang.Object
ch.tocco.nice2.optional.debitor.impl.services.vouchercreation.DebitorIncomingPaymentHandler
- All Implemented Interfaces:
IncomingPaymentHandler
@Component
public class DebitorIncomingPaymentHandler
extends Object
implements IncomingPaymentHandler
-
Constructor Summary
ConstructorsConstructorDescriptionDebitorIncomingPaymentHandler(QueryBuilderFactory queryBuilderFactory, BookIncomingPaymentService bookIncomingPaymentService) -
Method Summary
Modifier and TypeMethodDescriptionvoidclearRelevantData(Entity incomingPayment) When the affiliation of the incoming payment changes all the previous set relations and field must be clearedvoidfinalizeIncomingPayment(Entity incomingPayment, Entity debitor) Same asIncomingPaymentHandler.finalizeIncomingPayment(Entity, String)but receives the relevant entity (e.g.voidfinalizeIncomingPayment(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.booleanisRelevantRelation(String relationName) Returnstrueif the passed relation name is the name of the relevant relation.booleanrelevantRelationIsSet(Entity incomingPayment) Returnstrueif the relevant relation is set on the incoming payment.retrieveOrder(String referenceCode) retrieveOrderDirect(String referenceCode) retrieveOrderScor(String referenceCode)
-
Constructor Details
-
DebitorIncomingPaymentHandler
public DebitorIncomingPaymentHandler(QueryBuilderFactory queryBuilderFactory, @Lazy BookIncomingPaymentService bookIncomingPaymentService)
-
-
Method Details
-
relevantRelationIsSet
Description copied from interface:IncomingPaymentHandlerReturnstrueif 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:
relevantRelationIsSetin interfaceIncomingPaymentHandler
-
isRelevantRelation
Description copied from interface:IncomingPaymentHandlerReturnstrueif 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:
isRelevantRelationin interfaceIncomingPaymentHandler
-
finalizeVoucher
Description copied from interface:IncomingPaymentHandlerFinalizes 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:
finalizeVoucherin interfaceIncomingPaymentHandler
-
finalizeIncomingPayment
public void finalizeIncomingPayment(Entity incomingPayment, @Nullable @Nullable String referenceCode) Description copied from interface:IncomingPaymentHandlerDuring 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:
finalizeIncomingPaymentin interfaceIncomingPaymentHandler
-
retrieveOrder
-
retrieveOrderScor
-
retrieveOrderDirect
-
finalizeIncomingPayment
Description copied from interface:IncomingPaymentHandlerSame asIncomingPaymentHandler.finalizeIncomingPayment(Entity, String)but receives the relevant entity (e.g. Debitor, Donation) as second argument. This method is used if arelevantrelation is set on an existing incoming payment entity.- Specified by:
finalizeIncomingPaymentin interfaceIncomingPaymentHandler
-
clearRelevantData
Description copied from interface:IncomingPaymentHandlerWhen the affiliation of the incoming payment changes all the previous set relations and field must be cleared- Specified by:
clearRelevantDatain interfaceIncomingPaymentHandler
-