210:
211: BEGIN
212:
213: IF PG_DEBUG in ('Y', 'C') THEN
214: arp_standard.debug('ar_bfb_utils_pvt.get_bill_level(+)');
215: END IF;
216:
217: IF ( p_cust_account_id < -2147483647 or p_cust_account_id > 2147483647 ) then
218: arp_standard.debug('Customer Account Id is outside the sequence range.');
214: arp_standard.debug('ar_bfb_utils_pvt.get_bill_level(+)');
215: END IF;
216:
217: IF ( p_cust_account_id < -2147483647 or p_cust_account_id > 2147483647 ) then
218: arp_standard.debug('Customer Account Id is outside the sequence range.');
219:
220: begin
221: select decode(cp.cons_bill_level,'ACCOUNT','A','SITE','S','N')
222: into bfb_level
241:
242: temp_bill_level_table(p_cust_account_id) := bfb_level;
243: END IF;
244: IF PG_DEBUG in ('Y', 'C') THEN
245: arp_standard.debug('ar_bfb_utils_pvt.get_bill_level(-)');
246: END IF;
247: return temp_bill_level_table(p_cust_account_id);
248:
249: EXCEPTION
255: ELSE
256: return 'N';
257: END IF;
258: WHEN OTHERS THEN
259: arp_standard.debug('EXCEPTION OTHERS in ar_bfb_utils_pvt.get_bill_level :'||SQLERRM);
260: RAISE;
261: END get_bill_level;
262:
263: function get_billing_cycle (p_payment_term_id in NUMBER) RETURN NUMBER IS
264:
265: bill_cycle_id NUMBER;
266: BEGIN
267: IF PG_DEBUG in ('Y', 'C') THEN
268: arp_standard.debug('get_billing_cycle(+)');
269: END IF;
270: IF (temp_billing_cycle_id_tab.EXISTS(p_payment_term_id) = FALSE) THEN
271: select billing_cycle_id
272: into bill_cycle_id
276: temp_billing_cycle_id_tab(p_payment_term_id) := bill_cycle_id;
277: END IF;
278:
279: IF PG_DEBUG in ('Y', 'C') THEN
280: arp_standard.debug('get_billing_cycle(-)');
281: END IF;
282: return temp_billing_cycle_id_tab(p_payment_term_id);
283: EXCEPTION
284: WHEN NO_DATA_FOUND THEN
281: END IF;
282: return temp_billing_cycle_id_tab(p_payment_term_id);
283: EXCEPTION
284: WHEN NO_DATA_FOUND THEN
285: arp_standard.debug('NO_DATA_FOUND EXCEPTION in get_billing_cycle');
286: return 0;
287: WHEN OTHERS THEN
288: arp_standard.debug('EXCEPTION OTHERS in get_billing_cycle');
289: return 0;
284: WHEN NO_DATA_FOUND THEN
285: arp_standard.debug('NO_DATA_FOUND EXCEPTION in get_billing_cycle');
286: return 0;
287: WHEN OTHERS THEN
288: arp_standard.debug('EXCEPTION OTHERS in get_billing_cycle');
289: return 0;
290: END get_billing_cycle;
291:
292: function get_cycle_type (p_bill_cycle_id IN NUMBER) RETURN VARCHAR2 IS
481: l_msg_95 fnd_new_messages.message_text%type;
482: l_msg_96 fnd_new_messages.message_text%type;
483: BEGIN
484: IF PG_DEBUG in ('Y', 'C') THEN
485: arp_standard.debug('ar_bfb_utils_pvt.validate_and_default_term()+');
486: arp_standard.debug(' request_id = ' || p_request_id);
487: END IF;
488:
489: /* Fetch rows (transactions) for processing */
482: l_msg_96 fnd_new_messages.message_text%type;
483: BEGIN
484: IF PG_DEBUG in ('Y', 'C') THEN
485: arp_standard.debug('ar_bfb_utils_pvt.validate_and_default_term()+');
486: arp_standard.debug(' request_id = ' || p_request_id);
487: END IF;
488:
489: /* Fetch rows (transactions) for processing */
490: /* 7575555 - we now only fetch records where the account-level cons_inv_flag = Y.
502: IF l_rows_selected > 0
503: THEN
504: /* Process what we've got */
505: IF PG_DEBUG in ('Y', 'C') THEN
506: arp_standard.debug(' rows selected = ' || l_rows_selected);
507: END IF;
508:
509: /* Bulk update of transaction terms
510: NOTE: This excludes those in error or null */
555: END IF;
556: ELSE
557: /* Nothing to process */
558: IF PG_DEBUG in ('Y', 'C') THEN
559: arp_standard.debug(' NO ROWS TO PROCESS');
560: END IF;
561: END IF;
562:
563: p_error_count := l_rows_rejected;
562:
563: p_error_count := l_rows_rejected;
564:
565: IF PG_DEBUG in ('Y', 'C') THEN
566: arp_standard.debug(' rows processed = ' || l_rows_updated);
567: arp_standard.debug(' rows rejected = ' || p_error_count);
568: arp_standard.debug('ar_bfb_utils_pvt.validate_and_default_term()-');
569: END IF;
570:
563: p_error_count := l_rows_rejected;
564:
565: IF PG_DEBUG in ('Y', 'C') THEN
566: arp_standard.debug(' rows processed = ' || l_rows_updated);
567: arp_standard.debug(' rows rejected = ' || p_error_count);
568: arp_standard.debug('ar_bfb_utils_pvt.validate_and_default_term()-');
569: END IF;
570:
571:
564:
565: IF PG_DEBUG in ('Y', 'C') THEN
566: arp_standard.debug(' rows processed = ' || l_rows_updated);
567: arp_standard.debug(' rows rejected = ' || p_error_count);
568: arp_standard.debug('ar_bfb_utils_pvt.validate_and_default_term()-');
569: END IF;
570:
571:
572: END validate_and_default_term;