2218:
2219: BEGIN
2220:
2221: IF PG_DEBUG in ('Y', 'C') THEN
2222: arp_util.debug('fetch_assignments()+');
2223: arp_util.debug( 'Dump out NOCOPY the parameters :');
2224: arp_util.debug( 'Customer_trx_id :'||Customer_trx_id);
2225: arp_util.debug( 'Drawee_id :'||Drawee_id);
2226: arp_util.debug( 'Pay_unrelated_invoices :'||Pay_unrelated_invoices);
2219: BEGIN
2220:
2221: IF PG_DEBUG in ('Y', 'C') THEN
2222: arp_util.debug('fetch_assignments()+');
2223: arp_util.debug( 'Dump out NOCOPY the parameters :');
2224: arp_util.debug( 'Customer_trx_id :'||Customer_trx_id);
2225: arp_util.debug( 'Drawee_id :'||Drawee_id);
2226: arp_util.debug( 'Pay_unrelated_invoices :'||Pay_unrelated_invoices);
2227: arp_util.debug( 'pg_where_clause :'|| pg_where_clause );
2220:
2221: IF PG_DEBUG in ('Y', 'C') THEN
2222: arp_util.debug('fetch_assignments()+');
2223: arp_util.debug( 'Dump out NOCOPY the parameters :');
2224: arp_util.debug( 'Customer_trx_id :'||Customer_trx_id);
2225: arp_util.debug( 'Drawee_id :'||Drawee_id);
2226: arp_util.debug( 'Pay_unrelated_invoices :'||Pay_unrelated_invoices);
2227: arp_util.debug( 'pg_where_clause :'|| pg_where_clause );
2228: arp_util.debug( 'p_le_id:'|| p_le_id);
2221: IF PG_DEBUG in ('Y', 'C') THEN
2222: arp_util.debug('fetch_assignments()+');
2223: arp_util.debug( 'Dump out NOCOPY the parameters :');
2224: arp_util.debug( 'Customer_trx_id :'||Customer_trx_id);
2225: arp_util.debug( 'Drawee_id :'||Drawee_id);
2226: arp_util.debug( 'Pay_unrelated_invoices :'||Pay_unrelated_invoices);
2227: arp_util.debug( 'pg_where_clause :'|| pg_where_clause );
2228: arp_util.debug( 'p_le_id:'|| p_le_id);
2229: arp_util.debug( 'pg_order_clause :' || pg_order_clause );
2222: arp_util.debug('fetch_assignments()+');
2223: arp_util.debug( 'Dump out NOCOPY the parameters :');
2224: arp_util.debug( 'Customer_trx_id :'||Customer_trx_id);
2225: arp_util.debug( 'Drawee_id :'||Drawee_id);
2226: arp_util.debug( 'Pay_unrelated_invoices :'||Pay_unrelated_invoices);
2227: arp_util.debug( 'pg_where_clause :'|| pg_where_clause );
2228: arp_util.debug( 'p_le_id:'|| p_le_id);
2229: arp_util.debug( 'pg_order_clause :' || pg_order_clause );
2230: arp_util.debug( 'AssignmentAmount :'|| AssignMentAmount );
2223: arp_util.debug( 'Dump out NOCOPY the parameters :');
2224: arp_util.debug( 'Customer_trx_id :'||Customer_trx_id);
2225: arp_util.debug( 'Drawee_id :'||Drawee_id);
2226: arp_util.debug( 'Pay_unrelated_invoices :'||Pay_unrelated_invoices);
2227: arp_util.debug( 'pg_where_clause :'|| pg_where_clause );
2228: arp_util.debug( 'p_le_id:'|| p_le_id);
2229: arp_util.debug( 'pg_order_clause :' || pg_order_clause );
2230: arp_util.debug( 'AssignmentAmount :'|| AssignMentAmount );
2231: END IF;
2224: arp_util.debug( 'Customer_trx_id :'||Customer_trx_id);
2225: arp_util.debug( 'Drawee_id :'||Drawee_id);
2226: arp_util.debug( 'Pay_unrelated_invoices :'||Pay_unrelated_invoices);
2227: arp_util.debug( 'pg_where_clause :'|| pg_where_clause );
2228: arp_util.debug( 'p_le_id:'|| p_le_id);
2229: arp_util.debug( 'pg_order_clause :' || pg_order_clause );
2230: arp_util.debug( 'AssignmentAmount :'|| AssignMentAmount );
2231: END IF;
2232:
2225: arp_util.debug( 'Drawee_id :'||Drawee_id);
2226: arp_util.debug( 'Pay_unrelated_invoices :'||Pay_unrelated_invoices);
2227: arp_util.debug( 'pg_where_clause :'|| pg_where_clause );
2228: arp_util.debug( 'p_le_id:'|| p_le_id);
2229: arp_util.debug( 'pg_order_clause :' || pg_order_clause );
2230: arp_util.debug( 'AssignmentAmount :'|| AssignMentAmount );
2231: END IF;
2232:
2233: /* LE - R12 : add trx.legal_entity_id as a condition */
2226: arp_util.debug( 'Pay_unrelated_invoices :'||Pay_unrelated_invoices);
2227: arp_util.debug( 'pg_where_clause :'|| pg_where_clause );
2228: arp_util.debug( 'p_le_id:'|| p_le_id);
2229: arp_util.debug( 'pg_order_clause :' || pg_order_clause );
2230: arp_util.debug( 'AssignmentAmount :'|| AssignMentAmount );
2231: END IF;
2232:
2233: /* LE - R12 : add trx.legal_entity_id as a condition */
2234: /* modified for tca update */
2301:
2302: TotalSoFar := 0;
2303:
2304: IF PG_DEBUG in ('Y', 'C') THEN
2305: arp_util.debug( 'Inserting the existing assignments into the table ');
2306: END IF;
2307:
2308: OPEN AssignCur FOR AssignCurStr;
2309: LOOP
2348:
2349: /* get all non-BR transactions that can be assigned to this BR */
2350:
2351: IF PG_DEBUG in ('Y', 'C') THEN
2352: arp_util.debug( 'Inserting the new assignments ');
2353: END IF;
2354:
2355: /* bug 2473700 : for quick assign, show current balance due for invoices */
2356: /* modified for tca update */
2560:
2561: AssignCurStr:=AssignCurStr||pg_where_clause||' '||pg_order_clause;
2562:
2563: IF PG_DEBUG in ('Y', 'C') THEN
2564: arp_util.debug( 'AssignCurStr : ' || AssignCurStr);
2565: END IF;
2566: /* Now we retrieve all transactions that can be assigned to this BR */
2567:
2568: OPEN AssignCur FOR AssignCurStr;