1. DECLARE
  2. L_CR_ID NUMBER;
  3. L_ATTRIBUTE_REC AR_RECEIPT_API_PUB.ATTRIBUTE_REC_TYPE;
  4. L_GLOBAL_ATT_REC AR_RECEIPT_API_PUB.global_attribute_rec_type;
  5.  
  6. L_RETURN_STATUS VARCHAR2(100);
  7. L_MSG_COUNT NUMBER;
  8. L_MSG_DATA VARCHAR2(2000);
  9.  
  10. I NUMBER;
  11. L_MESSAGE_LIST VARCHAR2(1000);
  12. L_MSG_INDEX_OUT NUMBER;
  13. BEGIN
  14. FND_GLOBAL.APPS_INITIALIZE(USER_ID => 1111,
  15. RESP_ID => 50737 ,
  16. RESP_APPL_ID => 50737);
  17. mo_global.set_policy_context('S', 142);
  18.  
  19. AR_RECEIPT_API_PUB.REVERSE(
  20. P_API_VERSION => 1.0,
  21. P_COMMIT => 'F',
  22. P_VALIDATION_LEVEL => 100,
  23. P_CASH_RECEIPT_ID => 1000,
  24. P_REVERSAL_DATE => fnd_conc_date.string_to_date('2017-03-31'),
  25. P_REVERSAL_GL_DATE => fnd_conc_date.string_to_date('2017-03-31'),
  26. P_REVERSAL_CATEGORY_CODE => 'REV',
  27. P_REVERSAL_REASON_CODE => 'PAYMENT REVERSAL',
  28. P_REVERSAL_COMMENTS => 'TEST',
  29. X_RETURN_STATUS => L_RETURN_STATUS,
  30. X_MSG_COUNT => L_MSG_COUNT,
  31. X_MSG_DATA => L_MSG_DATA);
  32. IF L_RETURN_STATUS <> FND_API.G_RET_STS_SUCCESS THEN
  33. FOR I IN 1..L_MSG_COUNT LOOP
  34. FND_MSG_PUB.GET(P_MSG_INDEX => I
  35. ,P_DATA => L_MESSAGE_LIST
  36. ,P_MSG_INDEX_OUT => L_MSG_INDEX_OUT);
  37. DBMS_OUTPUT.PUT_LINE(L_MESSAGE_LIST);
  38. END LOOP;
  39. ELSE
  40. DBMS_OUTPUT.PUT_LINE(L_CR_ID);
  41. DBMS_OUTPUT.PUT_LINE(L_RETURN_STATUS);
  42. DBMS_OUTPUT.PUT_LINE('L_MSG_DATA '||L_MSG_DATA);
  43. END IF;
  44. END;
  1. --set serveroutput on size 1000000
  2.  
  3. DECLARE
  4.  
  5. l_return_status VARCHAR2(1);
  6. l_msg_count NUMBER;
  7. l_msg_data VARCHAR2(240);
  8. l_cash_receipt_id NUMBER;
  9. p_count number := 0;
  10.  
  11. BEGIN
  12.  
  13. -- 1) Set the applications context
  14. fnd_global.apps_initialize(1011902, 50559, 222,0);
  15. mo_global.init('AR');
  16. mo_global.set_policy_context('S','204');
  17.  
  18. -- 2) Call the API
  19. AR_RECEIPT_API_PUB.CREATE_CASH
  20. ( p_api_version => 1.0,
  21. p_init_msg_list => FND_API.G_TRUE,
  22. p_commit => FND_API.G_TRUE,
  23. p_validation_level => FND_API.G_VALID_LEVEL_FULL,
  24. x_return_status => l_return_status,
  25. x_msg_count => l_msg_count,
  26. x_msg_data => l_msg_data,
  27. p_currency_code => 'USD',
  28. p_amount => 1005.65,
  29. p_receipt_number => 'rct-api1',
  30. p_receipt_date => '22-JUL-2011',
  31. p_gl_date => '22-JUL-2011',
  32. p_customer_number => '1007',
  33. p_receipt_method_id => 1001,
  34. p_cr_id => l_cash_receipt_id );
  35.  
  36. -- 3) Review the API output
  37. dbms_output.put_line('Status ' || l_return_status);
  38. dbms_output.put_line('Cash Receipt id ' || l_cash_receipt_id );
  39. dbms_output.put_line('Message count ' || l_msg_count);
  40.  
  41. if l_msg_count = 1 Then
  42. dbms_output.put_line('l_msg_data '||l_msg_data);
  43. elsif l_msg_count > 1 Then
  44. loop
  45. p_count := p_count + 1;
  46. l_msg_data := FND_MSG_PUB.Get(FND_MSG_PUB.G_NEXT,FND_API.G_FALSE);
  47. if l_msg_data is NULL then
  48. exit;
  49. end if;
  50. dbms_output.put_line('Message ' || p_count ||'. '||l_msg_data);
  51. end loop;
  52. end if;
  53. END;
  54. /
  55.  
  56. --set serveroutput on size 1000000
  57.  
  58. DECLARE
  59. l_return_status varchar2(1);
  60. l_msg_count number;
  61. l_msg_data varchar2(240);
  62. p_count number :=0;
  63.  
  64. BEGIN
  65.  
  66. -- 1) Set the applications context
  67. fnd_global.apps_initialize(1011902, 50559, 222,0);
  68. mo_global.init('AR');
  69. mo_global.set_policy_context('S','204');
  70.  
  71. -- 2) Call the API
  72. AR_RECEIPT_API_PUB.APPLY
  73. ( p_api_version => 1.0,
  74. p_init_msg_list => FND_API.G_TRUE,
  75. p_commit => FND_API.G_TRUE,
  76. p_validation_level => FND_API.G_VALID_LEVEL_FULL,
  77. p_cash_receipt_id => 83989,
  78. p_customer_trx_id => 527928,
  79. x_return_status => l_return_status,
  80. x_msg_count => l_msg_count,
  81. x_msg_data => l_msg_data);
  82.  
  83. -- 3) Review the API output
  84. dbms_output.put_line('Status ' || l_return_status);
  85. dbms_output.put_line('Message count ' || l_msg_count);
  86.  
  87. if l_msg_count = 1 Then
  88. dbms_output.put_line('l_msg_data '|| l_msg_data);
  89. elsif l_msg_count > 1 Then
  90. loop
  91. p_count := p_count + 1;
  92. l_msg_data := FND_MSG_PUB.Get(FND_MSG_PUB.G_NEXT,FND_API.G_FALSE);
  93. if l_msg_data is NULL Then
  94. exit;
  95. end if;
  96. dbms_output.put_line('Message ' || p_count ||'. '||l_msg_data);
  97. end loop;
  98. end if;
  99. end;
  100. /
  101.  
  102. set serveroutput on size 1000000
  103.  
  104. DECLARE
  105. l_return_status VARCHAR2(1);
  106. l_msg_count NUMBER;
  107. l_msg_data VARCHAR2(240);
  108. l_cash_receipt_id NUMBER;
  109. p_count number := 0;
  110.  
  111. BEGIN
  112. -- 1) Set the applications context
  113. fnd_global.apps_initialize(1011902, 50559, 222,0);
  114. mo_global.init('AR');
  115. mo_global.set_policy_context('S','204');
  116.  
  117. AR_RECEIPT_API_PUB.create_and_apply
  118. ( p_api_version => 1.0,
  119. p_init_msg_list => FND_API.G_TRUE,
  120. p_commit => FND_API.G_TRUE,
  121. p_validation_level => FND_API.G_VALID_LEVEL_FULL,
  122. x_return_status => l_return_status,
  123. x_msg_count => l_msg_count,
  124. x_msg_data => l_msg_data,
  125. p_amount => 2000.00,
  126. p_receipt_number => 'rct-api2',
  127. p_receipt_date => '22-JUL-2011',
  128. p_gl_date => '22-JUL-2011',
  129. p_customer_number => 1007,
  130. p_receipt_method_id => 1001,
  131. p_trx_number => '102317',
  132. p_cr_id => l_cash_receipt_id );
  133.  
  134. -- 3) Review the API output
  135. dbms_output.put_line('Status ' || l_return_status);
  136. dbms_output.put_line('Message count ' || l_msg_count);
  137. dbms_output.put_line('Cash Receipt ID ' || l_cash_receipt_id );
  138.  
  139. if l_msg_count = 1 Then
  140. dbms_output.put_line('l_msg_data '|| l_msg_data);
  141. elsif l_msg_count > 1 Then
  142. loop
  143. p_count := p_count + 1;
  144. l_msg_data := FND_MSG_PUB.Get(FND_MSG_PUB.G_NEXT,FND_API.G_FALSE);
  145. if l_msg_data is NULL Then
  146. exit;
  147. end if;
  148. dbms_output.put_line('Message ' || p_count ||'. '||l_msg_data);
  149. end loop;
  150. end if;
  151. END;
  152. /
  153.  
  154. DECLARE
  155. l_return_status VARCHAR2(1);
  156. l_msg_count NUMBER;
  157. l_msg_data VARCHAR2(240);
  158. p_count number := 0;
  159. BEGIN
  160. -- 1) Set the applications context
  161. fnd_global.apps_initialize(1011902, 50559, 222,0);
  162. mo_global.init('AR');
  163. mo_global.set_policy_context('S','204');
  164.  
  165. AR_RECEIPT_API_PUB.UNAPPLY
  166. ( p_api_version => 1.0,
  167. p_init_msg_list => FND_API.G_TRUE,
  168. p_commit => FND_API.G_TRUE,
  169. p_validation_level => FND_API.G_VALID_LEVEL_FULL,
  170. x_return_status => l_return_status,
  171. x_msg_count => l_msg_count,
  172. x_msg_data => l_msg_data,
  173. p_cash_receipt_id => 83989,
  174. p_applied_payment_schedule_id => 182804,
  175. p_reversal_gl_date => '23-JUL-2011'
  176. );
  177.  
  178. -- 3) Review the API output
  179. dbms_output.put_line('Status ' || l_return_status);
  180. dbms_output.put_line('Message count ' || l_msg_count);
  181.  
  182. if l_msg_count = 1 Then
  183. dbms_output.put_line('l_msg_data '|| l_msg_data);
  184. elsif l_msg_count > 1 Then
  185. loop
  186. p_count := p_count + 1;
  187. l_msg_data := FND_MSG_PUB.Get(FND_MSG_PUB.G_NEXT,FND_API.G_FALSE);
  188. if l_msg_data is NULL Then
  189. exit;
  190. end if;
  191. dbms_output.put_line('Message ' || p_count ||'. '||l_msg_data);
  192. end loop;
  193. end if;
  194. END;
  195. /
  196.  
  197. --set serveroutput on size 1000000
  198.  
  199. DECLARE
  200. l_return_status VARCHAR2(1);
  201. l_msg_count NUMBER;
  202. l_msg_data VARCHAR2(240);
  203. l_cash_receipt_id NUMBER;
  204. p_count number := 0;
  205. BEGIN
  206. -- 1) Set the applications context
  207. fnd_global.apps_initialize(1011902, 50559, 222,0);
  208. mo_global.init('AR');
  209. mo_global.set_policy_context('S','204');
  210.  
  211. AR_RECEIPT_API_PUB.APPLY_ON_ACCOUNT
  212. ( p_api_version => 1.0,
  213. p_init_msg_list => FND_API.G_TRUE,
  214. p_commit => FND_API.G_TRUE,
  215. p_validation_level => FND_API.G_VALID_LEVEL_FULL,
  216. x_return_status => l_return_status,
  217. x_msg_count => l_msg_count,
  218. x_msg_data => l_msg_data,
  219. p_cash_receipt_id => 83992);
  220.  
  221. -- 3) Review the API output
  222. dbms_output.put_line('Status ' || l_return_status);
  223. dbms_output.put_line('Message count ' || l_msg_count);
  224.  
  225. if l_msg_count = 1 Then
  226. dbms_output.put_line('l_msg_data '|| l_msg_data);
  227. elsif l_msg_count > 1 Then
  228. loop
  229. p_count := p_count + 1;
  230. l_msg_data := FND_MSG_PUB.Get(FND_MSG_PUB.G_NEXT,FND_API.G_FALSE);
  231. if l_msg_data is NULL Then
  232. exit;
  233. end if;
  234. dbms_output.put_line('Message ' || p_count ||'. '||l_msg_data);
  235. end loop;
  236. end if;
  237. END;
  238. /
  239.  
  240. --set serveroutput on size 1000000
  241.  
  242. DECLARE
  243. l_return_status VARCHAR2(1);
  244. l_msg_count NUMBER;
  245. l_msg_data VARCHAR2(240);
  246. l_cash_receipt_id NUMBER;
  247. p_count number := 0;
  248. BEGIN
  249. -- 1) Set the applications context
  250. fnd_global.apps_initialize(1011902, 50559, 222,0);
  251. mo_global.init('AR');
  252. mo_global.set_policy_context('S','204');
  253.  
  254. AR_RECEIPT_API_PUB.UNAPPLY_ON_ACCOUNT
  255. ( p_api_version => 1.0,
  256. p_init_msg_list => FND_API.G_TRUE,
  257. p_commit => FND_API.G_TRUE,
  258. p_validation_level => FND_API.G_VALID_LEVEL_FULL,
  259. x_return_status => l_return_status,
  260. x_msg_count => l_msg_count,
  261. x_msg_data => l_msg_data,
  262. p_cash_receipt_id => 83992,
  263. P_reversal_gl_date => '23-JUL-2011');
  264.  
  265. -- 3) Review the API output
  266. dbms_output.put_line('Status ' || l_return_status);
  267. dbms_output.put_line('Message count ' || l_msg_count);
  268.  
  269. if l_msg_count = 1 Then
  270. dbms_output.put_line('l_msg_data '|| l_msg_data);
  271. elsif l_msg_count > 1 Then
  272. loop
  273. p_count := p_count + 1;
  274. l_msg_data := FND_MSG_PUB.Get(FND_MSG_PUB.G_NEXT,FND_API.G_FALSE);
  275. if l_msg_data is NULL Then
  276. exit;
  277. end if;
  278. dbms_output.put_line('Message ' || p_count ||'. '||l_msg_data);
  279. end loop;
  280. end if;
  281. END;
  282. /
  283.  
  284. --set serveroutput on size 1000000
  285.  
  286. DECLARE
  287. l_return_status VARCHAR2(1);
  288. l_msg_count NUMBER;
  289. l_msg_data VARCHAR2(240);
  290. l_cash_receipt_id NUMBER;
  291. p_count number := 0;
  292. BEGIN
  293. -- 1) Set the applications context
  294. fnd_global.apps_initialize(1011902, 50559, 222,0);
  295. mo_global.init('AR');
  296. mo_global.set_policy_context('S','204');
  297.  
  298. AR_RECEIPT_API_PUB.reverse
  299. ( p_api_version => 1.0,
  300. p_init_msg_list => FND_API.G_TRUE,
  301. p_commit => FND_API.G_TRUE,
  302. p_validation_level => FND_API.G_VALID_LEVEL_FULL,
  303. x_return_status => l_return_status,
  304. x_msg_count => l_msg_count,
  305. x_msg_data => l_msg_data,
  306. p_cash_receipt_id => 83993,
  307. p_reversal_category_code => 'REV',
  308. p_reversal_reason_code => 'WRONG INVOICE');
  309.  
  310. -- 3) Review the API output
  311. dbms_output.put_line('Status ' || l_return_status);
  312. dbms_output.put_line('Message count ' || l_msg_count);
  313.  
  314. if l_msg_count = 1 Then
  315. dbms_output.put_line('l_msg_data '|| l_msg_data);
  316. elsif l_msg_count > 1 Then
  317. loop
  318. p_count := p_count + 1;
  319. l_msg_data := FND_MSG_PUB.Get(FND_MSG_PUB.G_NEXT,FND_API.G_FALSE);
  320. if l_msg_data is NULL Then
  321. exit;
  322. end if;
  323. dbms_output.put_line('Message ' || p_count ||'. '||l_msg_data);
  324. end loop;
  325. end if;
  326. END;
  327. /
  328.  
  329. --set serveroutput on size 1000000
  330.  
  331. DECLARE
  332. l_return_status VARCHAR2(1);
  333. l_msg_count NUMBER;
  334. l_msg_data VARCHAR2(240);
  335. l_cash_receipt_id NUMBER;
  336. p_count number := 0;
  337. l_application_ref_type ar_receivable_applications.application_ref_type%TYPE;
  338. l_application_ref_id ar_receivable_applications.application_ref_id%TYPE;
  339. l_application_ref_num ar_receivable_applications.application_ref_num%TYPE;
  340. l_secondary_application_ref_id ar_receivable_applications.secondary_application_ref_id%TYPE;
  341. l_receivable_application_id ar_receivable_applications.receivable_application_id%TYPE;
  342.  
  343. BEGIN
  344. -- 1) Set the applications context
  345. fnd_global.apps_initialize(1011902, 50559, 222,0);
  346. mo_global.init('AR');
  347. mo_global.set_policy_context('S','204');
  348.  
  349. AR_RECEIPT_API_PUB.ACTIVITY_APPLICATION
  350. ( p_api_version => 1.0,
  351. p_init_msg_list => FND_API.G_TRUE,
  352. p_commit => FND_API.G_TRUE,
  353. p_validation_level => FND_API.G_VALID_LEVEL_FULL,
  354. x_return_status => l_return_status,
  355. x_msg_count => l_msg_count,
  356. x_msg_data => l_msg_data,
  357. p_cash_receipt_id => 83994,
  358. p_applied_payment_schedule_id => -3,
  359. p_receivables_trx_id => 2536,
  360. p_receivable_application_id => l_receivable_application_id
  361. p_application_ref_type => l_application_ref_type,
  362. p_application_ref_id => l_application_ref_id,
  363. p_application_ref_num => l_application_ref_num,
  364. p_secondary_application_ref_id => l_secondary_application_ref_id);
  365.  
  366. -- 3) Review the API output
  367. dbms_output.put_line('Status ' || l_return_status);
  368. dbms_output.put_line('Message count ' || l_msg_count);
  369. dbms_output.put_line('Application ID ' || l_receivable_application_id;
  370.  
  371. if l_msg_count = 1 Then
  372. dbms_output.put_line('l_msg_data '|| l_msg_data);
  373. elsif l_msg_count > 1 Then
  374. loop
  375. p_count := p_count + 1;
  376. l_msg_data := FND_MSG_PUB.Get(FND_MSG_PUB.G_NEXT,FND_API.G_FALSE);
  377. if l_msg_data is NULL Then
  378. exit;
  379. end if;
  380. dbms_output.put_line('Message ' || p_count ||'. '||l_msg_data);
  381. end loop;
  382. end if;
  383. END;
  384. /
  385.  
  386. --set serveroutput on size 1000000
  387.  
  388. DECLARE
  389. l_return_status VARCHAR2(1);
  390. l_msg_count NUMBER;
  391. l_msg_data VARCHAR2(240);
  392. l_cash_receipt_id NUMBER;
  393. p_count number := 0;
  394. l_receipt_number varchar(10);
  395.  
  396. BEGIN
  397. -- 1) Set the applications context
  398. fnd_global.apps_initialize(1011902, 50559, 222,0);
  399. mo_global.init('AR');
  400. mo_global.set_policy_context('S','204');
  401.  
  402. l_receipt_number := 'misc-api1';
  403.  
  404. AR_RECEIPT_API_PUB.CREATE_MISC
  405. ( p_api_version => 1.0,
  406. p_init_msg_list => FND_API.G_TRUE,
  407. p_commit => FND_API.G_TRUE,
  408. p_validation_level => FND_API.G_VALID_LEVEL_FULL,
  409. x_return_status => l_return_status,
  410. x_msg_count => l_msg_count,
  411. x_msg_data => l_msg_data,
  412. p_amount => 4560.00,
  413. p_receipt_date => '22-JUL-2011',
  414. p_gl_date => '22-JUL-2011',
  415. p_receipt_method_id => 1001,
  416. p_activity => 'Interest Income',
  417. p_misc_receipt_id => l_cash_receipt_id ,
  418. p_receipt_number => l_receipt_number);
  419.  
  420. -- 3) Review the API output
  421. dbms_output.put_line('Status ' || l_return_status);
  422. dbms_output.put_line('Message count ' || l_msg_count);
  423. dbms_output.put_line('Cash Receipt ID ' || l_cash_receipt_id );
  424.  
  425. if l_msg_count = 1 Then
  426. dbms_output.put_line('l_msg_data '|| l_msg_data);
  427. elsif l_msg_count > 1 Then
  428. loop
  429. p_count := p_count + 1;
  430. l_msg_data := FND_MSG_PUB.Get(FND_MSG_PUB.G_NEXT,FND_API.G_FALSE);
  431. if l_msg_data is NULL Then
  432. exit;
  433. end if;
  434. dbms_output.put_line('Message ' || p_count ||'. '||l_msg_data);
  435. end loop;
  436. end if;
  437. END;
  438. /
  439.  
  440. -- set serveroutput on size 1000000
  441.  
  442. DECLARE
  443. l_return_status VARCHAR2(1);
  444. l_msg_count NUMBER;
  445. l_msg_data VARCHAR2(240);
  446. p_count NUMBER;
  447. x_receivable_application_id NUMBER;
  448. x_application_ref_id NUMBER;
  449. x_application_ref_num VARCHAR2(30);
  450. x_secondary_application_ref_id NUMBER;
  451.  
  452. BEGIN
  453. -- 1) Set the applications context
  454. fnd_global.apps_initialize(1011902, 50559, 222,0);
  455. mo_global.init('AR');
  456. mo_global.set_policy_context('S','204');
  457. -- 2) Call the API
  458. AR_RECEIPT_API_PUB.apply_other_account
  459. ( p_api_version => 1.0,
  460. p_init_msg_list => FND_API.G_TRUE,
  461. p_commit => FND_API.G_TRUE,
  462. p_validation_level => FND_API.G_VALID_LEVEL_FULL,
  463. x_return_status => l_return_status,
  464. x_msg_count => l_msg_count,
  465. x_msg_data => l_msg_data,
  466. p_receivable_application_id => x_receivable_application_id,
  467. p_cash_receipt_id => 83997,
  468. p_receivables_trx_id => 1747,
  469. p_applied_payment_schedule_id => -4,
  470. p_amount_applied => 500.00,
  471. p_application_ref_id => x_application_ref_id,
  472. p_application_ref_num => x_application_ref_num,
  473. p_secondary_application_ref_id => x_secondary_application_ref_id,
  474. p_called_from => null);
  475.  
  476. -- 3) Review the API output
  477. dbms_output.put_line('Status ' || l_return_status);
  478. dbms_output.put_line('Message count ' || l_msg_count);
  479. dbms_output.put_line('Receivable Application Id ' || x_receivable_application_id);
  480.  
  481. if l_msg_count = 1 Then
  482. dbms_output.put_line('l_msg_data '|| l_msg_data);
  483. elsif l_msg_count > 1 Then
  484. loop
  485. p_count := p_count + 1;
  486. l_msg_data := FND_MSG_PUB.Get(FND_MSG_PUB.G_NEXT,FND_API.G_FALSE);
  487. if l_msg_data is NULL Then
  488. exit;
  489. end if;
  490. dbms_output.put_line('Message ' || p_count ||'. '||l_msg_data);
  491. end loop;
  492. end if;
  493. END;
  494. /
  495.  
  496. -- Note that several parameters are similar to those
  497.  
  498. --set serveroutput on size 1000000
  499.  
  500. DECLARE
  501. l_return_status VARCHAR2(1);
  502. l_msg_count NUMBER;
  503. l_msg_data VARCHAR2(240);
  504. p_count NUMBER;
  505. x_receivable_application_id NUMBER;
  506. x_application_ref_id NUMBER;
  507. x_application_ref_num VARCHAR2(30);
  508. x_secondary_application_ref_id NUMBER;
  509.  
  510. BEGIN
  511. -- 1) Set the applications context
  512. fnd_global.apps_initialize(1011902, 50559, 222,0);
  513. mo_global.init('AR');
  514. mo_global.set_policy_context('S','204');
  515. -- 2) Call the API
  516. AR_RECEIPT_API_PUB.apply_other_account
  517. ( p_api_version => 1.0,
  518. p_init_msg_list => FND_API.G_TRUE,
  519. p_commit => FND_API.G_TRUE,
  520. p_validation_level => FND_API.G_VALID_LEVEL_FULL,
  521. x_return_status => l_return_status,
  522. x_msg_count => l_msg_count,
  523. x_msg_data => l_msg_data,
  524. p_receivable_application_id => x_receivable_application_id,
  525. p_cash_receipt_id => 83997,
  526. p_receivables_trx_id => 1747,
  527. p_applied_payment_schedule_id => -4,
  528. p_amount_applied => 500.00,
  529. p_application_ref_id => x_application_ref_id,
  530. p_application_ref_num => x_application_ref_num,
  531. p_secondary_application_ref_id => x_secondary_application_ref_id,
  532. p_called_from => null);
  533.  
  534. -- 3) Review the API output
  535. dbms_output.put_line('Status ' || l_return_status);
  536. dbms_output.put_line('Message count ' || l_msg_count);
  537. dbms_output.put_line('Receivable Application Id ' || x_receivable_application_id);
  538.  
  539. if l_msg_count = 1 Then
  540. dbms_output.put_line('l_msg_data '|| l_msg_data);
  541. elsif l_msg_count > 1 Then
  542. loop
  543. p_count := p_count + 1;
  544. l_msg_data := FND_MSG_PUB.Get(FND_MSG_PUB.G_NEXT,FND_API.G_FALSE);
  545. if l_msg_data is NULL Then
  546. exit;
  547. end if;
  548. dbms_output.put_line('Message ' || p_count ||'. '||l_msg_data);
  549. end loop;
  550. end if;
  551. END;
  552. /
  553.  
  554. --set serveroutput on size 1000000
  555.  
  556. DECLARE
  557. l_return_status VARCHAR2(1);
  558. l_msg_count NUMBER;
  559. l_msg_data VARCHAR2(240);
  560. p_count number := 0;
  561.  
  562. BEGIN
  563. -- 1) Set the applications context
  564. fnd_global.apps_initialize(1011902, 50559, 222,0);
  565. mo_global.init('AR');
  566. mo_global.set_policy_context('S','204');
  567.  
  568. AR_RECEIPT_API_PUB.UNAPPLY_OTHER_ACCOUNT
  569. ( p_api_version => 1.0,
  570. p_init_msg_list => FND_API.G_TRUE,
  571. p_commit => FND_API.G_TRUE,
  572. p_validation_level => FND_API.G_VALID_LEVEL_FULL,
  573. x_return_status => l_return_status,
  574. x_msg_count => l_msg_count,
  575. x_msg_data => l_msg_data,
  576. p_cash_receipt_id => 83997,
  577. p_reversal_gl_date => '26-SEP-2011',
  578. p_receivable_application_id => 285776,
  579. p_cancel_claim_flag => 'Y',
  580. p_called_from => NULL);
  581.  
  582. -- 3) Review the API output
  583. dbms_output.put_line('Status ' || l_return_status);
  584. dbms_output.put_line('Message count ' || l_msg_count);
  585.  
  586. if l_msg_count = 1 Then
  587. dbms_output.put_line('l_msg_data '|| l_msg_data);
  588. elsif l_msg_count > 1 Then
  589. loop
  590. p_count := p_count + 1;
  591. l_msg_data := FND_MSG_PUB.Get(FND_MSG_PUB.G_NEXT,FND_API.G_FALSE);
  592. if l_msg_data is NULL Then
  593. exit;
  594. end if;
  595. dbms_output.put_line('Message ' || p_count ||'. '||l_msg_data);
  596. end loop;
  597. end if;
  598. END;
  599. /
  600.  
  601. --set serveroutput on size 1000000
  602.  
  603. DECLARE
  604. l_return_status VARCHAR2(1);
  605. l_msg_count NUMBER;
  606. l_msg_data VARCHAR2(240);
  607. p_count number := 0;
  608. l_application_ref_num VARCHAR2(30);
  609. l_receivable_application_id NUMBER;
  610. l_applied_rec_app_id NUMBER;
  611. l_acctd_amount_applied_from NUMBER;
  612. l_acctd_amount_applied_to VARCHAR2(30);
  613. BEGIN
  614. -- 1) Set the applications context
  615. fnd_global.apps_initialize(1011902, 50559, 222,0);
  616. mo_global.init('AR');
  617. mo_global.set_policy_context('S','204');
  618.  
  619. AR_RECEIPT_API_PUB.APPLY_OPEN_RECEIPT
  620. ( p_api_version => 1.0,
  621. p_init_msg_list => FND_API.G_TRUE,
  622. p_commit => FND_API.G_TRUE,
  623. p_validation_level => FND_API.G_VALID_LEVEL_FULL,
  624. x_return_status => l_return_status,
  625. x_msg_count => l_msg_count,
  626. x_msg_data => l_msg_data,
  627. p_amount_applied => -20.00,
  628. p_receipt_number => 'rct-api11',
  629. p_open_receipt_number => 'rct-api10',
  630. x_application_ref_num => l_application_ref_num,
  631. x_receivable_application_id => l_receivable_application_id,
  632. x_applied_rec_app_id => l_applied_rec_app_id,
  633. x_acctd_amount_applied_from => l_acctd_amount_applied_from,
  634. x_acctd_amount_applied_to => l_acctd_amount_applied_to);
  635.  
  636. -- 3) Review the API output
  637. dbms_output.put_line('Status ' || l_return_status);
  638. dbms_output.put_line('Message count ' || l_msg_count);
  639. dbms_output.put_line('Receivable Application Id ' || l_receivable_application_id);
  640.  
  641. if l_msg_count = 1 Then
  642. dbms_output.put_line('l_msg_data '|| l_msg_data);
  643. elsif l_msg_count > 1 Then
  644. loop
  645. p_count := p_count + 1;
  646. l_msg_data := FND_MSG_PUB.Get(FND_MSG_PUB.G_NEXT,FND_API.G_FALSE);
  647. if l_msg_data is NULL Then
  648. exit;
  649. end if;
  650. dbms_output.put_line('Message ' || p_count ||'. '||l_msg_data);
  651. end loop;
  652. end if;
  653. END;
  654. /
  655.  
  656. --set serveroutput on size 1000000
  657.  
  658. DECLARE
  659. l_return_status VARCHAR2(1);
  660. l_msg_count NUMBER;
  661. l_msg_data VARCHAR2(240);
  662. l_cash_receipt_id NUMBER;
  663. p_count number := 0;
  664.  
  665. BEGIN
  666. -- 1) Set the applications context
  667. fnd_global.apps_initialize(1011902, 50559, 222,0);
  668. mo_global.init('AR');
  669. mo_global.set_policy_context('S','204');
  670.  
  671. AR_RECEIPT_API_PUB.CREATE_APPLY_ON_ACC
  672. ( p_api_version => 1.0,
  673. p_init_msg_list => FND_API.G_TRUE,
  674. p_commit => FND_API.G_TRUE,
  675. p_validation_level => FND_API.G_VALID_LEVEL_FULL,
  676. x_return_status => l_return_status,
  677. x_msg_count => l_msg_count,
  678. x_msg_data => l_msg_data,
  679. p_amount => 555.00,
  680. p_receipt_number => 'rct-api12',
  681. p_receipt_date => '22-JUL-2011',
  682. p_gl_date => '22-JUL-2011',
  683. p_customer_number => 1007,
  684. p_receipt_method_id => 1001,
  685. p_cr_id => l_cash_receipt_id );
  686.  
  687. -- 3) Review the API output
  688. dbms_output.put_line('Status ' || l_return_status);
  689. dbms_output.put_line('Message count ' || l_msg_count);
  690. dbms_output.put_line('Cash Receipt Id ' || l_cash_receipt_id);
  691.  
  692. if l_msg_count = 1 Then
  693. dbms_output.put_line('l_msg_data '|| l_msg_data);
  694. elsif l_msg_count > 1 Then
  695. loop
  696. p_count := p_count + 1;
  697. l_msg_data := FND_MSG_PUB.Get(FND_MSG_PUB.G_NEXT,FND_API.G_FALSE);
  698. if l_msg_data is NULL Then
  699. exit;
  700. end if;
  701. dbms_output.put_line('Message ' || p_count ||'. '||l_msg_data);
  702. end loop;
  703. end if;
  704. END;
  705. /
  706.  
  707. --set serveroutput on size 1000000
  708.  
  709. DECLARE
  710. cursor c1 is
  711. select line.customer_trx_line_id,
  712. line.line_number,
  713. line.extended_amount line_amount,
  714. tax.extended_amount tax_amount
  715. from ra_customer_trx_lines line,
  716. (select link_to_cust_trx_line_id,
  717. sum(nvl(extended_amount,0)) extended_amount
  718. from ra_customer_trx_lines
  719. where customer_trx_id = 528349
  720. and line_type = 'TAX'
  721. group by link_to_cust_trx_line_id) tax
  722. where line.customer_trx_id = 528349
  723. and line.line_type = 'LINE'
  724. and line.customer_trx_line_id = tax.LINK_TO_CUST_TRX_LINE_ID(+);
  725.  
  726. l_llca_trx_lines_tbl ar_receipt_api_pub.llca_trx_lines_tbl_type;
  727. l_return_status VARCHAR2(1);
  728. l_msg_count NUMBER;
  729. l_msg_data VARCHAR2(240);
  730. p_count NUMBER := 0;
  731. l_cnt NUMBER := 0;
  732.  
  733. BEGIN
  734. -- 1) Set the applications context
  735. fnd_global.apps_initialize(1011902, 50559, 222,0);
  736. mo_global.init('AR');
  737. mo_global.set_policy_context('S','204');
  738.  
  739. -- 2) define the amounts to apply, for illustration purposes we will apply 10% of the original amounts
  740. for i in c1 loop
  741. l_cnt := l_cnt + 1;
  742.  
  743. l_llca_trx_lines_tbl(l_cnt).customer_trx_line_id := i.customer_trx_line_id ;
  744. l_llca_trx_lines_tbl(l_cnt).line_amount := i.line_amount * .10;
  745. l_llca_trx_lines_tbl(l_cnt).amount_applied := i.line_amount * .10;
  746. l_llca_trx_lines_tbl(l_cnt).tax_amount := i.tax_amount *.10;
  747. end loop;
  748.  
  749. AR_RECEIPT_API_PUB.APPLY_IN_DETAIL
  750. ( p_api_version => 1.0,
  751. p_init_msg_list => FND_API.G_TRUE,
  752. p_commit => FND_API.G_TRUE,
  753. p_validation_level => FND_API.G_VALID_LEVEL_FULL,
  754. x_return_status => l_return_status,
  755. x_msg_count => l_msg_count,
  756. x_msg_data => l_msg_data,
  757. p_cash_receipt_id => 84003,
  758. p_customer_trx_id => 528349,
  759. p_llca_type => 'L',
  760. p_org_id => 204,
  761. p_llca_trx_lines_tbl => l_llca_trx_lines_tbl );
  762.  
  763. if l_msg_count = 1 Then
  764. dbms_output.put_line('l_msg_data '|| l_msg_data);
  765. elsif l_msg_count > 1 Then
  766. loop
  767. p_count := p_count + 1;
  768. l_msg_data := FND_MSG_PUB.Get(FND_MSG_PUB.G_NEXT,FND_API.G_FALSE);
  769. if l_msg_data is NULL Then
  770. exit;
  771. end if;
  772. dbms_output.put_line('Message ' || p_count ||'. '||l_msg_data);
  773. end loop;
  774. end if;
  775. END;
  776. /
  777.  
  778. --set serveroutput on size 1000000
  779.  
  780. DECLARE
  781. l_count NUMBER;
  782. l_return_status VARCHAR2(1);
  783. l_msg_count NUMBER;
  784. l_msg_data VARCHAR2(240);
  785. l_status VARCHAR2(1);
  786. p_count number := 0;
  787.  
  788. BEGIN
  789. fnd_global.apps_initialize(1011902, 50559, 222,0);
  790. mo_global.init('AR');
  791. mo_global.set_policy_context('S','204');
  792.  
  793. AR_RECEIPT_UPDATE_API_PUB.UPDATE_RECEIPT_UNID_TO_UNAPP
  794. (p_api_version => 1.0,
  795. p_init_msg_list => FND_API.G_TRUE,
  796. p_commit => FND_API.G_TRUE,
  797. p_validation_level => FND_API.G_VALID_LEVEL_FULL,
  798. x_return_status => l_return_status,
  799. x_msg_count => l_msg_count,
  800. x_msg_data => l_msg_data,
  801. p_cash_receipt_id => 177018,
  802. p_pay_from_customer => 1290,
  803. p_comments => 'TEST RECEIPT API',
  804. x_status => l_status
  805. );
  806. DBMS_OUTPUT.put_line ('X_RETURN_STATUS = ' || l_return_status);
  807. DBMS_OUTPUT.put_line ('X_MSG_COUNT = ' || l_msg_count);
  808. DBMS_OUTPUT.put_line ('X_MSG_DATA = ' || l_msg_data);
  809. DBMS_OUTPUT.put_line ('X_STATUS = ' || l_status);
  810.  
  811. if l_msg_count = 1 Then
  812. dbms_output.put_line('l_msg_data '|| l_msg_data);
  813. elsif l_msg_count > 1 Then
  814. loop
  815. p_count := p_count + 1;
  816. l_msg_data := FND_MSG_PUB.Get(FND_MSG_PUB.G_NEXT,FND_API.G_FALSE);
  817. if l_msg_data is NULL Then
  818. exit;
  819. end if;
  820. dbms_output.put_line('Message ' || p_count ||'. '||l_msg_data);
  821. end loop;
  822. end if;
  823.  
  824. END;

  

