Skip Credit Check
If you implement credit check in Order Management but your order line fails credit check when you revise a sales order, you might notice that the status on the order line gets stuck at Credit Review Pending and the line doesn't move along in fulfillment with the other lines in the sales order. You can fix this problem.
You can do one of:
- Pay or revise.
- Send payment to the invoice for the Bill To Customer that's on the sales order.
- Revise the credit limit.
- Change the revision to Draft status, then resubmit it.
- Skip credit check altogether on the sales order. There are two different ways to
do this.
- Use order import to set the Credit Authorized in Source attribute to Y for the revised sales order. For details, see Import Source Orders That Include Credit Check.
-
Use an order management extension to set the PreCreditCheckedFlag attribute to Y for the revised sales order. The extension makes sure Order Management skips calls to credit check for the revision according to a condition that you specify in the extension.
Note that if authorization has expired, and if the order line isn't closed, then Order Management will run the credit check even if you set PreCreditCheckedFlag to Y.
This topic describes different ways to use an order management extension to skip credit check for a single sales order. For details about how to create an order management extension, see Overview of Creating Order Management Extensions.
Skip Credit Check on the Order's Revision
- Create an extension on the On Save event and name it Skip Credit Check for Order Revisions.
- Add this code to your
extension.
import oracle.apps.scm.doo.common.extensions.ValidationException; if (header.isRevisionDraftOrder()) { def row = context.getDbAdapter().getLookupRow("AR_FEATURES", "AR_CREDIT_MGMT"); boolean isFeatureEnabled = row != null && "Y".equals(row.getAttribute("EnabledFlag")); header.setAttribute("PreCreditCheckedFlag", isFeatureEnabled ? "N" : "Y"); }
Here's what it does.
if(refHeaderId != null)
determines whether the sales order is an original order or a revision.-
Determine whether credit check is enabled in Credit Management. If it isn't, then
header.setAttribute("PreCreditCheckedFlag", "Y"
enables it.
This example skips credit check for all revisions, including the first revision and any subsequent revision. If you need to skip credit check for only the latest revision, then you might need to modify this example or create a new extension.
If the revision modifies the order total, then don't use the Skip Credit Check on the Order's Revision extension because the total will contain some credit authorization that's still open and a subsequent credit check might fail. Assume your order has a $1500 total, credit check creates the authorization, then you revise the order's quantity so the new total is $1000. The extension sets PreCreditCheckedFlag to Y so it doesn't consider the total and doesn't check credit for the new $1000 amount. You bill the order line for $1000 which results in a $500 authorization that remains open. Your customer places another order for $250 but it fails credit check because it thinks there's still a $500 open balance. To avoid this problem, use the Skip Credit Check According to the Revision's Total extension.
Skip Credit Check According to the Revision's Total
- Create an extension on the On Save event and name it Skip Credit Check when Order Total Doesn't Change.
- Add this code to your
extension.
import oracle.apps.scm.doo.common.extensions.ValidationException; if (header.isFirstDraftOrder()) return; def currentTotal = header.getOrderTotalsPrimaryRow(); def currentTotalAmount = currentTotal.getAttribute("TotalAmount"); def processingOrder = header.getOrderInProcessing(); def processingTotal = processingOrder.getOrderTotalsPrimaryRow(); def processingTotalAmount = processingTotal.getAttribute("TotalAmount"); if(currentTotalAmount.compareTo(processingTotalAmount) == 0) { //If the total is the same, then skip credit check. header.setAttribute("PreCreditCheckedFlag","Y"); } else { header.setAttribute("PreCreditCheckedFlag","N"); }
Here's what it does.
- Determines whether the sales order is an original order or a revision.
- Determines whether the total in the revision matches the total in the original sales order. If yes, then Order Management runs a credit check on the revision. If no, then Order Management skips the check.
- This extension doesn't determine whether credit management is enabled.
Skip Credit Check on the Original Order
- Create an extension on the On Save event and name it Skip Credit Check for Sales Orders.
- Add this code to your
extension.
import oracle.apps.scm.doo.common.extensions.ValidationException; if (header.isRevisionDraftOrder()) { boolean ccHoldExists = header.activeHoldExistsOnProcessingLines("DOO_CREDIT_CHECK"); if (!ccHoldExists) { def row = context.getDbAdapter().getLookupRow("AR_FEATURES", "AR_CREDIT_MGMT"); boolean isCreditMgmtFeatureEnabled = row != null && "Y".equals(row.getAttribute("EnabledFlag")); header.setAttribute("PreCreditCheckedFlag", isCreditMgmtFeatureEnabled ? "N" : "Y"); } else { header.setAttribute("PreCreditCheckedFlag", "N"); } }
Here's what it does.
- Determines whether there any lines in the original sales order that are on credit check hold. If not, exit the extension.
- Determines whether credit check is enabled in Credit Management. If it isn't,
then
header.setAttribute("PreCreditCheckedFlag", "Y"
enables it.
Skip Credit Check When You Use an Extensible Flexfield
- Set up your flexfield.
- Edit the predefined Header Information extensible flexfield.
- On the Edit Extensible Flexfield page, Select Additional Header Information in the Category area.
- In the Associated Contexts area, create a new context.
Attribute Value Display Name Skip Credit Check for Sales Orders That Have Flexfields Associated Category Additional Header Information Behavior Single Row - Create a segment in the context that you just added.
For details about how to edit this flexfield, see Use Extensible Flexfields to Add Your Attributes in Order Management.Attribute Value Sequence 10 Name Skip Credit Check Table Column ATTRIBUTE_CHAR1 Code Skip Credit Check
- Create an extension on the On Save event and name it Skip Credit Check for Sales Orders with Flexfields.
- Add this code to your
extension.
import oracle.apps.scm.doo.common.extensions.ValidationException; if (header.isRevisionDraftOrder()) { def pccFlag = null; def row = context.getDbAdapter().getLookupRow("AR_FEATURES", "AR_CREDIT_MGMT"); boolean isCreditMgmtFeatureEnabled = row != null && "Y".equals(row.getAttribute("EnabledFlag")); if (!isCreditMgmtFeatureEnabled) { def headerEFF = header.getContextRow("Override Credit Failure for Revision"); if(headerEFF != null) { def segmentCode = headerEFF.getAttribute("skipCreditCheck"); pccFlag = "Y".equals(segmentCode) ? "Y" : "N"; } } header.setAttribute("PreCreditCheckedFlag", pccFlag == null ? "N" : pccFlag); }
Here's what it does.
- Determines whether the sales order is an original order or a revision.
- Determines whether credit check is enabled in Credit Management. If it isn't,
then it reads the Override Credit Failure for Revision flexfield context on the
order header, and it reads the value in the Skip Credit Check segment. If the
segment contains:
- Y, the code sets PreCreditCheckedFlag to Y to skip credit check.
- Not Y, the code sets PreCreditCheckedFlag to N, and Order Management will do the credit check.
Skip Credit Check According to the Revision's Payment Term
- Create an extension on the On Save event and name it Skip Credit Check According to Payment Term.
- Add this code to your
extension.
import oracle.apps.scm.doo.common.extensions.ValidationException; if (header.isFirstDraftOrder()) return; def currentTotal = header.getOrderTotalsRowByCode("QP_TOTAL_PAY_NOW"); def currentTotalAmount = currentTotal.getAttribute("TotalAmount"); def processingOrder = header.getOrderInProcessing(); def processingTotal = processingOrder.getOrderTotalsRowByCode("QP_TOTAL_PAY_NOW"); def processingTotalAmount = processingTotal.getAttribute("TotalAmount"); if(currentTotalAmount.compareTo(processingTotalAmount) == 0) { def hasPaymentTermChange = false; def lines = header.getAttribute("Lines"); while ( lines.hasNext() ) { def line = lines.next(); if (line.isNewLineInDraftOrder() || line.isClosed() || line.isCanceled()) continue; def currPaymentTermId = line.getAttribute("PaymentTermCode"); def refLine = line.getLineInProcessing(); def refPaymentTermId = refLine.getAttribute("PaymentTermCode"); if (isSame(currPaymentTermId, refPaymentTermId)) continue; hasPaymentTermChange = true; break; } if (hasPaymentTermChange) { header.setAttribute("PreCreditCheckedFlag","N"); } else { header.setAttribute("PreCreditCheckedFlag","Y"); } } boolean isSame(def o1, def o2) { if (o1 == null && o2 == null) return true; if (o1 != null && o2 != null && o1.equals(o2)) return true; return false; }
Here's what it does.
- Determines whether the sales order is an original order or a revision.
- Determines whether the total in the revision matches the total in the original
sales order, and whether the payment term on the order header of the revision
matches the payment term on the original order.
- If the total or the payment term doesn’t match, then Order Management does the credit check.
- If the total and the payment term do match, then Order Management skips the credit check.
- This extension doesn't determine whether credit management is enabled.
CustomerPONumber contains RD_TEST for testing purposes. You must remove this value or use your own value.
Disable Credit Check for All Sales Orders
You can disable credit check for all your sales orders.
- Go to the Setup and Maintenance work area, then go to the task:
- Offering: Financials
- Functional Area: Receivables
- Task: Manage Receivables Lookups
- On the Manage Receivables Lookups page, search for the value.
Attribute Value Lookup Type AR_FEATURES - In the search results, in the Financials Generic Lookup Type area, in the row that has AR_CREDIT_MGMT in the Lookup Code column, remove the check mark from the Enabled attribute.