496: IS
497:
498: CURSOR c_WIN_LOSS_INDICATOR(c_STATUS_CODE VARCHAR2) IS
499: select WIN_LOSS_INDICATOR
500: from as_statuses_b
501: where status_code = c_STATUS_CODE;
502:
503: l_indicator varchar2(1);
504:
1448:
1449: cursor comp_required ( p_status_profile VARCHAR2, p_lead_id NUMBER) IS
1450: select 'Y'
1451: from as_leads_all ld,
1452: as_statuses_b st
1453: where ld.status = st.status_code
1454: and ld.lead_id = p_lead_id
1455: and (( p_status_profile = 'BOTH' and
1456: ( st.OPP_OPEN_STATUS_FLAG <> 'Y' or st.FORECAST_ROLLUP_FLAG = 'Y')) OR
1514: l_opp_worst_forecast_amount NUMBER;
1515: l_opp_forecast_amount NUMBER;
1516: l_opp_best_forecast_amount NUMBER;
1517: l_win_probability NUMBER;
1518: l_win_loss_indicator as_statuses_b.win_loss_indicator%Type;
1519: l_forecast_rollup_flag as_statuses_b.forecast_rollup_flag%Type;
1520: l_old_win_probability NUMBER;
1521: l_old_win_loss_indicator as_statuses_b.win_loss_indicator%Type;
1522: l_old_forecast_rollup_flag as_statuses_b.forecast_rollup_flag%Type;
1515: l_opp_forecast_amount NUMBER;
1516: l_opp_best_forecast_amount NUMBER;
1517: l_win_probability NUMBER;
1518: l_win_loss_indicator as_statuses_b.win_loss_indicator%Type;
1519: l_forecast_rollup_flag as_statuses_b.forecast_rollup_flag%Type;
1520: l_old_win_probability NUMBER;
1521: l_old_win_loss_indicator as_statuses_b.win_loss_indicator%Type;
1522: l_old_forecast_rollup_flag as_statuses_b.forecast_rollup_flag%Type;
1523: l_old_tot_rev_opp_forecast_amt NUMBER; -- Added for ASNB
1517: l_win_probability NUMBER;
1518: l_win_loss_indicator as_statuses_b.win_loss_indicator%Type;
1519: l_forecast_rollup_flag as_statuses_b.forecast_rollup_flag%Type;
1520: l_old_win_probability NUMBER;
1521: l_old_win_loss_indicator as_statuses_b.win_loss_indicator%Type;
1522: l_old_forecast_rollup_flag as_statuses_b.forecast_rollup_flag%Type;
1523: l_old_tot_rev_opp_forecast_amt NUMBER; -- Added for ASNB
1524: l_tot_rev_opp_forecast_amt NUMBER; -- Added for R12
1525: l_update_count NUMBER;
1518: l_win_loss_indicator as_statuses_b.win_loss_indicator%Type;
1519: l_forecast_rollup_flag as_statuses_b.forecast_rollup_flag%Type;
1520: l_old_win_probability NUMBER;
1521: l_old_win_loss_indicator as_statuses_b.win_loss_indicator%Type;
1522: l_old_forecast_rollup_flag as_statuses_b.forecast_rollup_flag%Type;
1523: l_old_tot_rev_opp_forecast_amt NUMBER; -- Added for ASNB
1524: l_tot_rev_opp_forecast_amt NUMBER; -- Added for R12
1525: l_update_count NUMBER;
1526: l_count NUMBER;
3108: )
3109: IS
3110: CURSOR C_STATUS_Exists (c_status CHAR) IS
3111: SELECT 'X'
3112: FROM as_statuses_b
3113: WHERE status_code = c_status
3114: and enabled_flag = 'Y'
3115: and opp_flag = 'Y';
3116:
3156: p_msg_name => 'API_MISSING_STATUS');
3157:
3158: x_return_status := FND_API.G_RET_STS_ERROR;
3159:
3160: -- STATUS should exist in as_statuses_b
3161: ELSIF(p_STATUS <> FND_API.G_MISS_CHAR)
3162: THEN
3163: OPEN C_STATUS_Exists (p_STATUS);
3164: FETCH C_STATUS_Exists into l_val;
5679: )
5680: IS
5681: CURSOR C_Get_OppOpenStatusFlag (c_STATUS_CODE VARCHAR2) IS
5682: SELECT opp_open_status_flag
5683: FROM as_statuses_b
5684: WHERE STATUS_CODE = c_STATUS_CODE
5685: and opp_flag = 'Y'
5686: and ENABLED_FLAG = 'Y';
5687: l_val VARCHAR2(1);