642:
643: l_current_calling_sequence := p_calling_sequence || '<- remove_all_invoices';
644: l_debug_info := 'delete unselected invoices';
645:
646: delete from ap_unselected_invoices_all
647: where checkrun_id = p_checkrun_id;
648:
649:
650: l_debug_info := 'deleted selected invoices';
725:
726: if l_remove_invoices.count > 0 then
727: for i in l_remove_invoices.first .. l_remove_invoices.last loop
728:
729: insert into ap_unselected_invoices_all(
730: checkrun_id,
731: invoice_id,
732: payment_num,
733: dont_pay_reason_code,
1109:
1110: --Needs Invoice Validation
1111: if l_invoice_status in ('NEVER APPROVED', 'UNAPPROVED') then
1112:
1113: insert into ap_unselected_invoices_all(
1114: checkrun_id,
1115: invoice_id,
1116: payment_num,
1117: dont_pay_reason_code,
1136:
1137: --Failed Invoice Validation
1138: if l_invoice_status = 'NEEDS REAPPROVAL' then
1139:
1140: insert into ap_unselected_invoices(
1141: checkrun_id,
1142: invoice_id,
1143: payment_num,
1144: dont_pay_reason_code,
1164: --Needs Approval
1165: if l_approval_status in ('INITIATED','REQUIRED','NEEDS WFREAPPROVAL') then
1166:
1167:
1168: insert into ap_unselected_invoices(
1169: checkrun_id,
1170: invoice_id,
1171: payment_num,
1172: dont_pay_reason_code,
1193:
1194: --Approver Rejected
1195: if l_approval_status = 'REJECTED' then
1196:
1197: insert into ap_unselected_invoices(
1198: checkrun_id,
1199: invoice_id,
1200: payment_num,
1201: dont_pay_reason_code,
1218:
1219: --Scheduled Payment Hold
1220: if l_ps_hold_flag = 'Y' then
1221:
1222: insert into ap_unselected_invoices(
1223: checkrun_id,
1224: invoice_id,
1225: payment_num,
1226: dont_pay_reason_code,
1245:
1246: --Supplier Site Hold
1247: if l_hold_all_payments_flag = 'Y' then
1248:
1249: insert into ap_unselected_invoices(
1250: checkrun_id,
1251: invoice_id,
1252: payment_num,
1253: dont_pay_reason_code,
1270:
1271:
1272: --Discount Rate Too Low
1273: --4745133, can't call the ebd check in the cursor so doing it here.
1274: insert into ap_unselected_invoices(
1275: checkrun_id,
1276: invoice_id,
1277: payment_num,
1278: dont_pay_reason_code,
4950: )
4951: THEN
4952: IF l_schema IS NOT NULL THEN
4953: FND_STATS.GATHER_TABLE_STATS(l_schema, 'AP_SELECTED_INVOICES_ALL');
4954: FND_STATS.GATHER_TABLE_STATS(l_schema, 'AP_UNSELECTED_INVOICES_ALL'); /* Added for bug#10053374 */
4955: END IF;
4956: END IF;
4957:
4958: /* BUG 14498596 END - Moved Withholding Tax logic before grouping of invoices */
6203:
6204:
6205: l_debug_info := 'delete unselected invoices';
6206:
6207: delete from ap_unselected_invoices_all
6208: where checkrun_id = p_checkrun_id;
6209:
6210: l_debug_info := 'undo awt';
6211: