InvoiceOpenToDate - error in parameter datatype
InvoicePaidToDate - error in for loop sql
This commit is contained in:
parent
21db3e1d31
commit
bf75c69f02
|
|
@ -37,7 +37,7 @@ CREATE OR REPLACE FUNCTION InvoiceopenToDate
|
||||||
(
|
(
|
||||||
p_C_Invoice_ID IN numeric,
|
p_C_Invoice_ID IN numeric,
|
||||||
p_C_InvoicePaySchedule_ID IN numeric,
|
p_C_InvoicePaySchedule_ID IN numeric,
|
||||||
p_DateAcct IN DATE
|
p_DateAcct IN timestamp with time zone
|
||||||
)
|
)
|
||||||
RETURNS numeric
|
RETURNS numeric
|
||||||
AS
|
AS
|
||||||
|
|
|
||||||
|
|
@ -55,9 +55,10 @@ BEGIN
|
||||||
END IF;
|
END IF;
|
||||||
-- Calculate Allocated Amount
|
-- Calculate Allocated Amount
|
||||||
FOR allocation IN
|
FOR allocation IN
|
||||||
SELECT allocation.AD_Client_ID, allocation.AD_Org_ID,al.Amount, al.DiscountAmt, al.WriteOffAmt,allocation.C_Currency_ID, allocation.DateTrx
|
SELECT al.AD_Client_ID, al.AD_Org_ID,al.Amount, al.DiscountAmt, al.WriteOffAmt,a.C_Currency_ID, a.DateTrx
|
||||||
FROM C_ALLOCATIONLINE al
|
FROM C_ALLOCATIONLINE al
|
||||||
WHERE al.C_Invoice_ID = p_C_Invoice_ID AND allocation.IsActive='Y' AND allocation.DateAcct <= p_DateAcct
|
INNER JOIN C_ALLOCATIONHDR a ON (al.C_AllocationHdr_ID=a.C_AllocationHdr_ID)
|
||||||
|
WHERE al.C_Invoice_ID = p_C_Invoice_ID AND a.IsActive='Y' AND a.DateAcct <= p_DateAcct
|
||||||
LOOP
|
LOOP
|
||||||
v_PaymentAmt := v_PaymentAmt
|
v_PaymentAmt := v_PaymentAmt
|
||||||
+ Currencyconvert(allocation.Amount + allocation.DisCountAmt + allocation.WriteOffAmt,
|
+ Currencyconvert(allocation.Amount + allocation.DisCountAmt + allocation.WriteOffAmt,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue