Develop > Controller layer > Application developer > Business relationship assets


Purchase order number validation

Purchase order numbers are validated during the order processing.

WebSphere Commerce takes the purchase order number the customer enters with the order payment information and processes it...

  1. The ValidatePONumber task command is called. The ValidatePONumber task command checks if the entered purchase order number already exists in the business account. The entered purchase order number already exists in WebSphere Commerce if it is a blanket purchase order number, a limited purchase order number, or an individual purchase order number that was used for a different order. If the entered purchase number already exists in WebSphere Commerce, the ValidatePONumber task command checks if duplicates of the existing purchase order number are allowed. If no duplicates of the purchase order number are allowed, an error is thrown that specifies the DoPaymentErrorView. If either the entered purchase order number does not exist in WebSphere Commerce or duplicates of an existing purchase order number is allowed, the ValidatePONumber task command completes successfully.

  2. If the ValidatePONumber task command completes successfully, the CheckPOSpendingLimit task command is called. The CheckPOSpendingLimit command checks if the successfully validated purchase order number has a spending limit associated with it. If the purchase order number has a spending limit associated with it, the CheckPOSpendingLimit command check that the order total does not exceed the remaining spending limit for the purchase order number. If the order total does not exceed the remaining spending limit, the CheckPOSpendingLimit command completes successfully.

The spending limit for a limited purchase order number is not updated at this point. The spending limit is updated by the UpdatePOSpending task command which is called when a shipment is released to fulfillment by the CheckPaymentAccept task command.