DBA Data[Home] [Help]

APPS.JAI_AP_MATCH_TAX_PKG dependencies on AP_INVOICE_DISTRIBUTIONS_ALL

Line 150: trigger ja_in_tds_temp_after_insert_trg on ap_invoice_distributions_all. The main concepts

146: This trigger was created to move the processing of invoice lines while invoices get generated
147: from purchasing with pay on receipt option. the concurrent was getting submitted for every item
148: lines of the invoice, to generate associate tax lines. With this procedure all such invoice lines
149: will be processed as 1 concurrent. The temporary table used here is being populated from the
150: trigger ja_in_tds_temp_after_insert_trg on ap_invoice_distributions_all. The main concepts
151: used here are,
152: - if an error occurs while processing a particular record, the program will skip processing
153: all other distributions lines of the error invoice.
154: - the program will continue to process other invoices.

Line 230: ap_invoice_distributions_all.po_distribution_id shall be populated with the po_distribution_id of

226: Anything that is not linked to a po_distribution_id would be processed as
227: miscellaneous accrual and not as AP-PO accrual. Since po_distribution_id
228: for tax lines in AP is null in case of po with mulitple distributions, its being processed as Miscellaneous reconciliation record.
229: Fix:
230: ap_invoice_distributions_all.po_distribution_id shall be populated with the po_distribution_id of
231: the item distribution line.
232: Changes are done in process_batch_records procedure.
233:
234: 61. 25-Jan-2013 amandali for bug 16220700

Line 604: from ap_invoice_distributions_all

600: project_accounting_context,
601: pa_addition_flag,
602: distribution_class,
603: dist_match_type
604: from ap_invoice_distributions_all
605: where invoice_id = ln_invoice_id
606: and invoice_distribution_id = ln_invoice_distribution_id;
607:
608: Cursor c_inv_dist_tax_lines_ers (ln_invoice_id number, ln_po_distribution_id number) is /*Added by nprashar for bug # 12832424*/

Line 654: from ap_invoice_distributions_all

650: project_accounting_context,
651: pa_addition_flag,
652: distribution_class,
653: dist_match_type
654: from ap_invoice_distributions_all
655: where invoice_id = ln_invoice_id
656: and po_distribution_id = ln_po_distribution_id
657: and line_type_lookup_code = 'MISCELLANEOUS';
658:

Line 700: ap_invoice_distributions_all apd,

696: api.last_update_date,
697: api.last_updated_by,
698: api.invoice_date
699: FROM ap_invoices_all api,
700: ap_invoice_distributions_all apd,
701: po_distributions_all pod,
702: po_headers_all poh
703: WHERE apd.invoice_id = api.invoice_id
704: AND pod.po_header_id = poh.po_header_id

Line 711: ( cpn_invoice_id AP_INVOICE_DISTRIBUTIONS_ALL.INVOICE_ID%TYPE

707: AND api.invoice_id = inv_id
708: AND apd.distribution_line_number = cpn_min_dist_line_no;
709: -- Added by Brathod to get minimum invoice line number from invoice distributions, Bug#4445989
710: CURSOR cur_get_min_dist_linenum
711: ( cpn_invoice_id AP_INVOICE_DISTRIBUTIONS_ALL.INVOICE_ID%TYPE
712: ,cpn_invoice_line_number AP_INVOICE_DISTRIBUTIONS_ALL.INVOICE_LINE_NUMBER%TYPE
713: )
714: IS
715: SELECT min(distribution_line_number)

Line 712: ,cpn_invoice_line_number AP_INVOICE_DISTRIBUTIONS_ALL.INVOICE_LINE_NUMBER%TYPE

708: AND apd.distribution_line_number = cpn_min_dist_line_no;
709: -- Added by Brathod to get minimum invoice line number from invoice distributions, Bug#4445989
710: CURSOR cur_get_min_dist_linenum
711: ( cpn_invoice_id AP_INVOICE_DISTRIBUTIONS_ALL.INVOICE_ID%TYPE
712: ,cpn_invoice_line_number AP_INVOICE_DISTRIBUTIONS_ALL.INVOICE_LINE_NUMBER%TYPE
713: )
714: IS
715: SELECT min(distribution_line_number)
716: FROM ap_invoice_distributions_all apid

Line 716: FROM ap_invoice_distributions_all apid

712: ,cpn_invoice_line_number AP_INVOICE_DISTRIBUTIONS_ALL.INVOICE_LINE_NUMBER%TYPE
713: )
714: IS
715: SELECT min(distribution_line_number)
716: FROM ap_invoice_distributions_all apid
717: WHERE apid.invoice_id = cpn_invoice_id
718: AND apid.invoice_line_number = cpn_invoice_line_number;
719:
720:

Line 793: FROM ap_invoice_distributions_all a,

789: ,project_accounting_context
790: ,pa_addition_flag
791: /* End 5763527 */
792: ,a.dist_match_type --Added by nprashar for bug # 12832424
793: FROM ap_invoice_distributions_all a,
794: ap_invoice_lines_all b
795: WHERE a.invoice_id = cp_invoice_id
796: AND a.invoice_line_number = cp_line_num
797: AND b.invoice_id = cp_invoice_id

Line 978: FROM ap_invoice_distributions_all a

974: ,project_accounting_context
975: ,pa_addition_flag
976: /* End 5763527 */
977: , dist_match_type --Added by nprashar for bug # 12832424
978: FROM ap_invoice_distributions_all a
979: WHERE invoice_id = cpn_invoice_id
980: AND invoice_line_number = cpn_inv_line_num
981: AND distribution_line_number = cpn_min_dist_line_num;
982:

Line 1208: v_price_var_accnt ap_invoice_distributions_all.price_var_code_combination_id%type;

1204: chk_for_pcking_slip_rec checking_for_packing_slip%ROWTYPE;
1205: v_invoice_num_for_log VARCHAR2(50);
1206: v_tax_variance_inv_cur number; -- bug # 2775043
1207: v_tax_variance_fun_cur number; -- bug # 2775043
1208: v_price_var_accnt ap_invoice_distributions_all.price_var_code_combination_id%type;
1209: v_distribution_no ap_invoice_distributions_all.distribution_line_number%type;
1210: v_assets_tracking_flag ap_invoice_distributions_all.assets_tracking_flag%type;
1211: v_dist_code_combination_id ap_invoice_distributions_all.dist_code_combination_id%type;--bug#367196
1212: v_update_payment_schedule boolean; -- bug#3218978

