DBA Data[Home] [Help]

APPS.PSA_AP_BC_PVT dependencies on AP_INVOICE_DISTRIBUTIONS

Line 157: UPDATE ap_invoice_distributions_all

153: l_events_tab(i).event_status_code ||' '||
154: l_events_tab(i).process_status_code);
155:
156: psa_utils.debug_other_string(g_state_level,l_api_name,'Updating bc_event_id '||l_events_tab(i).event_id ||'to NULL for related distributions.');
157: UPDATE ap_invoice_distributions_all
158: SET bc_event_id = NULL
159: WHERE bc_event_id = l_events_tab(i).event_id;
160: psa_utils.debug_other_string(g_state_level,l_api_name,'# distributions in ap_invoice_distributions_all has been updated to NULL:'||SQL%ROWCOUNT);
161:

Line 160: psa_utils.debug_other_string(g_state_level,l_api_name,'# distributions in ap_invoice_distributions_all has been updated to NULL:'||SQL%ROWCOUNT);

156: psa_utils.debug_other_string(g_state_level,l_api_name,'Updating bc_event_id '||l_events_tab(i).event_id ||'to NULL for related distributions.');
157: UPDATE ap_invoice_distributions_all
158: SET bc_event_id = NULL
159: WHERE bc_event_id = l_events_tab(i).event_id;
160: psa_utils.debug_other_string(g_state_level,l_api_name,'# distributions in ap_invoice_distributions_all has been updated to NULL:'||SQL%ROWCOUNT);
161:
162: UPDATE ap_prepay_history_all aph
163: SET aph.bc_event_id = NULL
164: WHERE aph.bc_event_id = l_events_tab(i).event_id;

Line 307: UPDATE ap_invoice_distributions_all

303: p_return_status := Fnd_Api.G_Ret_Sts_Error;
304: EXIT;
305: END IF;
306:
307: UPDATE ap_invoice_distributions_all
308: SET bc_event_id = NULL
309: WHERE invoice_distribution_id = p_tab_fc_dist(i).inv_distribution_id;
310: END IF;
311:

Line 325: FROM ap_invoice_distributions_all

321: AND NVL(t.source_id_int_1,-99) = l_event_source_info.source_id_int_1 -- Bug 10227913
322: AND t.ledger_id = l_event_source_info.ledger_id -- Bug 10227913
323: AND e.budgetary_control_flag = 'Y'
324: AND NOT EXISTS (SELECT 1
325: FROM ap_invoice_distributions_all
326: WHERE invoice_id = l_event_source_info.source_id_int_1
327: AND bc_event_id = e.event_id)) LOOP
328: psa_utils.debug_other_string(g_state_level,l_path_name, 'Found Event Id = '||event_rec.event_id);
329: psa_utils.debug_other_string(g_state_level,l_path_name, 'process_status_code = '||event_rec.process_status_code);

Line 448: FROM ap_invoice_distributions_all aid

444: AND xe.process_status_code = 'P'
445: AND xe.budgetary_control_flag = 'Y'
446: AND xe.event_type_code <> 'MANUAL'
447: AND NOT EXISTS (SELECT 'not exists'
448: FROM ap_invoice_distributions_all aid
449: WHERE aid.bc_event_id = xe.event_id)
450: AND NOT EXISTS (SELECT 'not exists'
451: FROM ap_prepay_history_all aph
452: WHERE aph.bc_event_id = xe.event_id)

Line 643: FROM ap_invoice_distributions_all aid, xla_events xe

639: (
640: p_prepayapply_dist_id NUMBER
641: ) IS
642: SELECT 'Y'
643: FROM ap_invoice_distributions_all aid, xla_events xe
644: WHERE aid.invoice_distribution_id=p_prepayapply_dist_id
645: AND aid.bc_event_id = xe.event_id
646: AND xe.event_status_code = 'P'
647: AND xe.application_id = 200;

Line 658: FROM ap_invoice_distributions_all

