DBA Data[Home] [Help]

APPS.JAI_AP_MATCH_TAX_PKG dependencies on AP_INVOICE_DISTRIBUTIONS_ALL

Line 140: trigger ja_in_tds_temp_after_insert_trg on ap_invoice_distributions_all. The main concepts

136: This trigger was created to move the processing of invoice lines while invoices get generated
137: from purchasing with pay on receipt option. the concurrent was getting submitted for every item
138: lines of the invoice, to generate associate tax lines. With this procedure all such invoice lines
139: will be processed as 1 concurrent. The temporary table used here is being populated from the
140: trigger ja_in_tds_temp_after_insert_trg on ap_invoice_distributions_all. The main concepts
141: used here are,
142: - if an error occurs while processing a particular record, the program will skip processing
143: all other distributions lines of the error invoice.
144: - the program will continue to process other invoices.

Line 540: ap_invoice_distributions_all apd,

536: api.last_update_date,
537: api.last_updated_by,
538: api.invoice_date
539: FROM ap_invoices_all api,
540: ap_invoice_distributions_all apd,
541: po_distributions_all pod,
542: po_headers_all poh
543: WHERE apd.invoice_id = api.invoice_id
544: AND pod.po_header_id = poh.po_header_id

Line 551: ( cpn_invoice_id AP_INVOICE_DISTRIBUTIONS_ALL.INVOICE_ID%TYPE

547: AND api.invoice_id = inv_id
548: AND apd.distribution_line_number = cpn_min_dist_line_no;
549: -- Added by Brathod to get minimum invoice line number from invoice distributions, Bug#4445989
550: CURSOR cur_get_min_dist_linenum
551: ( cpn_invoice_id AP_INVOICE_DISTRIBUTIONS_ALL.INVOICE_ID%TYPE
552: ,cpn_invoice_line_number AP_INVOICE_DISTRIBUTIONS_ALL.INVOICE_LINE_NUMBER%TYPE
553: )
554: IS
555: SELECT min(distribution_line_number)

Line 552: ,cpn_invoice_line_number AP_INVOICE_DISTRIBUTIONS_ALL.INVOICE_LINE_NUMBER%TYPE

548: AND apd.distribution_line_number = cpn_min_dist_line_no;
549: -- Added by Brathod to get minimum invoice line number from invoice distributions, Bug#4445989
550: CURSOR cur_get_min_dist_linenum
551: ( cpn_invoice_id AP_INVOICE_DISTRIBUTIONS_ALL.INVOICE_ID%TYPE
552: ,cpn_invoice_line_number AP_INVOICE_DISTRIBUTIONS_ALL.INVOICE_LINE_NUMBER%TYPE
553: )
554: IS
555: SELECT min(distribution_line_number)
556: FROM ap_invoice_distributions_all apid

Line 556: FROM ap_invoice_distributions_all apid

552: ,cpn_invoice_line_number AP_INVOICE_DISTRIBUTIONS_ALL.INVOICE_LINE_NUMBER%TYPE
553: )
554: IS
555: SELECT min(distribution_line_number)
556: FROM ap_invoice_distributions_all apid
557: WHERE apid.invoice_id = cpn_invoice_id
558: AND apid.invoice_line_number = cpn_invoice_line_number;
559:
560:

Line 720: FROM ap_invoice_distributions_all a

716: /* 5763527 */
717: ,project_accounting_context
718: ,pa_addition_flag
719: /* End 5763527 */
720: FROM ap_invoice_distributions_all a
721: WHERE invoice_id = cpn_invoice_id
722: AND invoice_line_number = cpn_inv_line_num
723: AND distribution_line_number = cpn_min_dist_line_num;
724:

Line 912: v_price_var_accnt ap_invoice_distributions_all.price_var_code_combination_id%type;

908: chk_for_pcking_slip_rec checking_for_packing_slip%ROWTYPE;
909: v_invoice_num_for_log VARCHAR2(50);
910: v_tax_variance_inv_cur number; -- bug # 2775043
911: v_tax_variance_fun_cur number; -- bug # 2775043
912: v_price_var_accnt ap_invoice_distributions_all.price_var_code_combination_id%type;
913: v_distribution_no ap_invoice_distributions_all.distribution_line_number%type;
914: v_assets_tracking_flag ap_invoice_distributions_all.assets_tracking_flag%type;
915: v_dist_code_combination_id ap_invoice_distributions_all.dist_code_combination_id%type;--bug#367196
916: v_update_payment_schedule boolean; -- bug#3218978

Line 913: v_distribution_no ap_invoice_distributions_all.distribution_line_number%type;

909: v_invoice_num_for_log VARCHAR2(50);
910: v_tax_variance_inv_cur number; -- bug # 2775043
911: v_tax_variance_fun_cur number; -- bug # 2775043
912: v_price_var_accnt ap_invoice_distributions_all.price_var_code_combination_id%type;
913: v_distribution_no ap_invoice_distributions_all.distribution_line_number%type;
914: v_assets_tracking_flag ap_invoice_distributions_all.assets_tracking_flag%type;
915: v_dist_code_combination_id ap_invoice_distributions_all.dist_code_combination_id%type;--bug#367196
916: v_update_payment_schedule boolean; -- bug#3218978
917: v_invoice_distribution_id ap_invoice_distributions_all.invoice_distribution_id%type; -- bug#3332988

