23: v_proc varchar2(72) := g_package||'check_type';
24: --
25: Begin
26: --
27: hr_utility.set_location('Entering:'||v_proc, 5);
28: --
29: If p_type is not null Then
30: --
31: ota_general.check_domain_value( 'FINANCE_HEADER_TYPE', p_type);
36: ota_tfh_api_shd.constraint_error( 'OTA_TFH_TYPE_CHK');
37: --
38: End If;
39: --
40: hr_utility.set_location(' Leaving:'||v_proc, 10);
41: --
42: End check_type;
43: --
44: -- ----------------------------------------------------------------------------
58: v_proc varchar2(72) := g_package||'check_transfer_status';
59: --
60: Begin
61: --
62: hr_utility.set_location('Entering:'|| v_proc, 5);
63: --
64: If p_transfer_status is not null Then
65: --
66: ota_general.check_domain_value( 'GL_TRANSFER_STATUS', p_transfer_status);
71: --
72: End If;
73: --
74: --
75: hr_utility.set_location(' Leaving:'|| v_proc, 10);
76: --
77: End check_transfer_status;
78: --
79: -- ----------------------------------------------------------------------------
104: v_proc varchar2(72) := g_package||'check_transfer_rules';
105: --
106: Begin
107: --
108: hr_utility.set_location('Entering:'|| v_proc, 5);
109: --
110: if p_new_transfer_status <> p_old_transfer_status and
111: ((p_old_transfer_status = 'NT' and p_new_transfer_status = 'AT')
112: or (p_old_transfer_status = 'AT' and p_new_transfer_status = 'NT')
120: fnd_message.set_name('OTA','OTA_13414_TFH_TRANS_RULES');
121: fnd_message.raise_error;
122: end if;
123: --
124: hr_utility.set_location(' Leaving:'|| v_proc, 10);
125: --
126: End check_transfer_rules;
127: --
128: -- ----------------------------------------------------------------------------
142: --
143: v_proc varchar2(72) := g_package||'check_status_unauthorized';
144: --
145: Begin
146: hr_utility.set_location('Entering:'|| v_proc, 5);
147: --
148: If p_authorized_person_id is null Then
149: If p_status <> 'NT' Then
150: fnd_message.set_name('OTA','OTA_13280_TFH_UNAUTHORIZED');
151: fnd_message.raise_error;
152: End if;
153: End If;
154: --
155: hr_utility.set_location(' Leaving:'|| v_proc, 10);
156: End check_status_unauthorized;
157: --
158: -- ----------------------------------------------------------------------------
159: -- |-------------------------< check_authorized_by >--------------------------|
170: --
171: v_proc varchar2(72) := g_package||'check_authorized_by';
172: --
173: Begin
174: hr_utility.set_location('Entering:'|| v_proc, 5);
175: --
176: If p_person_id is not null Then
177: If NOT ota_general.check_fnd_user( p_person_id) Then
178: fnd_message.set_name('OTA','OTA_13281_TFH_AUTHORIZER');
179: fnd_message.raise_error;
180: End if;
181: End if;
182: --
183: hr_utility.set_location(' Leaving:'|| v_proc, 10);
184: End check_authorized_by;
185: --
186: -- ----------------------------------------------------------------------------
187: -- |-------------------------< set_date_raised >------------------------------|
200: --
201: v_proc varchar2(72) := g_package||'set_date_raised';
202: --
203: Begin
204: hr_utility.set_location('Entering:'|| v_proc, 5);
205: --
206: If p_session_date is null Then
207: fnd_message.set_name('OTA','OTA_13313_TFH_DATE_RAISED');
208: fnd_message.raise_error;
209: Else
210: p_date_raised := p_session_date;
211: End If;
212: --
213: hr_utility.set_location(' Leaving:'|| v_proc, 10);
214: End set_date_raised;
215: --
216: -- ----------------------------------------------------------------------------
217: -- |--------------------< check_receivable_attributes >-----------------------|
250: v_proc varchar2(72) := g_package||'check_receivable_attributes';
251: --
252: Begin
253: --
254: hr_utility.set_location('Entering:'|| v_proc, 5);
255: --
256: If p_type = 'R' Then
257: --
258: If p_customer_id is null OR
270: End if;
271: --
272: End If;
273: --
274: hr_utility.set_location(' Leaving:'|| v_proc, 10);
275: --
276: End check_receivable_attributes;
277: --
278: -- ----------------------------------------------------------------------------
299: where con.customer_id = p_customer_id
300: and con.contact_id = p_contact_id;
301: --
302: Begin
303: hr_utility.set_location('Entering:'|| v_proc, 5);
304: --
305: If p_contact_id is NOT null AND p_customer_id is NOT null Then
306: Open sel_customer_contact;
307: fetch sel_customer_contact into v_exists;
314: --
315: close sel_customer_contact;
316: End if;
317: --
318: hr_utility.set_location(' Leaving:'|| v_proc, 10);
319: End check_customer_contact;
320: --
321: -- ----------------------------------------------------------------------------
322: -- |-----------------------< check_customer_address >-------------------------|
342: where adr.customer_id = p_customer_id
343: and adr.address_id = p_address_id;
344: --
345: Begin
346: hr_utility.set_location('Entering:'|| v_proc, 5);
347: --
348: If p_address_id is NOT null AND p_customer_id is NOT null Then
349: Open sel_customer_address;
350: fetch sel_customer_address into v_exists;
357: --
358: close sel_customer_address;
359: End if;
360: --
361: hr_utility.set_location(' Leaving:'|| v_proc, 10);
362: End check_customer_address;
363: --
364: -- ----------------------------------------------------------------------------
365: -- |------------------------< set_invoice_address >---------------------------|
390: where adr.customer_id = p_customer_id
391: and adr.address_id = p_address_id;
392: --
393: Begin
394: hr_utility.set_location('Entering:'|| v_proc, 5);
395: --
396: If p_address_id is NOT null AND p_customer_id is NOT null Then
397: Open sel_invoice_address;
398: fetch sel_invoice_address into v_address;
407: --
408: close sel_invoice_address;
409: End if;
410: --
411: hr_utility.set_location(' Leaving:'|| v_proc, 10);
412: End set_invoice_address;
413: --
414: -- ----------------------------------------------------------------------------
415: -- |------------------------< set_invoice_contact >---------------------------|
434: where con.customer_id = p_customer_id
435: and con.contact_id = p_contact_id;
436: --
437: Begin
438: hr_utility.set_location('Entering:'|| v_proc, 5);
439: --
440: If p_contact_id is NOT null AND p_customer_id is NOT null Then
441: Open sel_invoice_contact;
442: fetch sel_invoice_contact into v_contact;
451: --
452: close sel_invoice_contact;
453: End if;
454: --
455: hr_utility.set_location(' Leaving:'|| v_proc, 10);
456: End set_invoice_contact;
457: --
458: -- ----------------------------------------------------------------------------
459: -- |-----------------------< check_vendor_contact >---------------------------|
484: and PAV.PARTY_ID = HP.PARTY_ID;
485:
486: --
487: Begin
488: hr_utility.set_location('Entering:'|| v_proc, 5);
489: --
490: If p_contact_id is NOT null AND p_vendor_id is NOT null Then
491: Open sel_vendor_contact;
492: fetch sel_vendor_contact into v_exists;
499: --
500: close sel_vendor_contact;
501: End if;
502: --
503: hr_utility.set_location(' Leaving:'|| v_proc, 10);
504: End check_vendor_contact;
505: --
506: -- ----------------------------------------------------------------------------
507: -- |-------------------------< check_vendor_address >-------------------------|
527: where adr.vendor_id = p_vendor_id
528: and adr.vendor_site_id = p_address_id;
529: --
530: Begin
531: hr_utility.set_location('Entering:'|| v_proc, 5);
532: --
533: If p_address_id is NOT null AND p_vendor_id is NOT null Then
534: Open sel_vendor_address;
535: fetch sel_vendor_address into v_exists;
542: --
543: close sel_vendor_address;
544: End if;
545: --
546: hr_utility.set_location(' Leaving:'|| v_proc, 10);
547: End check_vendor_address;
548: --
549: -- ----------------------------------------------------------------------------
550: -- |-----------------------< check_payable_attributes >-----------------------|
581: v_proc varchar2(72) := g_package||'check_payable_attributes';
582: --
583: Begin
584: --
585: hr_utility.set_location('Entering:'|| v_proc, 5);
586: --
587: If p_type like 'P' Then
588: --
589: If p_vendor_id is null OR
599: End if;
600: --
601: End If;
602: --
603: hr_utility.set_location(' Leaving:'|| v_proc, 10);
604: --
605: End check_payable_attributes;
606: --
607: -- ----------------------------------------------------------------------------
620: v_proc varchar2(72) := g_package||'check_cancelled_flag';
621: --
622: Begin
623: --
624: hr_utility.set_location('Entering:'|| v_proc, 5);
625: --
626: If NOT (p_flag in ('N', 'Y')) then
627: --
628: ota_tfh_api_shd.constraint_error( 'OTA_TFH_CANCELLED_FLAG_CHK');
628: ota_tfh_api_shd.constraint_error( 'OTA_TFH_CANCELLED_FLAG_CHK');
629: --
630: End If;
631: --
632: hr_utility.set_location(' Leaving:'|| v_proc, 10);
633: --
634: End check_cancelled_flag;
635: --
636: -- ----------------------------------------------------------------------------
655: v_finance_line_exists varchar2(30);
656: v_proc varchar2(72) := g_package||'finance_lines_exist';
657: --
658: Begin
659: hr_utility.set_location(' Leaving:'|| v_proc, 5);
660: --
661: open get_finance_line;
662: fetch get_finance_line into v_finance_line_exists;
663: if get_finance_line%found then
661: open get_finance_line;
662: fetch get_finance_line into v_finance_line_exists;
663: if get_finance_line%found then
664: close get_finance_line;
665: hr_utility.trace('Finance Lines Found');
666: return TRUE;
667: else
668: close get_finance_line;
669: hr_utility.trace('Finance Lines not Found');
665: hr_utility.trace('Finance Lines Found');
666: return TRUE;
667: else
668: close get_finance_line;
669: hr_utility.trace('Finance Lines not Found');
670: return FALSE;
671: end if;
672: --
673: hr_utility.set_location(' Leaving:'|| v_proc, 10);
669: hr_utility.trace('Finance Lines not Found');
670: return FALSE;
671: end if;
672: --
673: hr_utility.set_location(' Leaving:'|| v_proc, 10);
674: End finance_lines_exist;
675: --
676: -- ----------------------------------------------------------------------------
677: -- |---------------------------< cancel_header >------------------------------|
701: v_proc varchar2(72) := g_package||'cancel_header';
702: --
703: Begin
704: --
705: hr_utility.set_location('Entering:'|| v_proc, 5);
706: --
707: -- * Finance Header has already been cancelled
708: --
709: If p_rec_finance.cancelled_flag = 'Y' Then
800: p_cancel_header_id := l_rec_cancel.finance_header_id;
801: --
802: End if;
803: --
804: hr_utility.set_location(' Leaving:'|| v_proc, 10);
805: --
806: End cancel_header;
807: --
808: -- ----------------------------------------------------------------------------
970: where finance_header_id = p_finance_header_id ;
971: --
972: Begin
973: --
974: hr_utility.set_location('Entering:'|| v_proc, 5);
975: --
976: If p_finance_header_id is NOT null Then
977: --
978: Open sel_finance_header;
999: if p_commit then
1000: commit;
1001: end if;
1002: --
1003: hr_utility.set_location(' Leaving:'|| v_proc, 10);
1004: --
1005: End cancel_header;
1006: --
1007: -- ----------------------------------------------------------------------------
1025: from ota_finance_headers tfh
1026: where tfh.superceding_header_id = p_finance_header_id;
1027: --
1028: Begin
1029: hr_utility.set_location('Entering:'|| v_proc, 5);
1030: --
1031: Open sel_for_deletion;
1032: Fetch sel_for_deletion into v_exists;
1033: --
1037: fnd_message.raise_error;
1038: End if;
1039: --
1040: close sel_for_deletion;
1041: hr_utility.set_location(' Leaving:'|| v_proc, 10);
1042: End check_superceding;
1043: --
1044: -- ----------------------------------------------------------------------------
1045: -- |--------------------------< recancel_header >-----------------------------|
1072: from ota_finance_headers tfh
1073: where tfh.finance_header_id = p_finance_header_id;
1074: --
1075: Begin
1076: hr_utility.set_location('Entering:'|| v_proc, 5);
1077: --
1078: If p_finance_header_id is NOT null Then
1079: Open sel_finance_header;
1080: Fetch sel_finance_header into v_rec_header;
1139: if p_commit then
1140: commit;
1141: end if;
1142: --
1143: hr_utility.set_location(' Leaving:'|| v_proc, 10);
1144: --
1145: End recancel_header;
1146: --
1147: --
1186: v_proc varchar2(72) := g_package||'check_cancellation_attributes';
1187: --
1188: Begin
1189: --
1190: hr_utility.set_location('Entering:'|| v_proc, 5);
1191: --
1192: If p_type = 'C' Then
1193: --
1194: If p_supersedes_header_id is null OR
1207: End if;
1208: --
1209: End If;
1210: --
1211: hr_utility.set_location(' Leaving:'|| v_proc, 10);
1212: --
1213: End check_cancellation_attributes;
1214: --
1215: -- ----------------------------------------------------------------------------
1236: where tfh.finance_header_id = p_superseding_header_id;
1237: --
1238: --
1239: Begin
1240: hr_utility.set_location('Entering:'|| v_proc, 5);
1241: --
1242: If p_finance_type = 'C' Then
1243: --
1244: If p_superseding_header_id is NOT null Then
1258: fnd_message.raise_error;
1259: End if;
1260: End if;
1261: --
1262: hr_utility.set_location(' Leaving:'|| v_proc, 10);
1263: End check_superseded_header;
1264: --
1265: -- ----------------------------------------------------------------------------
1266: -- |---------------------< check_update_customer_id >-------------------------|
1280: --
1281: v_proc varchar2(72) := g_package||'check_update_customer_id';
1282: --
1283: Begin
1284: hr_utility.set_location('Entering:'|| v_proc, 5);
1285: --
1286: If p_customer_id is NOT null AND p_vendor_id is NOT null Then
1287: fnd_message.set_name('OTA','OTA_13324_TFH_CUSTOMER_VENDOR');
1288: fnd_message.raise_error;
1305: fnd_message.set_name('OTA','OTA_13321_TFH_CUSTOMER_NAME');
1306: fnd_message.raise_error;
1307: End if;
1308: --
1309: hr_utility.set_location(' Leaving:'|| v_proc, 10);
1310: --
1311: End check_update_customer_id;
1312: --
1313: -- ----------------------------------------------------------------------------
1328: --
1329: v_proc varchar2(72) := g_package||'check_update_vendor_id';
1330: --
1331: Begin
1332: hr_utility.set_location('Entering:'|| v_proc, 5);
1333: --
1334: If p_vendor_id is NOT null AND p_customer_id is NOT null Then
1335: fnd_message.set_name('OTA','OTA_13324_TFH_CUSTOMER_VENDOR');
1336: fnd_message.raise_error;
1353: fnd_message.raise_error;
1354: End if;
1355: --
1356: --
1357: hr_utility.set_location(' Leaving:'|| v_proc, 10);
1358: --
1359: End check_update_vendor_id;
1360: --
1361: -- ----------------------------------------------------------------------------
1384: v_proc varchar2(72) := g_package||'cancel_and_recreate';
1385: --
1386: Begin
1387: --
1388: hr_utility.set_location('Entering:'|| v_proc, 5);
1389: --
1390: -- * Finance Header has already been cancelled
1391: --
1392: If p_rec_finance.cancelled_flag = 'Y' Then
1452: , P_date_raised => p_date_raised
1453: , P_validate => p_validate );
1454: End if;
1455: --
1456: hr_utility.set_location(' Leaving:'|| v_proc, 10);
1457: --
1458: End cancel_and_recreate;
1459: --
1460: -- ----------------------------------------------------------------------------
1624: where tfh.finance_header_id = p_finance_header_id;
1625: --
1626: Begin
1627: --
1628: hr_utility.set_location('Entering:'|| v_proc, 5);
1629: --
1630: If p_finance_header_id is NOT null then
1631: --
1632: --Concert the HEADER_ID into a record by selecting the full
1660: --
1661: if p_commit then
1662: commit;
1663: end if;
1664: hr_utility.set_location(' Leaving:'|| v_proc, 10);
1665: --
1666: End cancel_and_recreate;
1667: --
1668: -- ----------------------------------------------------------------------------
1681: v_proc varchar2(72) := g_package||'check_payment_method';
1682: --
1683: Begin
1684: --
1685: hr_utility.set_location('Entering:'|| v_proc, 5);
1686: --
1687: If p_payment_method is not null Then
1688: --
1689: ota_general.check_domain_value( 'PAYMENT_METHOD', p_payment_method);
1689: ota_general.check_domain_value( 'PAYMENT_METHOD', p_payment_method);
1690: --
1691: End If;
1692: --
1693: hr_utility.set_location(' Leaving:'|| v_proc, 10);
1694: --
1695: End check_payment_method;
1696: --
1697: -- ----------------------------------------------------------------------------
1712: v_proc varchar2(72) := g_package||'check_allow_transfer';
1713: --
1714: Begin
1715: --
1716: hr_utility.set_location('Entering:'|| v_proc, 5);
1717: --
1718: If p_transfer_status <> 'NT' Then
1719: --
1720: If p_payment_method is null Then
1724: End if;
1725: --
1726: End If;
1727: --
1728: hr_utility.set_location(' Leaving:'|| v_proc, 10);
1729: --
1730: End check_allow_transfer;
1731: --
1732: -- ----------------------------------------------------------------------------
1829: , p_rec_new.payment_status_flag );
1830: --
1831: Begin
1832: --
1833: hr_utility.set_location('Entering:'|| v_proc, 5);
1834: --
1835: If l_super_header_id_changed OR
1836: l_authorizer_person_id_changed OR
1837: l_organization_id_changed OR
1859: return false;
1860: --
1861: End if;
1862: --
1863: hr_utility.set_location(' Leaving:'|| v_proc, 10);
1864: --
1865: End check_update01_header;
1866: --
1867: -- ----------------------------------------------------------------------------
2048: , p_rec_new.tfh_information20 );
2049: --
2050: Begin
2051: --
2052: hr_utility.set_location('Entering:'|| v_proc, 5);
2053: --
2054: If l_pym_info_category_changed OR
2055: l_pym_attribute1_changed OR
2056: l_pym_attribute2_changed OR
2100: return false;
2101: --
2102: End if;
2103: --
2104: hr_utility.set_location(' Leaving:'|| v_proc, 10);
2105: --
2106: End check_update02_header;
2107: --
2108: -- ----------------------------------------------------------------------------
2125: v_proc varchar2(72) := g_package||'check_update_header';
2126: --
2127: Begin
2128: --
2129: hr_utility.set_location('Entering:'|| v_proc, 5);
2130: --
2131: if p_transaction_type = 'CANCEL_HEADER' or
2132: p_transaction_type = 'REINSTATE_HEADER' then
2133: --
2168: end if;
2169: end if;
2170: end if;
2171: --
2172: hr_utility.set_location(' Leaving:'|| v_proc, 10);
2173: --
2174: End check_update_header;
2175: --
2176: -- ----------------------------------------------------------------------------
2189: v_proc varchar2(72) := g_package||'check_payment_status_flag';
2190: --
2191: Begin
2192: --
2193: hr_utility.set_location('Entering:'|| v_proc, 5);
2194: --
2195: If NOT (p_flag in ('N', 'Y')) then
2196: --
2197: ota_tfh_api_shd.constraint_error( 'OTA_TFH_PAYMENT_STATUS_FLA_CHK');
2197: ota_tfh_api_shd.constraint_error( 'OTA_TFH_PAYMENT_STATUS_FLA_CHK');
2198: --
2199: End If;
2200: --
2201: hr_utility.set_location(' Leaving:'|| v_proc, 10);
2202: --
2203: End check_payment_status_flag;
2204: --
2205: -- ----------------------------------------------------------------------------
2218: v_proc varchar2(72) := g_package||'check_administrator';
2219: --
2220: Begin
2221: --
2222: hr_utility.set_location('Entering:'|| v_proc, 5);
2223: --
2224: If p_administrator is NOT null Then
2225: --
2226: if not ota_general.check_fnd_user(p_administrator) then
2228: fnd_message.raise_error;
2229: end if;
2230: End if;
2231: --
2232: hr_utility.set_location(' Leaving:'|| v_proc, 10);
2233: --
2234: End check_administrator;
2235: --
2236: -- ----------------------------------------------------------------------------
2259: where tfh.finance_header_id = p_finance_header_id;
2260: --
2261: Begin
2262: --
2263: hr_utility.set_location('Entering:'|| v_proc, 5);
2264: --
2265: If p_finance_header_id is NOT null Then
2266: --
2267: Open sel_for_deletion;
2288: End if;
2289: --
2290: End if;
2291: --
2292: hr_utility.set_location(' Leaving:'|| v_proc, 10);
2293: --
2294: End check_deletion_allowed_status;
2295: --
2296: -- ----------------------------------------------------------------------------
2315: where tfl.finance_header_id = p_finance_header_id;
2316: --
2317: Begin
2318: --
2319: hr_utility.set_location('Entering:'|| v_proc, 5);
2320: --
2321: Open sel_for_deletion;
2322: Fetch sel_for_deletion into v_exists;
2323: --
2331: End if;
2332: --
2333: close sel_for_deletion;
2334: --
2335: hr_utility.set_location(' Leaving:'|| v_proc, 10);
2336: --
2337: End check_deletion_childs;
2338: --
2339: -- ----------------------------------------------------------------------------
2354: v_proc varchar2(72) := g_package||'check_deletion';
2355: --
2356: Begin
2357: --
2358: hr_utility.set_location('Entering:'|| v_proc, 5);
2359: --
2360: If p_finance_header_id is NOT null Then
2361: --
2362: -- * Checks whether the Finance Header has Finance Lines
2385: End if;
2386: --
2387: End if;
2388: --
2389: hr_utility.set_location(' Leaving:'|| v_proc, 10);
2390: --
2391: End check_deletion;
2392: -- ----------------------------------------------------------------------------
2393: -- |------------------------------< organization_name> -----------------------|
2482: from ota_finance_headers
2483: where superceding_header_id = p_finance_header_id;
2484: --
2485: begin
2486: hr_utility.set_location('Entering:'|| v_proc, 5);
2487: hr_utility.trace('Header ID is '||to_char(p_finance_header_id));
2488: --
2489: open get_superseding_header;
2490: fetch get_superseding_header into l_dummy;
2483: where superceding_header_id = p_finance_header_id;
2484: --
2485: begin
2486: hr_utility.set_location('Entering:'|| v_proc, 5);
2487: hr_utility.trace('Header ID is '||to_char(p_finance_header_id));
2488: --
2489: open get_superseding_header;
2490: fetch get_superseding_header into l_dummy;
2491: if get_superseding_header%notfound then
2497: fnd_message.raise_error;
2498: --
2499: end if;
2500: --
2501: hr_utility.set_location('Entering:'|| v_proc, 5);
2502: end check_superseded;
2503: --
2504: end ota_tfh_api_business_rules;