654: p_inv_dist_id NUMBER
655: ) IS
656: SELECT parent_reversal_id,
657: encumbered_flag
658: FROM ap_invoice_distributions_all
659: WHERE invoice_distribution_id = p_inv_dist_id;
660:
661: CURSOR c_get_parent_dist_id
662: (

Line 666: FROM ap_invoice_distributions_all

662: (
663: p_inv_dist_id NUMBER
664: ) IS
665: SELECT charge_applicable_to_dist_id
666: FROM ap_invoice_distributions_all
667: WHERE invoice_distribution_id = p_inv_dist_id;
668:
669: CURSOR c_get_parent_dist_type
670: (

Line 674: FROM ap_invoice_distributions_all

670: (
671: p_inv_dist_id NUMBER
672: ) IS
673: SELECT line_type_lookup_code parent_dist_type
674: FROM ap_invoice_distributions_all
675: WHERE invoice_distribution_id = p_inv_dist_id;
676:
677: CURSOR c_chk_accrue_flag
678: (

Line 682: FROM ap_invoice_distributions_all d,

678: (
679: p_inv_dist_id NUMBER
680: ) IS
681: SELECT NVL(pod.accrue_on_receipt_flag,'N')
682: FROM ap_invoice_distributions_all d,
683: po_distributions_all pod
684: WHERE d.invoice_distribution_id = p_inv_dist_id
685: AND d.po_distribution_id IS NOT NULL
686: AND d.po_distribution_id = pod.po_distribution_id;

Line 693: FROM ap_invoice_distributions_all d

689: (
690: p_inv_dist_id NUMBER
691: ) IS
692: SELECT d.po_distribution_id
693: FROM ap_invoice_distributions_all d
694: WHERE d.invoice_distribution_id = p_inv_dist_id;
695:
696: l_curr_calling_sequence VARCHAR2(2000);
697: l_log_msg FND_LOG_MESSAGES.MESSAGE_TEXT%TYPE;

Line 718: l_parent_reversal_id ap_invoice_distributions_all.parent_reversal_id%TYPE;

714: l_security_context xla_events_pub_pkg.t_security;
715: l_event_check BOOLEAN;
716: l_process_dist BOOLEAN;
717: l_encum_flag VARCHAR2(1);
718: l_parent_reversal_id ap_invoice_distributions_all.parent_reversal_id%TYPE;
719: l_federal_enabled VARCHAR2(1);
720: l_parent_dist_id NUMBER;
721: l_distribution_type VARCHAR2(30);
722: l_po_accrue_flag VARCHAR2(1);

Line 755: FROM ap_invoice_distributions_all d

751: l_dist_amount,
752: l_line_number,
753: l_invoice_id,
754: l_prepay_distribution_id
755: FROM ap_invoice_distributions_all d
756: WHERE invoice_distribution_id = p_invoice_distribution_id;
757:
758: psa_utils.debug_other_string(g_state_level,l_api_name,'l_rev_dist_id= '||l_rev_dist_id);
759: psa_utils.debug_other_string(g_state_level,l_api_name,'l_prepay_distribution_id= '||l_prepay_distribution_id);

Line 765: FROM ap_invoice_distributions_all d

761: SELECT d.bc_event_id,
762: d.encumbered_flag
763: INTO l_bc_event_id,
764: l_encumbered_flag
765: FROM ap_invoice_distributions_all d
766: WHERE invoice_distribution_id = l_rev_dist_id;
767: IF (l_bc_event_id IS NULL AND NVL(l_encumbered_flag, 'N') IN ('N', 'R')) THEN
768: RETURN 'Y';
769: END IF;

Line 775: FROM ap_invoice_distributions_all d

771: SELECT d.bc_event_id,
772: d.encumbered_flag
773: INTO l_bc_event_id,
774: l_encumbered_flag
775: FROM ap_invoice_distributions_all d
776: WHERE invoice_distribution_id = l_prepay_distribution_id;
777: IF (l_bc_event_id IS NULL AND NVL(l_encumbered_flag, 'N') IN ('N', 'R')) THEN
778: RETURN 'Y';
779: END IF;

Line 947: UPDATE ap_invoice_distributions_all

943: ELSIF (l_PrepayProcessTab(i).prepay_flag = 'Y' AND is_unencumbered_prepay(l_PrepayProcessTab(i).inv_distribution_id) = 'Y') THEN
944: l_create_bc_event := FALSE;
945: psa_utils.debug_other_string(g_state_level,l_api_name,'Original Apply/Unapply Distribution not encumbered');
946:
947: UPDATE ap_invoice_distributions_all
948: SET encumbered_flag = 'R',
949: bc_event_id = null
950: WHERE invoice_distribution_id = l_PrepayProcessTab(i).inv_distribution_id;
951: psa_utils.debug_other_string(g_state_level,l_api_name,'No of prepay distributiuon encumbered set to R = '||SQL%ROWCOUNT);

Line 1115: UPDATE ap_invoice_distributions_all aid

1111: psa_utils.debug_other_string(g_state_level,l_api_name,'Number of rows updated of ap_prepay_app_dists: ' || SQL%ROWCOUNT);
1112: END IF;
1113:
1114: IF nvl(p_tab_fc_dist(i).SELF_ASSESSED_FLAG , 'N') = 'N' THEN
1115: UPDATE ap_invoice_distributions_all aid
1116: SET bc_event_id = l_event_id
1117: WHERE aid.invoice_id = p_tab_fc_dist(i).invoice_id
1118: AND aid.invoice_line_number = p_tab_fc_dist(i).inv_line_num
1119: AND aid.invoice_distribution_id = p_tab_fc_dist(i).inv_distribution_id;

Line 1120: psa_utils.debug_other_string(g_state_level,l_api_name,'Number of rows updated of ap_invoice_distributions_all: ' || SQL%ROWCOUNT);

1116: SET bc_event_id = l_event_id
1117: WHERE aid.invoice_id = p_tab_fc_dist(i).invoice_id
1118: AND aid.invoice_line_number = p_tab_fc_dist(i).inv_line_num
1119: AND aid.invoice_distribution_id = p_tab_fc_dist(i).inv_distribution_id;
1120: psa_utils.debug_other_string(g_state_level,l_api_name,'Number of rows updated of ap_invoice_distributions_all: ' || SQL%ROWCOUNT);
1121: ELSE -- added by KS
1122: UPDATE ap_self_assessed_tax_dist_all sad
1123: SET bc_event_id = l_event_id
1124: WHERE sad.invoice_id = p_tab_fc_dist(i).invoice_id

Line 1166: FROM ap_invoice_distributions_all aid1

1162: 'Checking - Same bc_event_id stamped for prepay as well non-prepay distributions');
1163:
1164: SELECT 'Same bc_event_id stamped for prepay as well non-prepay distributions'
1165: INTO l_sameBCevent
1166: FROM ap_invoice_distributions_all aid1
1167: WHERE aid1.invoice_id = p_tab_fc_dist(1).invoice_id
1168: AND isprepaydist(aid1.invoice_distribution_id,aid1.invoice_id,aid1.line_type_lookup_code)='Y'
1169: AND aid1.bc_event_id IN (SELECT aid2.bc_event_id
1170: FROM ap_invoice_distributions_all aid2

Line 1170: FROM ap_invoice_distributions_all aid2

1166: FROM ap_invoice_distributions_all aid1
1167: WHERE aid1.invoice_id = p_tab_fc_dist(1).invoice_id
1168: AND isprepaydist(aid1.invoice_distribution_id,aid1.invoice_id,aid1.line_type_lookup_code)='Y'
1169: AND aid1.bc_event_id IN (SELECT aid2.bc_event_id
1170: FROM ap_invoice_distributions_all aid2
1171: WHERE aid1.invoice_id = aid2.invoice_id
1172: AND isprepaydist( aid2.invoice_distribution_id,aid2.invoice_id,aid2.line_type_lookup_code)='N');
1173:
1174: x_return_status := Fnd_Api.G_Ret_Sts_Error;

Line 1565: FROM ap_invoice_distributions_all

1561: IS
1562:
1563: CURSOR c_get_parent_dist_id (p_inv_dist_id NUMBER) IS
1564: SELECT charge_applicable_to_dist_id
1565: FROM ap_invoice_distributions_all
1566: WHERE invoice_distribution_id = p_inv_dist_id;
1567: -- Bug-7484486 .Added AMOUNT COLUMN IN THE SELECT
1568:
1569: CURSOR c_get_parent_dist_type (p_inv_dist_id NUMBER) IS

Line 1572: FROM ap_invoice_distributions_all

1568:
1569: CURSOR c_get_parent_dist_type (p_inv_dist_id NUMBER) IS
1570: SELECT line_type_lookup_code parent_dist_type,
1571: amount parent_dist_amount
1572: FROM ap_invoice_distributions_all
1573: WHERE invoice_distribution_id = p_inv_dist_id;
1574:
1575: l_event_type_code VARCHAR2(30);
1576: l_parent_dist_id NUMBER;

Line 1657: FROM ap_invoice_distributions_all

1653: p_org_id NUMBER
1654: )
1655: IS
1656: SELECT 1
1657: FROM ap_invoice_distributions_all
1658: WHERE invoice_id = p_invoice_id
1659: AND invoice_distribution_id = p_invoice_dist_id
1660: AND org_id =p_org_id
1661: AND po_distribution_id is not null;

Line 1707: FROM ap_invoice_distributions D,

1703: I.vendor_id,
1704: I.vendor_site_id,
1705: decode(I.invoice_currency_code,SP.base_currency_code,1,nvl(PD.rate,1)),
1706: nvl(PLL.price_override,0)
1707: FROM ap_invoice_distributions D,
1708: ap_invoices_all I,
1709: ap_invoice_lines L,
1710: po_distributions PD,
1711: po_lines PL,

Line 1763: FROM ap_invoice_distributions_all

1759: p_inv_dist_id NUMBER
1760: ) IS
1761: SELECT parent_reversal_id,
1762: encumbered_flag
1763: FROM ap_invoice_distributions_all
1764: WHERE invoice_distribution_id = p_inv_dist_id;
1765:
1766: CURSOR c_get_bc_event_id
1767: (

Line 1771: FROM ap_invoice_distributions_all

1767: (
1768: p_inv_dist_id NUMBER
1769: ) IS
1770: SELECT bc_event_id
1771: FROM ap_invoice_distributions_all
1772: WHERE invoice_distribution_id = p_inv_dist_id;
1773:
1774:
1775:

Line 1849: l_parent_reversal_id AP_INVOICE_DISTRIBUTIONS_ALL.parent_reversal_id%TYPE;

1845: l_po_packet_id NUMBER;
1846: l_return_status VARCHAR2(10);
1847: l_process_dist BOOLEAN;
1848: l_encum_flag VARCHAR2(1);
1849: l_parent_reversal_id AP_INVOICE_DISTRIBUTIONS_ALL.parent_reversal_id%TYPE;
1850: l_bc_event_id NUMBER;
1851:
1852: BEGIN
1853:

Line 2169: ap_invoice_distributions_all dist,

2165:
2166: CURSOR cur_get_po_encum_rev_amt IS
2167: SELECT NVL(sum((NVL(dist.amount,0) - NVL(dist.amount_variance,0) - NVL(dist.quantity_variance,0))*nvl(pod.rate,1)), 0) po_reversed_encumbered_amount
2168: FROM xla_events evt,
2169: ap_invoice_distributions_all dist,
2170: po_distributions_all pod
2171: WHERE evt.event_status_code = 'P'
2172: AND ((p_start_gl_date is not null
2173: AND p_start_gl_date <= evt.transaction_date )

Line 2275: FROM ap_invoice_distributions_all

2271: (
2272: p_inv_dist_id NUMBER
2273: ) IS
2274: SELECT charge_applicable_to_dist_id
2275: FROM ap_invoice_distributions_all
2276: WHERE invoice_distribution_id = p_inv_dist_id;
2277:
2278: CURSOR c_get_parent_dist_type
2279: (

Line 2283: FROM ap_invoice_distributions_all

2279: (
2280: p_inv_dist_id NUMBER
2281: ) IS
2282: SELECT line_type_lookup_code parent_dist_type
2283: FROM ap_invoice_distributions_all
2284: WHERE invoice_distribution_id = p_inv_dist_id;
2285:
2286: l_parent_dist_id NUMBER;
2287: l_distribution_type VARCHAR2(30);