106: ELSE
107:
108: SELECT SUM( NVL( ps.AMOUNT_IN_DISPUTE, 0) )
109: INTO l_amount_in_dispute
110: FROM ar_payment_schedules ps
111: WHERE ps.customer_trx_id = p_customer_trx_id;
112:
113: RETURN(l_amount_in_dispute);
114:
152: p_class IN varchar2,
153: p_open_receivable_flag IN varchar2)
154: RETURN DATE IS
155:
156: l_dispute_date ar_payment_schedules.dispute_date%type;
157:
158: BEGIN
159:
160: /*------------------------------------------------------------+
167: ELSE
168:
169: SELECT MAX(ps.dispute_date )
170: INTO l_dispute_date
171: FROM ar_payment_schedules ps
172: WHERE ps.customer_trx_id = p_customer_trx_id
173: AND ps.dispute_date IS NOT NULL;
174:
175: RETURN(l_dispute_date);
214: p_class IN varchar2,
215: p_open_receivable_flag IN varchar2)
216: RETURN DATE IS
217:
218: l_dispute_date ar_payment_schedules.dispute_date%type;
219:
220: BEGIN
221:
222: /*------------------------------------------------------------+
230:
231: SELECT MAX(h.start_date)
232: INTO l_dispute_date
233: FROM ar_dispute_history h,
234: ar_payment_schedules ps
235: WHERE h.payment_schedule_id = ps.payment_schedule_id
236: AND ps.customer_trx_id = p_customer_trx_id
237: AND end_date IS NULL;
238:
594: +-------------------------------------------*/
595:
596: SELECT COUNT(*)
597: INTO l_auto_rec_count
598: FROM ar_payment_schedules
599: WHERE customer_trx_id = p_customer_trx_id
600: AND selected_for_receipt_batch_id IS NOT NULL;
601:
602: /*-----------------------------------------------+
614: +-------------------------------------------------------*/
615:
616: SELECT COUNT(DISTINCT ps.payment_schedule_id)
617: INTO l_auto_rec_approved_count
618: FROM ar_payment_schedules ps,
619: ar_receivable_applications ra,
620: ar_cash_receipt_history crh
621: WHERE ps.customer_trx_id = p_customer_trx_id
622: AND ra.applied_payment_schedule_id = ps.payment_schedule_id
811: SELECT DECODE( MAX(ps.payment_schedule_id),
812: NULL, 'N',
813: 'Y')
814: INTO l_activity_flag
815: FROM ar_payment_schedules ps
816: WHERE ps.customer_trx_id = p_customer_trx_id
817: AND (
818: ps.amount_due_original <> ps.amount_due_remaining
819: OR NVL(ps.amount_applied,0) <> 0
867: SELECT DECODE( MAX( payment_schedule_id ),
868: NULL, 'N',
869: 'Y' )
870: INTO l_activity_flag
871: FROM ar_payment_schedules ps
872: WHERE (
873: (
874: NVL(ps.amount_credited, 0) <> 0
875: OR NVL(ps.amount_adjusted, 0) <> 0
895: SELECT DECODE( MAX( other_ps.payment_schedule_id),
896: NULL, 'N',
897: 'Y')
898: INTO l_activity_flag
899: FROM ar_payment_schedules this_ps,
900: ar_payment_schedules other_ps,
901: ra_customer_trx other_ct
902: WHERE this_ps.customer_trx_id = p_customer_trx_id
903: AND other_ct.previous_customer_trx_id =
896: NULL, 'N',
897: 'Y')
898: INTO l_activity_flag
899: FROM ar_payment_schedules this_ps,
900: ar_payment_schedules other_ps,
901: ra_customer_trx other_ct
902: WHERE this_ps.customer_trx_id = p_customer_trx_id
903: AND other_ct.previous_customer_trx_id =
904: p_previous_customer_trx_id
965: SELECT DECODE( MAX( cons_inv_id ),
966: NULL, 'N',
967: 'Y')
968: INTO l_activity_flag
969: FROM ar_payment_schedules
970: WHERE customer_trx_id = p_customer_trx_id;
971:
972: IF (l_activity_flag = 'Y')
973: THEN RETURN('Y');
1382:
1383: SELECT NVL(MIN(ps.due_date),
1384: arpt_sql_func_util.get_first_due_date(p_term_id, nvl(ct.billing_date, p_trx_date)))
1385: INTO l_term_due_date
1386: FROM ar_payment_schedules ps,
1387: ra_customer_trx ct
1388: WHERE ct.customer_trx_id=ps.customer_trx_id(+)
1389: AND ct.customer_trx_id = p_customer_trx_id
1390: group by ct.billing_date;
1904: | |
1905: | RETURNS : Batch Source Name of the Invoice associated with the |
1906: | chargeback. |
1907: | |
1908: | NOTES : Currently being used by -> AR_PAYMENT_SCHEDULES_V |
1909: | |
1910: | |
1911: | MODIFICATION HISTORY |
1912: | |
1975: | |
1976: | RETURNS : the lastest dunning date |
1977: | |
1978: | |
1979: | NOTES : Currently being used by -> AR_PAYMENT_SCHEDULES_V |
1980: | |
1981: | |
1982: | MODIFICATION HISTORY |
1983: | |
2705: AND apply_date <= p_as_of_date;
2706:
2707: SELECT amount_due_original
2708: INTO p_amt_due_original
2709: FROM ar_payment_schedules
2710: WHERE payment_schedule_id = p_applied_payment_schedule_id;
2711:
2712: /*Bug 2453245 Added p_adj_amount_applied so that
2713: Adjustment amount is also taken into account while