DBA Data[Home] [Help]

APPS.JAI_AP_DTC_GENERATION_PKG dependencies on AP_INVOICE_DISTRIBUTIONS_ALL

Line 75: from ap_invoice_distributions_all

71: --PRAGMA AUTONOMOUS_TRANSACTION; --commented by Cholei for ZX integration bug#14040855
72: cursor c_get_dist_prepay(p_invoice_id number) is
73: --select prepay_distribution_id, amount --Comments by Jia for FP Bug#7431371
74: select prepay_distribution_id, sum(amount) amount --Modified by Jia for FP Bug#7431371
75: from ap_invoice_distributions_all
76: where invoice_id = p_invoice_id
77: --Added the following clause to select the prepayment amounts with the same section type as the distribution - Bug 11070443
78: and
79: ((pn_section_type = 'TDS_SECTION' and global_attribute1 is not null)

Line 87: from ap_invoice_distributions_all

83: group by prepay_distribution_id; --Addec by Jia for FP Bug#7431371
84:
85: cursor c_get_prepay_inv(p_prepay_dist_id number) is
86: select invoice_id
87: from ap_invoice_distributions_all
88: where invoice_distribution_id = p_prepay_dist_id;
89:
90: cursor c_prepay_tds_cal(p_invoice_id number) is --Xiao for Bug#6767347
91: select 1 from

Line 172: from AP_INVOICE_DISTRIBUTIONS_ALL

168:
169: cursor c_chk_tax_exists(cn_invoice_id number)
170: is
171: select count(1)
172: from AP_INVOICE_DISTRIBUTIONS_ALL
173: where invoice_id = cn_invoice_id
174: and invoice_distribution_id not in
175: (
176: select invoice_distribution_id

Line 250: from AP_INVOICE_DISTRIBUTIONS_ALL dist,

246:
247: cursor c_chk_amount_chg(cn_invoice_id number)
248: is
249: select dist.invoice_id, dist.INVOICE_DISTRIBUTION_ID,nvl(dist.amount-sum(tax.amount),0) diff
250: from AP_INVOICE_DISTRIBUTIONS_ALL dist,
251: JAI_AP_TDS_INV_TAXES tax
252: where dist.invoice_id = tax.invoice_id
253: and dist.INVOICE_DISTRIBUTION_ID = tax.INVOICE_DISTRIBUTION_ID
254: and tax.threshold_transition is null

Line 278: 1).exists in jai_ap_tds_default but not in ap_invoice_distributions_all.

274: --Added by Chong.lei for Bug#13782492 on 20120301 begin
275: --------------------------------------------------------------------
276: /*Given invoice_id, check all distriutions line in this invoice
277: count distribution line:
278: 1).exists in jai_ap_tds_default but not in ap_invoice_distributions_all.
279: 2).exists in ap_invoice_distributions_all but not in jai_ap_tds_default.
280: 3).both exist in this two tables but with diff accounting date.
281:
282: return pn_diff > 0, then need redefaultation.

Line 279: 2).exists in ap_invoice_distributions_all but not in jai_ap_tds_default.

275: --------------------------------------------------------------------
276: /*Given invoice_id, check all distriutions line in this invoice
277: count distribution line:
278: 1).exists in jai_ap_tds_default but not in ap_invoice_distributions_all.
279: 2).exists in ap_invoice_distributions_all but not in jai_ap_tds_default.
280: 3).both exist in this two tables but with diff accounting date.
281:
282: return pn_diff > 0, then need redefaultation.
283: */

Line 290: 1).exists in jai_ap_tds_default but not in ap_invoice_distributions_all.

286: pn_cnt out nocopy number
287: )is
288: --PRAGMA AUTONOMOUS_TRANSACTION; --commented by Cholei for ZX integration bug#14040855
289: /*Check distribution line:
290: 1).exists in jai_ap_tds_default but not in ap_invoice_distributions_all.
291: 2).exists in ap_invoice_distributions_all but not in jai_ap_tds_default.
292: 3).both exist in this two tables but with diff accounting date.
293: */
294: cursor c_changed_acdate(cn_invoice_id number)

Line 291: 2).exists in ap_invoice_distributions_all but not in jai_ap_tds_default.

287: )is
288: --PRAGMA AUTONOMOUS_TRANSACTION; --commented by Cholei for ZX integration bug#14040855
289: /*Check distribution line:
290: 1).exists in jai_ap_tds_default but not in ap_invoice_distributions_all.
291: 2).exists in ap_invoice_distributions_all but not in jai_ap_tds_default.
292: 3).both exist in this two tables but with diff accounting date.
293: */
294: cursor c_changed_acdate(cn_invoice_id number)
295: is

