193: | Called By : PRC: Tieback Adjustment Invoices from Payables |
194: | Process : |
195: | 1. Fetch a new set of CDL's to tie back - Transfer Status Code of 'I' |
196: | 2. Retrieve status from ap_invoices_interface, depending on the reference_2 and |
197: | reference_2 columns in ap_invoice_lines_interface. |
198: | 3. If status is PROCESSED then update transfer status code to 'A', |
199: | Else if REJECTED then update to 'R' |
200: | 4. Write to OUTPUT file how many were rejected/succesfully processed |
201: | 5. Deleting rejected from ap_invoices_interface |
198: | 3. If status is PROCESSED then update transfer status code to 'A', |
199: | Else if REJECTED then update to 'R' |
200: | 4. Write to OUTPUT file how many were rejected/succesfully processed |
201: | 5. Deleting rejected from ap_invoices_interface |
202: | 6. Deleting rejected from ap_invoice_lines_interface |
203: | 7. Commit |
204: +----------------------------------------------------------------------------------------*/
205:
206: Procedure TiebackAdjCosts(X_Return_Status OUT Varchar2,
214: Cdl.Line_Num,
215: Inv.Status
216: From Pa_Cost_Distribution_Lines Cdl,
217: Ap_Invoices_Interface Inv,
218: Ap_Invoice_Lines_Interface Lines
219: Where Cdl.Transfer_Status_Code = 'I'
220: And Inv.Source = 'PA_COST_ADJUSTMENTS'
221: And Inv.Invoice_Id = Lines.Invoice_Id
222: And Lines.Reference_2 = To_Char(Cdl.Expenditure_Item_Id) || '-' || To_Char(Cdl.Line_Num);
220: And Inv.Source = 'PA_COST_ADJUSTMENTS'
221: And Inv.Invoice_Id = Lines.Invoice_Id
222: And Lines.Reference_2 = To_Char(Cdl.Expenditure_Item_Id) || '-' || To_Char(Cdl.Line_Num);
223:
224: /* Need new index on Ap_Invoice_Lines_Interface (reference_2) */
225:
226: l_RowIdTab PA_PLSQL_DATATYPES.RowidTabTyp;
227: l_EiTab PA_PLSQL_DATATYPES.IdTabTyp;
228: l_LineNumTab PA_PLSQL_DATATYPES.IdTabTyp;
326: End loop;
327:
328: Close C_TiebackRecs;
329:
330: Delete From Ap_Invoice_Lines_Interface
331: Where Invoice_Id in (
332: Select
333: Invoice_Id
334: From