Custom Script Calculation

How can i subtract the “Total Amount” field from “Statement Ending Balance” field and set the difference in “Reconciled difference” field in custom script of Bank Reconciliation.