Skip Credit Check

If you implement credit check in Order Management but your fulfillment line fails credit check when you revise a sales order, you might notice that the status on the fulfillment 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:

  1. Pay or revise.
    • Send payment to the invoice for the Bill To Customer that's on the sales order.
    • Revise the credit limit.
  2. Change the revision to Draft status, then resubmit it.
  3. 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 Sales Order Revision

  1. Create an extension on the On Save event and name it Skip Credit Check for Order Revisions.
  2. Add this code to your extension.
    import oracle.apps.scm.doo.common.extensions.ValidationException;  
    
    Boolean isCCMgmtEnabled = false;
    BigDecimal refHeaderId = header.getAttribute("ReferenceHeaderId");
    if(refHeaderId != null)
    {
        def lookupVO =context.getViewObject("oracle.apps.financials.assets.shared.publicView.LookupPVO");
        def vc = lookupVO.createViewCriteria();
        def vcrow = vc.createViewCriteriaRow();
        vcrow.setAttribute("LookupType", 'AR_FEATURES');//ACCOUNT_TYPE AR_FEATURES
        vcrow.setAttribute("EnabledFlag", 'Y');
        vcrow.setAttribute("LookupCode", 'AR_CREDIT_MGMT');
        def rowset = lookupVO.findByViewCriteria(vc, -1);
        rowset.reset();
        if(rowset.hasNext()){
          isCCMgmtEnabled = true;
        }
        if(!isCCMgmtEnabled)
           header.setAttribute("PreCreditCheckedFlag", "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.

Skip Credit Check on an Original Order

  1. Create an extension on the On Save event and name it Skip Credit Check for Sales Orders.
  2. Add this code to your extension.
    import oracle.apps.scm.doo.common.extensions.ValidationException;  
    
    Boolean isCCMgmtEnabled = false;
    BigDecimal refHeaderId = header.getAttribute("ReferenceHeaderId");
    Boolean ccHoldFoundOnOriginalLines = false;
    if(refHeaderId != null)
    {
    	def holdInstanceVO  =context.getViewObject("oracle.apps.scm.doo.publicView.analytics.HoldInstancePVO");
    	def hodlInstanceVc = holdInstanceVO.createViewCriteria();
    	def holdInstanceVrow = hodlInstanceVc.createViewCriteriaRow();
    	holdInstanceVrow.setAttribute("HeaderHeaderId", refHeaderId);
    	holdInstanceVrow.setAttribute("FulfillLineOnHold", 'Y');
    	def holdInstanceRowset = holdInstanceVO.findByViewCriteria(hodlInstanceVc, -1);
    	holdInstanceRowset.reset();
    	while(holdInstanceRowset.hasNext())
    	{
                      def holdInstance = holdInstanceRowset.next();
                      def holdDefs = holdInstance.getAttribute("HoldDefinition");
                     String holdCode = holdDefs.getAttribute("HoldHoldCode");
    	  if("DOO_CREDIT_CHECK".equalsIgnoreCase(holdCode))
    	  {
           		ccHoldFoundOnOriginalLines = true;
                                break;
    	  }
        }
       if(!ccHoldFoundOnOriginalLines)
      {
    	def lookupVO =context.getViewObject("oracle.apps.financials.assets.shared.publicView.LookupPVO");
    	def vc = lookupVO.createViewCriteria();
    	def vcrow = vc.createViewCriteriaRow();
    
    	vcrow.setAttribute("LookupType", 'AR_FEATURES');//ACCOUNT_TYPE AR_FEATURES
    	vcrow.setAttribute("EnabledFlag", 'Y');
    	vcrow.setAttribute("LookupCode", 'AR_CREDIT_MGMT');
    	def rowset = lookupVO.findByViewCriteria(vc, -1);
    	rowset.reset();
    	if(rowset.hasNext())
    	{
    		isCCMgmtEnabled = true;
    	}
    	if(!isCCMgmtEnabled)
                        header.setAttribute("PreCreditCheckedFlag", "Y");
      }
    }
    

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

  1. 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.
      Attribute Value
      Sequence 10
      Name Skip Credit Check
      Table Column ATTRIBUTE_CHAR1
      Code Skip Credit Check
      For details about how to edit this flexfield, see Overview of Using Extensible Flexfields in Order Management.
  2. Create an extension on the On Save event and name it Skip Credit Check for Sales Orders with Flexfields.
  3. Add this code to your extension.
    Boolean isCCMgmtEnabled = false;
    BigDecimal refHeaderId = header.getAttribute("ReferenceHeaderId");
    if(refHeaderId != null)
    {
        def lookupVO =context.getViewObject("oracle.apps.financials.assets.shared.publicView.LookupPVO");
        def vc = lookupVO.createViewCriteria();
        def vcrow = vc.createViewCriteriaRow();
        vcrow.setAttribute("LookupType", 'AR_FEATURES');//ACCOUNT_TYPE AR_FEATURES
        vcrow.setAttribute("EnabledFlag", 'Y');
        vcrow.setAttribute("LookupCode", 'AR_CREDIT_MGMT');
        def rowset = lookupVO.findByViewCriteria(vc, -1);
        rowset.reset();
        if(rowset.hasNext()){
          isCCMgmtEnabled = true;
        }
        if(!isCCMgmtEnabled)
      {
          
         def headerEFF = header.getContextRow("Override Credit Failure for Revision"); 
        if(headerEFF != null)
       {
          def segmentCode = headerEFF.getAttribute("skipCreditCheck");
          if(segmentCode != null)
          {
            if(segmentCode.equals("Y"))
               header.setAttribute("PreCreditCheckedFlag", "Y");
            else if(segmentCode.equals("N"))
               header.setAttribute("PreCreditCheckedFlag", "N");
          }
        }
      }
    

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 Total on the Order Revision

  1. Create an extension on the On Save event and name it Skip Credit Check when Order Total Doesn't Change.
  2. Add this code to your extension.
    import oracle.apps.scm.doo.common.extensions.ValidationException;
    import oracle.apps.scm.doo.common.extensions.Message;
    
    String headerId = header.getAttribute("HeaderId");
    String refHeaderId = header.getAttribute("ReferenceHeaderId");
    
    //skip if its new order
    if( refHeaderId == null ) return;
    
    String currTotal,refTotal;
    
    currTotal= getTotalValue(headerId);
    refTotal= getTotalValue(refHeaderId);
    
    if(currTotal.equals(refTotal)) {
    //If the total is the same, then skip credit check.
    header.setAttribute("PreCreditCheckedFlag","Y");
    } else {
    header.setAttribute("PreCreditCheckedFlag","N");
    }
    Object getTotalValue(String header_id){
    String soTotal;
    def vo = context.getViewObject("oracle.apps.scm.doo.publicView.analytics.OrderTotalPVO");
    def vc = vo.createViewCriteria();
    def vcrow = vc.createViewCriteriaRow();
    vcrow.setAttribute("HeaderHeaderId", header_id); // it was refHeaderId earlier
    vcrow.setAttribute("OrderTotalPrimaryFlag", "Y");
    vc.add(vcrow);
    def rowset = vo.findByViewCriteria(vc,-1);
    def totalSet = rowset.first();
    if(totalSet!=null)
    soTotal = totalSet.getAttribute("OrderTotalTotalAmount");
    return soTotal;
    }
    

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 According to the Payment Term on the Order Revision

  1. Create an extension on the On Save event and name it Skip Credit Check According to Payment Term.
  2. Add this code to your extension.
    import oracle.apps.scm.doo.common.extensions.ValidationException;  
    String customerPONumber = header.getAttribute("CustomerPONumber");
    if(customerPONumber.equals("RD_TEST"))
    {
    	BigDecimal headerId = header.getAttribute("HeaderId");
        BigDecimal refHeaderId = header.getAttribute("ReferenceHeaderId");
    	Boolean ccHoldFoundOnOriginalLines = false;
    	if(refHeaderId != null)
    	{
    		BigDecimal currentOrderAmount = new BigDecimal(0);
    		BigDecimal refTotalAmount = new BigDecimal(0);
    	
    	    def orderTotals = header.getAttribute("OrderTotals"); 
    		orderTotals.reset();
    		while(orderTotals.hasNext()) { 
    		 def orderTotal = orderTotals.next();
    		 String totalCode = orderTotal.getAttribute("TotalCode");
    		  if(totalCode.equals("QP_TOTAL_PAY_NOW"))
    		  {
    			  currentOrderAmount = orderTotal.getAttribute("TotalAmount");
    		  }
    		}
    		def headereVO  =context.getViewObject("oracle.apps.scm.doo.publicView.analytics.HeaderPVO");
    		def headereVC = headereVO.createViewCriteria();
    		def headerVCRow = headereVC.createViewCriteriaRow();
    
    		headerVCRow.setAttribute("HeaderId", refHeaderId);//ACCOUNT_TYPE AR_FEATURES
    		def headerRowset = headereVO.findByViewCriteria(headereVC, -1);
    		headerRowset.reset();
    		if(headerRowset.hasNext())
    		{
    		  def refHeader = headerRowset.next();
    		  def refOrderTotlasVO  =context.getViewObject("oracle.apps.scm.doo.publicView.analytics.OrderTotalPVO");
    		  def refOrderTotlasVC = refOrderTotlasVO.createViewCriteria();
    		  def refOrderTotlasVCRow = refOrderTotlasVC.createViewCriteriaRow();
    		  refOrderTotlasVCRow.setAttribute("OrderTotalHeaderId", refHeader.getAttribute("HeaderId"));//ACCOUNT_TYPE AR_FEATURES
    		  def refOrderTotlasRowset = refOrderTotlasVO.findByViewCriteria(refOrderTotlasVC, -1);
    		  refOrderTotlasRowset.reset();
    		  while(refOrderTotlasRowset.hasNext()) { 
    			def refOrderTotal = refOrderTotlasRowset.next();
    			String refTotalCode = refOrderTotal.getAttribute("OrderTotalTotalCode");
    		   if(refTotalCode.equals("QP_TOTAL_PAY_NOW"))
    		   {
    			  refTotalAmount = refOrderTotal.getAttribute("OrderTotalTotalAmount");
    			}
    		  }
    		}
    		if(currentOrderAmount.compareTo(refTotalAmount) == 0)
    		{
              def hasPaymentTermChange = false;
              def lines = header.getAttribute("Lines"); 
              while( lines.hasNext() ) 
              {
                def line = lines.next();
                def fulfillLinePaymentTermId = line.getAttribute("PaymentTermCode"); 
                //header.setAttribute("Comments",fulfillLinePaymentTermId);
    
                def refFlineId = line.getAttribute("ReferenceFulfillmentLineIdentifier"); 
               // header.setAttribute("Comments","1");
                def refFlineVO  =context.getViewObject("oracle.apps.scm.doo.publicView.analytics.FulfillLinePVO");
    		    def refFlineVC = refFlineVO.createViewCriteria();
    		    def refFlineVCRow = refFlineVC.createViewCriteriaRow();
    		    refFlineVCRow.setAttribute("FulfillLineId", refFlineId);
    		    def refFlineRowset = refFlineVO.findByViewCriteria(refFlineVC, -1);
    		    refFlineRowset.reset();
    		    if(refFlineRowset.hasNext())
    		    {
                  def refFline = refFlineRowset.next();
                  def refPaymentTerm = refFline.getAttribute("FulfillLinePaymentTermId"); 
                  if(fulfillLinePaymentTermId != refPaymentTerm)
                  {
                     hasPaymentTermChange = true;
                  }
    		    }
              }
              if(!hasPaymentTermChange)
    		     header.setAttribute("PreCreditCheckedFlag", "Y");
    		}
    	}
    }
    

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.

  1. Go to the Setup and Maintenance work area, then go to the task.
    • Offering: Financials
    • Functional Area: Receivables
    • Task: Manage Receivables Lookups
  2. On the Manage Receivables Lookups page, search for the value.
    Attribute Value
    Lookup Type AR_FEATURES
  3. 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.