/**
 * Copyright (c) 2010 Penril Datability (SEA) Sdn Bhd All rights reserved.
 *
 * This software is copyrighted. Under the copyright laws, this software
 * may not be copied, in whole or in part, without prior written consent
 * of Penril Datability (SEA) Sdn Bhd or its assignees. This software is
 * provided under the terms of a license between Penril Datability (SEA)
 * Sdn Bhd and the recipient, and its use is subject to the terms of that
 * license.
 */
package my.com.kfh.enterprise.services.ib104_fundtransfer.interbank;

import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

import my.com.kfh.enterprise.services.GenericESBServicesImpl;
import my.com.kfh.enterprise.services.IBEnterpriseServicesWorkspace;
import my.com.kfh.enterprise.services.IBUtils;
import my.com.kfh.enterprise.services.common.CommonConstants;
import my.com.kfh.enterprise.services.ib101_access.AccessConstants;
import my.com.kfh.enterprise.services.ib112_si.IBGenericSIServices;
import my.com.kfh.error.exception.IBBusinessException;
import my.com.kfh.error.exception.IBGenericException;
import my.com.kfh.error.exception.IBServiceException;
import my.com.kfh.error.handler.CommonErrorCode;
import my.com.kfh.error.handler.IBErrorHandler;
import my.com.kfh.esb.response.ESBRimRetrieveProfileBean;
import my.com.kfh.hibernate.tables.IBGSTContent;
import my.com.kfh.hibernate.utils.HibernateUtils;
import my.com.kfh.sms.services.SMSServices;
import my.com.kfh.web.utils.DataValidator;
import my.com.kfh.web.utils.FormatterUtils;
import my.com.kfh.web.utils.GSTUtils;
import my.com.kfh.web.utils.IBDynaBean;
import my.com.kfh.web.utils.IBDynaBeanManager;
import my.com.kfh.web.utils.IBLoadProperty;
import my.com.kfh.web.utils.IBLogger;
import my.com.kfh.web.utils.IBSessionObjects;
import my.com.kfh.web.utils.IBTimer;
import my.com.kfh.web.utils.ResourcesUtils;
import my.com.kfh.web.utils.constant.ESBConstants;
import my.com.kfh.web.utils.constant.ServiceInfo;

/**
 * <pre>
 * PROGRAMMER: Latipah bt Abdul Rashid
 * CHANGE-NO:
 * TASK-NO:
 * DATE CREATED: Dec 13, 2008
 * TAG AS:
 * REASON(S):
 * MODIFICATION:
 * </pre>
 */

/**
 * Sets display information of transfer details into IBDynaBean.
 */
public class IBInterbankTransferConfirmServices extends	IBEnterpriseServicesWorkspace
{
	private static Class c_oClass = IBInterbankTransferConfirmServices.class;

	/**
	 * Class constructor specifying session object.
	 *
	 * @param m_oIBSessionObjects session object containing all information stored in HTTP session
	 */
	public IBInterbankTransferConfirmServices (IBSessionObjects m_oIBSessionObjects)
	{
		super (m_oIBSessionObjects);
	}