Line 1209: v_distribution_no ap_invoice_distributions_all.distribution_line_number%type;

1205: v_invoice_num_for_log VARCHAR2(50);
1206: v_tax_variance_inv_cur number; -- bug # 2775043
1207: v_tax_variance_fun_cur number; -- bug # 2775043
1208: v_price_var_accnt ap_invoice_distributions_all.price_var_code_combination_id%type;
1209: v_distribution_no ap_invoice_distributions_all.distribution_line_number%type;
1210: v_assets_tracking_flag ap_invoice_distributions_all.assets_tracking_flag%type;
1211: v_dist_code_combination_id ap_invoice_distributions_all.dist_code_combination_id%type;--bug#367196
1212: v_update_payment_schedule boolean; -- bug#3218978
1213: v_invoice_distribution_id ap_invoice_distributions_all.invoice_distribution_id%type; -- bug#3332988

Line 1210: v_assets_tracking_flag ap_invoice_distributions_all.assets_tracking_flag%type;

1206: v_tax_variance_inv_cur number; -- bug # 2775043
1207: v_tax_variance_fun_cur number; -- bug # 2775043
1208: v_price_var_accnt ap_invoice_distributions_all.price_var_code_combination_id%type;
1209: v_distribution_no ap_invoice_distributions_all.distribution_line_number%type;
1210: v_assets_tracking_flag ap_invoice_distributions_all.assets_tracking_flag%type;
1211: v_dist_code_combination_id ap_invoice_distributions_all.dist_code_combination_id%type;--bug#367196
1212: v_update_payment_schedule boolean; -- bug#3218978
1213: v_invoice_distribution_id ap_invoice_distributions_all.invoice_distribution_id%type; -- bug#3332988
1214: v_functional_currency gl_sets_of_books.currency_code%type; -- bug#3354932

Line 1211: v_dist_code_combination_id ap_invoice_distributions_all.dist_code_combination_id%type;--bug#367196

1207: v_tax_variance_fun_cur number; -- bug # 2775043
1208: v_price_var_accnt ap_invoice_distributions_all.price_var_code_combination_id%type;
1209: v_distribution_no ap_invoice_distributions_all.distribution_line_number%type;
1210: v_assets_tracking_flag ap_invoice_distributions_all.assets_tracking_flag%type;
1211: v_dist_code_combination_id ap_invoice_distributions_all.dist_code_combination_id%type;--bug#367196
1212: v_update_payment_schedule boolean; -- bug#3218978
1213: v_invoice_distribution_id ap_invoice_distributions_all.invoice_distribution_id%type; -- bug#3332988
1214: v_functional_currency gl_sets_of_books.currency_code%type; -- bug#3354932
1215: v_batch_id NUMBER;

Line 1213: v_invoice_distribution_id ap_invoice_distributions_all.invoice_distribution_id%type; -- bug#3332988

1209: v_distribution_no ap_invoice_distributions_all.distribution_line_number%type;
1210: v_assets_tracking_flag ap_invoice_distributions_all.assets_tracking_flag%type;
1211: v_dist_code_combination_id ap_invoice_distributions_all.dist_code_combination_id%type;--bug#367196
1212: v_update_payment_schedule boolean; -- bug#3218978
1213: v_invoice_distribution_id ap_invoice_distributions_all.invoice_distribution_id%type; -- bug#3332988
1214: v_functional_currency gl_sets_of_books.currency_code%type; -- bug#3354932
1215: v_batch_id NUMBER;
1216: c_tax_rec c_tax%ROWTYPE;
1217: v_source VARCHAR2(25);

Line 1243: ln_project_id ap_invoice_distributions_all.project_id%TYPE;

1239: ln_ship_to_location_id po_line_locations_all.ship_to_location_id%type;
1240:
1241:
1242: /* 5763527 , Project costing Fwd porting*/
1243: ln_project_id ap_invoice_distributions_all.project_id%TYPE;
1244: ln_task_id ap_invoice_distributions_all.task_id%TYPE;
1245: lv_exp_type ap_invoice_distributions_all.expenditure_type%TYPE;
1246: ld_exp_item_date ap_invoice_distributions_all.expenditure_item_date%TYPE;
1247: ln_exp_organization_id ap_invoice_distributions_all.expenditure_organization_id%TYPE;

Line 1244: ln_task_id ap_invoice_distributions_all.task_id%TYPE;

1240:
1241:
1242: /* 5763527 , Project costing Fwd porting*/
1243: ln_project_id ap_invoice_distributions_all.project_id%TYPE;
1244: ln_task_id ap_invoice_distributions_all.task_id%TYPE;
1245: lv_exp_type ap_invoice_distributions_all.expenditure_type%TYPE;
1246: ld_exp_item_date ap_invoice_distributions_all.expenditure_item_date%TYPE;
1247: ln_exp_organization_id ap_invoice_distributions_all.expenditure_organization_id%TYPE;
1248: lv_project_accounting_context ap_invoice_distributions_all.project_accounting_context%TYPE;

Line 1245: lv_exp_type ap_invoice_distributions_all.expenditure_type%TYPE;

1241:
1242: /* 5763527 , Project costing Fwd porting*/
1243: ln_project_id ap_invoice_distributions_all.project_id%TYPE;
1244: ln_task_id ap_invoice_distributions_all.task_id%TYPE;
1245: lv_exp_type ap_invoice_distributions_all.expenditure_type%TYPE;
1246: ld_exp_item_date ap_invoice_distributions_all.expenditure_item_date%TYPE;
1247: ln_exp_organization_id ap_invoice_distributions_all.expenditure_organization_id%TYPE;
1248: lv_project_accounting_context ap_invoice_distributions_all.project_accounting_context%TYPE;
1249: lv_pa_addition_flag ap_invoice_distributions_all.pa_addition_flag%TYPE;

