We periodically run a background job to match unpaid selling documents to payment journals. However, we sometimes find that the journal is submitted and linked to a document but no GL Entry created. Initially, the clearing was done using ERPNext’s Payment Reconciliation so we rewrote the logic to use our customized algorithm and it has been effective for around four months now without a recurrence until yesterday.