[Home] [Help]
29: into l_dummy
30: from sys.dual
31: where not exists
32: (select null
33: from pay_pss_transaction_steps pts,
34: pay_org_payment_methods_f opm,
35: pay_payment_types ppt
36: where pts.transaction_step_id = p_transaction_step_id
37: and opm.org_payment_method_id = pts.org_payment_method_id
70: ) is
71: cursor csr_ppm_info(p_transaction_id in number) is
72: select ppts.transaction_step_id
73: , ppts.state
74: from pay_pss_transaction_steps ppts
75: where ppts.transaction_id = p_transaction_id
76: and ppts.state <> C_STATE_FREED
77: ;
78: --
253: select p.state
254: , p.amount_type
255: into l_state
256: , l_amount_type
257: from pay_pss_transaction_steps p
258: where p.transaction_step_id = l_txstepid;
259: if l_state = C_STATE_EXISTING and
260: l_amount_type <> C_REMAINING_PAY then
261: l_state := C_STATE_UPDATED;
280: end if;
281: --
282: -- Update the lowest priority PPM.
283: --
284: update pay_pss_transaction_steps p
285: set p.amount_type = C_REMAINING_PAY
286: , p.amount = 100
287: , p.state = l_state
288: where transaction_step_id = l_txstepid
2125: ) is
2126: select transaction_step_id
2127: , state
2128: , logical_priority
2129: from pay_pss_transaction_steps
2130: where transaction_id = p_transaction_id;
2131: --
2132: l_state varchar2(2000);
2133: l_priority number;
2223: l_priorities pay_ppmv4_utils_ss.t_boolean_tbl;
2224: i number;
2225: l_proc varchar2(2000) := g_package||'alloc_real_priorities';
2226:
2227: l_run_type_id pay_pss_transaction_steps.run_type_id%type;
2228:
2229: --
2230: -- cursor to fetch the run_type_id
2231: --
2231: --
2232:
2233: cursor csr_run_type_id(p_transaction_id in number) is
2234: select distinct ppts.run_type_id
2235: from pay_pss_transaction_steps ppts
2236: where ppts.transaction_id = p_transaction_id;
2237:
2238: begin
2239: pay_ppmv4_utils_ss.seterrorstage(l_proc, 'ENTER', 0);
2293: --
2294: pay_ppmv4_utils_ss.seterrorstage(l_proc, 'O_REAL_PRIORITY', 20);
2295: select p.o_real_priority
2296: into l_o_priority
2297: from pay_pss_transaction_steps p
2298: where p.transaction_step_id = l_txstepid
2299: ;
2300:
2301: --
2333: --
2334: -- Write back the real priority value.
2335: --
2336: pay_ppmv4_utils_ss.seterrorstage(l_proc, 'WRITE_PRIORITY', 40);
2337: update pay_pss_transaction_steps p
2338: set p.real_priority = l_priority
2339: where p.transaction_step_id = l_txstepid;
2340: --
2341:
2369: -- Curosor to get the actual percentage/amount of the ppm.
2370: cursor fetch_org_values is
2371: select ppm.AMOUNT, ppm.PERCENTAGE
2372: from pay_personal_payment_methods_f ppm,
2373: pay_pss_transaction_steps pps
2374: where pps.transaction_step_id = p_transaction_step_id
2375: and pps.PERSONAL_PAYMENT_METHOD_ID = ppm.PERSONAL_PAYMENT_METHOD_ID
2376: and pps.ASSIGNMENT_ID= ppm.ASSIGNMENT_ID
2377: and pps.ORG_PAYMENT_METHOD_ID = ppm.ORG_PAYMENT_METHOD_ID
2391: , l_o_logical_priority
2392: , l_state
2393: , l_amount_type
2394: , l_amount
2395: from pay_pss_transaction_steps p
2396: where p.transaction_step_id = p_transaction_step_id;
2397: --
2398: -- Only need to do something if the new logical priority differs
2399: -- from the current logical priority.
2482: end if;
2483: --
2484: -- Make and Commit the changes.
2485: --
2486: update pay_pss_transaction_steps p
2487: set p.amount = l_amount
2488: , p.amount_type = l_amount_type
2489: , p.logical_priority = p_logical_priority
2490: , p.state = l_state
2524: cursor csr_ppms(p_transaction_id in number) is
2525: select ppts.transaction_step_id
2526: , ppts.logical_priority
2527: , ppts.amount_type
2528: from pay_pss_transaction_steps ppts
2529: where ppts.transaction_id = p_transaction_id
2530: and pay_ppmv4_ss.include_in_page(C_SUMMARY_PAGE, ppts.state) = 'Y';
2531:
2532: --
3008: , p.transaction_id
3009: into l_state
3010: , l_amount_type
3011: , l_transaction_id
3012: from pay_pss_transaction_steps p
3013: where p.transaction_step_id = p_transaction_step_id;
3014: --
3015: -- If this is a newly created PPM then it's only necessary to update
3016: -- the state.
3016: -- the state.
3017: --
3018: if l_state = C_STATE_NEW then
3019: pay_ppmv4_utils_ss.seterrorstage(l_proc, 'PPM_FREED', 10);
3020: update pay_pss_transaction_steps p
3021: set p.state = C_STATE_FREED
3022: where p.transaction_step_id = p_transaction_step_id;
3023: else
3024: pay_ppmv4_utils_ss.seterrorstage(l_proc, 'TT2PPM', 20);