Line 1246: ld_exp_item_date ap_invoice_distributions_all.expenditure_item_date%TYPE;

1242: /* 5763527 , Project costing Fwd porting*/
1243: ln_project_id ap_invoice_distributions_all.project_id%TYPE;
1244: ln_task_id ap_invoice_distributions_all.task_id%TYPE;
1245: lv_exp_type ap_invoice_distributions_all.expenditure_type%TYPE;
1246: ld_exp_item_date ap_invoice_distributions_all.expenditure_item_date%TYPE;
1247: ln_exp_organization_id ap_invoice_distributions_all.expenditure_organization_id%TYPE;
1248: lv_project_accounting_context ap_invoice_distributions_all.project_accounting_context%TYPE;
1249: lv_pa_addition_flag ap_invoice_distributions_all.pa_addition_flag%TYPE;
1250:

Line 1247: ln_exp_organization_id ap_invoice_distributions_all.expenditure_organization_id%TYPE;

1243: ln_project_id ap_invoice_distributions_all.project_id%TYPE;
1244: ln_task_id ap_invoice_distributions_all.task_id%TYPE;
1245: lv_exp_type ap_invoice_distributions_all.expenditure_type%TYPE;
1246: ld_exp_item_date ap_invoice_distributions_all.expenditure_item_date%TYPE;
1247: ln_exp_organization_id ap_invoice_distributions_all.expenditure_organization_id%TYPE;
1248: lv_project_accounting_context ap_invoice_distributions_all.project_accounting_context%TYPE;
1249: lv_pa_addition_flag ap_invoice_distributions_all.pa_addition_flag%TYPE;
1250:
1251: ln_lines_to_insert number;

Line 1248: lv_project_accounting_context ap_invoice_distributions_all.project_accounting_context%TYPE;

1244: ln_task_id ap_invoice_distributions_all.task_id%TYPE;
1245: lv_exp_type ap_invoice_distributions_all.expenditure_type%TYPE;
1246: ld_exp_item_date ap_invoice_distributions_all.expenditure_item_date%TYPE;
1247: ln_exp_organization_id ap_invoice_distributions_all.expenditure_organization_id%TYPE;
1248: lv_project_accounting_context ap_invoice_distributions_all.project_accounting_context%TYPE;
1249: lv_pa_addition_flag ap_invoice_distributions_all.pa_addition_flag%TYPE;
1250:
1251: ln_lines_to_insert number;
1252: ln_nrec_tax_amt number;

Line 1249: lv_pa_addition_flag ap_invoice_distributions_all.pa_addition_flag%TYPE;

1245: lv_exp_type ap_invoice_distributions_all.expenditure_type%TYPE;
1246: ld_exp_item_date ap_invoice_distributions_all.expenditure_item_date%TYPE;
1247: ln_exp_organization_id ap_invoice_distributions_all.expenditure_organization_id%TYPE;
1248: lv_project_accounting_context ap_invoice_distributions_all.project_accounting_context%TYPE;
1249: lv_pa_addition_flag ap_invoice_distributions_all.pa_addition_flag%TYPE;
1250:
1251: ln_lines_to_insert number;
1252: ln_nrec_tax_amt number;
1253: ln_rec_tax_amt number;

Line 1487: p_table_name => ''AP_INVOICE_DISTRIBUTIONS_ALL'',

1483: begin
1484:
1485: v_mrc_string := 'BEGIN AP_MRC_ENGINE_PKG.Maintain_MRC_Data (
1486: p_operation_mode => ''INSERT'',
1487: p_table_name => ''AP_INVOICE_DISTRIBUTIONS_ALL'',
1488: p_key_value => :a,
1489: p_key_value_list => NULL,
1490: p_calling_sequence =>
1491: ''India Local Tax line as Miscellaneous distribution line (jai_ap_match_tax_pkg.process_online procedure)''

Line 1548: from ap_invoice_distributions_all

1544:
1545: -- get the corresponding base line amount in original invoice
1546: cursor c_check_orig_item_line(p_price_correct_inv_id number, p_po_distribution_id number) is
1547: select amount, invoice_distribution_id
1548: from ap_invoice_distributions_all
1549: WHERE invoice_id = p_price_correct_inv_id
1550: and po_distribution_id = p_po_distribution_id
1551: AND line_type_lookup_code = 'ITEM';
1552:

Line 1765: The assets_tracking_flag in ap_invoice_distributions_all,

1761: line UOM converion rate to be multiplied with PO Shipment price (used to proportionate the receipt tax along with invoice distribution price).
1762: This issue happens only during receipt matching.
1763:
1764: 18. 07/04/2003 Aparajita for bug # 2851123. Version # 615.10
1765: The assets_tracking_flag in ap_invoice_distributions_all,
1766: JAI_AP_MATCH_INV_TAXES and JAI_CMN_FA_INV_DIST_ALL should
1767: be set as 'N' if the tax line against which the line is being generated
1768: is excise type of tax and is modvatable. By default this flag gets the value
1769: from the corresponding item line for which the tax is attached.

Line 1866: The procedure is called after every insert into ap_invoice_distributions_all.

1862:
1863: This call is made after every distribution line is inserted.
1864: This has been implemented as a in line procedure insert_mrc_data.
1865:
1866: The procedure is called after every insert into ap_invoice_distributions_all.
1867:
1868: Procedure update_mrc_data has been created and invoked whereever invoice
1869: header is being updated.
1870:

Line 2010: be populated in the attribute columns of ap_invoice_distributions_all table

2006:
2007: 45 8/05/2005 rchandan for bug#4333488. Version 116.1
2008: The Invoice Distribution DFF is eliminated and a new global DFF is used to
2009: maintain the functionality. From now the TDS tax, WCT tax and ESSI will not
2010: be populated in the attribute columns of ap_invoice_distributions_all table
2011: instead these will be populated in the global attribute columns. So the code changes are
2012: made accordingly.
2013:
2014: 46 10-Jun-2005 rallamse for bug# Version 116.2

Line 2022: ap_invoice_distributions_all.

2018:
2019: 47 23-Jun-2005 Brathod for Bug# 4445989, Version 120.0
2020: Issue: Impact uptake on IL Product for AP_INVOICE_LINES_ALL Uptake
2021: Resolution:- Code modified to consider ap_invoice_lines_all instead of
2022: ap_invoice_distributions_all.
2023: Following changes done
2024: - Code refering to ap_invoice_distributions_all modified to consider
2025: invoice_id and invoice_line_number as unique combination
2026: - invoice line record is created in ap_invoice_lines_all where ever previously

Line 2024: - Code refering to ap_invoice_distributions_all modified to consider

2020: Issue: Impact uptake on IL Product for AP_INVOICE_LINES_ALL Uptake
2021: Resolution:- Code modified to consider ap_invoice_lines_all instead of
2022: ap_invoice_distributions_all.
2023: Following changes done
2024: - Code refering to ap_invoice_distributions_all modified to consider
2025: invoice_id and invoice_line_number as unique combination
2026: - invoice line record is created in ap_invoice_lines_all where ever previously
2027: distribution was created
2028: - Obsoleted JAI_CMN_FA_INV_DIST_ALL

Line 2062: Modified the insert statement of ap_invoice_distributions_all to populate the charge_applicable_to_dist_id

2058: 55. 03-APR-2008 Jason Liu for bug#66936416
2059: Added a condition to exclude the third party taxes
2060:
2061: 56. 19-May-2008 JMEENA for bug#7008161
2062: Modified the insert statement of ap_invoice_distributions_all to populate the charge_applicable_to_dist_id
2063: based on v_assets_tracking_flag and removed the condition of account_type.
2064:
2065: 57. 12-Dec-2008 Added by Bgowrava for Bug#7503308, File Version 120.7.12000000.15, 120.34.12010000.4, 120.38
2066: Issue: INDIA - TO INSERT TAXES FOR PAY ON RECEIPT REQUESTPERFORMANCE ISSUE

Line 2166: INSERT INTO ap_invoice_distributions_all

2162:
2163:
2164: ln_invoice_distribution_no := ins_reverse_dist_lines.distribution_line_number + 1;
2165:
2166: INSERT INTO ap_invoice_distributions_all
2167: (
2168: accounting_date,
2169: accrual_posted_flag,
2170: assets_addition_flag,

Line 2292: INSERT INTO ap_invoice_distributions_all

2288: For ins_reverse_dist_lines_ers in c_inv_dist_tax_lines_ers ( inv_id , po_dist_id)
2289: Loop
2290: ln_invoice_distribution_no := ins_reverse_dist_lines_ers.distribution_line_number + 1;
2291: select ap_invoice_distributions_s.nextval into ln_invoice_dist_id_rev from dual;
2292: INSERT INTO ap_invoice_distributions_all
2293: (
2294: accounting_date,
2295: accrual_posted_flag,
2296: assets_addition_flag,

Line 2493: update ap_invoice_distributions_all

2489:
2490: begin
2491: -- following update statement is to just get a lock on the distribution lines of the invoice.
2492: -- the distribution line numbers should be unique and in sequence.
2493: update ap_invoice_distributions_all
2494: set last_update_date = last_update_date
2495: where invoice_id = inv_id;
2496:
2497: -- Added by Brathod for Bug# 4445989

Line 2512: from ap_invoice_distributions_all

2508: /*
2509: Commented by Brathod for Bug# 4445989
2510: select max(DISTRIBUTION_LINE_NUMBER)
2511: into v_distribution_no
2512: from ap_invoice_distributions_all
2513: where invoice_id = inv_id;
2514: */
2515:
2516: exception

Line 3389: 'Before inserting into ap_invoice_distributions_all for distribution line no :'

3385: end if ;
3386:
3387: --End; --Added by kunkumar for bug 5593895
3388: Fnd_File.put_line(Fnd_File.LOG,
3389: 'Before inserting into ap_invoice_distributions_all for distribution line no :'
3390: ||v_distribution_no );
3391:
3392: -- Start bug#3332988
3393: open c_get_invoice_distribution;

Line 3426: INSERT INTO ap_invoice_distributions_all

3422: END;
3423: END IF;
3424: -- end for bug 13906303 by anupgupt
3425:
3426: INSERT INTO ap_invoice_distributions_all
3427: (
3428: accounting_date,
3429: accrual_posted_flag,
3430: assets_addition_flag,

Line 3865: 'Before inserting Inclusive Service tax lines for POT into ap_invoice_distributions_all for distribution line no :' || v_distribution_no);

3861: ,po_dist_id --Added for bug#6780154
3862: );
3863:
3864: Fnd_File.put_line(Fnd_File.LOG,
3865: 'Before inserting Inclusive Service tax lines for POT into ap_invoice_distributions_all for distribution line no :' || v_distribution_no);
3866:
3867:
3868: open c_get_invoice_distribution;
3869: fetch c_get_invoice_distribution into v_invoice_distribution_id;

Line 3875: INSERT INTO ap_invoice_distributions_all

3871:
3872:
3873: fnd_file.put_line(FND_FILE.LOG, 'Inclusive Service tax lines for POT Invoice distribution id '|| v_invoice_distribution_id);
3874:
3875: INSERT INTO ap_invoice_distributions_all
3876: (accounting_date,
3877: accrual_posted_flag,
3878: assets_addition_flag,
3879: assets_tracking_flag,

Line 4659: 'Before inserting into ap_invoice_distributions_all for distribution line no : '

4655: ,po_dist_id --Added for bug#6780154
4656: );
4657:
4658: Fnd_File.put_line(Fnd_File.LOG,
4659: 'Before inserting into ap_invoice_distributions_all for distribution line no : '
4660: ||v_distribution_no);
4661:
4662: -- Start bug#3332988
4663: open c_get_invoice_distribution;

Line 4670: INSERT INTO ap_invoice_distributions_all

4666: -- End bug#3332988
4667:
4668: fnd_file.put_line(FND_FILE.LOG, ' Invoice distribution id '|| v_invoice_distribution_id);
4669:
4670: INSERT INTO ap_invoice_distributions_all
4671: (
4672: accounting_date,
4673: accrual_posted_flag,
4674: assets_addition_flag,

Line 5546: 'Before inserting into ap_invoice_distributions_all for distribution line no : ' || v_distribution_no);

5542: ,po_dist_id --Added for bug#6780154
5543: );
5544:
5545: Fnd_File.put_line(Fnd_File.LOG,
5546: 'Before inserting into ap_invoice_distributions_all for distribution line no : ' || v_distribution_no);
5547:
5548: -- Start bug#3332988
5549: open c_get_invoice_distribution;
5550: fetch c_get_invoice_distribution into v_invoice_distribution_id;

