balance forward of a supplier
Dear All,
is there any query to calculate the balance of the supplier from it's creation till sysdate other than the sum of the value of the below functions:
FUNCTION Pay_Function(frdate date,todate date) RETURN Number IS
TOT number :=0;
TOT_Pay_Rate number :=0;
seg3 character(50);
Ex_Rate_Inv number :=0;
Ex_Rate_Pay number :=0;
begin
for C in
(select invpay.invoice_id inv_id,pay.currency_code invcurr,nvl(sum(invpay.amount),0)Amount, inv.accts_pay_code_combination_id acc_pay_code, pay.Exchange_rate ER
from apps.ap_checks_v pay, apps.ap_invoice_payments invpay,apps.ap_invoices inv