[Home] [Help]
910:
911: --Added by Sanjikum for Bug#5131075(4722011)
912: CURSOR c_check_prepayment_apply IS
913: SELECT '1'
914: FROM jai_ap_tds_prepayments
915: WHERE invoice_distribution_id_prepay = pr_new.invoice_distribution_id;
916:
917: CURSOR c_check_prepayment_unapply IS
918: SELECT '1'
915: WHERE invoice_distribution_id_prepay = pr_new.invoice_distribution_id;
916:
917: CURSOR c_check_prepayment_unapply IS
918: SELECT '1'
919: FROM jai_ap_tds_prepayments
920: WHERE invoice_distribution_id_prepay = pr_new.parent_reversal_id
921: AND unapply_flag = 'Y';
922:
923: lv_prepay_flag VARCHAR2(1);
1062: if lv_new_transaction_si = 'Y' and lv_new_transaction_pp = 'Y' then
1063:
1064: lv_codepath := null;
1065:
1066: jai_ap_tds_prepayments_pkg.process_prepayment
1067: (
1068: p_event => cp_event, --Added parameter cp_event for Bug 8431516
1069: p_invoice_id => pr_new.invoice_id,
1070: p_invoice_distribution_id => pr_new.invoice_distribution_id,
1096: */
1097: IF lv_process_old_trxn = 'Y' THEN
1098:
1099: --Invoke the old regime functionality
1100: jai_ap_tds_prepayments_pkg.process_old_transaction
1101: (
1102: p_invoice_id => pr_new.invoice_id,
1103: p_invoice_distribution_id => pr_new.invoice_distribution_id,
1104: p_prepay_distribution_id => pr_new.prepay_distribution_id,
2231: end if; /*inserting or updating */
2232:
2233: /* TDS Tax Defaultation Functionality Bug # 4088186 */
2234: /*Bug 12630283 - Start*/
2235: /*Data is inserted into JAI_AP_TDS_PREPAYMENTS before Validation. This results in incorrect TDS getting calculated
2236: On validation of Invoice the match status flag of PREPAY line is set to 'A' first resulting in JAI_AP_TDS_PREPAYMENTS
2237: getting inserted before the Item Line's match status flag is set to A. Only if all the distraibutions match status flag
2238: is set to A or T process_tds_at_inv_validate shall be called. If process_tds_at_inv_validate is called after insertion
2239: of data in JAI_AP_TDS_PREPAYMENTS it results in incorrect TDS deduction. Hence moved the code to insert JAI_AP_TDS_PREPAYMENTS
2232:
2233: /* TDS Tax Defaultation Functionality Bug # 4088186 */
2234: /*Bug 12630283 - Start*/
2235: /*Data is inserted into JAI_AP_TDS_PREPAYMENTS before Validation. This results in incorrect TDS getting calculated
2236: On validation of Invoice the match status flag of PREPAY line is set to 'A' first resulting in JAI_AP_TDS_PREPAYMENTS
2237: getting inserted before the Item Line's match status flag is set to A. Only if all the distraibutions match status flag
2238: is set to A or T process_tds_at_inv_validate shall be called. If process_tds_at_inv_validate is called after insertion
2239: of data in JAI_AP_TDS_PREPAYMENTS it results in incorrect TDS deduction. Hence moved the code to insert JAI_AP_TDS_PREPAYMENTS
2240: after validation of Invoice.*/
2235: /*Data is inserted into JAI_AP_TDS_PREPAYMENTS before Validation. This results in incorrect TDS getting calculated
2236: On validation of Invoice the match status flag of PREPAY line is set to 'A' first resulting in JAI_AP_TDS_PREPAYMENTS
2237: getting inserted before the Item Line's match status flag is set to A. Only if all the distraibutions match status flag
2238: is set to A or T process_tds_at_inv_validate shall be called. If process_tds_at_inv_validate is called after insertion
2239: of data in JAI_AP_TDS_PREPAYMENTS it results in incorrect TDS deduction. Hence moved the code to insert JAI_AP_TDS_PREPAYMENTS
2240: after validation of Invoice.*/
2241: --To handle the condition, if there are PP applications/Unapplications, before the SI is validated
2242: if pv_action = jai_constants.updating then
2243: IF pr_new.line_type_lookup_code = 'PREPAY' and
2476: if lv_new_transaction_si = 'Y' and lv_new_transaction_pp = 'Y' then
2477:
2478: lv_codepath := null;
2479:
2480: jai_ap_tds_prepayments_pkg.process_prepayment
2481: (
2482: p_invoice_id => pr_new.invoice_id,
2483: p_invoice_distribution_id => pr_new.invoice_distribution_id,
2484: p_prepay_distribution_id => pr_new.prepay_distribution_id,
2507: else
2508: --
2509: --|| Invoke the old regime functionality
2510: --
2511: jai_ap_tds_prepayments_pkg.process_old_transaction
2512: (
2513: p_invoice_id => pr_new.invoice_id,
2514: p_invoice_distribution_id => pr_new.invoice_distribution_id,
2515: p_prepay_distribution_id => pr_new.prepay_distribution_id,