264: , X_Ship_From_ID OUT NOCOPY NUMBER )IS
265:
266: cursor party_csr1(p_id Number,p_code varchar2) is
267: select object1_id1, object1_id2, jtot_object1_code
268: from okc_k_party_roles_b
269: where dnz_chr_id = p_header_id and cle_id = p_id
270: and rle_code = p_code;
271:
272: cursor party_csr2(p_id Number,p_code varchar2) is
270: and rle_code = p_code;
271:
272: cursor party_csr2(p_id Number,p_code varchar2) is
273: select object1_id1, object1_id2, jtot_object1_code
274: from okc_k_party_roles_b
275: where dnz_chr_id = p_header_id and chr_id = p_id
276: and rle_code = p_code;
277:
278: cursor line_party(p_code Varchar2) is
277:
278: cursor line_party(p_code Varchar2) is
279: select Max(a.level_sequence) from okc_ancestrys a
280: where a.cle_id = p_line_id
281: and exists(select 'x' from okc_k_party_roles_b b where dnz_chr_id = p_header_id and b.cle_id = a.cle_id_ascendant and b.rle_code = p_code and object1_id1 is not null);
282:
283: cursor header_party(p_code Varchar2) is
284: select count(*) from okc_k_party_roles_b
285: where dnz_chr_id = p_header_id and chr_id = p_header_id
280: where a.cle_id = p_line_id
281: and exists(select 'x' from okc_k_party_roles_b b where dnz_chr_id = p_header_id and b.cle_id = a.cle_id_ascendant and b.rle_code = p_code and object1_id1 is not null);
282:
283: cursor header_party(p_code Varchar2) is
284: select count(*) from okc_k_party_roles_b
285: where dnz_chr_id = p_header_id and chr_id = p_header_id
286: and rle_code = p_code
287: and object1_id1 is not null;
288:
325:
326: IF p_line_id is not null then
327:
328: SELECT COUNT(*) INTO l_row_count
329: FROM OKC_K_PARTY_ROLES_B
330: WHERE dnz_chr_id = p_header_id and cle_id = p_line_id
331: and rle_code = 'SHIP_FROM'
332: and object1_id1 is not null;
333:
388: where cle_id = p_line_id
389: and level_sequence = l_level;
390:
391: select count(*) into l_row_count
392: from okc_k_party_roles_b
393: where dnz_chr_id = p_header_id and cle_id = l_id
394: and rle_code = 'SHIP_FROM';
395:
396: if l_row_count = 1 then
468: end if;
469:
470:
471: select count(*) into l_row_count
472: from okc_k_party_roles_b
473: where dnz_chr_id = p_header_id and cle_id = p_line_id
474: and rle_code = 'SHIP_TO';
475:
476: if l_row_count = 1 then
521: where cle_id = p_line_id
522: and level_sequence = l_level;
523:
524: select count(*) into l_row_count
525: from okc_k_party_roles_b
526: where dnz_chr_id = p_header_id and cle_id = l_id
527: and rle_code = 'SHIP_TO';
528:
529: if l_row_count = 1 then