Oracle EBS AR 其他API的更多相关文章

  1. Oracle EBS AR 客户API

    ------------------------------------ 1. Set Environment ------------------------------------ -- 1a. ...

  2. Oracle EBS AR 收款API收款方法标识无效

    1.确认是不是没有收款方法 methods那个表的问题2.查看收款方法那个LOV的问题3.界面录入 是否会有问题  碰到的问题是 收款日期比较早时 找不到对应的收款方法 银行账户需要重新设置

  3. Oracle EBS AR 事务处理到期余额总计API

    declare    -- Local variables here   i integer;   x_line_original NUMBER;   x_line_remaining NUMBER; ...

  4. Oracle EBS OM 主要API示例

    1, Book order Oe_Order_Pub.Process_Order ( 1 , Fnd_Api.G_FALSE , Fnd_Api.G_FALSE , Fnd_Api.G_FALSE , ...

  5. Oracle EBS AR 更新客户配置文件

    DECLARE l_rec_profile_t hz_customer_profile_v2pub.customer_profile_rec_type; l_rec_profile hz_custom ...

  6. Oracle EBS 银行账户API

     创建银行 -- Create Bank DECLARE p_init_msg_list VARCHAR2(200); p_country_code VARCHAR2(200); p_bank_nam ...

  7. Oracle EBS AR 收款核销行关联到事务处理

    select ra.trx_number from ar_cash_receipts_all cr, ar_receivable_applications_all ar,ra_customer_trx ...

  8. Oracle EBS AR 删除应收发票

    DECLARE    -- Non-scalar parameters require additional processing     p_errors arp_trx_validate.mess ...

  9. Oracle EBS AR 更新客户组织层

    declare -- Local variables here i integer; g_module ) := 'TCA_V2_API'; lrec_org hz_party_v2pub.organ ...

