PDF (US Ltr)
- 180.8Kb
PDF (A4)
- 180.7Kb
The get_customer_balance
function returns
the current amount owing on a specified customer's account.
Parameters
p_customer_id
: The ID of the customer to check, from thecustomer_id
column of thecustomer
table.p_effective_date
: The cutoff date for items that will be applied to the balance. Any rentals, payments, and so forth after this date are not counted.
Return Values
This function returns the amount owing on the customer's account.
Sample Usage
mysql> SELECT get_customer_balance(298,NOW());
+---------------------------------+
| get_customer_balance(298,NOW()) |
+---------------------------------+
| 22.00 |
+---------------------------------+
1 row in set (0.00 sec)