DBA Data[Home] [Help]

APPS.JAI_AP_TDS_PREPAYMENTS_PKG dependencies on STANDARD

Line 107: on the net amount of standard invoice and hence the RTN need not be created.

103:
104: 11. 13-Jan-2010 Xiao for Bug#6596019
105: Commented the code related to creation of TDS invoices for RTN generation.
106: This is implemented because on application of prepayment the TDS calculated is
107: on the net amount of standard invoice and hence the RTN need not be created.
108:
109: 12. 14/01/2010 Added by Jia for FP Bug#7431371
110: Issue: This is a forward port bug for the 11i Bug#7419533
111: FINANCIALS FOR INDIA -TDS NOT WORKING IN CASE OF MULTIPLE DISTRIBUTIONS

Line 127: before validating the standard invoice' even though the prepayment was applied after validation of std invoice.

123:
124: Bug 8679964 (Forward Port of 8639011)
125: -------------------------------------
126: When attempting to unapply prepayment error message pops up 'Cannot unapply the prepayment as it was applied
127: before validating the standard invoice' even though the prepayment was applied after validation of std invoice.
128:
129: Bug 6363056 (Forward Port of 6031679)
130: -------------------------------------
131: When prepayment from the previous year is applied on to the Standard Invoice of the current year,

Line 131: When prepayment from the previous year is applied on to the Standard Invoice of the current year,

127: before validating the standard invoice' even though the prepayment was applied after validation of std invoice.
128:
129: Bug 6363056 (Forward Port of 6031679)
130: -------------------------------------
131: When prepayment from the previous year is applied on to the Standard Invoice of the current year,
132: it results in 'Effective Tax Amount cannot be negative'.
133: This issue is fixed by Invoice ID of the latest document in jai_ap_tds_thhold_trxs when inserting records
134: for TDS Event 'PREPAYMENT APPLICATION'. Apart from this, the threshold group which belongs latest
135: GL Date in the Distribution is used.

Line 139: RTN not generated for the correct amount when Prepayment Tax Rate is different from the Standard Invoice

135: GL Date in the Distribution is used.
136:
137: Bug 6972230 (Forward Port of 6742977)
138: -------------------------------------
139: RTN not generated for the correct amount when Prepayment Tax Rate is different from the Standard Invoice
140: Tax Rate
141:
142: Bug 6929483 (Forward Port of 6911776)
143: -------------------------------------

Line 149: is applied to a standard invoice.

145:
146: Bug 8431516 (Forward Port of 7626202)
147: -------------------------------------
148: RTN invoice would be generated to negate the effect of TDS invoice created for a prepayment, when the prepayment
149: is applied to a standard invoice.
150:
151: 14. 21-Jun-2010 Bug - 9826422
152: Description: Records are inserted into AP Interface tables using Standard Invoice, but import_and_approve
153: was called using the Prepayment Invoice ID. Hence wrong group_id was getting passed and no

Line 152: Description: Records are inserted into AP Interface tables using Standard Invoice, but import_and_approve

148: RTN invoice would be generated to negate the effect of TDS invoice created for a prepayment, when the prepayment
149: is applied to a standard invoice.
150:
151: 14. 21-Jun-2010 Bug - 9826422
152: Description: Records are inserted into AP Interface tables using Standard Invoice, but import_and_approve
153: was called using the Prepayment Invoice ID. Hence wrong group_id was getting passed and no
154: Invoices were getting improved
155: Fix: Replaced p_invoice_id by ln_parent_invoice_id
156:

Line 158: Description:UNAPP OF PREPAYMENT SHOULD NOT BE ALLOWED ON VALIDATED STANDARD INVOICE AFTER AP

154: Invoices were getting improved
155: Fix: Replaced p_invoice_id by ln_parent_invoice_id
156:
157: 15. 09-Jun-2011 Bug 12392890
158: Description:UNAPP OF PREPAYMENT SHOULD NOT BE ALLOWED ON VALIDATED STANDARD INVOICE AFTER AP
159: Fix:Modified the cursor c_get_prepay_apply
160: Changed the parameter from p_invoice_distribution_id to p_parent_reversal_id
161:
162: 16. 24-Jan-2012 mmurtuza for bug 13620923

Line 172: Description:RTN TDS invoice not generated when a prepayment is applied to a standard invoice

168: Description:PREPAYMENT ALLOWED TO BE APPLIED ON INVOICE EVEN IF IT HAS NO TDS
169: Fix:In populate_section_tax procedure, added a condition to check the TDS sections on both the documents.
170:
171: 18. 23-Jul-12 amandali for bug 14183670
172: Description:RTN TDS invoice not generated when a prepayment is applied to a standard invoice
173: Fix: Added a new cursor c_applied_amount to calculate the applied amount to an invoice and modified the if condition for checking the application_mode
174:
175: 19. 08-Nov-2012 amandali for bug 14811018
176: Description:RTN not generated for standard invoice having a negative line without TDS

