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 Details

    • relevantRelationIsSet

      boolean relevantRelationIsSet(Entity incomingPayment)
      Returns true 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

      boolean isRelevantRelation(String relationName)
      Returns true 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

      Entity finalizeVoucher(Entity voucher, Entity incomingPayment)
      Finalizes the passed voucher entity and returns it. Needs to
        - set the relation relDebit_account
        - set the relation relCredit_account
        - set the relation relCurrency
        - set the specific relation which is checked in the relevantRelationIsSet(Entity) method
    • finalizeIncomingPayment

      void finalizeIncomingPayment(Entity incomingPayment, @Nullable @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. 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

      void finalizeIncomingPayment(Entity incomingPayment, Entity entity)
      Same as finalizeIncomingPayment(Entity, String) but receives the relevant entity (e.g. Debitor, Donation) as second argument. This method is used if a relevant relation is set on an existing incoming payment entity.
    • clearRelevantData

      void clearRelevantData(Entity incomingPayment)
      When the affiliation of the incoming payment changes all the previous set relations and field must be cleared