Add trigger when deleting from invoice table

Issue No: AR-12082
Created 6/28/2020 11:27:51 PM
Type Bug-QC
Priority Blocker
Status Closed
Resolution Fixed
Fixed Version 19.1
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] 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 invoice.   2. Go to SQL, ran this query: (change the invoice number based on what you created in step #1)   {noformat}BEGIN TRAN DECLARE @intInvoiceId INT = NULL SELECT TOP 1 @intInvoiceId = intInvoiceId FROM tblARInvoice WHERE strInvoiceNumber = 'SI-1012' --CHANGE THIS INVOICE NUMBER UPDATE tblARInvoice SET ysnPosted = 0 WHERE intInvoiceId = @intInvoiceId DELETE FROM tblARInvoice WHERE intInvoiceId = @intInvoiceId ROLLBACK TRAN BEGIN TRAN DELETE FROM tblARInvoice WHERE intInvoiceId = @intInvoiceId ROLLBACK TRAN{noformat}   *Issue:*   Invoice was deleted.   *Expected Result:*   Invoice shouldn't be allowed to delete.   Check the comment section for sample.