DBA Data[Home] [Help]

APPS.AP_WITHHOLDING_PKG dependencies on AP_INVOICES_ALL

Line 97: ap_invoices_all AI,

93: , AATD.awt_related_id
94: , aatd.checkrun_id
95: , TC.description --Bug5502917
96: FROM ap_awt_temp_distributions_all AATD,
97: ap_invoices_all AI,
98: ap_tax_codes_all TC,
99: ap_invoice_distributions_all AID --bug 7930936
100: WHERE AATD.invoice_id = InvId
101: AND AATD.group_id = GRP_ID

Line 139: FROM ap_invoices_all AI,

135: , AI.vat_code
136: , NVL(PV.federal_reportable_flag, 'N') federal_reportable_flag
137: , AI.vendor_site_id vendor_site_id
138: , AI.amount_applicable_to_discount
139: FROM ap_invoices_all AI,
140: po_vendors PV
141: WHERE PV.vendor_id(+) = DECODE(AI.invoice_type_lookup_code,'PAYMENT REQUEST', NULL, AI.vendor_id) --bug8272564
142: AND AI.invoice_id = InvId
143: FOR UPDATE of AI.invoice_id;

Line 156: ap_invoices_all AI,

152: , SUM(AATD.withholding_amount) AMOUNT
153: , SUM(AATD.base_withholding_amount) BASE_AMOUNT
154: , MIN(AATD.accounting_date) ACCOUNTING_DATE
155: FROM ap_awt_temp_distributions_all AATD,
156: ap_invoices_all AI,
157: ap_tax_codes_all TC,
158: ap_invoice_distributions_all AID --bug 7930936
159: WHERE AATD.invoice_id = InvId
160: AND AATD.invoice_id = AI.invoice_id

Line 275: ap_invoices_all ai

271: l_income_tax_region_flag,
272: l_income_tax_region_asp,
273: l_basecur
274: FROM ap_system_parameters_all asp,
275: ap_invoices_all ai
276: WHERE ai.org_id = asp.org_id
277: and ai.invoice_id = p_invoice_id;
278:
279: --bug 7930936

Line 1003: FROM AP_Invoices_All AI