Line 914: v_assets_tracking_flag ap_invoice_distributions_all.assets_tracking_flag%type;

910: v_tax_variance_inv_cur number; -- bug # 2775043
911: v_tax_variance_fun_cur number; -- bug # 2775043
912: v_price_var_accnt ap_invoice_distributions_all.price_var_code_combination_id%type;
913: v_distribution_no ap_invoice_distributions_all.distribution_line_number%type;
914: v_assets_tracking_flag ap_invoice_distributions_all.assets_tracking_flag%type;
915: v_dist_code_combination_id ap_invoice_distributions_all.dist_code_combination_id%type;--bug#367196
916: v_update_payment_schedule boolean; -- bug#3218978
917: v_invoice_distribution_id ap_invoice_distributions_all.invoice_distribution_id%type; -- bug#3332988
918: v_functional_currency gl_sets_of_books.currency_code%type; -- bug#3354932

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

911: v_tax_variance_fun_cur number; -- bug # 2775043
912: v_price_var_accnt ap_invoice_distributions_all.price_var_code_combination_id%type;
913: v_distribution_no ap_invoice_distributions_all.distribution_line_number%type;
914: v_assets_tracking_flag ap_invoice_distributions_all.assets_tracking_flag%type;
915: v_dist_code_combination_id ap_invoice_distributions_all.dist_code_combination_id%type;--bug#367196
916: v_update_payment_schedule boolean; -- bug#3218978
917: v_invoice_distribution_id ap_invoice_distributions_all.invoice_distribution_id%type; -- bug#3332988
918: v_functional_currency gl_sets_of_books.currency_code%type; -- bug#3354932
919: v_batch_id NUMBER;

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

913: v_distribution_no ap_invoice_distributions_all.distribution_line_number%type;
914: v_assets_tracking_flag ap_invoice_distributions_all.assets_tracking_flag%type;
915: v_dist_code_combination_id ap_invoice_distributions_all.dist_code_combination_id%type;--bug#367196
916: v_update_payment_schedule boolean; -- bug#3218978
917: v_invoice_distribution_id ap_invoice_distributions_all.invoice_distribution_id%type; -- bug#3332988
918: v_functional_currency gl_sets_of_books.currency_code%type; -- bug#3354932
919: v_batch_id NUMBER;
920: c_tax_rec c_tax%ROWTYPE;
921: v_source VARCHAR2(25);

Line 946: ln_project_id ap_invoice_distributions_all.project_id%TYPE;

942: ln_ship_to_location_id po_line_locations_all.ship_to_location_id%type;
943:
944:
945: /* 5763527 , Project costing Fwd porting*/
946: ln_project_id ap_invoice_distributions_all.project_id%TYPE;
947: ln_task_id ap_invoice_distributions_all.task_id%TYPE;
948: lv_exp_type ap_invoice_distributions_all.expenditure_type%TYPE;
949: ld_exp_item_date ap_invoice_distributions_all.expenditure_item_date%TYPE;
950: ln_exp_organization_id ap_invoice_distributions_all.expenditure_organization_id%TYPE;

Line 947: ln_task_id ap_invoice_distributions_all.task_id%TYPE;

943:
944:
945: /* 5763527 , Project costing Fwd porting*/
946: ln_project_id ap_invoice_distributions_all.project_id%TYPE;
947: ln_task_id ap_invoice_distributions_all.task_id%TYPE;
948: lv_exp_type ap_invoice_distributions_all.expenditure_type%TYPE;
949: ld_exp_item_date ap_invoice_distributions_all.expenditure_item_date%TYPE;
950: ln_exp_organization_id ap_invoice_distributions_all.expenditure_organization_id%TYPE;
951: lv_project_accounting_context ap_invoice_distributions_all.project_accounting_context%TYPE;

Line 948: lv_exp_type ap_invoice_distributions_all.expenditure_type%TYPE;

944:
945: /* 5763527 , Project costing Fwd porting*/
946: ln_project_id ap_invoice_distributions_all.project_id%TYPE;
947: ln_task_id ap_invoice_distributions_all.task_id%TYPE;
948: lv_exp_type ap_invoice_distributions_all.expenditure_type%TYPE;
949: ld_exp_item_date ap_invoice_distributions_all.expenditure_item_date%TYPE;
950: ln_exp_organization_id ap_invoice_distributions_all.expenditure_organization_id%TYPE;
951: lv_project_accounting_context ap_invoice_distributions_all.project_accounting_context%TYPE;
952: lv_pa_addition_flag ap_invoice_distributions_all.pa_addition_flag%TYPE;

Line 949: ld_exp_item_date ap_invoice_distributions_all.expenditure_item_date%TYPE;

945: /* 5763527 , Project costing Fwd porting*/
946: ln_project_id ap_invoice_distributions_all.project_id%TYPE;
947: ln_task_id ap_invoice_distributions_all.task_id%TYPE;
948: lv_exp_type ap_invoice_distributions_all.expenditure_type%TYPE;
949: ld_exp_item_date ap_invoice_distributions_all.expenditure_item_date%TYPE;
950: ln_exp_organization_id ap_invoice_distributions_all.expenditure_organization_id%TYPE;
951: lv_project_accounting_context ap_invoice_distributions_all.project_accounting_context%TYPE;
952: lv_pa_addition_flag ap_invoice_distributions_all.pa_addition_flag%TYPE;
953:

Line 950: ln_exp_organization_id ap_invoice_distributions_all.expenditure_organization_id%TYPE;

946: ln_project_id ap_invoice_distributions_all.project_id%TYPE;
947: ln_task_id ap_invoice_distributions_all.task_id%TYPE;
948: lv_exp_type ap_invoice_distributions_all.expenditure_type%TYPE;
949: ld_exp_item_date ap_invoice_distributions_all.expenditure_item_date%TYPE;
950: ln_exp_organization_id ap_invoice_distributions_all.expenditure_organization_id%TYPE;
951: lv_project_accounting_context ap_invoice_distributions_all.project_accounting_context%TYPE;
952: lv_pa_addition_flag ap_invoice_distributions_all.pa_addition_flag%TYPE;
953:
954: ln_lines_to_insert number;

Line 951: lv_project_accounting_context ap_invoice_distributions_all.project_accounting_context%TYPE;

947: ln_task_id ap_invoice_distributions_all.task_id%TYPE;
948: lv_exp_type ap_invoice_distributions_all.expenditure_type%TYPE;
949: ld_exp_item_date ap_invoice_distributions_all.expenditure_item_date%TYPE;
950: ln_exp_organization_id ap_invoice_distributions_all.expenditure_organization_id%TYPE;
951: lv_project_accounting_context ap_invoice_distributions_all.project_accounting_context%TYPE;
952: lv_pa_addition_flag ap_invoice_distributions_all.pa_addition_flag%TYPE;
953:
954: ln_lines_to_insert number;
955: ln_nrec_tax_amt number;

Line 952: lv_pa_addition_flag ap_invoice_distributions_all.pa_addition_flag%TYPE;

948: lv_exp_type ap_invoice_distributions_all.expenditure_type%TYPE;
949: ld_exp_item_date ap_invoice_distributions_all.expenditure_item_date%TYPE;
950: ln_exp_organization_id ap_invoice_distributions_all.expenditure_organization_id%TYPE;
951: lv_project_accounting_context ap_invoice_distributions_all.project_accounting_context%TYPE;
952: lv_pa_addition_flag ap_invoice_distributions_all.pa_addition_flag%TYPE;
953:
954: ln_lines_to_insert number;
955: ln_nrec_tax_amt number;
956: ln_rec_tax_amt number;

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

1164: begin
1165:
1166: v_mrc_string := 'BEGIN AP_MRC_ENGINE_PKG.Maintain_MRC_Data (
1167: p_operation_mode => ''INSERT'',
1168: p_table_name => ''AP_INVOICE_DISTRIBUTIONS_ALL'',
1169: p_key_value => :a,
1170: p_key_value_list => NULL,
1171: p_calling_sequence =>
1172: ''India Local Tax line as Miscellaneous distribution line (jai_ap_match_tax_pkg.process_online procedure)''

Line 1229: from ap_invoice_distributions_all

1225:
1226: -- get the corresponding base line amount in original invoice
1227: cursor c_check_orig_item_line(p_price_correct_inv_id number, p_po_distribution_id number) is
1228: select amount, invoice_distribution_id
1229: from ap_invoice_distributions_all
1230: WHERE invoice_id = p_price_correct_inv_id
1231: and po_distribution_id = p_po_distribution_id
1232: AND line_type_lookup_code = 'ITEM';
1233:

Line 1438: The assets_tracking_flag in ap_invoice_distributions_all,

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

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

1535:
1536: This call is made after every distribution line is inserted.
1537: This has been implemented as a in line procedure insert_mrc_data.
1538:
1539: The procedure is called after every insert into ap_invoice_distributions_all.
1540:
1541: Procedure update_mrc_data has been created and invoked whereever invoice
1542: header is being updated.
1543:

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

1679:
1680: 45 8/05/2005 rchandan for bug#4333488. Version 116.1
1681: The Invoice Distribution DFF is eliminated and a new global DFF is used to
1682: maintain the functionality. From now the TDS tax, WCT tax and ESSI will not
1683: be populated in the attribute columns of ap_invoice_distributions_all table
1684: instead these will be populated in the global attribute columns. So the code changes are
1685: made accordingly.
1686:
1687: 46 10-Jun-2005 rallamse for bug# Version 116.2

Line 1695: ap_invoice_distributions_all.

1691:
1692: 47 23-Jun-2005 Brathod for Bug# 4445989, Version 120.0
1693: Issue: Impact uptake on IL Product for AP_INVOICE_LINES_ALL Uptake
1694: Resolution:- Code modified to consider ap_invoice_lines_all instead of
1695: ap_invoice_distributions_all.
1696: Following changes done
1697: - Code refering to ap_invoice_distributions_all modified to consider
1698: invoice_id and invoice_line_number as unique combination
1699: - invoice line record is created in ap_invoice_lines_all where ever previously

Line 1697: - Code refering to ap_invoice_distributions_all modified to consider

