DBA Data[Home] [Help]

APPS.JAI_AP_DTC_GENERATION_PKG dependencies on STANDARD

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 6122: /* Standard invoice to TDS authority, Credit memo to supplier */

6118:
6119: /* Invoice Numbers, type for the invoice pair that is being created */
6120: if ( (pv_tds_event = 'INVOICE VALIDATE') or (pv_tds_event like 'THRESHOLD TRANSITION%') ) then
6121:
6122: /* Standard invoice to TDS authority, Credit memo to supplier */
6123:
6124: lv_invoice_to_tds_type := 'STANDARD';
6125: lv_invoice_to_vendor_type := 'CREDIT';
6126: /*Bug 7410219 - Modified Invoice Number as per Section*/

Line 6124: lv_invoice_to_tds_type := 'STANDARD';

6120: if ( (pv_tds_event = 'INVOICE VALIDATE') or (pv_tds_event like 'THRESHOLD TRANSITION%') ) then
6121:
6122: /* Standard invoice to TDS authority, Credit memo to supplier */
6123:
6124: lv_invoice_to_tds_type := 'STANDARD';
6125: lv_invoice_to_vendor_type := 'CREDIT';
6126: /*Bug 7410219 - Modified Invoice Number as per Section*/
6127: lv_invoice_to_tds_num := lv_invoice_num ||'-'||lv_section_name||'-SI-'||lv_ja_in_ap_inv_id;
6128: lv_invoice_to_vendor_num := lv_invoice_num ||'-'||lv_section_name||'-CM-'||lv_ja_in_ap_inv_id;

Line 6135: /* Credit memo to TDS authority, Standard invoice to supplier */

6131: ln_invoice_to_vendor_amount := (-1) * ln_tax_amount;
6132:
6133: elsif pv_tds_event = 'PREPAYMENT APPLICATION' OR pv_tds_event like 'THRESHOLD ROLLBACK%' then --Added by Sanjikum for Bug#5131075(4718907)
6134:
6135: /* Credit memo to TDS authority, Standard invoice to supplier */
6136: if pv_invoice_num_prepay_apply is not null then
6137: lv_invoice_num := substr(pv_invoice_num_prepay_apply, 1, 30);
6138: end if;
6139:

Line 6141: lv_invoice_to_vendor_type := 'STANDARD';

6137: lv_invoice_num := substr(pv_invoice_num_prepay_apply, 1, 30);
6138: end if;
6139:
6140: lv_invoice_to_tds_type := 'CREDIT';
6141: lv_invoice_to_vendor_type := 'STANDARD';
6142: /*Bug 7410219 - Modified Invoice Number as per Section*/
6143: lv_invoice_to_tds_num := lv_invoice_num ||'-RTN-'||lv_section_name||'-CM-'||lv_ja_in_ap_inv_id;
6144: lv_invoice_to_vendor_num := lv_invoice_num ||'-RTN-'||lv_section_name||'-SI-'||lv_ja_in_ap_inv_id;
6145:

Line 6151: /* Standard invoice to TDS authority, Credit memo to supplier */

6147: ln_invoice_to_vendor_amount := ln_tax_amount;
6148:
6149: elsif pv_tds_event = 'PREPAYMENT UNAPPLICATION' then
6150:
6151: /* Standard invoice to TDS authority, Credit memo to supplier */
6152: lv_invoice_to_tds_type := 'STANDARD';
6153: lv_invoice_to_vendor_type := 'CREDIT';
6154:
6155: if pv_invoice_num_to_tds_apply is not null then

Line 6152: lv_invoice_to_tds_type := 'STANDARD';

6148:
6149: elsif pv_tds_event = 'PREPAYMENT UNAPPLICATION' then
6150:
6151: /* Standard invoice to TDS authority, Credit memo to supplier */
6152: lv_invoice_to_tds_type := 'STANDARD';
6153: lv_invoice_to_vendor_type := 'CREDIT';
6154:
6155: if pv_invoice_num_to_tds_apply is not null then
6156: lv_invoice_to_tds_num := 'CAN/' || substr(pv_invoice_num_to_tds_apply, 1, 45);

Line 6174: /* No invoice to TDS authority, Standard invoice to supplier */

6170: ln_invoice_to_vendor_amount := (-1) * ln_tax_amount;
6171:
6172: elsif pv_tds_event = 'INVOICE CANCEL' then
6173:
6174: /* No invoice to TDS authority, Standard invoice to supplier */
6175:
6176: lv_invoice_to_tds_num := null;
6177:
6178: if pv_invoice_num_to_vendor_can is not null then

Line 6186: lv_invoice_to_vendor_type := 'STANDARD';

