Reconsider logic for completing or cancelling contributions from Participant Batch Update
On digging into the code for participant batch status update in order to clean it up I found the logic rather esoteric.
If participation records are updated to have a different status contribution records are also updated IF all the following apply
- the contribution has is_pay_later = 1
- the contribution source is 'Online Event Registration'
- the status is changed to one of 'Registered', 'Attended', 'Partially Paid', 'Pending Refund' - in which case the contribution is updated to have a status of 'Completed' OR the status is changed to one of 'No Show', 'Cancelled', 'Rejected', 'Expired', 'Transferred' - in which case the contribution is updated to have a status of 'Cancelled'
Given the diversity of flows through Civi now I rather wonder if this would not cause more confusion than leaving the contribution alone.....