1693: Issue: Impact uptake on IL Product for AP_INVOICE_LINES_ALL Uptake
1694: Resolution:- Code modified to consider ap_invoice_lines_all instead of
1695: ap_invoice_distributions_all.
1696: Following changes done
1697: - Code refering to ap_invoice_distributions_all modified to consider
1698: invoice_id and invoice_line_number as unique combination
1699: - invoice line record is created in ap_invoice_lines_all where ever previously
1700: distribution was created
1701: - Obsoleted JAI_CMN_FA_INV_DIST_ALL

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

1731: 55. 03-APR-2008 Jason Liu for bug#66936416
1732: Added a condition to exclude the third party taxes
1733:
1734: 56. 19-May-2008 JMEENA for bug#7008161
1735: Modified the insert statement of ap_invoice_distributions_all to populate the charge_applicable_to_dist_id
1736: based on v_assets_tracking_flag and removed the condition of account_type.
1737:
1738: 57. 12-Dec-2008 Added by Bgowrava for Bug#7503308, File Version 120.7.12000000.15, 120.34.12010000.4, 120.38
1739: Issue: INDIA - TO INSERT TAXES FOR PAY ON RECEIPT REQUESTPERFORMANCE ISSUE

Line 1873: update ap_invoice_distributions_all

1869:
1870: begin
1871: -- following update statement is to just get a lock on the distribution lines of the invoice.
1872: -- the distribution line numbers should be unique and in sequence.
1873: update ap_invoice_distributions_all
1874: set last_update_date = last_update_date
1875: where invoice_id = inv_id;
1876:
1877: -- Added by Brathod for Bug# 4445989

Line 1892: from ap_invoice_distributions_all

1888: /*
1889: Commented by Brathod for Bug# 4445989
1890: select max(DISTRIBUTION_LINE_NUMBER)
1891: into v_distribution_no
1892: from ap_invoice_distributions_all
1893: where invoice_id = inv_id;
1894: */
1895:
1896: exception

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

2675: ,po_dist_id --Added for bug#6780154
2676: );
2677:
2678: Fnd_File.put_line(Fnd_File.LOG,
2679: 'Before inserting into ap_invoice_distributions_all for distribution line no :'
2680: ||v_distribution_no );
2681:
2682: -- Start bug#3332988
2683: open c_get_invoice_distribution;

Line 2691: INSERT INTO ap_invoice_distributions_all

2687:
2688: fnd_file.put_line(FND_FILE.LOG, ' Invoice distribution id '|| v_invoice_distribution_id);
2689:
2690:
2691: INSERT INTO ap_invoice_distributions_all
2692: (
2693: accounting_date,
2694: accrual_posted_flag,
2695: assets_addition_flag,

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

3529: ,po_dist_id --Added for bug#6780154
3530: );
3531:
3532: Fnd_File.put_line(Fnd_File.LOG,
3533: 'Before inserting into ap_invoice_distributions_all for distribution line no : '
3534: ||v_distribution_no);
3535:
3536: -- Start bug#3332988
3537: open c_get_invoice_distribution;

Line 3544: INSERT INTO ap_invoice_distributions_all

3540: -- End bug#3332988
3541:
3542: fnd_file.put_line(FND_FILE.LOG, ' Invoice distribution id '|| v_invoice_distribution_id);
3543:
3544: INSERT INTO ap_invoice_distributions_all
3545: (
3546: accounting_date,
3547: accrual_posted_flag,
3548: assets_addition_flag,

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

4383: ,po_dist_id --Added for bug#6780154
4384: );
4385:
4386: Fnd_File.put_line(Fnd_File.LOG,
4387: 'Before inserting into ap_invoice_distributions_all for distribution line no : ' || v_distribution_no);
4388:
4389: -- Start bug#3332988
4390: open c_get_invoice_distribution;
4391: fetch c_get_invoice_distribution into v_invoice_distribution_id;

Line 4397: INSERT INTO ap_invoice_distributions_all

4393: -- End bug#3332988
4394:
4395: fnd_file.put_line(FND_FILE.LOG, ' Invoice distribution id '|| v_invoice_distribution_id);
4396:
4397: INSERT INTO ap_invoice_distributions_all
4398: (
4399: accounting_date,
4400: accrual_posted_flag,
4401: assets_addition_flag,

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

5319: );
5320:
5321:
5322: Fnd_File.put_line(Fnd_File.LOG,
5323: 'Before inserting into ap_invoice_distributions_all for distribution line no :' || v_distribution_no);
5324:
5325: -- Start bug#3332988
5326: open c_get_invoice_distribution;
5327: fetch c_get_invoice_distribution into v_invoice_distribution_id;

Line 5333: INSERT INTO ap_invoice_distributions_all

