Groovy extension for Order Type Transaction Type
Content
import oracle.apps.scm.doo.common.extensions.ValidationException;
import oracle.apps.scm.doo.common.extensions.Message;
def extensionName = context.getExtensionName();
def varMessage = "IN code";
List<Message> messages = new ArrayList<Message>();
ValidationException ex = new ValidationException(messages);
def varTime = context.getCurrentTime();
def orderTypeCode = header.getAttribute("TransactionTypeCode");
def LineTypeCode = line.getAttribute("TransactionLineTypeCode");
def billingTxnTypeId ;
if( orderTypeCode.equals("RENTAL_ORDER") && LineTypeCode.equals("ORA_BUY") ) { // check for ordertype
billingTxnTypeId = getBillingTxnTypeId("OM Invoices");
}
else if ( orderTypeCode.equals("IS_RMA") ) {
billingTxnTypeId = getBillingTxnTypeId("Credit Memo");
}
if (billingTxnTypeId == null){
varMessage = "Billing Transaction Type has not Been Set for Order Type: - " + orderTypeCode;
messages.add(new Message( Message.MessageType.ERROR,varMessage));