999: from discount (if we opted the option exclude the freight from disc) */
1000: BEGIN
1001: SELECT AI.Exclude_Freight_From_Discount
1002: INTO l_exclude_freight_from_disc
1003: FROM AP_Invoices_All AI
1004: WHERE AI.Invoice_ID = P_Invoice_Id;
1005:
1006: debug_info := 'l_exclude_freight_from_disc ' || l_exclude_freight_from_disc;
1007: IF (G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN

Line 1249: UPDATE ap_invoices_all

1245: IF (G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN
1246: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||DBG_Loc,debug_info);
1247: END IF;
1248:
1249: UPDATE ap_invoices_all
1250: SET awt_flag = DECODE(P_Create_dists, 'APPROVAL', 'Y','BOTH','Y', NULL), --Bug6660355
1251: amount_applicable_to_discount = decode (sign(invoice_amount),
1252: -1, amount_applicable_to_discount,
1253: amount_applicable_to_discount

Line 1313: l_legal_entity_id ap_invoices_all.legal_entity_id%type;

1309: ta_payment_currency_code po_vendor_sites.payment_currency_code%TYPE;
1310: c_payment_cross_rate ap_invoices.payment_cross_rate%TYPE;
1311: c_payment_cross_rate_type ap_invoices.payment_cross_rate_type%TYPE;
1312: l_invoice_distribution_id ap_invoice_distributions.invoice_distribution_id%TYPE;
1313: l_legal_entity_id ap_invoices_all.legal_entity_id%type;
1314:
1315: l_set_of_books_id ap_invoices_all.set_of_books_id%type;
1316: l_batch_id ap_invoices_all.batch_id%type;
1317: l_org_id ap_invoices_all.org_id%type;

Line 1315: l_set_of_books_id ap_invoices_all.set_of_books_id%type;

1311: c_payment_cross_rate_type ap_invoices.payment_cross_rate_type%TYPE;
1312: l_invoice_distribution_id ap_invoice_distributions.invoice_distribution_id%TYPE;
1313: l_legal_entity_id ap_invoices_all.legal_entity_id%type;
1314:
1315: l_set_of_books_id ap_invoices_all.set_of_books_id%type;
1316: l_batch_id ap_invoices_all.batch_id%type;
1317: l_org_id ap_invoices_all.org_id%type;
1318: l_period_name gl_period_statuses.period_name%type;
1319:

Line 1316: l_batch_id ap_invoices_all.batch_id%type;

1312: l_invoice_distribution_id ap_invoice_distributions.invoice_distribution_id%TYPE;
1313: l_legal_entity_id ap_invoices_all.legal_entity_id%type;
1314:
1315: l_set_of_books_id ap_invoices_all.set_of_books_id%type;
1316: l_batch_id ap_invoices_all.batch_id%type;
1317: l_org_id ap_invoices_all.org_id%type;
1318: l_period_name gl_period_statuses.period_name%type;
1319:
1320: l_line_number ap_invoice_lines_all.line_number%type;

Line 1317: l_org_id ap_invoices_all.org_id%type;

1313: l_legal_entity_id ap_invoices_all.legal_entity_id%type;
1314:
1315: l_set_of_books_id ap_invoices_all.set_of_books_id%type;
1316: l_batch_id ap_invoices_all.batch_id%type;
1317: l_org_id ap_invoices_all.org_id%type;
1318: l_period_name gl_period_statuses.period_name%type;
1319:
1320: l_line_number ap_invoice_lines_all.line_number%type;
1321: l_dist_number ap_invoice_distributions_all.distribution_line_number%type;

Line 1379: ap_invoices_all AI

1375: , APID.awt_related_id awt_related_id -- bug 9913164
1376: FROM ap_invoice_distributions_all APID,
1377: ap_invoice_distributions_all APID1,
1378: ap_tax_codes_all ATC,
1379: ap_invoices_all AI
1380: WHERE (APID.invoice_id = InvId)
1381: AND (APID.invoice_line_number = NVL(P_Inv_Line_No,line_num))
1382: AND (APID.distribution_line_number = NVL(P_dist_Line_No,APID.distribution_line_number))
1383: AND (APID.line_type_lookup_code = 'AWT')

Line 1429: ap_invoices_all AI

1425: , APID.awt_related_id awt_related_id -- bug 9913164
1426: FROM ap_invoice_distributions_all APID,
1427: ap_invoice_distributions_all APID1,
1428: ap_tax_codes_all ATC,
1429: ap_invoices_all AI
1430: WHERE (APID.invoice_id = InvId)
1431: AND (APID.invoice_line_number = NVL(P_Inv_Line_No,line_num))
1432: AND (APID.distribution_line_number = NVL(P_dist_Line_No,APID.distribution_line_number))
1433: AND (APID.line_type_lookup_code = 'AWT')

Line 1471: AP_INVOICES_ALL AI

1467: , APID.invoice_line_number
1468: FROM ap_invoice_distributions_all APID,
1469: ap_invoice_distributions_all APID1,
1470: ap_tax_codes_all ATC,
1471: AP_INVOICES_ALL AI
1472: WHERE (APID.invoice_id = InvId)
1473: AND (APID.line_type_lookup_code = 'AWT')
1474: AND (NVL(APID.awt_flag , 'M' ) = 'A' )
1475: AND APID.WITHHOLDING_TAX_CODE_ID = ATC.tax_id

Line 1508: AP_INVOICES_ALL AI

1504: , APID.invoice_line_number
1505: FROM ap_invoice_distributions_all APID,
1506: ap_invoice_distributions_all APID1,
1507: ap_tax_codes_all ATC,
1508: AP_INVOICES_ALL AI
1509: WHERE (APID.invoice_id = InvId)
1510: AND (APID.line_type_lookup_code = 'AWT')
1511: AND (NVL(APID.awt_flag , 'M' ) = 'A' )
1512: AND APID.WITHHOLDING_TAX_CODE_ID = ATC.tax_id

Line 1557: , ap_invoices_all i

1553: i.set_of_books_id,
1554: i.batch_id,
1555: i.org_id
1556: FROM po_vendors v
1557: , ap_invoices_all i
1558: WHERE (v.vendor_id = i.vendor_id)
1559: AND (i.invoice_id = InvId);
1560:
1561: DBG_Loc VARCHAR2(30) := 'Create_AWT_Invoices';

Line 1607: --ap_invoices_all and ap_invoice_lines_all

1603:
1604:
1605: --Bug 8266021 inv cursor called based on calling module
1606: --This cursor will fetch info required to insert into
1607: --ap_invoices_all and ap_invoice_lines_all
1608: debug_info := 'OPEN CURSOR c_awt_invs';
1609:
1610: IF (P_Calling_Module in ('CANCEL INVOICE','REVERSE DIST','VOID PAYMENT')) THEN
1611: OPEN c_awt_invs_rev (P_Invoice_Id);

Line 1821: FROM ap_invoices_all

1817: SELECT invoice_received_date,
1818: goods_received_date
1819: INTO invoice_received_date,
1820: goods_received_date
1821: FROM ap_invoices_all
1822: WHERE invoice_id = P_Invoice_Id;
1823: END IF;
1824:
1825: --added for bug 8266021 to fetch period

Line 1847: INSERT INTO ap_invoices_all

1843: IF (G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN
1844: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||DBG_Loc,debug_info);
1845: END IF;
1846:
1847: INSERT INTO ap_invoices_all
1848: (invoice_id
1849: ,last_UPDATE_date
1850: ,last_UPDATEd_by
1851: ,vendor_id

Line 2759: ap_invoices_all ai

2755: l_awt_flag,
2756: l_inv_curr_code,
2757: l_org_id --4742265
2758: FROM ap_system_parameters_all asp,
2759: ap_invoices_all ai
2760: WHERE ai.org_id = asp.org_id
2761: and ai.invoice_id = p_invoice_id;
2762:
2763: --Bug6660355

Line 3043: ap_invoices_all AI,

3039: , NVL(asp.awt_include_discount_amt, 'N') include_discount_amt
3040: , asp.base_currency_code
3041: , NVL(ASI.payment_exchange_rate,1) payment_exchange_rate --bug 8590059
3042: FROM ap_SELECTed_invoices_all ASI,
3043: ap_invoices_all AI,
3044: ap_system_parameters_all asp
3045: WHERE ASI.checkrun_name = l_checkrun_name
3046: AND asi.checkrun_id = l_checkrun_id
3047: AND AI.invoice_id = ASI.invoice_id

Line 3551: , ap_invoices_all AI

3547: SELECT ASI.invoice_id
3548: , ASI.payment_num
3549: , AI.vendor_id
3550: FROM ap_SELECTed_invoices_all ASI
3551: , ap_invoices_all AI
3552: WHERE ASI.checkrun_name = l_checkrun_name
3553: AND AI.invoice_id = ASI.invoice_id
3554: and asi.checkrun_id = l_checkrun_id;
3555:

Line 3563: , ap_invoices_all AI

3559: SELECT ASI.invoice_id
3560: , ASI.payment_num
3561: , AI.vendor_id
3562: FROM ap_SELECTed_invoices_all ASI
3563: , ap_invoices_all AI
3564: , iby_fd_docs_payable_v ibydocs
3565: WHERE ASI.checkrun_name = p_checkrun_name
3566: AND AI.invoice_id = ASI.invoice_id
3567: and asi.checkrun_id = p_checkrun_id

Line 3736: ap_invoices_all AI,

3732: , AATD.tax_rate_id
3733: , TC.tax_id tax_code_id
3734: , aatd.checkrun_id
3735: FROM ap_awt_temp_distributions_all AATD,
3736: ap_invoices_all AI,
3737: ap_tax_codes_all TC
3738: WHERE AATD.invoice_id = InvId
3739: AND AATD.invoice_id = AI.invoice_id
3740: AND TC.name(+) = AATD.tax_name

Line 3775: ap_invoices_all AI,

3771: , TC.tax_id tax_code_id
3772: , aatd.checkrun_id
3773: , AATD.accounting_date
3774: FROM ap_awt_temp_distributions_all AATD,
3775: ap_invoices_all AI,
3776: ap_tax_codes_all TC
3777: WHERE AATD.invoice_id = InvId
3778: AND AATD.invoice_id = AI.invoice_id
3779: AND TC.name(+) = AATD.tax_name

Line 4643: FROM AP_INVOICES_ALL AI

4639:
4640: IF (P_Calling_Module in ('CANCEL INVOICE','REVERSE DIST')) THEN
4641: SELECT AI.org_id
4642: INTO l_org_id
4643: FROM AP_INVOICES_ALL AI
4644: WHERE invoice_id = P_Parent_Id;
4645:
4646: ELSIF (P_Calling_Module = 'VOID PAYMENT') THEN
4647: SELECT AIP.org_id

Line 5725: ap_invoices_all AI

5721: ,PaymNum IN NUMBER)
5722: is
5723: select ai.vendor_id, aatd.accounting_date, aatd.tax_name, aatd.withholding_amount
5724: from ap_awt_temp_distributions_all AATD,
5725: ap_invoices_all AI
5726: where aatd.invoice_id = InvId
5727: and AATD.invoice_id = AI.invoice_id
5728: AND ( PaymNum IS NULL
5729: OR AATD.payment_num = PaymNum)

Line 5741: ap_invoices_all AI

5737: ,PaymNum IN NUMBER)
5738: is
5739: select ai.vendor_id, aatd.accounting_date, aatd.tax_name, aatd.gross_amount
5740: from ap_awt_temp_distributions_all AATD,
5741: ap_invoices_all AI
5742: where aatd.invoice_id = InvId
5743: and AATD.invoice_id = AI.invoice_id
5744: AND ( PaymNum IS NULL
5745: OR AATD.payment_num = PaymNum)