Customer Balance - receivable
Dear All,
how can i calculate the balance till a specific date ex: till 01-JAN-2018 of a customer
im using these functions but it still missing something because the amount isnt correct:
"
function cust_open_balFormula return Number is
open_bal_INV number;
open_bal_payment number;
open_bal_adj number;
net_bal number;
total_refund_bf number;
begin
select nvl(sum(rcpt.functional_amount),0)
into open_bal_payment
from
apps.ar_cash_receipts_v rcpt
where
rcpt.customer_number = :cust_num AND
rcpt.gl_date < nvl(:P_TRX_FROM_DATE,to_date('01-JAN-2006','DD-MON-YYYY')) AND
rcpt.gl_date > '31-DEC-05' AND