110:
111: CURSOR C_Current_Line (InvId IN NUMBER)
112: IS
113: SELECT MAX(line_number) curr_inv_line_number
114: FROM ap_invoice_lines_all
115: WHERE (invoice_id = InvId);
116:
117: curr_inv_line_number ap_invoice_lines_all.line_number%TYPE;
118:
113: SELECT MAX(line_number) curr_inv_line_number
114: FROM ap_invoice_lines_all
115: WHERE (invoice_id = InvId);
116:
117: curr_inv_line_number ap_invoice_lines_all.line_number%TYPE;
118:
119: DBG_Loc VARCHAR2(30) := 'Create_AWT_distributions';
120:
121: current_calling_sequence VARCHAR2(2000);
213:
214: -- Now we have obtained all the required information AND we can
215: -- create lines AND distributions.
216:
217: debug_info := 'Insert INTO ap_invoice_lines_all';
218:
219: INSERT INTO AP_INVOICE_LINES_all (
220: invoice_id,
221: line_number,
215: -- create lines AND distributions.
216:
217: debug_info := 'Insert INTO ap_invoice_lines_all';
218:
219: INSERT INTO AP_INVOICE_LINES_all (
220: invoice_id,
221: line_number,
222: line_type_lookup_code,
223: description,
1152:
1153:
1154: -- Insert Invoice Lines for each distribution Fetched
1155:
1156: debug_info := 'Insert INTO ap_invoice_lines_all';
1157:
1158: INSERT INTO AP_INVOICE_LINES_all (
1159: invoice_id,
1160: line_number,
1154: -- Insert Invoice Lines for each distribution Fetched
1155:
1156: debug_info := 'Insert INTO ap_invoice_lines_all';
1157:
1158: INSERT INTO AP_INVOICE_LINES_all (
1159: invoice_id,
1160: line_number,
1161: line_type_lookup_code,
1162: description,
3148: rec_awt_dists c_awt_dists_pay%ROWTYPE;
3149:
3150: l_invoice_exchange_rate ap_invoices.exchange_rate%type;
3151: l_func_currency_code ap_system_parameters.base_currency_code%TYPE;
3152: l_old_inv_line_num ap_invoice_lines_all.line_number%TYPE;
3153:
3154: -- Ap_Undo_Withholding:
3155: -- PL/SQL Main Block PROCEDUREs AND functions:
3156:
3332:
3333: debug_info := 'Discard the Line';
3334: /* Bug 5202248. Added the Nvl */
3335: IF nvl(l_old_inv_line_num, 0) <> rec_awt_dists.invoice_line_number THEN
3336: UPDATE ap_invoice_lines_all
3337: SET discarded_flag = DECODE(p_calling_module,'CANCEL INVOICE','N','Y'),
3338: /* Bug 5299720. Comment out the following line */
3339: -- Cancelled_flag = DECODE(p_calling_module,'CANCEL INVOICE','Y','N'),
3340: Original_amount = amount,