217: SAVEPOINT Inccmplete_Claim;
218: ---- RUN mode ----
219: IF (funcmode = 'RUN') THEN
220: -- get claim_id
221: l_claim_id := WF_ENGINE.GetItemAttrText( itemtype => itemtype,
222: itemkey => itemkey,
223: aname => 'OZF_CLAIM_ID'
224: );
225:
493:
494: l_error_msg VARCHAR2(4000);
495: BEGIN
496:
497: l_next_status := WF_ENGINE.GetItemAttrText(itemtype => itemtype,
498: itemkey => itemkey,
499: aname => 'OZF_NEXT_STATUS'
500: );
501:
498: itemkey => itemkey,
499: aname => 'OZF_NEXT_STATUS'
500: );
501:
502: l_claim_id := WF_ENGINE.GetItemAttrNumber(itemtype => itemtype,
503: itemkey => itemkey,
504: aname => 'OZF_CLAIM_ID'
505: );
506:
505: );
506:
507:
508: -- [BEGIN OF BUG 3768539 FIXING]
509: l_rec_role_name := WF_ENGINE.GetItemAttrNumber(itemtype => itemtype,
510: itemkey => itemkey,
511: aname => 'OZF_RECEIVABLE_ROLE'
512: );
513:
514: -- Bug4042671: Read role from profile to allow role to be org specific.
515: IF l_rec_role_name IS NULL THEN
516: l_rec_role_name := FND_PROFILE.value('OZF_CLAIM_CSTL_WF_ROLE');
517: IF l_rec_role_name IS NOT NULL THEN
518: WF_ENGINE.SetItemAttrText( itemtype => itemtype,
519: itemkey => itemkey,
520: aname => 'OZF_RECEIVABLE_ROLE',
521: avalue => l_rec_role_name
522: );
530: p_lookup_code => 'OPEN'
531: );
532:
533:
534: WF_ENGINE.SetItemAttrText( itemtype => itemtype,
535: itemkey => itemkey,
536: aname => 'OZF_NEXT_STATUS_MEANING',
537: avalue => l_next_status_meaning
538: );
539:
540: FND_MESSAGE.set_name('OZF', 'OZF_SETL_WF_REC_ROLE_ERR');
541: l_csetl_err_msg := FND_MESSAGE.get;
542:
543: WF_ENGINE.SetItemAttrText( itemtype => itemtype,
544: itemkey => itemkey,
545: aname => 'OZF_CSETL_ERR_MSG',
546: avalue => l_csetl_err_msg
547: );
712: FND_MESSAGE.set_token('OZF_SETL_WF_LINE_DETLS', l_line_detail_msg, false);
713: l_line_detail_str := FND_MESSAGE.get;
714: /* ========================================= */
715:
716: WF_ENGINE.SetItemAttrText( itemtype => itemtype,
717: itemkey => itemkey,
718: aname => 'OZF_SPLIT_DETAILS',
719: avalue => l_split_str
720: );
719: avalue => l_split_str
720: );
721: --
722:
723: WF_ENGINE.SetItemAttrText( itemtype => itemtype,
724: itemkey => itemkey,
725: aname => 'OZF_LINE_DETAILS',
726: avalue => l_line_detail_str
727: );
725: aname => 'OZF_LINE_DETAILS',
726: avalue => l_line_detail_str
727: );
728:
729: WF_ENGINE.SetItemAttrDocument(itemtype => itemtype,
730: itemkey => itemkey,
731: aname => 'OZF_LINE_DETAILS',
732: documentid => l_line_detail_str
733: );
731: aname => 'OZF_LINE_DETAILS',
732: documentid => l_line_detail_str
733: );
734:
735: WF_ENGINE.SetItemAttrText( itemtype => itemtype,
736: itemkey => itemkey,
737: aname => 'OZF_VENDOR_INFO',
738: avalue => l_vendor_info_str
739: );
938: BEGIN
939: SAVEPOINT Update_Docs;
940: ---- RUN mode ----
941: IF (funcmode = 'RUN') THEN
942: l_claim_id := WF_ENGINE.GetItemAttrNumber(itemtype => itemtype,
943: itemkey => itemkey,
944: aname => 'OZF_CLAIM_ID'
945: );
946: l_settle_amount := WF_ENGINE.GetItemAttrNumber(itemtype => itemtype,
942: l_claim_id := WF_ENGINE.GetItemAttrNumber(itemtype => itemtype,
943: itemkey => itemkey,
944: aname => 'OZF_CLAIM_ID'
945: );
946: l_settle_amount := WF_ENGINE.GetItemAttrNumber(itemtype => itemtype,
947: itemkey => itemkey,
948: aname => 'OZF_AMOUNT_SETTLED'
949: );
950:
947: itemkey => itemkey,
948: aname => 'OZF_AMOUNT_SETTLED'
949: );
950:
951: l_receipt_id := WF_ENGINE.GetItemAttrNumber(itemtype => itemtype,
952: itemkey => itemkey,
953: aname => 'OZF_RECEIPT_ID'
954: );
955: l_invoice_id := WF_ENGINE.GetItemAttrNumber(itemtype => itemtype,
951: l_receipt_id := WF_ENGINE.GetItemAttrNumber(itemtype => itemtype,
952: itemkey => itemkey,
953: aname => 'OZF_RECEIPT_ID'
954: );
955: l_invoice_id := WF_ENGINE.GetItemAttrNumber(itemtype => itemtype,
956: itemkey => itemkey,
957: aname => 'OZF_INVOICE_ID'
958: );
959: OPEN csr_get_settle_method(l_claim_id);
996: -- get OZF_TRX_NUMBER_i
997: FOR i IN 1..5 LOOP
998: l_trx_number_name := 'OZF_TRX_NUMBER_'||i;
999: l_trx_number.extend;
1000: l_trx_number(i) := WF_ENGINE.GetItemAttrText( itemtype => itemtype
1001: , itemkey => itemkey
1002: , aname => l_trx_number_name
1003: );
1004:
1006:
1007: FOR j IN 1..i LOOP
1008: IF i <> 1 AND l_trx_number(i) = l_trx_number(j) THEN
1009: l_trx_number(i) := NULL;
1010: WF_ENGINE.SetItemAttrText( itemtype => itemtype
1011: , itemkey => itemkey
1012: , aname => l_trx_number_name
1013: , avalue => NULL
1014: );
1016: END LOOP;
1017:
1018: IF l_trx_number(i) IS NOT NULL THEN
1019: l_trx_number_all_null := 'N';
1020: WF_ENGINE.SetItemAttrText( itemtype => itemtype
1021: , itemkey => itemkey
1022: , aname => l_trx_number_name
1023: , avalue => l_trx_number(i)
1024: );
1024: );
1025: END IF;
1026:
1027: l_err_trx_number_name := 'OZF_ERROR_TRX_NUMBER_'||i;
1028: WF_ENGINE.SetItemAttrText( itemtype => itemtype
1029: , itemkey => itemkey
1030: , aname => l_err_trx_number_name
1031: , avalue => NULL
1032: );
1179:
1180: IF l_trx_number_invalid = 'Y' OR l_do_fetch = 'N' THEN
1181: l_trx_number_error := FND_API.g_true;
1182: l_err_trx_number_name := 'OZF_ERROR_TRX_NUMBER_'||i;
1183: WF_ENGINE.SetItemAttrText( itemtype => itemtype,
1184: itemkey => itemkey,
1185: aname => l_err_trx_number_name,
1186: avalue => l_trx_number(i)
1187: );
1184: itemkey => itemkey,
1185: aname => l_err_trx_number_name,
1186: avalue => l_trx_number(i)
1187: );
1188: WF_ENGINE.SetItemAttrText( itemtype => itemtype,
1189: itemkey => itemkey,
1190: aname => 'OZF_RECEIVABLE_NOTES',
1191: avalue => l_err_msg
1192: );
1332: SAVEPOINT Create_Settle_Doc;
1333: ---- RUN mode ----
1334: IF (funcmode = 'RUN') THEN
1335:
1336: l_claim_id := WF_ENGINE.GetItemAttrNumber(itemtype => itemtype,
1337: itemkey => itemkey,
1338: aname => 'OZF_CLAIM_ID'
1339: );
1340: l_settlement_method := WF_ENGINE.GetItemAttrText(
1336: l_claim_id := WF_ENGINE.GetItemAttrNumber(itemtype => itemtype,
1337: itemkey => itemkey,
1338: aname => 'OZF_CLAIM_ID'
1339: );
1340: l_settlement_method := WF_ENGINE.GetItemAttrText(
1341: itemtype => itemtype,
1342: itemkey => itemkey,
1343: aname => 'OZF_PAYMENT_METHOD_CODE'
1344: );
1341: itemtype => itemtype,
1342: itemkey => itemkey,
1343: aname => 'OZF_PAYMENT_METHOD_CODE'
1344: );
1345: l_settle_amount := WF_ENGINE.GetItemAttrNumber(itemtype => itemtype,
1346: itemkey => itemkey,
1347: aname => 'OZF_AMOUNT_SETTLED'
1348: );
1349: OPEN csr_get_org(l_claim_id);
1354: --Set_Org_Ctx (l_org_id);
1355:
1356: FOR i IN 1..1 LOOP
1357: l_trx_attribute_name := 'OZF_TRX_ID_'||i;
1358: l_settlement_doc_tbl(i).settlement_id := WF_ENGINE.GetItemAttrNumber(
1359: itemtype => itemtype
1360: , itemkey => itemkey
1361: , aname => l_trx_attribute_name
1362: );
1361: , aname => l_trx_attribute_name
1362: );
1363:
1364: l_trx_attribute_name := 'OZF_TRX_TYPE_'||i;
1365: l_settlement_doc_tbl(i).settlement_type := WF_ENGINE.GetItemAttrText(
1366: itemtype => itemtype
1367: , itemkey => itemkey
1368: , aname => l_trx_attribute_name
1369: );
1369: );
1370: l_settlement_doc_tbl(i).settlement_type := LTRIM(RTRIM(l_settlement_doc_tbl(i).settlement_type));
1371:
1372: l_trx_attribute_name := 'OZF_TRX_NUMBER_'||i;
1373: l_settlement_doc_tbl(i).settlement_number := WF_ENGINE.GetItemAttrText(
1374: itemtype => itemtype
1375: , itemkey => itemkey
1376: , aname => l_trx_attribute_name
1377: );
1381: l_trx_number_all_null := 'N';
1382: END IF;
1383:
1384: l_trx_attribute_name := 'OZF_TRX_DATE_'||i;
1385: l_settlement_doc_tbl(i).settlement_DATE := WF_ENGINE.GetItemAttrDate(
1386: itemtype => itemtype
1387: , itemkey => itemkey
1388: , aname => l_trx_attribute_name
1389: );
1388: , aname => l_trx_attribute_name
1389: );
1390:
1391: l_trx_attribute_name := 'OZF_TRX_AMOUNT_'||i;
1392: l_settlement_doc_tbl(i).settlement_amount := WF_ENGINE.GetItemAttrNumber(
1393: itemtype => itemtype
1394: , itemkey => itemkey
1395: , aname => l_trx_attribute_name
1396: );
1395: , aname => l_trx_attribute_name
1396: );
1397:
1398: l_trx_attribute_name := 'OZF_TRX_STATUS_'||i;
1399: l_settlement_doc_tbl(i).status_code := WF_ENGINE.GetItemAttrText(
1400: itemtype => itemtype
1401: , itemkey => itemkey
1402: , aname => l_trx_attribute_name
1403: );
1564: BEGIN
1565: ---- RUN mode ----
1566: IF (funcmode = 'RUN') THEN
1567: -- get claim_id
1568: l_claim_id := WF_ENGINE.GetItemAttrText( itemtype => itemtype,
1569: itemkey => itemkey,
1570: aname => 'OZF_CLAIM_ID'
1571: );
1572: -- get claim next status to update
1569: itemkey => itemkey,
1570: aname => 'OZF_CLAIM_ID'
1571: );
1572: -- get claim next status to update
1573: l_status_code := WF_ENGINE.GetItemAttrText( itemtype => itemtype,
1574: itemkey => itemkey,
1575: aname => 'OZF_NEXT_STATUS'
1576: );
1577:
1574: itemkey => itemkey,
1575: aname => 'OZF_NEXT_STATUS'
1576: );
1577:
1578: l_settle_amount := WF_ENGINE.GetItemAttrNumber(itemtype => itemtype,
1579: itemkey => itemkey,
1580: aname => 'OZF_AMOUNT_SETTLED'
1581: );
1582:
1750: SAVEPOINT Reset_Status;
1751: ---- RUN mode ----
1752: IF (funcmode = 'RUN') THEN
1753: -- get claim_id
1754: l_claim_id := WF_ENGINE.GetItemAttrText( itemtype => itemtype,
1755: itemkey => itemkey,
1756: aname => 'OZF_CLAIM_ID'
1757: );
1758:
2123: l_claim_rec.receipt_number||'_'||
2124: l_claim_rec.object_version_number;
2125:
2126: -- creaye a new process
2127: WF_ENGINE.CreateProcess( itemType => l_itemtype,
2128: itemKey => l_itemkey,
2129: process => l_process
2130: );
2131: --
2129: process => l_process
2130: );
2131: --
2132: -- set the user key for process
2133: WF_ENGINE.SetItemUserKey( itemType => l_itemtype,
2134: itemKey => l_itemkey,
2135: userKey => l_itemuserkey
2136: );
2137: --
2141: ,x_role_name => l_owner
2142: ,x_role_display_name => l_owner_name
2143: );
2144: -- set the process owner (l_claim_owner)
2145: WF_ENGINE.SetItemOwner( itemtype => l_itemtype,
2146: itemkey => l_itemkey,
2147: owner => l_owner
2148: );
2149: --
2148: );
2149: --
2150:
2151: ----------------- Set Attributes ---------------------------
2152: WF_ENGINE.SetItemAttrNumber( itemtype => l_itemtype,
2153: itemkey => l_itemkey,
2154: aname => 'OZF_CLAIM_ID',
2155: avalue => p_claim_id
2156: );
2154: aname => 'OZF_CLAIM_ID',
2155: avalue => p_claim_id
2156: );
2157: --
2158: WF_ENGINE.SetItemAttrText( itemtype => l_itemtype,
2159: itemkey => l_itemkey,
2160: aname => 'OZF_CLAIM_NUMBER',
2161: avalue => l_claim_rec.claim_number
2162: );
2160: aname => 'OZF_CLAIM_NUMBER',
2161: avalue => l_claim_rec.claim_number
2162: );
2163: --
2164: WF_ENGINE.SetItemAttrText( itemtype => l_itemtype,
2165: itemkey => l_itemkey,
2166: aname => 'OZF_CLAIM_CLASS',
2167: avalue => l_claim_rec.claim_class
2168: );
2166: aname => 'OZF_CLAIM_CLASS',
2167: avalue => l_claim_rec.claim_class
2168: );
2169: --
2170: WF_ENGINE.SetItemAttrNumber( itemtype => l_itemtype,
2171: itemkey => l_itemkey,
2172: aname => 'OZF_AMOUNT_SETTLED',
2173: avalue => l_claim_rec.amount_settled
2174: );
2172: aname => 'OZF_AMOUNT_SETTLED',
2173: avalue => l_claim_rec.amount_settled
2174: );
2175: --
2176: WF_ENGINE.SetItemAttrText( itemtype => l_itemtype,
2177: itemkey => l_itemkey,
2178: aname => 'OZF_CURRENCY_CODE',
2179: avalue => l_claim_rec.currency_code
2180: );
2178: aname => 'OZF_CURRENCY_CODE',
2179: avalue => l_claim_rec.currency_code
2180: );
2181: --
2182: WF_ENGINE.SetItemAttrNumber( itemtype => l_itemtype,
2183: itemkey => l_itemkey,
2184: aname => 'OZF_RECEIPT_ID',
2185: avalue => l_claim_rec.receipt_id
2186: );
2184: aname => 'OZF_RECEIPT_ID',
2185: avalue => l_claim_rec.receipt_id
2186: );
2187: --
2188: WF_ENGINE.SetItemAttrText( itemtype => l_itemtype,
2189: itemkey => l_itemkey,
2190: aname => 'OZF_RECEIPT_NUMBER',
2191: avalue => l_claim_rec.receipt_number
2192: );
2190: aname => 'OZF_RECEIPT_NUMBER',
2191: avalue => l_claim_rec.receipt_number
2192: );
2193: --
2194: WF_ENGINE.SetItemAttrNumber( itemtype => l_itemtype,
2195: itemkey => l_itemkey,
2196: aname => 'OZF_INVOICE_ID',
2197: avalue => l_claim_rec.source_object_id
2198: );
2196: aname => 'OZF_INVOICE_ID',
2197: avalue => l_claim_rec.source_object_id
2198: );
2199: --
2200: WF_ENGINE.SetItemAttrText( itemtype => l_itemtype,
2201: itemkey => l_itemkey,
2202: aname => 'OZF_INVOICE_NUMBER',
2203: avalue => l_claim_rec.source_object_number
2204: );
2202: aname => 'OZF_INVOICE_NUMBER',
2203: avalue => l_claim_rec.source_object_number
2204: );
2205: --
2206: WF_ENGINE.SetItemAttrText( itemtype => l_itemtype,
2207: itemkey => l_itemkey,
2208: aname => 'OZF_PAYMENT_METHOD',
2209: avalue => l_payment_method
2210: );
2208: aname => 'OZF_PAYMENT_METHOD',
2209: avalue => l_payment_method
2210: );
2211: --
2212: WF_ENGINE.SetItemAttrText( itemtype => l_itemtype,
2213: itemkey => l_itemkey,
2214: aname => 'OZF_PAYMENT_METHOD_CODE',
2215: avalue => l_claim_rec.payment_method
2216: );
2214: aname => 'OZF_PAYMENT_METHOD_CODE',
2215: avalue => l_claim_rec.payment_method
2216: );
2217: --
2218: WF_ENGINE.SetItemAttrDate( itemtype => l_itemtype,
2219: itemkey => l_itemkey,
2220: aname => 'OZF_GL_DATE',
2221: avalue => l_claim_rec.gl_date
2222: );
2220: aname => 'OZF_GL_DATE',
2221: avalue => l_claim_rec.gl_date
2222: );
2223: --
2224: WF_ENGINE.SetItemAttrDate( itemtype => l_itemtype,
2225: itemkey => l_itemkey,
2226: aname => 'OZF_EFFECTIVE_DATE',
2227: avalue => l_claim_rec.effective_date
2228: );
2226: aname => 'OZF_EFFECTIVE_DATE',
2227: avalue => l_claim_rec.effective_date
2228: );
2229: --
2230: WF_ENGINE.SetItemAttrNumber( itemtype => l_itemtype,
2231: itemkey => l_itemkey,
2232: aname => 'OZF_CUST_ACCOUNT_ID',
2233: avalue => l_claim_rec.cust_account_id
2234: );
2232: aname => 'OZF_CUST_ACCOUNT_ID',
2233: avalue => l_claim_rec.cust_account_id
2234: );
2235: --
2236: WF_ENGINE.SetItemAttrText( itemtype => l_itemtype,
2237: itemkey => l_itemkey,
2238: aname => 'OZF_ACCOUNT_NAME',
2239: avalue => l_cust_name
2240: );
2238: aname => 'OZF_ACCOUNT_NAME',
2239: avalue => l_cust_name
2240: );
2241: --
2242: WF_ENGINE.SetItemAttrNumber( itemtype => l_itemtype,
2243: itemkey => l_itemkey,
2244: aname => 'OZF_BILLTO_ACCT_SITE_ID',
2245: avalue => l_claim_rec.cust_billto_acct_site_id
2246: );
2244: aname => 'OZF_BILLTO_ACCT_SITE_ID',
2245: avalue => l_claim_rec.cust_billto_acct_site_id
2246: );
2247: --
2248: WF_ENGINE.SetItemAttrText( itemtype => l_itemtype,
2249: itemkey => l_itemkey,
2250: aname => 'OZF_BILLTO_SITE',
2251: avalue => l_billto_site
2252: );
2250: aname => 'OZF_BILLTO_SITE',
2251: avalue => l_billto_site
2252: );
2253: --
2254: WF_ENGINE.SetItemAttrNumber( itemtype => l_itemtype,
2255: itemkey => l_itemkey,
2256: aname => 'OZF_SHIPTO_ACCT_SITE_ID',
2257: avalue => l_claim_rec.cust_shipto_acct_site_id
2258: );
2256: aname => 'OZF_SHIPTO_ACCT_SITE_ID',
2257: avalue => l_claim_rec.cust_shipto_acct_site_id
2258: );
2259: --
2260: WF_ENGINE.SetItemAttrText( itemtype => l_itemtype,
2261: itemkey => l_itemkey,
2262: aname => 'OZF_SHIPTO_SITE',
2263: avalue => l_shipto_site
2264: );
2262: aname => 'OZF_SHIPTO_SITE',
2263: avalue => l_shipto_site
2264: );
2265: --
2266: WF_ENGINE.SetItemAttrNumber( itemtype => l_itemtype,
2267: itemkey => l_itemkey,
2268: aname => 'OZF_CLAIM_OWNER_ID',
2269: avalue => l_claim_rec.owner_id
2270: );
2268: aname => 'OZF_CLAIM_OWNER_ID',
2269: avalue => l_claim_rec.owner_id
2270: );
2271: --
2272: WF_ENGINE.SetItemAttrText(itemtype => l_itemtype,
2273: itemkey => l_itemkey,
2274: aname => 'OZF_CLAIM_OWNER',
2275: avalue => l_owner
2276: );
2274: aname => 'OZF_CLAIM_OWNER',
2275: avalue => l_owner
2276: );
2277: --
2278: WF_ENGINE.SetItemAttrText( itemtype => l_itemtype,
2279: itemkey => l_itemkey,
2280: aname => 'OZF_PREVIOUS_STATUS',
2281: avalue => p_prev_status
2282: );
2280: aname => 'OZF_PREVIOUS_STATUS',
2281: avalue => p_prev_status
2282: );
2283: --
2284: WF_ENGINE.SetItemAttrText( itemtype => l_itemtype,
2285: itemkey => l_itemkey,
2286: aname => 'OZF_CURRENT_STATUS',
2287: avalue => p_curr_status
2288: );
2286: aname => 'OZF_CURRENT_STATUS',
2287: avalue => p_curr_status
2288: );
2289: --
2290: WF_ENGINE.SetItemAttrText( itemtype => l_itemtype,
2291: itemkey => l_itemkey,
2292: aname => 'OZF_NEXT_STATUS',
2293: avalue => p_next_status
2294: );
2294: );
2295:
2296: -- New attr added 12-Aug
2297:
2298: WF_ENGINE.SetItemAttrText( itemtype => l_itemtype,
2299: itemkey => l_itemkey,
2300: aname => 'OZF_ORG_NAME',
2301: avalue => l_org_name
2302: );
2300: aname => 'OZF_ORG_NAME',
2301: avalue => l_org_name
2302: );
2303: --
2304: WF_ENGINE.SetItemAttrText( itemtype => l_itemtype,
2305: itemkey => l_itemkey,
2306: aname => 'OZF_CLAIM_TYPE',
2307: avalue => l_claim_type
2308: );
2306: aname => 'OZF_CLAIM_TYPE',
2307: avalue => l_claim_type
2308: );
2309: --
2310: WF_ENGINE.SetItemAttrText( itemtype => l_itemtype,
2311: itemkey => l_itemkey,
2312: aname => 'OZF_CLAIM_DATE',
2313: avalue => l_claim_rec.claim_date
2314: );
2312: aname => 'OZF_CLAIM_DATE',
2313: avalue => l_claim_rec.claim_date
2314: );
2315: --
2316: WF_ENGINE.SetItemAttrText( itemtype => l_itemtype,
2317: itemkey => l_itemkey,
2318: aname => 'OZF_DUE_DATE',
2319: avalue => l_claim_rec.due_date
2320: );
2318: aname => 'OZF_DUE_DATE',
2319: avalue => l_claim_rec.due_date
2320: );
2321: --
2322: WF_ENGINE.SetItemAttrText( itemtype => l_itemtype,
2323: itemkey => l_itemkey,
2324: aname => 'OZF_ACCOUNT_NUMBER',
2325: avalue => l_account_number
2326: );
2324: aname => 'OZF_ACCOUNT_NUMBER',
2325: avalue => l_account_number
2326: );
2327: --
2328: WF_ENGINE.SetItemAttrText( itemtype => l_itemtype,
2329: itemkey => l_itemkey,
2330: aname => 'OZF_REASON',
2331: avalue => l_ar_reason_code
2332: );
2330: aname => 'OZF_REASON',
2331: avalue => l_ar_reason_code
2332: );
2333: --
2334: WF_ENGINE.SetItemAttrText( itemtype => l_itemtype,
2335: itemkey => l_itemkey,
2336: aname => 'OZF_TRX_TYPE',
2337: avalue => l_trx_type
2338: );
2336: aname => 'OZF_TRX_TYPE',
2337: avalue => l_trx_type
2338: );
2339: --
2340: WF_ENGINE.SetItemAttrText( itemtype => l_itemtype,
2341: itemkey => l_itemkey,
2342: aname => 'OZF_COMMENTS',
2343: avalue => l_claim_rec.comments
2344: );
2342: aname => 'OZF_COMMENTS',
2343: avalue => l_claim_rec.comments
2344: );
2345: --
2346: WF_ENGINE.SetItemAttrText( itemtype => l_itemtype,
2347: itemkey => l_itemkey,
2348: aname => 'OZF_SALESREP_ID',
2349: avalue => l_claim_rec.sales_rep_id
2350: );
2348: aname => 'OZF_SALESREP_ID',
2349: avalue => l_claim_rec.sales_rep_id
2350: );
2351: --
2352: WF_ENGINE.SetItemAttrText( itemtype => l_itemtype,
2353: itemkey => l_itemkey,
2354: aname => 'OZF_SALESREP_NAME',
2355: avalue => l_salesrep_name
2356: );
2354: aname => 'OZF_SALESREP_NAME',
2355: avalue => l_salesrep_name
2356: );
2357: --
2358: WF_ENGINE.SetItemAttrText( itemtype => l_itemtype,
2359: itemkey => l_itemkey,
2360: aname => 'OZF_CLAIM_OWNER_NAME',
2361: avalue => l_owner_name
2362: );
2360: aname => 'OZF_CLAIM_OWNER_NAME',
2361: avalue => l_owner_name
2362: );
2363: --
2364: WF_ENGINE.SetItemAttrText( itemtype => l_itemtype,
2365: itemkey => l_itemkey,
2366: aname => 'OZF_NEXT_STATUS_MEANING',
2367: avalue => l_next_status_meaning
2368: );
2367: avalue => l_next_status_meaning
2368: );
2369: --
2370: IF p_promotional_claim = 'Y' THEN
2371: WF_ENGINE.SetItemAttrText( itemtype => l_itemtype,
2372: itemkey => l_itemkey,
2373: aname => 'OZF_PROMO_CLAIM_FLAG',
2374: avalue => 'Y'
2375: );
2387: FETCH csr_pmt_method INTO l_payment_method;
2388: CLOSE csr_pmt_method;
2389:
2390: --
2391: WF_ENGINE.SetItemAttrText( itemtype => l_itemtype,
2392: itemkey => l_itemkey,
2393: aname => 'OZF_PAYMENT_METHOD',
2394: avalue => l_payment_method
2395: );
2393: aname => 'OZF_PAYMENT_METHOD',
2394: avalue => l_payment_method
2395: );
2396: --
2397: WF_ENGINE.SetItemAttrText( itemtype => l_itemtype,
2398: itemkey => l_itemkey,
2399: aname => 'OZF_PAYMENT_METHOD_CODE',
2400: avalue => l_payment_method_code
2401: );
2399: aname => 'OZF_PAYMENT_METHOD_CODE',
2400: avalue => l_payment_method_code
2401: );
2402: --
2403: WF_ENGINE.SetItemAttrNumber( itemtype => l_itemtype,
2404: itemkey => l_itemkey,
2405: aname => 'OZF_AMOUNT_SETTLED',
2406: avalue => l_amount_settled
2407: );
2429: RAISE FND_API.G_EXC_ERROR;
2430: END IF;
2431: */
2432: /*
2433: WF_ENGINE.SetItemAttrText(itemtype => l_itemtype,
2434: itemkey => l_itemkey,
2435: aname => 'OZF_RECEIVABLE_DEPT',
2436: avalue =>
2437: );
2452: FND_MSG_PUB.Add;
2453: END IF;
2454: END;
2455: -------------- start the process ---------------------
2456: WF_ENGINE.StartProcess( itemtype => l_itemtype,
2457: itemkey => l_itemkey
2458: );
2459: --
2460:
2521: BEGIN
2522: ---- RUN mode ----
2523: IF (funcmode = 'RUN') THEN
2524: -- get claim_id
2525: l_promo_flag := WF_ENGINE.GetItemAttrText( itemtype => itemtype,
2526: itemkey => itemkey,
2527: aname => 'OZF_PROMO_CLAIM_FLAG'
2528: );
2529:
2526: itemkey => itemkey,
2527: aname => 'OZF_PROMO_CLAIM_FLAG'
2528: );
2529:
2530: l_claim_id := WF_ENGINE.GetItemAttrText( itemtype => itemtype,
2531: itemkey => itemkey,
2532: aname => 'OZF_CLAIM_ID'
2533: );
2534:
2616: SAVEPOINT Create_GL_Entries;
2617: ---- RUN mode ----
2618: IF (funcmode = 'RUN') THEN
2619: -- get claim_id
2620: l_claim_id := WF_ENGINE.GetItemAttrText( itemtype => itemtype,
2621: itemkey => itemkey,
2622: aname => 'OZF_CLAIM_ID'
2623: );
2624:
2621: itemkey => itemkey,
2622: aname => 'OZF_CLAIM_ID'
2623: );
2624:
2625: l_payment_method := WF_ENGINE.GetItemAttrText( itemtype => itemtype,
2626: itemkey => itemkey,
2627: aname => 'OZF_PAYMENT_METHOD_CODE'
2628: );
2629:
2626: itemkey => itemkey,
2627: aname => 'OZF_PAYMENT_METHOD_CODE'
2628: );
2629:
2630: l_claim_class := WF_ENGINE.GetItemAttrText( itemtype => itemtype,
2631: itemkey => itemkey,
2632: aname => 'OZF_CLAIM_CLASS'
2633: );
2634:
2743: SAVEPOINT Revert_GL_Entries;
2744: ---- RUN mode ----
2745: IF (funcmode = 'RUN') THEN
2746: -- get claim_id
2747: l_claim_id := WF_ENGINE.GetItemAttrText( itemtype => itemtype,
2748: itemkey => itemkey,
2749: aname => 'OZF_CLAIM_ID'
2750: );
2751:
2888: SAVEPOINT create_payment;
2889: ---- RUN mode ----
2890: IF (funcmode = 'RUN') THEN
2891: -- get claim_id
2892: l_claim_id := WF_ENGINE.GetItemAttrText( itemtype => itemtype,
2893: itemkey => itemkey,
2894: aname => 'OZF_CLAIM_ID'
2895: );
2896:
2893: itemkey => itemkey,
2894: aname => 'OZF_CLAIM_ID'
2895: );
2896:
2897: l_payment_method := WF_ENGINE.GetItemAttrText( itemtype => itemtype,
2898: itemkey => itemkey,
2899: aname => 'OZF_PAYMENT_METHOD_CODE'
2900: );
2901:
3039: BEGIN
3040: ---- RUN mode ----
3041: IF (funcmode = 'RUN') THEN
3042: -- get claim_id
3043: l_claim_class := WF_ENGINE.GetItemAttrText( itemtype => itemtype,
3044: itemkey => itemkey,
3045: aname => 'OZF_CLAIM_CLASS'
3046: );
3047: IF l_claim_class = 'CLAIM' THEN
3097: l_claim_number VARCHAR2(30);
3098:
3099:
3100: BEGIN
3101: l_claim_number := WF_ENGINE.GetItemAttrText(
3102: itemtype => p_itemtype,
3103: itemkey => p_itemkey,
3104: aname => 'OZF_CLAIM_NUMBER'
3105: );
3108: FND_MESSAGE.set_token ('CLAIM', l_claim_number, FALSE);
3109:
3110: l_err_subj := SUBSTR(FND_MESSAGE.get, 1, 240);
3111:
3112: Wf_Engine.SetItemAttrText(
3113: itemtype => p_itemtype,
3114: itemkey => p_itemkey ,
3115: aname => 'OZF_CSETL_ERR_SUBJ',
3116: avalue => l_err_subj );
3130: END LOOP ;
3131:
3132: x_error_msg := l_final_msg;
3133:
3134: WF_ENGINE.SetItemAttrText(
3135: itemtype => p_itemtype,
3136: itemkey => p_itemkey ,
3137: aname => 'OZF_CSETL_ERR_MSG',
3138: avalue => l_final_msg
3153: BEGIN
3154: ---- RUN mode ----
3155: IF (funcmode = 'RUN') THEN
3156: -- get claim_id
3157: l_payment_method := WF_ENGINE.GetItemAttrText(
3158: itemtype => itemtype,
3159: itemkey => itemkey,
3160: aname => 'OZF_PAYMENT_METHOD_CODE'
3161: );
3173: , 'WIRE'
3174: , 'AP_DEBIT'
3175: , 'AP_DEFAULT'
3176: ) THEN
3177: WF_ENGINE.SetItemAttrText(
3178: itemtype => itemtype,
3179: itemkey => itemkey,
3180: aname => 'OZF_CSETL_TYPE',
3181: avalue => 'SEEDED'
3181: avalue => 'SEEDED'
3182: );
3183: resultout := 'COMPLETE:Y';
3184: ELSE
3185: WF_ENGINE.SetItemAttrText(
3186: itemtype => itemtype,
3187: itemkey => itemkey,
3188: aname => 'OZF_CSETL_TYPE',
3189: avalue => 'ADHOC'
3234:
3235: ---- RUN mode ----
3236: IF (funcmode = 'RUN') THEN
3237: -- Transaction Identifier
3238: WF_ENGINE.SetItemAttrNumber( itemtype => itemtype,
3239: itemkey => itemkey,
3240: aname => 'OZF_TRX_ID_1',
3241: avalue => 1001
3242: );
3240: aname => 'OZF_TRX_ID_1',
3241: avalue => 1001
3242: );
3243: -- Transaction Type
3244: WF_ENGINE.SetItemAttrText( itemtype => itemtype,
3245: itemkey => itemkey,
3246: aname => 'OZF_TRX_TYPE_1',
3247: avalue => 'CM'
3248: );
3246: aname => 'OZF_TRX_TYPE_1',
3247: avalue => 'CM'
3248: );
3249: -- Transaction Number
3250: WF_ENGINE.SetItemAttrText( itemtype => itemtype,
3251: itemkey => itemkey,
3252: aname => 'OZF_TRX_NUMBER_1',
3253: avalue => 'TST-1001'
3254: );
3252: aname => 'OZF_TRX_NUMBER_1',
3253: avalue => 'TST-1001'
3254: );
3255: -- Transaction Date
3256: WF_ENGINE.SetItemAttrDate( itemtype => itemtype,
3257: itemkey => itemkey,
3258: aname => 'OZF_TRX_DATE_1',
3259: avalue => SYSDATE
3260: );
3258: aname => 'OZF_TRX_DATE_1',
3259: avalue => SYSDATE
3260: );
3261: -- Transaction Amount
3262: WF_ENGINE.SetItemAttrNumber( itemtype => itemtype,
3263: itemkey => itemkey,
3264: aname => 'OZF_TRX_AMOUNT_1',
3265: avalue => 123456
3266: );
3264: aname => 'OZF_TRX_AMOUNT_1',
3265: avalue => 123456
3266: );
3267: -- Transaction Status
3268: WF_ENGINE.SetItemAttrText( itemtype => itemtype,
3269: itemkey => itemkey,
3270: aname => 'OZF_TRX_STATUS_1',
3271: avalue => 'PAID'
3272: );
3334:
3335: BEGIN
3336: ---- RUN mode ----
3337: IF (funcmode = 'RUN') THEN
3338: l_claim_class := WF_ENGINE.GetItemAttrText( itemtype => itemtype,
3339: itemkey => itemkey,
3340: aname => 'OZF_CLAIM_CLASS'
3341: );
3342:
3339: itemkey => itemkey,
3340: aname => 'OZF_CLAIM_CLASS'
3341: );
3342:
3343: l_payment_method := WF_ENGINE.GetItemAttrText( itemtype => itemtype,
3344: itemkey => itemkey,
3345: aname => 'OZF_PAYMENT_METHOD_CODE'
3346: );
3347: