Script of the Month: Security Deposit/Outstanding Balance

When you’re looking for a way to automatically calculate a resident’s security deposit refund, or any outstanding balance due, the following two-part script can be added to your letter templates for a simple solution.

This double-duty script compares the security deposit held and the outstanding account balance. Then depending on which balance is greater, it calculates the security deposit to be paid to the tenant OR the remaining balance due after the security deposit was applied.

Here’s how:

Part 1:

Script:[$NET = (DEPAMT- BALASOF (CURDATE));]

$NET represents the sum of the security deposit held (DEPAMT) minus outstanding charges on the account (BALASOF) as of today’s date (CURDATE). The empty quotes () at the end of the script tells Rent Manager to calculate the value of $NET, but not to display or print it when merged with a customer account.

(Note: Part 1 script copy/data will NOT show up on the final letter. It’s strictly pulls data for Part 2 to reference and will not appear when printed.)

Part 2:

Script: [Sif($NET>=0,”Amount Refunded:”&SFormat($NET,”Currency”),”Amount Owed:”&SFormat(0-$NET,”Currency”))]

If (Sif) the value of $NET is greater than or equal to $0, ($NET>=0) then display the text “Amount Refunded:” followed by the value of $NET (DEPAMT BALASOF) and format it with a dollar sign and two decimal places (SFormat…Currency). Otherwise (if $NET is less than $0) display the text “Amount Owed:” followed by the value amount the customer owes for charges after security deposits are exhausted (0-$NET).

Example:

Jane Renter’s original security deposit was $500.
Her outstanding account balance is $322.45.

Amount Refunded: $177.55 will appear in the printed letter in place of the scripting code.

To take advantage of this timesaving script, simply go to Letter Template Manager and copy and paste Part 1 and Part 2 directly into any letter template.