Line 176: Description:RTN not generated for standard invoice having a negative line without TDS

172: Description:RTN TDS invoice not generated when a prepayment is applied to a standard invoice
173: Fix: Added a new cursor c_applied_amount to calculate the applied amount to an invoice and modified the if condition for checking the application_mode
174:
175: 19. 08-Nov-2012 amandali for bug 14811018
176: Description:RTN not generated for standard invoice having a negative line without TDS
177: Fix:Added AND clause in cursor c_get_effective_available_amt in procedure allocate_prepayment to find the effective amount for the lines having TDS alone.
178:
179: 20. 20-Nov-2012 amandali for bug 15848719
180: Description:RTN NOT GENERATED FOR A SI HAVING A NEGATIVE LINE HAVING TDS

Line 363: P_process_message := 'Error - Cannot Unapply prepayment as it was Applied before Validating the Standard invoice';

359:
360: if p_event = 'INSERT' and nvl(ln_prepay_apply,0) > 0 and nvl(ln_prepay_apply_trx_id, 0) = 0 and ln_cnt_thrshold <> 0 then
361: /*added condition of ln_cnt_thrshold by mmurtuza for bug 13620923*/
362: p_process_flag := 'E';
363: P_process_message := 'Error - Cannot Unapply prepayment as it was Applied before Validating the Standard invoice';
364: goto exit_from_procedure;
365: end if;
366:
367:

Line 1227: lv_application_basis := 'STANDARD INVOICE';

1223: fetch c_get_tds_application_basis into lv_is_si_validated_flag;
1224: close c_get_tds_application_basis;
1225:
1226: if nvl(lv_is_si_validated_flag, 'Y') = 'Y' then
1227: lv_application_basis := 'STANDARD INVOICE';
1228: else
1229: lv_application_basis := 'PREPAYMENT';
1230: end if;
1231: */

Line 1247: -- Get the threshold_trx_id of the standard invoice.

1243: OPEN get_threshold_trx_id (pre_pay_inv_id,p_prepay_distribution_id );
1244: FETCH get_threshold_trx_id INTO lv_pp_thhold_trx_id ;
1245: CLOSE get_threshold_trx_id;
1246: jai_cmn_utils_pkg.write_fnd_log_msg('jai_ap_tds_prepayments_pkg','lv_pp_thhold_trx_id: '||lv_pp_thhold_trx_id);
1247: -- Get the threshold_trx_id of the standard invoice.
1248: SELECT max(nvl(threshold_trx_id, 0))
1249: INTO lv_si_thhold_trx_id
1250: FROM jai_ap_tds_inv_taxes
1251: WHERE invoice_id = p_invoice_id ;

Line 1254: lv_application_basis := 'STANDARD INVOICE';

1250: FROM jai_ap_tds_inv_taxes
1251: WHERE invoice_id = p_invoice_id ;
1252: jai_cmn_utils_pkg.write_fnd_log_msg('jai_ap_tds_prepayments_pkg',' lv_si_thhold_trx_id: '||lv_si_thhold_trx_id);
1253: IF (lv_si_thhold_trx_id > NVL (lv_pp_thhold_trx_id,0 )) THEN
1254: lv_application_basis := 'STANDARD INVOICE';
1255: ELSIF ( NVL (lv_pp_thhold_trx_id,0 ) <> 0 ) THEN
1256: lv_application_basis := 'PREPAYMENT';
1257: END IF ;
1258: /*Bug 5751783 - End*/

Line 1282: /* Start- Bug 13929793 --Validate the section codes of standard and prepayment invoices during application */

1278:
1279: for cur_rec in c_get_tax_details_si_inv_dist(p_invoice_id, cur_rec_pp_allocations.invoice_distribution_id) loop
1280: -- Bug 4754213. Added by Lakshmi Gopalsami
1281: if cur_rec.section_type = 'TDS_SECTION' then
1282: /* Start- Bug 13929793 --Validate the section codes of standard and prepayment invoices during application */
1283: if nvl(cur_rec.section_code, 'XYZ') <> nvl(lv_tds_section_code_prepay,'XYZ')
1284: and nvl(jai_populate_attribute.is_legacy_invoice(pre_pay_inv_id), 'N') = 'N' then
1285: /* Added above AND condition for bug 16606774 -
1286: This validation for legacy invoice is checked only if the Client Extension in jai_populate_attribute.is_legacy_invoice function enable_customization is set to Y */

Line 1300: and if the standard invoice belongs to a single slab */

1296: lv_tds_section_code_other is not null and
1297: lv_tds_section_code_prepay is not null
1298: then
1299: /* Bug 14657086 -Added the below if condition. RTN should not be generated when a prepayment does not have TDS deducted
1300: and if the standard invoice belongs to a single slab */
1301: if nvl(lv_pp_thhold_trx_id,0 ) = 0 and cur_rec.threshold_slab_id_single is not null
1302: then lv_tds_applicable_flag := 'N';
1303: else
1304: lv_tds_applicable_flag := 'Y';

Line 1400: decode(application_basis, 'STANDARD INVOICE', tds_tax_id_other, tds_tax_id_prepay),

1396: application_amount,
1397: application_basis,
1398: /*
1399: decode(tds_applicable_flag, 'Y',
1400: decode(application_basis, 'STANDARD INVOICE', tds_tax_id_other, tds_tax_id_prepay),
1401: null) tds_tax_id,
1402: decode(wct_applicable_flag, 'Y',
1403: decode(application_basis, 'STANDARD INVOICE', wct_tax_id_other, wct_tax_id_prepay),
1404: null) wct_tax_id,

Line 1403: decode(application_basis, 'STANDARD INVOICE', wct_tax_id_other, wct_tax_id_prepay),

1399: decode(tds_applicable_flag, 'Y',
1400: decode(application_basis, 'STANDARD INVOICE', tds_tax_id_other, tds_tax_id_prepay),
1401: null) tds_tax_id,
1402: decode(wct_applicable_flag, 'Y',
1403: decode(application_basis, 'STANDARD INVOICE', wct_tax_id_other, wct_tax_id_prepay),
1404: null) wct_tax_id,
1405: decode(essi_applicable_flag, 'Y',
1406: decode(application_basis, 'STANDARD INVOICE', essi_tax_id_other, essi_tax_id_prepay),
1407: null) essi_tax_id

Line 1406: decode(application_basis, 'STANDARD INVOICE', essi_tax_id_other, essi_tax_id_prepay),

1402: decode(wct_applicable_flag, 'Y',
1403: decode(application_basis, 'STANDARD INVOICE', wct_tax_id_other, wct_tax_id_prepay),
1404: null) wct_tax_id,
1405: decode(essi_applicable_flag, 'Y',
1406: decode(application_basis, 'STANDARD INVOICE', essi_tax_id_other, essi_tax_id_prepay),
1407: null) essi_tax_id
1408: */
1409: /* Bug 6363056. Commented the above
1410: * and added the following. Need to selected the lowest rate between

Line 2030: IF lv_application_basis = 'STANDARD INVOICE' THEN

2026: end if;
2027: /*Bug 8431516 - End*/
2028: jai_cmn_utils_pkg.write_fnd_log_msg('jai_ap_tds_prepayments_pkg',' ln_amt_tds_inv_generated_si :'||ln_amt_tds_inv_generated_si);
2029: IF ln_amt_tds_inv_generated_si > 0 THEN
2030: IF lv_application_basis = 'STANDARD INVOICE' THEN
2031: /* get the standard invoice number */
2032: OPEN c_si_ap_invoices_all(p_invoice_id);
2033: FETCH c_si_ap_invoices_all INTO lv_invoice_num_prepay_apply, ln_parent_invoice_id;
2034: CLOSE c_si_ap_invoices_all;

Line 2031: /* get the standard invoice number */

2027: /*Bug 8431516 - End*/
2028: jai_cmn_utils_pkg.write_fnd_log_msg('jai_ap_tds_prepayments_pkg',' ln_amt_tds_inv_generated_si :'||ln_amt_tds_inv_generated_si);
2029: IF ln_amt_tds_inv_generated_si > 0 THEN
2030: IF lv_application_basis = 'STANDARD INVOICE' THEN
2031: /* get the standard invoice number */
2032: OPEN c_si_ap_invoices_all(p_invoice_id);
2033: FETCH c_si_ap_invoices_all INTO lv_invoice_num_prepay_apply, ln_parent_invoice_id;
2034: CLOSE c_si_ap_invoices_all;
2035: ELSE

Line 2076: IF lv_application_basis = 'STANDARD INVOICE' THEN

2072: end if; /* if r_get_total_prepayment_tax.tds_amount > 0 then */ --moved this statement from above to here for Bug 6972230
2073:
2074: /*Bug 8431516 - Start*/
2075: IF ln_tot_tds_amt > 0 THEN
2076: IF lv_application_basis = 'STANDARD INVOICE' THEN
2077: /* get the standard invoice number */
2078: OPEN c_si_ap_invoices_all(p_invoice_id);
2079: FETCH c_si_ap_invoices_all INTO lv_invoice_num_prepay_apply, ln_parent_invoice_id;
2080: CLOSE c_si_ap_invoices_all;