Line 5556: INSERT INTO ap_invoice_distributions_all

5552: -- End bug#3332988
5553:
5554: fnd_file.put_line(FND_FILE.LOG, ' Invoice distribution id '|| v_invoice_distribution_id);
5555:
5556: INSERT INTO ap_invoice_distributions_all
5557: (
5558: accounting_date,
5559: accrual_posted_flag,
5560: assets_addition_flag,

Line 6553: 'Before inserting into ap_invoice_distributions_all for distribution line no :' || v_distribution_no);

6549: );
6550:
6551:
6552: Fnd_File.put_line(Fnd_File.LOG,
6553: 'Before inserting into ap_invoice_distributions_all for distribution line no :' || v_distribution_no);
6554:
6555: -- Start bug#3332988
6556: open c_get_invoice_distribution;
6557: fetch c_get_invoice_distribution into v_invoice_distribution_id;

Line 6563: INSERT INTO ap_invoice_distributions_all

6559: -- End bug#3332988
6560:
6561: fnd_file.put_line(FND_FILE.LOG, ' Invoice distribution id '|| v_invoice_distribution_id);
6562:
6563: INSERT INTO ap_invoice_distributions_all
6564: (
6565: accounting_date,
6566: accrual_posted_flag,
6567: assets_addition_flag,

Line 7009: 'Before inserting Inclusive Service tax lines for POT into ap_invoice_distributions_all for distribution line no :' || v_distribution_no);

7005: );
7006:
7007:
7008: Fnd_File.put_line(Fnd_File.LOG,
7009: 'Before inserting Inclusive Service tax lines for POT into ap_invoice_distributions_all for distribution line no :' || v_distribution_no);
7010:
7011:
7012: open c_get_invoice_distribution;
7013: fetch c_get_invoice_distribution into v_invoice_distribution_id;

Line 7019: INSERT INTO ap_invoice_distributions_all

