319: --end ER 8399134 code
320: BEGIN
321:
322: --check if the fund id or fund number is valid
323: IF p_adj_rec.fund_id <> fnd_api.g_miss_num AND p_adj_rec.fund_id IS NOT NULL THEN
324: --check if the input fund_id is valid
325: OPEN c_fund_exists (p_adj_rec.fund_id);
326: FETCH c_fund_exists INTO l_fund_exists;
327: CLOSE c_fund_exists;
330: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
331: fnd_message.set_name('OZF', 'OZF_INVALID_FUND_ID');
332: fnd_msg_pub.add;
333: END IF;
334: x_return_status := fnd_api.g_ret_sts_error;
335: RETURN;
336: END IF;
337: ELSIF p_adj_rec.fund_number <> fnd_api.g_miss_num AND p_adj_rec.fund_number IS NOT NULL THEN
338: --check if the input fund_number is valid
333: END IF;
334: x_return_status := fnd_api.g_ret_sts_error;
335: RETURN;
336: END IF;
337: ELSIF p_adj_rec.fund_number <> fnd_api.g_miss_num AND p_adj_rec.fund_number IS NOT NULL THEN
338: --check if the input fund_number is valid
339: OPEN c_fund_num_exists (p_adj_rec.fund_number);
340: FETCH c_fund_num_exists INTO l_fund_id;
341: CLOSE c_fund_num_exists;
346: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
347: fnd_message.set_name('OZF', 'OZF_INVALID_FUND_NUM');
348: fnd_msg_pub.add;
349: END IF;
350: x_return_status := fnd_api.g_ret_sts_error;
351: RETURN;
352: END IF;
353: ELSE
354: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
354: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
355: fnd_message.set_name('OZF', 'OZF_NO_FUND_ID');
356: fnd_msg_pub.add;
357: END IF;
358: x_return_status := fnd_api.g_ret_sts_error;
359: RETURN;
360: END IF;
361:
362: IF p_adj_rec.adjustment_type = fnd_api.g_miss_char OR p_adj_rec.adjustment_type IS NULL THEN
358: x_return_status := fnd_api.g_ret_sts_error;
359: RETURN;
360: END IF;
361:
362: IF p_adj_rec.adjustment_type = fnd_api.g_miss_char OR p_adj_rec.adjustment_type IS NULL THEN
363: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
364: fnd_message.set_name('OZF', 'OZF_FUND_NO_ADJ_TYPE');
365: fnd_msg_pub.add;
366: END IF;
363: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
364: fnd_message.set_name('OZF', 'OZF_FUND_NO_ADJ_TYPE');
365: fnd_msg_pub.add;
366: END IF;
367: x_return_status := fnd_api.g_ret_sts_error;
368: RETURN;
369: END IF;
370:
371: IF p_adj_rec.adjustment_type NOT IN ('DECREASE_COMM_EARNED', 'DECREASE_COMMITTED', 'DECREASE_EARNED',
373: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
374: fnd_message.set_name('OZF', 'OZF_INVALID_ADJ_TYPE');
375: fnd_msg_pub.add;
376: END IF;
377: x_return_status := fnd_api.g_ret_sts_error;
378: RETURN;
379: END IF;
380:
381: mo_global.init('OZF');
380:
381: mo_global.init('OZF');
382:
383:
384: IF (p_adj_rec.amount = fnd_api.g_miss_num OR p_adj_rec.amount IS NULL)
385: --nirprasa,ER 8399134 add this condition since user can now pass plan_amount also
386: AND (p_adj_rec.plan_amount = fnd_api.g_miss_num OR p_adj_rec.plan_amount IS NULL) THEN
387: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
388: fnd_message.set_name('OZF', 'OZF_FUND_NO_ADJ_AMT');
382:
383:
384: IF (p_adj_rec.amount = fnd_api.g_miss_num OR p_adj_rec.amount IS NULL)
385: --nirprasa,ER 8399134 add this condition since user can now pass plan_amount also
386: AND (p_adj_rec.plan_amount = fnd_api.g_miss_num OR p_adj_rec.plan_amount IS NULL) THEN
387: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
388: fnd_message.set_name('OZF', 'OZF_FUND_NO_ADJ_AMT');
389: fnd_msg_pub.add;
390: END IF;
387: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
388: fnd_message.set_name('OZF', 'OZF_FUND_NO_ADJ_AMT');
389: fnd_msg_pub.add;
390: END IF;
391: x_return_status := fnd_api.g_ret_sts_error;
392: RETURN;
393: END IF;
394:
395: IF p_adj_rec.fund_id IS NOT NULL THEN
396: OPEN c_curr_code(p_adj_rec.fund_id);
397: FETCH c_curr_code INTO l_fund_curr_code;
398: CLOSE c_curr_code;
399: --nirprasa,ER 8399134 validate if p_adj_rec.currency_code is passed
400: IF p_adj_rec.currency_code IS NULL OR p_adj_rec.currency_code = fnd_api.g_miss_char THEN
401: p_adj_rec.currency_code := l_fund_curr_code;
402: ELSIF p_adj_rec.currency_code <> l_fund_curr_code THEN
403: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
404: fnd_message.set_name('OZF', 'OZF_INVALID_FUND_CURR_CODE');
403: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
404: fnd_message.set_name('OZF', 'OZF_INVALID_FUND_CURR_CODE');
405: fnd_msg_pub.add;
406: END IF;
407: x_return_status := fnd_api.g_ret_sts_error;
408: RETURN;
409: END IF;
410: END IF;
411: --end ER 8399134 code changes
414: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
415: fnd_message.set_name('OZF', 'OZF_INVALID_ACTIVITY_TYPE');
416: fnd_msg_pub.add;
417: END IF;
418: x_return_status := fnd_api.g_ret_sts_error;
419: RETURN;
420: END IF;
421:
422: IF p_adj_rec.activity_type = 'CAMP' THEN
441: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
442: fnd_message.set_name('OZF', 'OZF_INVALID_ACTIVITY_ID');
443: fnd_msg_pub.add;
444: END IF;
445: x_return_status := fnd_api.g_ret_sts_error;
446: RETURN;
447: END IF;
448:
449: IF p_adj_rec.activity_type = 'CAMP' AND p_adj_rec.camp_schedule_id <> fnd_api.g_miss_num
445: x_return_status := fnd_api.g_ret_sts_error;
446: RETURN;
447: END IF;
448:
449: IF p_adj_rec.activity_type = 'CAMP' AND p_adj_rec.camp_schedule_id <> fnd_api.g_miss_num
450: AND p_adj_rec.camp_schedule_id IS NOT NULL THEN
451:
452: OPEN c_valid_csch (p_adj_rec.activity_id);
453: FETCH c_valid_csch INTO l_valid_csch;
457: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
458: fnd_message.set_name('OZF', 'OZF_INVALID_CSCH_ID');
459: fnd_msg_pub.add;
460: END IF;
461: x_return_status := fnd_api.g_ret_sts_error;
462: RETURN;
463: END IF;
464: END IF;
465:
462: RETURN;
463: END IF;
464: END IF;
465:
466: IF p_adj_rec.customer_type <> fnd_api.g_miss_char AND p_adj_rec.customer_type IS NOT NULL THEN
467:
468: OPEN c_valid_cust_type (p_adj_rec.customer_type);
469: FETCH c_valid_cust_type INTO l_cust_type;
470: CLOSE c_valid_cust_type;
473: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
474: fnd_message.set_name('OZF', 'OZF_INVALID_CUST_TYPE');
475: fnd_msg_pub.add;
476: END IF;
477: x_return_status := fnd_api.g_ret_sts_error;
478: RETURN;
479: END IF;
480:
481: IF p_adj_rec.customer_type = 'CUSTOMER' THEN
506:
507: p_adj_rec.ship_to_site_use_id := p_adj_rec.cust_id;
508: END IF;
509:
510: IF p_adj_rec.cust_account_id = fnd_api.g_miss_num OR p_adj_rec.cust_account_id IS NULL THEN
511:
512: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
513: fnd_message.set_name('OZF', 'OZF_INVALID_CUST_ID');
514: fnd_msg_pub.add;
512: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
513: fnd_message.set_name('OZF', 'OZF_INVALID_CUST_ID');
514: fnd_msg_pub.add;
515: END IF;
516: x_return_status := fnd_api.g_ret_sts_error;
517: RETURN;
518: END IF;
519:
520: END IF;
518: END IF;
519:
520: END IF;
521:
522: IF p_adj_rec.document_type <> fnd_api.g_miss_char AND p_adj_rec.document_type IS NOT NULL THEN
523: IF p_adj_rec.document_type NOT IN ('INVOICE', 'ORDER', 'PCHO', 'TP_ORDER') THEN
524:
525: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
526: fnd_message.set_name('OZF', 'OZF_INVALID_DOCUMENT_TYPE');
525: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
526: fnd_message.set_name('OZF', 'OZF_INVALID_DOCUMENT_TYPE');
527: fnd_msg_pub.add;
528: END IF;
529: x_return_status := fnd_api.g_ret_sts_error;
530: RETURN;
531: END IF;
532:
533: IF p_adj_rec.document_number = fnd_api.g_miss_num OR p_adj_rec.document_number IS NULL THEN
529: x_return_status := fnd_api.g_ret_sts_error;
530: RETURN;
531: END IF;
532:
533: IF p_adj_rec.document_number = fnd_api.g_miss_num OR p_adj_rec.document_number IS NULL THEN
534:
535: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
536: fnd_message.set_name('OZF', 'OZF_NO_DOCUMENT_NUM');
537: fnd_msg_pub.add;
535: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
536: fnd_message.set_name('OZF', 'OZF_NO_DOCUMENT_NUM');
537: fnd_msg_pub.add;
538: END IF;
539: x_return_status := fnd_api.g_ret_sts_error;
540: RETURN;
541: END IF;
542: END IF;
543:
541: END IF;
542: END IF;
543:
544: -- for SCAN_DATA type of offer
545: IF p_adj_rec.scan_type_id <> fnd_api.g_miss_num AND p_adj_rec.scan_type_id IS NOT NULL THEN
546:
547: OPEN c_valid_scantype_id (p_adj_rec.activity_id, p_adj_rec.scan_type_id);
548: FETCH c_valid_scantype_id INTO l_valid_scantype_id;
549: CLOSE c_valid_scantype_id;
552: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
553: fnd_message.set_name('OZF', 'OZF_INVALID_SCANTYPE_ID');
554: fnd_msg_pub.add;
555: END IF;
556: x_return_status := fnd_api.g_ret_sts_error;
557: RETURN;
558: END IF;
559: END IF;
560:
558: END IF;
559: END IF;
560:
561: IF p_adj_rec.activity_type = 'OFFR' THEN
562: IF p_adj_rec.product_level_type <> fnd_api.g_miss_char AND p_adj_rec.product_level_type IS NOT NULL THEN
563:
564: IF p_adj_rec.product_level_type NOT IN ('FAMILY', 'PRODUCT') THEN
565: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
566: fnd_message.set_name('OZF', 'OZF_INVALID_PROD_LEVEL');
565: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
566: fnd_message.set_name('OZF', 'OZF_INVALID_PROD_LEVEL');
567: fnd_msg_pub.add;
568: END IF;
569: x_return_status := fnd_api.g_ret_sts_error;
570: RETURN;
571: END IF;
572:
573: IF G_DEBUG THEN
575: ozf_utility_pvt.debug_message('p_adj_rec.product_name: ' || p_adj_rec.product_name);
576: ozf_utility_pvt.debug_message('l_inv_org_id: ' || l_inv_org_id);
577: END IF;
578:
579: IF p_adj_rec.product_name = fnd_api.g_miss_char OR p_adj_rec.product_name IS NULL THEN
580: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
581: fnd_message.set_name('OZF', 'OZF_NO_PROD_NAME');
582: fnd_msg_pub.add;
583: END IF;
580: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
581: fnd_message.set_name('OZF', 'OZF_NO_PROD_NAME');
582: fnd_msg_pub.add;
583: END IF;
584: x_return_status := fnd_api.g_ret_sts_error;
585: RETURN;
586: ELSE
587: IF p_adj_rec.product_level_type = 'FAMILY' THEN
588: OPEN c_valid_prod_family (p_adj_rec.product_name);
592:
593: /*07-APR-09 kdass bug 8402334 - used Inventory Org instead of Operating Unit
594: Derive Inventory Org in precedence - Order's OU, Offer's OU, profile AMS_ITEM_ORGANIZATION_ID
595: */
596: IF p_adj_rec.document_type <> fnd_api.g_miss_char AND p_adj_rec.document_type IS NOT NULL
597: AND p_adj_rec.document_type = 'ORDER' THEN
598:
599: OPEN c_org_order (p_adj_rec.document_number);
600: FETCH c_org_order INTO l_org_for_product;
623: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
624: fnd_message.set_name('OZF', 'OZF_INVALID_PROD');
625: fnd_msg_pub.add;
626: END IF;
627: x_return_status := fnd_api.g_ret_sts_error;
628: RETURN;
629: END IF;
630: END IF;
631: END IF;
634: p_adj_rec.product_id := NULL;
635: END IF;
636:
637: IF p_adj_rec.adjustment_type IN ('INCREASE_PAID', 'DECREASE_PAID') THEN
638: IF p_adj_rec.gl_account_credit = fnd_api.g_miss_num OR p_adj_rec.gl_account_credit IS NULL THEN
639: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
640: fnd_message.set_name('OZF', 'OZF_NO_GL_CREDIT_ACCT');
641: fnd_msg_pub.add;
642: END IF;
639: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
640: fnd_message.set_name('OZF', 'OZF_NO_GL_CREDIT_ACCT');
641: fnd_msg_pub.add;
642: END IF;
643: x_return_status := fnd_api.g_ret_sts_error;
644: RETURN;
645: END IF;
646:
647: IF p_adj_rec.gl_account_debit = fnd_api.g_miss_num OR p_adj_rec.gl_account_debit IS NULL THEN
643: x_return_status := fnd_api.g_ret_sts_error;
644: RETURN;
645: END IF;
646:
647: IF p_adj_rec.gl_account_debit = fnd_api.g_miss_num OR p_adj_rec.gl_account_debit IS NULL THEN
648: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
649: fnd_message.set_name('OZF', 'OZF_NO_GL_DEBIT_ACCT');
650: fnd_msg_pub.add;
651: END IF;
648: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
649: fnd_message.set_name('OZF', 'OZF_NO_GL_DEBIT_ACCT');
650: fnd_msg_pub.add;
651: END IF;
652: x_return_status := fnd_api.g_ret_sts_error;
653: RETURN;
654: END IF;
655: END IF;
656:
660:
661: --ER 9382547
662: --ER 13069257
663:
664: IF p_adj_rec.skip_acct_gen_flag <> fnd_api.g_miss_char AND p_adj_rec.skip_acct_gen_flag IS NOT NULL THEN
665:
666: IF p_adj_rec.skip_acct_gen_flag NOT IN ('F', 'T') THEN
667: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
668: fnd_message.set_name('OZF', 'OZF_INVALID_ACCT_GEN_FLAG');
667: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
668: fnd_message.set_name('OZF', 'OZF_INVALID_ACCT_GEN_FLAG');
669: fnd_msg_pub.add;
670: END IF;
671: x_return_status := fnd_api.g_ret_sts_error;
672: RETURN;
673: END IF;
674: END IF;
675:
672: RETURN;
673: END IF;
674: END IF;
675:
676: IF p_adj_rec.document_type <> fnd_api.g_miss_char AND p_adj_rec.document_type IS NOT NULL
677: AND p_adj_rec.document_type = 'ORDER' AND p_adj_rec.order_line_id <> fnd_api.g_miss_num
678: AND p_adj_rec.order_line_id IS NOT NULL THEN
679:
680: --07-APR-09 kdass bug 8402334 - added document_number to the cursor
673: END IF;
674: END IF;
675:
676: IF p_adj_rec.document_type <> fnd_api.g_miss_char AND p_adj_rec.document_type IS NOT NULL
677: AND p_adj_rec.document_type = 'ORDER' AND p_adj_rec.order_line_id <> fnd_api.g_miss_num
678: AND p_adj_rec.order_line_id IS NOT NULL THEN
679:
680: --07-APR-09 kdass bug 8402334 - added document_number to the cursor
681: OPEN c_order_line(p_adj_rec.order_line_id, p_adj_rec.document_number);
684: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
685: fnd_message.set_name('OZF', 'OZF_INVALID_ORDER_LINE');
686: fnd_msg_pub.add;
687: END IF;
688: x_return_status := fnd_api.g_ret_sts_error;
689: RETURN;
690: END IF;
691: CLOSE c_order_line;
692: END IF;
696: 1) OU should be part of Budget's ledger
697: 2) OU should be same as bill to/ ship to site's OU
698: 3) OU should be same as Offer's OU
699: */
700: IF p_adj_rec.org_id <> fnd_api.g_miss_num AND p_adj_rec.org_id IS NOT NULL THEN
701:
702: --nirprasa,ER 8399134 if fund_id is not passed then this will always evaluate to false.
703: IF p_adj_rec.fund_id <> fnd_api.g_miss_num AND p_adj_rec.fund_id IS NOT NULL THEN
704: OPEN c_org_id(p_adj_rec.org_id, p_adj_rec.fund_id);
699: */
700: IF p_adj_rec.org_id <> fnd_api.g_miss_num AND p_adj_rec.org_id IS NOT NULL THEN
701:
702: --nirprasa,ER 8399134 if fund_id is not passed then this will always evaluate to false.
703: IF p_adj_rec.fund_id <> fnd_api.g_miss_num AND p_adj_rec.fund_id IS NOT NULL THEN
704: OPEN c_org_id(p_adj_rec.org_id, p_adj_rec.fund_id);
705: FETCH c_org_id INTO l_dummy;
706: IF c_org_id%NOTFOUND THEN
707: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
707: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
708: fnd_message.set_name('OZF', 'OZF_INVALID_ORG_LEDGER');
709: fnd_msg_pub.add;
710: END IF;
711: x_return_status := fnd_api.g_ret_sts_error;
712: RETURN;
713: END IF;
714: CLOSE c_org_id;
715: END IF;
718: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
719: fnd_message.set_name('OZF', 'OZF_INVALID_ORG_SITE');
720: fnd_msg_pub.add;
721: END IF;
722: x_return_status := fnd_api.g_ret_sts_error;
723: RETURN;
724: END IF;
725:
726: IF l_offer_org_id IS NOT NULL AND l_offer_org_id <> p_adj_rec.org_id THEN
727: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
728: fnd_message.set_name('OZF', 'OZF_INVALID_ORG_OFFER');
729: fnd_msg_pub.add;
730: END IF;
731: x_return_status := fnd_api.g_ret_sts_error;
732: RETURN;
733: END IF;
734:
735: ELSE
750: l_offer_info.autopay_party_attr IS NOT NULL THEN
751: OPEN c_benef_org_id (l_offer_info.autopay_party_id);
752: FETCH c_benef_org_id INTO p_adj_rec.org_id ;
753: CLOSE c_benef_org_id;
754: ELSIF p_adj_rec.document_type <> fnd_api.g_miss_char AND p_adj_rec.document_type IS NOT NULL THEN
755: IF p_adj_rec.document_type = 'ORDER' THEN
756: OPEN c_org_order (p_adj_rec.document_number);
757: FETCH c_org_order INTO p_adj_rec.org_id ;
758: CLOSE c_org_order;
768: OPEN c_invoice_org_id( p_adj_rec.document_number) ;
769: FETCH c_invoice_org_id INTO p_adj_rec.org_id ;
770: CLOSE c_invoice_org_id ;
771: END IF;
772: ELSIF p_adj_rec.order_line_id <> fnd_api.g_miss_num AND p_adj_rec.order_line_id IS NOT NULL THEN
773: OPEN c_org_order_line (p_adj_rec.order_line_id);
774: FETCH c_org_order_line INTO p_adj_rec.org_id ;
775: CLOSE c_org_order_line;
776: END IF;
801: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
802: fnd_message.set_name('OZF', 'OZF_INVALID_ADJ_TYPE_ID');
803: fnd_msg_pub.add;
804: END IF;
805: x_return_status := fnd_api.g_ret_sts_error;
806: RETURN;
807: END IF;
808: CLOSE c_adj_type;
809:
811: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
812: fnd_message.set_name('OZF', 'OZF_INVALID_ADJ_TYPE_ID');
813: fnd_msg_pub.add;
814: END IF;
815: x_return_status := fnd_api.g_ret_sts_error;
816: RETURN;
817: END IF;
818: END IF;
819:
825: FETCH c_get_offer_currency INTO l_offer_currency;
826: CLOSE c_get_offer_currency;
827:
828: IF l_offer_currency.transaction_currency_code IS NULL
829: OR l_offer_currency.transaction_currency_code = fnd_api.g_miss_char THEN
830: IF p_adj_rec.adjustment_type NOT IN ('DECREASE_COMMITTED') THEN
831: IF p_adj_rec.order_line_id IS NULL
832: OR p_adj_rec.order_line_id = fnd_api.g_miss_num THEN
833: --Bug 14078405
828: IF l_offer_currency.transaction_currency_code IS NULL
829: OR l_offer_currency.transaction_currency_code = fnd_api.g_miss_char THEN
830: IF p_adj_rec.adjustment_type NOT IN ('DECREASE_COMMITTED') THEN
831: IF p_adj_rec.order_line_id IS NULL
832: OR p_adj_rec.order_line_id = fnd_api.g_miss_num THEN
833: --Bug 14078405
834: /*IF p_adj_rec.document_type IS NULL
835: OR p_adj_rec.document_type = fnd_api.g_miss_char
836: OR p_adj_rec.document_number IS NULL
831: IF p_adj_rec.order_line_id IS NULL
832: OR p_adj_rec.order_line_id = fnd_api.g_miss_num THEN
833: --Bug 14078405
834: /*IF p_adj_rec.document_type IS NULL
835: OR p_adj_rec.document_type = fnd_api.g_miss_char
836: OR p_adj_rec.document_number IS NULL
837: OR p_adj_rec.document_number = fnd_api.g_miss_num THEN
838: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
839: fnd_message.set_name('OZF', 'OZF_NO_DOCUMENT_INFO');
833: --Bug 14078405
834: /*IF p_adj_rec.document_type IS NULL
835: OR p_adj_rec.document_type = fnd_api.g_miss_char
836: OR p_adj_rec.document_number IS NULL
837: OR p_adj_rec.document_number = fnd_api.g_miss_num THEN
838: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
839: fnd_message.set_name('OZF', 'OZF_NO_DOCUMENT_INFO');
840: fnd_msg_pub.add;
841: END IF;
838: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
839: fnd_message.set_name('OZF', 'OZF_NO_DOCUMENT_INFO');
840: fnd_msg_pub.add;
841: END IF;
842: x_return_status := fnd_api.g_ret_sts_error;
843: RETURN;
844: ELSE*/
845: --Bug 14078405
846: IF p_adj_rec.document_type = 'ORDER' THEN
894: CLOSE c_get_eveo_currency;
895: END IF; -- IF p_adj_rec.activity_type = 'OFFR' THEN
896:
897: -- Bug 14078405
898: /*IF p_adj_rec.plan_currency_code IS NULL OR p_adj_rec.plan_currency_code = fnd_api.g_miss_char THEN
899: p_adj_rec.plan_currency_code := l_document_curr;
900: ELSE
901: IF l_document_curr <> p_adj_rec.plan_currency_code THEN
902: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
902: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
903: fnd_message.set_name('OZF', 'OZF_INVALID_PLAN_CURR_CODE');
904: fnd_msg_pub.add;
905: END IF;
906: x_return_status := fnd_api.g_ret_sts_error;
907: RETURN;
908: END IF;
909: END IF; */
910: --end ER 8399134 code changes
930:
931: ELSE
932:
933: --Cost Price is mandatory for Ship & Debit Offer
934: IF p_adj_rec.cost_price = fnd_api.g_miss_num OR p_adj_rec.cost_price IS NULL THEN
935: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
936: fnd_message.set_name('OZF', 'OZF_NO_COST_PRICE');
937: fnd_msg_pub.add;
938: END IF;
935: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
936: fnd_message.set_name('OZF', 'OZF_NO_COST_PRICE');
937: fnd_msg_pub.add;
938: END IF;
939: x_return_status := fnd_api.g_ret_sts_error;
940: RETURN;
941: END IF;
942:
943: --Cost Price should be greater than 0
945: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
946: fnd_message.set_name('OZF', 'OZF_COST_PRICE_GT_ZERO');
947: fnd_msg_pub.add;
948: END IF;
949: x_return_status := fnd_api.g_ret_sts_error;
950: RETURN;
951: END IF;
952:
953: IF p_adj_rec.cost_price_currency_code <> fnd_api.g_miss_char AND p_adj_rec.cost_price_currency_code IS NOT NULL THEN
949: x_return_status := fnd_api.g_ret_sts_error;
950: RETURN;
951: END IF;
952:
953: IF p_adj_rec.cost_price_currency_code <> fnd_api.g_miss_char AND p_adj_rec.cost_price_currency_code IS NOT NULL THEN
954:
955: OPEN c_valid_currency (p_adj_rec.cost_price_currency_code);
956: FETCH c_valid_currency INTO l_valid_curr;
957: CLOSE c_valid_currency;
960: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
961: fnd_message.set_name('OZF', 'OZF_INVALID_COST_PRICE_CURR');
962: fnd_msg_pub.add;
963: END IF;
964: x_return_status := fnd_api.g_ret_sts_error;
965: RETURN;
966: END IF;
967: ELSE
968: --If Cost Price Currency is not passed, it is same as Offer Currency
969: p_adj_rec.cost_price_currency_code := p_adj_rec.plan_currency_code;
970: END IF;
971:
972: --Discount Type is mandatory for Ship & Debit Offer
973: IF p_adj_rec.discount_type = fnd_api.g_miss_char OR p_adj_rec.discount_type IS NULL THEN
974: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
975: fnd_message.set_name('OZF', 'OZF_NO_DIS_TYPE');
976: fnd_msg_pub.add;
977: END IF;
974: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
975: fnd_message.set_name('OZF', 'OZF_NO_DIS_TYPE');
976: fnd_msg_pub.add;
977: END IF;
978: x_return_status := fnd_api.g_ret_sts_error;
979: RETURN;
980: ELSE
981:
982: --Valid values for Discount Type = % (Percent), AMT (Amount), NEWPRICE (New Price)
984: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
985: fnd_message.set_name('OZF', 'OZF_INVALID_DIS_TYPE');
986: fnd_msg_pub.add;
987: END IF;
988: x_return_status := fnd_api.g_ret_sts_error;
989: RETURN;
990: END IF;
991: END IF;
992:
990: END IF;
991: END IF;
992:
993: --Discount Amount is mandatory for Ship & Debit Offer
994: IF p_adj_rec.discount_amount = fnd_api.g_miss_num OR p_adj_rec.discount_amount IS NULL THEN
995: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
996: fnd_message.set_name('OZF', 'OZF_NO_DIS_AMT');
997: fnd_msg_pub.add;
998: END IF;
995: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
996: fnd_message.set_name('OZF', 'OZF_NO_DIS_AMT');
997: fnd_msg_pub.add;
998: END IF;
999: x_return_status := fnd_api.g_ret_sts_error;
1000: RETURN;
1001: END IF;
1002:
1003: --Discount Amount should be greater than 0
1005: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
1006: fnd_message.set_name('OZF', 'OZF_DIS_AMT_GT_ZERO');
1007: fnd_msg_pub.add;
1008: END IF;
1009: x_return_status := fnd_api.g_ret_sts_error;
1010: RETURN;
1011: END IF;
1012:
1013: --Discount Amount Currency is mandatory for Ship & Debit Offer except for Discount Type = % (Percent)
1013: --Discount Amount Currency is mandatory for Ship & Debit Offer except for Discount Type = % (Percent)
1014: IF p_adj_rec.discount_type = '%' THEN
1015: p_adj_rec.discount_amount_currency_code := NULL;
1016:
1017: ELSIF p_adj_rec.discount_amount_currency_code <> fnd_api.g_miss_char AND p_adj_rec.discount_amount_currency_code IS NOT NULL THEN
1018:
1019: l_valid_curr := NULL;
1020: OPEN c_valid_currency (p_adj_rec.discount_amount_currency_code);
1021: FETCH c_valid_currency INTO l_valid_curr;
1025: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
1026: fnd_message.set_name('OZF', 'OZF_INVALID_DIS_AMT_CURR');
1027: fnd_msg_pub.add;
1028: END IF;
1029: x_return_status := fnd_api.g_ret_sts_error;
1030: RETURN;
1031: END IF;
1032: ELSE
1033: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
1033: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
1034: fnd_message.set_name('OZF', 'OZF_NO_DIS_AMT_CURR');
1035: fnd_msg_pub.add;
1036: END IF;
1037: x_return_status := fnd_api.g_ret_sts_error;
1038: RETURN;
1039: END IF;
1040:
1041: END IF; --IF l_sdr_offer IS NULL THEN
1060: ---------------------------------------------------------------------
1061: -- nirprasa Added for FP of bug 9383565.
1062: PROCEDURE Create_Fund_Adjustment(
1063: p_api_version IN NUMBER
1064: ,p_init_msg_list IN VARCHAR2 := fnd_api.g_false
1065: ,p_commit IN VARCHAR2 := fnd_api.g_false
1066: ,p_validation_level IN NUMBER := fnd_api.g_valid_level_full
1067: ,p_adj_rec IN OZF_FUND_UTILIZED_PUB.adjustment_rec_type
1068: ,x_return_status OUT NOCOPY VARCHAR2
1061: -- nirprasa Added for FP of bug 9383565.
1062: PROCEDURE Create_Fund_Adjustment(
1063: p_api_version IN NUMBER
1064: ,p_init_msg_list IN VARCHAR2 := fnd_api.g_false
1065: ,p_commit IN VARCHAR2 := fnd_api.g_false
1066: ,p_validation_level IN NUMBER := fnd_api.g_valid_level_full
1067: ,p_adj_rec IN OZF_FUND_UTILIZED_PUB.adjustment_rec_type
1068: ,x_return_status OUT NOCOPY VARCHAR2
1069: ,x_msg_count OUT NOCOPY NUMBER
1062: PROCEDURE Create_Fund_Adjustment(
1063: p_api_version IN NUMBER
1064: ,p_init_msg_list IN VARCHAR2 := fnd_api.g_false
1065: ,p_commit IN VARCHAR2 := fnd_api.g_false
1066: ,p_validation_level IN NUMBER := fnd_api.g_valid_level_full
1067: ,p_adj_rec IN OZF_FUND_UTILIZED_PUB.adjustment_rec_type
1068: ,x_return_status OUT NOCOPY VARCHAR2
1069: ,x_msg_count OUT NOCOPY NUMBER
1070: ,x_msg_data OUT NOCOPY VARCHAR2
1102: -- 03/14/2008 psomyaju ER-6858324
1103: ---------------------------------------------------------------------
1104: PROCEDURE Create_Fund_Adjustment(
1105: p_api_version IN NUMBER
1106: ,p_init_msg_list IN VARCHAR2 := fnd_api.g_false
1107: ,p_commit IN VARCHAR2 := fnd_api.g_false
1108: ,p_validation_level IN NUMBER := fnd_api.g_valid_level_full
1109: ,p_adj_rec IN OZF_FUND_UTILIZED_PUB.adjustment_rec_type
1110: ,x_return_status OUT NOCOPY VARCHAR2
1103: ---------------------------------------------------------------------
1104: PROCEDURE Create_Fund_Adjustment(
1105: p_api_version IN NUMBER
1106: ,p_init_msg_list IN VARCHAR2 := fnd_api.g_false
1107: ,p_commit IN VARCHAR2 := fnd_api.g_false
1108: ,p_validation_level IN NUMBER := fnd_api.g_valid_level_full
1109: ,p_adj_rec IN OZF_FUND_UTILIZED_PUB.adjustment_rec_type
1110: ,x_return_status OUT NOCOPY VARCHAR2
1111: ,x_msg_count OUT NOCOPY NUMBER
1104: PROCEDURE Create_Fund_Adjustment(
1105: p_api_version IN NUMBER
1106: ,p_init_msg_list IN VARCHAR2 := fnd_api.g_false
1107: ,p_commit IN VARCHAR2 := fnd_api.g_false
1108: ,p_validation_level IN NUMBER := fnd_api.g_valid_level_full
1109: ,p_adj_rec IN OZF_FUND_UTILIZED_PUB.adjustment_rec_type
1110: ,x_return_status OUT NOCOPY VARCHAR2
1111: ,x_msg_count OUT NOCOPY NUMBER
1112: ,x_msg_data OUT NOCOPY VARCHAR2
1175: FROM ozf_sys_parameters_all
1176: WHERE org_id = p_org_id;
1177:
1178:
1179: l_exchange_rate_type VARCHAR2(30) := FND_API.G_MISS_CHAR;
1180: --nirprasa,ER 8399134
1181: BEGIN
1182: SAVEPOINT Create_Fund_Adjustment;
1183:
1192:
1193: --ER 8399134 Since fund_id is passed, validate_items() defaults the currency_code
1194: --if it is not passed. If currency_code is passed then validate it.
1195: --If plan_amount is passed then ignore amount column.
1196: IF l_adj_rec.plan_amount IS NOT NULL OR l_adj_rec.plan_amount <> fnd_api.g_miss_num THEN
1197: l_adj_rec.amount := NULL;
1198: l_act_budgets_rec.request_amount := l_adj_rec.plan_amount;
1199: END IF;
1200:
1203: l_act_budgets_rec.request_currency := l_act_util_rec.plan_currency_code;
1204:
1205:
1206: /* 07-APR-09 kdass bug 8402334
1207: IF l_adj_rec.org_id = fnd_api.g_miss_num OR l_adj_rec.org_id IS NULL THEN
1208: IF l_adj_rec.document_type = 'ORDER' THEN
1209: OPEN c_org_order (l_adj_rec.document_number);
1210: FETCH c_org_order INTO l_adj_rec.org_id;
1211: CLOSE c_org_order;
1216: END IF;
1217: END IF;
1218: */
1219:
1220: IF x_return_status = fnd_api.g_ret_sts_unexp_error THEN
1221: RAISE fnd_api.g_exc_unexpected_error;
1222: ELSIF x_return_status = fnd_api.g_ret_sts_error THEN
1223: RAISE fnd_api.g_exc_error;
1224: END IF;
1217: END IF;
1218: */
1219:
1220: IF x_return_status = fnd_api.g_ret_sts_unexp_error THEN
1221: RAISE fnd_api.g_exc_unexpected_error;
1222: ELSIF x_return_status = fnd_api.g_ret_sts_error THEN
1223: RAISE fnd_api.g_exc_error;
1224: END IF;
1225:
1218: */
1219:
1220: IF x_return_status = fnd_api.g_ret_sts_unexp_error THEN
1221: RAISE fnd_api.g_exc_unexpected_error;
1222: ELSIF x_return_status = fnd_api.g_ret_sts_error THEN
1223: RAISE fnd_api.g_exc_error;
1224: END IF;
1225:
1226: l_act_util_rec.adjustment_type_id := l_adj_rec.adjustment_type_id;
1219:
1220: IF x_return_status = fnd_api.g_ret_sts_unexp_error THEN
1221: RAISE fnd_api.g_exc_unexpected_error;
1222: ELSIF x_return_status = fnd_api.g_ret_sts_error THEN
1223: RAISE fnd_api.g_exc_error;
1224: END IF;
1225:
1226: l_act_util_rec.adjustment_type_id := l_adj_rec.adjustment_type_id;
1227: l_act_util_rec.adjustment_type := l_adj_rec.adjustment_type;
1329: --ER 8399134 This will be used to created dec comm record.
1330: l_act_budgets_rec.request_currency := l_adj_rec.currency_code;
1331: l_act_budgets_rec.request_amount := l_adj_rec.amount;
1332:
1333: IF l_adj_rec.plan_amount IS NOT NULL OR l_adj_rec.plan_amount <> FND_API.G_MISS_NUM THEN
1334: l_act_budgets_rec.src_curr_req_amt := l_adj_rec.plan_amount;
1335: END IF;
1336:
1337: /*OPEN c_offer_currency(l_adj_rec.activity_id);
1338: FETCH c_offer_currency INTO l_offer_currency;
1339: CLOSE c_offer_currency;
1340:
1341: IF l_offer_currency.transaction_currency_code IS NULL
1342: OR l_offer_currency.transaction_currency_code = FND_API.G_MISS_CHAR THEN
1343: IF l_adj_rec.plan_currency_code <> l_offer_currency.fund_request_curr_code THEN
1344: ozf_utility_pvt.convert_currency (
1345: x_return_status => x_return_status
1346: ,p_from_currency => l_adj_rec.plan_currency_code
1379: END LOOP;*/
1380:
1381: END IF;
1382:
1383: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
1384: RAISE FND_API.g_exc_unexpected_error;
1385: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1386: RAISE FND_API.g_exc_unexpected_error;
1387: END IF;
1380:
1381: END IF;
1382:
1383: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
1384: RAISE FND_API.g_exc_unexpected_error;
1385: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1386: RAISE FND_API.g_exc_unexpected_error;
1387: END IF;
1388:
1381: END IF;
1382:
1383: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
1384: RAISE FND_API.g_exc_unexpected_error;
1385: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1386: RAISE FND_API.g_exc_unexpected_error;
1387: END IF;
1388:
1389: --reset utilization_type for decrease committed amount
1382:
1383: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
1384: RAISE FND_API.g_exc_unexpected_error;
1385: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1386: RAISE FND_API.g_exc_unexpected_error;
1387: END IF;
1388:
1389: --reset utilization_type for decrease committed amount
1390: l_act_util_rec.utilization_type := NULL;
1397: l_act_budgets_rec.arc_act_budget_used_by := 'FUND';
1398: --nirprasa,ER 8399134
1399: l_act_budgets_rec.request_currency := l_adj_rec.currency_code;
1400: l_act_budgets_rec.request_amount := l_adj_rec.amount;
1401: IF l_adj_rec.plan_amount IS NOT NULL AND l_adj_rec.plan_amount <> FND_API.G_MISS_NUM THEN
1402: l_act_budgets_rec.src_curr_req_amt := l_adj_rec.plan_amount;
1403: END IF;
1404:
1405: -- if adjustment type is 'Increase Earned Amount' (STANDARD) or 'Decrease Earned Amount' (DECREASE_EARNED)
1459: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
1460: fnd_message.set_name('OZF', 'OZF_NO_ORIG_UTIL_ID');
1461: fnd_msg_pub.add;
1462: END IF;
1463: RAISE fnd_api.g_exc_error;
1464: END IF;
1465:
1466: --if the original utilization is not posted to GL(e.g. marketing cost, or off invoice offer
1467: --where gl posting is not required), then paid adjustment should not be allowed.
1469: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
1470: fnd_message.set_name('OZF', 'OZF_ADJ_PAID_NOT_ALLOWED');
1471: fnd_msg_pub.add;
1472: END IF;
1473: RAISE fnd_api.g_exc_error;
1474: END IF;
1475:
1476: IF l_act_util_rec.adjustment_type = 'DECREASE_PAID' THEN
1477: l_act_budgets_rec.parent_src_apprvd_amt := - l_act_budgets_rec.parent_src_apprvd_amt;
1486: );
1487:
1488: IF l_act_budgets_rec.request_amount IS NOT NULL THEN
1489: IF ((l_act_budgets_rec.parent_src_apprvd_amt IS NULL
1490: OR l_act_budgets_rec.parent_src_apprvd_amt = fnd_api.g_miss_num)
1491: AND l_act_budgets_rec.request_currency <> l_act_budgets_rec.parent_src_curr) THEN
1492:
1493: ozf_utility_pvt.convert_currency (
1494: x_return_status=> x_return_status
1499: ,x_to_amount=> l_act_budgets_rec.parent_src_apprvd_amt
1500: ,x_rate=> l_rate
1501: );
1502:
1503: IF x_return_status = fnd_api.g_ret_sts_unexp_error THEN
1504: RAISE fnd_api.g_exc_unexpected_error;
1505: ELSIF x_return_status = fnd_api.g_ret_sts_error THEN
1506: RAISE fnd_api.g_exc_error;
1507: END IF;
1500: ,x_rate=> l_rate
1501: );
1502:
1503: IF x_return_status = fnd_api.g_ret_sts_unexp_error THEN
1504: RAISE fnd_api.g_exc_unexpected_error;
1505: ELSIF x_return_status = fnd_api.g_ret_sts_error THEN
1506: RAISE fnd_api.g_exc_error;
1507: END IF;
1508: ELSE
1501: );
1502:
1503: IF x_return_status = fnd_api.g_ret_sts_unexp_error THEN
1504: RAISE fnd_api.g_exc_unexpected_error;
1505: ELSIF x_return_status = fnd_api.g_ret_sts_error THEN
1506: RAISE fnd_api.g_exc_error;
1507: END IF;
1508: ELSE
1509: l_act_budgets_rec.parent_src_apprvd_amt := l_act_budgets_rec.request_amount;
1502:
1503: IF x_return_status = fnd_api.g_ret_sts_unexp_error THEN
1504: RAISE fnd_api.g_exc_unexpected_error;
1505: ELSIF x_return_status = fnd_api.g_ret_sts_error THEN
1506: RAISE fnd_api.g_exc_error;
1507: END IF;
1508: ELSE
1509: l_act_budgets_rec.parent_src_apprvd_amt := l_act_budgets_rec.request_amount;
1510: END IF;
1510: END IF;
1511: ELSIF l_act_budgets_rec.parent_src_apprvd_amt IS NOT NULL THEN
1512: IF l_act_budgets_rec.request_currency <> l_act_budgets_rec.parent_src_curr
1513: AND (l_act_budgets_rec.request_amount IS NULL
1514: OR l_act_budgets_rec.request_amount = fnd_api.g_miss_num) THEN
1515: --nirprasa,ER 8399134
1516: ozf_utility_pvt.convert_currency (
1517: x_return_status=> x_return_status
1518: ,p_from_currency=> l_act_budgets_rec.parent_src_curr
1522: ,p_from_amount=> l_act_budgets_rec.parent_src_apprvd_amt
1523: ,x_to_amount=> l_act_budgets_rec.request_amount
1524: ,x_rate=> l_rate
1525: );
1526: IF x_return_status = fnd_api.g_ret_sts_unexp_error THEN
1527: RAISE fnd_api.g_exc_unexpected_error;
1528: ELSIF x_return_status = fnd_api.g_ret_sts_error THEN
1529: RAISE fnd_api.g_exc_error;
1530: END IF;
1523: ,x_to_amount=> l_act_budgets_rec.request_amount
1524: ,x_rate=> l_rate
1525: );
1526: IF x_return_status = fnd_api.g_ret_sts_unexp_error THEN
1527: RAISE fnd_api.g_exc_unexpected_error;
1528: ELSIF x_return_status = fnd_api.g_ret_sts_error THEN
1529: RAISE fnd_api.g_exc_error;
1530: END IF;
1531: ELSE
1524: ,x_rate=> l_rate
1525: );
1526: IF x_return_status = fnd_api.g_ret_sts_unexp_error THEN
1527: RAISE fnd_api.g_exc_unexpected_error;
1528: ELSIF x_return_status = fnd_api.g_ret_sts_error THEN
1529: RAISE fnd_api.g_exc_error;
1530: END IF;
1531: ELSE
1532: l_act_budgets_rec.request_amount := l_act_budgets_rec.parent_src_apprvd_amt;
1525: );
1526: IF x_return_status = fnd_api.g_ret_sts_unexp_error THEN
1527: RAISE fnd_api.g_exc_unexpected_error;
1528: ELSIF x_return_status = fnd_api.g_ret_sts_error THEN
1529: RAISE fnd_api.g_exc_error;
1530: END IF;
1531: ELSE
1532: l_act_budgets_rec.request_amount := l_act_budgets_rec.parent_src_apprvd_amt;
1533: END IF;
1592: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
1593: fnd_message.set_name('OZF', 'OZF_NO_ORIG_UTIL_ID');
1594: fnd_msg_pub.add;
1595: END IF;
1596: RAISE fnd_api.g_exc_error;
1597: END IF;
1598:
1599: --if the original utilization is not posted to GL(e.g. marketing cost, or off invoice offer
1600: --where gl posting is not required), then paid adjustment should not be allowed.
1602: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
1603: fnd_message.set_name('OZF', 'OZF_ADJ_PAID_NOT_ALLOWED');
1604: fnd_msg_pub.add;
1605: END IF;
1606: RAISE fnd_api.g_exc_error;
1607: END IF;
1608:
1609: IF l_act_util_rec.adjustment_type = 'DECREASE_PAID' THEN
1610: l_act_budgets_rec.parent_src_apprvd_amt := - l_act_budgets_rec.parent_src_apprvd_amt;
1623: END IF;
1624:
1625: END IF;
1626:
1627: IF x_return_status = fnd_api.g_ret_sts_unexp_error THEN
1628: RAISE fnd_api.g_exc_unexpected_error;
1629: ELSIF x_return_status = fnd_api.g_ret_sts_error THEN
1630: RAISE fnd_api.g_exc_error;
1631: END IF;
1624:
1625: END IF;
1626:
1627: IF x_return_status = fnd_api.g_ret_sts_unexp_error THEN
1628: RAISE fnd_api.g_exc_unexpected_error;
1629: ELSIF x_return_status = fnd_api.g_ret_sts_error THEN
1630: RAISE fnd_api.g_exc_error;
1631: END IF;
1632:
1625: END IF;
1626:
1627: IF x_return_status = fnd_api.g_ret_sts_unexp_error THEN
1628: RAISE fnd_api.g_exc_unexpected_error;
1629: ELSIF x_return_status = fnd_api.g_ret_sts_error THEN
1630: RAISE fnd_api.g_exc_error;
1631: END IF;
1632:
1633: FND_MSG_PUB.Count_And_Get (
1626:
1627: IF x_return_status = fnd_api.g_ret_sts_unexp_error THEN
1628: RAISE fnd_api.g_exc_unexpected_error;
1629: ELSIF x_return_status = fnd_api.g_ret_sts_error THEN
1630: RAISE fnd_api.g_exc_error;
1631: END IF;
1632:
1633: FND_MSG_PUB.Count_And_Get (
1634: p_encoded => FND_API.G_FALSE,
1630: RAISE fnd_api.g_exc_error;
1631: END IF;
1632:
1633: FND_MSG_PUB.Count_And_Get (
1634: p_encoded => FND_API.G_FALSE,
1635: p_count => x_msg_count,
1636: p_data => x_msg_data
1637: );
1638:
1636: p_data => x_msg_data
1637: );
1638:
1639: EXCEPTION
1640: WHEN FND_API.G_EXC_ERROR THEN
1641: ROLLBACK TO Create_Fund_Adjustment;
1642: x_return_status := FND_API.G_RET_STS_ERROR;
1643: -- Standard call to get message count and if count=1, get the message
1644: FND_MSG_PUB.Count_And_Get(p_encoded => FND_API.G_FALSE
1638:
1639: EXCEPTION
1640: WHEN FND_API.G_EXC_ERROR THEN
1641: ROLLBACK TO Create_Fund_Adjustment;
1642: x_return_status := FND_API.G_RET_STS_ERROR;
1643: -- Standard call to get message count and if count=1, get the message
1644: FND_MSG_PUB.Count_And_Get(p_encoded => FND_API.G_FALSE
1645: ,p_count => x_msg_count
1646: ,p_data => x_msg_data
1640: WHEN FND_API.G_EXC_ERROR THEN
1641: ROLLBACK TO Create_Fund_Adjustment;
1642: x_return_status := FND_API.G_RET_STS_ERROR;
1643: -- Standard call to get message count and if count=1, get the message
1644: FND_MSG_PUB.Count_And_Get(p_encoded => FND_API.G_FALSE
1645: ,p_count => x_msg_count
1646: ,p_data => x_msg_data
1647: );
1648: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1644: FND_MSG_PUB.Count_And_Get(p_encoded => FND_API.G_FALSE
1645: ,p_count => x_msg_count
1646: ,p_data => x_msg_data
1647: );
1648: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1649: ROLLBACK TO Create_Fund_Adjustment;
1650: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1651: -- Standard call to get message count and if count=1, get the message
1652: FND_MSG_PUB.Count_And_Get(p_encoded => FND_API.G_FALSE
1646: ,p_data => x_msg_data
1647: );
1648: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1649: ROLLBACK TO Create_Fund_Adjustment;
1650: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1651: -- Standard call to get message count and if count=1, get the message
1652: FND_MSG_PUB.Count_And_Get(p_encoded => FND_API.G_FALSE
1653: ,p_count => x_msg_count
1654: ,p_data => x_msg_data
1648: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1649: ROLLBACK TO Create_Fund_Adjustment;
1650: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1651: -- Standard call to get message count and if count=1, get the message
1652: FND_MSG_PUB.Count_And_Get(p_encoded => FND_API.G_FALSE
1653: ,p_count => x_msg_count
1654: ,p_data => x_msg_data
1655: );
1656: WHEN OTHERS THEN
1654: ,p_data => x_msg_data
1655: );
1656: WHEN OTHERS THEN
1657: ROLLBACK TO Create_Fund_Adjustment;
1658: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1659: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
1660: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
1661: END IF;
1662: -- Standard call to get message count and if count=1, get the message
1659: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
1660: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
1661: END IF;
1662: -- Standard call to get message count and if count=1, get the message
1663: FND_MSG_PUB.Count_And_Get(p_encoded => FND_API.G_FALSE
1664: ,p_count => x_msg_count
1665: ,p_data => x_msg_data
1666: );
1667: END Create_Fund_Adjustment;