Line 300: ap_invoice_distributions_all aida on (

296: select sum(
297: decode(to_char(trunc(aida.accounting_date),'YYYYMMDD'), to_char(trunc(jatd.accounting_date),'YYYYMMDD'), 0, 1)
298: )
299: from jai_ap_tds_default jatd full outer join
300: ap_invoice_distributions_all aida on (
301: jatd.invoice_distribution_id = aida.invoice_distribution_id
302: and jatd.invoice_id = aida.invoice_id
303: )
304: where (aida.invoice_id = cn_invoice_id or jatd.invoice_id = cn_invoice_id)

Line 333: FROM ap_invoice_distributions_all

329: --PRAGMA AUTONOMOUS_TRANSACTION; --commented by Cholei for ZX integration bug#14040855
330: CURSOR c_CCID(c_invoice_distribution_id NUMBER
331: ) IS
332: SELECT dist_code_combination_id
333: FROM ap_invoice_distributions_all
334: WHERE invoice_distribution_id = c_invoice_distribution_id;
335: begin
336:
337: OPEN c_CCID(pn_invoice_distribution_id);

Line 358: FROM AP_INVOICE_DISTRIBUTIONS_ALL AIDA, JAI_AP_TDS_INV_TAXES JATIT

354:
355: cursor c_get_non_match_dist(cn_invoice_id number)
356: is
357: SELECT count(1)
358: FROM AP_INVOICE_DISTRIBUTIONS_ALL AIDA, JAI_AP_TDS_INV_TAXES JATIT
359: WHERE AIDA.INVOICE_ID = JATIT.INVOICE_ID
360: and aida.invoice_id = cn_invoice_id
361: AND AIDA.INVOICE_DISTRIBUTION_ID = JATIT.INVOICE_DISTRIBUTION_ID
362: AND AIDA.DIST_CODE_COMBINATION_ID <> JATIT.DIST_CODE_COMBINATION_ID

Line 393: from ap_invoice_distributions_all

389: cursor get_result
390: is
391: --select get_natural_account(dist_code_combination_id)
392: select JAI_AP_UTILS_PKG.GET_NATURAL_ACCOUNT_VALUE(dist_code_combination_id,pv_segment_name)
393: from ap_invoice_distributions_all
394: where invoice_id = pn_invoice_id
395: and invoice_distribution_id = pn_invoice_distribution_id;
396:
397:

Line 423: FROM AP_INVOICE_DISTRIBUTIONS_ALL

419: from dual
420: where exists
421: (
422: SELECT INVOICE_ID
423: FROM AP_INVOICE_DISTRIBUTIONS_ALL
424: WHERE INVOICE_DISTRIBUTION_ID IN
425: (
426: SELECT PREPAY_DISTRIBUTION_ID
427: FROM AP_INVOICE_DISTRIBUTIONS_ALL

Line 427: FROM AP_INVOICE_DISTRIBUTIONS_ALL

423: FROM AP_INVOICE_DISTRIBUTIONS_ALL
424: WHERE INVOICE_DISTRIBUTION_ID IN
425: (
426: SELECT PREPAY_DISTRIBUTION_ID
427: FROM AP_INVOICE_DISTRIBUTIONS_ALL
428: WHERE LINE_TYPE_LOOKUP_CODE = 'PREPAY'
429: AND INVOICE_ID = cn_invoice_id
430: )
431: AND NOT EXISTS (

Line 461: FROM AP_INVOICE_DISTRIBUTIONS_ALL

457: from dual
458: where not exists
459: (
460: SELECT PREPAY_DISTRIBUTION_ID
461: FROM AP_INVOICE_DISTRIBUTIONS_ALL
462: WHERE LINE_TYPE_LOOKUP_CODE = 'PREPAY'
463: AND INVOICE_ID = cn_invoice_id
464: );
465:

Line 534: FROM AP_INVOICE_DISTRIBUTIONS_ALL DIST

530: AND (
531: EXISTS
532: (
533: SELECT DIST.INVOICE_ID
534: FROM AP_INVOICE_DISTRIBUTIONS_ALL DIST
535: WHERE DIST.INVOICE_DISTRIBUTION_ID IN
536: (
537: SELECT PREPAY_DISTRIBUTION_ID
538: FROM AP_INVOICE_DISTRIBUTIONS_ALL

Line 538: FROM AP_INVOICE_DISTRIBUTIONS_ALL

534: FROM AP_INVOICE_DISTRIBUTIONS_ALL DIST
535: WHERE DIST.INVOICE_DISTRIBUTION_ID IN
536: (
537: SELECT PREPAY_DISTRIBUTION_ID
538: FROM AP_INVOICE_DISTRIBUTIONS_ALL
539: WHERE LINE_TYPE_LOOKUP_CODE = ''PREPAY''
540: AND INVOICE_ID = JATIT.INVOICE_ID
541: )
542: AND

Line 571: FROM AP_INVOICE_DISTRIBUTIONS_ALL

567: OR
568: NOT EXISTS
569: (
570: SELECT PREPAY_DISTRIBUTION_ID
571: FROM AP_INVOICE_DISTRIBUTIONS_ALL
572: WHERE LINE_TYPE_LOOKUP_CODE = ''PREPAY''
573: AND INVOICE_ID = JATIT.INVOICE_ID
574: )
575: )

Line 675: FROM AP_INVOICE_DISTRIBUTIONS_ALL DIST

671: )
672: )
673: AND EXISTS (
674: SELECT DIST.INVOICE_ID
675: FROM AP_INVOICE_DISTRIBUTIONS_ALL DIST
676: WHERE DIST.INVOICE_DISTRIBUTION_ID IN (
677: SELECT PREPAY_DISTRIBUTION_ID
678: FROM AP_INVOICE_DISTRIBUTIONS_ALL
679: WHERE LINE_TYPE_LOOKUP_CODE = ''PREPAY''

Line 678: FROM AP_INVOICE_DISTRIBUTIONS_ALL

674: SELECT DIST.INVOICE_ID
675: FROM AP_INVOICE_DISTRIBUTIONS_ALL DIST
676: WHERE DIST.INVOICE_DISTRIBUTION_ID IN (
677: SELECT PREPAY_DISTRIBUTION_ID
678: FROM AP_INVOICE_DISTRIBUTIONS_ALL
679: WHERE LINE_TYPE_LOOKUP_CODE = ''PREPAY''
680: AND INVOICE_ID = JATIT.INVOICE_ID
681: )
682: AND EXISTS (

Line 758: FROM JAI_AP_TDS_INV_TAXES JATIT, AP_INVOICE_DISTRIBUTIONS_ALL AIDA

754:
755: --Updated by Chong.Lei for bug#13787158 begin
756: -----------------------------------------------------------------------------------------------------
757: /* lv_sql := 'SELECT JATIT.INVOICE_ID, SUM (nvl(AIDA.PREPAY_AMOUNT_REMAINING,aida.amount)) AMOUNT, JATIT.ACTUAL_SECTION_CODE, JATIT.TAX_CATEGORY_ID
758: FROM JAI_AP_TDS_INV_TAXES JATIT, AP_INVOICE_DISTRIBUTIONS_ALL AIDA
759: WHERE JATIT.INVOICE_ID <> $$P_INVOICE_ID$$
760: AND (
761: ( JATIT.TAX_LINE_NO <> 0 and JATIT.TAX_CATEGORY_ID IS NOT NULL and JATIT.invoice_distribution_id <> 1 )
762: or

Line 804: --Updated by Chong.Lei for bug#14218068, Added left outer join for ap_invoice_distributions_all table to get prepayments invoice which never applied to any standard invoice.

800: )
801: )
802: )
803: GROUP BY JATIT.INVOICE_ID, JATIT.ACTUAL_SECTION_CODE, JATIT.TAX_CATEGORY_ID';*/
804: --Updated by Chong.Lei for bug#14218068, Added left outer join for ap_invoice_distributions_all table to get prepayments invoice which never applied to any standard invoice.
805: lv_sql := 'SELECT JATIT.INVOICE_ID, DECODE(JATIT.INVOICE_ID ,$$pn_prepayment_inovice_id$$, SUM(JATIT.AMOUNT) - NVL(abs(SUM (AIDA.AMOUNT)),0) + $$pn_unapply_amount$$ ,SUM(JATIT.AMOUNT) - NVL(abs(SUM (AIDA.AMOUNT)),0)) AMOUNT
806: ,JATIT.ACTUAL_SECTION_CODE, JATIT.TAX_CATEGORY_ID
807: FROM JAI_AP_TDS_INV_TAXES JATIT, AP_INVOICE_DISTRIBUTIONS_ALL AIDA
808: WHERE JATIT.INVOICE_ID <> $$P_INVOICE_ID$$

Line 807: FROM JAI_AP_TDS_INV_TAXES JATIT, AP_INVOICE_DISTRIBUTIONS_ALL AIDA

803: GROUP BY JATIT.INVOICE_ID, JATIT.ACTUAL_SECTION_CODE, JATIT.TAX_CATEGORY_ID';*/
804: --Updated by Chong.Lei for bug#14218068, Added left outer join for ap_invoice_distributions_all table to get prepayments invoice which never applied to any standard invoice.
805: lv_sql := 'SELECT JATIT.INVOICE_ID, DECODE(JATIT.INVOICE_ID ,$$pn_prepayment_inovice_id$$, SUM(JATIT.AMOUNT) - NVL(abs(SUM (AIDA.AMOUNT)),0) + $$pn_unapply_amount$$ ,SUM(JATIT.AMOUNT) - NVL(abs(SUM (AIDA.AMOUNT)),0)) AMOUNT
806: ,JATIT.ACTUAL_SECTION_CODE, JATIT.TAX_CATEGORY_ID
807: FROM JAI_AP_TDS_INV_TAXES JATIT, AP_INVOICE_DISTRIBUTIONS_ALL AIDA
808: WHERE JATIT.INVOICE_ID <> $$P_INVOICE_ID$$
809: AND JATIT.TAX_LINE_NO = 0
810: AND (JATIT.TAX_CATEGORY_ID IS NOT NULL or (JATIT.TAX_CATEGORY_ID IS NULL and JATIT.ACTUAL_TAX_ID IS NULL))
811: AND JATIT.ACTUAL_SECTION_CODE = ''$$cv_section_code$$''

Line 909: from ap_invoice_distributions_all

905: --Commented and Added by Zhiwei Hou on 20120113 begin
906: -----------------------------------------------------------
907: /* cursor c_get_dist_prepay(p_invoice_id number) is
908: select prepay_distribution_id, sum(amount) amount
909: from ap_invoice_distributions_all
910: where invoice_id = p_invoice_id
911: and
912: (
913: ( pn_section_type = 'TDS_SECTION'

Line 939: from ap_invoice_distributions_all

935: where invoice_distribution_id
936: in
937: (
938: select prepay_distribution_id
939: from ap_invoice_distributions_all
940: where invoice_id = p_invoice_id
941: and prepay_distribution_id is not null
942: )
943: and (

Line 954: FROM ap_invoice_distributions_all

950: cursor c_get_dist_prepay(p_invoice_id number)
951: is
952: select invoice_distribution_id prepay_distribution_id,
953: sum(AMOUNT-PREPAY_AMOUNT_REMAINING) amount
954: FROM ap_invoice_distributions_all
955: WHERE INVOICE_DISTRIBUTION_ID IN
956: (
957: SELECT invoice_distribution_id
958: from jai_ap_tds_inv_taxes

Line 963: from ap_invoice_distributions_all

959: where invoice_distribution_id
960: in
961: (
962: select prepay_distribution_id
963: from ap_invoice_distributions_all
964: where invoice_id = p_invoice_id
965: and prepay_distribution_id is not null
966: )
967: and (

Line 980: from ap_invoice_distributions_all

976: --Commented and Added by Zhiwei Hou on 20120113 end
977:
978: cursor c_get_prepay_inv(p_prepay_dist_id number) is
979: select invoice_id
980: from ap_invoice_distributions_all
981: where invoice_distribution_id = p_prepay_dist_id;
982:
983: cursor c_prepay_tds_cal(p_invoice_id number) is --Xiao for Bug#6767347
984: select 1 from

Line 1075: ap_invoice_distributions_all b,

1071: --PRAGMA AUTONOMOUS_TRANSACTION; --commented by Cholei for ZX integration bug#14040855
1072: cursor c_jai_apply_amount(cp_invoice_id number) is
1073: select sum(a.application_amount) application_amount, d.threshold_grp_id, d.invoice_id
1074: from jai_ap_tds_prepayments a,
1075: ap_invoice_distributions_all b,
1076: ap_invoice_distributions_all c,
1077: jai_ap_tds_inv_taxes d
1078: where a.invoice_distribution_id_prepay = b.invoice_distribution_id
1079: and b.prepay_distribution_id = c.invoice_distribution_id

Line 1076: ap_invoice_distributions_all c,

1072: cursor c_jai_apply_amount(cp_invoice_id number) is
1073: select sum(a.application_amount) application_amount, d.threshold_grp_id, d.invoice_id
1074: from jai_ap_tds_prepayments a,
1075: ap_invoice_distributions_all b,
1076: ap_invoice_distributions_all c,
1077: jai_ap_tds_inv_taxes d
1078: where a.invoice_distribution_id_prepay = b.invoice_distribution_id
1079: and b.prepay_distribution_id = c.invoice_distribution_id
1080: and nvl(a.unapply_flag, 'N') <> 'Y'

Line 1093: ap_invoice_distributions_all b

1089: applied and subtract the same before calculating Effective amount for Threshold Transition*/
1090: cursor c_pp_single_apply_amount(cp_invoice_id number) is
1091: select sum(application_amount) amount
1092: from jai_ap_tds_prepayments a,
1093: ap_invoice_distributions_all b
1094: where a.invoice_id = cp_invoice_id
1095: and a.invoice_id = b.invoice_id
1096: and a.invoice_distribution_id_prepay = b.invoice_distribution_id
1097: and prepay_distribution_id is not null

Line 1100: from jai_ap_tds_inv_taxes jatit, ap_invoice_distributions_all aida

1096: and a.invoice_distribution_id_prepay = b.invoice_distribution_id
1097: and prepay_distribution_id is not null
1098: and nvl(a.unapply_flag, 'N') <> 'Y'
1099: and exists (select 1
1100: from jai_ap_tds_inv_taxes jatit, ap_invoice_distributions_all aida
1101: where aida.invoice_distribution_id = b.prepay_distribution_id
1102: and aida.invoice_id = jatit.invoice_id
1103: and aida.invoice_distribution_id = jatit.invoice_distribution_id
1104: and jatit.threshold_slab_id_single is not null

Line 1111: from ap_invoice_distributions_all

1107: /*Bug 12671504 - End*/
1108: --Added by Xiao Lv for Bug#8513550, related 11i bug#8439276, begin
1109: cursor c_prepay_apply_amt(cp_invoice_id number) is
1110: select abs(amount) amount, invoice_distribution_id, prepay_distribution_id
1111: from ap_invoice_distributions_all
1112: where invoice_id = cp_invoice_id
1113: and line_type_lookup_code = 'PREPAY';
1114:
1115: cursor c_get_thhold_grp(cp_invoice_id number, cp_invoice_dist_id number) is

Line 1395: from ap_invoice_distributions_all aida

1391: and meaning = 'Tax Basis'
1392: )
1393: and not exists(
1394: select 1
1395: from ap_invoice_distributions_all aida
1396: where aida.invoice_id = pn_invoice_id
1397: and (JAI_DTC_ROUNDING_SETUPS.from_date > aida.accounting_date
1398: or NVL(JAI_DTC_ROUNDING_SETUPS.to_date, TO_DATE('01019999','DDMMYYYY')) < aida.accounting_date
1399: )

Line 1480: from ap_invoice_distributions_all aida

1476: and meaning = 'Tax'
1477: )
1478: and not exists(
1479: select 1
1480: from ap_invoice_distributions_all aida
1481: where aida.invoice_id = pn_invoice_id
1482: and (JAI_DTC_ROUNDING_SETUPS.from_date > aida.accounting_date
1483: or NVL(JAI_DTC_ROUNDING_SETUPS.to_date, TO_DATE('01019999','DDMMYYYY')) < aida.accounting_date
1484: )

Line 1527: from ap_invoice_distributions_all

1523: --PRAGMA AUTONOMOUS_TRANSACTION; --commented by Cholei for ZX integration bug#14040855
1524: begin
1525: begin
1526: select dist_code_combination_id into cp_ccid
1527: from ap_invoice_distributions_all
1528: where invoice_id = cp_inv_id
1529: and distribution_line_number = 1
1530: AND ROWNUM = 1;
1531: EXCEPTION

Line 2160: from ap_invoice_distributions_all

2156:
2157: cursor c_get_dist_info(cn_invoice_distribution_id number)
2158: is
2159: select *
2160: from ap_invoice_distributions_all
2161: where invoice_distribution_id = cn_invoice_distribution_id;
2162:
2163: rec_dist_info c_get_dist_info%rowtype;
2164: lv_fin_year JAI_AP_TDS_YEARS.fin_year%type;

Line 2210: select 1 from ap_invoice_distributions_all dist

2206: ap_invoices_all hdrs
2207: where org_id = ln_org_id
2208: and exists
2209: (
2210: select 1 from ap_invoice_distributions_all dist
2211: where 1=1
2212: and dist.invoice_id = hdrs.invoice_id
2213: and dist.org_id = ln_org_id
2214: and(

Line 2264: select line. from ap_invoice_lines_all line, ap_invoice_distributions_all dist

2260: --Get Section Type, Section Code, Tax type, Tax Rate from JAI_AP_TDS_INV_TAXES or Description of Invoice Distribution
2261:
2262: \* cursor get_line_info(cn_invoice_distribution_id number)
2263: is
2264: select line. from ap_invoice_lines_all line, ap_invoice_distributions_all dist
2265: where line.invoice_id = dist.invoice_id
2266: and line.line_number = dist.invoice_line_number
2267: and dist.invoice_distribution_id = *\
2268:

Line 2353: --rec_dist_info.distribution_line_number,--get from ap_invoice_distributions_all.,--DISTRIBUTION_LINE_NUMBER ,

2349: nvl(rec_dist_info.parent_invoice_id,rec_trxs.invoice_id),
2350: --1, --get from ap_invoice_lines_all --INVOICE_LINE_ID ,
2351: --rec_dist_info.invoice_line_number, --get from ap_invoice_lines_all -- LINE_NUMBER ,
2352: --rec_tds_taxes.invoice_distribution_id, --INVOICE_DISTRIBUTION_ID ,
2353: --rec_dist_info.distribution_line_number,--get from ap_invoice_distributions_all.,--DISTRIBUTION_LINE_NUMBER ,
2354: rec_dist_info.accounting_date, --get from ap_invoice_distributions_all.,--ACCOUNTING_DATE ,
2355: rec_dist_info.org_id, --get from ap_invoice_distributions_all.,--ORG_ID ,
2356: --lv_vendor_name, --get vendor name by id, --VENDOR_NAME ,
2357: --lv_vendor_site_name, --get vendor site code by id --VENDOR_SITE_CODE ,

Line 2354: rec_dist_info.accounting_date, --get from ap_invoice_distributions_all.,--ACCOUNTING_DATE ,

2350: --1, --get from ap_invoice_lines_all --INVOICE_LINE_ID ,
2351: --rec_dist_info.invoice_line_number, --get from ap_invoice_lines_all -- LINE_NUMBER ,
2352: --rec_tds_taxes.invoice_distribution_id, --INVOICE_DISTRIBUTION_ID ,
2353: --rec_dist_info.distribution_line_number,--get from ap_invoice_distributions_all.,--DISTRIBUTION_LINE_NUMBER ,
2354: rec_dist_info.accounting_date, --get from ap_invoice_distributions_all.,--ACCOUNTING_DATE ,
2355: rec_dist_info.org_id, --get from ap_invoice_distributions_all.,--ORG_ID ,
2356: --lv_vendor_name, --get vendor name by id, --VENDOR_NAME ,
2357: --lv_vendor_site_name, --get vendor site code by id --VENDOR_SITE_CODE ,
2358: rec_tds_taxes.section_type, --get from jaji_ap_tds_inv_taxes,--SECTION_TYPE ,

Line 2355: rec_dist_info.org_id, --get from ap_invoice_distributions_all.,--ORG_ID ,

2351: --rec_dist_info.invoice_line_number, --get from ap_invoice_lines_all -- LINE_NUMBER ,
2352: --rec_tds_taxes.invoice_distribution_id, --INVOICE_DISTRIBUTION_ID ,
2353: --rec_dist_info.distribution_line_number,--get from ap_invoice_distributions_all.,--DISTRIBUTION_LINE_NUMBER ,
2354: rec_dist_info.accounting_date, --get from ap_invoice_distributions_all.,--ACCOUNTING_DATE ,
2355: rec_dist_info.org_id, --get from ap_invoice_distributions_all.,--ORG_ID ,
2356: --lv_vendor_name, --get vendor name by id, --VENDOR_NAME ,
2357: --lv_vendor_site_name, --get vendor site code by id --VENDOR_SITE_CODE ,
2358: rec_tds_taxes.section_type, --get from jaji_ap_tds_inv_taxes,--SECTION_TYPE ,
2359: rec_tds_taxes.actual_section_code, --get from jai_ap_tds_inv_taxes, --SECTION_CODE ,

Line 3080: FROM AP_INVOICE_DISTRIBUTIONS_ALL AIDA, JAI_AP_TDS_INV_TAXES JATIT

3076: -----------------------------------------------------------------
3077: /*cursor get_non_match_dist(cn_invoice_id number)
3078: is
3079: SELECT count(1)
3080: FROM AP_INVOICE_DISTRIBUTIONS_ALL AIDA, JAI_AP_TDS_INV_TAXES JATIT
3081: WHERE AIDA.INVOICE_ID = JATIT.INVOICE_ID
3082: and aida.invoice_id = cn_invoice_id
3083: AND AIDA.INVOICE_DISTRIBUTION_ID = JATIT.INVOICE_DISTRIBUTION_ID
3084: AND AIDA.DIST_CODE_COMBINATION_ID <> JATIT.DIST_CODE_COMBINATION_ID

Line 3182: from ap_invoice_distributions_all

3178:
3179: cursor get_first_dist_ccid(cn_invoice_id number)
3180: is
3181: select dist_code_combination_id
3182: from ap_invoice_distributions_all
3183: where invoice_id = cn_invoice_id
3184: and distribution_line_number = 1;
3185:
3186: ln_ccid number;

Line 5968: lv_invoice_to_tds_line_type ap_invoice_distributions_all.line_type_lookup_code%type; --File.Sql.35 Cbabu := 'ITEM';

5964:
5965: ln_invoice_to_tds_line_id ap_invoice_lines_interface.invoice_line_id%type;
5966: ln_invoice_to_vendor_line_id ap_invoice_lines_interface.invoice_line_id%type;
5967:
5968: lv_invoice_to_tds_line_type ap_invoice_distributions_all.line_type_lookup_code%type; --File.Sql.35 Cbabu := 'ITEM';
5969: lv_invoice_to_vendor_line_type ap_invoice_distributions_all.line_type_lookup_code%type; --File.Sql.35 Cbabu := 'ITEM';
5970:
5971: ln_invoice_to_tds_amount number;
5972: ln_invoice_to_vendor_amount number;

Line 5969: lv_invoice_to_vendor_line_type ap_invoice_distributions_all.line_type_lookup_code%type; --File.Sql.35 Cbabu := 'ITEM';

5965: ln_invoice_to_tds_line_id ap_invoice_lines_interface.invoice_line_id%type;
5966: ln_invoice_to_vendor_line_id ap_invoice_lines_interface.invoice_line_id%type;
5967:
5968: lv_invoice_to_tds_line_type ap_invoice_distributions_all.line_type_lookup_code%type; --File.Sql.35 Cbabu := 'ITEM';
5969: lv_invoice_to_vendor_line_type ap_invoice_distributions_all.line_type_lookup_code%type; --File.Sql.35 Cbabu := 'ITEM';
5970:
5971: ln_invoice_to_tds_amount number;
5972: ln_invoice_to_vendor_amount number;
5973:

Line 5983: lv_open_period ap_invoice_distributions_all.period_name%type;

5979: lv_pay_group_lookup_code po_vendors.pay_group_lookup_code%type;
5980:
5981: lv_ja_in_ap_inv_id varchar2(15);
5982: ld_accounting_date date;
5983: lv_open_period ap_invoice_distributions_all.period_name%type;
5984: ln_tax_amount number;
5985:
5986: lv_invoice_num ap_invoices_all.invoice_num%type;
5987: lv_source_attribute jai_ap_tds_invoices.source_attribute%TYPE ; --rchandan for bug#4428980

Line 6863: lv_invoice_to_tds_line_type ap_invoice_distributions_all.line_type_lookup_code%type; --File.Sql.35 Cbabu := 'ITEM';

6859:
6860: ln_invoice_to_tds_line_id ap_invoice_lines_interface.invoice_line_id%type;
6861: ln_invoice_to_vendor_line_id ap_invoice_lines_interface.invoice_line_id%type;
6862:
6863: lv_invoice_to_tds_line_type ap_invoice_distributions_all.line_type_lookup_code%type; --File.Sql.35 Cbabu := 'ITEM';
6864: lv_invoice_to_vendor_line_type ap_invoice_distributions_all.line_type_lookup_code%type; --File.Sql.35 Cbabu := 'ITEM';
6865:
6866: ln_invoice_to_tds_amount number;
6867: ln_invoice_to_vendor_amount number;

Line 6864: lv_invoice_to_vendor_line_type ap_invoice_distributions_all.line_type_lookup_code%type; --File.Sql.35 Cbabu := 'ITEM';

6860: ln_invoice_to_tds_line_id ap_invoice_lines_interface.invoice_line_id%type;
6861: ln_invoice_to_vendor_line_id ap_invoice_lines_interface.invoice_line_id%type;
6862:
6863: lv_invoice_to_tds_line_type ap_invoice_distributions_all.line_type_lookup_code%type; --File.Sql.35 Cbabu := 'ITEM';
6864: lv_invoice_to_vendor_line_type ap_invoice_distributions_all.line_type_lookup_code%type; --File.Sql.35 Cbabu := 'ITEM';
6865:
6866: ln_invoice_to_tds_amount number;
6867: ln_invoice_to_vendor_amount number;
6868:

Line 6878: lv_open_period ap_invoice_distributions_all.period_name%type;

6874: lv_pay_group_lookup_code po_vendors.pay_group_lookup_code%type;
6875:
6876: lv_ja_in_ap_inv_id varchar2(15);
6877: ld_accounting_date date;
6878: lv_open_period ap_invoice_distributions_all.period_name%type;
6879: ln_tax_amount number;
6880:
6881: lv_invoice_num ap_invoices_all.invoice_num%type;
6882: lv_source_attribute jai_ap_tds_invoices.source_attribute%TYPE ; --rchandan for bug#4428980

Line 8874: FROM ap_invoice_distributions_all a,

8870: b.vendor_site_id,
8871: b.invoice_currency_code,
8872: b.exchange_rate,
8873: b.set_of_books_id
8874: FROM ap_invoice_distributions_all a,
8875: ap_invoices_all b
8876: WHERE a.invoice_id = b.invoice_id
8877: AND b.invoice_id = p_invoice_id
8878: AND a.line_type_lookup_code = 'PREPAY'

Line 9042: FROM ap_invoice_distributions_all

9038: --Get CCID by distribution id
9039: /* CURSOR c_CCID(p_invoice_distribution_id NUMBER
9040: ) IS
9041: SELECT dist_code_combination_id
9042: FROM ap_invoice_distributions_all
9043: WHERE invoice_distribution_id = p_invoice_distribution_id;
9044: */
9045: CURSOR c_get_threshold_grp_id(p_prepay_distribution_id NUMBER) IS
9046: SELECT threshold_grp_id

Line 9399: FROM ap_invoice_distributions_all

9395:
9396: CURSOR get_dist_gl_date(cp_invoice_id IN ap_invoices_all.invoice_id%TYPE) IS
9397: SELECT accounting_date
9398: ,creation_date --Added by Chong for Bug#13802244 2012/09/17
9399: FROM ap_invoice_distributions_all
9400: WHERE invoice_id = cp_invoice_id
9401: AND distribution_line_number = 1;
9402:
9403: /*Get Accounting Date from AP_INVOICE_LINES_ALL.

Line 9482: lv_open_period ap_invoice_distributions_all.period_name%TYPE;

9478: r_ap_invoices_all_cm c_ap_invoices_all%ROWTYPE;
9479: lb_return_value BOOLEAN;
9480: ld_accounting_date DATE;
9481: ld_creation_date DATE; --Added by Chong for Bug#13802244 2012/09/17
9482: lv_open_period ap_invoice_distributions_all.period_name%TYPE;
9483: ld_ret_accounting_date DATE;
9484: lv_token VARCHAR2(4000);
9485: lv_invoice_to_tds_num ap_invoices_all.invoice_num%type;
9486: lv_invoice_to_vendor_num ap_invoices_all.invoice_num%type;

Line 10266: FROM ap_invoice_distributions_all

10262: BEGIN
10263: BEGIN
10264: SELECT invoice_id
10265: INTO p_prepay_inv_id
10266: FROM ap_invoice_distributions_all
10267: WHERE invoice_distribution_id = p_prepay_inv_dist_id;
10268: EXCEPTION
10269: WHEN NO_DATA_FOUND THEN
10270: p_prepay_inv_id := null;

Line 10392: lv_invoice_to_tds_line_type ap_invoice_distributions_all.line_type_lookup_code%type; --File.Sql.35 Cbabu := 'ITEM';

10388:
10389: ln_invoice_to_tds_line_id ap_invoice_lines_interface.invoice_line_id%type;
10390: ln_invoice_to_vendor_line_id ap_invoice_lines_interface.invoice_line_id%type;
10391:
10392: lv_invoice_to_tds_line_type ap_invoice_distributions_all.line_type_lookup_code%type; --File.Sql.35 Cbabu := 'ITEM';
10393: lv_invoice_to_vendor_line_type ap_invoice_distributions_all.line_type_lookup_code%type; --File.Sql.35 Cbabu := 'ITEM';
10394:
10395: ln_invoice_to_tds_amount number;
10396: ln_invoice_to_vendor_amount number;

Line 10393: lv_invoice_to_vendor_line_type ap_invoice_distributions_all.line_type_lookup_code%type; --File.Sql.35 Cbabu := 'ITEM';

10389: ln_invoice_to_tds_line_id ap_invoice_lines_interface.invoice_line_id%type;
10390: ln_invoice_to_vendor_line_id ap_invoice_lines_interface.invoice_line_id%type;
10391:
10392: lv_invoice_to_tds_line_type ap_invoice_distributions_all.line_type_lookup_code%type; --File.Sql.35 Cbabu := 'ITEM';
10393: lv_invoice_to_vendor_line_type ap_invoice_distributions_all.line_type_lookup_code%type; --File.Sql.35 Cbabu := 'ITEM';
10394:
10395: ln_invoice_to_tds_amount number;
10396: ln_invoice_to_vendor_amount number;
10397:

Line 10407: lv_open_period ap_invoice_distributions_all.period_name%type;

10403: lv_pay_group_lookup_code po_vendors.pay_group_lookup_code%type;
10404:
10405: lv_ja_in_ap_inv_id varchar2(15);
10406: ld_accounting_date date;
10407: lv_open_period ap_invoice_distributions_all.period_name%type;
10408: ln_tax_amount number;
10409:
10410: lv_invoice_num ap_invoices_all.invoice_num%type;
10411: lv_source_attribute jai_ap_tds_invoices.source_attribute%TYPE ; --rchandan for bug#4428980