264: print_debuginfo(l_module_name, 'p_exchange_date: '||p_exchange_date,
265: G_LEVEL_PROCEDURE);
266:
267: /* standard call to check for api compatibility */
268: IF NOT FND_API.Compatible_API_Call(
269: l_api_version,
270: p_api_version,
271: l_api_name,
272: G_PKG_NAME) THEN
270: p_api_version,
271: l_api_name,
272: G_PKG_NAME) THEN
273:
274: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
275:
276: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
277:
278: END IF;
272: G_PKG_NAME) THEN
273:
274: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
275:
276: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
277:
278: END IF;
279:
280: /* initialize message list if p_init_msg_list is set to TRUE. */
277:
278: END IF;
279:
280: /* initialize message list if p_init_msg_list is set to TRUE. */
281: IF FND_API.to_Boolean(p_init_msg_list) THEN
282: FND_MSG_PUB.initialize;
283: END IF;
284:
285: /* initialize API return status to success */
282: FND_MSG_PUB.initialize;
283: END IF;
284:
285: /* initialize API return status to success */
286: x_return_status := FND_API.G_RET_STS_SUCCESS;
287: l_temp_status := 'S';
288:
289: l_debug_info := 'Get invoice_info';
290: print_debuginfo(l_module_name, l_debug_info,
380: -- in a TRUE value for the P_called_Online parameter (the last param)
381: -- because we don't want the ap debug pkg to get it off the stack at
382: -- the same time.
383:
384: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
385:
386: FND_MESSAGE.SET_NAME('SQLAP', 'AP_PERIOD_NOT_OPEN');
387: FND_MSG_PUB.ADD;
388:
426:
427: EXCEPTION
428: WHEN NO_DATA_FOUND THEN
429:
430: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
431:
432: FND_MESSAGE.SET_NAME('SQLAP', 'AP_CE_INVALID_BANK_ACCT');
433: FND_MSG_PUB.ADD;
434:
459: -- State that we need to to have an exchange rate if the
460: -- type is USER this is irrespective of the value of the
461: -- make_rate_mandatory_flag on AP_SYSTEM_PARAMETERS
462:
463: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
464:
465: FND_MESSAGE.SET_NAME('SQLAP', 'AP_NO_USER_XRATE');
466: FND_MSG_PUB.ADD;
467:
497:
498: IF (l_check_rec.xrate is NULL
499: AND l_asp_rec.make_rate_mandatory_flag = 'Y') THEN
500:
501: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
502:
503: FND_MESSAGE.SET_NAME('SQLAP', 'AP_NO_XRATE');
504: FND_MSG_PUB.ADD;
505:
521: EXCEPTION
522:
523: WHEN NO_DATA_FOUND THEN
524:
525: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
526:
527: FND_MESSAGE.SET_NAME('SQLAP', 'AP_INVOICE_CANNOT_BE_PAID');
528: FND_MSG_PUB.ADD;
529:
541: -- This means that the payment schedules for the one invoice may
542: -- have different payment methods. If that is the case, we cannot
543: -- handle in one payment.
544:
545: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
546:
547: FND_MESSAGE.SET_NAME('SQLAP', 'AP_MISMATCHED_PMT_SCHEDS');
548: FND_MSG_PUB.ADD;
549:
569: WHERE invoice_id = P_invoice_id;
570:
571: IF (l_num_invs_sel_for_pmt > 0) THEN
572:
573: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
574:
575: FND_MESSAGE.SET_NAME('SQLAP', 'AP_INV_PAY_FAIL_SEL_BY_BATCH');
576: FND_MSG_PUB.ADD;
577:
784: -- The Vendor Site that was on the invoice does not exist or
785: -- we cannot pay invoices for this vendor or the vendor has no
786: -- active pay sites
787:
788: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
789:
790: FND_MESSAGE.SET_NAME('SQLAP', 'AP_NO_VENDOR_SITE');
791: FND_MSG_PUB.ADD;
792:
826:
827: EXCEPTION
828: WHEN NO_DATA_FOUND THEN
829:
830: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
831:
832: FND_MESSAGE.SET_NAME('SQLAP', 'AP_IBY_INVALID_PAYMENT_PROF');
833: FND_MSG_PUB.ADD;
834:
846: -- Verify payment document is needed or not
847: IF l_processing_type = 'PRINTED' THEN
848: IF p_payment_document_id IS NULL THEN
849:
850: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
851:
852: FND_MESSAGE.SET_NAME('SQLAP', 'AP_CE_PAYMENT_DOC_NEEDED');
853: FND_MSG_PUB.ADD;
854:
891: x_msg_count => x_msg_count,
892: x_msg_data => x_msg_data,
893: show_warn_msgs_flag => 'T');
894:
895: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
896:
897: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
898: print_debuginfo(l_module_name, 'EXIT',
899: G_LEVEL_PROCEDURE);
893: show_warn_msgs_flag => 'T');
894:
895: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
896:
897: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
898: print_debuginfo(l_module_name, 'EXIT',
899: G_LEVEL_PROCEDURE);
900: l_temp_status := 'E';
901:
903:
904: EXCEPTION
905:
906: WHEN NO_DATA_FOUND THEN
907: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
908:
909: FND_MESSAGE.SET_NAME('SQLAP', 'AP_PAY_DOCUMENT_ALREADY_IN_USE');
910: FND_MSG_PUB.ADD;
911:
947: EXCEPTION
948:
949: WHEN NO_DATA_FOUND THEN
950:
951: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
952:
953: FND_MESSAGE.SET_NAME('SQLAP', 'AP_PAY_NO_VENDOR');
954: FND_MSG_PUB.ADD;
955:
1033:
1034: EXCEPTION
1035: WHEN NO_DATA_FOUND THEN
1036:
1037: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1038:
1039: FND_MESSAGE.SET_NAME('SQLAP', 'AP_IBY_INVALID_PAYMENT_METHOD');
1040: FND_MSG_PUB.ADD;
1041:
1077: AND table_name IN ('AP_CHECKS','AP_CHECKS_ALL');
1078: exception
1079: when no_data_found then
1080:
1081: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1082: FND_MESSAGE.SET_NAME('SQLAP', 'AP_SEQ_NO_DOC_CAT');
1083: FND_MSG_PUB.ADD;
1084: FND_MSG_PUB.COUNT_AND_GET(p_count => x_msg_count,
1085: p_data => x_msg_data);
1105:
1106:
1107: if l_doc_category_code = '-1' and l_seq_num_profile = 'A' then
1108:
1109: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1110: FND_MESSAGE.SET_NAME('SQLAP', 'AP_SEQ_DOC_CAT_NO_FOUND');
1111: FND_MSG_PUB.ADD;
1112: FND_MSG_PUB.COUNT_AND_GET(p_count => x_msg_count,
1113: p_data => x_msg_data);
1121: if l_doc_category_code <> '-1' and
1122: l_asp_rec.pay_doc_override <> 'Y' and
1123: l_doc_category_code <> p_doc_category_code then
1124:
1125: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1126: FND_MESSAGE.SET_NAME('SQLAP', 'AP_SEQ_DOC_NO_REQ');
1127: FND_MSG_PUB.ADD;
1128: FND_MSG_PUB.COUNT_AND_GET(p_count => x_msg_count,
1129: p_data => x_msg_data);
1156:
1157: --reject if invalid and seq numbering is always used
1158: if (l_return_code <> 0 or l_docseq_type = 'M') and l_seq_num_profile = 'A' then
1159:
1160: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1161: FND_MESSAGE.SET_NAME('SQLAP', 'AP_SEQ_CREATE_ERROR');
1162: FND_MSG_PUB.ADD;
1163: FND_MSG_PUB.COUNT_AND_GET(p_count => x_msg_count,
1164: p_data => x_msg_data);
1181: 'N');
1182:
1183: if l_return_code <> 0 and l_seq_num_profile = 'A' then
1184:
1185: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1186: FND_MESSAGE.SET_NAME('SQLAP', 'AP_SEQ_CREATE_ERROR');
1187: FND_MSG_PUB.ADD;
1188: FND_MSG_PUB.COUNT_AND_GET(p_count => x_msg_count,
1189: p_data => x_msg_data);
1600: x_msg_count => x_msg_count,
1601: x_msg_data => x_msg_data
1602: );
1603:
1604: IF (l_return_status = FND_API.G_RET_STS_SUCCESS) THEN
1605:
1606: UPDATE AP_CHECKS_ALL
1607: SET payment_id = l_payment_id
1608: WHERE check_id = l_check_rec.check_id;
1634:
1635:
1636: ELSE
1637:
1638: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1639:
1640: END IF; -- l_temp_status
1641:
1642: EXCEPTION
1652: G_LEVEL_PROCEDURE);
1653: print_debuginfo(l_module_name, 'SQLERRM: ' || SQLERRM,
1654: G_LEVEL_PROCEDURE);
1655:
1656: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1657: print_debuginfo(l_module_name, 'EXIT',
1658: G_LEVEL_PROCEDURE);
1659:
1660: RETURN;