DBA Data[Home] [Help]

APPS.PSA_AP_BC_PVT dependencies on AP_INVOICE_DISTRIBUTIONS_ALL

Line 143: UPDATE ap_invoice_distributions_all

139: l_events_tab(i).event_status_code ||' '||
140: l_events_tab(i).process_status_code);
141:
142: 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.');
143: UPDATE ap_invoice_distributions_all
144: SET bc_event_id = NULL
145: WHERE bc_event_id = l_events_tab(i).event_id;
146: psa_utils.debug_other_string(g_state_level,l_api_name,'# distributions in ap_invoice_distributions_all has been updated to NULL:'||SQL%ROWCOUNT);
147:

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

142: 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.');
143: UPDATE ap_invoice_distributions_all
144: SET bc_event_id = NULL
145: WHERE bc_event_id = l_events_tab(i).event_id;
146: psa_utils.debug_other_string(g_state_level,l_api_name,'# distributions in ap_invoice_distributions_all has been updated to NULL:'||SQL%ROWCOUNT);
147:
148: UPDATE ap_prepay_history_all aph
149: SET aph.bc_event_id = NULL
150: WHERE aph.bc_event_id = l_events_tab(i).event_id;

Line 208: FROM ap_invoice_distributions_all aid, xla_events xe

204:
205:
206: CURSOR c_parent_prepayapply_processed(p_prepayapply_dist_id number) IS
207: SELECT 'Y'
208: FROM ap_invoice_distributions_all aid, xla_events xe
209: WHERE aid.invoice_distribution_id=p_prepayapply_dist_id
210: --l_parent_reversal_id
211: AND aid.bc_event_id = xe.event_id
212: AND xe.event_status_code = 'P'

Line 224: (SELECT '1' FROM ap_invoice_distributions_all

220: CURSOR c_exists_encumline (p_event_id NUMBER,
221: p_invoice_id NUMBER) IS
222: SELECT 'Encumbered line exist' from dual
223: WHERE EXISTS
224: (SELECT '1' FROM ap_invoice_distributions_all
225: WHERE bc_event_id = p_event_id
226: AND invoice_id = p_invoice_id
227: AND encumbered_flag = 'Y'
228: );

Line 232: FROM ap_invoice_distributions_all

228: );
229:
230: CURSOR c_get_dist_info (p_inv_dist_id NUMBER) IS
231: SELECT parent_reversal_id, encumbered_flag
232: FROM ap_invoice_distributions_all
233: WHERE invoice_distribution_id = p_inv_dist_id;
234:
235: CURSOR c_get_parent_dist_id (p_inv_dist_id NUMBER) IS
236: SELECT charge_applicable_to_dist_id

Line 237: FROM ap_invoice_distributions_all

233: WHERE invoice_distribution_id = p_inv_dist_id;
234:
235: CURSOR c_get_parent_dist_id (p_inv_dist_id NUMBER) IS
236: SELECT charge_applicable_to_dist_id
237: FROM ap_invoice_distributions_all
238: WHERE invoice_distribution_id = p_inv_dist_id;
239:
240: CURSOR c_get_parent_dist_type (p_inv_dist_id NUMBER) IS
241: SELECT LINE_TYPE_LOOKUP_CODE parent_dist_type

Line 242: FROM ap_invoice_distributions_all

238: WHERE invoice_distribution_id = p_inv_dist_id;
239:
240: CURSOR c_get_parent_dist_type (p_inv_dist_id NUMBER) IS
241: SELECT LINE_TYPE_LOOKUP_CODE parent_dist_type
242: FROM ap_invoice_distributions_all
243: WHERE invoice_distribution_id = p_inv_dist_id;
244:
245: CURSOR c_chk_accrue_flag (p_inv_dist_id NUMBER) IS
246: SELECT NVL(pod.accrue_on_receipt_flag,'N')

Line 247: FROM ap_invoice_distributions_all D,

243: WHERE invoice_distribution_id = p_inv_dist_id;
244:
245: CURSOR c_chk_accrue_flag (p_inv_dist_id NUMBER) IS
246: SELECT NVL(pod.accrue_on_receipt_flag,'N')
247: FROM ap_invoice_distributions_all D,
248: po_distributions_all pod
249: WHERE D.invoice_distribution_id = p_inv_dist_id
250: AND D.po_distribution_id IS NOT NULL
251: AND D.po_distribution_id = pod.po_distribution_id;

Line 255: FROM ap_invoice_distributions_all D

251: AND D.po_distribution_id = pod.po_distribution_id;
252:
253: CURSOR c_chk_prepayment_match_po (p_inv_dist_id NUMBER) IS
254: SELECT D.po_distribution_id
255: FROM ap_invoice_distributions_all D
256: WHERE D.invoice_distribution_id = p_inv_dist_id;
257:
258: l_curr_calling_sequence VARCHAR2(2000);
259: l_log_msg FND_LOG_MESSAGES.MESSAGE_TEXT%TYPE;

Line 281: l_parent_reversal_id AP_INVOICE_DISTRIBUTIONS_ALL.parent_reversal_id%TYPE;

277: l_event_check BOOLEAN;
278: dummy VARCHAR2(200);
279: l_process_dist BOOLEAN;
280: l_encum_flag VARCHAR2(1);
281: l_parent_reversal_id AP_INVOICE_DISTRIBUTIONS_ALL.parent_reversal_id%TYPE;
282: l_federal_enabled VARCHAR2(1);
283: l_parent_dist_id NUMBER;
284: l_distribution_type VARCHAR2(30);
285: l_po_accrue_flag VARCHAR2(1);

Line 543: UPDATE ap_invoice_distributions_all

539: --IF p_bc_mode = 'C' THEN
540:
541: psa_utils.debug_other_string(g_state_level,l_api_name,'Updating bc_event_id to NULL for other distributions.');
542:
543: UPDATE ap_invoice_distributions_all
544: SET bc_event_id = NULL
545: WHERE bc_event_id = p_tab_fc_dist(i).bc_event_id
546: AND invoice_id = p_tab_fc_dist(i).invoice_id
547: AND invoice_distribution_id <> p_tab_fc_dist(i).inv_distribution_id;

Line 637: UPDATE ap_invoice_distributions_all aid

633: apad.bc_event_id = p_tab_fc_dist(i).bc_event_id);
634: psa_utils.debug_other_string(g_state_level,l_api_name,'Number of rows updated of ap_prepay_app_dists: ' || SQL%ROWCOUNT);
635: END IF;
636: IF nvl(p_tab_fc_dist(i).SELF_ASSESSED_FLAG , 'N') = 'N' THEN
637: UPDATE ap_invoice_distributions_all aid
638: SET bc_event_id = l_event_id
639: WHERE aid.invoice_id = p_tab_fc_dist(i).invoice_id
640: AND aid.invoice_line_number = p_tab_fc_dist(i).inv_line_num
641: AND aid.invoice_distribution_id = p_tab_fc_dist(i).inv_distribution_id;

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

638: SET bc_event_id = l_event_id
639: WHERE aid.invoice_id = p_tab_fc_dist(i).invoice_id
640: AND aid.invoice_line_number = p_tab_fc_dist(i).inv_line_num
641: AND aid.invoice_distribution_id = p_tab_fc_dist(i).inv_distribution_id;
642: psa_utils.debug_other_string(g_state_level,l_api_name,'Number of rows updated of ap_invoice_distributions_all: ' || SQL%ROWCOUNT);
643: ELSE -- added by KS
644:
645: UPDATE ap_self_assessed_tax_dist_all sad
646: SET bc_event_id = l_event_id

Line 685: FROM ap_invoice_distributions_all aid1

681: 'Checking - Same bc_event_id stamped for prepay as well non-prepay distributions');
682:
683: SELECT 'Same bc_event_id stamped for prepay as well non-prepay distributions'
684: INTO l_sameBCevent
685: FROM ap_invoice_distributions_all aid1
686: WHERE aid1.invoice_id = p_tab_fc_dist(1).invoice_id
687: AND isprepaydist( aid1.invoice_distribution_id
688: ,aid1.invoice_id
689: ,aid1.line_type_lookup_code)='Y'

Line 691: FROM ap_invoice_distributions_all aid2

687: AND isprepaydist( aid1.invoice_distribution_id
688: ,aid1.invoice_id
689: ,aid1.line_type_lookup_code)='Y'
690: AND aid1.bc_event_id IN (SELECT aid2.bc_event_id
691: FROM ap_invoice_distributions_all aid2
692: WHERE aid1.invoice_id = aid2.invoice_id
693: AND isprepaydist( aid2.invoice_distribution_id
694: ,aid2.invoice_id
695: ,aid2.line_type_lookup_code)='N');

Line 1079: FROM ap_invoice_distributions_all

1075: IS
1076:
1077: CURSOR c_get_parent_dist_id (p_inv_dist_id NUMBER) IS
1078: SELECT charge_applicable_to_dist_id
1079: FROM ap_invoice_distributions_all
1080: WHERE invoice_distribution_id = p_inv_dist_id;
1081: -- Bug-7484486 .Added AMOUNT COLUMN IN THE SELECT
1082:
1083: CURSOR c_get_parent_dist_type (p_inv_dist_id NUMBER) IS

Line 1085: ,AMOUNT parent_dist_amount FROM ap_invoice_distributions_all

1081: -- Bug-7484486 .Added AMOUNT COLUMN IN THE SELECT
1082:
1083: CURSOR c_get_parent_dist_type (p_inv_dist_id NUMBER) IS
1084: SELECT LINE_TYPE_LOOKUP_CODE parent_dist_type
1085: ,AMOUNT parent_dist_amount FROM ap_invoice_distributions_all
1086: WHERE invoice_distribution_id = p_inv_dist_id;
1087:
1088: l_event_type_code VARCHAR2(30);
1089: l_parent_dist_id NUMBER;

Line 1166: FROM AP_INVOICE_DISTRIBUTIONS_ALL

1162: ,p_invoice_dist_id NUMBER
1163: ,p_org_id NUMBER)
1164: IS
1165: SELECT 1
1166: FROM AP_INVOICE_DISTRIBUTIONS_ALL
1167: WHERE invoice_id = p_invoice_id
1168: AND invoice_distribution_id = p_invoice_dist_id
1169: AND org_id =p_org_id
1170: AND po_distribution_id is not null;

Line 1271: FROM ap_invoice_distributions_all

1267: AND H.hold_lookup_code <> 'INSUFFICIENT FUNDS'));
1268:
1269: CURSOR c_get_dist_info (p_inv_dist_id NUMBER) IS
1270: SELECT parent_reversal_id, encumbered_flag
1271: FROM ap_invoice_distributions_all
1272: WHERE invoice_distribution_id = p_inv_dist_id;
1273:
1274: CURSOR c_get_bc_event_id (p_inv_dist_id NUMBER) IS
1275: SELECT bc_event_id

Line 1276: FROM ap_invoice_distributions_all

1272: WHERE invoice_distribution_id = p_inv_dist_id;
1273:
1274: CURSOR c_get_bc_event_id (p_inv_dist_id NUMBER) IS
1275: SELECT bc_event_id
1276: FROM ap_invoice_distributions_all
1277: WHERE invoice_distribution_id = p_inv_dist_id;
1278:
1279:
1280:

Line 1353: l_parent_reversal_id AP_INVOICE_DISTRIBUTIONS_ALL.parent_reversal_id%TYPE;

1349: l_po_packet_id NUMBER;
1350: l_return_status VARCHAR2(10);
1351: l_process_dist BOOLEAN;
1352: l_encum_flag VARCHAR2(1);
1353: l_parent_reversal_id AP_INVOICE_DISTRIBUTIONS_ALL.parent_reversal_id%TYPE;
1354: l_bc_event_id NUMBER;
1355:
1356: BEGIN
1357:

Line 1669: ,ap_invoice_distributions_all dist

1665:
1666: CURSOR cur_get_po_encum_rev_amt IS
1667: 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
1668: FROM xla_events evt
1669: ,ap_invoice_distributions_all dist
1670: ,po_distributions_all pod
1671: WHERE evt.event_status_code = 'P'
1672: AND ( ( p_start_gl_date is not null
1673: and p_start_gl_date <= evt.transaction_date ) or

Line 1688: /* and dist.invoice_distribution_id not in(select aid.invoice_distribution_id from ap_invoice_distributions_all aid

1684: AND dist.po_distribution_id = P_PO_Distribution_Id
1685: AND dist.po_distribution_id = pod.po_distribution_id
1686: AND dist.line_type_lookup_code NOT IN ('IPV', 'ERV', 'TIPV', 'TERV', 'TRV', 'QV', 'AV') -- added due to bug 5639595
1687: -- ADDED TO RESOLVE SDSU ISSE and need to be revisited
1688: /* and dist.invoice_distribution_id not in(select aid.invoice_distribution_id from ap_invoice_distributions_all aid
1689: where aid.line_type_lookup_code='NONREC_TAX'
1690: and charge_applicable_to_dist_id
1691: in(select invoice_distribution_id from ap_invoice_distributions_all
1692: where bc_event_id is null

Line 1691: in(select invoice_distribution_id from ap_invoice_distributions_all

1687: -- ADDED TO RESOLVE SDSU ISSE and need to be revisited
1688: /* and dist.invoice_distribution_id not in(select aid.invoice_distribution_id from ap_invoice_distributions_all aid
1689: where aid.line_type_lookup_code='NONREC_TAX'
1690: and charge_applicable_to_dist_id
1691: in(select invoice_distribution_id from ap_invoice_distributions_all
1692: where bc_event_id is null
1693: and historical_flag ='Y'))*/
1694: -- added by ks not to pick PO that has data in 11i
1695: and not exists (

Line 1797: FROM ap_invoice_distributions_all

1793: ) RETURN VARCHAR2
1794: IS
1795: CURSOR c_get_parent_dist_id (p_inv_dist_id NUMBER) IS
1796: SELECT charge_applicable_to_dist_id
1797: FROM ap_invoice_distributions_all
1798: WHERE invoice_distribution_id = p_inv_dist_id;
1799:
1800: CURSOR c_get_parent_dist_type (p_inv_dist_id NUMBER) IS
1801: SELECT LINE_TYPE_LOOKUP_CODE parent_dist_type

Line 1802: FROM ap_invoice_distributions_all

1798: WHERE invoice_distribution_id = p_inv_dist_id;
1799:
1800: CURSOR c_get_parent_dist_type (p_inv_dist_id NUMBER) IS
1801: SELECT LINE_TYPE_LOOKUP_CODE parent_dist_type
1802: FROM ap_invoice_distributions_all
1803: WHERE invoice_distribution_id = p_inv_dist_id;
1804:
1805: l_parent_dist_id NUMBER;
1806: l_distribution_type VARCHAR2(30);