6182: lv_invoice_to_vendor_num := lv_invoice_num||'-CAN-'||lv_section_name||'-SI-'||lv_ja_in_ap_inv_id;
6183: end if;
6184:
6185: lv_invoice_to_tds_type := null;
6186: lv_invoice_to_vendor_type := 'STANDARD';
6187:
6188: ln_invoice_to_tds_amount := null;
6189: ln_invoice_to_vendor_amount := ln_tax_amount;
6190:

Line 6194: /* Standard invoice to TDS authority, Credit memo to supplier */

6190:
6191: /*START, Bgowrava for Bug#8254510*/
6192: elsif ( pv_tds_event = G_SURCHARGE_CALCULATE) then
6193:
6194: /* Standard invoice to TDS authority, Credit memo to supplier */
6195:
6196: lv_invoice_to_tds_type := 'STANDARD';
6197: lv_invoice_to_vendor_type := 'CREDIT';
6198:

Line 6196: lv_invoice_to_tds_type := 'STANDARD';

6192: elsif ( pv_tds_event = G_SURCHARGE_CALCULATE) then
6193:
6194: /* Standard invoice to TDS authority, Credit memo to supplier */
6195:
6196: lv_invoice_to_tds_type := 'STANDARD';
6197: lv_invoice_to_vendor_type := 'CREDIT';
6198:
6199: lv_invoice_to_tds_num := lv_invoice_num ||'-SUR-'||lv_section_name||'-SI-'||lv_ja_in_ap_inv_id; --Added lv_section_name by Chong on 20130130 for bug#16048702
6200: lv_invoice_to_vendor_num := lv_invoice_num ||'-SUR-'||lv_section_name||'-CM-'||lv_ja_in_ap_inv_id; --Added lv_section_name by Chong on 20130130 for bug#16048702

Line 6208: /* Credit memo to TDS authority, Standard invoice to supplier */

6204: /*END, Bgowrava for Bug#8254510*/
6205: --Added by Chong for Bug#13359892 2012/09/27 Start
6206: -----------------------------------------------------------------------------
6207: elsif ( pv_tds_event = G_SURCHARGE_ROLLBACK) then
6208: /* Credit memo to TDS authority, Standard invoice to supplier */
6209: lv_invoice_to_tds_type := 'CREDIT';
6210: lv_invoice_to_vendor_type := 'STANDARD';
6211:
6212: lv_invoice_to_tds_num := lv_invoice_num ||'-SUR-RTN-'||lv_section_name||'-CM-'||lv_ja_in_ap_inv_id; --Added lv_section_name by Chong on 20130130 for bug#16048702

Line 6210: lv_invoice_to_vendor_type := 'STANDARD';

6206: -----------------------------------------------------------------------------
6207: elsif ( pv_tds_event = G_SURCHARGE_ROLLBACK) then
6208: /* Credit memo to TDS authority, Standard invoice to supplier */
6209: lv_invoice_to_tds_type := 'CREDIT';
6210: lv_invoice_to_vendor_type := 'STANDARD';
6211:
6212: lv_invoice_to_tds_num := lv_invoice_num ||'-SUR-RTN-'||lv_section_name||'-CM-'||lv_ja_in_ap_inv_id; --Added lv_section_name by Chong on 20130130 for bug#16048702
6213: lv_invoice_to_vendor_num := lv_invoice_num ||'-SUR-RTN-'||lv_section_name||'-SI-'||lv_ja_in_ap_inv_id; --Added lv_section_name by Chong on 20130130 for bug#16048702
6214:

Line 6431: /*Bug 9759709 - Liability Account for the Credit Note must be fetched from the Standard Invoice

6427: end if;
6428:
6429: fnd_file.put_line(FND_FILE.LOG, ' CALL utils for inserting interface lines');
6430:
6431: /*Bug 9759709 - Liability Account for the Credit Note must be fetched from the Standard Invoice
6432: If it is not present, then it needs to be defaulted from Vendor Site Setup. Passing NULL to
6433: parameter p_accts_pay_ccid in jai_ap_utils_pkg.insert_ap_inv_interface would cause it to default
6434: from setup*/
6435: if (r_ap_invoices_all.accts_pay_code_combination_id is not NULL) then

Line 7144: /* Standard invoice to TDS authority, Credit memo to supplier */

7140:
7141: /* Invoice Numbers, type for the invoice pair that is being created */
7142: if ( (pv_tds_event = 'INVOICE VALIDATE') or (pv_tds_event like 'THRESHOLD TRANSITION%') ) then
7143:
7144: /* Standard invoice to TDS authority, Credit memo to supplier */
7145:
7146: lv_invoice_to_tds_type := 'STANDARD';
7147: lv_invoice_to_vendor_type := 'CREDIT';
7148: /*Bug 7410219 - Modified Invoice Number as per Section*/

Line 7146: lv_invoice_to_tds_type := 'STANDARD';

