77: t.category_instance_id,
78: t.sr_category_id,
79: t.budget_value,
80: t.budget_value * decode(t.currency_code,
81: fnd_profile.value('MSC_HUB_CUR_CODE_RPT'),
82: 1, nvl(mcc.conv_rate,0)) budget_value2,
83: fnd_global.user_id,
84: sysdate,
85: fnd_global.user_id,
97: decode(sign(b.sr_category_id), -1, 1, 3)) budget_level,
98: decode(b.sr_instance_id, -1, -23453, b.sr_instance_id) sr_instance_id,
99: decode(b.organization_id, -1, -23453, b.organization_id) organization_id,
100: nvl(mtp.currency_code, l_owning_currency_code) currency_code,
101: fnd_profile.value('MSR_BUDGET_CATEGORY_SET') category_set_id,
102: b.category_instance_id,
103: b.sr_category_id,
104: b.budget_value
105: from
112: ) t,
113: msc_currency_conv_mv mcc
114: where mcc.from_currency(+)=t.currency_code
115: and mcc.calendar_date(+)=l_plan_start_date
116: and mcc.to_currency(+)=fnd_profile.value('MSC_HUB_CUR_CODE_RPT');
117: else
118: insert into msc_budgets_f (
119: plan_id,
120: plan_run_id,
145: -1,
146: -1,
147: budget_value,
148: budget_value * decode(currency_code,
149: fnd_profile.value('MSC_HUB_CUR_CODE_RPT'),
150: 1, nvl(mcc.conv_rate,0)) budget_value2,
151: fnd_global.user_id,
152: sysdate,
153: fnd_global.user_id,
164: from dual), -- inline table for outer join
165: msc_currency_conv_mv mcc
166: where mcc.from_currency(+)=currency_code
167: and mcc.calendar_date(+)=l_plan_start_date
168: and mcc.to_currency(+)=fnd_profile.value('MSC_HUB_CUR_CODE_RPT');
169: end if;
170: msc_phub_util.log('msc_phub_budget_pkg.populate_details: msc_budgets_f, rowcount='||sql%rowcount);
171: commit;
172: