Add trigger when deleting from payment table

Issue No: AR-12259
Created 8/21/2020 12:04:41 AM
Type Feature
Priority Critical
Status Closed
Resolution Fixed
Fixed Version 19.1, 20.1, 19.2
Description This issue relates to i21 Help Desk ticket. Click the link below to go to Help Desk ticket.     [HDTN-247380 - AR Account is out of balance|https://helpdesk.irely.com/iRelyi21live/#/HD/Ticket/?ticket=HDTN-247380]     *Reproduction Steps:*   1. Create and post an payment.   2. Go to SQL, ran this query: (change the payment number based on what you created in step #1)   {noformat}BEGIN TRAN DECLARE @intPaymentId INT = NULL SELECT TOP 1 @intPaymentId = intPaymentId FROM tblARPayment WHERE strRecordNumber = 'RCV-381' --CHANGE THIS PAYMENT NUMBER UPDATE tblARPayment SET ysnPosted = 0 WHERE intPaymentId = @intPaymentId DELETE FROM tblARPayment WHERE intPaymentId = @intPaymentId ROLLBACK TRAN BEGIN TRAN DELETE FROM tblARPayment WHERE intPaymentId = @intPaymentId ROLLBACK TRAN{noformat}   *Issue:*   Payment was deleted.   *Expected Result:*   Payment shouldn't be allowed to delete.   Check the comment section for sample.