5: G_DEBUG_ENABLED CONSTANT VARCHAR2(10) := OKL_DEBUG_PUB.CHECK_LOG_ENABLED;
6: G_IS_DEBUG_STATEMENT_ON BOOLEAN;
7: --subtypes declared here to facilitate rosetta skip okc_rule_pub compilation
8: --which has a clob in it
9: TYPE l_phid_mapping_type IS RECORD (old_id okl_party_payment_hdr.id%TYPE := OKC_API.G_MISS_NUM, new_id okl_party_payment_hdr.id%TYPE := OKC_API.G_MISS_NUM);
10: TYPE l_phid_mapping_tab_type IS TABLE OF l_phid_mapping_type INDEX BY BINARY_INTEGER;
11:
12: SUBTYPE api_components_rec_okc is OKC_COPY_CONTRACT_PVT.api_components_rec;
13: SUBTYPE api_components_tbl_okc is OKC_COPY_CONTRACT_PVT.api_components_tbl;
1058: --Bug# : 3143522
1059:
1060: --furong 4350255
1061: ---------------------------------------------------------------------------
1062: -- FUNCTION get_rec for: OKL_PARTY_PAYMENT_HDR_V
1063: ---------------------------------------------------------------------------
1064: FUNCTION get_pphv_rec (
1065: p_pphv_rec IN pphv_rec_type,
1066: x_no_data_found OUT NOCOPY BOOLEAN
1064: FUNCTION get_pphv_rec (
1065: p_pphv_rec IN pphv_rec_type,
1066: x_no_data_found OUT NOCOPY BOOLEAN
1067: ) RETURN pphv_rec_type IS
1068: CURSOR okl_party_payment_hdr_v_pk_csr (p_id IN NUMBER) IS
1069: SELECT
1070: ID,
1071: OBJECT_VERSION_NUMBER,
1072: DNZ_CHR_ID,
1083: CREATION_DATE,
1084: LAST_UPDATED_BY,
1085: LAST_UPDATE_DATE,
1086: LAST_UPDATE_LOGIN
1087: FROM Okl_Party_Payment_Hdr_V
1088: WHERE okl_party_payment_hdr_v.id = p_id;
1089: l_okl_party_payment_hdr_v_pk okl_party_payment_hdr_v_pk_csr%ROWTYPE;
1090: l_pphv_rec pphv_rec_type;
1091: BEGIN
1084: LAST_UPDATED_BY,
1085: LAST_UPDATE_DATE,
1086: LAST_UPDATE_LOGIN
1087: FROM Okl_Party_Payment_Hdr_V
1088: WHERE okl_party_payment_hdr_v.id = p_id;
1089: l_okl_party_payment_hdr_v_pk okl_party_payment_hdr_v_pk_csr%ROWTYPE;
1090: l_pphv_rec pphv_rec_type;
1091: BEGIN
1092: x_no_data_found := TRUE;
1085: LAST_UPDATE_DATE,
1086: LAST_UPDATE_LOGIN
1087: FROM Okl_Party_Payment_Hdr_V
1088: WHERE okl_party_payment_hdr_v.id = p_id;
1089: l_okl_party_payment_hdr_v_pk okl_party_payment_hdr_v_pk_csr%ROWTYPE;
1090: l_pphv_rec pphv_rec_type;
1091: BEGIN
1092: x_no_data_found := TRUE;
1093: -- Get current database values
1090: l_pphv_rec pphv_rec_type;
1091: BEGIN
1092: x_no_data_found := TRUE;
1093: -- Get current database values
1094: OPEN okl_party_payment_hdr_v_pk_csr (p_pphv_rec.id);
1095: FETCH okl_party_payment_hdr_v_pk_csr INTO
1096: l_pphv_rec.id,
1097: l_pphv_rec.object_version_number,
1098: l_pphv_rec.dnz_chr_id,
1091: BEGIN
1092: x_no_data_found := TRUE;
1093: -- Get current database values
1094: OPEN okl_party_payment_hdr_v_pk_csr (p_pphv_rec.id);
1095: FETCH okl_party_payment_hdr_v_pk_csr INTO
1096: l_pphv_rec.id,
1097: l_pphv_rec.object_version_number,
1098: l_pphv_rec.dnz_chr_id,
1099: l_pphv_rec.cle_id,
1109: l_pphv_rec.creation_date,
1110: l_pphv_rec.last_updated_by,
1111: l_pphv_rec.last_update_date,
1112: l_pphv_rec.last_update_login;
1113: x_no_data_found := okl_party_payment_hdr_v_pk_csr%NOTFOUND;
1114: CLOSE okl_party_payment_hdr_v_pk_csr;
1115: RETURN(l_pphv_rec);
1116: END get_pphv_rec;
1117: ------------------------------------------------------------------
1110: l_pphv_rec.last_updated_by,
1111: l_pphv_rec.last_update_date,
1112: l_pphv_rec.last_update_login;
1113: x_no_data_found := okl_party_payment_hdr_v_pk_csr%NOTFOUND;
1114: CLOSE okl_party_payment_hdr_v_pk_csr;
1115: RETURN(l_pphv_rec);
1116: END get_pphv_rec;
1117: ------------------------------------------------------------------
1118: -- This version of get_rec sets error messages if no data found --
3390:
3391: --furong 4350255, find out the hdr id for a cle id --
3392: CURSOR hdr_exist_csr (p_chr_id NUMBER, p_cle_id NUMBER) IS
3393: SELECT id
3394: FROM okl_party_payment_hdr
3395: WHERE dnz_chr_id = p_chr_id
3396: AND cle_id = p_cle_id;
3397:
3398: l_old_hdr_id NUMBER;
3403: SELECT id
3404: FROM okl_party_payment_dtls
3405: WHERE payment_hdr_id IN
3406: (SELECT id
3407: FROM okl_party_payment_hdr
3408: WHERE dnz_chr_id = p_chr_id
3409: AND cle_id = p_cle_id);
3410:
3411: --l_old_hdr_id NUMBER;
3427: cpl_new.id cpl_id
3428: from okl_party_payment_dtls pyd_old,
3429: okc_k_party_roles_b cpl_old,
3430: okc_k_party_roles_b cpl_new,
3431: okl_party_payment_hdr hdr
3432: where pyd_old.cpl_id = cpl_old.id
3433: and cpl_old.cle_id = p_old_cle_id
3434: and cpl_old.dnz_chr_id = p_old_chr_id
3435: and cpl_new.cle_id = p_new_cle_id
12371:
12372:
12373: Procedure copy_party_payment_hdr(p_old_id IN NUMBER,
12374: p_new_id IN NUMBER) IS
12375: TYPE l_phid_type is table of okl_party_payment_hdr.id%TYPE index by binary_integer;
12376: TYPE l_phdnz_chr_id_type is table of okl_party_payment_hdr.dnz_chr_id%TYPE index by binary_integer;
12377: TYPE l_phcle_id_type is table of okl_party_payment_hdr.cle_id%TYPE index by binary_integer;
12378: TYPE l_phppl_id_type is table of okl_party_payment_hdr.ppl_id%TYPE index by binary_integer;
12379: TYPE l_phpassthru_start_date_type is table of okl_party_payment_hdr.passthru_start_date%TYPE index by binary_integer;
12372:
12373: Procedure copy_party_payment_hdr(p_old_id IN NUMBER,
12374: p_new_id IN NUMBER) IS
12375: TYPE l_phid_type is table of okl_party_payment_hdr.id%TYPE index by binary_integer;
12376: TYPE l_phdnz_chr_id_type is table of okl_party_payment_hdr.dnz_chr_id%TYPE index by binary_integer;
12377: TYPE l_phcle_id_type is table of okl_party_payment_hdr.cle_id%TYPE index by binary_integer;
12378: TYPE l_phppl_id_type is table of okl_party_payment_hdr.ppl_id%TYPE index by binary_integer;
12379: TYPE l_phpassthru_start_date_type is table of okl_party_payment_hdr.passthru_start_date%TYPE index by binary_integer;
12380: TYPE l_phpayout_basis_type is table of okl_party_payment_hdr.payout_basis%TYPE index by binary_integer;
12373: Procedure copy_party_payment_hdr(p_old_id IN NUMBER,
12374: p_new_id IN NUMBER) IS
12375: TYPE l_phid_type is table of okl_party_payment_hdr.id%TYPE index by binary_integer;
12376: TYPE l_phdnz_chr_id_type is table of okl_party_payment_hdr.dnz_chr_id%TYPE index by binary_integer;
12377: TYPE l_phcle_id_type is table of okl_party_payment_hdr.cle_id%TYPE index by binary_integer;
12378: TYPE l_phppl_id_type is table of okl_party_payment_hdr.ppl_id%TYPE index by binary_integer;
12379: TYPE l_phpassthru_start_date_type is table of okl_party_payment_hdr.passthru_start_date%TYPE index by binary_integer;
12380: TYPE l_phpayout_basis_type is table of okl_party_payment_hdr.payout_basis%TYPE index by binary_integer;
12381: TYPE l_pheffective_from_type is table of okl_party_payment_hdr.effective_from%TYPE index by binary_integer;
12374: p_new_id IN NUMBER) IS
12375: TYPE l_phid_type is table of okl_party_payment_hdr.id%TYPE index by binary_integer;
12376: TYPE l_phdnz_chr_id_type is table of okl_party_payment_hdr.dnz_chr_id%TYPE index by binary_integer;
12377: TYPE l_phcle_id_type is table of okl_party_payment_hdr.cle_id%TYPE index by binary_integer;
12378: TYPE l_phppl_id_type is table of okl_party_payment_hdr.ppl_id%TYPE index by binary_integer;
12379: TYPE l_phpassthru_start_date_type is table of okl_party_payment_hdr.passthru_start_date%TYPE index by binary_integer;
12380: TYPE l_phpayout_basis_type is table of okl_party_payment_hdr.payout_basis%TYPE index by binary_integer;
12381: TYPE l_pheffective_from_type is table of okl_party_payment_hdr.effective_from%TYPE index by binary_integer;
12382: TYPE l_pheffective_to_type is table of okl_party_payment_hdr.effective_to%TYPE index by binary_integer;
12375: TYPE l_phid_type is table of okl_party_payment_hdr.id%TYPE index by binary_integer;
12376: TYPE l_phdnz_chr_id_type is table of okl_party_payment_hdr.dnz_chr_id%TYPE index by binary_integer;
12377: TYPE l_phcle_id_type is table of okl_party_payment_hdr.cle_id%TYPE index by binary_integer;
12378: TYPE l_phppl_id_type is table of okl_party_payment_hdr.ppl_id%TYPE index by binary_integer;
12379: TYPE l_phpassthru_start_date_type is table of okl_party_payment_hdr.passthru_start_date%TYPE index by binary_integer;
12380: TYPE l_phpayout_basis_type is table of okl_party_payment_hdr.payout_basis%TYPE index by binary_integer;
12381: TYPE l_pheffective_from_type is table of okl_party_payment_hdr.effective_from%TYPE index by binary_integer;
12382: TYPE l_pheffective_to_type is table of okl_party_payment_hdr.effective_to%TYPE index by binary_integer;
12383: TYPE l_phobject_version_number_type is table of okl_party_payment_hdr.object_version_number%TYPE index by binary_integer;
12376: TYPE l_phdnz_chr_id_type is table of okl_party_payment_hdr.dnz_chr_id%TYPE index by binary_integer;
12377: TYPE l_phcle_id_type is table of okl_party_payment_hdr.cle_id%TYPE index by binary_integer;
12378: TYPE l_phppl_id_type is table of okl_party_payment_hdr.ppl_id%TYPE index by binary_integer;
12379: TYPE l_phpassthru_start_date_type is table of okl_party_payment_hdr.passthru_start_date%TYPE index by binary_integer;
12380: TYPE l_phpayout_basis_type is table of okl_party_payment_hdr.payout_basis%TYPE index by binary_integer;
12381: TYPE l_pheffective_from_type is table of okl_party_payment_hdr.effective_from%TYPE index by binary_integer;
12382: TYPE l_pheffective_to_type is table of okl_party_payment_hdr.effective_to%TYPE index by binary_integer;
12383: TYPE l_phobject_version_number_type is table of okl_party_payment_hdr.object_version_number%TYPE index by binary_integer;
12384: TYPE l_phpassthru_term_type is table of okl_party_payment_hdr.passthru_term%TYPE index by binary_integer;
12377: TYPE l_phcle_id_type is table of okl_party_payment_hdr.cle_id%TYPE index by binary_integer;
12378: TYPE l_phppl_id_type is table of okl_party_payment_hdr.ppl_id%TYPE index by binary_integer;
12379: TYPE l_phpassthru_start_date_type is table of okl_party_payment_hdr.passthru_start_date%TYPE index by binary_integer;
12380: TYPE l_phpayout_basis_type is table of okl_party_payment_hdr.payout_basis%TYPE index by binary_integer;
12381: TYPE l_pheffective_from_type is table of okl_party_payment_hdr.effective_from%TYPE index by binary_integer;
12382: TYPE l_pheffective_to_type is table of okl_party_payment_hdr.effective_to%TYPE index by binary_integer;
12383: TYPE l_phobject_version_number_type is table of okl_party_payment_hdr.object_version_number%TYPE index by binary_integer;
12384: TYPE l_phpassthru_term_type is table of okl_party_payment_hdr.passthru_term%TYPE index by binary_integer;
12385: TYPE l_phpayout_basis_formula_type is table of okl_party_payment_hdr.payout_basis_formula%TYPE index by binary_integer;
12378: TYPE l_phppl_id_type is table of okl_party_payment_hdr.ppl_id%TYPE index by binary_integer;
12379: TYPE l_phpassthru_start_date_type is table of okl_party_payment_hdr.passthru_start_date%TYPE index by binary_integer;
12380: TYPE l_phpayout_basis_type is table of okl_party_payment_hdr.payout_basis%TYPE index by binary_integer;
12381: TYPE l_pheffective_from_type is table of okl_party_payment_hdr.effective_from%TYPE index by binary_integer;
12382: TYPE l_pheffective_to_type is table of okl_party_payment_hdr.effective_to%TYPE index by binary_integer;
12383: TYPE l_phobject_version_number_type is table of okl_party_payment_hdr.object_version_number%TYPE index by binary_integer;
12384: TYPE l_phpassthru_term_type is table of okl_party_payment_hdr.passthru_term%TYPE index by binary_integer;
12385: TYPE l_phpayout_basis_formula_type is table of okl_party_payment_hdr.payout_basis_formula%TYPE index by binary_integer;
12386: TYPE l_phpassthru_stre_type_id_type is table of okl_party_payment_hdr.passthru_stream_type_id%TYPE index by binary_integer;
12379: TYPE l_phpassthru_start_date_type is table of okl_party_payment_hdr.passthru_start_date%TYPE index by binary_integer;
12380: TYPE l_phpayout_basis_type is table of okl_party_payment_hdr.payout_basis%TYPE index by binary_integer;
12381: TYPE l_pheffective_from_type is table of okl_party_payment_hdr.effective_from%TYPE index by binary_integer;
12382: TYPE l_pheffective_to_type is table of okl_party_payment_hdr.effective_to%TYPE index by binary_integer;
12383: TYPE l_phobject_version_number_type is table of okl_party_payment_hdr.object_version_number%TYPE index by binary_integer;
12384: TYPE l_phpassthru_term_type is table of okl_party_payment_hdr.passthru_term%TYPE index by binary_integer;
12385: TYPE l_phpayout_basis_formula_type is table of okl_party_payment_hdr.payout_basis_formula%TYPE index by binary_integer;
12386: TYPE l_phpassthru_stre_type_id_type is table of okl_party_payment_hdr.passthru_stream_type_id%TYPE index by binary_integer;
12387:
12380: TYPE l_phpayout_basis_type is table of okl_party_payment_hdr.payout_basis%TYPE index by binary_integer;
12381: TYPE l_pheffective_from_type is table of okl_party_payment_hdr.effective_from%TYPE index by binary_integer;
12382: TYPE l_pheffective_to_type is table of okl_party_payment_hdr.effective_to%TYPE index by binary_integer;
12383: TYPE l_phobject_version_number_type is table of okl_party_payment_hdr.object_version_number%TYPE index by binary_integer;
12384: TYPE l_phpassthru_term_type is table of okl_party_payment_hdr.passthru_term%TYPE index by binary_integer;
12385: TYPE l_phpayout_basis_formula_type is table of okl_party_payment_hdr.payout_basis_formula%TYPE index by binary_integer;
12386: TYPE l_phpassthru_stre_type_id_type is table of okl_party_payment_hdr.passthru_stream_type_id%TYPE index by binary_integer;
12387:
12388: l_phid_tab l_phid_type;
12381: TYPE l_pheffective_from_type is table of okl_party_payment_hdr.effective_from%TYPE index by binary_integer;
12382: TYPE l_pheffective_to_type is table of okl_party_payment_hdr.effective_to%TYPE index by binary_integer;
12383: TYPE l_phobject_version_number_type is table of okl_party_payment_hdr.object_version_number%TYPE index by binary_integer;
12384: TYPE l_phpassthru_term_type is table of okl_party_payment_hdr.passthru_term%TYPE index by binary_integer;
12385: TYPE l_phpayout_basis_formula_type is table of okl_party_payment_hdr.payout_basis_formula%TYPE index by binary_integer;
12386: TYPE l_phpassthru_stre_type_id_type is table of okl_party_payment_hdr.passthru_stream_type_id%TYPE index by binary_integer;
12387:
12388: l_phid_tab l_phid_type;
12389: l_phdnz_chr_id_tab l_phdnz_chr_id_type;
12382: TYPE l_pheffective_to_type is table of okl_party_payment_hdr.effective_to%TYPE index by binary_integer;
12383: TYPE l_phobject_version_number_type is table of okl_party_payment_hdr.object_version_number%TYPE index by binary_integer;
12384: TYPE l_phpassthru_term_type is table of okl_party_payment_hdr.passthru_term%TYPE index by binary_integer;
12385: TYPE l_phpayout_basis_formula_type is table of okl_party_payment_hdr.payout_basis_formula%TYPE index by binary_integer;
12386: TYPE l_phpassthru_stre_type_id_type is table of okl_party_payment_hdr.passthru_stream_type_id%TYPE index by binary_integer;
12387:
12388: l_phid_tab l_phid_type;
12389: l_phdnz_chr_id_tab l_phdnz_chr_id_type;
12390: l_phcle_id_tab l_phcle_id_type;
12416: a.id, a.dnz_chr_id, a.cle_id,
12417: a.ppl_id, a.passthru_start_date, a.payout_basis,
12418: a.effective_from, a.effective_to, a.object_version_number,
12419: a.passthru_term, a.payout_basis_formula, a.passthru_stream_type_id
12420: FROM okl_party_payment_hdr a
12421: WHERE a.dnz_chr_id = p_id;
12422: l_new_cle_id NUMBER;
12423:
12424: BEGIN
12480: END IF;
12481: IF (l_party_payment_hdr_counter > 1) THEN
12482: sort_phid_mapping_tab;
12483: FORALL i IN l_phid_tab.FIRST..l_phid_tab.LAST
12484: INSERT INTO okl_party_payment_hdr (
12485: id, dnz_chr_id, cle_id,
12486: ppl_id, passthru_start_date, payout_basis,
12487: effective_from, effective_to, created_by,
12488: creation_date, last_updated_by, last_update_date,