随机推荐

  1. 联系动词Link.V笔记

    这篇单独记录一下联系动词的语法.需要注意的是,只有这个单词在作为联系动词的时候才是这个意思或者才是这样的用法.当然每个单词都会有很多的用法,并不只是这样而已. 第一组:好像…似乎… seem to b ...

  2. kafka消费者基本操作

    1.消费消息 消费者以pull的方式获取消息, 每个消费者属于某一个消费组,在创建时不指定消费者的groupId,则该消费者属于默认消费组test-consumer-group ,在配置文件./con ...

  3. JavaScript 经典笔记

    JavaScript 是弱类型的语言,所以编译器不能检测出类型错误. JavaScript 依赖于全局变量来进行链接.所有编译单元的所有顶级变量被撮合到一个被称为全局对象(the global obj ...

  4. linux wheel组

    wheel 组的概念 wheel 组的概念继承自 UNIX.当服务器需要进行一些日常系统管理员无法执行的高级维护时,往往就要用到 root 权限:而“wheel” 组就是一个包含这些特殊权限的用户池: ...

  5. 精读JavaScript模式(二)

    我在想知识点怎么去分类,原本计划一章节一篇,但这样会会显得长短不一.更主要的是看到哪写的哪更为随意.那么这一篇还是紧接第一篇进行知识梳理,上篇说到了更优化的for循环,现在继续聊聊其它的循环方式. 1 ...

  6. Druid链接池配置加密密码链接数据库

    Druid是阿里巴巴开源平台上一个数据库连接池实现,它结合了C3P0.DBCP.PROXOOL等DB池的优点,同时加入了日志监控,可以很好的监控DB池连接和SQL的执行情况,可以说是针对监控而生的DB ...

  7. MyBatis原理第四篇——statementHandler对象(sqlSession内部核心实现,插件的基础)

    首先约定文中将的四大对象是指:executor, statementHandler,parameterHandler,resultHandler对象.(为了方便下面的文章说道四大对象就专指它们) 讲到 ...

  8. WPF备忘录(5)怎样修改模板中的控件

    首先,想问大家一个问题,你们如果要给一个Button添加背景图片会怎么做?(呵呵,这个问题又点小白哈) 是这样吗? <Button Height="57" Horizonta ...

  9. maven国内aliyun镜像

    打开maven安装目录下conf文件夹的settings.xml文件 配置本地仓库 <localRepository>D:/maven/repository</localReposi ...

  10. MyCAT入门实践

    1.MyCAT简单介绍 MyCAT是一个彻底开源的,面向企业应用开发的大数据库集群,支持事务.ACID.可以替代MySQL的加强版数据库,是一个可以视为MySQL集群的企业级数据库,用来替代昂贵的Or ...