34: mo_global.set_policy_context('S',p_org_id);
35:
36: GET_COMMON(p_org_id);
37:
38: iex_debug_pub.logmessage (' IEX_COLL_IND_PUB.get_true_dso - g_base_currency_code = ' ||g_base_currency_code);
39: iex_debug_pub.logmessage (' IEX_COLL_IND_PUB.get_true_dso - g_base_precision = ' ||g_base_precision);
40: iex_debug_pub.logmessage (' IEX_COLL_IND_PUB.get_true_dso - g_base_min_acc_unit = ' ||g_base_min_acc_unit);
41: iex_debug_pub.logmessage (' IEX_COLL_IND_PUB.get_true_dso - p_org_id = ' ||p_org_id);
42:
35:
36: GET_COMMON(p_org_id);
37:
38: iex_debug_pub.logmessage (' IEX_COLL_IND_PUB.get_true_dso - g_base_currency_code = ' ||g_base_currency_code);
39: iex_debug_pub.logmessage (' IEX_COLL_IND_PUB.get_true_dso - g_base_precision = ' ||g_base_precision);
40: iex_debug_pub.logmessage (' IEX_COLL_IND_PUB.get_true_dso - g_base_min_acc_unit = ' ||g_base_min_acc_unit);
41: iex_debug_pub.logmessage (' IEX_COLL_IND_PUB.get_true_dso - p_org_id = ' ||p_org_id);
42:
43: IF p_party_id IS NOT NULL THEN
36: GET_COMMON(p_org_id);
37:
38: iex_debug_pub.logmessage (' IEX_COLL_IND_PUB.get_true_dso - g_base_currency_code = ' ||g_base_currency_code);
39: iex_debug_pub.logmessage (' IEX_COLL_IND_PUB.get_true_dso - g_base_precision = ' ||g_base_precision);
40: iex_debug_pub.logmessage (' IEX_COLL_IND_PUB.get_true_dso - g_base_min_acc_unit = ' ||g_base_min_acc_unit);
41: iex_debug_pub.logmessage (' IEX_COLL_IND_PUB.get_true_dso - p_org_id = ' ||p_org_id);
42:
43: IF p_party_id IS NOT NULL THEN
44: SELECT SUM(DECODE(prof_amt.overall_credit_limit, NULL, NULL,
37:
38: iex_debug_pub.logmessage (' IEX_COLL_IND_PUB.get_true_dso - g_base_currency_code = ' ||g_base_currency_code);
39: iex_debug_pub.logmessage (' IEX_COLL_IND_PUB.get_true_dso - g_base_precision = ' ||g_base_precision);
40: iex_debug_pub.logmessage (' IEX_COLL_IND_PUB.get_true_dso - g_base_min_acc_unit = ' ||g_base_min_acc_unit);
41: iex_debug_pub.logmessage (' IEX_COLL_IND_PUB.get_true_dso - p_org_id = ' ||p_org_id);
42:
43: IF p_party_id IS NOT NULL THEN
44: SELECT SUM(DECODE(prof_amt.overall_credit_limit, NULL, NULL,
45: gl_currency_api.convert_amount_sql(prof_amt.currency_code,g_base_currency_code,
86: RETURN l_char_val;
87:
88: EXCEPTION
89: when others then
90: iex_debug_pub.logmessage (' IEX_COLL_IND_PUB.get_credit_limit - Exception = ' ||SQLERRM);
91: RETURN(0);
92:
93: END GET_CREDIT_LIMIT;
94:
183: RETURN l_char_val;
184:
185: EXCEPTION
186: when others then
187: iex_debug_pub.logmessage (' IEX_COLL_IND_PUB.get_wtd_days_terms - Exception = ' ||SQLERRM);
188: RETURN(TO_CHAR(0));
189: END GET_WTD_DAYS_TERMS;
190:
191: FUNCTION GET_WTD_DAYS_LATE(p_party_id IN NUMBER,
280: RETURN l_char_val;
281:
282: EXCEPTION
283: when others then
284: iex_debug_pub.logmessage (' IEX_COLL_IND_PUB.get_wtd_days_late - Exception = ' ||SQLERRM);
285: RETURN(TO_CHAR(0));
286: END GET_WTD_DAYS_LATE;
287:
288: FUNCTION GET_TRUE_DSO(p_party_id IN NUMBER,
312:
313: where tot outs rec = sum of all receivables less all receipts (use COMP_REM_REC)
314: avg sales per day = sum of all receivables (use COMP_TOT_REC) / days in period
315: -----------------------------------------------------------------------*/
316: iex_debug_pub.logmessage (' IEX_COLL_DSO_PUB.get_true_dso - g_base_currency_code = ' ||g_base_currency_code);
317: iex_debug_pub.logmessage (' IEX_COLL_DSO_PUB.get_true_dso - g_base_precision = ' ||g_base_precision);
318: iex_debug_pub.logmessage (' IEX_COLL_DSO_PUB.get_true_dso - g_base_min_acc_unit = ' ||g_base_min_acc_unit);
319:
320: l_sales := COMP_TOT_REC(TRUNC(add_months(sysdate, -12)), TRUNC(sysdate),
313: where tot outs rec = sum of all receivables less all receipts (use COMP_REM_REC)
314: avg sales per day = sum of all receivables (use COMP_TOT_REC) / days in period
315: -----------------------------------------------------------------------*/
316: iex_debug_pub.logmessage (' IEX_COLL_DSO_PUB.get_true_dso - g_base_currency_code = ' ||g_base_currency_code);
317: iex_debug_pub.logmessage (' IEX_COLL_DSO_PUB.get_true_dso - g_base_precision = ' ||g_base_precision);
318: iex_debug_pub.logmessage (' IEX_COLL_DSO_PUB.get_true_dso - g_base_min_acc_unit = ' ||g_base_min_acc_unit);
319:
320: l_sales := COMP_TOT_REC(TRUNC(add_months(sysdate, -12)), TRUNC(sysdate),
321: p_party_id, p_cust_account_id, p_customer_site_use_id);
314: avg sales per day = sum of all receivables (use COMP_TOT_REC) / days in period
315: -----------------------------------------------------------------------*/
316: iex_debug_pub.logmessage (' IEX_COLL_DSO_PUB.get_true_dso - g_base_currency_code = ' ||g_base_currency_code);
317: iex_debug_pub.logmessage (' IEX_COLL_DSO_PUB.get_true_dso - g_base_precision = ' ||g_base_precision);
318: iex_debug_pub.logmessage (' IEX_COLL_DSO_PUB.get_true_dso - g_base_min_acc_unit = ' ||g_base_min_acc_unit);
319:
320: l_sales := COMP_TOT_REC(TRUNC(add_months(sysdate, -12)), TRUNC(sysdate),
321: p_party_id, p_cust_account_id, p_customer_site_use_id);
322:
325:
326: l_end_ar := IEX_COLL_IND.COMP_REM_REC(to_date('01/01/1952','MM/DD/YYYY'), TRUNC(sysdate),
327: p_party_id, p_cust_account_id, p_customer_site_use_id);
328:
329: iex_debug_pub.logmessage (' IEX_COLL_DSO_PUB.get_true_dso - l_sales = ' ||l_sales);
330: iex_debug_pub.logmessage (' IEX_COLL_DSO_PUB.get_true_dso - l_beg_ar = ' ||l_beg_ar);
331: iex_debug_pub.logmessage (' IEX_COLL_DSO_PUB.get_true_dso - l_end_ar = ' ||l_end_ar);
332:
333:
326: l_end_ar := IEX_COLL_IND.COMP_REM_REC(to_date('01/01/1952','MM/DD/YYYY'), TRUNC(sysdate),
327: p_party_id, p_cust_account_id, p_customer_site_use_id);
328:
329: iex_debug_pub.logmessage (' IEX_COLL_DSO_PUB.get_true_dso - l_sales = ' ||l_sales);
330: iex_debug_pub.logmessage (' IEX_COLL_DSO_PUB.get_true_dso - l_beg_ar = ' ||l_beg_ar);
331: iex_debug_pub.logmessage (' IEX_COLL_DSO_PUB.get_true_dso - l_end_ar = ' ||l_end_ar);
332:
333:
334: if ( nvl(l_sales,0) = 0 ) then
327: p_party_id, p_cust_account_id, p_customer_site_use_id);
328:
329: iex_debug_pub.logmessage (' IEX_COLL_DSO_PUB.get_true_dso - l_sales = ' ||l_sales);
330: iex_debug_pub.logmessage (' IEX_COLL_DSO_PUB.get_true_dso - l_beg_ar = ' ||l_beg_ar);
331: iex_debug_pub.logmessage (' IEX_COLL_DSO_PUB.get_true_dso - l_end_ar = ' ||l_end_ar);
332:
333:
334: if ( nvl(l_sales,0) = 0 ) then
335: l_dso := 0;
343: RETURN l_char_val;
344:
345: exception
346: When others then
347: iex_debug_pub.logmessage (' IEX_COLL_DSO_PUB.get_true_dso - Exception = ' ||SQLERRM);
348: return null;
349:
350: END GET_TRUE_DSO;
351:
418: RETURN l_num_val;
419:
420: exception
421: When others then
422: iex_debug_pub.logmessage (' IEX_COLL_DSO_PUB.comp_tot_rec - Exception = ' ||SQLERRM);
423: return(0);
424: END COMP_TOT_REC;
425:
426:
436: where
437: gll.ledger_id = sp.set_of_books_id
438: and gll.currency_code = c.currency_code;
439:
440: iex_debug_pub.logmessage (' IEX_COLL_IND_PUB.get_common - g_base_currency_code = ' ||g_base_currency_code);
441: iex_debug_pub.logmessage (' IEX_COLL_IND_PUB.get_common - g_base_precision = ' ||g_base_precision);
442: iex_debug_pub.logmessage (' IEX_COLL_IND_PUB.get_common - g_base_min_acc_unit = ' ||g_base_min_acc_unit);
443:
444:
437: gll.ledger_id = sp.set_of_books_id
438: and gll.currency_code = c.currency_code;
439:
440: iex_debug_pub.logmessage (' IEX_COLL_IND_PUB.get_common - g_base_currency_code = ' ||g_base_currency_code);
441: iex_debug_pub.logmessage (' IEX_COLL_IND_PUB.get_common - g_base_precision = ' ||g_base_precision);
442: iex_debug_pub.logmessage (' IEX_COLL_IND_PUB.get_common - g_base_min_acc_unit = ' ||g_base_min_acc_unit);
443:
444:
445: exception
438: and gll.currency_code = c.currency_code;
439:
440: iex_debug_pub.logmessage (' IEX_COLL_IND_PUB.get_common - g_base_currency_code = ' ||g_base_currency_code);
441: iex_debug_pub.logmessage (' IEX_COLL_IND_PUB.get_common - g_base_precision = ' ||g_base_precision);
442: iex_debug_pub.logmessage (' IEX_COLL_IND_PUB.get_common - g_base_min_acc_unit = ' ||g_base_min_acc_unit);
443:
444:
445: exception
446: when others then
443:
444:
445: exception
446: when others then
447: iex_debug_pub.logmessage (' IEX_COLL_IND_PUB.main selection - Exception = ' ||SQLERRM);
448: null;
449:
450: end GET_COMMON;
451:
459: l_char_val VARCHAR2(1000);
460:
461: BEGIN
462:
463: iex_debug_pub.logmessage ('IEX_COLL_IND_PUB.GET_SALES Start ');
464: mo_global.set_policy_context('S',p_org_id);
465:
466: iex_debug_pub.logmessage ('IEX_COLL_IND_PUB.GET_SALES: Calling GET_COMMON with org_id: ' || p_org_id);
467: GET_COMMON(p_org_id);
462:
463: iex_debug_pub.logmessage ('IEX_COLL_IND_PUB.GET_SALES Start ');
464: mo_global.set_policy_context('S',p_org_id);
465:
466: iex_debug_pub.logmessage ('IEX_COLL_IND_PUB.GET_SALES: Calling GET_COMMON with org_id: ' || p_org_id);
467: GET_COMMON(p_org_id);
468: iex_debug_pub.logmessage ('IEX_COLL_IND_PUB.GET_SALES: After Calling GET_COMMON');
469:
470: l_sales := COMP_TOT_REC(TRUNC(add_months(sysdate, -12)), TRUNC(sysdate),
464: mo_global.set_policy_context('S',p_org_id);
465:
466: iex_debug_pub.logmessage ('IEX_COLL_IND_PUB.GET_SALES: Calling GET_COMMON with org_id: ' || p_org_id);
467: GET_COMMON(p_org_id);
468: iex_debug_pub.logmessage ('IEX_COLL_IND_PUB.GET_SALES: After Calling GET_COMMON');
469:
470: l_sales := COMP_TOT_REC(TRUNC(add_months(sysdate, -12)), TRUNC(sysdate),
471: p_party_id, p_cust_account_id, p_customer_site_use_id);
472:
469:
470: l_sales := COMP_TOT_REC(TRUNC(add_months(sysdate, -12)), TRUNC(sysdate),
471: p_party_id, p_cust_account_id, p_customer_site_use_id);
472:
473: iex_debug_pub.logmessage ('IEX_COLL_IND_PUB.GET_SALES: l_sales: ' || l_sales);
474: l_num_val := NVL(l_sales, 0);
475: l_char_val := RTRIM(TO_CHAR(l_num_val, fnd_currency.get_format_mask(g_base_currency_code, 50)));
476: iex_debug_pub.logmessage ('IEX_COLL_IND_PUB.GET_SALES: l_char_val: ' || l_char_val);
477: RETURN l_char_val;
472:
473: iex_debug_pub.logmessage ('IEX_COLL_IND_PUB.GET_SALES: l_sales: ' || l_sales);
474: l_num_val := NVL(l_sales, 0);
475: l_char_val := RTRIM(TO_CHAR(l_num_val, fnd_currency.get_format_mask(g_base_currency_code, 50)));
476: iex_debug_pub.logmessage ('IEX_COLL_IND_PUB.GET_SALES: l_char_val: ' || l_char_val);
477: RETURN l_char_val;
478: exception
479: when others then
480: iex_debug_pub.logmessage ('IEX_COLL_IND_PUB.GET_SALES - Exception = ' ||SQLERRM);
476: iex_debug_pub.logmessage ('IEX_COLL_IND_PUB.GET_SALES: l_char_val: ' || l_char_val);
477: RETURN l_char_val;
478: exception
479: when others then
480: iex_debug_pub.logmessage ('IEX_COLL_IND_PUB.GET_SALES - Exception = ' ||SQLERRM);
481: null;
482: END GET_SALES;
483: --End for bug 10091833 gnramasa 22nd Sep 10
484: