when we throw the batch DirectDebitResult we got some errors which are IllegalEventException and that
due to some bills were in presented status and back to pending status because of an endorsement like "Payment Mode Adaptation",
therefore the application won't found a state machine related to that status and then throw the exception.
the correction is to skip these bills and if there is a credit instance these later will be paid by it.
after this correction we got an other error when the application try to insert an affectation(related to a credit instance) in the database with an amount i…