Prevent Orphaned CM BankTransaction records that are created from other modules

Issue No: GL-7770
Created 8/19/2020 8:29:21 AM
Type Bug
Priority Critical
Status Closed
Resolution Fixed
Fixed Version 18.3
Description *This issue relates to i21 Help Desk ticket:* [ HDTN-249609 - A deleted payment is still showing up on the bank reconciliation|https://helpdesk.irely.com/iRelyi21live/#/HD/Ticket/?ticket=HDTN-249609]   * Issue ** Data is being orphaned in CM module that is related to transactions that created the CM Bank Record. ** Note the exact steps to recreate have not been consistently created. * Requirements ** Enforce data integrity on the relationship of records created down stream. ** Do not allow deletion of Pay record (tblAPPayment) without first deleting the CM (tblCMBankTransaction) record ** Give error message on AP side on why/when a record cannot be removed for SQL error. * Technical Requirements ** CM   *** Add a new foreign key column in tblCMBankTransaction (intPaymentId). *** One Time Update intPaymentId on existing records during deployment ** AP   *** Put a value on intPaymentId upon creation of bank transaction after payment is posted. *** Adjust the AP screen for this error that user may encounter when deleting payment with bank transaction.