Line 2077: /* get the standard invoice number */

2073:
2074: /*Bug 8431516 - Start*/
2075: IF ln_tot_tds_amt > 0 THEN
2076: IF lv_application_basis = 'STANDARD INVOICE' THEN
2077: /* get the standard invoice number */
2078: OPEN c_si_ap_invoices_all(p_invoice_id);
2079: FETCH c_si_ap_invoices_all INTO lv_invoice_num_prepay_apply, ln_parent_invoice_id;
2080: CLOSE c_si_ap_invoices_all;
2081: ELSE

Line 2214: if lv_application_basis = 'STANDARD INVOICE' then

2210: ln_pp_section_tax_id := null;
2211: ln_parent_invoice_id := null;
2212:
2213: /*Bug 6363056*/
2214: if lv_application_basis = 'STANDARD INVOICE' then
2215: /* get the standard invoice number */
2216: ln_parent_invoice_id := p_invoice_id;
2217: else
2218: /* Get the prepayment number */

Line 2215: /* get the standard invoice number */

2211: ln_parent_invoice_id := null;
2212:
2213: /*Bug 6363056*/
2214: if lv_application_basis = 'STANDARD INVOICE' then
2215: /* get the standard invoice number */
2216: ln_parent_invoice_id := p_invoice_id;
2217: else
2218: /* Get the prepayment number */
2219: open c_get_pp_section_tax_id(p_prepay_distribution_id, 'WCT_SECTION');

Line 2273: if lv_application_basis = 'STANDARD INVOICE' then

2269: /* get the tax_id */
2270: ln_pp_section_tax_id := null;
2271: ln_parent_invoice_id := null;
2272: /*Bug 6363056*/
2273: if lv_application_basis = 'STANDARD INVOICE' then
2274: /* get the standard invoice number */
2275: ln_parent_invoice_id := p_invoice_id;
2276: else
2277: /* Get the prepayment number */

Line 2274: /* get the standard invoice number */

2270: ln_pp_section_tax_id := null;
2271: ln_parent_invoice_id := null;
2272: /*Bug 6363056*/
2273: if lv_application_basis = 'STANDARD INVOICE' then
2274: /* get the standard invoice number */
2275: ln_parent_invoice_id := p_invoice_id;
2276: else
2277: /* Get the prepayment number */
2278: open c_get_pp_section_tax_id(p_prepay_distribution_id, 'WCT_SECTION');

Line 2327: Records are inserted into AP Interface tables using Standard Invoice, but import_and_approve

2323: end if; /* if r_get_total_prepayment_tax.essi_amount > 0 then */
2324:
2325: if ln_start_threshold_trx_id is not null then
2326: /*Bug - 9826422
2327: Records are inserted into AP Interface tables using Standard Invoice, but import_and_approve
2328: was called using the Prepayment Invoice ID. Hence wrong group_id was getting passed and no
2329: Invoices were getting improved*/
2330: jai_ap_tds_generation_pkg.import_and_approve
2331: (

Line 2403: -- the standard invoice does not have tds attached to it.

2399: fetch c_tds_count into ln_tds_count_attribute1;
2400: close c_tds_count;
2401:
2402: if ln_tds_count_attribute1 = 0 then
2403: -- the standard invoice does not have tds attached to it.
2404: -- check if there is TDS record in temp table, this would happen when the invoice is unapproved.
2405: -- Bug 4754213. Added by Lakshmi Gopalsami
2406: open c_tds_count_unapp(p_invoice_id, 'TDS_SECTION'); --rchandan for bug#4428980
2407: fetch c_tds_count_unapp into ln_tds_count_attribute1;

Line 2474: -- the standard invoice does not have tds attached to it.

2470: fetch c_tds_count into ln_tds_count_attribute2;
2471: close c_tds_count;
2472:
2473: if ln_tds_count_attribute2 = 0 then
2474: -- the standard invoice does not have tds attached to it.
2475: -- check if there is TDS record in temp table, this would happen when the invoice is unapproved.
2476: open c_tds_count_unapp(p_invoice_id, 'WCT_SECTION');
2477: fetch c_tds_count_unapp into ln_tds_count_attribute2;
2478: close c_tds_count_unapp;

Line 2544: -- the standard invoice does not have tds attached to it.

2540: fetch c_tds_count into ln_tds_count_attribute3;
2541: close c_tds_count;
2542:
2543: if ln_tds_count_attribute3 = 0 then
2544: -- the standard invoice does not have tds attached to it.
2545: -- check if there is TDS record in temp table, this would happen when the invoice is unapproved.
2546: open c_tds_count_unapp(p_invoice_id, 'ESSI_SECTION');
2547: fetch c_tds_count_unapp into ln_tds_count_attribute3;
2548: close c_tds_count_unapp;