	/**
	 * Formats details of transfer for display and sets into view bean.
	 *
	 * @throws IBGenericException
	 */
	public void verifyInput () throws IBGenericException
	{
		String m_sMethodName = "verifyInput";
		IBTimer m_oTimer = IBLogger.logBSFNMethodEnteringMessage (c_oClass, m_sMethodName);

		IBDynaBean m_oViewBean = null;
		IBDynaBean m_oServiceInfoBean = null;
		String m_sFromAccount = "";
		String m_sFromAccountDis = "";
		String m_sAmountDis = "";
		String m_sBeneBankNameDis = "";
		String m_sBeneBankAccountNo = "";
		String m_sBeneBankHolderName = "";
		String m_sBeneId = "";
		String m_sBeneEmail= "";
		String m_sBeneIdTypeDisplay = "";
		String m_sBeneBankCode = "";
		String m_sTransactionRefNo = "";
		String m_sTransactionDescription = "";
		String m_sFromIsoCurrency = "";
		String m_sBankRouteNo = "";
		String m_sEnableVerificationDis = "";
		String m_sTransferType = "";
		StringBuffer m_sbTempBuffer = new StringBuffer ();
		boolean m_boEnableVerification = false;
		String m_sNewIc = "";
		String m_sOldIc = "";
		String m_sBusinessReg = "";
		String m_sOtherId = "";
		
		boolean m_boEnableVerificationNewIc = false;
		boolean m_boEnableVerificationOldIc = false;
		boolean m_boEnableVerificationBusReg = false;
		boolean m_boEnableVerificationOtherId = false;
		boolean isIdEmpty = false;
		List <String>m_sAccountLengthList = null;
		boolean isAccountLengthValid = false;
		String senderName = "";
		
		try
		{
			m_oViewBean = (IBDynaBean) getIBDynaBean ().get (InterbankConstants.INTERBANK_TRANSFER_VIEW) == null
				? IBDynaBeanManager.createIBDynaBean (InterbankConstants.INTERBANK_TRANSFER_VIEW, getIBDynaBean ().getActionMapping ())
					: (IBDynaBean) getIBDynaBean ().get (InterbankConstants.INTERBANK_TRANSFER_VIEW);

			m_sTransferType = (String) m_oViewBean.get (InterbankConstants.TRANSFER_TYPE);
			GenericESBServicesImpl esbServices = new GenericESBServicesImpl (getIBSessionObjects());
			ESBRimRetrieveProfileBean profileBean = esbServices.getProfile((String) getIBSessionObjects().getHttpSessionAttrObject (AccessConstants.RIM_NO));
			StringBuffer sender = new StringBuffer(profileBean.getFirstName()).append(" ").append(profileBean.getLastName());
			senderName = sender.toString();
			
			if (!DataValidator.isEmptyString(senderName)){
				if(senderName.trim().length() > 40){
					senderName = senderName.trim().substring(0, 40);
				}
			}
			
			
			/*
			 * get beneficiary bank, beneficiary account no, beneficiary holder name
			 */
			if (InterbankConstants.TRANSFER_TYPE_OPEN.equalsIgnoreCase (m_sTransferType))
			{
				m_sBeneBankCode = (String) getIBDynaBean ().get (InterbankConstants.BENE_BANK);

				Map m_oBeneficiaryBankListMap = (LinkedHashMap) m_oViewBean.get (InterbankConstants.BENE_BANK_LIST_MAP);
				Map m_oBeneficiaryBankMap = (HashMap) m_oBeneficiaryBankListMap.get (m_sBeneBankCode);

				m_sBeneBankNameDis = (String) m_oBeneficiaryBankMap.get (InterbankConstants.FULL_NAME);
				m_sBeneBankAccountNo = (String) getIBDynaBean ().get (InterbankConstants.BENE_ACCOUNT_NO);
				m_sBeneBankHolderName = (String) getIBDynaBean ().get (InterbankConstants.BENE_NAME);
				m_sBeneId = DataValidator.isEmptyString ((String) getIBDynaBean ().get (InterbankConstants.BENE_ID)) ? "-"
						: (String) getIBDynaBean ().get (InterbankConstants.BENE_ID);
				m_sNewIc = (String) getIBDynaBean ().get (InterbankConstants.NEW_IC);
				m_sOldIc = (String) getIBDynaBean ().get (InterbankConstants.OLD_IC);
				m_sBusinessReg = (String) getIBDynaBean ().get (InterbankConstants.BUSINESS_REG);
				m_sOtherId = (String) getIBDynaBean ().get (InterbankConstants.OTHER_ID);

				m_sBankRouteNo = (String) m_oBeneficiaryBankMap.get (InterbankConstants.IB_INTERBANK_LIST.IBG_MEMBER_ID.toString ());
			}
			else if (InterbankConstants.TRANSFER_TYPE_REG.equalsIgnoreCase (m_sTransferType))
			{
				String m_sSelectedBeneAcctNo = (String) getIBDynaBean ().get (InterbankConstants.BENE_ACCOUNT_NO);

				Map m_oBeneficiaryAccountListMap = (LinkedHashMap) m_oViewBean.get (InterbankConstants.BENE_ACCOUNT_LIST_MAP);

				Map m_oBeneficiaryAccountMap = (HashMap) m_oBeneficiaryAccountListMap.get (m_sSelectedBeneAcctNo);

				m_sBeneBankCode = (String) m_oBeneficiaryAccountMap.get (InterbankConstants.BANK_CODE);
				m_sBeneBankNameDis = (String) m_oBeneficiaryAccountMap.get (InterbankConstants.BANK_NAME);
				m_sBeneBankAccountNo = m_sSelectedBeneAcctNo;
				m_sBeneBankHolderName = (String) m_oBeneficiaryAccountMap.get (InterbankConstants.BENE_NAME);

				getIBDynaBean ().set (InterbankConstants.BENE_BANK, m_sBeneBankCode);
				m_sBankRouteNo = (String) m_oBeneficiaryAccountMap.get (InterbankConstants.ROUTING_ID);
			}

			m_sNewIc = (String) getIBDynaBean ().get (InterbankConstants.NEW_IC);
			m_sOldIc = (String) getIBDynaBean ().get (InterbankConstants.OLD_IC);
			m_sBusinessReg = (String) getIBDynaBean ().get (InterbankConstants.BUSINESS_REG);
			m_sOtherId = (String) getIBDynaBean ().get (InterbankConstants.OTHER_ID);
			m_sBeneEmail = DataValidator.isEmptyString ((String) getIBDynaBean ().get (InterbankConstants.BENEFICIARY_EMAIL)) ? "-"
					: (String) getIBDynaBean ().get (InterbankConstants.BENEFICIARY_EMAIL);

			/*
			 * check beneficiary id if enable verification is selected
			 */
			
			if (null != getIBDynaBean ().get (InterbankConstants.ENABLE_VERIFICATION))
			{
				m_boEnableVerification = ((Boolean)getIBDynaBean ().get (InterbankConstants.ENABLE_VERIFICATION)).booleanValue ();
			}
			
			if (null != getIBDynaBean ().get ("enableVerificationNewIc"))
			{
				m_boEnableVerificationNewIc = ((Boolean)getIBDynaBean ().get ("enableVerificationNewIc")).booleanValue ();
			}
			if (null != getIBDynaBean ().get ("enableVerificationOldIc"))
			{
				m_boEnableVerificationOldIc = ((Boolean)getIBDynaBean ().get ("enableVerificationOldIc")).booleanValue ();
			}
			if (null != getIBDynaBean ().get ("enableVerificationBusReg"))
			{
				m_boEnableVerificationBusReg = ((Boolean)getIBDynaBean ().get ("enableVerificationBusReg")).booleanValue ();
			}
			if (null != getIBDynaBean ().get ("enableVerificationOtherId"))
			{
				m_boEnableVerificationOtherId = ((Boolean)getIBDynaBean ().get ("enableVerificationOtherId")).booleanValue ();
			}
			
			if(m_boEnableVerificationNewIc == false)
			{
				m_sNewIc = "";
			}
			if(m_boEnableVerificationOldIc == false)
			{
				m_sOldIc = "";
			}
			if(m_boEnableVerificationBusReg == false)
			{
				m_sBusinessReg = "";
			}
			if(m_boEnableVerificationOtherId == false)
			{
				m_sOtherId = "";
			}
			
			if(DataValidator.isEmptyString(m_sNewIc))
			{
				m_sNewIc = (String) getIBDynaBean ().get (InterbankConstants.NEW_IC);
			}
			if(DataValidator.isEmptyString(m_sOldIc))
			{
				m_sOldIc = (String) getIBDynaBean ().get (InterbankConstants.OLD_IC);
			}
			if(DataValidator.isEmptyString(m_sBusinessReg))
			{
				m_sBusinessReg = (String) getIBDynaBean ().get (InterbankConstants.BUSINESS_REG);
			}
			if(DataValidator.isEmptyString(m_sOtherId))
			{
				m_sOtherId = (String) getIBDynaBean ().get (InterbankConstants.OTHER_ID);
			}

			
			if (m_boEnableVerification)
			{
				if(DataValidator.isEmptyString(m_sNewIc))
				{
					if(DataValidator.isEmptyString(m_sOldIc))
					{
						if(DataValidator.isEmptyString(m_sBusinessReg))
						{
							if(DataValidator.isEmptyString(m_sOtherId))
							{
								isIdEmpty = true;
							}
						}
					}
				}
				
				m_sEnableVerificationDis = ResourcesUtils.getApplicationResourceMessage (InterbankConstants.RESOURCE_KEY_ENABLE_VERIFICATION_TRUE);
				if (isIdEmpty)
				{
					if (InterbankConstants.TRANSFER_TYPE_OPEN.equalsIgnoreCase (m_sTransferType))
					{
						throw IBErrorHandler.createBusinessException(IBBusinessException.INTERBANK_TRANSFER, "7");
					}
					else
					{
						throw IBErrorHandler.createBusinessException(IBBusinessException.INTERBANK_TRANSFER, "7");
					}
				}
				
				if (m_boEnableVerificationNewIc)
				{
					if(DataValidator.isEmptyString(m_sNewIc))
					{
						throw IBErrorHandler.createBusinessException(IBBusinessException.INTERBANK_TRANSFER, InterbankConstants.ERR_NO_NEW_IC);
					}
				}
				
				if (m_boEnableVerificationOldIc)
				{
					if(DataValidator.isEmptyString(m_sOldIc))
					{
						throw IBErrorHandler.createBusinessException(IBBusinessException.INTERBANK_TRANSFER, InterbankConstants.ERR_NO_OLD_IC);
					}
				}
				
				if (m_boEnableVerificationBusReg)
				{
					if(DataValidator.isEmptyString(m_sBusinessReg))
					{
						throw IBErrorHandler.createBusinessException(IBBusinessException.INTERBANK_TRANSFER, InterbankConstants.ERR_NO_BUS_REG);
					}
				}
				
				if (m_boEnableVerificationOtherId)
				{
					if(DataValidator.isEmptyString(m_sOtherId))
					{
						throw IBErrorHandler.createBusinessException(IBBusinessException.INTERBANK_TRANSFER, InterbankConstants.ERR_NO_OTHER_ID);
					}
				}

				m_sEnableVerificationDis = ResourcesUtils.getApplicationResourceMessage (InterbankConstants.RESOURCE_KEY_ENABLE_VERIFICATION_TRUE);

//				 Get Bene ID Type
				String m_sBeneIdType = (String) getIBDynaBean ().get (InterbankConstants.BENE_ID_TYPE);
				Map m_oBeneIDTypeMap = ResourcesUtils.getBusinessOptionsResourceKey (InterbankConstants.RESOURCES_BENE_ID_TYPE_OPTION);
				m_sBeneIdTypeDisplay = (String) m_oBeneIDTypeMap.get (m_sBeneIdType);
			}
			else
			{
				m_sEnableVerificationDis = ResourcesUtils.getApplicationResourceMessage (InterbankConstants.RESOURCE_KEY_ENABLE_VERIFICATION_FALSE);
			}

			/*
			 * do validation for account no length based on beneficiary bank
			 */
			if (!DataValidator.isEmptyString (m_sBankRouteNo))
			{
				IBLoadProperty.load ("ibg");
				
				m_sAccountLengthList = ResourcesUtils.getIBGAccountLengthProperties (m_sBankRouteNo);
				
				isAccountLengthValid = InterbankDBUtils.validateAccountLength(m_sAccountLengthList , m_sBeneBankAccountNo.length ());
				
				if (!isAccountLengthValid)
				{
					throw IBErrorHandler.createBusinessException (IBBusinessException.INTERBANK_TRANSFER, InterbankConstants.ERR_ACCOUNT_LENGTH,
							new String [] {m_sBeneBankNameDis, String.valueOf (m_sBeneBankAccountNo.trim ().length ())});
				}
			}

			/*
			 * get formatted from account
			 */
			Map m_oFromAccountListMap = (LinkedHashMap) m_oViewBean.get (InterbankConstants.FROM_ACCOUNT_LIST_MAP);
			if (m_oFromAccountListMap != null)
			{
				m_sFromAccount = (String) getIBDynaBean ().get (InterbankConstants.FROM_ACCOUNT);
				IBDynaBean m_oSelectedFromAccountBean = null;
				m_oSelectedFromAccountBean = (IBDynaBean) m_oFromAccountListMap.get (m_sFromAccount);

				m_sFromIsoCurrency = (String) m_oSelectedFromAccountBean.get (CommonConstants.ISO_CURRENCY);

				m_sbTempBuffer = new StringBuffer ();
				m_sbTempBuffer.append (m_sFromAccount);
				m_sbTempBuffer.append (" ");
				m_sbTempBuffer.append ((String) m_oSelectedFromAccountBean.get (CommonConstants.ACCOUNT_NICKNAME));

				m_sFromAccountDis = m_sbTempBuffer.toString ();
			}

			/*
			 * get formatted amount
			 */
			m_sAmountDis = FormatterUtils.formatMoneyDisplay ((String) getIBDynaBean ().get (InterbankConstants.AMOUNT), m_sFromIsoCurrency, true);

			/*
			 * check the amount against the minimum limit of IBG (set at ibconfig)
			 */
			Double m_dAmountInput = Double.parseDouble ((String) getIBDynaBean ().get (InterbankConstants.AMOUNT));
			IBLoadProperty.load("ibconfig");
			Double m_dMinimumLimit = Double.parseDouble (IBLoadProperty.getValue (InterbankConstants.IBG_TRANSFER_LIMIT));
			//if m_dAmountInput lesser than m_dLimit
			if(m_dAmountInput.compareTo (m_dMinimumLimit)<0)
			{
				String m_sFormattedLimit = FormatterUtils.formatMoneyDisplay (m_dMinimumLimit.toString (), m_sFromIsoCurrency, true);
				throw IBErrorHandler.createBusinessException(IBBusinessException.INTERBANK_TRANSFER, "3",
						new String[]{m_sAmountDis,InterbankConstants.IBG_OPTION_DISPLAY,m_sFormattedLimit});
			}

			/*
			 * get transaction ref number display, if filled by user
			 */
			m_sTransactionRefNo = DataValidator.isEmptyString ((String) getIBDynaBean ().get (InterbankConstants.TRANSACTION_REF_NO)) ? "-"
					: (String) getIBDynaBean ().get (InterbankConstants.TRANSACTION_REF_NO);

			/*
			 * get transaction description display, if filled by user
			 */
			m_sTransactionDescription = DataValidator.isEmptyString ((String) getIBDynaBean ().get (InterbankConstants.TRANSACTION_DESC)) ? "-"
					: (String) getIBDynaBean ().get (InterbankConstants.TRANSACTION_DESC);


			m_sBeneId = !DataValidator.isEmptyString (m_sBeneId) ? m_sBeneId : "-";

			m_oServiceInfoBean = (IBDynaBean) m_oViewBean.get (ServiceInfo.SERVICE_INFO_BEAN);
			
			//Pixakarft Bank Negara Changes 30th Mar 2013 start
			if (((Boolean) m_oServiceInfoBean.get (ServiceInfo.BEAN_ATT_TAC_REQUIRED)).booleanValue ())
			{
				IBDynaBean m_oSMSViewBean = (IBDynaBean) getIBSessionObjects().getHttpSessionAttrObject(CommonConstants.SMS_VIEW_BEAN);
				m_oSMSViewBean.set(CommonConstants.AMOUNT, m_sAmountDis);
				if(!DataValidator.isEmptyString(m_sBeneBankHolderName)){
					m_oSMSViewBean.set(CommonConstants.BENE_NAME, m_sBeneBankHolderName.length()>18?m_sBeneBankHolderName.substring(0, 18):m_sBeneBankHolderName);
				}
				getIBSessionObjects().setHttpSessionAttrObject(CommonConstants.SMS_VIEW_BEAN, m_oSMSViewBean);
			}
			//Pixakarft Bank Negara Changes 30th Mar 2013 start
			
			if (m_oServiceInfoBean != null && ((Boolean)m_oServiceInfoBean.get (ServiceInfo.BEAN_ATT_FUTURE_TRANSACTION_FLAG)).booleanValue ())
			{
				IBGenericSIServices m_oGenericSIServices = new IBGenericSIServices (getIBSessionObjects ());
				m_oGenericSIServices.setIBDynaBean (getIBDynaBean ());
				m_oGenericSIServices.confirmSIInput (m_oViewBean);
			}

			m_oViewBean.set (InterbankConstants.FROM_ACCOUNT_DIS, m_sFromAccountDis);
			m_oViewBean.set (InterbankConstants.AMOUNT_DIS, m_sAmountDis);
			m_oViewBean.set (InterbankConstants.BENE_BANK_DIS, m_sBeneBankNameDis);
			m_oViewBean.set (InterbankConstants.BENE_ACCOUNT_NO, m_sBeneBankAccountNo);
			m_oViewBean.set (InterbankConstants.BENE_NAME, m_sBeneBankHolderName);
//			m_oViewBean.set (InterbankConstants.BENE_ID, m_sBeneId);
//			m_oViewBean.set (InterbankConstants.BENE_ID_TYPE_DIS,
//					!DataValidator.isEmptyString (m_sBeneIdTypeDisplay)?m_sBeneIdTypeDisplay:"-");
			m_oViewBean.set (InterbankConstants.BENEFICIARY_EMAIL, m_sBeneEmail);
			m_oViewBean.set (InterbankConstants.TRANSACTION_REF_NO, m_sTransactionRefNo);
			m_oViewBean.set (InterbankConstants.TRANSACTION_DESC, m_sTransactionDescription);
			m_oViewBean.set (InterbankConstants.FROM_ISO_CURRENCY, m_sFromIsoCurrency);
			m_oViewBean.set (InterbankConstants.BANK_ROUTE_NUMBER, m_sBankRouteNo);
			m_oViewBean.set (InterbankConstants.ENABLE_VERIFICATION_DIS, m_sEnableVerificationDis);
			m_oViewBean.set (InterbankConstants.NEW_IC, 
					!DataValidator.isEmptyString (m_sNewIc)?m_sNewIc:"-");
			m_oViewBean.set (InterbankConstants.OLD_IC, 
					!DataValidator.isEmptyString (m_sOldIc)?m_sOldIc:"-");
			m_oViewBean.set (InterbankConstants.BUSINESS_REG, 
					!DataValidator.isEmptyString (m_sBusinessReg)?m_sBusinessReg:"-");
			m_oViewBean.set (InterbankConstants.OTHER_ID, 
					!DataValidator.isEmptyString (m_sOtherId)?m_sOtherId:"-");
			m_oViewBean.set(InterbankConstants.SENDER_NAME, senderName);
			//Setup service charges and gst charges and set into view bean for display
			String serviceCharges = null;
			String gstChargesRate = null;
			String gstCharges = null;
			String gstChargesWithoutRounding = ""; 
			
			String m_sIsStaffAccount = getESBServices().getInquiryStaffByAcctNo(m_sFromAccount).getStatus();
			
			if (ESBConstants.ACC_NONSTAFF.equalsIgnoreCase(m_sIsStaffAccount)){
				serviceCharges = DataValidator.isEmptyString((String) m_oServiceInfoBean.get(ServiceInfo.BEAN_ATT_CHARGES))?"0":(String) m_oServiceInfoBean.get(ServiceInfo.BEAN_ATT_CHARGES);
				IBGSTContent gstContent = HibernateUtils.getGstContentByChargesCode(IBLoadProperty.getValue(GSTUtils.INTERBANK_CHARGES_CODE));
				if(gstContent!=null){
					gstChargesRate = IBUtils.getGSTRate(this, IBLoadProperty.getValue(GSTUtils.INTERBANK_CHARGES_CODE));
					gstCharges = GSTUtils.gstAmount2Dec(serviceCharges, gstChargesRate);
					gstChargesWithoutRounding = GSTUtils.gstCalcCharges(serviceCharges, gstChargesRate);
				}
			}
			
			m_oViewBean.set (InterbankConstants.IS_STAFF_ACCOUNT, m_sIsStaffAccount);
			m_oViewBean.set (InterbankConstants.SERVICE_CHARGES, serviceCharges);
			m_oViewBean.set (InterbankConstants.SERVICE_CHARGES_DISP, DataValidator.isEmptyString(serviceCharges)?"-":!(Double.valueOf(serviceCharges)>0)?"-":FormatterUtils.formatMoneyDisplay (serviceCharges, m_sFromIsoCurrency, true));
			m_oViewBean.set (InterbankConstants.GST_CHARGES, gstCharges);
			m_oViewBean.set (InterbankConstants.GST_CHARGES_DIS, DataValidator.isEmptyString(gstCharges)? "-":(gstCharges.equals("0.00")||gstCharges.equals("0.0")||gstCharges.equals("0")?"-":FormatterUtils.formatMoneyDisplay (gstCharges, m_sFromIsoCurrency, true)));
			m_oViewBean.set (InterbankConstants.GST_CHARGES_WITHOUT_ROUNDING, gstChargesWithoutRounding);
			// SMS Notification START
			m_oViewBean = SMSServices.setupConfirmViewBean(this, (String) getIBDynaBean ().get (InterbankConstants.AMOUNT), m_sFromIsoCurrency, getIBDynaBean(), m_oViewBean, m_oServiceInfoBean);
			// SMS Notification END

			getIBDynaBean ().set (InterbankConstants.INTERBANK_TRANSFER_VIEW, m_oViewBean);
		}
		catch (Exception e)
		{
			if (e instanceof IBGenericException)
			{
				throw (IBGenericException) e;
			}
			throw IBErrorHandler.createServiceException(
					IBServiceException.GENERAL_SERVICE_ERROR, true,
					new String[] {CommonErrorCode.GENERIC_CODE, "", "", "", IBErrorHandler.generateErrorMessage(e)}, c_oClass);
		}
		finally
		{
			getIBDynaBean ().set ("enableVerificationNewIc", null);
			getIBDynaBean ().set ("enableVerificationOldIc" , null);
			getIBDynaBean ().set ("enableVerificationBusReg", null);
			getIBDynaBean ().set ("enableVerificationOtherId", null);
		}

		IBLogger.logBSFNMethodLeavingMessage (c_oClass, m_sMethodName, m_oTimer);
	}
}