7142: if ( (pv_tds_event = 'INVOICE VALIDATE') or (pv_tds_event like 'THRESHOLD TRANSITION%') ) then
7143:
7144: /* Standard invoice to TDS authority, Credit memo to supplier */
7145:
7146: lv_invoice_to_tds_type := 'STANDARD';
7147: lv_invoice_to_vendor_type := 'CREDIT';
7148: /*Bug 7410219 - Modified Invoice Number as per Section*/
7149: lv_invoice_to_tds_num := lv_invoice_num ||'-'||lv_section_name||'-SI-'||lv_ja_in_ap_inv_id;
7150: lv_invoice_to_vendor_num := lv_invoice_num ||'-'||lv_section_name||'-CM-'||lv_ja_in_ap_inv_id;

Line 7157: /* Credit memo to TDS authority, Standard invoice to supplier */

7153: ln_invoice_to_vendor_amount := (-1) * ln_tax_amount;
7154:
7155: elsif pv_tds_event = 'PREPAYMENT APPLICATION' OR pv_tds_event like 'THRESHOLD ROLLBACK%' then --Added by Sanjikum for Bug#5131075(4718907)
7156:
7157: /* Credit memo to TDS authority, Standard invoice to supplier */
7158: if pv_invoice_num_prepay_apply is not null then
7159: lv_invoice_num := substr(pv_invoice_num_prepay_apply, 1, 30);
7160: end if;
7161:

Line 7163: lv_invoice_to_vendor_type := 'STANDARD';

7159: lv_invoice_num := substr(pv_invoice_num_prepay_apply, 1, 30);
7160: end if;
7161:
7162: lv_invoice_to_tds_type := 'CREDIT';
7163: lv_invoice_to_vendor_type := 'STANDARD';
7164: /*Bug 7410219 - Modified Invoice Number as per Section*/
7165: lv_invoice_to_tds_num := lv_invoice_num ||'-RTN-'||lv_section_name||'-CM-'||lv_ja_in_ap_inv_id;
7166: lv_invoice_to_vendor_num := lv_invoice_num ||'-RTN-'||lv_section_name||'-SI-'||lv_ja_in_ap_inv_id;
7167:

Line 7173: /* Standard invoice to TDS authority, Credit memo to supplier */

7169: ln_invoice_to_vendor_amount := ln_tax_amount;
7170:
7171: elsif pv_tds_event = 'PREPAYMENT UNAPPLICATION' then
7172:
7173: /* Standard invoice to TDS authority, Credit memo to supplier */
7174: lv_invoice_to_tds_type := 'STANDARD';
7175: lv_invoice_to_vendor_type := 'CREDIT';
7176:
7177: if pv_invoice_num_to_tds_apply is not null then

Line 7174: lv_invoice_to_tds_type := 'STANDARD';

7170:
7171: elsif pv_tds_event = 'PREPAYMENT UNAPPLICATION' then
7172:
7173: /* Standard invoice to TDS authority, Credit memo to supplier */
7174: lv_invoice_to_tds_type := 'STANDARD';
7175: lv_invoice_to_vendor_type := 'CREDIT';
7176:
7177: if pv_invoice_num_to_tds_apply is not null then
7178: lv_invoice_to_tds_num := 'CAN/' || substr(pv_invoice_num_to_tds_apply, 1, 45);

Line 7196: /* No invoice to TDS authority, Standard invoice to supplier */

7192: ln_invoice_to_vendor_amount := (-1) * ln_tax_amount;
7193:
7194: elsif pv_tds_event = 'INVOICE CANCEL' then
7195:
7196: /* No invoice to TDS authority, Standard invoice to supplier */
7197:
7198: lv_invoice_to_tds_num := null;
7199:
7200: if pv_invoice_num_to_vendor_can is not null then

Line 7208: lv_invoice_to_vendor_type := 'STANDARD';

7204: lv_invoice_to_vendor_num := lv_invoice_num||'-CAN-'||lv_section_name||'-SI-'||lv_ja_in_ap_inv_id;
7205: end if;
7206:
7207: lv_invoice_to_tds_type := null;
7208: lv_invoice_to_vendor_type := 'STANDARD';
7209:
7210: ln_invoice_to_tds_amount := null;
7211: ln_invoice_to_vendor_amount := ln_tax_amount;
7212:

Line 7216: /* Standard invoice to TDS authority, Credit memo to supplier */

7212:
7213: /*START, Bgowrava for Bug#8254510*/
7214: elsif ( pv_tds_event = G_SURCHARGE_CALCULATE) then
7215:
7216: /* Standard invoice to TDS authority, Credit memo to supplier */
7217:
7218: lv_invoice_to_tds_type := 'STANDARD';
7219: lv_invoice_to_vendor_type := 'CREDIT';
7220:

Line 7218: lv_invoice_to_tds_type := 'STANDARD';

7214: elsif ( pv_tds_event = G_SURCHARGE_CALCULATE) then
7215:
7216: /* Standard invoice to TDS authority, Credit memo to supplier */
7217:
7218: lv_invoice_to_tds_type := 'STANDARD';
7219: lv_invoice_to_vendor_type := 'CREDIT';
7220:
7221: lv_invoice_to_tds_num := lv_invoice_num ||'-SUR-SI-'||lv_ja_in_ap_inv_id;
7222: lv_invoice_to_vendor_num := lv_invoice_num ||'-SUR-CM-'||lv_ja_in_ap_inv_id;

Line 7382: /*Bug 9759709 - Liability Account for the Credit Note must be fetched from the Standard Invoice

7378:
7379: END IF; --( ln_proc_level >= ln_dbg_level) ;
7380: --fnd_file.put_line(FND_FILE.LOG, ' CALL utils for inserting interface lines');
7381:
7382: /*Bug 9759709 - Liability Account for the Credit Note must be fetched from the Standard Invoice
7383: If it is not present, then it needs to be defaulted from Vendor Site Setup. Passing NULL to
7384: parameter p_accts_pay_ccid in jai_ap_utils_pkg.insert_ap_inv_interface would cause it to default
7385: from setup*/
7386: if (r_ap_invoices_all.accts_pay_code_combination_id is not NULL) then

Line 10071: lv_tds_credit_memo_message := 'Generated Standard invoice to suppliet : ' || lv_invoice_to_vendor_num;

10067: goto Continue_with_next_record;
10068: end if;
10069:
10070: lv_tds_credit_memo_flag := 'Y';
10071: lv_tds_credit_memo_message := 'Generated Standard invoice to suppliet : ' || lv_invoice_to_vendor_num;
10072: lv_codepath := jai_general_pkg.plot_codepath(16,lv_codepath); /* 16 */
10073:
10074: if ln_start_threshold_trx_id is null then
10075: ln_start_threshold_trx_id := ln_threshold_trx_id;

Line 10083: compensating standard invoice has been made */

10079:
10080: END IF; /* Credit memo to the supplier paid / not paid */
10081:
10082: /* Control comes here when either the credit memo for the tds authority is cancelled or a
10083: compensating standard invoice has been made */
10084:
10085: ln_threshold_grp_id := cur_rec.threshold_grp_id;
10086: maintain_thhold_grps(p_threshold_grp_id => ln_threshold_grp_id,
10087: p_trx_tax_paid => (-1 * cur_rec.tax_amount),

Line 10548: lv_invoice_to_vendor_type := 'STANDARD';

10544: /*Only for threshold rollback*/
10545: if pv_tds_event like 'THRESHOLD ROLLBACK%' then
10546:
10547: lv_invoice_to_tds_type := 'CREDIT';
10548: lv_invoice_to_vendor_type := 'STANDARD';
10549: /*Bug 7410219 - Modified Invoice Number as per Section*/
10550: lv_invoice_to_tds_num := lv_invoice_num ||'-RTN-'||lv_section_name||'-CM-'||lv_ja_in_ap_inv_id;
10551: lv_invoice_to_vendor_num := lv_invoice_num ||'-RTN-'||lv_section_name||'-SI-'||lv_ja_in_ap_inv_id;
10552:

Line 10693: /*Bug 9759709 - Liability Account for the Credit Note must be fetched from the Standard Invoice

10689:
10690: END IF; --( ln_proc_level >= ln_dbg_level) ;
10691: --fnd_file.put_line(FND_FILE.LOG, ' CALL utils for inserting interface lines');
10692:
10693: /*Bug 9759709 - Liability Account for the Credit Note must be fetched from the Standard Invoice
10694: If it is not present, then it needs to be defaulted from Vendor Site Setup. Passing NULL to
10695: parameter p_accts_pay_ccid in jai_ap_utils_pkg.insert_ap_inv_interface would cause it to default
10696: from setup*/
10697: if (r_ap_invoices_all.accts_pay_code_combination_id is not NULL) then

Line 10860: /*Bug 9759709 - Liability Account for the Credit Note must be fetched from the Standard Invoice

10856: --fnd_file.put_line(FND_FILE.LOG, ' CALL utils for inserting interface lines');
10857:
10858: IF NVL(ln_invoice_to_vendor_amount,0) <> 0 THEN
10859:
10860: /*Bug 9759709 - Liability Account for the Credit Note must be fetched from the Standard Invoice
10861: If it is not present, then it needs to be defaulted from Vendor Site Setup. Passing NULL to
10862: parameter p_accts_pay_ccid in jai_ap_utils_pkg.insert_ap_inv_interface would cause it to default
10863: from setup*/
10864: /*there will be only one liability Account in one threshold group*/