7015:
7016:
7017: fnd_file.put_line(FND_FILE.LOG, 'Inclusive Service tax lines for POT Invoice distribution id '|| v_invoice_distribution_id);
7018:
7019: INSERT INTO ap_invoice_distributions_all
7020: (
7021: accounting_date,
7022: accrual_posted_flag,
7023: assets_addition_flag,

Line 7264: ap_invoice_distributions_all apd,

7260: api.last_update_date,
7261: api.last_updated_by,
7262: api.invoice_date
7263: FROM ap_invoices_all api,
7264: ap_invoice_distributions_all apd,
7265: po_distributions_all pod,
7266: po_headers_all poh
7267: WHERE api.invoice_id = inv_id
7268: AND api.invoice_id = apd.invoice_id

Line 7276: ( cpn_invoice_id AP_INVOICE_DISTRIBUTIONS_ALL.INVOICE_ID%TYPE

7272: AND apd.distribution_line_number = cpn_max_dist_line_num;
7273:
7274: -- Added by Brathod to get minimum invoice line number from invoice distributions, Bug#4445989
7275: CURSOR cur_get_min_dist_linenum
7276: ( cpn_invoice_id AP_INVOICE_DISTRIBUTIONS_ALL.INVOICE_ID%TYPE
7277: ,cpn_invoice_line_number AP_INVOICE_DISTRIBUTIONS_ALL.INVOICE_LINE_NUMBER%TYPE
7278: )
7279: IS
7280: SELECT min(distribution_line_number)

Line 7277: ,cpn_invoice_line_number AP_INVOICE_DISTRIBUTIONS_ALL.INVOICE_LINE_NUMBER%TYPE

7273:
7274: -- Added by Brathod to get minimum invoice line number from invoice distributions, Bug#4445989
7275: CURSOR cur_get_min_dist_linenum
7276: ( cpn_invoice_id AP_INVOICE_DISTRIBUTIONS_ALL.INVOICE_ID%TYPE
7277: ,cpn_invoice_line_number AP_INVOICE_DISTRIBUTIONS_ALL.INVOICE_LINE_NUMBER%TYPE
7278: )
7279: IS
7280: SELECT min(distribution_line_number)
7281: FROM ap_invoice_distributions_all apid

Line 7281: FROM ap_invoice_distributions_all apid

7277: ,cpn_invoice_line_number AP_INVOICE_DISTRIBUTIONS_ALL.INVOICE_LINE_NUMBER%TYPE
7278: )
7279: IS
7280: SELECT min(distribution_line_number)
7281: FROM ap_invoice_distributions_all apid
7282: WHERE apid.invoice_id = cpn_invoice_id
7283: AND apid.invoice_line_number = cpn_invoice_line_number;
7284:
7285: --> Cursor to fetch the maximum line_number for current invoice, Bug# 4445989

Line 7372: FROM ap_invoice_distributions_all a

7368: org_id -- Bug 4863208
7369: , project_accounting_context /* 5763527 */
7370: , pa_addition_flag /* 5763527 */
7371: , asset_book_type_code /* 8406404 */
7372: FROM ap_invoice_distributions_all a
7373: WHERE invoice_id = inv_id
7374: AND invoice_line_number = inv_line_num
7375: AND distribution_line_number = cpn_min_dist_line_num;
7376:

Line 7471: FROM ap_invoice_distributions_all

7467: ORDER BY tax_line_no; --pramasub FP end
7468:
7469: CURSOR c_dist_reversal_cnt(p_invoice_id IN NUMBER) IS
7470: SELECT 1
7471: FROM ap_invoice_distributions_all
7472: WHERE invoice_id = p_invoice_id
7473: AND reversal_flag = 'Y'
7474: AND rownum = 1; -- Added by avallabh for bug 4926094 on 03-Feb-2006
7475:

Line 7478: AP_INVOICE_DISTRIBUTIONS_ALL WHERE

7474: AND rownum = 1; -- Added by avallabh for bug 4926094 on 03-Feb-2006
7475:
7476: CURSOR count_dist_no(inv_id NUMBER) IS
7477: SELECT NVL(DISTRIBUTION_LINE_NUMBER,1) FROM
7478: AP_INVOICE_DISTRIBUTIONS_ALL WHERE
7479: INVOICE_ID = inv_id
7480: AND DISTRIBUTION_LINE_NUMBER =
7481: (SELECT MAX(DISTRIBUTION_LINE_NUMBER)
7482: FROM AP_INVOICE_DISTRIBUTIONS_ALL

Line 7482: FROM AP_INVOICE_DISTRIBUTIONS_ALL

7478: AP_INVOICE_DISTRIBUTIONS_ALL WHERE
7479: INVOICE_ID = inv_id
7480: AND DISTRIBUTION_LINE_NUMBER =
7481: (SELECT MAX(DISTRIBUTION_LINE_NUMBER)
7482: FROM AP_INVOICE_DISTRIBUTIONS_ALL
7483: WHERE INVOICE_ID = inv_id)
7484: FOR UPDATE OF DISTRIBUTION_LINE_NUMBER;
7485:
7486: cursor c_get_invoice_distribution is -- bug#3332988

Line 7536: v_assets_tracking_flag ap_invoice_distributions_all.assets_tracking_flag%type;

7532: v_sup_inv_type VARCHAR2(25);
7533: v_ship_num VARCHAR2(30); -- added pramasub FP
7534: get_ven_info_rec get_ven_info%ROWTYPE;
7535: chk_for_pcking_slip_rec checking_for_packing_slip%ROWTYPE;
7536: v_assets_tracking_flag ap_invoice_distributions_all.assets_tracking_flag%type;
7537: v_update_payment_schedule boolean; -- bug#3206083
7538: v_invoice_distribution_id ap_invoice_distributions_all.invoice_distribution_id%type; -- bug#3332988
7539: v_apportn_factor_for_item_line number;
7540: v_dist_code_combination_id ap_invoice_distributions_all.dist_code_combination_id%type;--bug#367196

Line 7538: v_invoice_distribution_id ap_invoice_distributions_all.invoice_distribution_id%type; -- bug#3332988

7534: get_ven_info_rec get_ven_info%ROWTYPE;
7535: chk_for_pcking_slip_rec checking_for_packing_slip%ROWTYPE;
7536: v_assets_tracking_flag ap_invoice_distributions_all.assets_tracking_flag%type;
7537: v_update_payment_schedule boolean; -- bug#3206083
7538: v_invoice_distribution_id ap_invoice_distributions_all.invoice_distribution_id%type; -- bug#3332988
7539: v_apportn_factor_for_item_line number;
7540: v_dist_code_combination_id ap_invoice_distributions_all.dist_code_combination_id%type;--bug#367196
7541:
7542: -- Bug 5401111. Added by Lakshmi Gopalsami

Line 7540: v_dist_code_combination_id ap_invoice_distributions_all.dist_code_combination_id%type;--bug#367196

7536: v_assets_tracking_flag ap_invoice_distributions_all.assets_tracking_flag%type;
7537: v_update_payment_schedule boolean; -- bug#3206083
7538: v_invoice_distribution_id ap_invoice_distributions_all.invoice_distribution_id%type; -- bug#3332988
7539: v_apportn_factor_for_item_line number;
7540: v_dist_code_combination_id ap_invoice_distributions_all.dist_code_combination_id%type;--bug#367196
7541:
7542: -- Bug 5401111. Added by Lakshmi Gopalsami
7543: lv_account_type gl_code_combinations.account_type%TYPE;
7544:

Line 7546: ln_project_id ap_invoice_distributions_all.project_id%TYPE;

7542: -- Bug 5401111. Added by Lakshmi Gopalsami
7543: lv_account_type gl_code_combinations.account_type%TYPE;
7544:
7545: /* 5763527 */
7546: ln_project_id ap_invoice_distributions_all.project_id%TYPE;
7547: ln_task_id ap_invoice_distributions_all.task_id%TYPE;
7548: lv_exp_type ap_invoice_distributions_all.expenditure_type%TYPE;
7549: ld_exp_item_date ap_invoice_distributions_all.expenditure_item_date%TYPE;
7550: ln_exp_organization_id ap_invoice_distributions_all.expenditure_organization_id%TYPE;

Line 7547: ln_task_id ap_invoice_distributions_all.task_id%TYPE;

7543: lv_account_type gl_code_combinations.account_type%TYPE;
7544:
7545: /* 5763527 */
7546: ln_project_id ap_invoice_distributions_all.project_id%TYPE;
7547: ln_task_id ap_invoice_distributions_all.task_id%TYPE;
7548: lv_exp_type ap_invoice_distributions_all.expenditure_type%TYPE;
7549: ld_exp_item_date ap_invoice_distributions_all.expenditure_item_date%TYPE;
7550: ln_exp_organization_id ap_invoice_distributions_all.expenditure_organization_id%TYPE;
7551: lv_project_accounting_context ap_invoice_distributions_all.project_accounting_context%TYPE;

Line 7548: lv_exp_type ap_invoice_distributions_all.expenditure_type%TYPE;

7544:
7545: /* 5763527 */
7546: ln_project_id ap_invoice_distributions_all.project_id%TYPE;
7547: ln_task_id ap_invoice_distributions_all.task_id%TYPE;
7548: lv_exp_type ap_invoice_distributions_all.expenditure_type%TYPE;
7549: ld_exp_item_date ap_invoice_distributions_all.expenditure_item_date%TYPE;
7550: ln_exp_organization_id ap_invoice_distributions_all.expenditure_organization_id%TYPE;
7551: lv_project_accounting_context ap_invoice_distributions_all.project_accounting_context%TYPE;
7552: lv_pa_addition_flag ap_invoice_distributions_all.pa_addition_flag%TYPE;

Line 7549: ld_exp_item_date ap_invoice_distributions_all.expenditure_item_date%TYPE;

7545: /* 5763527 */
7546: ln_project_id ap_invoice_distributions_all.project_id%TYPE;
7547: ln_task_id ap_invoice_distributions_all.task_id%TYPE;
7548: lv_exp_type ap_invoice_distributions_all.expenditure_type%TYPE;
7549: ld_exp_item_date ap_invoice_distributions_all.expenditure_item_date%TYPE;
7550: ln_exp_organization_id ap_invoice_distributions_all.expenditure_organization_id%TYPE;
7551: lv_project_accounting_context ap_invoice_distributions_all.project_accounting_context%TYPE;
7552: lv_pa_addition_flag ap_invoice_distributions_all.pa_addition_flag%TYPE;
7553:

Line 7550: ln_exp_organization_id ap_invoice_distributions_all.expenditure_organization_id%TYPE;

7546: ln_project_id ap_invoice_distributions_all.project_id%TYPE;
7547: ln_task_id ap_invoice_distributions_all.task_id%TYPE;
7548: lv_exp_type ap_invoice_distributions_all.expenditure_type%TYPE;
7549: ld_exp_item_date ap_invoice_distributions_all.expenditure_item_date%TYPE;
7550: ln_exp_organization_id ap_invoice_distributions_all.expenditure_organization_id%TYPE;
7551: lv_project_accounting_context ap_invoice_distributions_all.project_accounting_context%TYPE;
7552: lv_pa_addition_flag ap_invoice_distributions_all.pa_addition_flag%TYPE;
7553:
7554: ln_lines_to_insert number;

Line 7551: lv_project_accounting_context ap_invoice_distributions_all.project_accounting_context%TYPE;

7547: ln_task_id ap_invoice_distributions_all.task_id%TYPE;
7548: lv_exp_type ap_invoice_distributions_all.expenditure_type%TYPE;
7549: ld_exp_item_date ap_invoice_distributions_all.expenditure_item_date%TYPE;
7550: ln_exp_organization_id ap_invoice_distributions_all.expenditure_organization_id%TYPE;
7551: lv_project_accounting_context ap_invoice_distributions_all.project_accounting_context%TYPE;
7552: lv_pa_addition_flag ap_invoice_distributions_all.pa_addition_flag%TYPE;
7553:
7554: ln_lines_to_insert number;
7555: ln_nrec_tax_amt number;

Line 7552: lv_pa_addition_flag ap_invoice_distributions_all.pa_addition_flag%TYPE;

7548: lv_exp_type ap_invoice_distributions_all.expenditure_type%TYPE;
7549: ld_exp_item_date ap_invoice_distributions_all.expenditure_item_date%TYPE;
7550: ln_exp_organization_id ap_invoice_distributions_all.expenditure_organization_id%TYPE;
7551: lv_project_accounting_context ap_invoice_distributions_all.project_accounting_context%TYPE;
7552: lv_pa_addition_flag ap_invoice_distributions_all.pa_addition_flag%TYPE;
7553:
7554: ln_lines_to_insert number;
7555: ln_nrec_tax_amt number;
7556: ln_rec_tax_amt number;

Line 7734: p_table_name => ''AP_INVOICE_DISTRIBUTIONS_ALL'',

7730: begin
7731:
7732: v_mrc_string := 'BEGIN AP_MRC_ENGINE_PKG.Maintain_MRC_Data (
7733: p_operation_mode => ''INSERT'',
7734: p_table_name => ''AP_INVOICE_DISTRIBUTIONS_ALL'',
7735: p_key_value => :a,
7736: p_key_value_list => NULL,
7737: p_calling_sequence =>
7738: ''India Local Tax line as Miscellaneous distribution line (jai_ap_match_tax_pkg.process_batch_record procedure)''

Line 7802: In the insertion to ap_invoice_distributions_all, populated the

7798: only the pay on receipt functionality which will be now used by the
7799: concurrent for pay on receipt which will call this procedure.
7800:
7801: 2. 21/06/2002 Aparajita for bug # 2428264 Version# 614.2
7802: In the insertion to ap_invoice_distributions_all, populated the
7803: org id that is supplied as a parameter to this program. Without this
7804: the org id gets defaulted from the session variables and may go wrong.
7805:
7806: 3. 09/10/2002 Aparajita for bug # 2483164 Version# 615.1

Line 7837: In the insertion to ap_invoice_distributions_all, populated the org id

7833: time. If any reversal is happened for distribution lines, then invoice
7834: header amount is not modified.
7835:
7836: 7. 02/12/2002 Aparajita for bug # 2689834 Version # 615.5
7837: In the insertion to ap_invoice_distributions_all, populated the org id
7838: that is supplied as a parameter to this program. Without this the org id
7839: gets defaulted from the session variables and may go wrong.
7840:
7841: Bug # 2428264 had addressed this issue before but that was only for

Line 7850: in ap_invoice_distributions_all is NULL. Thsi happens in PO matching

7846: 8. 16/12/2002 cbabu for bug# 2713601, FileVersion # 615.6
7847: AP_PAYMENTS_SCHEDULES_ALL is not getting updated with the tax amount
7848: as soon as AP_INVOICES_ALL isgetting updated. Update statement for
7849: ap_payment_schedules_all is written for scenario where rcv_transaction_id
7850: in ap_invoice_distributions_all is NULL. Thsi happens in PO matching
7851: setup for ERS invoices.
7852:
7853: 9. 20/12/2002 Aparajita for bug # 2689826 Version # 615.7
7854:

Line 7869: The assets_tracking_flag in ap_invoice_distributions_all,

7865: Taxes having 0 amount were not considered, changed the cursor
7866: from_line_location_taxes to conside such tax lines for propagation into AP.
7867:
7868: 11. 15/03/2003 Aparajita for bug # 2851123. Version # 615.9
7869: The assets_tracking_flag in ap_invoice_distributions_all,
7870: JAI_AP_MATCH_INV_TAXES and JAI_CMN_FA_INV_DIST_ALL should be set as 'N'
7871: if the tax line against which the line is being generated is excise type of
7872: tax and is modvatable. By default this flag gets the value from the
7873: corresponding item line for which the tax is attached.

Line 7987: ap_invoice_distributions_all.

7983:
7984: This call is made after every distribution line is inserted.
7985: This has been implemented as a in line procedure insert_mrc_data.
7986: The procedure is called after every insert into
7987: ap_invoice_distributions_all.
7988:
7989: Procedure update_mrc_data has been created and invoked whereever
7990: invoice header is being updated.
7991:

Line 8099: be populated in the attribute columns of ap_invoice_distributions_all table

8095:
8096: 42. 8/05/2005 rchandan for bug#4333488. Version 116.1
8097: The Invoice Distribution DFF is eliminated and a new global DFF is used to
8098: maintain the functionality. From now the TDS tax, WCT tax and ESSI will not
8099: be populated in the attribute columns of ap_invoice_distributions_all table
8100: instead these will be populated in the global attribute columns. So the code changes are
8101: made accordingly.
8102:
8103: 43. 10-Jun-2005 rallamse for bug# Version 116.2

Line 8111: ap_invoice_distributions_all.

8107:
8108: 44 23-Jun-2005 Brathod for Bug# 4445989, Version 120.0
8109: Issue: Impact uptake on IL Product for AP_INVOICE_LINES_ALL Uptake
8110: Resolution:- Code modified to consider ap_invoice_lines_all instead of
8111: ap_invoice_distributions_all.
8112: Following changes done
8113: - Code refering to ap_invoice_distributions_all modified to consider
8114: invoice_id and invoice_line_number as unique combination
8115: - invoice line record is created in ap_invoice_lines_all where ever previously

Line 8113: - Code refering to ap_invoice_distributions_all modified to consider

8109: Issue: Impact uptake on IL Product for AP_INVOICE_LINES_ALL Uptake
8110: Resolution:- Code modified to consider ap_invoice_lines_all instead of
8111: ap_invoice_distributions_all.
8112: Following changes done
8113: - Code refering to ap_invoice_distributions_all modified to consider
8114: invoice_id and invoice_line_number as unique combination
8115: - invoice line record is created in ap_invoice_lines_all where ever previously
8116: distribution was created
8117: - Obsoleted JAI_CMN_FA_INV_DIST_ALL

Line 8128: (2) Derived the org_id for inserting into ap_invoice_distributions_all

8124: 2) Commented the call to function - jai_general_pkg.get_accounting_method
8125:
8126: 46. 08-Dec-2005 Bug 4863208. Added by Lakshmi Gopalsami Version 120.2
8127: (1) Added wfapproval_Status in insert to ap_invoice_lines_all
8128: (2) Derived the org_id for inserting into ap_invoice_distributions_all
8129: This is added in CURSOR for_dist_insertion
8130: (3) Added values for match_status_flag, reversal_flag in insert
8131:
8132: 47. 04-Feb-2008 JMEENA for bug#6780154

Line 8141: Modified the insert statement of ap_invoice_distributions_all to populate the charge_applicable_to_dist_id

8137: 48. 21-Feb-2008 JMEENA for bug#6835548
8138: Changed the value of lv_match_type from NOT MATCHED to NOT_MATCHED.
8139:
8140: 49. 19-May-2008 JMEENA for bug#7008161
8141: Modified the insert statement of ap_invoice_distributions_all to populate the charge_applicable_to_dist_id
8142: based on v_assets_tracking_flag and removed the condition of account_type.
8143:
8144:
8145: Future Dependencies For the release Of this Object:-

Line 8285: FROM AP_INVOICE_DISTRIBUTIONS_ALL

8281: /*
8282: Commented by Brathod for Bug# 4445989
8283: SELECT NVL(DISTRIBUTION_LINE_NUMBER,1)
8284: INTO v_distribution_no
8285: FROM AP_INVOICE_DISTRIBUTIONS_ALL
8286: WHERE INVOICE_ID = inv_id
8287: AND DISTRIBUTION_LINE_NUMBER =
8288: (
8289: SELECT MAX(DISTRIBUTION_LINE_NUMBER)

Line 8290: FROM AP_INVOICE_DISTRIBUTIONS_ALL

8286: WHERE INVOICE_ID = inv_id
8287: AND DISTRIBUTION_LINE_NUMBER =
8288: (
8289: SELECT MAX(DISTRIBUTION_LINE_NUMBER)
8290: FROM AP_INVOICE_DISTRIBUTIONS_ALL
8291: WHERE INVOICE_ID = inv_id
8292: )
8293: FOR UPDATE OF DISTRIBUTION_LINE_NUMBER;
8294: */

Line 8902: INSERT INTO ap_invoice_distributions_all

8898: close c_get_invoice_distribution;
8899: -- End bug#3332988
8900: fnd_file.put_line(FND_FILE.LOG, ' Invoice distribution id '|| v_invoice_distribution_id);
8901:
8902: INSERT INTO ap_invoice_distributions_all
8903: (
8904: accounting_date,
8905: accrual_posted_flag,
8906: assets_addition_flag,

Line 9767: INSERT INTO ap_invoice_distributions_all

9763: close c_get_invoice_distribution;
9764: -- End bug#3332988
9765: fnd_file.put_line(FND_FILE.LOG, ' Invoice distribution id '|| v_invoice_distribution_id);
9766:
9767: INSERT INTO ap_invoice_distributions_all
9768: (
9769: accounting_date,
9770: accrual_posted_flag,
9771: assets_addition_flag,

Line 10619: 'Before inserting into ap_invoice_distributions_all for distribution line no :'

10615: ,po_dist_id --Added for bug#6780154
10616: );
10617:
10618: Fnd_File.put_line(Fnd_File.LOG,
10619: 'Before inserting into ap_invoice_distributions_all for distribution line no :'
10620: || v_distribution_no);
10621:
10622: -- Start bug#3332988
10623: open c_get_invoice_distribution;

Line 10629: INSERT INTO ap_invoice_distributions_all

10625: close c_get_invoice_distribution;
10626: -- End bug#3332988
10627: fnd_file.put_line(FND_FILE.LOG, ' Invoice distribution id '|| v_invoice_distribution_id);
10628:
10629: INSERT INTO ap_invoice_distributions_all
10630: (
10631: accounting_date,
10632: accrual_posted_flag,
10633: assets_addition_flag,