5329: -- End bug#3332988
5330:
5331: fnd_file.put_line(FND_FILE.LOG, ' Invoice distribution id '|| v_invoice_distribution_id);
5332:
5333: INSERT INTO ap_invoice_distributions_all
5334: (
5335: accounting_date,
5336: accrual_posted_flag,
5337: assets_addition_flag,

Line 5715: ap_invoice_distributions_all apd,

5711: api.last_update_date,
5712: api.last_updated_by,
5713: api.invoice_date
5714: FROM ap_invoices_all api,
5715: ap_invoice_distributions_all apd,
5716: po_distributions_all pod,
5717: po_headers_all poh
5718: WHERE api.invoice_id = inv_id
5719: AND api.invoice_id = apd.invoice_id

Line 5727: ( cpn_invoice_id AP_INVOICE_DISTRIBUTIONS_ALL.INVOICE_ID%TYPE

5723: AND apd.distribution_line_number = cpn_max_dist_line_num;
5724:
5725: -- Added by Brathod to get minimum invoice line number from invoice distributions, Bug#4445989
5726: CURSOR cur_get_min_dist_linenum
5727: ( cpn_invoice_id AP_INVOICE_DISTRIBUTIONS_ALL.INVOICE_ID%TYPE
5728: ,cpn_invoice_line_number AP_INVOICE_DISTRIBUTIONS_ALL.INVOICE_LINE_NUMBER%TYPE
5729: )
5730: IS
5731: SELECT min(distribution_line_number)

Line 5728: ,cpn_invoice_line_number AP_INVOICE_DISTRIBUTIONS_ALL.INVOICE_LINE_NUMBER%TYPE

5724:
5725: -- Added by Brathod to get minimum invoice line number from invoice distributions, Bug#4445989
5726: CURSOR cur_get_min_dist_linenum
5727: ( cpn_invoice_id AP_INVOICE_DISTRIBUTIONS_ALL.INVOICE_ID%TYPE
5728: ,cpn_invoice_line_number AP_INVOICE_DISTRIBUTIONS_ALL.INVOICE_LINE_NUMBER%TYPE
5729: )
5730: IS
5731: SELECT min(distribution_line_number)
5732: FROM ap_invoice_distributions_all apid

Line 5732: FROM ap_invoice_distributions_all apid

5728: ,cpn_invoice_line_number AP_INVOICE_DISTRIBUTIONS_ALL.INVOICE_LINE_NUMBER%TYPE
5729: )
5730: IS
5731: SELECT min(distribution_line_number)
5732: FROM ap_invoice_distributions_all apid
5733: WHERE apid.invoice_id = cpn_invoice_id
5734: AND apid.invoice_line_number = cpn_invoice_line_number;
5735:
5736: --> Cursor to fetch the maximum line_number for current invoice, Bug# 4445989

Line 5821: FROM ap_invoice_distributions_all a

5817: matched_uom_lookup_code,
5818: org_id -- Bug 4863208
5819: , project_accounting_context /* 5763527 */
5820: , pa_addition_flag /* 5763527 */
5821: FROM ap_invoice_distributions_all a
5822: WHERE invoice_id = inv_id
5823: AND invoice_line_number = inv_line_num
5824: AND distribution_line_number = cpn_min_dist_line_num;
5825:

Line 5920: FROM ap_invoice_distributions_all

5916: ORDER BY tax_line_no; --pramasub FP end
5917:
5918: CURSOR c_dist_reversal_cnt(p_invoice_id IN NUMBER) IS
5919: SELECT 1
5920: FROM ap_invoice_distributions_all
5921: WHERE invoice_id = p_invoice_id
5922: AND reversal_flag = 'Y'
5923: AND rownum = 1; -- Added by avallabh for bug 4926094 on 03-Feb-2006
5924:

Line 5927: AP_INVOICE_DISTRIBUTIONS_ALL WHERE

5923: AND rownum = 1; -- Added by avallabh for bug 4926094 on 03-Feb-2006
5924:
5925: CURSOR count_dist_no(inv_id NUMBER) IS
5926: SELECT NVL(DISTRIBUTION_LINE_NUMBER,1) FROM
5927: AP_INVOICE_DISTRIBUTIONS_ALL WHERE
5928: INVOICE_ID = inv_id
5929: AND DISTRIBUTION_LINE_NUMBER =
5930: (SELECT MAX(DISTRIBUTION_LINE_NUMBER)
5931: FROM AP_INVOICE_DISTRIBUTIONS_ALL

Line 5931: FROM AP_INVOICE_DISTRIBUTIONS_ALL

5927: AP_INVOICE_DISTRIBUTIONS_ALL WHERE
5928: INVOICE_ID = inv_id
5929: AND DISTRIBUTION_LINE_NUMBER =
5930: (SELECT MAX(DISTRIBUTION_LINE_NUMBER)
5931: FROM AP_INVOICE_DISTRIBUTIONS_ALL
5932: WHERE INVOICE_ID = inv_id)
5933: FOR UPDATE OF DISTRIBUTION_LINE_NUMBER;
5934:
5935: cursor c_get_invoice_distribution is -- bug#3332988

Line 5985: v_assets_tracking_flag ap_invoice_distributions_all.assets_tracking_flag%type;

5981: v_sup_inv_type VARCHAR2(25);
5982: v_ship_num VARCHAR2(30); -- added pramasub FP
5983: get_ven_info_rec get_ven_info%ROWTYPE;
5984: chk_for_pcking_slip_rec checking_for_packing_slip%ROWTYPE;
5985: v_assets_tracking_flag ap_invoice_distributions_all.assets_tracking_flag%type;
5986: v_update_payment_schedule boolean; -- bug#3206083
5987: v_invoice_distribution_id ap_invoice_distributions_all.invoice_distribution_id%type; -- bug#3332988
5988: v_apportn_factor_for_item_line number;
5989: v_dist_code_combination_id ap_invoice_distributions_all.dist_code_combination_id%type;--bug#367196

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

5983: get_ven_info_rec get_ven_info%ROWTYPE;
5984: chk_for_pcking_slip_rec checking_for_packing_slip%ROWTYPE;
5985: v_assets_tracking_flag ap_invoice_distributions_all.assets_tracking_flag%type;
5986: v_update_payment_schedule boolean; -- bug#3206083
5987: v_invoice_distribution_id ap_invoice_distributions_all.invoice_distribution_id%type; -- bug#3332988
5988: v_apportn_factor_for_item_line number;
5989: v_dist_code_combination_id ap_invoice_distributions_all.dist_code_combination_id%type;--bug#367196
5990:
5991: -- Bug 5401111. Added by Lakshmi Gopalsami

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

5985: v_assets_tracking_flag ap_invoice_distributions_all.assets_tracking_flag%type;
5986: v_update_payment_schedule boolean; -- bug#3206083
5987: v_invoice_distribution_id ap_invoice_distributions_all.invoice_distribution_id%type; -- bug#3332988
5988: v_apportn_factor_for_item_line number;
5989: v_dist_code_combination_id ap_invoice_distributions_all.dist_code_combination_id%type;--bug#367196
5990:
5991: -- Bug 5401111. Added by Lakshmi Gopalsami
5992: lv_account_type gl_code_combinations.account_type%TYPE;
5993:

Line 5995: ln_project_id ap_invoice_distributions_all.project_id%TYPE;

5991: -- Bug 5401111. Added by Lakshmi Gopalsami
5992: lv_account_type gl_code_combinations.account_type%TYPE;
5993:
5994: /* 5763527 */
5995: ln_project_id ap_invoice_distributions_all.project_id%TYPE;
5996: ln_task_id ap_invoice_distributions_all.task_id%TYPE;
5997: lv_exp_type ap_invoice_distributions_all.expenditure_type%TYPE;
5998: ld_exp_item_date ap_invoice_distributions_all.expenditure_item_date%TYPE;
5999: ln_exp_organization_id ap_invoice_distributions_all.expenditure_organization_id%TYPE;

Line 5996: ln_task_id ap_invoice_distributions_all.task_id%TYPE;

5992: lv_account_type gl_code_combinations.account_type%TYPE;
5993:
5994: /* 5763527 */
5995: ln_project_id ap_invoice_distributions_all.project_id%TYPE;
5996: ln_task_id ap_invoice_distributions_all.task_id%TYPE;
5997: lv_exp_type ap_invoice_distributions_all.expenditure_type%TYPE;
5998: ld_exp_item_date ap_invoice_distributions_all.expenditure_item_date%TYPE;
5999: ln_exp_organization_id ap_invoice_distributions_all.expenditure_organization_id%TYPE;
6000: lv_project_accounting_context ap_invoice_distributions_all.project_accounting_context%TYPE;

Line 5997: lv_exp_type ap_invoice_distributions_all.expenditure_type%TYPE;

5993:
5994: /* 5763527 */
5995: ln_project_id ap_invoice_distributions_all.project_id%TYPE;
5996: ln_task_id ap_invoice_distributions_all.task_id%TYPE;
5997: lv_exp_type ap_invoice_distributions_all.expenditure_type%TYPE;
5998: ld_exp_item_date ap_invoice_distributions_all.expenditure_item_date%TYPE;
5999: ln_exp_organization_id ap_invoice_distributions_all.expenditure_organization_id%TYPE;
6000: lv_project_accounting_context ap_invoice_distributions_all.project_accounting_context%TYPE;
6001: lv_pa_addition_flag ap_invoice_distributions_all.pa_addition_flag%TYPE;

Line 5998: ld_exp_item_date ap_invoice_distributions_all.expenditure_item_date%TYPE;

5994: /* 5763527 */
5995: ln_project_id ap_invoice_distributions_all.project_id%TYPE;
5996: ln_task_id ap_invoice_distributions_all.task_id%TYPE;
5997: lv_exp_type ap_invoice_distributions_all.expenditure_type%TYPE;
5998: ld_exp_item_date ap_invoice_distributions_all.expenditure_item_date%TYPE;
5999: ln_exp_organization_id ap_invoice_distributions_all.expenditure_organization_id%TYPE;
6000: lv_project_accounting_context ap_invoice_distributions_all.project_accounting_context%TYPE;
6001: lv_pa_addition_flag ap_invoice_distributions_all.pa_addition_flag%TYPE;
6002:

Line 5999: ln_exp_organization_id ap_invoice_distributions_all.expenditure_organization_id%TYPE;

5995: ln_project_id ap_invoice_distributions_all.project_id%TYPE;
5996: ln_task_id ap_invoice_distributions_all.task_id%TYPE;
5997: lv_exp_type ap_invoice_distributions_all.expenditure_type%TYPE;
5998: ld_exp_item_date ap_invoice_distributions_all.expenditure_item_date%TYPE;
5999: ln_exp_organization_id ap_invoice_distributions_all.expenditure_organization_id%TYPE;
6000: lv_project_accounting_context ap_invoice_distributions_all.project_accounting_context%TYPE;
6001: lv_pa_addition_flag ap_invoice_distributions_all.pa_addition_flag%TYPE;
6002:
6003: ln_lines_to_insert number;

Line 6000: lv_project_accounting_context ap_invoice_distributions_all.project_accounting_context%TYPE;

5996: ln_task_id ap_invoice_distributions_all.task_id%TYPE;
5997: lv_exp_type ap_invoice_distributions_all.expenditure_type%TYPE;
5998: ld_exp_item_date ap_invoice_distributions_all.expenditure_item_date%TYPE;
5999: ln_exp_organization_id ap_invoice_distributions_all.expenditure_organization_id%TYPE;
6000: lv_project_accounting_context ap_invoice_distributions_all.project_accounting_context%TYPE;
6001: lv_pa_addition_flag ap_invoice_distributions_all.pa_addition_flag%TYPE;
6002:
6003: ln_lines_to_insert number;
6004: ln_nrec_tax_amt number;

Line 6001: lv_pa_addition_flag ap_invoice_distributions_all.pa_addition_flag%TYPE;

5997: lv_exp_type ap_invoice_distributions_all.expenditure_type%TYPE;
5998: ld_exp_item_date ap_invoice_distributions_all.expenditure_item_date%TYPE;
5999: ln_exp_organization_id ap_invoice_distributions_all.expenditure_organization_id%TYPE;
6000: lv_project_accounting_context ap_invoice_distributions_all.project_accounting_context%TYPE;
6001: lv_pa_addition_flag ap_invoice_distributions_all.pa_addition_flag%TYPE;
6002:
6003: ln_lines_to_insert number;
6004: ln_nrec_tax_amt number;
6005: ln_rec_tax_amt number;

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

6176: begin
6177:
6178: v_mrc_string := 'BEGIN AP_MRC_ENGINE_PKG.Maintain_MRC_Data (
6179: p_operation_mode => ''INSERT'',
6180: p_table_name => ''AP_INVOICE_DISTRIBUTIONS_ALL'',
6181: p_key_value => :a,
6182: p_key_value_list => NULL,
6183: p_calling_sequence =>
6184: ''India Local Tax line as Miscellaneous distribution line (jai_ap_match_tax_pkg.process_batch_record procedure)''

Line 6248: In the insertion to ap_invoice_distributions_all, populated the

6244: only the pay on receipt functionality which will be now used by the
6245: concurrent for pay on receipt which will call this procedure.
6246:
6247: 2. 21/06/2002 Aparajita for bug # 2428264 Version# 614.2
6248: In the insertion to ap_invoice_distributions_all, populated the
6249: org id that is supplied as a parameter to this program. Without this
6250: the org id gets defaulted from the session variables and may go wrong.
6251:
6252: 3. 09/10/2002 Aparajita for bug # 2483164 Version# 615.1

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

6279: time. If any reversal is happened for distribution lines, then invoice
6280: header amount is not modified.
6281:
6282: 7. 02/12/2002 Aparajita for bug # 2689834 Version # 615.5
6283: In the insertion to ap_invoice_distributions_all, populated the org id
6284: that is supplied as a parameter to this program. Without this the org id
6285: gets defaulted from the session variables and may go wrong.
6286:
6287: Bug # 2428264 had addressed this issue before but that was only for

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

6292: 8. 16/12/2002 cbabu for bug# 2713601, FileVersion # 615.6
6293: AP_PAYMENTS_SCHEDULES_ALL is not getting updated with the tax amount
6294: as soon as AP_INVOICES_ALL isgetting updated. Update statement for
6295: ap_payment_schedules_all is written for scenario where rcv_transaction_id
6296: in ap_invoice_distributions_all is NULL. Thsi happens in PO matching
6297: setup for ERS invoices.
6298:
6299: 9. 20/12/2002 Aparajita for bug # 2689826 Version # 615.7
6300:

Line 6315: The assets_tracking_flag in ap_invoice_distributions_all,

6311: Taxes having 0 amount were not considered, changed the cursor
6312: from_line_location_taxes to conside such tax lines for propagation into AP.
6313:
6314: 11. 15/03/2003 Aparajita for bug # 2851123. Version # 615.9
6315: The assets_tracking_flag in ap_invoice_distributions_all,
6316: JAI_AP_MATCH_INV_TAXES and JAI_CMN_FA_INV_DIST_ALL should be set as 'N'
6317: if the tax line against which the line is being generated is excise type of
6318: tax and is modvatable. By default this flag gets the value from the
6319: corresponding item line for which the tax is attached.

Line 6433: ap_invoice_distributions_all.

6429:
6430: This call is made after every distribution line is inserted.
6431: This has been implemented as a in line procedure insert_mrc_data.
6432: The procedure is called after every insert into
6433: ap_invoice_distributions_all.
6434:
6435: Procedure update_mrc_data has been created and invoked whereever
6436: invoice header is being updated.
6437:

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

6541:
6542: 42. 8/05/2005 rchandan for bug#4333488. Version 116.1
6543: The Invoice Distribution DFF is eliminated and a new global DFF is used to
6544: maintain the functionality. From now the TDS tax, WCT tax and ESSI will not
6545: be populated in the attribute columns of ap_invoice_distributions_all table
6546: instead these will be populated in the global attribute columns. So the code changes are
6547: made accordingly.
6548:
6549: 43. 10-Jun-2005 rallamse for bug# Version 116.2

Line 6557: ap_invoice_distributions_all.

6553:
6554: 44 23-Jun-2005 Brathod for Bug# 4445989, Version 120.0
6555: Issue: Impact uptake on IL Product for AP_INVOICE_LINES_ALL Uptake
6556: Resolution:- Code modified to consider ap_invoice_lines_all instead of
6557: ap_invoice_distributions_all.
6558: Following changes done
6559: - Code refering to ap_invoice_distributions_all modified to consider
6560: invoice_id and invoice_line_number as unique combination
6561: - invoice line record is created in ap_invoice_lines_all where ever previously

Line 6559: - Code refering to ap_invoice_distributions_all modified to consider

6555: Issue: Impact uptake on IL Product for AP_INVOICE_LINES_ALL Uptake
6556: Resolution:- Code modified to consider ap_invoice_lines_all instead of
6557: ap_invoice_distributions_all.
6558: Following changes done
6559: - Code refering to ap_invoice_distributions_all modified to consider
6560: invoice_id and invoice_line_number as unique combination
6561: - invoice line record is created in ap_invoice_lines_all where ever previously
6562: distribution was created
6563: - Obsoleted JAI_CMN_FA_INV_DIST_ALL

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

6570: 2) Commented the call to function - jai_general_pkg.get_accounting_method
6571:
6572: 46. 08-Dec-2005 Bug 4863208. Added by Lakshmi Gopalsami Version 120.2
6573: (1) Added wfapproval_Status in insert to ap_invoice_lines_all
6574: (2) Derived the org_id for inserting into ap_invoice_distributions_all
6575: This is added in CURSOR for_dist_insertion
6576: (3) Added values for match_status_flag, reversal_flag in insert
6577:
6578: 47. 04-Feb-2008 JMEENA for bug#6780154

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

6583: 48. 21-Feb-2008 JMEENA for bug#6835548
6584: Changed the value of lv_match_type from NOT MATCHED to NOT_MATCHED.
6585:
6586: 49. 19-May-2008 JMEENA for bug#7008161
6587: Modified the insert statement of ap_invoice_distributions_all to populate the charge_applicable_to_dist_id
6588: based on v_assets_tracking_flag and removed the condition of account_type.
6589:
6590:
6591: Future Dependencies For the release Of this Object:-

Line 6731: FROM AP_INVOICE_DISTRIBUTIONS_ALL

6727: /*
6728: Commented by Brathod for Bug# 4445989
6729: SELECT NVL(DISTRIBUTION_LINE_NUMBER,1)
6730: INTO v_distribution_no
6731: FROM AP_INVOICE_DISTRIBUTIONS_ALL
6732: WHERE INVOICE_ID = inv_id
6733: AND DISTRIBUTION_LINE_NUMBER =
6734: (
6735: SELECT MAX(DISTRIBUTION_LINE_NUMBER)

Line 6736: FROM AP_INVOICE_DISTRIBUTIONS_ALL

6732: WHERE INVOICE_ID = inv_id
6733: AND DISTRIBUTION_LINE_NUMBER =
6734: (
6735: SELECT MAX(DISTRIBUTION_LINE_NUMBER)
6736: FROM AP_INVOICE_DISTRIBUTIONS_ALL
6737: WHERE INVOICE_ID = inv_id
6738: )
6739: FOR UPDATE OF DISTRIBUTION_LINE_NUMBER;
6740: */

Line 7342: INSERT INTO ap_invoice_distributions_all

7338: close c_get_invoice_distribution;
7339: -- End bug#3332988
7340: fnd_file.put_line(FND_FILE.LOG, ' Invoice distribution id '|| v_invoice_distribution_id);
7341:
7342: INSERT INTO ap_invoice_distributions_all
7343: (
7344: accounting_date,
7345: accrual_posted_flag,
7346: assets_addition_flag,

Line 8189: INSERT INTO ap_invoice_distributions_all

8185: close c_get_invoice_distribution;
8186: -- End bug#3332988
8187: fnd_file.put_line(FND_FILE.LOG, ' Invoice distribution id '|| v_invoice_distribution_id);
8188:
8189: INSERT INTO ap_invoice_distributions_all
8190: (
8191: accounting_date,
8192: accrual_posted_flag,
8193: assets_addition_flag,

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

9025: ,po_dist_id --Added for bug#6780154
9026: );
9027:
9028: Fnd_File.put_line(Fnd_File.LOG,
9029: 'Before inserting into ap_invoice_distributions_all for distribution line no :'
9030: || v_distribution_no);
9031:
9032: -- Start bug#3332988
9033: open c_get_invoice_distribution;

Line 9039: INSERT INTO ap_invoice_distributions_all

9035: close c_get_invoice_distribution;
9036: -- End bug#3332988
9037: fnd_file.put_line(FND_FILE.LOG, ' Invoice distribution id '|| v_invoice_distribution_id);
9038:
9039: INSERT INTO ap_invoice_distributions_all
9040: (
9041: accounting_date,
9042: accrual_posted_flag,
9043: assets_addition_flag,