Index: sql/latest-schema.sql
===================================================================
--- sql/latest-schema.sql	(revision 12167)
+++ sql/latest-schema.sql	(working copy)
@@ -4246,3 +4246,17 @@
 
 --
 
+-- added for moratorium module [start]
+CREATE TABLE moratorium (
+     ID INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY,
+     APPLIED_TO varchar(200),
+     START_DATE date,
+     END_DATE date,
+     LIFT_DATE date,
+     CREATED_BY varchar(200),
+     NOTES varchar(200),
+     CUSTOMER_ID INTEGER,
+     OFFICE_ID INTEGER
+     );
+-- added for moratorium module [end]
+
Index: sql/mifosdroptables.sql
===================================================================
--- sql/mifosdroptables.sql	(revision 12167)
+++ sql/mifosdroptables.sql	(working copy)
@@ -383,4 +383,6 @@
 
 DROP TABLE IF EXISTS DATABASE_VERSION;
 
-
+-- added for moratorium module [start]
+DROP TABLE IF EXISTS MORATORIUM;
+-- added for moratorium module [end]
Index: src/org/mifos/application/accounts/loan/business/LoanScheduleEntity.java
===================================================================
--- src/org/mifos/application/accounts/loan/business/LoanScheduleEntity.java	(revision 12167)
+++ src/org/mifos/application/accounts/loan/business/LoanScheduleEntity.java	(working copy)
@@ -45,12 +45,14 @@
 import org.mifos.application.accounts.business.AccountBO;
 import org.mifos.application.accounts.business.AccountFeesActionDetailEntity;
 import org.mifos.application.accounts.business.AccountFeesEntity;
+import org.mifos.application.accounts.loan.persistance.LoanPersistence;
 import org.mifos.application.accounts.loan.util.helpers.LoanConstants;
 import org.mifos.application.accounts.util.helpers.AccountConstants;
 import org.mifos.application.accounts.util.helpers.LoanPaymentData;
 import org.mifos.application.accounts.util.helpers.OverDueAmounts;
 import org.mifos.application.accounts.util.helpers.PaymentStatus;
 import org.mifos.application.customer.business.CustomerBO;
+import org.mifos.framework.exceptions.ApplicationException;
 import org.mifos.framework.util.helpers.Money;
 
 public class LoanScheduleEntity extends AccountActionDateEntity {
@@ -457,5 +459,9 @@
 		}
 		return false;
 	}
-
+	
+	// for moratorium
+	public void save() throws ApplicationException {
+		new LoanPersistence().createOrUpdate(this);	
+	}
 }
Index: src/org/mifos/application/accounts/savings/business/SavingsScheduleEntity.java
===================================================================
--- src/org/mifos/application/accounts/savings/business/SavingsScheduleEntity.java	(revision 12167)
+++ src/org/mifos/application/accounts/savings/business/SavingsScheduleEntity.java	(working copy)
@@ -4,8 +4,10 @@
 
 import org.mifos.application.accounts.business.AccountActionDateEntity;
 import org.mifos.application.accounts.business.AccountBO;
+import org.mifos.application.accounts.savings.persistence.SavingsPersistence;
 import org.mifos.application.accounts.util.helpers.PaymentStatus;
 import org.mifos.application.customer.business.CustomerBO;
+import org.mifos.framework.exceptions.ApplicationException;
 import org.mifos.framework.util.helpers.Money;
 
 public class SavingsScheduleEntity extends AccountActionDateEntity {
@@ -58,4 +60,8 @@
 		setPaymentStatus(PaymentStatus.PAID);
 	}
 	
+//	 for moratorium
+	public void save() throws ApplicationException {
+		new SavingsPersistence().createOrUpdate(this);	
+	}
 }
Index: src/org/mifos/application/admin/util/resources/adminUIResources.properties
===================================================================
--- src/org/mifos/application/admin/util/resources/adminUIResources.properties	(revision 12167)
+++ src/org/mifos/application/admin/util/resources/adminUIResources.properties	(working copy)
@@ -74,3 +74,7 @@
 admin.configurePPI=Configure PPI Settings
 admin.defineacceptedpaymenttype=Define accepted payment types
 admin.defineadditionalfields=Define additional fields
+
+# added for moratorium
+admin.viewMoratorium=View moratoriums
+admin.appplyMoratorium=Apply moratorium
Index: src/org/mifos/application/customer/business/CustomerBO.hbm.xml
===================================================================
--- src/org/mifos/application/customer/business/CustomerBO.hbm.xml	(revision 12167)
+++ src/org/mifos/application/customer/business/CustomerBO.hbm.xml	(working copy)
@@ -769,4 +769,58 @@
 				 where client.searchId like :SEARCH_STRING and client.office.officeId = :OFFICE_ID 
 				 and client.customerStatus.id in (3,4) order by client.customerActivationDate]]>
 	</query>
+	
+	<!-- for moratorium [start] -->		
+	<query name="Moratorium.cust_account_Search">
+		<![CDATA[select cust.displayName,cust.customerId,customerOne.displayName,customerTwo.displayName,off.officeName,cust.globalCustNum  
+		from org.mifos.application.customer.business.CustomerBO as cust 
+		left join cust.parentCustomer as customerOne 
+		left join customerOne.parentCustomer as customerTwo 
+		left join cust.office as off
+        where (:GROUP_LOAN_ALLOWED=true and cust.customerLevel.id =2 and cust.customerStatus.id =9 and cust.displayName like :SEARCH_STRING and off.searchId like :SEARCH_ID) 
+		or (cust.customerLevel.id =1  and 
+		      (cust.displayName like :SEARCH_STRING 
+		       or cust.lastName like :SEARCH_STRING 
+		       or cust.secondLastName like :SEARCH_STRING 
+		      )
+		   and off.searchId like :SEARCH_ID 
+	   	  and cust.customerStatus.id =3
+	   	)
+	   	or (cust.customerLevel.id =3  and 
+		      (cust.displayName like :SEARCH_STRING 
+		       or cust.lastName like :SEARCH_STRING 
+		       or cust.secondLastName like :SEARCH_STRING 
+		      )
+		   and off.searchId like :SEARCH_ID 
+	   	  and cust.customerStatus.id =13
+	   	)	   	
+        order by  cust.customerLevel.id,cust.lastName,cust.firstName,cust.displayName ]]>
+	</query>
+		
+ 	<query name="Moratorium.cust_count_account_Search">
+		<![CDATA[select count(*)  
+		from org.mifos.application.customer.business.CustomerBO as cust 
+		left join cust.parentCustomer as customerOne 
+		left join customerOne.parentCustomer as customerTwo 
+		left join cust.office as off 
+		where (:GROUP_LOAN_ALLOWED=true and cust.customerLevel.id =2 and cust.customerStatus.id =9 and cust.displayName like :SEARCH_STRING and off.searchId like :SEARCH_ID) 
+		or (cust.customerLevel.id =1  and 
+		      (cust.displayName like :SEARCH_STRING 
+		       or cust.lastName like :SEARCH_STRING 
+		       or cust.secondLastName like :SEARCH_STRING 
+		      )
+		   and off.searchId like :SEARCH_ID 
+	   	  and cust.customerStatus.id =3
+	   	)
+	   	or (cust.customerLevel.id =3  and 
+		      (cust.displayName like :SEARCH_STRING 
+		       or cust.lastName like :SEARCH_STRING 
+		       or cust.secondLastName like :SEARCH_STRING 
+		      )
+		   and off.searchId like :SEARCH_ID 
+	   	  and cust.customerStatus.id =13
+	   	)	   	
+	   	]]>
+	</query>
+	<!-- for moratorium [end] -->
 </hibernate-mapping>
Index: src/org/mifos/application/customer/business/service/CustomerBusinessService.java
===================================================================
--- src/org/mifos/application/customer/business/service/CustomerBusinessService.java	(revision 12167)
+++ src/org/mifos/application/customer/business/service/CustomerBusinessService.java	(working copy)
@@ -491,4 +491,17 @@
 			throw new ServiceException(pe);
 		}
 	}
+	
+	// for moratorium [start]
+	public QueryResult searchCenterGroupClient(String searchString, Short userId)
+			throws ServiceException {
+		try {
+			return new CustomerPersistence().searchCenterGroupClient(searchString,
+					userId);
+		} catch (PersistenceException e) {
+			throw new ServiceException(e);
+		}
+		
+		}
+	// for moratorium [end]
 }
Index: src/org/mifos/application/customer/persistence/CustomerPersistence.java
===================================================================
--- src/org/mifos/application/customer/persistence/CustomerPersistence.java	(revision 12167)
+++ src/org/mifos/application/customer/persistence/CustomerPersistence.java	(working copy)
@@ -946,4 +946,50 @@
 				NamedQueryConstants.SEARCH_GROUPS_FOR_LOAN_OFFICER,
 				queryParameters);
 	}
+	
+//	 for moratorium [start]
+	public QueryResult searchCenterGroupClient(String searchString, Short userId)
+	throws PersistenceException {
+		String[] namedQuery = new String[2];
+		List<Param> paramList = new ArrayList<Param>();
+		QueryInputs queryInputs = new QueryInputs();
+		QueryResult queryResult = QueryFactory
+				.getQueryResult(CustomerSearchConstants.ACCOUNTSEARCHRESULTS);
+		PersonnelBO personnel = new PersonnelPersistence().getPersonnel(userId);
+		if (personnel.getLevelEnum() == PersonnelLevel.LOAN_OFFICER) {
+			namedQuery[0] = NamedQueryConstants.SEARCH_GROUP_CLIENT_COUNT_LO;
+			namedQuery[1] = NamedQueryConstants.SEARCH_GROUP_CLIENT_LO;
+			paramList.add(typeNameValue("Short", "PERSONNEL_ID", userId));
+		}
+		else {
+			namedQuery[0] = NamedQueryConstants.MORATORIUM_SEARCH_GROUP_CLIENT_COUNT;
+			namedQuery[1] = NamedQueryConstants.MORATORIUM_SEARCH_GROUP_CLIENT;
+		}
+		
+		paramList.add(typeNameValue("String", "SEARCH_ID", personnel
+				.getOffice().getSearchId()
+				+ "%"));
+		paramList.add(typeNameValue("String", "SEARCH_STRING", searchString
+				+ "%"));
+		paramList.add(typeNameValue("Boolean", "GROUP_LOAN_ALLOWED",
+				Configuration.getInstance().getCustomerConfig(
+						personnel.getOffice().getOfficeId())
+						.canGroupApplyForLoan() == true ? Boolean.valueOf(true)
+						: Boolean.valueOf(false)));
+		
+		String[] aliasNames = { "clientName", "clientId", "groupName",
+				"centerName", "officeName", "globelNo" };
+		queryInputs.setQueryStrings(namedQuery);
+		queryInputs
+				.setPath("org.mifos.application.accounts.util.helpers.AccountSearchResults");
+		queryInputs.setAliasNames(aliasNames);
+		queryInputs.setParamList(paramList);
+		try {
+			queryResult.setQueryInputs(queryInputs);
+		} catch (HibernateSearchException e) {
+			throw new PersistenceException(e);
+		}		
+		return queryResult;		
+		}
+	//  for moratorium [end]
 }
Index: src/org/mifos/application/customer/struts/action/CustSearchAction.java
===================================================================
--- src/org/mifos/application/customer/struts/action/CustSearchAction.java	(revision 12167)
+++ src/org/mifos/application/customer/struts/action/CustSearchAction.java	(working copy)
@@ -346,6 +346,24 @@
 			SessionUtils.setQueryResultAttribute(Constants.SEARCH_RESULTS,
 					getCustomerBusinessService().searchCustForSavings(
 							searchString, userContext.getId()), request);
+		// added for moratorium [start]
+		else if(actionForm.getInput() != null && actionForm.getInput().equals("moratorium"))
+		{
+			SessionUtils.setQueryResultAttribute(Constants.SEARCH_RESULTS, getCustomerBusinessService().searchCenterGroupClient(searchString, userContext.getId()), request);			
+			//SessionUtils.setQueryResultAttribute(Constants.SEARCH_RESULTS, getCustomerBusinessService().searchGroupClient(searchString, userContext.getId()), request);
+			
+			/*Short officeId = getShortValue(actionForm.getOfficeId());
+			if (officeId != null && officeId != 0)
+				addSeachValues(searchString, officeId.toString(),
+						new OfficeBusinessService().getOffice(officeId)
+								.getOfficeName(), request);
+			else
+				addSeachValues(searchString, officeId.toString(),
+						new OfficeBusinessService().getOffice(
+								userContext.getBranchId()).getOfficeName(), request);			
+			SessionUtils.setQueryResultAttribute(Constants.SEARCH_RESULTS, getCustomerBusinessService().search(searchString, officeId, userContext.getId(), userContext.getBranchId()), request);*/
+		}
+		// added for moratorium [end]
         if (request.getParameter("perspective") != null) {
             request.setAttribute("perspective", request.getParameter("perspective"));
         }
Index: src/org/mifos/application/moratorium/business/MoratoriumBO.java
===================================================================
--- src/org/mifos/application/moratorium/business/MoratoriumBO.java	(revision 0)
+++ src/org/mifos/application/moratorium/business/MoratoriumBO.java	(revision 0)
@@ -0,0 +1,139 @@
+package org.mifos.application.moratorium.business;
+
+
+import java.sql.Date;
+
+import org.mifos.application.customer.business.CustomerBO;
+import org.mifos.application.customer.exceptions.CustomerException;
+import org.mifos.application.moratorium.persistence.MoratoriumPersistence;
+import org.mifos.application.moratorium.util.resources.MoratoriumConstants;
+import org.mifos.framework.business.BusinessObject;
+import org.mifos.framework.exceptions.PersistenceException;
+
+public class MoratoriumBO extends BusinessObject{
+
+	private int moratoriumId;
+	
+	private String appliedTo;
+		
+	private Date startDate;
+		
+	private Date endDate;
+		
+	private Date liftDate;
+	
+	private String morCreatedBy;
+	
+	private String notes;
+	
+	private String customerId;
+	
+	private String officeId;
+	
+	private CustomerBO customer;
+	
+	public MoratoriumBO() {
+		super();
+		//this.moratoriumId = null;
+		this.appliedTo = null;
+		this.startDate = null;
+		this.endDate = null;		
+		this.liftDate = null;
+		this.morCreatedBy = null;
+		this.notes = null;
+		this.customerId=null;
+		this.officeId=null;
+		this.customer = null;
+	}
+
+	public String getAppliedTo() {
+		return appliedTo;
+	}
+
+	public void setAppliedTo(String appliedTo) {
+		this.appliedTo = appliedTo;
+	}
+
+	public CustomerBO getCustomer() {
+		return customer;
+	}
+
+	public void setCustomer(CustomerBO customer) {
+		this.customer = customer;
+	}
+
+	public Date getEndDate() {
+		return endDate;
+	}
+
+	public void setEndDate(Date endDate) {
+		this.endDate = endDate;
+	}
+
+	public Date getLiftDate() {
+		return liftDate;
+	}
+
+	public void setLiftDate(Date liftDate) {
+		this.liftDate = liftDate;
+	}
+
+	public int getMoratoriumId() {
+		return moratoriumId;
+	}
+
+	public void setMoratoriumId(int moratoriumId) {
+		this.moratoriumId = moratoriumId;
+	}
+
+	public String getMorCreatedBy() {
+		return morCreatedBy;
+	}
+
+	public void setMorCreatedBy(String morCreatedBy) {
+		this.morCreatedBy = morCreatedBy;
+	}
+
+	public String getNotes() {
+		return notes;
+	}
+
+	public void setNotes(String notes) {
+		this.notes = notes;
+	}
+
+	public Date getStartDate() {
+		return startDate;
+	}
+
+	public void setStartDate(Date startDate) {
+		this.startDate = startDate;
+	}
+	
+	public void save() throws CustomerException {
+		try 
+		{
+			new MoratoriumPersistence().createOrUpdate(this);			
+		}
+		catch (PersistenceException e) 
+		{
+			throw new CustomerException(MoratoriumConstants.CREATE_FAILED_EXCEPTION, e);
+		}
+	}
+
+	public String getCustomerId() {
+		return customerId;
+	}
+
+	public void setCustomerId(String customerId) {
+		this.customerId = customerId;
+	}
+
+	public String getOfficeId() {
+		return officeId;
+	}
+
+	public void setOfficeId(String officeId) {
+		this.officeId = officeId;
+	}
+}
Index: src/org/mifos/application/moratorium/business/MoratoriumBO.hbm.xml
===================================================================
--- src/org/mifos/application/moratorium/business/MoratoriumBO.hbm.xml	(revision 0)
+++ src/org/mifos/application/moratorium/business/MoratoriumBO.hbm.xml	(revision 0)
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding='UTF-8'?>
+<!DOCTYPE hibernate-mapping PUBLIC
+                            "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+                            "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >
+
+
+<hibernate-mapping>
+
+	<class name="org.mifos.application.moratorium.business.MoratoriumBO" table="MORATORIUM">
+		<id name="moratoriumId" column="ID" type="integer" access="field">
+			<generator class="native" />
+		</id>
+
+	    <property name="appliedTo" column="APPLIED_TO" type="string" />
+		<property name="startDate" column="START_DATE" type="date" />
+		<property name="endDate" column="END_DATE" type="date"/>
+		<property name="liftDate" column="LIFT_DATE" type="date"/>
+		<property name="morCreatedBy" column="CREATED_BY" type="string" />
+		<property name="notes" column="NOTES" type="string"/>
+		<property name="customerId" column="CUSTOMER_ID" type="string"/>
+		<property name="officeId" column="OFFICE_ID" type="string"/>
+	</class>
+	
+	<query name="moratorium.getMoratoriums">
+			<![CDATA[from org.mifos.application.moratorium.business.MoratoriumBO
+			]]>
+	</query>
+	
+	<query name="moratorium.getMoratoriumById">
+			<![CDATA[from org.mifos.application.moratorium.business.MoratoriumBO moratoriumBO
+	                  where moratoriumBO.moratoriumId = :moratoriumId
+			]]>
+	</query> 
+ 
+ 	<query name="moratorium.getMoratoriumByCustomerId">
+			<![CDATA[from org.mifos.application.moratorium.business.MoratoriumBO moratoriumBO
+	                  where moratoriumBO.customerId = :customerId
+			]]>
+	</query>
+	
+	<query name="moratorium.getMoratoriumByOfficeId">
+			<![CDATA[from org.mifos.application.moratorium.business.MoratoriumBO moratoriumBO
+	                  where moratoriumBO.officeId = :officeId
+			]]>
+	</query>
+</hibernate-mapping>
\ No newline at end of file
Index: src/org/mifos/application/moratorium/business/MoratoriumBO.hbm.xml
===================================================================
--- src/org/mifos/application/moratorium/business/MoratoriumBO.hbm.xml	(revision 0)
+++ src/org/mifos/application/moratorium/business/MoratoriumBO.hbm.xml	(revision 0)
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding='UTF-8'?>
+<!DOCTYPE hibernate-mapping PUBLIC
+                            "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+                            "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >
+
+
+<hibernate-mapping>
+
+	<class name="org.mifos.application.moratorium.business.MoratoriumBO" table="MORATORIUM">
+		<id name="moratoriumId" column="ID" type="integer" access="field">
+			<generator class="native" />
+		</id>
+
+	    <property name="appliedTo" column="APPLIED_TO" type="string" />
+		<property name="startDate" column="START_DATE" type="date" />
+		<property name="endDate" column="END_DATE" type="date"/>
+		<property name="liftDate" column="LIFT_DATE" type="date"/>
+		<property name="morCreatedBy" column="CREATED_BY" type="string" />
+		<property name="notes" column="NOTES" type="string"/>
+		<property name="customerId" column="CUSTOMER_ID" type="string"/>
+		<property name="officeId" column="OFFICE_ID" type="string"/>
+	</class>
+	
+	<query name="moratorium.getMoratoriums">
+			<![CDATA[from org.mifos.application.moratorium.business.MoratoriumBO
+			]]>
+	</query>
+	
+	<query name="moratorium.getMoratoriumById">
+			<![CDATA[from org.mifos.application.moratorium.business.MoratoriumBO moratoriumBO
+	                  where moratoriumBO.moratoriumId = :moratoriumId
+			]]>
+	</query> 
+ 
+ 	<query name="moratorium.getMoratoriumByCustomerId">
+			<![CDATA[from org.mifos.application.moratorium.business.MoratoriumBO moratoriumBO
+	                  where moratoriumBO.customerId = :customerId
+			]]>
+	</query>
+	
+	<query name="moratorium.getMoratoriumByOfficeId">
+			<![CDATA[from org.mifos.application.moratorium.business.MoratoriumBO moratoriumBO
+	                  where moratoriumBO.officeId = :officeId
+			]]>
+	</query>
+</hibernate-mapping>
\ No newline at end of file
Index: src/org/mifos/application/moratorium/business/MoratoriumBO.java
===================================================================
--- src/org/mifos/application/moratorium/business/MoratoriumBO.java	(revision 0)
+++ src/org/mifos/application/moratorium/business/MoratoriumBO.java	(revision 0)
@@ -0,0 +1,139 @@
+package org.mifos.application.moratorium.business;
+
+
+import java.sql.Date;
+
+import org.mifos.application.customer.business.CustomerBO;
+import org.mifos.application.customer.exceptions.CustomerException;
+import org.mifos.application.moratorium.persistence.MoratoriumPersistence;
+import org.mifos.application.moratorium.util.resources.MoratoriumConstants;
+import org.mifos.framework.business.BusinessObject;
+import org.mifos.framework.exceptions.PersistenceException;
+
+public class MoratoriumBO extends BusinessObject{
+
+	private int moratoriumId;
+	
+	private String appliedTo;
+		
+	private Date startDate;
+		
+	private Date endDate;
+		
+	private Date liftDate;
+	
+	private String morCreatedBy;
+	
+	private String notes;
+	
+	private String customerId;
+	
+	private String officeId;
+	
+	private CustomerBO customer;
+	
+	public MoratoriumBO() {
+		super();
+		//this.moratoriumId = null;
+		this.appliedTo = null;
+		this.startDate = null;
+		this.endDate = null;		
+		this.liftDate = null;
+		this.morCreatedBy = null;
+		this.notes = null;
+		this.customerId=null;
+		this.officeId=null;
+		this.customer = null;
+	}
+
+	public String getAppliedTo() {
+		return appliedTo;
+	}
+
+	public void setAppliedTo(String appliedTo) {
+		this.appliedTo = appliedTo;
+	}
+
+	public CustomerBO getCustomer() {
+		return customer;
+	}
+
+	public void setCustomer(CustomerBO customer) {
+		this.customer = customer;
+	}
+
+	public Date getEndDate() {
+		return endDate;
+	}
+
+	public void setEndDate(Date endDate) {
+		this.endDate = endDate;
+	}
+
+	public Date getLiftDate() {
+		return liftDate;
+	}
+
+	public void setLiftDate(Date liftDate) {
+		this.liftDate = liftDate;
+	}
+
+	public int getMoratoriumId() {
+		return moratoriumId;
+	}
+
+	public void setMoratoriumId(int moratoriumId) {
+		this.moratoriumId = moratoriumId;
+	}
+
+	public String getMorCreatedBy() {
+		return morCreatedBy;
+	}
+
+	public void setMorCreatedBy(String morCreatedBy) {
+		this.morCreatedBy = morCreatedBy;
+	}
+
+	public String getNotes() {
+		return notes;
+	}
+
+	public void setNotes(String notes) {
+		this.notes = notes;
+	}
+
+	public Date getStartDate() {
+		return startDate;
+	}
+
+	public void setStartDate(Date startDate) {
+		this.startDate = startDate;
+	}
+	
+	public void save() throws CustomerException {
+		try 
+		{
+			new MoratoriumPersistence().createOrUpdate(this);			
+		}
+		catch (PersistenceException e) 
+		{
+			throw new CustomerException(MoratoriumConstants.CREATE_FAILED_EXCEPTION, e);
+		}
+	}
+
+	public String getCustomerId() {
+		return customerId;
+	}
+
+	public void setCustomerId(String customerId) {
+		this.customerId = customerId;
+	}
+
+	public String getOfficeId() {
+		return officeId;
+	}
+
+	public void setOfficeId(String officeId) {
+		this.officeId = officeId;
+	}
+}
Index: src/org/mifos/application/moratorium/business/service/MoratoriumBusinessService.java
===================================================================
--- src/org/mifos/application/moratorium/business/service/MoratoriumBusinessService.java	(revision 0)
+++ src/org/mifos/application/moratorium/business/service/MoratoriumBusinessService.java	(revision 0)
@@ -0,0 +1,80 @@
+package org.mifos.application.moratorium.business.service;
+
+import java.util.List;
+
+import org.mifos.application.customer.persistence.CustomerPersistence;
+import org.mifos.application.moratorium.business.MoratoriumBO;
+import org.mifos.application.moratorium.persistence.MoratoriumPersistence;
+import org.mifos.application.personnel.business.PersonnelView;
+import org.mifos.framework.business.BusinessObject;
+import org.mifos.framework.business.service.BusinessService;
+import org.mifos.framework.exceptions.PersistenceException;
+import org.mifos.framework.exceptions.ServiceException;
+import org.mifos.framework.security.util.UserContext;
+
+public class MoratoriumBusinessService extends BusinessService {
+
+	public MoratoriumBusinessService()
+	{}
+	
+	public static MoratoriumBusinessService getInstance(UserContext userContext) {
+		return new MoratoriumBusinessService();
+	}
+	
+	@Override
+	public BusinessObject getBusinessObject(UserContext userContext) {
+		return null;
+	}
+	
+	// for getting all records from moratorium table(closed & open)
+	public List<MoratoriumBO> getMoratoriums() throws ServiceException 
+	{
+		try 
+		{
+			return new MoratoriumPersistence().getMoratoriums();
+		}
+		catch (PersistenceException pe) 
+		{
+			throw new ServiceException(pe);
+		}
+	}
+	
+	// for getting moratorium by moratoriumId
+	public List<MoratoriumBO> getMoratoriumById(String moratoriumId) throws ServiceException 
+	{
+		try 
+		{
+			return new MoratoriumPersistence().getMoratoriumById(moratoriumId);
+		}
+		catch (PersistenceException pe) 
+		{
+			throw new ServiceException(pe);
+		}
+	}
+	
+	// for getting moratoriums by customerId
+	public List<MoratoriumBO> getMoratoriumByCustomerId(String customerId) throws ServiceException 
+	{
+		try 
+		{
+			return new MoratoriumPersistence().getMoratoriumByCustomerId(customerId);
+		}
+		catch (PersistenceException pe) 
+		{
+			throw new ServiceException(pe);
+		}
+	}
+	
+	// for getting moratoriums by officeId
+	public List<MoratoriumBO> getMoratoriumByOfficeId(String officeId) throws ServiceException 
+	{
+		try 
+		{
+			return new MoratoriumPersistence().getMoratoriumByOfficeId(officeId);
+		}
+		catch (PersistenceException pe) 
+		{
+			throw new ServiceException(pe);
+		}
+	}
+}
Index: src/org/mifos/application/moratorium/business/service/MoratoriumBusinessService.java
===================================================================
--- src/org/mifos/application/moratorium/business/service/MoratoriumBusinessService.java	(revision 0)
+++ src/org/mifos/application/moratorium/business/service/MoratoriumBusinessService.java	(revision 0)
@@ -0,0 +1,80 @@
+package org.mifos.application.moratorium.business.service;
+
+import java.util.List;
+
+import org.mifos.application.customer.persistence.CustomerPersistence;
+import org.mifos.application.moratorium.business.MoratoriumBO;
+import org.mifos.application.moratorium.persistence.MoratoriumPersistence;
+import org.mifos.application.personnel.business.PersonnelView;
+import org.mifos.framework.business.BusinessObject;
+import org.mifos.framework.business.service.BusinessService;
+import org.mifos.framework.exceptions.PersistenceException;
+import org.mifos.framework.exceptions.ServiceException;
+import org.mifos.framework.security.util.UserContext;
+
+public class MoratoriumBusinessService extends BusinessService {
+
+	public MoratoriumBusinessService()
+	{}
+	
+	public static MoratoriumBusinessService getInstance(UserContext userContext) {
+		return new MoratoriumBusinessService();
+	}
+	
+	@Override
+	public BusinessObject getBusinessObject(UserContext userContext) {
+		return null;
+	}
+	
+	// for getting all records from moratorium table(closed & open)
+	public List<MoratoriumBO> getMoratoriums() throws ServiceException 
+	{
+		try 
+		{
+			return new MoratoriumPersistence().getMoratoriums();
+		}
+		catch (PersistenceException pe) 
+		{
+			throw new ServiceException(pe);
+		}
+	}
+	
+	// for getting moratorium by moratoriumId
+	public List<MoratoriumBO> getMoratoriumById(String moratoriumId) throws ServiceException 
+	{
+		try 
+		{
+			return new MoratoriumPersistence().getMoratoriumById(moratoriumId);
+		}
+		catch (PersistenceException pe) 
+		{
+			throw new ServiceException(pe);
+		}
+	}
+	
+	// for getting moratoriums by customerId
+	public List<MoratoriumBO> getMoratoriumByCustomerId(String customerId) throws ServiceException 
+	{
+		try 
+		{
+			return new MoratoriumPersistence().getMoratoriumByCustomerId(customerId);
+		}
+		catch (PersistenceException pe) 
+		{
+			throw new ServiceException(pe);
+		}
+	}
+	
+	// for getting moratoriums by officeId
+	public List<MoratoriumBO> getMoratoriumByOfficeId(String officeId) throws ServiceException 
+	{
+		try 
+		{
+			return new MoratoriumPersistence().getMoratoriumByOfficeId(officeId);
+		}
+		catch (PersistenceException pe) 
+		{
+			throw new ServiceException(pe);
+		}
+	}
+}
Index: src/org/mifos/application/moratorium/exceptions/MoratoriumException.java
===================================================================
--- src/org/mifos/application/moratorium/exceptions/MoratoriumException.java	(revision 0)
+++ src/org/mifos/application/moratorium/exceptions/MoratoriumException.java	(revision 0)
@@ -0,0 +1,63 @@
+/**
+
+ * CustomerException.java    version: 1.0
+
+
+
+ * Copyright (c) 2005-2006 Grameen Foundation USA
+
+ * 1029 Vermont Avenue, NW, Suite 400, Washington DC 20005
+
+ * All rights reserved.
+
+
+
+ * Apache License
+ * Copyright (c) 2005-2006 Grameen Foundation USA
+ *
+
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License. You may obtain
+ * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
+ *
+
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and limitations under the
+
+ * License.
+ *
+ * See also http://www.apache.org/licenses/LICENSE-2.0.html for an explanation of the license
+
+ * and how it is applied.
+
+ *
+
+ */
+
+package org.mifos.application.moratorium.exceptions;
+
+import org.mifos.framework.exceptions.ApplicationException;
+/**
+ * This is general exception for the customer(group/client/center)
+ */
+public class MoratoriumException extends ApplicationException{
+	
+	public MoratoriumException(String key) {
+		super(key);
+	}
+	
+	public MoratoriumException(String key, Object[] values) {
+		super(key, values);
+	}
+
+	public MoratoriumException(Throwable cause) {
+		super(cause);
+	}
+	
+	public MoratoriumException(String key, Throwable cause) {
+		super(key, cause);
+	}
+
+}
Index: src/org/mifos/application/moratorium/exceptions/MoratoriumException.java
===================================================================
--- src/org/mifos/application/moratorium/exceptions/MoratoriumException.java	(revision 0)
+++ src/org/mifos/application/moratorium/exceptions/MoratoriumException.java	(revision 0)
@@ -0,0 +1,63 @@
+/**
+
+ * CustomerException.java    version: 1.0
+
+
+
+ * Copyright (c) 2005-2006 Grameen Foundation USA
+
+ * 1029 Vermont Avenue, NW, Suite 400, Washington DC 20005
+
+ * All rights reserved.
+
+
+
+ * Apache License
+ * Copyright (c) 2005-2006 Grameen Foundation USA
+ *
+
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License. You may obtain
+ * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
+ *
+
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and limitations under the
+
+ * License.
+ *
+ * See also http://www.apache.org/licenses/LICENSE-2.0.html for an explanation of the license
+
+ * and how it is applied.
+
+ *
+
+ */
+
+package org.mifos.application.moratorium.exceptions;
+
+import org.mifos.framework.exceptions.ApplicationException;
+/**
+ * This is general exception for the customer(group/client/center)
+ */
+public class MoratoriumException extends ApplicationException{
+	
+	public MoratoriumException(String key) {
+		super(key);
+	}
+	
+	public MoratoriumException(String key, Object[] values) {
+		super(key, values);
+	}
+
+	public MoratoriumException(Throwable cause) {
+		super(cause);
+	}
+	
+	public MoratoriumException(String key, Throwable cause) {
+		super(key, cause);
+	}
+
+}
Index: src/org/mifos/application/moratorium/persistence/MoratoriumPersistence.java
===================================================================
--- src/org/mifos/application/moratorium/persistence/MoratoriumPersistence.java	(revision 0)
+++ src/org/mifos/application/moratorium/persistence/MoratoriumPersistence.java	(revision 0)
@@ -0,0 +1,44 @@
+package org.mifos.application.moratorium.persistence;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.mifos.application.NamedQueryConstants;
+import org.mifos.application.master.persistence.MasterPersistence;
+import org.mifos.application.moratorium.business.MoratoriumBO;
+import org.mifos.framework.exceptions.PersistenceException;
+
+public class MoratoriumPersistence extends MasterPersistence {
+
+	// for getting all records from moratorium table(closed & open)
+	public List<MoratoriumBO> getMoratoriums() throws PersistenceException {
+		Map<String, Object> queryParameters = new HashMap<String, Object>();		
+		List<MoratoriumBO> queryResult = executeNamedQuery(NamedQueryConstants.GET_MORATORIUMS, queryParameters);
+		return queryResult;
+	}
+	
+	// for getting moratorium by moratoriumId
+	public List<MoratoriumBO> getMoratoriumById(String moratoriumId) throws PersistenceException {
+		Map<String, Object> queryParameters = new HashMap<String, Object>();
+		queryParameters.put("moratoriumId", moratoriumId);
+		List<MoratoriumBO> queryResult = executeNamedQuery(NamedQueryConstants.GET_MORATORIUM_BY_ID, queryParameters);
+		return queryResult;
+	}
+	
+	// for getting moratoriums by customerId
+	public List<MoratoriumBO> getMoratoriumByCustomerId(String customerId) throws PersistenceException {
+		Map<String, Object> queryParameters = new HashMap<String, Object>();
+		queryParameters.put("customerId", customerId);
+		List<MoratoriumBO> queryResult = executeNamedQuery(NamedQueryConstants.GET_MORATORIUM_BY_CUSTOMER_ID, queryParameters);
+		return queryResult;
+	}
+	
+	// for getting moratoriums by officeId
+	public List<MoratoriumBO> getMoratoriumByOfficeId(String officeId) throws PersistenceException {
+		Map<String, Object> queryParameters = new HashMap<String, Object>();
+		queryParameters.put("officeId", officeId);
+		List<MoratoriumBO> queryResult = executeNamedQuery(NamedQueryConstants.GET_MORATORIUM_BY_OFFICE_ID, queryParameters);
+		return queryResult;
+	}
+}
Index: src/org/mifos/application/moratorium/persistence/MoratoriumPersistence.java
===================================================================
--- src/org/mifos/application/moratorium/persistence/MoratoriumPersistence.java	(revision 0)
+++ src/org/mifos/application/moratorium/persistence/MoratoriumPersistence.java	(revision 0)
@@ -0,0 +1,44 @@
+package org.mifos.application.moratorium.persistence;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.mifos.application.NamedQueryConstants;
+import org.mifos.application.master.persistence.MasterPersistence;
+import org.mifos.application.moratorium.business.MoratoriumBO;
+import org.mifos.framework.exceptions.PersistenceException;
+
+public class MoratoriumPersistence extends MasterPersistence {
+
+	// for getting all records from moratorium table(closed & open)
+	public List<MoratoriumBO> getMoratoriums() throws PersistenceException {
+		Map<String, Object> queryParameters = new HashMap<String, Object>();		
+		List<MoratoriumBO> queryResult = executeNamedQuery(NamedQueryConstants.GET_MORATORIUMS, queryParameters);
+		return queryResult;
+	}
+	
+	// for getting moratorium by moratoriumId
+	public List<MoratoriumBO> getMoratoriumById(String moratoriumId) throws PersistenceException {
+		Map<String, Object> queryParameters = new HashMap<String, Object>();
+		queryParameters.put("moratoriumId", moratoriumId);
+		List<MoratoriumBO> queryResult = executeNamedQuery(NamedQueryConstants.GET_MORATORIUM_BY_ID, queryParameters);
+		return queryResult;
+	}
+	
+	// for getting moratoriums by customerId
+	public List<MoratoriumBO> getMoratoriumByCustomerId(String customerId) throws PersistenceException {
+		Map<String, Object> queryParameters = new HashMap<String, Object>();
+		queryParameters.put("customerId", customerId);
+		List<MoratoriumBO> queryResult = executeNamedQuery(NamedQueryConstants.GET_MORATORIUM_BY_CUSTOMER_ID, queryParameters);
+		return queryResult;
+	}
+	
+	// for getting moratoriums by officeId
+	public List<MoratoriumBO> getMoratoriumByOfficeId(String officeId) throws PersistenceException {
+		Map<String, Object> queryParameters = new HashMap<String, Object>();
+		queryParameters.put("officeId", officeId);
+		List<MoratoriumBO> queryResult = executeNamedQuery(NamedQueryConstants.GET_MORATORIUM_BY_OFFICE_ID, queryParameters);
+		return queryResult;
+	}
+}
Index: src/org/mifos/application/moratorium/struts/action/MoratoriumAction.java
===================================================================
--- src/org/mifos/application/moratorium/struts/action/MoratoriumAction.java	(revision 0)
+++ src/org/mifos/application/moratorium/struts/action/MoratoriumAction.java	(revision 0)
@@ -0,0 +1,1232 @@
+package org.mifos.application.moratorium.struts.action;
+
+import java.sql.Date;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.GregorianCalendar;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.struts.action.ActionForm;
+import org.apache.struts.action.ActionForward;
+import org.apache.struts.action.ActionMapping;
+import org.mifos.application.accounts.loan.business.LoanBO;
+import org.mifos.application.accounts.loan.business.LoanScheduleEntity;
+import org.mifos.application.accounts.savings.business.SavingsBO;
+import org.mifos.application.accounts.savings.business.SavingsScheduleEntity;
+import org.mifos.application.customer.business.CustomerBO;
+import org.mifos.application.customer.client.business.ClientBO;
+import org.mifos.application.customer.client.business.service.ClientBusinessService;
+import org.mifos.application.customer.util.helpers.CustomerLevel;
+import org.mifos.application.meeting.business.MeetingBO;
+import org.mifos.application.meeting.business.service.MeetingBusinessService;
+import org.mifos.application.meeting.struts.actionforms.MeetingActionForm;
+import org.mifos.application.meeting.util.helpers.RecurrenceType;
+import org.mifos.application.moratorium.business.MoratoriumBO;
+import org.mifos.application.moratorium.business.service.MoratoriumBusinessService;
+import org.mifos.application.moratorium.struts.actionforms.MoratoriumActionForm;
+import org.mifos.application.office.business.OfficeBO;
+import org.mifos.application.office.business.service.OfficeBusinessService;
+import org.mifos.application.office.util.helpers.OfficeLevel;
+import org.mifos.application.office.util.resources.OfficeConstants;
+import org.mifos.application.util.helpers.ActionForwards;
+import org.mifos.framework.business.service.BusinessService;
+import org.mifos.framework.business.service.ServiceFactory;
+import org.mifos.framework.components.tabletag.TableTagConstants;
+import org.mifos.framework.exceptions.PageExpiredException;
+import org.mifos.framework.exceptions.ServiceException;
+import org.mifos.framework.security.util.ActionSecurity;
+import org.mifos.framework.security.util.UserContext;
+import org.mifos.framework.security.util.resources.SecurityConstants;
+import org.mifos.framework.struts.action.BaseAction;
+import org.mifos.framework.util.helpers.BusinessServiceName;
+import org.mifos.framework.util.helpers.Constants;
+import org.mifos.framework.util.helpers.DateUtils;
+import org.mifos.framework.util.helpers.SessionUtils;
+import org.mifos.framework.util.helpers.TransactionDemarcate;
+
+public class MoratoriumAction extends BaseAction{
+	
+	@Override
+	protected BusinessService getService() throws ServiceException {
+		return ServiceFactory.getInstance().getBusinessService(
+				BusinessServiceName.Office);
+	}
+	
+	@Override
+	protected boolean skipActionFormToBusinessObjectConversion(String method) {
+		return true;
+	}
+	
+	public static ActionSecurity getSecurity() {
+		ActionSecurity security = new ActionSecurity("moratoriumAction");
+		security.allow("configure", SecurityConstants.VIEW);
+		security.allow("load", SecurityConstants.VIEW);		
+		security.allow("loadSearch", SecurityConstants.VIEW);		
+		security.allow("edit",SecurityConstants.VIEW);
+		security.allow("cancelCreate", SecurityConstants.VIEW);
+		security.allow("cancelUpdate", SecurityConstants.VIEW);
+		security.allow("create", SecurityConstants.VIEW);
+		security.allow("get", SecurityConstants.VIEW);
+		security.allow("edit", SecurityConstants.VIEW);
+		security.allow("editPreview", SecurityConstants.VIEW);
+		security.allow("updateMoratorium", SecurityConstants.VIEW);
+		security.allow("createConfirmed", SecurityConstants.VIEW);
+		security.allow("previous", SecurityConstants.VIEW);
+		security.allow("previousEdit", SecurityConstants.VIEW);
+		security.allow("loadForBranch", SecurityConstants.VIEW);		
+		return security;
+	}			
+	
+	
+	// for edit moratorium screen
+	@TransactionDemarcate(joinToken = true)
+	public ActionForward edit(ActionMapping mapping, ActionForm form,
+			HttpServletRequest request, HttpServletResponse response) throws Exception{
+		
+		//UserContext userContext = (UserContext) SessionUtils.getAttribute(Constants.USER_CONTEXT_KEY, request.getSession());
+		MoratoriumActionForm actionForm = (MoratoriumActionForm) form;
+		
+		if (null != request.getParameter(Constants.CURRENTFLOWKEY))
+			request.setAttribute(Constants.CURRENTFLOWKEY, request.getParameter("currentFlowKey"));
+		
+		// get customerId, moratoriumId and officeId from request
+		String moratoriumId = null;
+		String customerId = null;
+		String officeId = null;
+		if(null != request.getParameter("moratoriumId"))
+			moratoriumId = request.getParameter("moratoriumId");
+		if(null != request.getParameter("customerId"))
+			customerId = request.getParameter("customerId");
+		if(null != request.getParameter("officeId"))
+			officeId = request.getParameter("officeId");
+		
+		// get moratorium details for client/branch and save it to session, so that 
+		// it can be used in actionForm for validation, i.e., overlapping of moratoriums
+		List moratoriumList = new ArrayList<MoratoriumBO>();
+		if(officeId != null)
+			moratoriumList = getMoratoriumBizService().getMoratoriumByOfficeId(officeId);
+		else
+			moratoriumList = getMoratoriumBizService().getMoratoriumByCustomerId(customerId);
+		// setting list of moratoriums in session
+		SessionUtils.setCollectionAttribute("moratoriumLst", moratoriumList, request.getSession());
+		
+		try 
+		{
+			// get moratorium corresponding to the moratoriumId
+			List moratoriumLst = getMoratoriumBizService().getMoratoriumById(moratoriumId);
+			
+			Iterator iter = moratoriumLst.iterator();
+			if (iter.hasNext()) 
+			{
+				MoratoriumBO moratoriumBO = (MoratoriumBO) iter.next();
+				
+				// setting moratoriumBO in session, so that it can be used in the jsp page(editMoratoriums.jsp)
+				SessionUtils.setAttribute(Constants.BUSINESS_KEY, moratoriumBO, request);
+				
+				// setting values of action form
+				Calendar fromDateCalendar = new GregorianCalendar();
+				fromDateCalendar.setTimeInMillis(moratoriumBO.getStartDate().getTime());
+				int fromYear = fromDateCalendar.get(Calendar.YEAR);
+				int fromMonth = fromDateCalendar.get(Calendar.MONTH) + 1;
+				int fromDay = fromDateCalendar.get(Calendar.DAY_OF_MONTH);
+				
+				Calendar endDateCalendar = new GregorianCalendar();
+				endDateCalendar.setTimeInMillis(moratoriumBO.getEndDate().getTime());
+				int endYear = endDateCalendar.get(Calendar.YEAR);
+				int endMonth = endDateCalendar.get(Calendar.MONTH) + 1;
+				int endDay = endDateCalendar.get(Calendar.DAY_OF_MONTH);
+								
+				//actionForm.setFromDate(moratoriumBO.getStartDate());
+				//actionForm.setEndDate(moratoriumBO.getEndDate());
+				actionForm.setMoratoriumFromDateDD(String.valueOf(fromDay));
+				actionForm.setMoratoriumFromDateMM(String.valueOf(fromMonth));
+				actionForm.setMoratoriumFromDateYY(String.valueOf(fromYear));
+				actionForm.setMoratoriumEndDateDD(String.valueOf(endDay));
+				actionForm.setMoratoriumEndDateMM(String.valueOf(endMonth));
+				actionForm.setMoratoriumEndDateYY(String.valueOf(endYear));
+				actionForm.setMoratoriumNotes(moratoriumBO.getNotes());
+			}
+		}
+		catch (ServiceException e) 
+		{
+			throw new RuntimeException(e);
+		}
+		
+		return mapping.findForward(ActionForwards.edit_success.toString());		
+	}
+	
+	//for edit preview screen
+	@TransactionDemarcate(joinToken = true)
+	public ActionForward editPreview(ActionMapping mapping, ActionForm form,
+			HttpServletRequest request, HttpServletResponse response) throws Exception{
+		
+		MoratoriumActionForm actionForm = (MoratoriumActionForm) form;
+		
+		if (null != request.getParameter(Constants.CURRENTFLOWKEY))
+			request.setAttribute(Constants.CURRENTFLOWKEY, request.getParameter("currentFlowKey"));
+		
+		// get officeId from request
+		String officeId = null;
+		if(null != request.getParameter("officeId"))
+		{
+			officeId = request.getParameter("officeId");
+			// setting officeId in action form, so that it can be used in updateMoratorium() method
+			actionForm.setOfficeId(officeId);
+		}
+		
+		// get moratoriumId from request
+		String moratoriumId = null;		
+		if(null != request.getParameter("moratoriumId"))
+		{
+			moratoriumId = request.getParameter("moratoriumId");
+			// setting moratoriumId in action form, so that it can be used in updateMoratorium() method
+			actionForm.setMoratoriumId(moratoriumId);
+		}
+		
+		try 
+		{
+			// get moratorium corresponding to the moratoriumId
+			List moratoriumLst = getMoratoriumBizService().getMoratoriumById(moratoriumId);
+			
+			Iterator iter = moratoriumLst.iterator();
+			if (iter.hasNext()) 
+			{
+				MoratoriumBO moratoriumBO = (MoratoriumBO) iter.next();
+				
+				// setting moratoriumBO in session, so that it can be used in the jsp page(editMoratoriumsPreview.jsp)
+				SessionUtils.setAttribute(Constants.BUSINESS_KEY, moratoriumBO, request);
+			}
+		}
+		catch (ServiceException e) 
+		{
+			throw new RuntimeException(e);
+		}
+		
+		return mapping.findForward(ActionForwards.editpreview_success.toString());		
+	}
+	
+	// for update moratorium from "edit preview screen"
+	@TransactionDemarcate(joinToken = true)
+	public ActionForward updateMoratorium(ActionMapping mapping, ActionForm form,
+			HttpServletRequest request, HttpServletResponse response) throws Exception{
+		
+		MoratoriumActionForm actionForm = (MoratoriumActionForm) form;
+		MeetingActionForm meetingForm = new MeetingActionForm();
+		
+		if (null != request.getParameter(Constants.CURRENTFLOWKEY))
+			request.setAttribute(Constants.CURRENTFLOWKEY, request.getParameter("currentFlowKey"));
+		
+		// get moratoriumId from request
+		String moratoriumId = null;		
+		if(null != actionForm.getMoratoriumId())
+			moratoriumId = actionForm.getMoratoriumId();		
+		
+		try 
+		{
+			// get moratorium corresponding to the moratoriumId
+			List moratoriumLst = getMoratoriumBizService().getMoratoriumById(moratoriumId);
+			
+			Iterator iter = moratoriumLst.iterator();
+			if (iter.hasNext()) 
+			{
+				MoratoriumBO moratoriumBO = (MoratoriumBO) iter.next();
+				
+				// updating moratoriumBO object and saving it to database
+				moratoriumBO.setEndDate((Date) actionForm.getEndDate());
+				moratoriumBO.save();
+												
+				if(actionForm.getOfficeId() != null)
+				{
+					// officeId
+					String officeId = actionForm.getOfficeId();
+					// getting office
+					OfficeBO officeBO = null;
+					officeBO = ((OfficeBusinessService) getService()).getOffice(Short.valueOf(officeId));
+					Set clients = officeBO.getClients();
+					if(clients != null)
+					{
+						Iterator clientsIter = clients.iterator();
+						while (clientsIter.hasNext()) 
+						{
+							CustomerBO client = (CustomerBO) clientsIter.next();
+							client.getCustomerId();
+							
+							// call method to reschedule loan and savings accounts
+							// we will reschedule only for center and clients which belong to this branch, because
+							// calling a reschedule on center will reschedule for it's corresponsding groups and clients
+							CustomerLevel customerLevel = client.getLevel();
+							Short id = customerLevel.getValue();
+							if(id == 3)
+								callRescsheduleLoanAndSavingsAccount(client, meetingForm, actionForm, officeId);
+							else if(id == 1)
+							{
+								// get moratorium parent of this client(i.e., group)
+								// if it's parent customer is null, then only we need to call reschdule, because
+								// a client without group belongs to branch and for a client belonging to a group
+								// we don't have to call reschedule, it is taken care by reschedule of center.
+								CustomerBO group = client.getParentCustomer();
+								if(group == null)
+									callRescsheduleLoanAndSavingsAccount(client, meetingForm, actionForm, officeId);
+							}
+						}
+					}					
+				}
+				else
+				{
+					// getting customer			
+					CustomerBO client = getClientBusinessService().getClient(getIntegerValue(moratoriumBO.getCustomerId()));
+					
+					// call method to reschedule loan and savings accounts
+					callRescsheduleLoanAndSavingsAccount(client, meetingForm, actionForm, null);
+				}
+			}
+		}
+		catch (ServiceException e) 
+		{
+			throw new RuntimeException(e);
+		}
+		
+		return mapping.findForward(ActionForwards.update_success.toString());		
+	}
+	
+	// for edit screen when ctrl is coming from editMoratoriumsPreview.jsp
+	@TransactionDemarcate(joinToken = true)
+	public ActionForward previousEdit(ActionMapping mapping, ActionForm form,
+			HttpServletRequest request, HttpServletResponse response)
+			throws Exception {
+		
+		if (null != request.getParameter(Constants.CURRENTFLOWKEY))
+			request.setAttribute(Constants.CURRENTFLOWKEY, request.getParameter("currentFlowKey"));
+		
+		return mapping.findForward("edit_previous_success");
+	}
+	
+	// for view moratorium screen
+	@TransactionDemarcate(saveToken = true)
+	public ActionForward get(ActionMapping mapping, ActionForm form,
+			HttpServletRequest request, HttpServletResponse response) throws Exception{
+		
+		if (null != request.getParameter(Constants.CURRENTFLOWKEY))
+			request.setAttribute(Constants.CURRENTFLOWKEY, request.getParameter("currentFlowKey"));
+		
+		try 
+		{
+			List activeMoratoriums = new ArrayList();
+			List closedMoratoriums = new ArrayList();
+			List moratoriumLst = getMoratoriumBizService().getMoratoriums();
+			
+			Iterator iter = moratoriumLst.iterator();
+			while (iter.hasNext()) 
+			{
+				MoratoriumBO moratoriumBO = (MoratoriumBO) iter.next();
+				if(moratoriumBO.getLiftDate() == null)
+				{
+					// clarification is required from community
+					if(DateUtils.getDateWithoutTimeStamp(moratoriumBO.getEndDate().getTime()).compareTo(DateUtils.getCurrentDateWithoutTimeStamp()) < 0)
+						closedMoratoriums.add(moratoriumBO);
+					else
+						activeMoratoriums.add(moratoriumBO);
+					
+					//activeMoratoriums.add(moratoriumBO); // remove after getting clarification
+				}
+				else
+					closedMoratoriums.add(moratoriumBO);
+			}
+			// setting list of moratoriums in session			
+			request.setAttribute("openMoratoriums", activeMoratoriums);
+			request.setAttribute("closedMoratoriums", closedMoratoriums);
+		}
+		catch (ServiceException e) 
+		{
+			throw new RuntimeException(e);
+		}
+		
+		return mapping.findForward(ActionForwards.get_success.toString());		
+	}
+	
+	// for edit screen when ctrl is coming from applyMoratoriumConfirm.jsp or applyBranchMoratoriumConfirm.jsp
+	@TransactionDemarcate(joinToken = true)
+	public ActionForward previous(ActionMapping mapping, ActionForm form,
+			HttpServletRequest request, HttpServletResponse response)
+			throws Exception {
+		
+		if (null != request.getParameter(Constants.CURRENTFLOWKEY))
+			request.setAttribute(Constants.CURRENTFLOWKEY, request.getParameter("currentFlowKey"));
+		
+		String officeId = request.getParameter("officeId");
+		if(officeId == null)
+			return mapping.findForward(ActionForwards.previous_success.toString());
+		else
+			return mapping.findForward("previous_success_for_branch");
+	}
+	
+	private MoratoriumBusinessService getMoratoriumBizService() {
+		return new MoratoriumBusinessService();
+	}
+	
+	public ActionForward configure(ActionMapping mapping, ActionForm form,
+			HttpServletRequest request, HttpServletResponse response)
+			throws Exception {
+		
+		return mapping.findForward("configure");
+	}
+	
+	@TransactionDemarcate(saveToken = true)
+	public ActionForward loadSearch(ActionMapping mapping, ActionForm form,
+			HttpServletRequest request, HttpServletResponse response)
+			throws Exception {
+		
+		MoratoriumActionForm actionForm = (MoratoriumActionForm) form;
+		//actionForm.setSearchString(null);
+        if (request.getParameter("perspective") != null) {
+            request.setAttribute("perspective", request.getParameter("perspective"));
+        }
+        cleanUpSearch(request);	
+		
+        if("1".equals(actionForm.getSearchString()))
+        {
+        	// code for search logic of branches [start]
+        	UserContext userContext = (UserContext) SessionUtils.getAttribute(
+    				Constants.USER_CONTEXT_KEY, request.getSession());
+        	List<OfficeBO> officeList = getOffices(userContext, ((OfficeBusinessService) getService()).getOfficesTillBranchOffice());
+    		SessionUtils.setCollectionAttribute(OfficeConstants.GET_HEADOFFICE, getOffice(officeList, OfficeLevel.HEADOFFICE), request);
+    		SessionUtils.setCollectionAttribute(OfficeConstants.GET_REGIONALOFFICE, getOffice(officeList, OfficeLevel.REGIONALOFFICE), request);
+    		SessionUtils.setCollectionAttribute(OfficeConstants.GET_SUBREGIONALOFFICE, getOffice(officeList, OfficeLevel.SUBREGIONALOFFICE), request);
+    		SessionUtils.setCollectionAttribute(OfficeConstants.GET_AREAOFFICE, getOffice(officeList, OfficeLevel.AREAOFFICE), request);
+        	SessionUtils.setCollectionAttribute(OfficeConstants.GET_BRANCHOFFICE, getOffices(userContext, ((OfficeBusinessService) getService()).getBranchOffices()), request);
+        	loadofficeLevels(request);
+        	// code for search logic of branches [end]
+        	return mapping.findForward("loadSearchForBranch");
+        }
+        else
+        	return mapping.findForward("loadSearch");
+	}
+	
+	@TransactionDemarcate(saveToken = true) // for links on moratoriumSearchResult.jsp
+	public ActionForward load(ActionMapping mapping, ActionForm form,
+			HttpServletRequest request, HttpServletResponse response)
+			throws Exception {
+		
+		// customerId
+		String customerId = request.getParameter("customerId");
+		//ClientBO clientInSession = (ClientBO) SessionUtils.getAttribute(Constants.BUSINESS_KEY, request);
+		if(customerId != null)
+		{
+			//ClientBO client = getClientBusinessService().getClient(getIntegerValue(customerId));
+			CustomerBO client = getClientBusinessService().getClient(getIntegerValue(customerId));
+			request.setAttribute("customerId", request.getParameter("customerId"));
+			SessionUtils.setAttribute(Constants.BUSINESS_KEY, client, request);
+		}
+		
+        if (request.getParameter("perspective") != null) {
+            request.setAttribute("perspective", request.getParameter("perspective"));
+        }        	
+		
+        // get moratorium details for client and save it to session, so that 
+		// it can be used in actionForm for validation, i.e., overlapping of moratoriums
+		List moratoriumLst = getMoratoriumBizService().getMoratoriumByCustomerId(customerId);
+		// setting list of moratoriums in session			
+		//request.setAttribute("moratoriumLst", moratoriumLst);
+		//request.getSession().setAttribute("moratoriumLst", moratoriumLst);		
+		SessionUtils.setCollectionAttribute("moratoriumLst", moratoriumLst, request.getSession());
+        
+		return mapping.findForward("load");
+	}
+	
+	// for apply moratorium screen (applyMoratorium.jsp and applyMoratoriumForBranch.jsp)
+	@TransactionDemarcate(saveToken = true)
+	public ActionForward create(ActionMapping mapping, ActionForm form,
+			HttpServletRequest request, HttpServletResponse response)
+			throws Exception {               	
+		
+		// customerId
+		String customerId = request.getParameter("customerId");		
+		if(customerId != null)
+		{
+			// getting customer
+			ClientBO client = getClientBusinessService().getClient(getIntegerValue(customerId));
+			request.setAttribute("customerId", customerId);
+			SessionUtils.setAttribute(Constants.BUSINESS_KEY, client, request);
+			
+			return mapping.findForward("create");
+		}
+		else
+		{
+			// officeId
+			String officeId = request.getParameter("officeId");
+			
+			// getting office
+			OfficeBO officeBO = null;
+			officeBO = ((OfficeBusinessService) getService()).getOffice(Short.valueOf(officeId));
+			request.setAttribute("officeId", officeId);
+			SessionUtils.setAttribute(Constants.BUSINESS_KEY, officeBO, request);
+			
+			return mapping.findForward("createForBranch");
+		}
+	}
+	
+	// for apply moratorium confirm screen (applyMoratoriumConfirm.jsp & applyBranchMoratoriumConfirm.jsp)
+	@TransactionDemarcate(saveToken = true)
+	public ActionForward createConfirmed(ActionMapping mapping, ActionForm form,
+			HttpServletRequest request, HttpServletResponse response)
+			throws Exception {               	
+		
+		MoratoriumActionForm actionForm = (MoratoriumActionForm) form;
+		MeetingActionForm meetingForm = new MeetingActionForm();
+		
+		// customerId
+		String customerId = request.getParameter("customerId");		
+		if(customerId != null)
+		{
+			// getting customer			
+			CustomerBO client = getClientBusinessService().getClient(getIntegerValue(customerId));
+			
+			request.setAttribute("customerId", customerId);
+			SessionUtils.setAttribute(Constants.BUSINESS_KEY, client, request);			
+			
+			// call method to reschedule loan and savings accounts
+			callRescsheduleLoanAndSavingsAccount(client, meetingForm, actionForm, null);
+			
+			//save record to Moratorium table (refer holidayAction - update method)
+			MoratoriumBO moratoriumBO = new MoratoriumBO();
+			moratoriumBO.setAppliedTo(client.getDisplayName());
+			moratoriumBO.setStartDate((Date) actionForm.getFromDate());
+			moratoriumBO.setEndDate((Date) actionForm.getEndDate());			
+			//moratoriumBO.setCreatedBy(createdBy);
+			moratoriumBO.setNotes(actionForm.getMoratoriumNotes());
+			moratoriumBO.setCustomerId(customerId);
+			// commented for testing, uncomment later
+			moratoriumBO.save();			
+		}
+		else
+		{
+			// officeId
+			String officeId = request.getParameter("officeId");
+			
+			// getting office
+			OfficeBO officeBO = null;
+			officeBO = ((OfficeBusinessService) getService()).getOffice(Short.valueOf(officeId));
+			Set clients = officeBO.getClients();
+			Iterator iter = clients.iterator();
+			while (iter.hasNext()) 
+			{
+				CustomerBO client = (CustomerBO) iter.next();
+				client.getCustomerId();
+				
+				// call method to reschedule loan and savings accounts
+				// we will reschedule only for center and clients which belong to this branch, because
+				// calling a reschedule on center will reschedule for it's corresponsding groups and clients
+				CustomerLevel customerLevel = client.getLevel();
+				Short id = customerLevel.getValue();
+				if(id == 3)
+					callRescsheduleLoanAndSavingsAccount(client, meetingForm, actionForm, officeId);
+				else if(id == 1)
+				{
+					// get moratorium parent of this client(i.e., group)
+					// if it's parent customer is null, then only we need to call reschdule, because
+					// a client without group belongs to branch and for a client belonging to a group
+					// we don't have to call reschedule, it is taken care by reschedule of center.
+					CustomerBO group = client.getParentCustomer();
+					if(group == null)
+						callRescsheduleLoanAndSavingsAccount(client, meetingForm, actionForm, officeId);
+				}				
+			}
+			
+			// save record to Moratorium table (refer holidayAction - update method)
+			MoratoriumBO moratoriumBO = new MoratoriumBO();
+			moratoriumBO.setAppliedTo(officeBO.getOfficeName());
+			moratoriumBO.setStartDate((Date) actionForm.getFromDate());
+			moratoriumBO.setEndDate((Date) actionForm.getEndDate());			
+			//moratoriumBO.setCreatedBy(createdBy);
+			moratoriumBO.setNotes(actionForm.getMoratoriumNotes());			
+			moratoriumBO.setOfficeId(officeId);
+			// commented for testing, uncomment later
+			moratoriumBO.save();
+		}
+		
+		return mapping.findForward("create_success");
+		
+	}
+	
+	@TransactionDemarcate(saveToken = true) // for links on configureBranchMoratorium.jsp
+	public ActionForward loadForBranch(ActionMapping mapping, ActionForm form,
+			HttpServletRequest request, HttpServletResponse response)
+			throws Exception {
+		
+		// officeId
+		String officeId = request.getParameter("officeId");
+		
+		if(officeId != null)
+		{
+			OfficeBO officeBO = null;
+			officeBO = ((OfficeBusinessService) getService()).getOffice(Short.valueOf(officeId));
+			
+			request.setAttribute("officeId", request.getParameter("officeId"));
+			SessionUtils.setAttribute(Constants.BUSINESS_KEY, officeBO, request);
+		}
+		
+        if (request.getParameter("perspective") != null) {
+            request.setAttribute("perspective", request.getParameter("perspective"));
+        }        	
+		
+        // get moratorium details for branch office and save it to session, so that 
+		// it can be used in actionForm for validation, i.e., overlapping of moratoriums
+		List moratoriumLst = getMoratoriumBizService().getMoratoriumByOfficeId(officeId);
+		// setting list of moratoriums in session			
+		//request.setAttribute("moratoriumLst", moratoriumLst);
+		//request.getSession().setAttribute("moratoriumLst", moratoriumLst);		
+		SessionUtils.setCollectionAttribute("moratoriumLst", moratoriumLst, request.getSession());
+        
+		return mapping.findForward("loadForBranch");
+	}
+	
+	
+	
+	private void callRescsheduleLoanAndSavingsAccount(CustomerBO client, MeetingActionForm meetingForm, MoratoriumActionForm actionForm, String officeId) throws Exception
+	{
+		// getting clientLevel >> it will decide type of client
+		// 3 stands for "center", 2 stands for "group" and 1 stands for "client"
+		CustomerLevel customerLevel = client.getLevel();
+		Short id = customerLevel.getValue();
+		if(id == 3)
+		{	
+			// get moratorium list for this center
+			List centerMoratoriumLst = getMoratoriumBizService().getMoratoriumByCustomerId(client.getCustomerId().toString());
+			
+			// get moratorium list for office, if officeId is given
+			if(officeId != null)
+			{				
+				List branchMoratoriumLst = getMoratoriumBizService().getMoratoriumByOfficeId(officeId);
+				centerMoratoriumLst.addAll(branchMoratoriumLst);
+			}
+			
+			// rescheduling for savings account of center(loan account is not applicable for center)
+			rescheduleLoanAndSavingsAccounts(client, meetingForm, actionForm, centerMoratoriumLst);
+			
+			// rescheduling for loan and savings account of groups under this center
+			Set groups = client.getChildren();
+			if(groups != null)
+			{
+				Iterator groupsIter = groups.iterator();
+				while (groupsIter.hasNext()) 
+				{
+					//ClientBO group = (ClientBO) groupsIter.next();
+					CustomerBO group = (CustomerBO) groupsIter.next();
+					
+					// get moratorium list for this group
+					List groupMoratoriumLst = getMoratoriumBizService().getMoratoriumByCustomerId(client.getCustomerId().toString());
+					groupMoratoriumLst.addAll(centerMoratoriumLst);
+					
+					rescheduleLoanAndSavingsAccounts(group, meetingForm, actionForm, groupMoratoriumLst);
+					
+					// rescheduling for loan and savings account of clients under this group
+					Set clients = group.getChildren();
+					if(clients != null)
+					{
+						Iterator clientsIter = clients.iterator();
+						while (clientsIter.hasNext()) 
+						{						
+							CustomerBO tempClient = (CustomerBO) clientsIter.next();
+							
+							// get moratorium list for this client
+							List clientMoratoriumLst = getMoratoriumBizService().getMoratoriumByCustomerId(client.getCustomerId().toString());
+							clientMoratoriumLst.addAll(groupMoratoriumLst);
+							
+							rescheduleLoanAndSavingsAccounts(tempClient, meetingForm, actionForm, clientMoratoriumLst);
+						}
+					}
+				}
+			}			
+		}
+		else if(id == 2)
+		{				
+			// get moratorium list for parent of this group(i.e., center)				
+			CustomerBO center = client.getParentCustomer();
+			List centerMoratoriumLst = new ArrayList();
+			if(center != null)
+				centerMoratoriumLst = getMoratoriumBizService().getMoratoriumByCustomerId(center.getCustomerId().toString());				
+			
+			// get moratorium list for office, if officeId is given
+			if(officeId != null)
+			{				
+				List branchMoratoriumLst = getMoratoriumBizService().getMoratoriumByOfficeId(officeId);
+				centerMoratoriumLst.addAll(branchMoratoriumLst);
+			}
+			
+			// get moratorium list for this group
+			List groupMoratoriumLst = getMoratoriumBizService().getMoratoriumByCustomerId(client.getCustomerId().toString());
+			
+			groupMoratoriumLst.addAll(centerMoratoriumLst);
+			
+			// rescheduling for loan and savings account of group
+			rescheduleLoanAndSavingsAccounts(client, meetingForm, actionForm, groupMoratoriumLst);
+			
+			// rescheduling for loan and savings account of clients under this group
+			Set clients = client.getChildren();
+			if(clients != null)
+			{
+				Iterator clientsIter = clients.iterator();
+				while (clientsIter.hasNext()) 
+				{
+					//ClientBO tempClient = (ClientBO) clientsIter.next();
+					CustomerBO tempClient = (CustomerBO) clientsIter.next();
+					
+					// get moratorium list for this client
+					List clientMoratoriumLst = getMoratoriumBizService().getMoratoriumByCustomerId(tempClient.getCustomerId().toString());
+					clientMoratoriumLst.addAll(groupMoratoriumLst);
+					
+					rescheduleLoanAndSavingsAccounts(tempClient, meetingForm, actionForm, clientMoratoriumLst);
+				}
+			}			
+		}
+		else
+		{				
+			// get moratorium list for this client
+			List clientMoratoriumLst = getMoratoriumBizService().getMoratoriumByCustomerId(client.getCustomerId().toString());
+			
+			// get moratorium list for office, if officeId is given
+			if(officeId != null)
+			{				
+				List branchMoratoriumLst = getMoratoriumBizService().getMoratoriumByOfficeId(officeId);
+				clientMoratoriumLst.addAll(branchMoratoriumLst);
+			}
+			
+			// get moratorium list for parent of this client(i.e., group)
+			CustomerBO group = client.getParentCustomer();
+			if(group != null)
+			{
+				clientMoratoriumLst.addAll(getMoratoriumBizService().getMoratoriumByCustomerId(group.getCustomerId().toString()));
+				
+				// get moratorium for the center
+				CustomerBO center = group.getParentCustomer();				
+				if(center != null)
+					clientMoratoriumLst.addAll(getMoratoriumBizService().getMoratoriumByCustomerId(center.getCustomerId().toString()));
+			}
+			
+			rescheduleLoanAndSavingsAccounts(client, meetingForm, actionForm, clientMoratoriumLst);
+		}
+	}
+	
+	private void rescheduleLoanAndSavingsAccounts(CustomerBO client, MeetingActionForm meetingForm, MoratoriumActionForm actionForm, List moratoriumList) throws Exception
+	{
+		// getting meeting details
+		if (client.getCustomerMeeting() != null) 
+		{				
+			MeetingBO meeting = getMeetingBusinessService().getMeeting(client.getCustomerMeeting().getMeeting().getMeetingId());
+			meeting.getMeetingId();				
+			setValuesInActionForm(meetingForm, meeting);
+		}
+		
+		//code for getting min date from moratorium list [start]
+		Date minDate = null;
+		Iterator iter = moratoriumList.iterator();
+		while (iter.hasNext()) 
+		{
+			MoratoriumBO moratoriumBO = (MoratoriumBO) iter.next();
+			if(minDate == null)
+				minDate = moratoriumBO.getStartDate();
+			else
+			{
+				if(DateUtils.getDateWithoutTimeStamp(moratoriumBO.getStartDate().getTime()).compareTo(DateUtils.getDateWithoutTimeStamp(minDate.getTime())) > 0)
+					minDate = moratoriumBO.getStartDate();
+			}
+		}
+		//code for getting min date from moratorium list [end]
+		
+		// code for rescheduling of loan repayment [start]
+		// getting open loan accounts
+		List loanAccounts = client.getOpenLoanAccounts();
+		Iterator loanAccountsIter = loanAccounts.iterator();
+		while (loanAccountsIter.hasNext()) 
+		{
+			LoanBO loanBO = (LoanBO) loanAccountsIter.next();
+			//Integer accountId = loanBO.getAccountId();
+			
+			// getting repayment schedule			
+			List modifiedInstallmentLst = new ArrayList();
+			
+			//Iterator modifiedInstallmentLstIter = modifiedInstallmentLst.iterator();
+			List totalInstallmentsLst = loanBO.getAllInstallments(); // of type LoanScheduleEntity
+			Iterator totalInstlIter = totalInstallmentsLst.iterator();
+			while (totalInstlIter.hasNext())
+			{					
+				LoanScheduleEntity obj = (LoanScheduleEntity) totalInstlIter.next();
+				
+				// store max date into temp variable (not required)
+				Date maxDate = null;
+				/*Iterator modifiedInstallmentLstIter = modifiedInstallmentLst.iterator();
+				while (modifiedInstallmentLstIter.hasNext()) 
+				{
+					LoanScheduleEntity tempObj = (LoanScheduleEntity) modifiedInstallmentLstIter.next();
+					if(maxDate == null)							
+						maxDate = tempObj.getActionDate();
+					else
+					{
+						if(DateUtils.getDateWithoutTimeStamp(tempObj.getActionDate().getTime()).compareTo(DateUtils.getDateWithoutTimeStamp(maxDate.getTime())) > 0)
+							maxDate = tempObj.getActionDate();
+					}
+					tempObj = null;
+				}
+				modifiedInstallmentLstIter = null;*/					
+				
+				// changing actionDate for loan repayment
+				// checking whether an installment is paid or not, and whether the installment date is less than moratorium start date,
+				// if installment date is greater than moratorium min date(from moratorium list) then only we need to reschedule the installment.
+				//if(!obj.isPaid() && !(DateUtils.getDateWithoutTimeStamp(obj.getActionDate().getTime()).compareTo(DateUtils.getDateWithoutTimeStamp(actionForm.getFromDate().getTime())) < 0))
+				if(minDate != null)
+				{
+					if(!obj.isPaid() && DateUtils.getDateWithoutTimeStamp(obj.getActionDate().getTime()).compareTo(DateUtils.getDateWithoutTimeStamp(minDate.getTime())) >= 0)
+					{													
+						Date newActionDate = null;
+						newActionDate = getNewActionDate(obj, meetingForm, actionForm, maxDate, moratoriumList);						
+						obj.setActionDate(newActionDate);
+						// commented for testing, uncomment later
+						//obj.save();
+					}
+				}
+				else if(minDate == null) // this means we are creating moratorium first time
+				{
+					if(!obj.isPaid() && DateUtils.getDateWithoutTimeStamp(obj.getActionDate().getTime()).compareTo(DateUtils.getDateWithoutTimeStamp(actionForm.getFromDate().getTime())) >= 0)
+					{													
+						Date newActionDate = null;
+						newActionDate = getNewActionDate(obj, meetingForm, actionForm, maxDate, moratoriumList);						
+						obj.setActionDate(newActionDate);
+						// commented for testing, uncomment later
+						//obj.save();
+					}
+				}
+				modifiedInstallmentLst.add(obj);
+				obj = null;
+			}				
+		}
+		// code for rescheduling of loan repayment [end]
+		
+		// code for rescheduling of savings account [start]
+		List savingsAccounts = client.getActiveSavingsAccounts();
+		Iterator savingsAccountsIter = savingsAccounts.iterator();
+		while (savingsAccountsIter.hasNext())
+		{
+			SavingsBO savingsBO = (SavingsBO) savingsAccountsIter.next();
+			List modifiedSavingsInstallmentLst = new ArrayList();
+			
+			List totalInstallmentsLst = savingsBO.getAllInstallments(); // of type SavingsScheduleEntity
+			Iterator totalInstlIter = totalInstallmentsLst.iterator();
+			while (totalInstlIter.hasNext())
+			{
+				SavingsScheduleEntity obj = (SavingsScheduleEntity) totalInstlIter.next();
+				
+				// store max date into temp variable (not required)
+				Date maxDate = null;
+				Iterator modifiedSavingsInstallmentLstIter = modifiedSavingsInstallmentLst.iterator();
+				while (modifiedSavingsInstallmentLstIter.hasNext()) 
+				{
+					SavingsScheduleEntity tempObj = (SavingsScheduleEntity) modifiedSavingsInstallmentLstIter.next();
+					if(maxDate == null)							
+						maxDate = tempObj.getActionDate();
+					else
+					{
+						if(DateUtils.getDateWithoutTimeStamp(tempObj.getActionDate().getTime()).compareTo(DateUtils.getDateWithoutTimeStamp(maxDate.getTime())) > 0)
+							maxDate = tempObj.getActionDate();
+					}
+					tempObj = null;
+				}
+				modifiedSavingsInstallmentLstIter = null;	
+				
+				if(!obj.isPaid() && DateUtils.getDateWithoutTimeStamp(obj.getActionDate().getTime()).compareTo(DateUtils.getDateWithoutTimeStamp(minDate.getTime())) >= 0)
+				{													
+					Date newActionDate = null;
+					newActionDate = getNewActionDate(obj, meetingForm, actionForm, maxDate, moratoriumList);						
+					obj.setActionDate(newActionDate);
+					// commented for testing, uncomment later
+					//obj.save();
+				}
+				modifiedSavingsInstallmentLst.add(obj);
+				obj = null;
+			}
+		}
+		// code for rescheduling of savings account [end]
+	}
+	
+	private Date getNewActionDate(Object obj, MeetingActionForm meetingForm, MoratoriumActionForm actionForm, Date maxDate, List moratoriumList)
+	{
+		Calendar cal = new GregorianCalendar();
+		//Date actionDate = obj.getActionDate();
+		Date actionDate = null;
+		Date newActionDate = null;
+		
+		if (obj instanceof LoanScheduleEntity)
+		{
+			LoanScheduleEntity newObj = (LoanScheduleEntity) obj;
+			actionDate = newObj.getActionDate();
+		}
+		else if(obj instanceof SavingsScheduleEntity)
+		{
+			SavingsScheduleEntity newObj = (SavingsScheduleEntity) obj;
+			actionDate = newObj.getActionDate();
+		}
+		
+		cal.setTime(actionDate);
+		
+		// if we are creating moratorium for first time
+		if(moratoriumList == null || moratoriumList.size() == 0)
+		{
+			if(meetingForm.getFrequency().equals("1")) // this indicates that meeting is weekly
+			{
+				int recurWeek;
+				meetingForm.getWeekDay();
+				recurWeek = Integer.parseInt(meetingForm.getRecurWeek());							
+				recurWeek = recurWeek * 7;
+				Long newDay = Long.parseLong(recurWeek + "");							
+				newActionDate = new java.sql.Date(actionDate.getTime() + newDay*24*60*60*1000L);
+				
+				// comparing with moratorium end date 
+				while (DateUtils.getDateWithoutTimeStamp(newActionDate.getTime()).compareTo(DateUtils.getDateWithoutTimeStamp(actionForm.getEndDate().getTime())) <= 0) 
+				{
+					newActionDate = new java.sql.Date(actionDate.getTime() + newDay*24*60*60*1000L);
+				}
+				
+				// comparing with max date
+				/*while (DateUtils.getDateWithoutTimeStamp(newActionDate.getTime()).compareTo(DateUtils.getDateWithoutTimeStamp(maxDate.getTime())) <= 0) 
+				{
+					newActionDate = new java.sql.Date(actionDate.getTime() + newDay*24*60*60*1000L);
+				}*/
+				System.out.println("newActionDate >> " + newActionDate);
+			}
+			else if(meetingForm.getFrequency().equals("2")) // this indicates that meeting is monthly
+			{
+				int monthInterval;
+				int weekInMonth;
+				int dayInWeek;
+				
+				if(meetingForm.getMonthType().equals("1")) // this indicates specific date of specific month
+				{
+					monthInterval = meetingForm.getDayRecurMonthValue();
+					System.out.println("before roll over >> " + cal.getTime());
+					cal.roll(Calendar.MONTH, monthInterval);
+					System.out.println("after roll over >> " + cal.getTime());
+					
+					System.out.println("cal.getTime().getTime() >> " + cal.getTime().getTime());
+					newActionDate = new java.sql.Date(cal.getTime().getTime());
+					
+					
+					// comparing with moratorium end date 
+					while (DateUtils.getDateWithoutTimeStamp(newActionDate.getTime()).compareTo(DateUtils.getDateWithoutTimeStamp(actionForm.getEndDate().getTime())) <= 0) 
+					{
+						cal.roll(Calendar.MONTH, monthInterval);
+						newActionDate = new java.sql.Date(cal.getTime().getTime());
+					}
+					
+					// comparing with max date
+					/*while (DateUtils.getDateWithoutTimeStamp(newActionDate.getTime()).compareTo(DateUtils.getDateWithoutTimeStamp(maxDate.getTime())) <= 0) 
+					{
+						cal.roll(Calendar.MONTH, monthInterval);
+						newActionDate = new java.sql.Date(cal.getTime().getTime());
+					}*/								
+					System.out.println("newActionDate >> " + newActionDate);
+				}
+				else // this indicates specific day, specific week and specific month
+				{
+					monthInterval = meetingForm.getRecurMonthValue();
+					weekInMonth = Integer.parseInt(meetingForm.getMonthRank());
+					dayInWeek = Integer.parseInt(meetingForm.getMonthWeek());
+					
+					System.out.println("before roll over >> " + cal.getTime());
+					cal.roll(Calendar.MONTH, monthInterval);
+					System.out.println("after month roll over >> " + cal.getTime());
+					cal.roll(Calendar.WEEK_OF_MONTH, weekInMonth);
+					System.out.println("after week roll over >> " + cal.getTime());
+					// Rolling of WEEK_OF_MONTH will take to last day of previous week
+					// So need to add one more day to step into next week
+					cal.roll(Calendar.DAY_OF_MONTH,1);
+					System.out.println("after day roll over(of month) by 1 >> " + cal.getTime());
+					cal.roll(Calendar.DAY_OF_WEEK,dayInWeek);
+					System.out.println("after day roll over(of week) >> " + cal.getTime());
+					
+					newActionDate = new java.sql.Date(cal.getTime().getTime());
+													
+					// comparing with moratorium end date 
+					while (DateUtils.getDateWithoutTimeStamp(newActionDate.getTime()).compareTo(DateUtils.getDateWithoutTimeStamp(actionForm.getEndDate().getTime())) <= 0) 
+					{
+						// code for roll over of new "action date", until it becomes greater than
+						// "moratorium end date".									
+						cal.roll(Calendar.MONTH, monthInterval);									
+						cal.roll(Calendar.WEEK_OF_MONTH, weekInMonth);									
+						// Rolling of WEEK_OF_MONTH will take to last day of previous week
+						// So need to add one more day to step into next week
+						cal.roll(Calendar.DAY_OF_MONTH,1);									
+						cal.roll(Calendar.DAY_OF_WEEK,dayInWeek);									
+						
+						newActionDate = new java.sql.Date(cal.getTime().getTime());
+					}
+					
+					// comparing with max date
+					/*while (DateUtils.getDateWithoutTimeStamp(newActionDate.getTime()).compareTo(DateUtils.getDateWithoutTimeStamp(maxDate.getTime())) <= 0) 
+					{
+						// code for roll over of new "action date", until it becomes greater than
+						// "max date".
+						cal.roll(Calendar.MONTH, monthInterval);									
+						cal.roll(Calendar.WEEK_OF_MONTH, weekInMonth);									
+						// Rolling of WEEK_OF_MONTH will take to last day of previous week
+						// So need to add one more day to step into next week
+						cal.roll(Calendar.DAY_OF_MONTH,1);									
+						cal.roll(Calendar.DAY_OF_WEEK,dayInWeek);									
+						
+						newActionDate = new java.sql.Date(cal.getTime().getTime());
+					}*/								
+					System.out.println("newActionDate >> " + newActionDate);
+				}
+			}			
+		}
+		else
+		{
+			if(meetingForm.getFrequency().equals("1")) // this indicates that meeting is weekly
+			{
+				int recurWeek;
+				meetingForm.getWeekDay();
+				recurWeek = Integer.parseInt(meetingForm.getRecurWeek());							
+				recurWeek = recurWeek * 7;
+				Long newDay = Long.parseLong(recurWeek + "");							
+				newActionDate = new java.sql.Date(actionDate.getTime() + newDay*24*60*60*1000L);
+				
+				while (isBetween(newActionDate, moratoriumList))
+				{
+					newActionDate = new java.sql.Date(actionDate.getTime() + newDay*24*60*60*1000L);
+				}
+				
+				// comparing with max date
+				/*while (DateUtils.getDateWithoutTimeStamp(newActionDate.getTime()).compareTo(DateUtils.getDateWithoutTimeStamp(maxDate.getTime())) <= 0) 
+				{
+					newActionDate = new java.sql.Date(actionDate.getTime() + newDay*24*60*60*1000L);
+				}*/
+				System.out.println("newActionDate >> " + newActionDate);
+			}
+			else if(meetingForm.getFrequency().equals("2")) // this indicates that meeting is monthly
+			{
+				int monthInterval;
+				int weekInMonth;
+				int dayInWeek;
+				
+				if(meetingForm.getMonthType().equals("1")) // this indicates specific date of specific month
+				{
+					monthInterval = meetingForm.getDayRecurMonthValue();
+					System.out.println("before roll over >> " + cal.getTime());
+					cal.roll(Calendar.MONTH, monthInterval);
+					System.out.println("after roll over >> " + cal.getTime());
+					
+					System.out.println("cal.getTime().getTime() >> " + cal.getTime().getTime());
+					newActionDate = new java.sql.Date(cal.getTime().getTime());
+					
+					
+					// comparing with moratorium end date 
+					while (isBetween(newActionDate, moratoriumList)) 
+					{
+						cal.roll(Calendar.MONTH, monthInterval);
+						newActionDate = new java.sql.Date(cal.getTime().getTime());
+					}
+					
+					// comparing with max date
+					/*while (DateUtils.getDateWithoutTimeStamp(newActionDate.getTime()).compareTo(DateUtils.getDateWithoutTimeStamp(maxDate.getTime())) <= 0) 
+					{
+						cal.roll(Calendar.MONTH, monthInterval);
+						newActionDate = new java.sql.Date(cal.getTime().getTime());
+					}*/								
+					System.out.println("newActionDate >> " + newActionDate);
+				}
+				else // this indicates specific day, specific week and specific month
+				{
+					monthInterval = meetingForm.getRecurMonthValue();
+					weekInMonth = Integer.parseInt(meetingForm.getMonthRank());
+					dayInWeek = Integer.parseInt(meetingForm.getMonthWeek());
+					
+					System.out.println("before roll over >> " + cal.getTime());
+					cal.roll(Calendar.MONTH, monthInterval);
+					System.out.println("after month roll over >> " + cal.getTime());
+					cal.roll(Calendar.WEEK_OF_MONTH, weekInMonth);
+					System.out.println("after week roll over >> " + cal.getTime());
+					// Rolling of WEEK_OF_MONTH will take to last day of previous week
+					// So need to add one more day to step into next week
+					cal.roll(Calendar.DAY_OF_MONTH,1);
+					System.out.println("after day roll over(of month) by 1 >> " + cal.getTime());
+					cal.roll(Calendar.DAY_OF_WEEK,dayInWeek);
+					System.out.println("after day roll over(of week) >> " + cal.getTime());
+					
+					newActionDate = new java.sql.Date(cal.getTime().getTime());
+													
+					// comparing with moratorium end date 
+					while (isBetween(newActionDate, moratoriumList)) 
+					{
+						// code for roll over of new "action date", until it becomes greater than
+						// "moratorium end date".									
+						cal.roll(Calendar.MONTH, monthInterval);									
+						cal.roll(Calendar.WEEK_OF_MONTH, weekInMonth);									
+						// Rolling of WEEK_OF_MONTH will take to last day of previous week
+						// So need to add one more day to step into next week
+						cal.roll(Calendar.DAY_OF_MONTH,1);									
+						cal.roll(Calendar.DAY_OF_WEEK,dayInWeek);									
+						
+						newActionDate = new java.sql.Date(cal.getTime().getTime());
+					}
+					
+					// comparing with max date
+					/*while (DateUtils.getDateWithoutTimeStamp(newActionDate.getTime()).compareTo(DateUtils.getDateWithoutTimeStamp(maxDate.getTime())) <= 0) 
+					{
+						// code for roll over of new "action date", until it becomes greater than
+						// "max date".
+						cal.roll(Calendar.MONTH, monthInterval);									
+						cal.roll(Calendar.WEEK_OF_MONTH, weekInMonth);									
+						// Rolling of WEEK_OF_MONTH will take to last day of previous week
+						// So need to add one more day to step into next week
+						cal.roll(Calendar.DAY_OF_MONTH,1);									
+						cal.roll(Calendar.DAY_OF_WEEK,dayInWeek);									
+						
+						newActionDate = new java.sql.Date(cal.getTime().getTime());
+					}*/								
+					System.out.println("newActionDate >> " + newActionDate);
+				}
+			}
+		}
+		return newActionDate;
+	}
+	
+	private boolean isBetween(Date newActionDate, List moratoriumLst)
+	{
+		boolean result = false;
+		Iterator iter = moratoriumLst.iterator();
+		while (iter.hasNext()) 
+		{
+			MoratoriumBO moratoriumBO = (MoratoriumBO) iter.next();
+			if(DateUtils.getDateWithoutTimeStamp(newActionDate.getTime()).compareTo(DateUtils.getDateWithoutTimeStamp(moratoriumBO.getStartDate().getTime())) >= 0 && DateUtils.getDateWithoutTimeStamp(newActionDate.getTime()).compareTo(DateUtils.getDateWithoutTimeStamp(moratoriumBO.getEndDate().getTime())) <= 0)
+			{
+				result = true;
+				break;
+			}			
+		}
+		
+		return result;
+	}
+	
+	private void cleanUpSearch(HttpServletRequest request) throws PageExpiredException
+	{
+		SessionUtils.setRemovableAttribute("TableCache",null,TableTagConstants.PATH,request.getSession());
+		SessionUtils.setRemovableAttribute("current",null,TableTagConstants.PATH,request.getSession());
+		SessionUtils.setRemovableAttribute("meth",null,TableTagConstants.PATH,request.getSession());
+		SessionUtils.setRemovableAttribute("forwardkey",null,TableTagConstants.PATH,request.getSession());
+		SessionUtils.setRemovableAttribute("action",null,TableTagConstants.PATH,request.getSession());
+		SessionUtils.removeAttribute(Constants.SEARCH_RESULTS,request);
+	}
+	
+	@TransactionDemarcate (joinToken = true)
+	public ActionForward validate(ActionMapping mapping, ActionForm form,
+			HttpServletRequest request, HttpServletResponse response)
+			throws Exception {
+		String method = (String) request.getAttribute("methodCalled");
+		String forward = null;
+		if (method != null) 
+		{
+			if (method.equals("create"))
+			{
+				String officeId = request.getParameter("officeId");
+				if(officeId == null)
+					forward = "previewCreateMoratorium_failure";
+				else
+					forward = "previewCreateBranchMoratorium_failure";
+			}
+			else if(method.equals("editPreview"))
+				forward = "editPreviewMoratorium_failure";
+		}
+		return mapping.findForward(forward);
+	}
+	
+	private ClientBusinessService getClientBusinessService() {
+		return (ClientBusinessService) ServiceFactory.getInstance()
+				.getBusinessService(BusinessServiceName.Client);
+	}
+	
+	private MeetingBusinessService getMeetingBusinessService()
+			throws ServiceException {
+		return new MeetingBusinessService();
+	}
+	
+	private void setValuesInActionForm(MeetingActionForm form, MeetingBO meeting) {
+		if (meeting.isWeekly()) {
+			form.setFrequency(RecurrenceType.WEEKLY.getValue().toString());
+			form.setWeekDay(meeting.getMeetingDetails().getWeekDay().getValue()
+					.toString());
+			form.setRecurWeek(meeting.getMeetingDetails().getRecurAfter()
+					.toString());
+		} else if (meeting.isMonthly()) {
+			form.setFrequency(RecurrenceType.MONTHLY.getValue().toString());
+			if (meeting.isMonthlyOnDate()) {
+				form.setMonthType("1");
+				form.setDayRecurMonth(meeting.getMeetingDetails()
+						.getRecurAfter().toString());
+				form.setMonthDay(meeting.getMeetingDetails().getDayNumber()
+						.toString());
+			} else {
+				form.setMonthType("2");
+				form.setRecurMonth(meeting.getMeetingDetails().getRecurAfter()
+						.toString());
+				form.setMonthWeek(meeting.getMeetingDetails().getWeekDay()
+						.getValue().toString());
+				form.setMonthRank(meeting.getMeetingDetails().getWeekRank()
+						.getValue().toString());
+			}
+		}
+		form.setMeetingPlace(meeting.getMeetingPlace());
+	}
+	
+	private List<OfficeBO> getOffice(List<OfficeBO> officeList,
+			OfficeLevel officeLevel) throws Exception {
+		if (officeList != null) {
+			List<OfficeBO> newOfficeList = new ArrayList<OfficeBO>();
+			for (OfficeBO officeBO : officeList) {
+				if (officeBO.getOfficeLevel().equals(officeLevel)) {
+					newOfficeList.add(officeBO);
+				}
+			}
+			if (newOfficeList.isEmpty())
+				return null;
+			return newOfficeList;
+		}
+		return null;
+	}
+	
+	private List<OfficeBO> getOffices(UserContext userContext,
+			List<OfficeBO> officeList) throws Exception {
+		if (officeList != null) {
+			for (OfficeBO officeBO : officeList) {
+				officeBO.getLevel().setLocaleId(userContext.getLocaleId());
+				officeBO.getStatus().setLocaleId(userContext.getLocaleId());
+			}
+		}
+		return officeList;
+	}
+	
+	private void loadofficeLevels(HttpServletRequest request) throws Exception {
+		SessionUtils.setCollectionAttribute(OfficeConstants.OFFICELEVELLIST,
+				((OfficeBusinessService) getService())
+						.getConfiguredLevels(getUserContext(request)
+								.getLocaleId()), request);
+	}
+	
+	/*private void setValuesInActionForm(MeetingActionForm form, MeetingBO meeting) {		
+		form.setFrequency(RecurrenceType.MONTHLY.getValue().toString());
+		form.setMonthType("1");
+		form.setDayRecurMonth(String.valueOf(2));
+		form.setMonthDay(String.valueOf(10));			 		
+		form.setMeetingPlace(meeting.getMeetingPlace());
+	}*/
+	/*private void setValuesInActionForm(MeetingActionForm form, MeetingBO meeting) {		
+		form.setFrequency(RecurrenceType.MONTHLY.getValue().toString());
+		form.setMonthType("2");
+		form.setRecurMonth("2");
+		form.setMonthWeek("2");
+		form.setMonthRank("2");
+		form.setMeetingPlace(meeting.getMeetingPlace());
+	}*/
+}
Index: src/org/mifos/application/moratorium/struts/action/MoratoriumAction.java
===================================================================
--- src/org/mifos/application/moratorium/struts/action/MoratoriumAction.java	(revision 0)
+++ src/org/mifos/application/moratorium/struts/action/MoratoriumAction.java	(revision 0)
@@ -0,0 +1,1232 @@
+package org.mifos.application.moratorium.struts.action;
+
+import java.sql.Date;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.GregorianCalendar;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.struts.action.ActionForm;
+import org.apache.struts.action.ActionForward;
+import org.apache.struts.action.ActionMapping;
+import org.mifos.application.accounts.loan.business.LoanBO;
+import org.mifos.application.accounts.loan.business.LoanScheduleEntity;
+import org.mifos.application.accounts.savings.business.SavingsBO;
+import org.mifos.application.accounts.savings.business.SavingsScheduleEntity;
+import org.mifos.application.customer.business.CustomerBO;
+import org.mifos.application.customer.client.business.ClientBO;
+import org.mifos.application.customer.client.business.service.ClientBusinessService;
+import org.mifos.application.customer.util.helpers.CustomerLevel;
+import org.mifos.application.meeting.business.MeetingBO;
+import org.mifos.application.meeting.business.service.MeetingBusinessService;
+import org.mifos.application.meeting.struts.actionforms.MeetingActionForm;
+import org.mifos.application.meeting.util.helpers.RecurrenceType;
+import org.mifos.application.moratorium.business.MoratoriumBO;
+import org.mifos.application.moratorium.business.service.MoratoriumBusinessService;
+import org.mifos.application.moratorium.struts.actionforms.MoratoriumActionForm;
+import org.mifos.application.office.business.OfficeBO;
+import org.mifos.application.office.business.service.OfficeBusinessService;
+import org.mifos.application.office.util.helpers.OfficeLevel;
+import org.mifos.application.office.util.resources.OfficeConstants;
+import org.mifos.application.util.helpers.ActionForwards;
+import org.mifos.framework.business.service.BusinessService;
+import org.mifos.framework.business.service.ServiceFactory;
+import org.mifos.framework.components.tabletag.TableTagConstants;
+import org.mifos.framework.exceptions.PageExpiredException;
+import org.mifos.framework.exceptions.ServiceException;
+import org.mifos.framework.security.util.ActionSecurity;
+import org.mifos.framework.security.util.UserContext;
+import org.mifos.framework.security.util.resources.SecurityConstants;
+import org.mifos.framework.struts.action.BaseAction;
+import org.mifos.framework.util.helpers.BusinessServiceName;
+import org.mifos.framework.util.helpers.Constants;
+import org.mifos.framework.util.helpers.DateUtils;
+import org.mifos.framework.util.helpers.SessionUtils;
+import org.mifos.framework.util.helpers.TransactionDemarcate;
+
+public class MoratoriumAction extends BaseAction{
+	
+	@Override
+	protected BusinessService getService() throws ServiceException {
+		return ServiceFactory.getInstance().getBusinessService(
+				BusinessServiceName.Office);
+	}
+	
+	@Override
+	protected boolean skipActionFormToBusinessObjectConversion(String method) {
+		return true;
+	}
+	
+	public static ActionSecurity getSecurity() {
+		ActionSecurity security = new ActionSecurity("moratoriumAction");
+		security.allow("configure", SecurityConstants.VIEW);
+		security.allow("load", SecurityConstants.VIEW);		
+		security.allow("loadSearch", SecurityConstants.VIEW);		
+		security.allow("edit",SecurityConstants.VIEW);
+		security.allow("cancelCreate", SecurityConstants.VIEW);
+		security.allow("cancelUpdate", SecurityConstants.VIEW);
+		security.allow("create", SecurityConstants.VIEW);
+		security.allow("get", SecurityConstants.VIEW);
+		security.allow("edit", SecurityConstants.VIEW);
+		security.allow("editPreview", SecurityConstants.VIEW);
+		security.allow("updateMoratorium", SecurityConstants.VIEW);
+		security.allow("createConfirmed", SecurityConstants.VIEW);
+		security.allow("previous", SecurityConstants.VIEW);
+		security.allow("previousEdit", SecurityConstants.VIEW);
+		security.allow("loadForBranch", SecurityConstants.VIEW);		
+		return security;
+	}			
+	
+	
+	// for edit moratorium screen
+	@TransactionDemarcate(joinToken = true)
+	public ActionForward edit(ActionMapping mapping, ActionForm form,
+			HttpServletRequest request, HttpServletResponse response) throws Exception{
+		
+		//UserContext userContext = (UserContext) SessionUtils.getAttribute(Constants.USER_CONTEXT_KEY, request.getSession());
+		MoratoriumActionForm actionForm = (MoratoriumActionForm) form;
+		
+		if (null != request.getParameter(Constants.CURRENTFLOWKEY))
+			request.setAttribute(Constants.CURRENTFLOWKEY, request.getParameter("currentFlowKey"));
+		
+		// get customerId, moratoriumId and officeId from request
+		String moratoriumId = null;
+		String customerId = null;
+		String officeId = null;
+		if(null != request.getParameter("moratoriumId"))
+			moratoriumId = request.getParameter("moratoriumId");
+		if(null != request.getParameter("customerId"))
+			customerId = request.getParameter("customerId");
+		if(null != request.getParameter("officeId"))
+			officeId = request.getParameter("officeId");
+		
+		// get moratorium details for client/branch and save it to session, so that 
+		// it can be used in actionForm for validation, i.e., overlapping of moratoriums
+		List moratoriumList = new ArrayList<MoratoriumBO>();
+		if(officeId != null)
+			moratoriumList = getMoratoriumBizService().getMoratoriumByOfficeId(officeId);
+		else
+			moratoriumList = getMoratoriumBizService().getMoratoriumByCustomerId(customerId);
+		// setting list of moratoriums in session
+		SessionUtils.setCollectionAttribute("moratoriumLst", moratoriumList, request.getSession());
+		
+		try 
+		{
+			// get moratorium corresponding to the moratoriumId
+			List moratoriumLst = getMoratoriumBizService().getMoratoriumById(moratoriumId);
+			
+			Iterator iter = moratoriumLst.iterator();
+			if (iter.hasNext()) 
+			{
+				MoratoriumBO moratoriumBO = (MoratoriumBO) iter.next();
+				
+				// setting moratoriumBO in session, so that it can be used in the jsp page(editMoratoriums.jsp)
+				SessionUtils.setAttribute(Constants.BUSINESS_KEY, moratoriumBO, request);
+				
+				// setting values of action form
+				Calendar fromDateCalendar = new GregorianCalendar();
+				fromDateCalendar.setTimeInMillis(moratoriumBO.getStartDate().getTime());
+				int fromYear = fromDateCalendar.get(Calendar.YEAR);
+				int fromMonth = fromDateCalendar.get(Calendar.MONTH) + 1;
+				int fromDay = fromDateCalendar.get(Calendar.DAY_OF_MONTH);
+				
+				Calendar endDateCalendar = new GregorianCalendar();
+				endDateCalendar.setTimeInMillis(moratoriumBO.getEndDate().getTime());
+				int endYear = endDateCalendar.get(Calendar.YEAR);
+				int endMonth = endDateCalendar.get(Calendar.MONTH) + 1;
+				int endDay = endDateCalendar.get(Calendar.DAY_OF_MONTH);
+								
+				//actionForm.setFromDate(moratoriumBO.getStartDate());
+				//actionForm.setEndDate(moratoriumBO.getEndDate());
+				actionForm.setMoratoriumFromDateDD(String.valueOf(fromDay));
+				actionForm.setMoratoriumFromDateMM(String.valueOf(fromMonth));
+				actionForm.setMoratoriumFromDateYY(String.valueOf(fromYear));
+				actionForm.setMoratoriumEndDateDD(String.valueOf(endDay));
+				actionForm.setMoratoriumEndDateMM(String.valueOf(endMonth));
+				actionForm.setMoratoriumEndDateYY(String.valueOf(endYear));
+				actionForm.setMoratoriumNotes(moratoriumBO.getNotes());
+			}
+		}
+		catch (ServiceException e) 
+		{
+			throw new RuntimeException(e);
+		}
+		
+		return mapping.findForward(ActionForwards.edit_success.toString());		
+	}
+	
+	//for edit preview screen
+	@TransactionDemarcate(joinToken = true)
+	public ActionForward editPreview(ActionMapping mapping, ActionForm form,
+			HttpServletRequest request, HttpServletResponse response) throws Exception{
+		
+		MoratoriumActionForm actionForm = (MoratoriumActionForm) form;
+		
+		if (null != request.getParameter(Constants.CURRENTFLOWKEY))
+			request.setAttribute(Constants.CURRENTFLOWKEY, request.getParameter("currentFlowKey"));
+		
+		// get officeId from request
+		String officeId = null;
+		if(null != request.getParameter("officeId"))
+		{
+			officeId = request.getParameter("officeId");
+			// setting officeId in action form, so that it can be used in updateMoratorium() method
+			actionForm.setOfficeId(officeId);
+		}
+		
+		// get moratoriumId from request
+		String moratoriumId = null;		
+		if(null != request.getParameter("moratoriumId"))
+		{
+			moratoriumId = request.getParameter("moratoriumId");
+			// setting moratoriumId in action form, so that it can be used in updateMoratorium() method
+			actionForm.setMoratoriumId(moratoriumId);
+		}
+		
+		try 
+		{
+			// get moratorium corresponding to the moratoriumId
+			List moratoriumLst = getMoratoriumBizService().getMoratoriumById(moratoriumId);
+			
+			Iterator iter = moratoriumLst.iterator();
+			if (iter.hasNext()) 
+			{
+				MoratoriumBO moratoriumBO = (MoratoriumBO) iter.next();
+				
+				// setting moratoriumBO in session, so that it can be used in the jsp page(editMoratoriumsPreview.jsp)
+				SessionUtils.setAttribute(Constants.BUSINESS_KEY, moratoriumBO, request);
+			}
+		}
+		catch (ServiceException e) 
+		{
+			throw new RuntimeException(e);
+		}
+		
+		return mapping.findForward(ActionForwards.editpreview_success.toString());		
+	}
+	
+	// for update moratorium from "edit preview screen"
+	@TransactionDemarcate(joinToken = true)
+	public ActionForward updateMoratorium(ActionMapping mapping, ActionForm form,
+			HttpServletRequest request, HttpServletResponse response) throws Exception{
+		
+		MoratoriumActionForm actionForm = (MoratoriumActionForm) form;
+		MeetingActionForm meetingForm = new MeetingActionForm();
+		
+		if (null != request.getParameter(Constants.CURRENTFLOWKEY))
+			request.setAttribute(Constants.CURRENTFLOWKEY, request.getParameter("currentFlowKey"));
+		
+		// get moratoriumId from request
+		String moratoriumId = null;		
+		if(null != actionForm.getMoratoriumId())
+			moratoriumId = actionForm.getMoratoriumId();		
+		
+		try 
+		{
+			// get moratorium corresponding to the moratoriumId
+			List moratoriumLst = getMoratoriumBizService().getMoratoriumById(moratoriumId);
+			
+			Iterator iter = moratoriumLst.iterator();
+			if (iter.hasNext()) 
+			{
+				MoratoriumBO moratoriumBO = (MoratoriumBO) iter.next();
+				
+				// updating moratoriumBO object and saving it to database
+				moratoriumBO.setEndDate((Date) actionForm.getEndDate());
+				moratoriumBO.save();
+												
+				if(actionForm.getOfficeId() != null)
+				{
+					// officeId
+					String officeId = actionForm.getOfficeId();
+					// getting office
+					OfficeBO officeBO = null;
+					officeBO = ((OfficeBusinessService) getService()).getOffice(Short.valueOf(officeId));
+					Set clients = officeBO.getClients();
+					if(clients != null)
+					{
+						Iterator clientsIter = clients.iterator();
+						while (clientsIter.hasNext()) 
+						{
+							CustomerBO client = (CustomerBO) clientsIter.next();
+							client.getCustomerId();
+							
+							// call method to reschedule loan and savings accounts
+							// we will reschedule only for center and clients which belong to this branch, because
+							// calling a reschedule on center will reschedule for it's corresponsding groups and clients
+							CustomerLevel customerLevel = client.getLevel();
+							Short id = customerLevel.getValue();
+							if(id == 3)
+								callRescsheduleLoanAndSavingsAccount(client, meetingForm, actionForm, officeId);
+							else if(id == 1)
+							{
+								// get moratorium parent of this client(i.e., group)
+								// if it's parent customer is null, then only we need to call reschdule, because
+								// a client without group belongs to branch and for a client belonging to a group
+								// we don't have to call reschedule, it is taken care by reschedule of center.
+								CustomerBO group = client.getParentCustomer();
+								if(group == null)
+									callRescsheduleLoanAndSavingsAccount(client, meetingForm, actionForm, officeId);
+							}
+						}
+					}					
+				}
+				else
+				{
+					// getting customer			
+					CustomerBO client = getClientBusinessService().getClient(getIntegerValue(moratoriumBO.getCustomerId()));
+					
+					// call method to reschedule loan and savings accounts
+					callRescsheduleLoanAndSavingsAccount(client, meetingForm, actionForm, null);
+				}
+			}
+		}
+		catch (ServiceException e) 
+		{
+			throw new RuntimeException(e);
+		}
+		
+		return mapping.findForward(ActionForwards.update_success.toString());		
+	}
+	
+	// for edit screen when ctrl is coming from editMoratoriumsPreview.jsp
+	@TransactionDemarcate(joinToken = true)
+	public ActionForward previousEdit(ActionMapping mapping, ActionForm form,
+			HttpServletRequest request, HttpServletResponse response)
+			throws Exception {
+		
+		if (null != request.getParameter(Constants.CURRENTFLOWKEY))
+			request.setAttribute(Constants.CURRENTFLOWKEY, request.getParameter("currentFlowKey"));
+		
+		return mapping.findForward("edit_previous_success");
+	}
+	
+	// for view moratorium screen
+	@TransactionDemarcate(saveToken = true)
+	public ActionForward get(ActionMapping mapping, ActionForm form,
+			HttpServletRequest request, HttpServletResponse response) throws Exception{
+		
+		if (null != request.getParameter(Constants.CURRENTFLOWKEY))
+			request.setAttribute(Constants.CURRENTFLOWKEY, request.getParameter("currentFlowKey"));
+		
+		try 
+		{
+			List activeMoratoriums = new ArrayList();
+			List closedMoratoriums = new ArrayList();
+			List moratoriumLst = getMoratoriumBizService().getMoratoriums();
+			
+			Iterator iter = moratoriumLst.iterator();
+			while (iter.hasNext()) 
+			{
+				MoratoriumBO moratoriumBO = (MoratoriumBO) iter.next();
+				if(moratoriumBO.getLiftDate() == null)
+				{
+					// clarification is required from community
+					if(DateUtils.getDateWithoutTimeStamp(moratoriumBO.getEndDate().getTime()).compareTo(DateUtils.getCurrentDateWithoutTimeStamp()) < 0)
+						closedMoratoriums.add(moratoriumBO);
+					else
+						activeMoratoriums.add(moratoriumBO);
+					
+					//activeMoratoriums.add(moratoriumBO); // remove after getting clarification
+				}
+				else
+					closedMoratoriums.add(moratoriumBO);
+			}
+			// setting list of moratoriums in session			
+			request.setAttribute("openMoratoriums", activeMoratoriums);
+			request.setAttribute("closedMoratoriums", closedMoratoriums);
+		}
+		catch (ServiceException e) 
+		{
+			throw new RuntimeException(e);
+		}
+		
+		return mapping.findForward(ActionForwards.get_success.toString());		
+	}
+	
+	// for edit screen when ctrl is coming from applyMoratoriumConfirm.jsp or applyBranchMoratoriumConfirm.jsp
+	@TransactionDemarcate(joinToken = true)
+	public ActionForward previous(ActionMapping mapping, ActionForm form,
+			HttpServletRequest request, HttpServletResponse response)
+			throws Exception {
+		
+		if (null != request.getParameter(Constants.CURRENTFLOWKEY))
+			request.setAttribute(Constants.CURRENTFLOWKEY, request.getParameter("currentFlowKey"));
+		
+		String officeId = request.getParameter("officeId");
+		if(officeId == null)
+			return mapping.findForward(ActionForwards.previous_success.toString());
+		else
+			return mapping.findForward("previous_success_for_branch");
+	}
+	
+	private MoratoriumBusinessService getMoratoriumBizService() {
+		return new MoratoriumBusinessService();
+	}
+	
+	public ActionForward configure(ActionMapping mapping, ActionForm form,
+			HttpServletRequest request, HttpServletResponse response)
+			throws Exception {
+		
+		return mapping.findForward("configure");
+	}
+	
+	@TransactionDemarcate(saveToken = true)
+	public ActionForward loadSearch(ActionMapping mapping, ActionForm form,
+			HttpServletRequest request, HttpServletResponse response)
+			throws Exception {
+		
+		MoratoriumActionForm actionForm = (MoratoriumActionForm) form;
+		//actionForm.setSearchString(null);
+        if (request.getParameter("perspective") != null) {
+            request.setAttribute("perspective", request.getParameter("perspective"));
+        }
+        cleanUpSearch(request);	
+		
+        if("1".equals(actionForm.getSearchString()))
+        {
+        	// code for search logic of branches [start]
+        	UserContext userContext = (UserContext) SessionUtils.getAttribute(
+    				Constants.USER_CONTEXT_KEY, request.getSession());
+        	List<OfficeBO> officeList = getOffices(userContext, ((OfficeBusinessService) getService()).getOfficesTillBranchOffice());
+    		SessionUtils.setCollectionAttribute(OfficeConstants.GET_HEADOFFICE, getOffice(officeList, OfficeLevel.HEADOFFICE), request);
+    		SessionUtils.setCollectionAttribute(OfficeConstants.GET_REGIONALOFFICE, getOffice(officeList, OfficeLevel.REGIONALOFFICE), request);
+    		SessionUtils.setCollectionAttribute(OfficeConstants.GET_SUBREGIONALOFFICE, getOffice(officeList, OfficeLevel.SUBREGIONALOFFICE), request);
+    		SessionUtils.setCollectionAttribute(OfficeConstants.GET_AREAOFFICE, getOffice(officeList, OfficeLevel.AREAOFFICE), request);
+        	SessionUtils.setCollectionAttribute(OfficeConstants.GET_BRANCHOFFICE, getOffices(userContext, ((OfficeBusinessService) getService()).getBranchOffices()), request);
+        	loadofficeLevels(request);
+        	// code for search logic of branches [end]
+        	return mapping.findForward("loadSearchForBranch");
+        }
+        else
+        	return mapping.findForward("loadSearch");
+	}
+	
+	@TransactionDemarcate(saveToken = true) // for links on moratoriumSearchResult.jsp
+	public ActionForward load(ActionMapping mapping, ActionForm form,
+			HttpServletRequest request, HttpServletResponse response)
+			throws Exception {
+		
+		// customerId
+		String customerId = request.getParameter("customerId");
+		//ClientBO clientInSession = (ClientBO) SessionUtils.getAttribute(Constants.BUSINESS_KEY, request);
+		if(customerId != null)
+		{
+			//ClientBO client = getClientBusinessService().getClient(getIntegerValue(customerId));
+			CustomerBO client = getClientBusinessService().getClient(getIntegerValue(customerId));
+			request.setAttribute("customerId", request.getParameter("customerId"));
+			SessionUtils.setAttribute(Constants.BUSINESS_KEY, client, request);
+		}
+		
+        if (request.getParameter("perspective") != null) {
+            request.setAttribute("perspective", request.getParameter("perspective"));
+        }        	
+		
+        // get moratorium details for client and save it to session, so that 
+		// it can be used in actionForm for validation, i.e., overlapping of moratoriums
+		List moratoriumLst = getMoratoriumBizService().getMoratoriumByCustomerId(customerId);
+		// setting list of moratoriums in session			
+		//request.setAttribute("moratoriumLst", moratoriumLst);
+		//request.getSession().setAttribute("moratoriumLst", moratoriumLst);		
+		SessionUtils.setCollectionAttribute("moratoriumLst", moratoriumLst, request.getSession());
+        
+		return mapping.findForward("load");
+	}
+	
+	// for apply moratorium screen (applyMoratorium.jsp and applyMoratoriumForBranch.jsp)
+	@TransactionDemarcate(saveToken = true)
+	public ActionForward create(ActionMapping mapping, ActionForm form,
+			HttpServletRequest request, HttpServletResponse response)
+			throws Exception {               	
+		
+		// customerId
+		String customerId = request.getParameter("customerId");		
+		if(customerId != null)
+		{
+			// getting customer
+			ClientBO client = getClientBusinessService().getClient(getIntegerValue(customerId));
+			request.setAttribute("customerId", customerId);
+			SessionUtils.setAttribute(Constants.BUSINESS_KEY, client, request);
+			
+			return mapping.findForward("create");
+		}
+		else
+		{
+			// officeId
+			String officeId = request.getParameter("officeId");
+			
+			// getting office
+			OfficeBO officeBO = null;
+			officeBO = ((OfficeBusinessService) getService()).getOffice(Short.valueOf(officeId));
+			request.setAttribute("officeId", officeId);
+			SessionUtils.setAttribute(Constants.BUSINESS_KEY, officeBO, request);
+			
+			return mapping.findForward("createForBranch");
+		}
+	}
+	
+	// for apply moratorium confirm screen (applyMoratoriumConfirm.jsp & applyBranchMoratoriumConfirm.jsp)
+	@TransactionDemarcate(saveToken = true)
+	public ActionForward createConfirmed(ActionMapping mapping, ActionForm form,
+			HttpServletRequest request, HttpServletResponse response)
+			throws Exception {               	
+		
+		MoratoriumActionForm actionForm = (MoratoriumActionForm) form;
+		MeetingActionForm meetingForm = new MeetingActionForm();
+		
+		// customerId
+		String customerId = request.getParameter("customerId");		
+		if(customerId != null)
+		{
+			// getting customer			
+			CustomerBO client = getClientBusinessService().getClient(getIntegerValue(customerId));
+			
+			request.setAttribute("customerId", customerId);
+			SessionUtils.setAttribute(Constants.BUSINESS_KEY, client, request);			
+			
+			// call method to reschedule loan and savings accounts
+			callRescsheduleLoanAndSavingsAccount(client, meetingForm, actionForm, null);
+			
+			//save record to Moratorium table (refer holidayAction - update method)
+			MoratoriumBO moratoriumBO = new MoratoriumBO();
+			moratoriumBO.setAppliedTo(client.getDisplayName());
+			moratoriumBO.setStartDate((Date) actionForm.getFromDate());
+			moratoriumBO.setEndDate((Date) actionForm.getEndDate());			
+			//moratoriumBO.setCreatedBy(createdBy);
+			moratoriumBO.setNotes(actionForm.getMoratoriumNotes());
+			moratoriumBO.setCustomerId(customerId);
+			// commented for testing, uncomment later
+			moratoriumBO.save();			
+		}
+		else
+		{
+			// officeId
+			String officeId = request.getParameter("officeId");
+			
+			// getting office
+			OfficeBO officeBO = null;
+			officeBO = ((OfficeBusinessService) getService()).getOffice(Short.valueOf(officeId));
+			Set clients = officeBO.getClients();
+			Iterator iter = clients.iterator();
+			while (iter.hasNext()) 
+			{
+				CustomerBO client = (CustomerBO) iter.next();
+				client.getCustomerId();
+				
+				// call method to reschedule loan and savings accounts
+				// we will reschedule only for center and clients which belong to this branch, because
+				// calling a reschedule on center will reschedule for it's corresponsding groups and clients
+				CustomerLevel customerLevel = client.getLevel();
+				Short id = customerLevel.getValue();
+				if(id == 3)
+					callRescsheduleLoanAndSavingsAccount(client, meetingForm, actionForm, officeId);
+				else if(id == 1)
+				{
+					// get moratorium parent of this client(i.e., group)
+					// if it's parent customer is null, then only we need to call reschdule, because
+					// a client without group belongs to branch and for a client belonging to a group
+					// we don't have to call reschedule, it is taken care by reschedule of center.
+					CustomerBO group = client.getParentCustomer();
+					if(group == null)
+						callRescsheduleLoanAndSavingsAccount(client, meetingForm, actionForm, officeId);
+				}				
+			}
+			
+			// save record to Moratorium table (refer holidayAction - update method)
+			MoratoriumBO moratoriumBO = new MoratoriumBO();
+			moratoriumBO.setAppliedTo(officeBO.getOfficeName());
+			moratoriumBO.setStartDate((Date) actionForm.getFromDate());
+			moratoriumBO.setEndDate((Date) actionForm.getEndDate());			
+			//moratoriumBO.setCreatedBy(createdBy);
+			moratoriumBO.setNotes(actionForm.getMoratoriumNotes());			
+			moratoriumBO.setOfficeId(officeId);
+			// commented for testing, uncomment later
+			moratoriumBO.save();
+		}
+		
+		return mapping.findForward("create_success");
+		
+	}
+	
+	@TransactionDemarcate(saveToken = true) // for links on configureBranchMoratorium.jsp
+	public ActionForward loadForBranch(ActionMapping mapping, ActionForm form,
+			HttpServletRequest request, HttpServletResponse response)
+			throws Exception {
+		
+		// officeId
+		String officeId = request.getParameter("officeId");
+		
+		if(officeId != null)
+		{
+			OfficeBO officeBO = null;
+			officeBO = ((OfficeBusinessService) getService()).getOffice(Short.valueOf(officeId));
+			
+			request.setAttribute("officeId", request.getParameter("officeId"));
+			SessionUtils.setAttribute(Constants.BUSINESS_KEY, officeBO, request);
+		}
+		
+        if (request.getParameter("perspective") != null) {
+            request.setAttribute("perspective", request.getParameter("perspective"));
+        }        	
+		
+        // get moratorium details for branch office and save it to session, so that 
+		// it can be used in actionForm for validation, i.e., overlapping of moratoriums
+		List moratoriumLst = getMoratoriumBizService().getMoratoriumByOfficeId(officeId);
+		// setting list of moratoriums in session			
+		//request.setAttribute("moratoriumLst", moratoriumLst);
+		//request.getSession().setAttribute("moratoriumLst", moratoriumLst);		
+		SessionUtils.setCollectionAttribute("moratoriumLst", moratoriumLst, request.getSession());
+        
+		return mapping.findForward("loadForBranch");
+	}
+	
+	
+	
+	private void callRescsheduleLoanAndSavingsAccount(CustomerBO client, MeetingActionForm meetingForm, MoratoriumActionForm actionForm, String officeId) throws Exception
+	{
+		// getting clientLevel >> it will decide type of client
+		// 3 stands for "center", 2 stands for "group" and 1 stands for "client"
+		CustomerLevel customerLevel = client.getLevel();
+		Short id = customerLevel.getValue();
+		if(id == 3)
+		{	
+			// get moratorium list for this center
+			List centerMoratoriumLst = getMoratoriumBizService().getMoratoriumByCustomerId(client.getCustomerId().toString());
+			
+			// get moratorium list for office, if officeId is given
+			if(officeId != null)
+			{				
+				List branchMoratoriumLst = getMoratoriumBizService().getMoratoriumByOfficeId(officeId);
+				centerMoratoriumLst.addAll(branchMoratoriumLst);
+			}
+			
+			// rescheduling for savings account of center(loan account is not applicable for center)
+			rescheduleLoanAndSavingsAccounts(client, meetingForm, actionForm, centerMoratoriumLst);
+			
+			// rescheduling for loan and savings account of groups under this center
+			Set groups = client.getChildren();
+			if(groups != null)
+			{
+				Iterator groupsIter = groups.iterator();
+				while (groupsIter.hasNext()) 
+				{
+					//ClientBO group = (ClientBO) groupsIter.next();
+					CustomerBO group = (CustomerBO) groupsIter.next();
+					
+					// get moratorium list for this group
+					List groupMoratoriumLst = getMoratoriumBizService().getMoratoriumByCustomerId(client.getCustomerId().toString());
+					groupMoratoriumLst.addAll(centerMoratoriumLst);
+					
+					rescheduleLoanAndSavingsAccounts(group, meetingForm, actionForm, groupMoratoriumLst);
+					
+					// rescheduling for loan and savings account of clients under this group
+					Set clients = group.getChildren();
+					if(clients != null)
+					{
+						Iterator clientsIter = clients.iterator();
+						while (clientsIter.hasNext()) 
+						{						
+							CustomerBO tempClient = (CustomerBO) clientsIter.next();
+							
+							// get moratorium list for this client
+							List clientMoratoriumLst = getMoratoriumBizService().getMoratoriumByCustomerId(client.getCustomerId().toString());
+							clientMoratoriumLst.addAll(groupMoratoriumLst);
+							
+							rescheduleLoanAndSavingsAccounts(tempClient, meetingForm, actionForm, clientMoratoriumLst);
+						}
+					}
+				}
+			}			
+		}
+		else if(id == 2)
+		{				
+			// get moratorium list for parent of this group(i.e., center)				
+			CustomerBO center = client.getParentCustomer();
+			List centerMoratoriumLst = new ArrayList();
+			if(center != null)
+				centerMoratoriumLst = getMoratoriumBizService().getMoratoriumByCustomerId(center.getCustomerId().toString());				
+			
+			// get moratorium list for office, if officeId is given
+			if(officeId != null)
+			{				
+				List branchMoratoriumLst = getMoratoriumBizService().getMoratoriumByOfficeId(officeId);
+				centerMoratoriumLst.addAll(branchMoratoriumLst);
+			}
+			
+			// get moratorium list for this group
+			List groupMoratoriumLst = getMoratoriumBizService().getMoratoriumByCustomerId(client.getCustomerId().toString());
+			
+			groupMoratoriumLst.addAll(centerMoratoriumLst);
+			
+			// rescheduling for loan and savings account of group
+			rescheduleLoanAndSavingsAccounts(client, meetingForm, actionForm, groupMoratoriumLst);
+			
+			// rescheduling for loan and savings account of clients under this group
+			Set clients = client.getChildren();
+			if(clients != null)
+			{
+				Iterator clientsIter = clients.iterator();
+				while (clientsIter.hasNext()) 
+				{
+					//ClientBO tempClient = (ClientBO) clientsIter.next();
+					CustomerBO tempClient = (CustomerBO) clientsIter.next();
+					
+					// get moratorium list for this client
+					List clientMoratoriumLst = getMoratoriumBizService().getMoratoriumByCustomerId(tempClient.getCustomerId().toString());
+					clientMoratoriumLst.addAll(groupMoratoriumLst);
+					
+					rescheduleLoanAndSavingsAccounts(tempClient, meetingForm, actionForm, clientMoratoriumLst);
+				}
+			}			
+		}
+		else
+		{				
+			// get moratorium list for this client
+			List clientMoratoriumLst = getMoratoriumBizService().getMoratoriumByCustomerId(client.getCustomerId().toString());
+			
+			// get moratorium list for office, if officeId is given
+			if(officeId != null)
+			{				
+				List branchMoratoriumLst = getMoratoriumBizService().getMoratoriumByOfficeId(officeId);
+				clientMoratoriumLst.addAll(branchMoratoriumLst);
+			}
+			
+			// get moratorium list for parent of this client(i.e., group)
+			CustomerBO group = client.getParentCustomer();
+			if(group != null)
+			{
+				clientMoratoriumLst.addAll(getMoratoriumBizService().getMoratoriumByCustomerId(group.getCustomerId().toString()));
+				
+				// get moratorium for the center
+				CustomerBO center = group.getParentCustomer();				
+				if(center != null)
+					clientMoratoriumLst.addAll(getMoratoriumBizService().getMoratoriumByCustomerId(center.getCustomerId().toString()));
+			}
+			
+			rescheduleLoanAndSavingsAccounts(client, meetingForm, actionForm, clientMoratoriumLst);
+		}
+	}
+	
+	private void rescheduleLoanAndSavingsAccounts(CustomerBO client, MeetingActionForm meetingForm, MoratoriumActionForm actionForm, List moratoriumList) throws Exception
+	{
+		// getting meeting details
+		if (client.getCustomerMeeting() != null) 
+		{				
+			MeetingBO meeting = getMeetingBusinessService().getMeeting(client.getCustomerMeeting().getMeeting().getMeetingId());
+			meeting.getMeetingId();				
+			setValuesInActionForm(meetingForm, meeting);
+		}
+		
+		//code for getting min date from moratorium list [start]
+		Date minDate = null;
+		Iterator iter = moratoriumList.iterator();
+		while (iter.hasNext()) 
+		{
+			MoratoriumBO moratoriumBO = (MoratoriumBO) iter.next();
+			if(minDate == null)
+				minDate = moratoriumBO.getStartDate();
+			else
+			{
+				if(DateUtils.getDateWithoutTimeStamp(moratoriumBO.getStartDate().getTime()).compareTo(DateUtils.getDateWithoutTimeStamp(minDate.getTime())) > 0)
+					minDate = moratoriumBO.getStartDate();
+			}
+		}
+		//code for getting min date from moratorium list [end]
+		
+		// code for rescheduling of loan repayment [start]
+		// getting open loan accounts
+		List loanAccounts = client.getOpenLoanAccounts();
+		Iterator loanAccountsIter = loanAccounts.iterator();
+		while (loanAccountsIter.hasNext()) 
+		{
+			LoanBO loanBO = (LoanBO) loanAccountsIter.next();
+			//Integer accountId = loanBO.getAccountId();
+			
+			// getting repayment schedule			
+			List modifiedInstallmentLst = new ArrayList();
+			
+			//Iterator modifiedInstallmentLstIter = modifiedInstallmentLst.iterator();
+			List totalInstallmentsLst = loanBO.getAllInstallments(); // of type LoanScheduleEntity
+			Iterator totalInstlIter = totalInstallmentsLst.iterator();
+			while (totalInstlIter.hasNext())
+			{					
+				LoanScheduleEntity obj = (LoanScheduleEntity) totalInstlIter.next();
+				
+				// store max date into temp variable (not required)
+				Date maxDate = null;
+				/*Iterator modifiedInstallmentLstIter = modifiedInstallmentLst.iterator();
+				while (modifiedInstallmentLstIter.hasNext()) 
+				{
+					LoanScheduleEntity tempObj = (LoanScheduleEntity) modifiedInstallmentLstIter.next();
+					if(maxDate == null)							
+						maxDate = tempObj.getActionDate();
+					else
+					{
+						if(DateUtils.getDateWithoutTimeStamp(tempObj.getActionDate().getTime()).compareTo(DateUtils.getDateWithoutTimeStamp(maxDate.getTime())) > 0)
+							maxDate = tempObj.getActionDate();
+					}
+					tempObj = null;
+				}
+				modifiedInstallmentLstIter = null;*/					
+				
+				// changing actionDate for loan repayment
+				// checking whether an installment is paid or not, and whether the installment date is less than moratorium start date,
+				// if installment date is greater than moratorium min date(from moratorium list) then only we need to reschedule the installment.
+				//if(!obj.isPaid() && !(DateUtils.getDateWithoutTimeStamp(obj.getActionDate().getTime()).compareTo(DateUtils.getDateWithoutTimeStamp(actionForm.getFromDate().getTime())) < 0))
+				if(minDate != null)
+				{
+					if(!obj.isPaid() && DateUtils.getDateWithoutTimeStamp(obj.getActionDate().getTime()).compareTo(DateUtils.getDateWithoutTimeStamp(minDate.getTime())) >= 0)
+					{													
+						Date newActionDate = null;
+						newActionDate = getNewActionDate(obj, meetingForm, actionForm, maxDate, moratoriumList);						
+						obj.setActionDate(newActionDate);
+						// commented for testing, uncomment later
+						//obj.save();
+					}
+				}
+				else if(minDate == null) // this means we are creating moratorium first time
+				{
+					if(!obj.isPaid() && DateUtils.getDateWithoutTimeStamp(obj.getActionDate().getTime()).compareTo(DateUtils.getDateWithoutTimeStamp(actionForm.getFromDate().getTime())) >= 0)
+					{													
+						Date newActionDate = null;
+						newActionDate = getNewActionDate(obj, meetingForm, actionForm, maxDate, moratoriumList);						
+						obj.setActionDate(newActionDate);
+						// commented for testing, uncomment later
+						//obj.save();
+					}
+				}
+				modifiedInstallmentLst.add(obj);
+				obj = null;
+			}				
+		}
+		// code for rescheduling of loan repayment [end]
+		
+		// code for rescheduling of savings account [start]
+		List savingsAccounts = client.getActiveSavingsAccounts();
+		Iterator savingsAccountsIter = savingsAccounts.iterator();
+		while (savingsAccountsIter.hasNext())
+		{
+			SavingsBO savingsBO = (SavingsBO) savingsAccountsIter.next();
+			List modifiedSavingsInstallmentLst = new ArrayList();
+			
+			List totalInstallmentsLst = savingsBO.getAllInstallments(); // of type SavingsScheduleEntity
+			Iterator totalInstlIter = totalInstallmentsLst.iterator();
+			while (totalInstlIter.hasNext())
+			{
+				SavingsScheduleEntity obj = (SavingsScheduleEntity) totalInstlIter.next();
+				
+				// store max date into temp variable (not required)
+				Date maxDate = null;
+				Iterator modifiedSavingsInstallmentLstIter = modifiedSavingsInstallmentLst.iterator();
+				while (modifiedSavingsInstallmentLstIter.hasNext()) 
+				{
+					SavingsScheduleEntity tempObj = (SavingsScheduleEntity) modifiedSavingsInstallmentLstIter.next();
+					if(maxDate == null)							
+						maxDate = tempObj.getActionDate();
+					else
+					{
+						if(DateUtils.getDateWithoutTimeStamp(tempObj.getActionDate().getTime()).compareTo(DateUtils.getDateWithoutTimeStamp(maxDate.getTime())) > 0)
+							maxDate = tempObj.getActionDate();
+					}
+					tempObj = null;
+				}
+				modifiedSavingsInstallmentLstIter = null;	
+				
+				if(!obj.isPaid() && DateUtils.getDateWithoutTimeStamp(obj.getActionDate().getTime()).compareTo(DateUtils.getDateWithoutTimeStamp(minDate.getTime())) >= 0)
+				{													
+					Date newActionDate = null;
+					newActionDate = getNewActionDate(obj, meetingForm, actionForm, maxDate, moratoriumList);						
+					obj.setActionDate(newActionDate);
+					// commented for testing, uncomment later
+					//obj.save();
+				}
+				modifiedSavingsInstallmentLst.add(obj);
+				obj = null;
+			}
+		}
+		// code for rescheduling of savings account [end]
+	}
+	
+	private Date getNewActionDate(Object obj, MeetingActionForm meetingForm, MoratoriumActionForm actionForm, Date maxDate, List moratoriumList)
+	{
+		Calendar cal = new GregorianCalendar();
+		//Date actionDate = obj.getActionDate();
+		Date actionDate = null;
+		Date newActionDate = null;
+		
+		if (obj instanceof LoanScheduleEntity)
+		{
+			LoanScheduleEntity newObj = (LoanScheduleEntity) obj;
+			actionDate = newObj.getActionDate();
+		}
+		else if(obj instanceof SavingsScheduleEntity)
+		{
+			SavingsScheduleEntity newObj = (SavingsScheduleEntity) obj;
+			actionDate = newObj.getActionDate();
+		}
+		
+		cal.setTime(actionDate);
+		
+		// if we are creating moratorium for first time
+		if(moratoriumList == null || moratoriumList.size() == 0)
+		{
+			if(meetingForm.getFrequency().equals("1")) // this indicates that meeting is weekly
+			{
+				int recurWeek;
+				meetingForm.getWeekDay();
+				recurWeek = Integer.parseInt(meetingForm.getRecurWeek());							
+				recurWeek = recurWeek * 7;
+				Long newDay = Long.parseLong(recurWeek + "");							
+				newActionDate = new java.sql.Date(actionDate.getTime() + newDay*24*60*60*1000L);
+				
+				// comparing with moratorium end date 
+				while (DateUtils.getDateWithoutTimeStamp(newActionDate.getTime()).compareTo(DateUtils.getDateWithoutTimeStamp(actionForm.getEndDate().getTime())) <= 0) 
+				{
+					newActionDate = new java.sql.Date(actionDate.getTime() + newDay*24*60*60*1000L);
+				}
+				
+				// comparing with max date
+				/*while (DateUtils.getDateWithoutTimeStamp(newActionDate.getTime()).compareTo(DateUtils.getDateWithoutTimeStamp(maxDate.getTime())) <= 0) 
+				{
+					newActionDate = new java.sql.Date(actionDate.getTime() + newDay*24*60*60*1000L);
+				}*/
+				System.out.println("newActionDate >> " + newActionDate);
+			}
+			else if(meetingForm.getFrequency().equals("2")) // this indicates that meeting is monthly
+			{
+				int monthInterval;
+				int weekInMonth;
+				int dayInWeek;
+				
+				if(meetingForm.getMonthType().equals("1")) // this indicates specific date of specific month
+				{
+					monthInterval = meetingForm.getDayRecurMonthValue();
+					System.out.println("before roll over >> " + cal.getTime());
+					cal.roll(Calendar.MONTH, monthInterval);
+					System.out.println("after roll over >> " + cal.getTime());
+					
+					System.out.println("cal.getTime().getTime() >> " + cal.getTime().getTime());
+					newActionDate = new java.sql.Date(cal.getTime().getTime());
+					
+					
+					// comparing with moratorium end date 
+					while (DateUtils.getDateWithoutTimeStamp(newActionDate.getTime()).compareTo(DateUtils.getDateWithoutTimeStamp(actionForm.getEndDate().getTime())) <= 0) 
+					{
+						cal.roll(Calendar.MONTH, monthInterval);
+						newActionDate = new java.sql.Date(cal.getTime().getTime());
+					}
+					
+					// comparing with max date
+					/*while (DateUtils.getDateWithoutTimeStamp(newActionDate.getTime()).compareTo(DateUtils.getDateWithoutTimeStamp(maxDate.getTime())) <= 0) 
+					{
+						cal.roll(Calendar.MONTH, monthInterval);
+						newActionDate = new java.sql.Date(cal.getTime().getTime());
+					}*/								
+					System.out.println("newActionDate >> " + newActionDate);
+				}
+				else // this indicates specific day, specific week and specific month
+				{
+					monthInterval = meetingForm.getRecurMonthValue();
+					weekInMonth = Integer.parseInt(meetingForm.getMonthRank());
+					dayInWeek = Integer.parseInt(meetingForm.getMonthWeek());
+					
+					System.out.println("before roll over >> " + cal.getTime());
+					cal.roll(Calendar.MONTH, monthInterval);
+					System.out.println("after month roll over >> " + cal.getTime());
+					cal.roll(Calendar.WEEK_OF_MONTH, weekInMonth);
+					System.out.println("after week roll over >> " + cal.getTime());
+					// Rolling of WEEK_OF_MONTH will take to last day of previous week
+					// So need to add one more day to step into next week
+					cal.roll(Calendar.DAY_OF_MONTH,1);
+					System.out.println("after day roll over(of month) by 1 >> " + cal.getTime());
+					cal.roll(Calendar.DAY_OF_WEEK,dayInWeek);
+					System.out.println("after day roll over(of week) >> " + cal.getTime());
+					
+					newActionDate = new java.sql.Date(cal.getTime().getTime());
+													
+					// comparing with moratorium end date 
+					while (DateUtils.getDateWithoutTimeStamp(newActionDate.getTime()).compareTo(DateUtils.getDateWithoutTimeStamp(actionForm.getEndDate().getTime())) <= 0) 
+					{
+						// code for roll over of new "action date", until it becomes greater than
+						// "moratorium end date".									
+						cal.roll(Calendar.MONTH, monthInterval);									
+						cal.roll(Calendar.WEEK_OF_MONTH, weekInMonth);									
+						// Rolling of WEEK_OF_MONTH will take to last day of previous week
+						// So need to add one more day to step into next week
+						cal.roll(Calendar.DAY_OF_MONTH,1);									
+						cal.roll(Calendar.DAY_OF_WEEK,dayInWeek);									
+						
+						newActionDate = new java.sql.Date(cal.getTime().getTime());
+					}
+					
+					// comparing with max date
+					/*while (DateUtils.getDateWithoutTimeStamp(newActionDate.getTime()).compareTo(DateUtils.getDateWithoutTimeStamp(maxDate.getTime())) <= 0) 
+					{
+						// code for roll over of new "action date", until it becomes greater than
+						// "max date".
+						cal.roll(Calendar.MONTH, monthInterval);									
+						cal.roll(Calendar.WEEK_OF_MONTH, weekInMonth);									
+						// Rolling of WEEK_OF_MONTH will take to last day of previous week
+						// So need to add one more day to step into next week
+						cal.roll(Calendar.DAY_OF_MONTH,1);									
+						cal.roll(Calendar.DAY_OF_WEEK,dayInWeek);									
+						
+						newActionDate = new java.sql.Date(cal.getTime().getTime());
+					}*/								
+					System.out.println("newActionDate >> " + newActionDate);
+				}
+			}			
+		}
+		else
+		{
+			if(meetingForm.getFrequency().equals("1")) // this indicates that meeting is weekly
+			{
+				int recurWeek;
+				meetingForm.getWeekDay();
+				recurWeek = Integer.parseInt(meetingForm.getRecurWeek());							
+				recurWeek = recurWeek * 7;
+				Long newDay = Long.parseLong(recurWeek + "");							
+				newActionDate = new java.sql.Date(actionDate.getTime() + newDay*24*60*60*1000L);
+				
+				while (isBetween(newActionDate, moratoriumList))
+				{
+					newActionDate = new java.sql.Date(actionDate.getTime() + newDay*24*60*60*1000L);
+				}
+				
+				// comparing with max date
+				/*while (DateUtils.getDateWithoutTimeStamp(newActionDate.getTime()).compareTo(DateUtils.getDateWithoutTimeStamp(maxDate.getTime())) <= 0) 
+				{
+					newActionDate = new java.sql.Date(actionDate.getTime() + newDay*24*60*60*1000L);
+				}*/
+				System.out.println("newActionDate >> " + newActionDate);
+			}
+			else if(meetingForm.getFrequency().equals("2")) // this indicates that meeting is monthly
+			{
+				int monthInterval;
+				int weekInMonth;
+				int dayInWeek;
+				
+				if(meetingForm.getMonthType().equals("1")) // this indicates specific date of specific month
+				{
+					monthInterval = meetingForm.getDayRecurMonthValue();
+					System.out.println("before roll over >> " + cal.getTime());
+					cal.roll(Calendar.MONTH, monthInterval);
+					System.out.println("after roll over >> " + cal.getTime());
+					
+					System.out.println("cal.getTime().getTime() >> " + cal.getTime().getTime());
+					newActionDate = new java.sql.Date(cal.getTime().getTime());
+					
+					
+					// comparing with moratorium end date 
+					while (isBetween(newActionDate, moratoriumList)) 
+					{
+						cal.roll(Calendar.MONTH, monthInterval);
+						newActionDate = new java.sql.Date(cal.getTime().getTime());
+					}
+					
+					// comparing with max date
+					/*while (DateUtils.getDateWithoutTimeStamp(newActionDate.getTime()).compareTo(DateUtils.getDateWithoutTimeStamp(maxDate.getTime())) <= 0) 
+					{
+						cal.roll(Calendar.MONTH, monthInterval);
+						newActionDate = new java.sql.Date(cal.getTime().getTime());
+					}*/								
+					System.out.println("newActionDate >> " + newActionDate);
+				}
+				else // this indicates specific day, specific week and specific month
+				{
+					monthInterval = meetingForm.getRecurMonthValue();
+					weekInMonth = Integer.parseInt(meetingForm.getMonthRank());
+					dayInWeek = Integer.parseInt(meetingForm.getMonthWeek());
+					
+					System.out.println("before roll over >> " + cal.getTime());
+					cal.roll(Calendar.MONTH, monthInterval);
+					System.out.println("after month roll over >> " + cal.getTime());
+					cal.roll(Calendar.WEEK_OF_MONTH, weekInMonth);
+					System.out.println("after week roll over >> " + cal.getTime());
+					// Rolling of WEEK_OF_MONTH will take to last day of previous week
+					// So need to add one more day to step into next week
+					cal.roll(Calendar.DAY_OF_MONTH,1);
+					System.out.println("after day roll over(of month) by 1 >> " + cal.getTime());
+					cal.roll(Calendar.DAY_OF_WEEK,dayInWeek);
+					System.out.println("after day roll over(of week) >> " + cal.getTime());
+					
+					newActionDate = new java.sql.Date(cal.getTime().getTime());
+													
+					// comparing with moratorium end date 
+					while (isBetween(newActionDate, moratoriumList)) 
+					{
+						// code for roll over of new "action date", until it becomes greater than
+						// "moratorium end date".									
+						cal.roll(Calendar.MONTH, monthInterval);									
+						cal.roll(Calendar.WEEK_OF_MONTH, weekInMonth);									
+						// Rolling of WEEK_OF_MONTH will take to last day of previous week
+						// So need to add one more day to step into next week
+						cal.roll(Calendar.DAY_OF_MONTH,1);									
+						cal.roll(Calendar.DAY_OF_WEEK,dayInWeek);									
+						
+						newActionDate = new java.sql.Date(cal.getTime().getTime());
+					}
+					
+					// comparing with max date
+					/*while (DateUtils.getDateWithoutTimeStamp(newActionDate.getTime()).compareTo(DateUtils.getDateWithoutTimeStamp(maxDate.getTime())) <= 0) 
+					{
+						// code for roll over of new "action date", until it becomes greater than
+						// "max date".
+						cal.roll(Calendar.MONTH, monthInterval);									
+						cal.roll(Calendar.WEEK_OF_MONTH, weekInMonth);									
+						// Rolling of WEEK_OF_MONTH will take to last day of previous week
+						// So need to add one more day to step into next week
+						cal.roll(Calendar.DAY_OF_MONTH,1);									
+						cal.roll(Calendar.DAY_OF_WEEK,dayInWeek);									
+						
+						newActionDate = new java.sql.Date(cal.getTime().getTime());
+					}*/								
+					System.out.println("newActionDate >> " + newActionDate);
+				}
+			}
+		}
+		return newActionDate;
+	}
+	
+	private boolean isBetween(Date newActionDate, List moratoriumLst)
+	{
+		boolean result = false;
+		Iterator iter = moratoriumLst.iterator();
+		while (iter.hasNext()) 
+		{
+			MoratoriumBO moratoriumBO = (MoratoriumBO) iter.next();
+			if(DateUtils.getDateWithoutTimeStamp(newActionDate.getTime()).compareTo(DateUtils.getDateWithoutTimeStamp(moratoriumBO.getStartDate().getTime())) >= 0 && DateUtils.getDateWithoutTimeStamp(newActionDate.getTime()).compareTo(DateUtils.getDateWithoutTimeStamp(moratoriumBO.getEndDate().getTime())) <= 0)
+			{
+				result = true;
+				break;
+			}			
+		}
+		
+		return result;
+	}
+	
+	private void cleanUpSearch(HttpServletRequest request) throws PageExpiredException
+	{
+		SessionUtils.setRemovableAttribute("TableCache",null,TableTagConstants.PATH,request.getSession());
+		SessionUtils.setRemovableAttribute("current",null,TableTagConstants.PATH,request.getSession());
+		SessionUtils.setRemovableAttribute("meth",null,TableTagConstants.PATH,request.getSession());
+		SessionUtils.setRemovableAttribute("forwardkey",null,TableTagConstants.PATH,request.getSession());
+		SessionUtils.setRemovableAttribute("action",null,TableTagConstants.PATH,request.getSession());
+		SessionUtils.removeAttribute(Constants.SEARCH_RESULTS,request);
+	}
+	
+	@TransactionDemarcate (joinToken = true)
+	public ActionForward validate(ActionMapping mapping, ActionForm form,
+			HttpServletRequest request, HttpServletResponse response)
+			throws Exception {
+		String method = (String) request.getAttribute("methodCalled");
+		String forward = null;
+		if (method != null) 
+		{
+			if (method.equals("create"))
+			{
+				String officeId = request.getParameter("officeId");
+				if(officeId == null)
+					forward = "previewCreateMoratorium_failure";
+				else
+					forward = "previewCreateBranchMoratorium_failure";
+			}
+			else if(method.equals("editPreview"))
+				forward = "editPreviewMoratorium_failure";
+		}
+		return mapping.findForward(forward);
+	}
+	
+	private ClientBusinessService getClientBusinessService() {
+		return (ClientBusinessService) ServiceFactory.getInstance()
+				.getBusinessService(BusinessServiceName.Client);
+	}
+	
+	private MeetingBusinessService getMeetingBusinessService()
+			throws ServiceException {
+		return new MeetingBusinessService();
+	}
+	
+	private void setValuesInActionForm(MeetingActionForm form, MeetingBO meeting) {
+		if (meeting.isWeekly()) {
+			form.setFrequency(RecurrenceType.WEEKLY.getValue().toString());
+			form.setWeekDay(meeting.getMeetingDetails().getWeekDay().getValue()
+					.toString());
+			form.setRecurWeek(meeting.getMeetingDetails().getRecurAfter()
+					.toString());
+		} else if (meeting.isMonthly()) {
+			form.setFrequency(RecurrenceType.MONTHLY.getValue().toString());
+			if (meeting.isMonthlyOnDate()) {
+				form.setMonthType("1");
+				form.setDayRecurMonth(meeting.getMeetingDetails()
+						.getRecurAfter().toString());
+				form.setMonthDay(meeting.getMeetingDetails().getDayNumber()
+						.toString());
+			} else {
+				form.setMonthType("2");
+				form.setRecurMonth(meeting.getMeetingDetails().getRecurAfter()
+						.toString());
+				form.setMonthWeek(meeting.getMeetingDetails().getWeekDay()
+						.getValue().toString());
+				form.setMonthRank(meeting.getMeetingDetails().getWeekRank()
+						.getValue().toString());
+			}
+		}
+		form.setMeetingPlace(meeting.getMeetingPlace());
+	}
+	
+	private List<OfficeBO> getOffice(List<OfficeBO> officeList,
+			OfficeLevel officeLevel) throws Exception {
+		if (officeList != null) {
+			List<OfficeBO> newOfficeList = new ArrayList<OfficeBO>();
+			for (OfficeBO officeBO : officeList) {
+				if (officeBO.getOfficeLevel().equals(officeLevel)) {
+					newOfficeList.add(officeBO);
+				}
+			}
+			if (newOfficeList.isEmpty())
+				return null;
+			return newOfficeList;
+		}
+		return null;
+	}
+	
+	private List<OfficeBO> getOffices(UserContext userContext,
+			List<OfficeBO> officeList) throws Exception {
+		if (officeList != null) {
+			for (OfficeBO officeBO : officeList) {
+				officeBO.getLevel().setLocaleId(userContext.getLocaleId());
+				officeBO.getStatus().setLocaleId(userContext.getLocaleId());
+			}
+		}
+		return officeList;
+	}
+	
+	private void loadofficeLevels(HttpServletRequest request) throws Exception {
+		SessionUtils.setCollectionAttribute(OfficeConstants.OFFICELEVELLIST,
+				((OfficeBusinessService) getService())
+						.getConfiguredLevels(getUserContext(request)
+								.getLocaleId()), request);
+	}
+	
+	/*private void setValuesInActionForm(MeetingActionForm form, MeetingBO meeting) {		
+		form.setFrequency(RecurrenceType.MONTHLY.getValue().toString());
+		form.setMonthType("1");
+		form.setDayRecurMonth(String.valueOf(2));
+		form.setMonthDay(String.valueOf(10));			 		
+		form.setMeetingPlace(meeting.getMeetingPlace());
+	}*/
+	/*private void setValuesInActionForm(MeetingActionForm form, MeetingBO meeting) {		
+		form.setFrequency(RecurrenceType.MONTHLY.getValue().toString());
+		form.setMonthType("2");
+		form.setRecurMonth("2");
+		form.setMonthWeek("2");
+		form.setMonthRank("2");
+		form.setMeetingPlace(meeting.getMeetingPlace());
+	}*/
+}
Index: src/org/mifos/application/moratorium/struts/actionforms/MoratoriumActionForm.java
===================================================================
--- src/org/mifos/application/moratorium/struts/actionforms/MoratoriumActionForm.java	(revision 0)
+++ src/org/mifos/application/moratorium/struts/actionforms/MoratoriumActionForm.java	(revision 0)
@@ -0,0 +1,396 @@
+package org.mifos.application.moratorium.struts.actionforms;
+
+import java.util.Calendar;
+import java.util.Date;
+import java.util.GregorianCalendar;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Locale;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.struts.Globals;
+import org.apache.struts.action.ActionErrors;
+import org.apache.struts.action.ActionMapping;
+import org.mifos.application.login.util.helpers.LoginConstants;
+import org.mifos.application.moratorium.business.MoratoriumBO;
+import org.mifos.application.moratorium.util.resources.MoratoriumConstants;
+import org.mifos.framework.exceptions.InvalidDateException;
+import org.mifos.framework.security.util.UserContext;
+import org.mifos.framework.struts.actionforms.BaseActionForm;
+import org.mifos.framework.util.helpers.Constants;
+import org.mifos.framework.util.helpers.DateUtils;
+import org.mifos.framework.util.helpers.SessionUtils;
+import org.mifos.framework.util.helpers.StringUtils;
+
+public class MoratoriumActionForm extends BaseActionForm{
+	
+	private String searchString;
+	
+	private String input;
+	
+	private Date fromDate;
+	
+	private Date endDate;
+	
+	private String moratoriumFromDate;
+	
+	private String moratoriumEndDate;
+	
+	private String moratoriumFromDateDD;
+	
+	private String moratoriumFromDateMM;
+	
+	private String moratoriumFromDateYY;
+	
+	private String moratoriumEndDateDD;
+	
+	private String moratoriumEndDateMM;
+	
+	private String moratoriumEndDateYY;
+	
+	private String moratoriumNotes;
+	
+	private String moratoriumId;
+	
+	private String officeId;
+	
+	public String getMoratoriumId() {
+		return moratoriumId;
+	}
+
+	public void setMoratoriumId(String moratoriumId) {
+		this.moratoriumId = moratoriumId;
+	}
+
+	public String getSearchString() {
+		return searchString;
+	}
+
+	public void setSearchString(String searchString) {
+		this.searchString = searchString;
+	}
+
+	public String getInput() {
+		return input;
+	}
+
+	public void setInput(String input) {
+		this.input = input;
+	}
+
+	public String getMoratoriumNotes() {
+		return moratoriumNotes;
+	}
+
+	public void setMoratoriumNotes(String moratoriumNotes) {		
+		this.moratoriumNotes = moratoriumNotes;
+	}	
+	
+	public String getMoratoriumEndDateDD() {
+		return moratoriumEndDateDD;
+	}
+
+	public void setMoratoriumEndDateDD(String moratoriumEndDateDD) {
+		this.moratoriumEndDateDD = moratoriumEndDateDD;
+	}
+
+	public String getMoratoriumEndDateMM() {
+		return moratoriumEndDateMM;
+	}
+
+	public void setMoratoriumEndDateMM(String moratoriumEndDateMM) {
+		this.moratoriumEndDateMM = moratoriumEndDateMM;
+	}
+
+	public String getMoratoriumEndDateYY() {
+		return moratoriumEndDateYY;
+	}
+
+	public void setMoratoriumEndDateYY(String moratoriumEndDateYY) {
+		this.moratoriumEndDateYY = moratoriumEndDateYY;
+	}
+
+	public String getMoratoriumFromDateDD() {
+		return moratoriumFromDateDD;
+	}
+
+	public void setMoratoriumFromDateDD(String moratoriumFromDateDD) {
+		this.moratoriumFromDateDD = moratoriumFromDateDD;
+	}
+
+	public String getMoratoriumFromDateMM() {
+		return moratoriumFromDateMM;
+	}
+
+	public void setMoratoriumFromDateMM(String moratoriumFromDateMM) {
+		this.moratoriumFromDateMM = moratoriumFromDateMM;
+	}
+
+	public String getMoratoriumFromDateYY() {
+		return moratoriumFromDateYY;
+	}
+
+	public void setMoratoriumFromDateYY(String moratoriumFromDateYY) {
+		this.moratoriumFromDateYY = moratoriumFromDateYY;
+	}
+
+	@Override
+	public ActionErrors validate(ActionMapping mapping,
+			HttpServletRequest request) {
+		ActionErrors errors = new ActionErrors();
+		String method = request.getParameter("method");
+
+		Locale userLocale = getUserLocale(request);
+
+		if (null != request.getParameter(Constants.CURRENTFLOWKEY) && null == request.getAttribute(Constants.CURRENTFLOWKEY))
+			request.setAttribute(Constants.CURRENTFLOWKEY, request.getParameter(Constants.CURRENTFLOWKEY));
+		
+		if (method.equals("create") || method.equals("editPreview")) 
+		{
+			if (!StringUtils.isNullOrEmpty(getMoratoriumFromDate())) 
+			{
+				try
+				{
+					fromDate = DateUtils.getLocaleDate(userLocale, getMoratoriumFromDate());
+				}
+				catch (InvalidDateException e) 
+				{					
+					addError(errors, "From Date", MoratoriumConstants.INVALID_FORMAT_FOR_FROM_DATE);									
+				}
+			}
+			else
+			{
+				addError(errors, "From Date", MoratoriumConstants.MORATORIUM_FROM_DATE);								
+			}
+
+			if (!StringUtils.isNullOrEmpty(getMoratoriumEndDate())) 
+			{
+				try
+				{
+					endDate = DateUtils.getLocaleDate(userLocale, getMoratoriumEndDate());
+				}
+				catch (InvalidDateException e) 
+				{
+					addError(errors, "End Date", MoratoriumConstants.INVALID_FORMAT_FOR_END_DATE);					
+				}
+			}
+			else 
+			{
+				addError(errors, "End Date", MoratoriumConstants.MORATORIUM_END_DATE);								
+			}
+			
+			if (fromDate != null && DateUtils.getDateWithoutTimeStamp(fromDate.getTime()).compareTo(DateUtils.getCurrentDateWithoutTimeStamp()) < 0) 
+			{				
+				//check whether from date is less than current date by 30 days or not.
+				Calendar fromDateCalendar = new GregorianCalendar();
+				fromDateCalendar.setTimeInMillis(getFromDate().getTime());
+				int year1 = fromDateCalendar.get(Calendar.YEAR);
+				int month1 = fromDateCalendar.get(Calendar.MONTH);
+				int day1 = fromDateCalendar.get(Calendar.DAY_OF_MONTH);
+				fromDateCalendar = new GregorianCalendar(year1, month1, day1);
+				
+				Date currentDateMinusThirty = new Date();
+				Calendar calendarMinusThirty = new GregorianCalendar();
+				calendarMinusThirty.setTimeInMillis(currentDateMinusThirty.getTime());
+				int year = calendarMinusThirty.get(Calendar.YEAR);
+				int month = calendarMinusThirty.get(Calendar.MONTH);
+				int day = calendarMinusThirty.get(Calendar.DAY_OF_MONTH) - 30;
+				calendarMinusThirty = new GregorianCalendar(year, month, day);
+				
+				if(fromDateCalendar.compareTo(calendarMinusThirty) < 0)				
+					addError(errors, "From Date", MoratoriumConstants.INVALIDFROMDATE);
+			}
+
+			if (fromDate != null && endDate != null && DateUtils.getDateWithoutTimeStamp(fromDate.getTime()).compareTo(DateUtils.getDateWithoutTimeStamp(endDate.getTime())) > 0) 
+			{
+					addError(errors, "End Date", MoratoriumConstants.INVALIDENDDATE);
+			}
+			
+			// for validation of "overlapping of moratorium" [start]
+			if (method.equals("create"))
+			{
+				if(fromDate != null && endDate != null)
+				{
+					boolean flag = false;
+					if(null != SessionUtils.getAttribute("moratoriumLst", request.getSession()))
+					{
+						List lstOfMoratoriums = (List) SessionUtils.getAttribute("moratoriumLst", request.getSession());
+						Iterator iter = lstOfMoratoriums.iterator(); 
+						while (iter.hasNext())
+						{
+							MoratoriumBO moratoriumBO = (MoratoriumBO) iter.next();
+							moratoriumBO.getStartDate();
+							if(DateUtils.getDateWithoutTimeStamp(getFromDate().getTime()).compareTo(DateUtils.getDateWithoutTimeStamp(moratoriumBO.getStartDate().getTime())) == 0)
+							{
+								addError(errors, "Moratorium Overlap", MoratoriumConstants.MORATORIUM_OVERLAP_EXCEPTION);
+								flag = true;
+							}						
+							else if(DateUtils.getDateWithoutTimeStamp(getFromDate().getTime()).compareTo(DateUtils.getDateWithoutTimeStamp(moratoriumBO.getStartDate().getTime())) > 0)
+							{
+								if(DateUtils.getDateWithoutTimeStamp(getFromDate().getTime()).compareTo(DateUtils.getDateWithoutTimeStamp(moratoriumBO.getEndDate().getTime())) <= 0)
+								{
+									addError(errors, "Moratorium Overlap", MoratoriumConstants.MORATORIUM_OVERLAP_EXCEPTION);
+									flag = true;
+								}
+							}
+							else if(DateUtils.getDateWithoutTimeStamp(getFromDate().getTime()).compareTo(DateUtils.getDateWithoutTimeStamp(moratoriumBO.getStartDate().getTime())) < 0)
+							{
+								if(DateUtils.getDateWithoutTimeStamp(getEndDate().getTime()).compareTo(DateUtils.getDateWithoutTimeStamp(moratoriumBO.getStartDate().getTime())) >= 0)
+								{
+									addError(errors, "Moratorium Overlap", MoratoriumConstants.MORATORIUM_OVERLAP_EXCEPTION);
+									flag = true;
+								}
+							}
+							
+							if(flag)
+								break;
+						}
+					}					
+				}				
+			}
+			else if(method.equals("editPreview"))
+			{
+				if(fromDate != null && endDate != null)
+				{
+					boolean flag = false;
+					String moratoriumId = request.getParameter("moratoriumId");// id of the moratorium which we are editing
+					if(null != SessionUtils.getAttribute("moratoriumLst", request.getSession()))
+					{
+						List lstOfMoratoriums = (List) SessionUtils.getAttribute("moratoriumLst", request.getSession());
+						Iterator iter = lstOfMoratoriums.iterator(); 
+						while (iter.hasNext())
+						{
+							MoratoriumBO moratoriumBO = (MoratoriumBO) iter.next();
+							moratoriumBO.getStartDate();
+							
+							// if we are editing moratorium then the validation for same moratorium needs to be skipped,
+							// because while editing we can only change end date, we need to check whether that end date
+							// overlaps with other moratorium or not.
+							if(moratoriumId.equals(String.valueOf(moratoriumBO.getMoratoriumId())))
+								continue;
+							
+							if(DateUtils.getDateWithoutTimeStamp(getFromDate().getTime()).compareTo(DateUtils.getDateWithoutTimeStamp(moratoriumBO.getStartDate().getTime())) == 0)
+							{
+								addError(errors, "Moratorium Overlap", MoratoriumConstants.MORATORIUM_OVERLAP_EXCEPTION);
+								flag = true;
+							}						
+							else if(DateUtils.getDateWithoutTimeStamp(getFromDate().getTime()).compareTo(DateUtils.getDateWithoutTimeStamp(moratoriumBO.getStartDate().getTime())) > 0)
+							{
+								if(DateUtils.getDateWithoutTimeStamp(getFromDate().getTime()).compareTo(DateUtils.getDateWithoutTimeStamp(moratoriumBO.getEndDate().getTime())) <= 0)
+								{
+									addError(errors, "Moratorium Overlap", MoratoriumConstants.MORATORIUM_OVERLAP_EXCEPTION);
+									flag = true;
+								}
+							}
+							else if(DateUtils.getDateWithoutTimeStamp(getFromDate().getTime()).compareTo(DateUtils.getDateWithoutTimeStamp(moratoriumBO.getStartDate().getTime())) < 0)
+							{
+								if(DateUtils.getDateWithoutTimeStamp(getEndDate().getTime()).compareTo(DateUtils.getDateWithoutTimeStamp(moratoriumBO.getStartDate().getTime())) >= 0)
+								{
+									addError(errors, "Moratorium Overlap", MoratoriumConstants.MORATORIUM_OVERLAP_EXCEPTION);
+									flag = true;
+								}
+							}
+							
+							if(flag)
+								break;
+						}
+					}					
+				}
+			}
+			// for validation of "overlapping of moratorium" [end]
+
+			try
+			{
+				errors.add(super.validate(mapping, request));
+			}
+			catch(Exception e)
+			{}
+		}
+
+		if (null != errors && !errors.isEmpty()) {
+			request.setAttribute(Globals.ERROR_KEY, errors);
+			request.setAttribute("methodCalled", method);
+		}
+
+		return errors;
+	}
+	
+	protected Locale getUserLocale(HttpServletRequest request) {
+		Locale locale = null;
+
+		UserContext userContext = (UserContext) request.getSession()
+				.getAttribute(LoginConstants.USERCONTEXT);
+		if (null != userContext) {
+			locale = userContext.getPreferredLocale();
+			if (null == locale) {
+				locale = userContext.getMfiLocale();
+			}
+		}
+		return locale;
+	}
+
+	public Date getEndDate() {
+		return endDate;
+	}
+
+	public void setEndDate(Date endDate) {
+		this.endDate = endDate;
+	}
+
+	public Date getFromDate() {
+		return fromDate;
+	}
+
+	public void setFromDate(Date fromDate) {
+		this.fromDate = fromDate;
+	}
+	
+	@Override
+	protected UserContext getUserContext(HttpServletRequest request) {
+		return (UserContext) SessionUtils.getAttribute(
+				Constants.USER_CONTEXT_KEY, request.getSession());
+	}
+	
+	public String getMoratoriumEndDate() {
+		String tempDate = null;
+		if (!StringUtils.isNullAndEmptySafe(moratoriumEndDateDD)
+				|| !StringUtils.isNullAndEmptySafe(moratoriumEndDateMM)
+				|| !StringUtils.isNullAndEmptySafe(moratoriumEndDateYY)) {			
+		}
+		else {
+			tempDate = moratoriumEndDateDD + "/" + moratoriumEndDateMM + "/" + moratoriumEndDateYY;
+		}
+		moratoriumEndDate = tempDate;
+		return moratoriumEndDate;
+	}
+
+	public void setMoratoriumEndDate(String moratoriumEndDate) {
+		this.moratoriumEndDate = moratoriumEndDate;		
+	}
+
+	public String getMoratoriumFromDate() {
+		String tempDate = null;
+		if (!StringUtils.isNullAndEmptySafe(moratoriumFromDateDD)
+				|| !StringUtils.isNullAndEmptySafe(moratoriumFromDateMM)
+				|| !StringUtils.isNullAndEmptySafe(moratoriumFromDateYY)) {			
+		}
+		else {
+			tempDate = moratoriumFromDateDD + "/" + moratoriumFromDateMM + "/" + moratoriumFromDateYY;
+		}
+		moratoriumFromDate = tempDate;
+		return moratoriumFromDate;
+	}
+
+	public void setMoratoriumFromDate(String moratoriumFromDate) {
+		this.moratoriumFromDate = moratoriumFromDate;		
+	}
+
+	public String getOfficeId() {
+		return officeId;
+	}
+
+	public void setOfficeId(String officeId) {
+		this.officeId = officeId;
+	}			
+}
Index: src/org/mifos/application/moratorium/struts/actionforms/MoratoriumActionForm.java
===================================================================
--- src/org/mifos/application/moratorium/struts/actionforms/MoratoriumActionForm.java	(revision 0)
+++ src/org/mifos/application/moratorium/struts/actionforms/MoratoriumActionForm.java	(revision 0)
@@ -0,0 +1,396 @@
+package org.mifos.application.moratorium.struts.actionforms;
+
+import java.util.Calendar;
+import java.util.Date;
+import java.util.GregorianCalendar;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Locale;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.struts.Globals;
+import org.apache.struts.action.ActionErrors;
+import org.apache.struts.action.ActionMapping;
+import org.mifos.application.login.util.helpers.LoginConstants;
+import org.mifos.application.moratorium.business.MoratoriumBO;
+import org.mifos.application.moratorium.util.resources.MoratoriumConstants;
+import org.mifos.framework.exceptions.InvalidDateException;
+import org.mifos.framework.security.util.UserContext;
+import org.mifos.framework.struts.actionforms.BaseActionForm;
+import org.mifos.framework.util.helpers.Constants;
+import org.mifos.framework.util.helpers.DateUtils;
+import org.mifos.framework.util.helpers.SessionUtils;
+import org.mifos.framework.util.helpers.StringUtils;
+
+public class MoratoriumActionForm extends BaseActionForm{
+	
+	private String searchString;
+	
+	private String input;
+	
+	private Date fromDate;
+	
+	private Date endDate;
+	
+	private String moratoriumFromDate;
+	
+	private String moratoriumEndDate;
+	
+	private String moratoriumFromDateDD;
+	
+	private String moratoriumFromDateMM;
+	
+	private String moratoriumFromDateYY;
+	
+	private String moratoriumEndDateDD;
+	
+	private String moratoriumEndDateMM;
+	
+	private String moratoriumEndDateYY;
+	
+	private String moratoriumNotes;
+	
+	private String moratoriumId;
+	
+	private String officeId;
+	
+	public String getMoratoriumId() {
+		return moratoriumId;
+	}
+
+	public void setMoratoriumId(String moratoriumId) {
+		this.moratoriumId = moratoriumId;
+	}
+
+	public String getSearchString() {
+		return searchString;
+	}
+
+	public void setSearchString(String searchString) {
+		this.searchString = searchString;
+	}
+
+	public String getInput() {
+		return input;
+	}
+
+	public void setInput(String input) {
+		this.input = input;
+	}
+
+	public String getMoratoriumNotes() {
+		return moratoriumNotes;
+	}
+
+	public void setMoratoriumNotes(String moratoriumNotes) {		
+		this.moratoriumNotes = moratoriumNotes;
+	}	
+	
+	public String getMoratoriumEndDateDD() {
+		return moratoriumEndDateDD;
+	}
+
+	public void setMoratoriumEndDateDD(String moratoriumEndDateDD) {
+		this.moratoriumEndDateDD = moratoriumEndDateDD;
+	}
+
+	public String getMoratoriumEndDateMM() {
+		return moratoriumEndDateMM;
+	}
+
+	public void setMoratoriumEndDateMM(String moratoriumEndDateMM) {
+		this.moratoriumEndDateMM = moratoriumEndDateMM;
+	}
+
+	public String getMoratoriumEndDateYY() {
+		return moratoriumEndDateYY;
+	}
+
+	public void setMoratoriumEndDateYY(String moratoriumEndDateYY) {
+		this.moratoriumEndDateYY = moratoriumEndDateYY;
+	}
+
+	public String getMoratoriumFromDateDD() {
+		return moratoriumFromDateDD;
+	}
+
+	public void setMoratoriumFromDateDD(String moratoriumFromDateDD) {
+		this.moratoriumFromDateDD = moratoriumFromDateDD;
+	}
+
+	public String getMoratoriumFromDateMM() {
+		return moratoriumFromDateMM;
+	}
+
+	public void setMoratoriumFromDateMM(String moratoriumFromDateMM) {
+		this.moratoriumFromDateMM = moratoriumFromDateMM;
+	}
+
+	public String getMoratoriumFromDateYY() {
+		return moratoriumFromDateYY;
+	}
+
+	public void setMoratoriumFromDateYY(String moratoriumFromDateYY) {
+		this.moratoriumFromDateYY = moratoriumFromDateYY;
+	}
+
+	@Override
+	public ActionErrors validate(ActionMapping mapping,
+			HttpServletRequest request) {
+		ActionErrors errors = new ActionErrors();
+		String method = request.getParameter("method");
+
+		Locale userLocale = getUserLocale(request);
+
+		if (null != request.getParameter(Constants.CURRENTFLOWKEY) && null == request.getAttribute(Constants.CURRENTFLOWKEY))
+			request.setAttribute(Constants.CURRENTFLOWKEY, request.getParameter(Constants.CURRENTFLOWKEY));
+		
+		if (method.equals("create") || method.equals("editPreview")) 
+		{
+			if (!StringUtils.isNullOrEmpty(getMoratoriumFromDate())) 
+			{
+				try
+				{
+					fromDate = DateUtils.getLocaleDate(userLocale, getMoratoriumFromDate());
+				}
+				catch (InvalidDateException e) 
+				{					
+					addError(errors, "From Date", MoratoriumConstants.INVALID_FORMAT_FOR_FROM_DATE);									
+				}
+			}
+			else
+			{
+				addError(errors, "From Date", MoratoriumConstants.MORATORIUM_FROM_DATE);								
+			}
+
+			if (!StringUtils.isNullOrEmpty(getMoratoriumEndDate())) 
+			{
+				try
+				{
+					endDate = DateUtils.getLocaleDate(userLocale, getMoratoriumEndDate());
+				}
+				catch (InvalidDateException e) 
+				{
+					addError(errors, "End Date", MoratoriumConstants.INVALID_FORMAT_FOR_END_DATE);					
+				}
+			}
+			else 
+			{
+				addError(errors, "End Date", MoratoriumConstants.MORATORIUM_END_DATE);								
+			}
+			
+			if (fromDate != null && DateUtils.getDateWithoutTimeStamp(fromDate.getTime()).compareTo(DateUtils.getCurrentDateWithoutTimeStamp()) < 0) 
+			{				
+				//check whether from date is less than current date by 30 days or not.
+				Calendar fromDateCalendar = new GregorianCalendar();
+				fromDateCalendar.setTimeInMillis(getFromDate().getTime());
+				int year1 = fromDateCalendar.get(Calendar.YEAR);
+				int month1 = fromDateCalendar.get(Calendar.MONTH);
+				int day1 = fromDateCalendar.get(Calendar.DAY_OF_MONTH);
+				fromDateCalendar = new GregorianCalendar(year1, month1, day1);
+				
+				Date currentDateMinusThirty = new Date();
+				Calendar calendarMinusThirty = new GregorianCalendar();
+				calendarMinusThirty.setTimeInMillis(currentDateMinusThirty.getTime());
+				int year = calendarMinusThirty.get(Calendar.YEAR);
+				int month = calendarMinusThirty.get(Calendar.MONTH);
+				int day = calendarMinusThirty.get(Calendar.DAY_OF_MONTH) - 30;
+				calendarMinusThirty = new GregorianCalendar(year, month, day);
+				
+				if(fromDateCalendar.compareTo(calendarMinusThirty) < 0)				
+					addError(errors, "From Date", MoratoriumConstants.INVALIDFROMDATE);
+			}
+
+			if (fromDate != null && endDate != null && DateUtils.getDateWithoutTimeStamp(fromDate.getTime()).compareTo(DateUtils.getDateWithoutTimeStamp(endDate.getTime())) > 0) 
+			{
+					addError(errors, "End Date", MoratoriumConstants.INVALIDENDDATE);
+			}
+			
+			// for validation of "overlapping of moratorium" [start]
+			if (method.equals("create"))
+			{
+				if(fromDate != null && endDate != null)
+				{
+					boolean flag = false;
+					if(null != SessionUtils.getAttribute("moratoriumLst", request.getSession()))
+					{
+						List lstOfMoratoriums = (List) SessionUtils.getAttribute("moratoriumLst", request.getSession());
+						Iterator iter = lstOfMoratoriums.iterator(); 
+						while (iter.hasNext())
+						{
+							MoratoriumBO moratoriumBO = (MoratoriumBO) iter.next();
+							moratoriumBO.getStartDate();
+							if(DateUtils.getDateWithoutTimeStamp(getFromDate().getTime()).compareTo(DateUtils.getDateWithoutTimeStamp(moratoriumBO.getStartDate().getTime())) == 0)
+							{
+								addError(errors, "Moratorium Overlap", MoratoriumConstants.MORATORIUM_OVERLAP_EXCEPTION);
+								flag = true;
+							}						
+							else if(DateUtils.getDateWithoutTimeStamp(getFromDate().getTime()).compareTo(DateUtils.getDateWithoutTimeStamp(moratoriumBO.getStartDate().getTime())) > 0)
+							{
+								if(DateUtils.getDateWithoutTimeStamp(getFromDate().getTime()).compareTo(DateUtils.getDateWithoutTimeStamp(moratoriumBO.getEndDate().getTime())) <= 0)
+								{
+									addError(errors, "Moratorium Overlap", MoratoriumConstants.MORATORIUM_OVERLAP_EXCEPTION);
+									flag = true;
+								}
+							}
+							else if(DateUtils.getDateWithoutTimeStamp(getFromDate().getTime()).compareTo(DateUtils.getDateWithoutTimeStamp(moratoriumBO.getStartDate().getTime())) < 0)
+							{
+								if(DateUtils.getDateWithoutTimeStamp(getEndDate().getTime()).compareTo(DateUtils.getDateWithoutTimeStamp(moratoriumBO.getStartDate().getTime())) >= 0)
+								{
+									addError(errors, "Moratorium Overlap", MoratoriumConstants.MORATORIUM_OVERLAP_EXCEPTION);
+									flag = true;
+								}
+							}
+							
+							if(flag)
+								break;
+						}
+					}					
+				}				
+			}
+			else if(method.equals("editPreview"))
+			{
+				if(fromDate != null && endDate != null)
+				{
+					boolean flag = false;
+					String moratoriumId = request.getParameter("moratoriumId");// id of the moratorium which we are editing
+					if(null != SessionUtils.getAttribute("moratoriumLst", request.getSession()))
+					{
+						List lstOfMoratoriums = (List) SessionUtils.getAttribute("moratoriumLst", request.getSession());
+						Iterator iter = lstOfMoratoriums.iterator(); 
+						while (iter.hasNext())
+						{
+							MoratoriumBO moratoriumBO = (MoratoriumBO) iter.next();
+							moratoriumBO.getStartDate();
+							
+							// if we are editing moratorium then the validation for same moratorium needs to be skipped,
+							// because while editing we can only change end date, we need to check whether that end date
+							// overlaps with other moratorium or not.
+							if(moratoriumId.equals(String.valueOf(moratoriumBO.getMoratoriumId())))
+								continue;
+							
+							if(DateUtils.getDateWithoutTimeStamp(getFromDate().getTime()).compareTo(DateUtils.getDateWithoutTimeStamp(moratoriumBO.getStartDate().getTime())) == 0)
+							{
+								addError(errors, "Moratorium Overlap", MoratoriumConstants.MORATORIUM_OVERLAP_EXCEPTION);
+								flag = true;
+							}						
+							else if(DateUtils.getDateWithoutTimeStamp(getFromDate().getTime()).compareTo(DateUtils.getDateWithoutTimeStamp(moratoriumBO.getStartDate().getTime())) > 0)
+							{
+								if(DateUtils.getDateWithoutTimeStamp(getFromDate().getTime()).compareTo(DateUtils.getDateWithoutTimeStamp(moratoriumBO.getEndDate().getTime())) <= 0)
+								{
+									addError(errors, "Moratorium Overlap", MoratoriumConstants.MORATORIUM_OVERLAP_EXCEPTION);
+									flag = true;
+								}
+							}
+							else if(DateUtils.getDateWithoutTimeStamp(getFromDate().getTime()).compareTo(DateUtils.getDateWithoutTimeStamp(moratoriumBO.getStartDate().getTime())) < 0)
+							{
+								if(DateUtils.getDateWithoutTimeStamp(getEndDate().getTime()).compareTo(DateUtils.getDateWithoutTimeStamp(moratoriumBO.getStartDate().getTime())) >= 0)
+								{
+									addError(errors, "Moratorium Overlap", MoratoriumConstants.MORATORIUM_OVERLAP_EXCEPTION);
+									flag = true;
+								}
+							}
+							
+							if(flag)
+								break;
+						}
+					}					
+				}
+			}
+			// for validation of "overlapping of moratorium" [end]
+
+			try
+			{
+				errors.add(super.validate(mapping, request));
+			}
+			catch(Exception e)
+			{}
+		}
+
+		if (null != errors && !errors.isEmpty()) {
+			request.setAttribute(Globals.ERROR_KEY, errors);
+			request.setAttribute("methodCalled", method);
+		}
+
+		return errors;
+	}
+	
+	protected Locale getUserLocale(HttpServletRequest request) {
+		Locale locale = null;
+
+		UserContext userContext = (UserContext) request.getSession()
+				.getAttribute(LoginConstants.USERCONTEXT);
+		if (null != userContext) {
+			locale = userContext.getPreferredLocale();
+			if (null == locale) {
+				locale = userContext.getMfiLocale();
+			}
+		}
+		return locale;
+	}
+
+	public Date getEndDate() {
+		return endDate;
+	}
+
+	public void setEndDate(Date endDate) {
+		this.endDate = endDate;
+	}
+
+	public Date getFromDate() {
+		return fromDate;
+	}
+
+	public void setFromDate(Date fromDate) {
+		this.fromDate = fromDate;
+	}
+	
+	@Override
+	protected UserContext getUserContext(HttpServletRequest request) {
+		return (UserContext) SessionUtils.getAttribute(
+				Constants.USER_CONTEXT_KEY, request.getSession());
+	}
+	
+	public String getMoratoriumEndDate() {
+		String tempDate = null;
+		if (!StringUtils.isNullAndEmptySafe(moratoriumEndDateDD)
+				|| !StringUtils.isNullAndEmptySafe(moratoriumEndDateMM)
+				|| !StringUtils.isNullAndEmptySafe(moratoriumEndDateYY)) {			
+		}
+		else {
+			tempDate = moratoriumEndDateDD + "/" + moratoriumEndDateMM + "/" + moratoriumEndDateYY;
+		}
+		moratoriumEndDate = tempDate;
+		return moratoriumEndDate;
+	}
+
+	public void setMoratoriumEndDate(String moratoriumEndDate) {
+		this.moratoriumEndDate = moratoriumEndDate;		
+	}
+
+	public String getMoratoriumFromDate() {
+		String tempDate = null;
+		if (!StringUtils.isNullAndEmptySafe(moratoriumFromDateDD)
+				|| !StringUtils.isNullAndEmptySafe(moratoriumFromDateMM)
+				|| !StringUtils.isNullAndEmptySafe(moratoriumFromDateYY)) {			
+		}
+		else {
+			tempDate = moratoriumFromDateDD + "/" + moratoriumFromDateMM + "/" + moratoriumFromDateYY;
+		}
+		moratoriumFromDate = tempDate;
+		return moratoriumFromDate;
+	}
+
+	public void setMoratoriumFromDate(String moratoriumFromDate) {
+		this.moratoriumFromDate = moratoriumFromDate;		
+	}
+
+	public String getOfficeId() {
+		return officeId;
+	}
+
+	public void setOfficeId(String officeId) {
+		this.officeId = officeId;
+	}			
+}
Index: src/org/mifos/application/moratorium/util/resources/MoratoriumUIResources.properties
===================================================================
--- src/org/mifos/application/moratorium/util/resources/MoratoriumUIResources.properties	(revision 0)
+++ src/org/mifos/application/moratorium/util/resources/MoratoriumUIResources.properties	(revision 0)
@@ -0,0 +1,67 @@
+moratorium.moratoriumcatinfo=Search
+moratorium.review=Review &amp; submit
+moratorium.define=Apply Moratorium
+moratorium.categoryinfo=Search
+moratorium.compfields=Choose an option to apply either branch motatorium or client/group/center moratorium and click Continue.
+moratorium.clickcanc=Click Cancel to return to admin without submitting information.
+moratorium.applyForOffice=Apply Mfi/regional/ branch moratorium
+moratorium.applyForClient=Apply client/group/center moratorium
+moratorium.preview=Preview
+moratorium.cancel=Cancel
+moratorium.continue=Continue
+moratorium.enter_search_criteria_for_branch=To apply a moratorium on a branch, click on a branch from the list below. Click Cancel to return to Admin without submitting information.
+moratorium.info=Moratorium Information
+moratorium.enter_search_criteria=Enter a center/client/group name and click Search. Click Cancel to return to Admin without submitting information.
+moratorium.client_type=Center/Client/Group Name
+moratorium.enterInfo=Enter Moratorium Information
+moratorium.enterDetailInfo1=To apply a moratorium for the selected branch/center/client/group, enter the information below and click continue. Click cancel to return to admin without submitting any information.
+moratorium.enterDetailInfo2=Fields marked with an asterisk are required.
+moratorium.clientName=Name
+moratorium.StartDate=Start date
+moratorium.EndDate=End date
+moratorium.notes=Notes
+moratorium.reviewAndSubmit=Review & submit
+moratorium.confirmDetailInfo=The information entered by you is shown below. Click submit to confirm and cancel to return to admin without submitting information.
+moratorium.submit=Submit
+moratorium.editLabel=Edit moratorium information
+
+errors.fromdateformatexception=<li>Invalid format for Moratorium from date.</li>
+errors.enddateformatexception=<li>Invalid format for Moratorium end date.</li>
+errors.fromdateexception=<li>The Start Date can be set to a date earlier than the System Date as long as the Start Date is not 30 days earlier than the System Date.</li>
+errors.enddateexception=<li>Moratorium End Date can be either greater than or equal to From Date.</li>
+moratorium.FromDate=<li>From Date</li>
+moratorium.ToDate=<li>To Date</li>
+error.mandatory_field=<li>is mandatory</li>
+errors.mandatory.moratorium.from.date=<li>Moratorium From Date is mandatory.</li>
+errors.mandatory.moratorium.end.date=<li>Moratorium End Date is mandatory.</li>
+
+Customer.CreateFailed=<li>The creation of the moratorium could not be done.</li>
+
+# For view moratorium screen
+moratorium.labelLinkAdmin=Admin
+moratorium.labelLinkViewMoratoriums1=View moratoriums
+moratorium.labelLinkViewMoratoriums2=View Moratoriums
+moratorium.labelLinkListMOratoriums=Below is the list of moratoriums.
+moratorium.labelLinkClickHere=Click here to
+moratorium.labelAddNewMoratorium=apply new moratorium
+moratorium.labelActiveMoratoriums=Active Moratoriums
+moratorium.labelClosedMoratoriums=Closed Moratoriums
+moratorium.labelAppliedTo=Applied to
+moratorium.labelStartDateEndDate=Start Date - End Date
+moratorium.labelCreatedBy=Created By
+moratorium.labelNotes=Notes
+moratorium.edit=Edit
+
+# For moratorium edit screen
+moratorium.labelViewDetails=View moratorium details
+moratorium.labelEditMoratoriums=Edit Moratoriums
+moratorium.labelEditMoratoriumsInfo1=Complete the fields below. Then click Preview. Click Cancel to return to View Moratoriums page without submitting information.
+moratorium.labelEditMoratoriumsInfo2=Fields marked with an asterisk are required.
+moratorium.labelEditMoratoriumDetails=Edit moratorium details
+
+# For moratorium edit preview screen
+moratorium.labelPreviewEditMoratoriums=Preview edit moratorium
+moratorium.labelPreviewEditMoratoriumsInfo1=Preview the fields below. Then click Submit. Click Cancel to return to View moratoriums without submitting information.
+
+# For overlap validation
+moratorium.overlap=This moratorium overlaps with existing moratorium, please check view moratorium screen. 
\ No newline at end of file
Index: src/org/mifos/application/moratorium/util/resources/MoratoriumConstants.java
===================================================================
--- src/org/mifos/application/moratorium/util/resources/MoratoriumConstants.java	(revision 0)
+++ src/org/mifos/application/moratorium/util/resources/MoratoriumConstants.java	(revision 0)
@@ -0,0 +1,17 @@
+package org.mifos.application.moratorium.util.resources;
+
+public interface MoratoriumConstants {
+
+	public static final String INVALID_FORMAT_FOR_FROM_DATE = "errors.fromdateformatexception";
+	public static final String INVALID_FORMAT_FOR_END_DATE = "errors.enddateformatexception";
+	public static final String INVALIDFROMDATE = "errors.fromdateexception";
+	public static final String INVALIDENDDATE = "errors.enddateexception";
+	public final String MORATORIUM_FROM_DATE="errors.mandatory.moratorium.from.date";
+	public final String MORATORIUM_END_DATE="errors.mandatory.moratorium.end.date";
+	public static final String ERRORMANDATORYFIELD="error.mandatory_field";
+	public static final String MORATORIUMFROMDATE = "moratorium.FromDate";
+	public static final String MORATORIUMENDDATE = "moratorium.EndDate";
+	public static final String HOLIDAYSOURCEPATH = "org/mifos/application/moratorium/util/resources/MoratoriumUIResources";
+	public static final String CREATE_FAILED_EXCEPTION = "Moratorium.CreateFailed";
+	public static final String MORATORIUM_OVERLAP_EXCEPTION = "moratorium.overlap";
+}
Index: src/org/mifos/application/moratorium/util/resources/MoratoriumConstants.java
===================================================================
--- src/org/mifos/application/moratorium/util/resources/MoratoriumConstants.java	(revision 0)
+++ src/org/mifos/application/moratorium/util/resources/MoratoriumConstants.java	(revision 0)
@@ -0,0 +1,17 @@
+package org.mifos.application.moratorium.util.resources;
+
+public interface MoratoriumConstants {
+
+	public static final String INVALID_FORMAT_FOR_FROM_DATE = "errors.fromdateformatexception";
+	public static final String INVALID_FORMAT_FOR_END_DATE = "errors.enddateformatexception";
+	public static final String INVALIDFROMDATE = "errors.fromdateexception";
+	public static final String INVALIDENDDATE = "errors.enddateexception";
+	public final String MORATORIUM_FROM_DATE="errors.mandatory.moratorium.from.date";
+	public final String MORATORIUM_END_DATE="errors.mandatory.moratorium.end.date";
+	public static final String ERRORMANDATORYFIELD="error.mandatory_field";
+	public static final String MORATORIUMFROMDATE = "moratorium.FromDate";
+	public static final String MORATORIUMENDDATE = "moratorium.EndDate";
+	public static final String HOLIDAYSOURCEPATH = "org/mifos/application/moratorium/util/resources/MoratoriumUIResources";
+	public static final String CREATE_FAILED_EXCEPTION = "Moratorium.CreateFailed";
+	public static final String MORATORIUM_OVERLAP_EXCEPTION = "moratorium.overlap";
+}
Index: src/org/mifos/application/moratorium/util/resources/MoratoriumUIResources.properties
===================================================================
--- src/org/mifos/application/moratorium/util/resources/MoratoriumUIResources.properties	(revision 0)
+++ src/org/mifos/application/moratorium/util/resources/MoratoriumUIResources.properties	(revision 0)
@@ -0,0 +1,67 @@
+moratorium.moratoriumcatinfo=Search
+moratorium.review=Review &amp; submit
+moratorium.define=Apply Moratorium
+moratorium.categoryinfo=Search
+moratorium.compfields=Choose an option to apply either branch motatorium or client/group/center moratorium and click Continue.
+moratorium.clickcanc=Click Cancel to return to admin without submitting information.
+moratorium.applyForOffice=Apply Mfi/regional/ branch moratorium
+moratorium.applyForClient=Apply client/group/center moratorium
+moratorium.preview=Preview
+moratorium.cancel=Cancel
+moratorium.continue=Continue
+moratorium.enter_search_criteria_for_branch=To apply a moratorium on a branch, click on a branch from the list below. Click Cancel to return to Admin without submitting information.
+moratorium.info=Moratorium Information
+moratorium.enter_search_criteria=Enter a center/client/group name and click Search. Click Cancel to return to Admin without submitting information.
+moratorium.client_type=Center/Client/Group Name
+moratorium.enterInfo=Enter Moratorium Information
+moratorium.enterDetailInfo1=To apply a moratorium for the selected branch/center/client/group, enter the information below and click continue. Click cancel to return to admin without submitting any information.
+moratorium.enterDetailInfo2=Fields marked with an asterisk are required.
+moratorium.clientName=Name
+moratorium.StartDate=Start date
+moratorium.EndDate=End date
+moratorium.notes=Notes
+moratorium.reviewAndSubmit=Review & submit
+moratorium.confirmDetailInfo=The information entered by you is shown below. Click submit to confirm and cancel to return to admin without submitting information.
+moratorium.submit=Submit
+moratorium.editLabel=Edit moratorium information
+
+errors.fromdateformatexception=<li>Invalid format for Moratorium from date.</li>
+errors.enddateformatexception=<li>Invalid format for Moratorium end date.</li>
+errors.fromdateexception=<li>The Start Date can be set to a date earlier than the System Date as long as the Start Date is not 30 days earlier than the System Date.</li>
+errors.enddateexception=<li>Moratorium End Date can be either greater than or equal to From Date.</li>
+moratorium.FromDate=<li>From Date</li>
+moratorium.ToDate=<li>To Date</li>
+error.mandatory_field=<li>is mandatory</li>
+errors.mandatory.moratorium.from.date=<li>Moratorium From Date is mandatory.</li>
+errors.mandatory.moratorium.end.date=<li>Moratorium End Date is mandatory.</li>
+
+Customer.CreateFailed=<li>The creation of the moratorium could not be done.</li>
+
+# For view moratorium screen
+moratorium.labelLinkAdmin=Admin
+moratorium.labelLinkViewMoratoriums1=View moratoriums
+moratorium.labelLinkViewMoratoriums2=View Moratoriums
+moratorium.labelLinkListMOratoriums=Below is the list of moratoriums.
+moratorium.labelLinkClickHere=Click here to
+moratorium.labelAddNewMoratorium=apply new moratorium
+moratorium.labelActiveMoratoriums=Active Moratoriums
+moratorium.labelClosedMoratoriums=Closed Moratoriums
+moratorium.labelAppliedTo=Applied to
+moratorium.labelStartDateEndDate=Start Date - End Date
+moratorium.labelCreatedBy=Created By
+moratorium.labelNotes=Notes
+moratorium.edit=Edit
+
+# For moratorium edit screen
+moratorium.labelViewDetails=View moratorium details
+moratorium.labelEditMoratoriums=Edit Moratoriums
+moratorium.labelEditMoratoriumsInfo1=Complete the fields below. Then click Preview. Click Cancel to return to View Moratoriums page without submitting information.
+moratorium.labelEditMoratoriumsInfo2=Fields marked with an asterisk are required.
+moratorium.labelEditMoratoriumDetails=Edit moratorium details
+
+# For moratorium edit preview screen
+moratorium.labelPreviewEditMoratoriums=Preview edit moratorium
+moratorium.labelPreviewEditMoratoriumsInfo1=Preview the fields below. Then click Submit. Click Cancel to return to View moratoriums without submitting information.
+
+# For overlap validation
+moratorium.overlap=This moratorium overlaps with existing moratorium, please check view moratorium screen. 
\ No newline at end of file
Index: src/org/mifos/application/NamedQueryConstants.java
===================================================================
--- src/org/mifos/application/NamedQueryConstants.java	(revision 12167)
+++ src/org/mifos/application/NamedQueryConstants.java	(working copy)
@@ -678,5 +678,13 @@
 	public String GET_TOP_LEVEL_ACCOUNTS = "COABO.getTopLevelAccounts";
 	public String GET_ACCOUNT_ID_FOR_GL_CODE = "COABO.getAccountIdForGLCode";
 	public String GET_ALL_COA = "COABO.getAllCoa";
+	
+	// for moratorium
+	public String GET_MORATORIUMS = "moratorium.getMoratoriums";
+	public String GET_MORATORIUM_BY_ID = "moratorium.getMoratoriumById";
+	public String GET_MORATORIUM_BY_CUSTOMER_ID = "moratorium.getMoratoriumByCustomerId";
+	public String GET_MORATORIUM_BY_OFFICE_ID = "moratorium.getMoratoriumByOfficeId";
+	public String MORATORIUM_SEARCH_GROUP_CLIENT_COUNT="Moratorium.cust_count_account_Search";
+	public String MORATORIUM_SEARCH_GROUP_CLIENT="Moratorium.cust_account_Search";
 
 }
\ No newline at end of file
Index: src/org/mifos/application/office/business/OfficeBO.hbm.xml
===================================================================
--- src/org/mifos/application/office/business/OfficeBO.hbm.xml	(revision 12167)
+++ src/org/mifos/application/office/business/OfficeBO.hbm.xml	(working copy)
@@ -33,6 +33,13 @@
 			<key column="PARENT_OFFICE_ID"  />
 			<one-to-many class="org.mifos.application.office.business.OfficeBO"   />
 		</set>
+		
+		<!-- added for moratorium -->
+		<set name="clients"  inverse="true"  lazy="true" >
+			<key column="BRANCH_ID"  />
+			<one-to-many class="org.mifos.application.customer.business.CustomerBO"   />
+		</set>
+		<!-- added for moratorium -->
 
 		<one-to-one name="address"	class="org.mifos.application.office.business.OfficeAddressEntity"	cascade="all" property-ref="office" />
 	</class>
Index: src/org/mifos/application/office/business/OfficeBO.java
===================================================================
--- src/org/mifos/application/office/business/OfficeBO.java	(revision 12167)
+++ src/org/mifos/application/office/business/OfficeBO.java	(working copy)
@@ -8,6 +8,7 @@
 import java.util.ResourceBundle;
 import java.util.Set;
 
+import org.mifos.application.customer.business.CustomerBO;
 import org.mifos.application.master.business.CustomFieldView;
 import org.mifos.application.master.persistence.MasterPersistence;
 import org.mifos.application.office.exceptions.OfficeException;
@@ -58,6 +59,9 @@
 	private OfficeAddressEntity address;
 
 	private Set<OfficeBO> children;
+	
+	// added for moratorium
+	private Set<CustomerBO> clients;
 
 	public OfficeBO() {
 		super();
@@ -646,4 +650,12 @@
 		}
 		return isParent;
 	}
+
+	public Set<CustomerBO> getClients() {
+		return clients;
+	}
+
+	public void setClients(Set<CustomerBO> clients) {
+		this.clients = clients;
+	}
 }
Index: src/org/mifos/application/util/helpers/ActionForwards.java
===================================================================
--- src/org/mifos/application/util/helpers/ActionForwards.java	(revision 12167)
+++ src/org/mifos/application/util/helpers/ActionForwards.java	(working copy)
@@ -194,5 +194,6 @@
 	previewEdit_success,
 	previewEdit_failure,
 	confirm_delete,
-	download_success;
+	download_success,
+	moratorium_search_success;
 }
Index: src/org/mifos/doc-root/application/admin/jsp/admin.jsp
===================================================================
--- src/org/mifos/doc-root/application/admin/jsp/admin.jsp	(revision 12167)
+++ src/org/mifos/doc-root/application/admin/jsp/admin.jsp	(working copy)
@@ -168,7 +168,17 @@
 								action="ppiAction.do?method=configure">
 								<mifos:mifoslabel name="admin.configurePPI" /></html-el:link></td>
 						</tr>
-
+						
+						<tr class="fontnormal">
+							<td><img src="pages/framework/images/bullet_circle.gif" width="9"
+								height="11"></td>
+							<td><html-el:link
+								action="moratoriumAction.do?method=get">
+								<mifos:mifoslabel name="admin.viewMoratorium" /></html-el:link>
+							| <html-el:link
+								action="moratoriumAction.do?method=configure">
+								<mifos:mifoslabel name="admin.appplyMoratorium" /></html-el:link></td>
+						</tr>
 					</table>
 					 <br>
 					<span class="fontnormalbold"><mifos:mifoslabel name="admin.datadisplayrules" /></span><br>
Index: src/org/mifos/doc-root/application/moratorium/jsp/applyMoratorium.jsp
===================================================================
--- src/org/mifos/doc-root/application/moratorium/jsp/applyMoratorium.jsp	(revision 0)
+++ src/org/mifos/doc-root/application/moratorium/jsp/applyMoratorium.jsp	(revision 0)
@@ -0,0 +1,204 @@
+<!-- 
+
+/**
+
+ * applyMoratorium.jsp    version: 1.0
+
+ 
+
+ * Copyright (c) 2005-2006 Grameen Foundation USA
+
+ * 1029 Vermont Avenue, NW, Suite 400, Washington DC 20005
+
+ * All rights reserved.
+
+ 
+
+ * Apache License 
+ * Copyright (c) 2005-2006 Grameen Foundation USA 
+ * 
+
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License. You may obtain
+ * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 
+ *
+
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and limitations under the 
+
+ * License. 
+ * 
+ * See also http://www.apache.org/licenses/LICENSE-2.0.html for an explanation of the license 
+
+ * and how it is applied. 
+
+ *
+
+ */
+
+-->
+
+<%@taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
+<%@taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
+<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
+<%@taglib uri="/tags/mifos-html" prefix="mifos"%>
+<%@ taglib uri="/tags/date" prefix="date"%>
+<%@taglib uri="http://struts.apache.org/tags-html-el" prefix="html-el"%>
+<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
+<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles"%>
+<%@ taglib uri="/sessionaccess" prefix="session"%>
+<%@ taglib uri="/mifos/customtags" prefix="mifoscustom"%>
+<%@ taglib uri="/mifos/custom-tags" prefix="customtags"%>
+<tiles:insert definition=".withoutmenu">
+	<tiles:put name="body" type="string">
+		<script>
+				function fnCancel(form) {
+				form.action="AdminAction.do?method=load";
+				form.submit();
+			}
+		</script>
+
+		<SCRIPT SRC="pages/framework/js/date.js"></SCRIPT>
+		<html-el:form method="post"
+			action="/moratoriumAction.do?method=create">
+			<c:set value="${session:getFromSession(sessionScope.flowManager,requestScope.currentFlowKey,'BusinessKey')}" var="BusinessKey" />
+				   <!-- This hidden variable is being used in the next page -->
+			<html-el:hidden property="customerId" value="${BusinessKey.customerId}" />			
+			<html-el:hidden property="globalCustNum" value="${BusinessKey.globalCustNum}"/>
+				global customer no : <c:out value="${BusinessKey.globalCustNum}"/>
+			<table width="100%" border="0" cellspacing="0" cellpadding="0">
+				<tr>
+					<td height="470" align="left" valign="top" bgcolor="#FFFFFF">
+					<table width="90%" border="0" align="center" cellpadding="0"
+						cellspacing="0">
+						<tr>
+							<td align="center" class="heading">&nbsp;</td>
+						</tr>
+					</table>
+					<table width="90%" border="0" align="center" cellpadding="0"
+						cellspacing="0">
+						<tr>
+							<td class="bluetablehead">							
+									<table width="100%" border="0" cellspacing="0" cellpadding="0">
+										<tr>
+											<td width="25%">
+											<table border="0" cellspacing="0" cellpadding="0">
+												<tr>
+													<td><img src="pages/framework/images/timeline/tick.gif"
+														width="17" height="17"></td>
+													<td class="timelineboldgray"><mifos:mifoslabel
+														name="moratorium.categoryinfo" bundle="moratoriumUIResources" /></td>
+												</tr>
+											</table>
+											</td>
+											<td width="25%" align="center">
+											<table border="0" cellspacing="0" cellpadding="0">
+												<tr>
+													<td><img
+														src="pages/framework/images/timeline/bigarrow.gif"
+														width="17" height="17"></td>
+													<td class="timelineboldorange"><mifos:mifoslabel
+												name="moratorium.info" bundle="moratoriumUIResources" /></td>
+												</tr>
+											</table>
+											</td>											
+											<td width="25%" align="right">
+											<table border="0" cellspacing="0" cellpadding="0">
+												<tr>
+													<td><img
+														src="pages/framework/images/timeline/orangearrow.gif"
+														width="17" height="17"></td>
+													<td class="timelineboldorangelight"><mifos:mifoslabel
+												name="moratorium.review" bundle="moratoriumUIResources" /></td>
+												</tr>
+											</table>
+											</td>
+										</tr>
+									</table>									
+							</td>
+						</tr>
+					</table>
+					<table width="90%" border="0" align="center" cellpadding="0"
+						cellspacing="0" class="bluetableborder">
+						<tr>
+							<td width="70%" height="24" align="left" valign="top"
+								class="paddingleftCreates">
+							<table width="98%" border="0" cellspacing="0" cellpadding="3">								
+                                <tr>
+									<td class="headingorange">								
+										<span class="heading"> 
+											<mifos:mifoslabel name="moratorium.define" /> -
+										</span>
+									<mifos:mifoslabel name="moratorium.enterInfo" /></td>
+								</tr>
+								<tr>
+									<td class="fontnormalbold">
+										<span class="fontnormal">
+											<mifos:mifoslabel name="moratorium.enterDetailInfo1" />
+											<mifos:mifoslabel mandatory="yes" name="moratorium.enterDetailInfo2" />
+										</span>
+									</td>
+								</tr>
+								<tr>
+									<td class="fontnormalbold">
+										<span class="fontnormalbold">
+											<mifos:mifoslabel name="moratorium.clientName" isColonRequired="Yes"/>
+										</span>&nbsp;
+										<span class="fontnormal">
+											<c:out value="${BusinessKey.displayName}"/>
+										</span>
+									</td>
+								</tr>
+								<tr><logic:messagesPresent>
+								<td><br><font class="fontnormalRedBold"><html-el:errors bundle="moratoriumUIResources" /></font></td>
+								</logic:messagesPresent>
+								</tr>
+							</table>
+							<br>
+							<table width="96%" border="0" cellspacing="0" cellpadding="0">
+								<tr>
+									<td align="right" class="fontnormal"><mifos:mifoslabel
+										mandatory="yes" isColonRequired="Yes" name="moratorium.StartDate" bundle="moratoriumUIResources"/></td>
+									<td class="fontnormal"><date:datetag renderstyle="simple" property="moratoriumFromDate" /></td>
+								</tr>
+								<tr>
+									<td align="right" class="fontnormal"><mifos:mifoslabel
+										mandatory="yes" isColonRequired="Yes" name="moratorium.EndDate" bundle="moratoriumUIResources"/></td>
+									<td class="fontnormal"><date:datetag renderstyle="simple" property="moratoriumEndDate"/></td>
+								</tr>
+								<tr>
+									<td align="right" class="fontnormal"><mifos:mifoslabel
+										isColonRequired="Yes" name="moratorium.notes" bundle="moratoriumUIResources"/></td>
+									<td class="fontnormal">
+									<html-el:textarea property="moratoriumNotes" style="width:120px; height:90px;">
+									</html-el:textarea>
+									</td>
+								</tr>								
+							</table><br>
+							<table width="96%" border="0" cellspacing="0" cellpadding="0">
+								<tr>
+									<td align="center">
+										<html-el:submit property="continueButton" styleClass="buttn" style="width:70px;">
+											<mifos:mifoslabel name="moratorium.continue" />
+										</html-el:submit>
+									    &nbsp;&nbsp;
+										<html-el:button property="cancelButton" styleClass="cancelbuttn" style="width:70px;" onclick="javascript:fnCancel(this.form)">
+											<mifos:mifoslabel name="accounts.cancel" />
+										</html-el:button>
+									</td>
+								</tr>
+							</table>							
+							<br>
+					</table>
+					</td>
+				</tr>
+			</table>
+            <html:hidden property="perspective" value="${custSearchActionForm.perspective}"/>
+            <html:hidden property="method" value="create" />
+			<html-el:hidden property="currentFlowKey" value="${requestScope.currentFlowKey}" />
+			
+		</html-el:form>
+	</tiles:put>
+</tiles:insert>
Index: src/org/mifos/doc-root/application/moratorium/jsp/moratoriumSearchResults.jsp
===================================================================
--- src/org/mifos/doc-root/application/moratorium/jsp/moratoriumSearchResults.jsp	(revision 0)
+++ src/org/mifos/doc-root/application/moratorium/jsp/moratoriumSearchResults.jsp	(revision 0)
@@ -0,0 +1,177 @@
+<!-- 
+
+/**
+
+ * moratoriumSearchResults.jsp    version: 1.0
+
+ 
+
+ * Copyright (c) 2005-2006 Grameen Foundation USA
+
+ * 1029 Vermont Avenue, NW, Suite 400, Washington DC 20005
+
+ * All rights reserved.
+
+ 
+
+ * Apache License 
+ * Copyright (c) 2005-2006 Grameen Foundation USA 
+ * 
+
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License. You may obtain
+ * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 
+ *
+
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and limitations under the 
+
+ * License. 
+ * 
+ * See also http://www.apache.org/licenses/LICENSE-2.0.html for an explanation of the license 
+
+ * and how it is applied. 
+
+ *
+
+ */
+
+-->
+
+<%@taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
+<%@taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
+<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
+<%@taglib uri="/tags/mifos-html" prefix="mifos"%>
+<%@taglib uri="http://struts.apache.org/tags-html-el" prefix="html-el"%>
+<%@ taglib uri="/tags/struts-tiles" prefix="tiles"%>
+<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
+
+<tiles:insert definition=".withoutmenu">
+	<tiles:put name="body" type="string">
+		<script>
+				function fnCancel(form) {
+				form.action="AdminAction.do?method=load";
+				form.submit();
+			}
+		</script>
+
+		<html-el:form method="post"
+			action="/custSearchAction.do?method=search">			
+			<table width="100%" border="0" cellspacing="0" cellpadding="0">
+				<tr>
+					<td height="470" align="left" valign="top" bgcolor="#FFFFFF">
+					<table width="90%" border="0" align="center" cellpadding="0"
+						cellspacing="0">
+						<tr>
+							<td align="center" class="heading">&nbsp;</td>
+						</tr>
+					</table>
+					<table width="90%" border="0" align="center" cellpadding="0"
+						cellspacing="0">
+						<tr>
+							<td class="bluetablehead">							
+									<table width="100%" border="0" cellspacing="0" cellpadding="0">
+										<tr>
+											<td width="25%">
+											<table border="0" cellspacing="0" cellpadding="0">
+												<tr>
+													<td><img src="pages/framework/images/timeline/bigarrow.gif"
+														width="17" height="17"></td>
+													<td class="timelineboldorange"><mifos:mifoslabel
+														name="moratorium.categoryinfo" bundle="moratoriumUIResources" /></td>
+												</tr>
+											</table>
+											</td>
+											<td width="25%" align="center">
+											<table border="0" cellspacing="0" cellpadding="0">
+												<tr>
+													<td><img
+														src="pages/framework/images/timeline/orangearrow.gif"
+														width="17" height="17"></td>
+													<td class="timelineboldorangelight"><mifos:mifoslabel
+												name="moratorium.info" bundle="moratoriumUIResources" /></td>
+												</tr>
+											</table>
+											</td>											
+											<td width="25%" align="right">
+											<table border="0" cellspacing="0" cellpadding="0">
+												<tr>
+													<td><img
+														src="pages/framework/images/timeline/orangearrow.gif"
+														width="17" height="17"></td>
+													<td class="timelineboldorangelight"><mifos:mifoslabel
+												name="moratorium.review" bundle="moratoriumUIResources" /></td>
+												</tr>
+											</table>
+											</td>
+										</tr>
+									</table>									
+							</td>
+						</tr>
+					</table>
+					<table width="90%" border="0" align="center" cellpadding="0"
+						cellspacing="0" class="bluetableborder">
+						<tr>
+							<td width="70%" height="24" align="left" valign="top"
+								class="paddingleftCreates">
+							<table width="98%" border="0" cellspacing="0" cellpadding="3">								
+                                <tr>
+									<td class="headingorange">								
+										<span class="heading"> 
+											<mifos:mifoslabel name="moratorium.define" /> -
+										</span>
+									<mifos:mifoslabel name="moratorium.categoryinfo" /></td>
+								</tr>
+								<tr>
+									<td class="fontnormalbold">
+										<span class="fontnormal">
+											<mifos:mifoslabel name="moratorium.enter_search_criteria" />
+										</span>
+									</td>
+								</tr>
+								<tr><logic:messagesPresent>
+								<td><br><font class="fontnormalRedBold"><html-el:errors bundle="accountsUIResources" /></font></td>
+								</logic:messagesPresent>
+								</tr>
+							</table>
+							<br>
+							<table width="96%" border="0" cellspacing="0" cellpadding="0">
+								<tr align="left">
+									<td class="fontnormal"><mifos:mifoslabel
+										name="accounts.search_for" />:&nbsp; <html-el:text
+										styleId="111" property="searchString" maxlength="200"/> &nbsp;
+									<html-el:submit property="searchButton" styleClass="buttn"
+										style="width:70px;">
+										<mifos:mifoslabel name="accounts.search" />
+									</html-el:submit></td>
+								</tr>
+								<tr class="fontnormal">
+									<td>
+										<mifos:mifostabletagdata name="moratorium" key="moratoriumSearch" 
+										type="single" width="100%" border="0" cellspacing="0" cellpadding="0" />										
+								   </td>
+								</tr>
+							</table><br>
+							<table width="96%" border="0" cellspacing="0" cellpadding="0">
+								<tr>
+									<td align="center"><html-el:button property="cancelButton"
+										styleClass="cancelbuttn" style="width:70px;"
+										onclick="javascript:fnCancel(this.form)">
+										<mifos:mifoslabel name="accounts.cancel" />
+									</html-el:button></td>
+								</tr>
+							</table>
+							<br>
+					</table>
+					</td>
+				</tr>
+			</table>
+            <html:hidden property="perspective" value="${custSearchActionForm.perspective}"/>
+            <html:hidden property="method" value="search" />
+			<html-el:hidden property="currentFlowKey" value="${requestScope.currentFlowKey}" />
+			
+		</html-el:form>
+	</tiles:put>
+</tiles:insert>
Index: src/org/mifos/doc-root/application/moratorium/jsp/editMoratoriums.jsp
===================================================================
--- src/org/mifos/doc-root/application/moratorium/jsp/editMoratoriums.jsp	(revision 0)
+++ src/org/mifos/doc-root/application/moratorium/jsp/editMoratoriums.jsp	(revision 0)
@@ -0,0 +1,168 @@
+<!--
+/**
+
+* editMoratoriums.jsp    version: 1.0
+
+
+
+* Copyright (c) 2005-2006 Grameen Foundation USA
+
+* 1029 Vermont Avenue, NW, Suite 400, Washington DC 20005
+
+* All rights reserved.
+
+
+
+* Apache License
+* Copyright (c) 2005-2006 Grameen Foundation USA
+*
+
+* Licensed under the Apache License, Version 2.0 (the "License"); you may
+* not use this file except in compliance with the License. You may obtain
+* a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
+*
+
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and limitations under the
+
+* License.
+*
+* See also http://www.apache.org/licenses/LICENSE-2.0.html for an explanation of the license
+
+* and how it is applied.
+
+*
+* 
+*/
+ -->
+
+<%@ taglib uri="/tags/struts-tiles" prefix="tiles"%>
+<%@ taglib uri="/tags/struts-html-el" prefix="html-el"%>
+<%@ taglib uri="/tags/mifos-html" prefix="mifos"%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+<%@ taglib uri="/sessionaccess" prefix="session"%>
+<%@ taglib uri="/tags/date" prefix="date"%>
+<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
+<tiles:insert definition=".view">
+<tiles:put name="body" type="string">
+<script language="javascript">
+		<!--
+			function fnCancel(form) {
+				form.action="AdminAction.do?method=load";
+				form.submit();
+			}
+		//-->
+		</script>
+<html-el:form action="/moratoriumAction.do?method=editPreview">
+<c:set value="${session:getFromSession(sessionScope.flowManager,requestScope.currentFlowKey,'BusinessKey')}" var="BusinessKey" />
+<table width="95%" border="0" cellpadding="0" cellspacing="0">
+        <tr>
+          <td class="bluetablehead05">
+	          <span class="fontnormal8pt">
+	          	 <html-el:link action="AdminAction.do?method=load&randomNUm=${sessionScope.randomNUm}">
+					<mifos:mifoslabel name="moratorium.labelLinkAdmin" bundle="moratoriumUIResources"/>	
+				</html-el:link> /
+	          </span>
+	          <span class="fontnormal8pt">
+	          	<html-el:link action="moratoriumAction.do?method=get&randomNUm=${sessionScope.randomNUm}">
+          			<mifos:mifoslabel name="moratorium.labelLinkViewMoratoriums1" bundle="moratoriumUIResources"/>          			
+          		</html-el:link> /
+          	   </span>
+          	   <span class="fontnormal8ptbold">
+          			<mifos:mifoslabel name="moratorium.labelViewDetails" bundle="moratoriumUIResources"/>          			
+          	   </span>
+          </td>
+        </tr>
+      </table>
+      <table width="95%" border="0" cellpadding="0" cellspacing="0">
+        <tr>
+          <td width="70%" align="left" valign="top" class="paddingL15T15"><table width="98%" border="0" cellspacing="0" cellpadding="3">
+            <tr>
+              <td width="35%">
+              	<span class="heading">
+    	          	<c:out value="${BusinessKey.appliedTo}"/>
+    	        </span> - 	            
+              	<span class="headingorange">
+              	   <mifos:mifoslabel name="moratorium.labelEditMoratoriums" bundle="moratoriumUIResources"/>
+              	</span>
+              </td>
+            </tr>
+            
+            <tr>
+			  <td class="fontnormalbold">			     
+	            <span class="fontnormal">
+					<mifos:mifoslabel name="moratorium.labelEditMoratoriumsInfo1" bundle="moratoriumUIResources" />
+					<mifos:mifoslabel mandatory="yes" name="moratorium.labelEditMoratoriumsInfo2" bundle="moratoriumUIResources" />
+				</span>
+            	 <br><br>
+                 
+              </td>
+            </tr>
+            
+            <tr>
+            	<logic:messagesPresent>
+            		<td>
+            			<br><font class="fontnormalRedBold"><html-el:errors bundle="moratoriumUIResources" /></font>
+            		</td>
+				</logic:messagesPresent>
+			</tr>
+            
+            <tr>
+				<td class="fontnormalbold">
+					<span class="fontnormalbold">
+						<mifos:mifoslabel name="moratorium.labelEditMoratoriumDetails" />
+					</span>					
+				</td>
+			</tr>    
+          </table>
+          
+	        <table width="96%" border="0" cellspacing="0" cellpadding="0">
+				<tr>
+					<td align="right" class="fontnormal">
+						<mifos:mifoslabel isColonRequired="Yes" name="moratorium.StartDate" bundle="moratoriumUIResources"/>
+					</td>
+					<td class="fontnormal"><date:datetag renderstyle="simple" isDisabled="Yes" property="moratoriumFromDate" /></td>
+				</tr>
+				<tr>
+					<td align="right" class="fontnormal">
+						<mifos:mifoslabel mandatory="yes" isColonRequired="Yes" name="moratorium.EndDate" bundle="moratoriumUIResources"/>
+					</td>
+					<td class="fontnormal"><date:datetag renderstyle="simple" property="moratoriumEndDate"/></td>
+				</tr>
+				<tr>
+					<td align="right" class="fontnormal">
+						<mifos:mifoslabel isColonRequired="Yes" name="moratorium.notes" bundle="moratoriumUIResources"/>
+					</td>
+					<td class="fontnormal">
+						<html-el:textarea property="moratoriumNotes" disabled="true" style="width:240px; height:90px;"></html-el:textarea>
+					</td>
+				</tr>								
+			</table><br>
+			<table width="96%" border="0" cellspacing="0" cellpadding="0">
+				<tr>
+					<td align="center">
+						<html-el:submit property="Preview" styleClass="buttn" style="width:70px;">
+							<mifos:mifoslabel name="moratorium.preview" bundle="moratoriumUIResources" />
+						</html-el:submit>
+						&nbsp;&nbsp;
+						<html-el:button property="cancelButton" styleClass="cancelbuttn" style="width:70px;" onclick="javascript:fnCancel(this.form)">
+							<mifos:mifoslabel name="moratorium.cancel" bundle="moratoriumUIResources" />
+						</html-el:button>
+					</td>
+				</tr>
+			</table>                      
+          
+          
+            <br>
+          </td>
+          </tr>
+      </table>
+      <br>
+   	  <html-el:hidden property="currentFlowKey" value="${requestScope.currentFlowKey}" />
+   	  <html-el:hidden property="moratoriumId" value="${BusinessKey.moratoriumId}" />
+   	  <html-el:hidden property="officeId" value="${BusinessKey.officeId}" />
+      </html-el:form>
+</tiles:put>
+</tiles:insert>
Index: src/org/mifos/doc-root/application/moratorium/jsp/applyMoratoriumForBranch.jsp
===================================================================
--- src/org/mifos/doc-root/application/moratorium/jsp/applyMoratoriumForBranch.jsp	(revision 0)
+++ src/org/mifos/doc-root/application/moratorium/jsp/applyMoratoriumForBranch.jsp	(revision 0)
@@ -0,0 +1,204 @@
+<!-- 
+
+/**
+
+ * applyMoratoriumForBranch.jsp    version: 1.0
+
+ 
+
+ * Copyright (c) 2005-2006 Grameen Foundation USA
+
+ * 1029 Vermont Avenue, NW, Suite 400, Washington DC 20005
+
+ * All rights reserved.
+
+ 
+
+ * Apache License 
+ * Copyright (c) 2005-2006 Grameen Foundation USA 
+ * 
+
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License. You may obtain
+ * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 
+ *
+
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and limitations under the 
+
+ * License. 
+ * 
+ * See also http://www.apache.org/licenses/LICENSE-2.0.html for an explanation of the license 
+
+ * and how it is applied. 
+
+ *
+
+ */
+
+-->
+
+<%@taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
+<%@taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
+<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
+<%@taglib uri="/tags/mifos-html" prefix="mifos"%>
+<%@ taglib uri="/tags/date" prefix="date"%>
+<%@taglib uri="http://struts.apache.org/tags-html-el" prefix="html-el"%>
+<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
+<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles"%>
+<%@ taglib uri="/sessionaccess" prefix="session"%>
+<%@ taglib uri="/mifos/customtags" prefix="mifoscustom"%>
+<%@ taglib uri="/mifos/custom-tags" prefix="customtags"%>
+<tiles:insert definition=".withoutmenu">
+	<tiles:put name="body" type="string">
+		<script>
+				function fnCancel(form) {
+				form.action="AdminAction.do?method=load";
+				form.submit();
+			}
+		</script>
+
+		<SCRIPT SRC="pages/framework/js/date.js"></SCRIPT>
+		<html-el:form method="post"
+			action="/moratoriumAction.do?method=create">
+			<c:set value="${session:getFromSession(sessionScope.flowManager,requestScope.currentFlowKey,'BusinessKey')}" var="BusinessKey" />
+				   <!-- This hidden variable is being used in the next page -->
+			<html-el:hidden property="officeId" value="${BusinessKey.officeId}" />			
+			<html-el:hidden property="globalOfficeNum" value="${BusinessKey.globalOfficeNum}"/>
+				global office no : <c:out value="${BusinessKey.globalOfficeNum}"/>
+			<table width="100%" border="0" cellspacing="0" cellpadding="0">
+				<tr>
+					<td height="470" align="left" valign="top" bgcolor="#FFFFFF">
+					<table width="90%" border="0" align="center" cellpadding="0"
+						cellspacing="0">
+						<tr>
+							<td align="center" class="heading">&nbsp;</td>
+						</tr>
+					</table>
+					<table width="90%" border="0" align="center" cellpadding="0"
+						cellspacing="0">
+						<tr>
+							<td class="bluetablehead">							
+									<table width="100%" border="0" cellspacing="0" cellpadding="0">
+										<tr>
+											<td width="25%">
+											<table border="0" cellspacing="0" cellpadding="0">
+												<tr>
+													<td><img src="pages/framework/images/timeline/tick.gif"
+														width="17" height="17"></td>
+													<td class="timelineboldgray"><mifos:mifoslabel
+														name="moratorium.categoryinfo" bundle="moratoriumUIResources" /></td>
+												</tr>
+											</table>
+											</td>
+											<td width="25%" align="center">
+											<table border="0" cellspacing="0" cellpadding="0">
+												<tr>
+													<td><img
+														src="pages/framework/images/timeline/bigarrow.gif"
+														width="17" height="17"></td>
+													<td class="timelineboldorange"><mifos:mifoslabel
+												name="moratorium.info" bundle="moratoriumUIResources" /></td>
+												</tr>
+											</table>
+											</td>											
+											<td width="25%" align="right">
+											<table border="0" cellspacing="0" cellpadding="0">
+												<tr>
+													<td><img
+														src="pages/framework/images/timeline/orangearrow.gif"
+														width="17" height="17"></td>
+													<td class="timelineboldorangelight"><mifos:mifoslabel
+												name="moratorium.review" bundle="moratoriumUIResources" /></td>
+												</tr>
+											</table>
+											</td>
+										</tr>
+									</table>									
+							</td>
+						</tr>
+					</table>
+					<table width="90%" border="0" align="center" cellpadding="0"
+						cellspacing="0" class="bluetableborder">
+						<tr>
+							<td width="70%" height="24" align="left" valign="top"
+								class="paddingleftCreates">
+							<table width="98%" border="0" cellspacing="0" cellpadding="3">								
+                                <tr>
+									<td class="headingorange">								
+										<span class="heading"> 
+											<mifos:mifoslabel name="moratorium.define" /> -
+										</span>
+									<mifos:mifoslabel name="moratorium.enterInfo" /></td>
+								</tr>
+								<tr>
+									<td class="fontnormalbold">
+										<span class="fontnormal">
+											<mifos:mifoslabel name="moratorium.enterDetailInfo1" />
+											<mifos:mifoslabel mandatory="yes" name="moratorium.enterDetailInfo2" />
+										</span>
+									</td>
+								</tr>
+								<tr>
+									<td class="fontnormalbold">
+										<span class="fontnormalbold">
+											<mifos:mifoslabel name="moratorium.clientName" isColonRequired="Yes"/>
+										</span>&nbsp;
+										<span class="fontnormal">
+											<c:out value="${BusinessKey.officeName}"/>
+										</span>
+									</td>
+								</tr>
+								<tr><logic:messagesPresent>
+								<td><br><font class="fontnormalRedBold"><html-el:errors bundle="moratoriumUIResources" /></font></td>
+								</logic:messagesPresent>
+								</tr>
+							</table>
+							<br>
+							<table width="96%" border="0" cellspacing="0" cellpadding="0">
+								<tr>
+									<td align="right" class="fontnormal"><mifos:mifoslabel
+										mandatory="yes" isColonRequired="Yes" name="moratorium.StartDate" bundle="moratoriumUIResources"/></td>
+									<td class="fontnormal"><date:datetag renderstyle="simple" property="moratoriumFromDate" /></td>
+								</tr>
+								<tr>
+									<td align="right" class="fontnormal"><mifos:mifoslabel
+										mandatory="yes" isColonRequired="Yes" name="moratorium.EndDate" bundle="moratoriumUIResources"/></td>
+									<td class="fontnormal"><date:datetag renderstyle="simple" property="moratoriumEndDate"/></td>
+								</tr>
+								<tr>
+									<td align="right" class="fontnormal"><mifos:mifoslabel
+										isColonRequired="Yes" name="moratorium.notes" bundle="moratoriumUIResources"/></td>
+									<td class="fontnormal">
+									<html-el:textarea property="moratoriumNotes" style="width:120px; height:90px;">
+									</html-el:textarea>
+									</td>
+								</tr>								
+							</table><br>
+							<table width="96%" border="0" cellspacing="0" cellpadding="0">
+								<tr>
+									<td align="center">
+										<html-el:submit property="continueButton" styleClass="buttn" style="width:70px;">
+											<mifos:mifoslabel name="moratorium.continue" />
+										</html-el:submit>
+									    &nbsp;&nbsp;
+										<html-el:button property="cancelButton" styleClass="cancelbuttn" style="width:70px;" onclick="javascript:fnCancel(this.form)">
+											<mifos:mifoslabel name="accounts.cancel" />
+										</html-el:button>
+									</td>
+								</tr>
+							</table>							
+							<br>
+					</table>
+					</td>
+				</tr>
+			</table>
+            
+            <html:hidden property="method" value="create" />
+			<html-el:hidden property="currentFlowKey" value="${requestScope.currentFlowKey}" />
+			
+		</html-el:form>
+	</tiles:put>
+</tiles:insert>
Index: src/org/mifos/doc-root/application/moratorium/jsp/editMoratoriumsPreview.jsp
===================================================================
--- src/org/mifos/doc-root/application/moratorium/jsp/editMoratoriumsPreview.jsp	(revision 0)
+++ src/org/mifos/doc-root/application/moratorium/jsp/editMoratoriumsPreview.jsp	(revision 0)
@@ -0,0 +1,181 @@
+<!--
+/**
+
+* editMoratoriumsPreview.jsp    version: 1.0
+
+
+
+* Copyright (c) 2005-2006 Grameen Foundation USA
+
+* 1029 Vermont Avenue, NW, Suite 400, Washington DC 20005
+
+* All rights reserved.
+
+
+
+* Apache License
+* Copyright (c) 2005-2006 Grameen Foundation USA
+*
+
+* Licensed under the Apache License, Version 2.0 (the "License"); you may
+* not use this file except in compliance with the License. You may obtain
+* a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
+*
+
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and limitations under the
+
+* License.
+*
+* See also http://www.apache.org/licenses/LICENSE-2.0.html for an explanation of the license
+
+* and how it is applied.
+
+*
+* 
+*/
+ -->
+
+<%@ taglib uri="/tags/struts-tiles" prefix="tiles"%>
+<%@ taglib uri="/tags/struts-html-el" prefix="html-el"%>
+<%@ taglib uri="/tags/mifos-html" prefix="mifos"%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+<%@ taglib uri="/sessionaccess" prefix="session"%>
+<%@ taglib uri="/tags/date" prefix="date"%>
+<tiles:insert definition=".view">
+<tiles:put name="body" type="string">		
+		<script>
+				function fnCancel(form) {
+				form.action="AdminAction.do?method=load";
+				form.submit();
+			}
+			
+			function goToEditPage(form){
+			form.action="moratoriumAction.do?method=previousEdit";
+			form.submit();
+		  }
+		</script>
+<html-el:form action="/moratoriumAction.do?method=updateMoratorium">
+<c:set value="${session:getFromSession(sessionScope.flowManager,requestScope.currentFlowKey,'BusinessKey')}" var="BusinessKey" />
+<table width="95%" border="0" cellpadding="0" cellspacing="0">
+        <tr>
+          <td class="bluetablehead05">
+	          <span class="fontnormal8pt">
+	          	 <html-el:link action="AdminAction.do?method=load&randomNUm=${sessionScope.randomNUm}">
+					<mifos:mifoslabel name="moratorium.labelLinkAdmin" bundle="moratoriumUIResources"/>	
+				</html-el:link> /
+	          </span>
+	          <span class="fontnormal8pt">
+	          	<html-el:link action="moratoriumAction.do?method=get&randomNUm=${sessionScope.randomNUm}">
+          			<mifos:mifoslabel name="moratorium.labelLinkViewMoratoriums1" bundle="moratoriumUIResources"/>          			
+          		</html-el:link> /
+          	   </span>
+          	   <span class="fontnormal8ptbold">
+          			<mifos:mifoslabel name="moratorium.labelViewDetails" bundle="moratoriumUIResources"/>          			
+          	   </span>
+          </td>
+        </tr>
+      </table>
+      <table width="95%" border="0" cellpadding="0" cellspacing="0">
+        <tr>
+          <td width="70%" align="left" valign="top" class="paddingL15T15"><table width="98%" border="0" cellspacing="0" cellpadding="3">
+            <tr>
+              <td width="35%">
+              	<span class="heading">
+    	          	<c:out value="${BusinessKey.appliedTo}"/>
+    	        </span> - 	            
+              	<span class="headingorange">
+              	   <mifos:mifoslabel name="moratorium.labelPreviewEditMoratoriums" bundle="moratoriumUIResources"/>
+              	</span>
+              </td>
+            </tr>
+            
+            <tr>
+			  <td class="fontnormalbold">			     
+	            <span class="fontnormal">
+					<mifos:mifoslabel name="moratorium.labelPreviewEditMoratoriumsInfo1" bundle="moratoriumUIResources" />					
+				</span>
+            	 <br><br>
+                 
+              </td>
+            </tr>
+            
+            <tr>
+				<td class="fontnormalbold">
+					<span class="fontnormalbold">
+						<mifos:mifoslabel name="moratorium.labelEditMoratoriumDetails" />
+					</span>					
+				</td>
+			</tr>    
+          </table>
+          
+	        <table width="96%" border="0" cellspacing="0" cellpadding="0">	        	
+				<tr>
+					<td>
+						<span class="fontnormalbold">
+							<mifos:mifoslabel isColonRequired="Yes" name="moratorium.StartDate" bundle="moratoriumUIResources"/>
+						</span>&nbsp;
+						<span class="fontnormal">
+							<c:out value="${sessionScope.moratoriumActionForm.moratoriumFromDateDD}"/>/<c:out value="${sessionScope.moratoriumActionForm.moratoriumFromDateMM}"/>/<c:out value="${sessionScope.moratoriumActionForm.moratoriumFromDateYY}"/>
+						</span>
+					</td>									
+				</tr>
+				<tr>
+					<td>
+						<span class="fontnormalbold">
+							<mifos:mifoslabel isColonRequired="Yes" name="moratorium.EndDate" bundle="moratoriumUIResources"/>
+						</span>&nbsp;
+						<span class="fontnormal">
+							<c:out value="${sessionScope.moratoriumActionForm.moratoriumEndDateDD}"/>/<c:out value="${sessionScope.moratoriumActionForm.moratoriumEndDateMM}"/>/<c:out value="${sessionScope.moratoriumActionForm.moratoriumEndDateYY}"/>
+						</span>
+					</td>									
+				</tr>
+				<tr>
+					<td>
+						<span class="fontnormalbold">
+							<mifos:mifoslabel isColonRequired="Yes" name="moratorium.notes" bundle="moratoriumUIResources"/>
+						</span>
+					</td>									
+				</tr>
+				<tr>
+					<td class="fontnormal">
+						<span class="fontnormal">
+							<c:out value="${sessionScope.moratoriumActionForm.moratoriumNotes}"/>
+						</span>
+					</td>
+				</tr>
+				<tr></tr><tr></tr>
+				<tr></tr><tr></tr>
+				<tr></tr><tr></tr>
+				<tr>
+					<td align="left" valign="top">
+						<html-el:button property="btn" style="width:200px;" styleClass="insidebuttn" onclick="goToEditPage(this.form);">
+					    	<mifos:mifoslabel name="moratorium.editLabel" bundle="moratoriumUIResources"></mifos:mifoslabel>
+					    </html-el:button>
+				    </td>
+				</tr>								
+			</table><br>
+			<table width="96%" border="0" cellspacing="0" cellpadding="0">
+				<tr>
+					<td align="center">
+						<html-el:submit styleClass="buttn" style="width:70px;">
+							<mifos:mifoslabel name="moratorium.submit" />
+						</html-el:submit>
+						&nbsp;&nbsp;
+						<html-el:button property="cancelButton" styleClass="cancelbuttn" style="width:70px;" onclick="fnCancel(this.form);">
+							<mifos:mifoslabel name="moratorium.cancel" bundle="moratoriumUIResources" />
+						</html-el:button>
+					</td>
+				</tr>
+			</table>
+            <br>
+          </td>
+          </tr>
+      </table>
+      <br>
+   	  <html-el:hidden property="currentFlowKey" value="${requestScope.currentFlowKey}" />   	  
+      </html-el:form>
+</tiles:put>
+</tiles:insert>
Index: src/org/mifos/doc-root/application/moratorium/jsp/viewMoratoriums.jsp
===================================================================
--- src/org/mifos/doc-root/application/moratorium/jsp/viewMoratoriums.jsp	(revision 0)
+++ src/org/mifos/doc-root/application/moratorium/jsp/viewMoratoriums.jsp	(revision 0)
@@ -0,0 +1,185 @@
+<!--
+/**
+
+* viewMoratoriums.jsp    version: 1.0
+
+
+
+* Copyright (c) 2005-2006 Grameen Foundation USA
+
+* 1029 Vermont Avenue, NW, Suite 400, Washington DC 20005
+
+* All rights reserved.
+
+
+
+* Apache License
+* Copyright (c) 2005-2006 Grameen Foundation USA
+*
+
+* Licensed under the Apache License, Version 2.0 (the "License"); you may
+* not use this file except in compliance with the License. You may obtain
+* a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
+*
+
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and limitations under the
+
+* License.
+*
+* See also http://www.apache.org/licenses/LICENSE-2.0.html for an explanation of the license
+
+* and how it is applied.
+
+*
+* 
+*/
+ -->
+
+<%@ taglib uri="/tags/struts-tiles" prefix="tiles"%>
+<%@ taglib uri="/tags/struts-html-el" prefix="html-el"%>
+<%@ taglib uri="/tags/mifos-html" prefix="mifos"%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+<%@ taglib uri="/sessionaccess" prefix="session"%>
+
+<tiles:insert definition=".view">
+<tiles:put name="body" type="string">
+<html-el:form action="/moratoriumAction.do">
+<table width="95%" border="0" cellpadding="0" cellspacing="0">
+        <tr>
+          <td class="bluetablehead05">
+	          <span class="fontnormal8pt">
+	          	 <html-el:link action="AdminAction.do?method=load&randomNUm=${sessionScope.randomNUm}">
+					<mifos:mifoslabel name="moratorium.labelLinkAdmin" bundle="moratoriumUIResources"/>	
+				</html-el:link> /
+	          </span><span class="fontnormal8ptbold">
+          			<mifos:mifoslabel name="moratorium.labelLinkViewMoratoriums1" bundle="moratoriumUIResources"/>          			
+          	   </span>
+          </td>
+        </tr>
+      </table>
+      <table width="95%" border="0" cellpadding="0" cellspacing="0">
+        <tr>
+          <td width="70%" align="left" valign="top" class="paddingL15T15"><table width="98%" border="0" cellspacing="0" cellpadding="3">
+            <tr>
+              <td width="35%">	            
+              	<span class="headingorange">
+              	   <mifos:mifoslabel name="moratorium.labelLinkViewMoratoriums2" bundle="moratoriumUIResources"/>
+              	</span>
+              </td>
+            </tr>
+            
+            <tr>
+			  <td class="fontnormalbold">
+			     <span class="fontnormal">
+	                <mifos:mifoslabel name="moratorium.labelLinkListMOratoriums" bundle="moratoriumUIResources"/>
+	                <mifos:mifoslabel name="moratorium.labelLinkClickHere" bundle="moratoriumUIResources"/>
+					<html-el:link action="moratoriumAction.do?method=configure&currentFlowKey=${requestScope.currentFlowKey}">
+						<mifos:mifoslabel name="moratorium.labelAddNewMoratorium" bundle="moratoriumUIResources"/>
+					</html-el:link>
+	             </span>
+            	 <br><br>
+                 
+              </td>
+            </tr>    
+          </table>
+          
+	        
+            <span class="fontnormalbold">
+			  <mifos:mifoslabel name="moratorium.labelActiveMoratoriums" bundle="moratoriumUIResources"/>			  
+    	    </span>
+            <br><br>
+            <table width="98%" border="0" cellpadding="3" cellspacing="0">
+              <tr>              
+                <td width="11%" class="drawtablehd">
+               		 <mifos:mifoslabel name="moratorium.labelAppliedTo" bundle="moratoriumUIResources"/>
+                </td>
+                <td width="20%" class="drawtablehd">
+               		 <mifos:mifoslabel name="moratorium.labelStartDateEndDate" bundle="moratoriumUIResources"/>
+                </td>
+                <td width="12%" class="drawtablehd">
+                	<mifos:mifoslabel name="moratorium.labelCreatedBy" bundle="moratoriumUIResources"/>
+				</td>
+				<td width="50%" class="drawtablehd">
+                	<mifos:mifoslabel name="moratorium.labelNotes" bundle="moratoriumUIResources"/>
+				</td>
+				<td width="7%" class="drawtablehd">
+                	&nbsp;
+				</td>
+              </tr>
+              <c:forEach var="moratorium" items="${requestScope.openMoratoriums}" >
+	              <tr>
+	                <td width="11%" class="drawtablerow">${moratorium.appliedTo}</td>
+	                <td width="20%" class="drawtablerow">${moratorium.startDate} - ${moratorium.endDate}</td>
+	                <td width="12%" class="drawtablerow">${moratorium.morCreatedBy}</td>
+	                <td width="50%" class="drawtablerow">${moratorium.notes}</td>
+	                <td width="7%" class="drawtablerow">
+	                	<html-el:link href="moratoriumAction.do?method=edit&moratoriumId=${moratorium.moratoriumId}&customerId=${moratorium.customerId}&officeId=${moratorium.officeId}&currentFlowKey=${requestScope.currentFlowKey}">
+	                		<mifos:mifoslabel name="moratorium.edit" bundle="moratoriumUIResources" />						
+						</html-el:link>
+					</td>
+	              </tr>
+              </c:forEach>           
+              <tr>
+                <td width="11%" class="drawtablerow">&nbsp;</td>
+                <td width="20%" class="drawtablerow">&nbsp;</td>
+                <td width="12%" class="drawtablerow">&nbsp;</td>
+                <td width="50%" class="drawtablerow">&nbsp;</td>
+                <td width="7%" class="drawtablerow">&nbsp;</td>
+              </tr>             
+            </table>
+            
+            <span class="fontnormalbold">
+			  <mifos:mifoslabel name="moratorium.labelClosedMoratoriums" bundle="moratoriumUIResources"/>			  
+    	    </span>
+            <br><br>
+            <table width="98%" border="0" cellpadding="3" cellspacing="0">
+              <tr>              
+                <td width="11%" class="drawtablehd">
+               		 <mifos:mifoslabel name="moratorium.labelAppliedTo" bundle="moratoriumUIResources"/>
+                </td>
+                <td width="20%" class="drawtablehd">
+               		 <mifos:mifoslabel name="moratorium.labelStartDateEndDate" bundle="moratoriumUIResources"/>
+                </td>
+                <td width="12%" class="drawtablehd">
+                	<mifos:mifoslabel name="moratorium.labelCreatedBy" bundle="moratoriumUIResources"/>
+				</td>
+				<td width="50%" class="drawtablehd">
+                	<mifos:mifoslabel name="moratorium.labelNotes" bundle="moratoriumUIResources"/>
+				</td>
+				<td width="7%" class="drawtablehd">
+                	&nbsp;
+				</td>
+              </tr>
+              <c:forEach var="moratorium" items="${requestScope.closedMoratoriums}" >
+	              <tr>
+	                <td width="11%" class="drawtablerow">${moratorium.appliedTo}</td>
+	                <td width="20%" class="drawtablerow">${moratorium.startDate} - ${moratorium.endDate}</td>
+	                <td width="12%" class="drawtablerow">${moratorium.morCreatedBy}</td>
+	                <td width="50%" class="drawtablerow">${moratorium.notes}</td>
+	                <td width="7%" class="drawtablerow">
+	                	<a href="#" disabled>Edit </a>
+					</td>	                
+	              </tr>
+              </c:forEach>           
+              <tr>
+                <td width="11%" class="drawtablerow">&nbsp;</td>
+                <td width="20%" class="drawtablerow">&nbsp;</td>
+                <td width="12%" class="drawtablerow">&nbsp;</td>
+                <td width="50%" class="drawtablerow">&nbsp;</td>
+                <td width="7%" class="drawtablerow">&nbsp;</td>
+              </tr>             
+            </table>            
+          
+          
+            <br>
+          </td>
+          </tr>
+      </table>
+      <br>
+   	  <html-el:hidden property="currentFlowKey" value="${requestScope.currentFlowKey}" />
+      </html-el:form>
+</tiles:put>
+</tiles:insert>
Index: src/org/mifos/doc-root/application/moratorium/jsp/configureBranchMoratorium.jsp
===================================================================
--- src/org/mifos/doc-root/application/moratorium/jsp/configureBranchMoratorium.jsp	(revision 0)
+++ src/org/mifos/doc-root/application/moratorium/jsp/configureBranchMoratorium.jsp	(revision 0)
@@ -0,0 +1,239 @@
+<!-- 
+
+/**
+
+ * configureBranchMoratorium.jsp    version: 1.0
+
+ 
+
+ * Copyright (c) 2005-2006 Grameen Foundation USA
+
+ * 1029 Vermont Avenue, NW, Suite 400, Washington DC 20005
+
+ * All rights reserved.
+
+ 
+
+ * Apache License 
+ * Copyright (c) 2005-2006 Grameen Foundation USA 
+ * 
+
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License. You may obtain
+ * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 
+ *
+
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and limitations under the 
+
+ * License. 
+ * 
+ * See also http://www.apache.org/licenses/LICENSE-2.0.html for an explanation of the license 
+
+ * and how it is applied. 
+
+ *
+
+ */
+
+-->
+
+
+<%@taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
+<%@taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
+<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
+<%@taglib uri="/tags/mifos-html" prefix="mifos"%>
+<%@taglib uri="http://struts.apache.org/tags-html-el" prefix="html-el"%>
+<%@ taglib uri="/tags/struts-tiles" prefix="tiles"%>
+<%@ taglib uri="/sessionaccess" prefix="session"%>
+
+<tiles:insert definition=".withoutmenu">
+	<tiles:put name="body" type="string">
+		<script language="javascript">
+		<!--
+			function fnCancel(form) {
+				form.action="AdminAction.do?method=load";
+				form.submit();
+			}
+		//-->
+		</script>
+		<html-el:form method="post"
+			action="/custSearchAction.do?method=search">
+			<table width="100%" border="0" cellspacing="0" cellpadding="0">
+				<tr>
+					<td height="470" align="left" valign="top" bgcolor="#FFFFFF">
+					<table width="90%" border="0" align="center" cellpadding="0"
+						cellspacing="0">
+						<tr>
+							<td align="center" class="heading">&nbsp;</td>
+						</tr>
+					</table>
+					<table width="90%" border="0" align="center" cellpadding="0"
+						cellspacing="0">
+						<tr>
+							<td class="bluetablehead">						
+							<table width="100%" border="0" cellspacing="0" cellpadding="0">
+								<tr>
+									<td width="25%">
+									<table border="0" cellspacing="0" cellpadding="0">
+										<tr>
+											<td><img src="pages/framework/images/timeline/bigarrow.gif"
+												width="17" height="17"></td>
+											<td class="timelineboldorange"><mifos:mifoslabel
+												name="moratorium.categoryinfo" bundle="moratoriumUIResources" /></td>
+										</tr>
+									</table>
+									</td>									
+									<td width="25%" align="right">
+									<table border="0" cellspacing="0" cellpadding="0">
+										<tr>
+											<td><img
+												src="pages/framework/images/timeline/orangearrow.gif"
+												width="17" height="17"></td>
+											<td class="timelineboldorangelight"><mifos:mifoslabel
+												name="moratorium.info" bundle="moratoriumUIResources" /></td>
+										</tr>
+									</table>
+									</td>
+									<td width="25%" align="right">
+									<table border="0" cellspacing="0" cellpadding="0">
+										<tr>
+											<td><img
+												src="pages/framework/images/timeline/orangearrow.gif"
+												width="17" height="17"></td>
+											<td class="timelineboldorangelight"><mifos:mifoslabel
+												name="moratorium.review" bundle="moratoriumUIResources" /></td>
+										</tr>
+									</table>
+									</td>
+								</tr>
+							</table>						
+							</td>
+						</tr>
+					</table>
+				
+					<table width="90%" border="0" align="center" cellpadding="0"
+						cellspacing="0" class="bluetableborder">
+						<tr>
+							<td width="70%" height="24" align="left" valign="top"
+								class="paddingleftCreates">
+							<table width="98%" border="0" cellspacing="0" cellpadding="3">                                
+                                <tr>
+									<td class="headingorange">								
+										<span class="heading"> 
+											<mifos:mifoslabel name="moratorium.define" /> -
+										</span>
+									<mifos:mifoslabel name="moratorium.categoryinfo" /></td>
+								</tr>
+								<tr>
+									<td class="fontnormalbold">
+										<span class="fontnormal">
+											<mifos:mifoslabel name="moratorium.enter_search_criteria_for_branch" />
+										</span>
+									</td>
+								</tr>
+								<tr>
+									<td>
+										<font class="fontnormalRedBold">
+											<html-el:errors bundle="CustomerSearchUIResources" /> 
+										</font>
+									</td>
+								</tr>
+							</table>
+							
+							<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
+								<tr>
+									<td><c:set var="parentOffice" /> <c:set var="branch" />
+										<c:choose>
+											<c:when test="${empty session:getFromSession(sessionScope.flowManager,requestScope.currentFlowKey,'branchOfficeList')}">
+												<c:set var="branch" value="level" />
+												<br>
+												<table width="95%" border="0" cellspacing="0" cellpadding="0">
+													<tr>
+														<td width="61%"><span class="fontnormalbold"> <mifos:mifoslabel
+															name="Office.labelBranchOffice" bundle="OfficeUIResources" />
+														</span></td>
+														<td width="39%" align="right"></td>
+													</tr>
+												</table>
+											</c:when>
+											<c:otherwise>
+												<c:forEach var="office" items="${session:getFromSession(sessionScope.flowManager,requestScope.currentFlowKey,'branchOfficeList')}"
+													varStatus="counter">
+													<c:if
+														test="${office.level.id == OfficeLevel.BRANCHOFFICE.value && empty branch}">
+														<c:set var="branch" value="level" />
+														<br>
+														<table width="95%" border="0" cellspacing="0" cellpadding="0">
+															<tr>
+																<td width="61%"><span class="fontnormalbold"> <c:out
+																	value="${office.level.name}"></c:out> </span></td>
+																<td width="39%" align="right"></td>
+															</tr>
+														</table>
+													</c:if>
+													<c:if
+														test="${ !empty parentOffice  && parentOffice != office.parentOffice.officeName}">
+														<br>
+														<span class="fontnormal"><c:out
+															value="${office.parentOffice.officeName}" /></span>
+													</c:if>
+													<c:if test="${empty parentOffice}">
+														<span class="fontnormal"><c:out
+															value="${office.parentOffice.officeName}" /></span>
+														<c:set var="parentOffice"
+															value="${office.parentOffice.officeName}" />
+														<c:set var="branch" value="${office.parentOffice.officeName}" />
+													</c:if>
+													<table width="90%" border="0" cellspacing="0" cellpadding="0">
+														<tr class="fontnormal">
+															<td width="1%"><img
+																src="pages/framework/images/bullet_circle.gif" width="9"
+																height="11"></td>
+															<td width="99%"><html-el:link
+																href="moratoriumAction.do?method=loadForBranch&officeId=${office.officeId}&randomNUm=${sessionScope.randomNUm}">
+																<c:out value="${office.officeName}" />
+															</html-el:link> &nbsp;&nbsp;&nbsp; <c:if
+																test="${office.status.id == OfficeStatus.INACTIVE.value}">
+																<mifos:MifosImage id="inactive" moduleName="office" />
+																<c:out value="${office.status.name}" />
+															</c:if></td>
+														</tr>
+													</table>
+												</c:forEach>
+											</c:otherwise>
+										</c:choose>
+									</td>
+								</tr>
+								<tr>
+									<td align="center" class="blueline">&nbsp;</td>
+				                </tr>
+							</table>
+							
+							<br>
+							<table width="90%" border="0" align="center" cellspacing="0" cellpadding="3">								
+								<tr class="fontnormal">									
+									<td align="center"><br>									
+									<html-el:button property="cancelButton"
+											onclick="javascript:fnCancel(this.form)"
+											styleClass="cancelbuttn" style="width:70px;">
+											<mifos:mifoslabel name="accounts.cancel" />
+										</html-el:button>
+									</td>
+								</tr>
+							</table><br>
+							</td>
+						</tr>
+					</table><br>
+					</td>
+				</tr>
+			</table>
+			<html:hidden property="method" value="search" />
+			<html:hidden property="perspective" value="${custSearchActionForm.perspective}"/>
+			<html-el:hidden property="currentFlowKey" value="${requestScope.currentFlowKey}" />
+			<html:hidden property="input" value="moratorium" />
+		</html-el:form>
+	</tiles:put>
+</tiles:insert>
Index: src/org/mifos/doc-root/application/moratorium/jsp/configureClientMoratorium.jsp
===================================================================
--- src/org/mifos/doc-root/application/moratorium/jsp/configureClientMoratorium.jsp	(revision 0)
+++ src/org/mifos/doc-root/application/moratorium/jsp/configureClientMoratorium.jsp	(revision 0)
@@ -0,0 +1,179 @@
+<!-- 
+
+/**
+
+ * configureClientMoratorium.jsp    version: 1.0
+
+ 
+
+ * Copyright (c) 2005-2006 Grameen Foundation USA
+
+ * 1029 Vermont Avenue, NW, Suite 400, Washington DC 20005
+
+ * All rights reserved.
+
+ 
+
+ * Apache License 
+ * Copyright (c) 2005-2006 Grameen Foundation USA 
+ * 
+
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License. You may obtain
+ * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 
+ *
+
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and limitations under the 
+
+ * License. 
+ * 
+ * See also http://www.apache.org/licenses/LICENSE-2.0.html for an explanation of the license 
+
+ * and how it is applied. 
+
+ *
+
+ */
+
+-->
+
+
+<%@taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
+<%@taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
+<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
+<%@taglib uri="/tags/mifos-html" prefix="mifos"%>
+<%@taglib uri="http://struts.apache.org/tags-html-el" prefix="html-el"%>
+<%@ taglib uri="/tags/struts-tiles" prefix="tiles"%>
+
+<tiles:insert definition=".withoutmenu">
+	<tiles:put name="body" type="string">
+		<script language="javascript">
+		<!--
+			function fnCancel(form) {
+				form.action="AdminAction.do?method=load";
+				form.submit();
+			}
+		//-->
+		</script>
+		<html-el:form method="post"
+			action="/custSearchAction.do?method=search">
+			<table width="100%" border="0" cellspacing="0" cellpadding="0">
+				<tr>
+					<td height="470" align="left" valign="top" bgcolor="#FFFFFF">
+					<table width="90%" border="0" align="center" cellpadding="0"
+						cellspacing="0">
+						<tr>
+							<td align="center" class="heading">&nbsp;</td>
+						</tr>
+					</table>
+					<table width="90%" border="0" align="center" cellpadding="0"
+						cellspacing="0">
+						<tr>
+							<td class="bluetablehead">						
+							<table width="100%" border="0" cellspacing="0" cellpadding="0">
+								<tr>
+									<td width="25%">
+									<table border="0" cellspacing="0" cellpadding="0">
+										<tr>
+											<td><img src="pages/framework/images/timeline/bigarrow.gif"
+												width="17" height="17"></td>
+											<td class="timelineboldorange"><mifos:mifoslabel
+												name="moratorium.categoryinfo" bundle="moratoriumUIResources" /></td>
+										</tr>
+									</table>
+									</td>									
+									<td width="25%" align="right">
+									<table border="0" cellspacing="0" cellpadding="0">
+										<tr>
+											<td><img
+												src="pages/framework/images/timeline/orangearrow.gif"
+												width="17" height="17"></td>
+											<td class="timelineboldorangelight"><mifos:mifoslabel
+												name="moratorium.info" bundle="moratoriumUIResources" /></td>
+										</tr>
+									</table>
+									</td>
+									<td width="25%" align="right">
+									<table border="0" cellspacing="0" cellpadding="0">
+										<tr>
+											<td><img
+												src="pages/framework/images/timeline/orangearrow.gif"
+												width="17" height="17"></td>
+											<td class="timelineboldorangelight"><mifos:mifoslabel
+												name="moratorium.review" bundle="moratoriumUIResources" /></td>
+										</tr>
+									</table>
+									</td>
+								</tr>
+							</table>						
+							</td>
+						</tr>
+					</table>
+				
+					<table width="90%" border="0" align="center" cellpadding="0"
+						cellspacing="0" class="bluetableborder">
+						<tr>
+							<td width="70%" height="24" align="left" valign="top"
+								class="paddingleftCreates">
+							<table width="98%" border="0" cellspacing="0" cellpadding="3">                                
+                                <tr>
+									<td class="headingorange">								
+										<span class="heading"> 
+											<mifos:mifoslabel name="moratorium.define" /> -
+										</span>
+									<mifos:mifoslabel name="moratorium.categoryinfo" /></td>
+								</tr>
+								<tr>
+									<td class="fontnormalbold">
+										<span class="fontnormal">
+											<mifos:mifoslabel name="moratorium.enter_search_criteria" />
+										</span>
+									</td>
+								</tr>
+								<tr>
+									<td>
+										<font class="fontnormalRedBold">
+											<html-el:errors bundle="CustomerSearchUIResources" /> 
+										</font>
+									</td>
+								</tr>
+							</table>
+							<br>
+							<table width="90%" border="0" cellspacing="0" cellpadding="3">
+								<tr class="fontnormal">
+									<td align="right"><mifos:mifoslabel
+										name="moratorium.client_type" />:</td>
+									<td><html-el:text styleId="111"
+										property="searchString" maxlength="200"/> </td>
+								</tr>
+								<tr class="fontnormal">
+									<td width="30%">&nbsp;</td>
+									<td width="70%"><br>
+									<html-el:submit property="searchButton" styleClass="buttn"
+										style="width:70px;">
+										<mifos:mifoslabel name="accounts.search" />
+									</html-el:submit>&nbsp;
+									<html-el:button property="cancelButton"
+											onclick="javascript:fnCancel(this.form)"
+											styleClass="cancelbuttn" style="width:70px;">
+											<mifos:mifoslabel name="accounts.cancel" />
+										</html-el:button>
+									</td>
+								</tr>
+							</table><br>
+							</td>
+						</tr>
+					</table><br>
+					</td>
+				</tr>
+			</table>
+			<html:hidden property="method" value="search" />
+			<html:hidden property="perspective" value="${custSearchActionForm.perspective}"/>
+			<html-el:hidden property="currentFlowKey" value="${requestScope.currentFlowKey}" />
+			<html:hidden property="input" value="moratorium" />
+		</html-el:form>
+	</tiles:put>
+</tiles:insert>
Index: src/org/mifos/doc-root/application/moratorium/jsp/applyBranchMoratoriumConfirm.jsp
===================================================================
--- src/org/mifos/doc-root/application/moratorium/jsp/applyBranchMoratoriumConfirm.jsp	(revision 0)
+++ src/org/mifos/doc-root/application/moratorium/jsp/applyBranchMoratoriumConfirm.jsp	(revision 0)
@@ -0,0 +1,221 @@
+<!-- 
+
+/**
+
+ * applyBranchMoratoriumConfirm.jsp    version: 1.0
+
+ 
+
+ * Copyright (c) 2005-2006 Grameen Foundation USA
+
+ * 1029 Vermont Avenue, NW, Suite 400, Washington DC 20005
+
+ * All rights reserved.
+
+ 
+
+ * Apache License 
+ * Copyright (c) 2005-2006 Grameen Foundation USA 
+ * 
+
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License. You may obtain
+ * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 
+ *
+
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and limitations under the 
+
+ * License. 
+ * 
+ * See also http://www.apache.org/licenses/LICENSE-2.0.html for an explanation of the license 
+
+ * and how it is applied. 
+
+ *
+
+ */
+
+-->
+
+<%@taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
+<%@taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
+<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
+<%@taglib uri="/tags/mifos-html" prefix="mifos"%>
+<%@ taglib uri="/tags/date" prefix="date"%>
+<%@taglib uri="http://struts.apache.org/tags-html-el" prefix="html-el"%>
+<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
+<%@ taglib uri="/tags/struts-tiles" prefix="tiles"%>
+<%@ taglib uri="/sessionaccess" prefix="session"%>
+
+<tiles:insert definition=".withoutmenu">
+	<tiles:put name="body" type="string">
+		<script>
+				function fun_cancel(form) {
+				form.action="AdminAction.do?method=load";
+				form.submit();
+			}
+			
+			function goToEditPage(form){
+			form.action="moratoriumAction.do?method=previous";
+			form.submit();
+		  }
+		</script>
+
+		<html-el:form method="post" action="/moratoriumAction.do?method=createConfirmed">
+		<c:set value="${session:getFromSession(sessionScope.flowManager,requestScope.currentFlowKey,'BusinessKey')}" var="BusinessKey" />
+			<html-el:hidden property="officeId" value="${BusinessKey.officeId}" />
+			<table width="100%" border="0" cellspacing="0" cellpadding="0">
+				<tr>
+					<td height="470" align="left" valign="top" bgcolor="#FFFFFF">
+					<table width="90%" border="0" align="center" cellpadding="0"
+						cellspacing="0">
+						<tr>
+							<td align="center" class="heading">&nbsp;</td>
+						</tr>
+					</table>
+					<table width="90%" border="0" align="center" cellpadding="0"
+						cellspacing="0">
+						<tr>
+							<td class="bluetablehead">							
+									<table width="100%" border="0" cellspacing="0" cellpadding="0">
+										<tr>
+											<td width="25%">
+											<table border="0" cellspacing="0" cellpadding="0">
+												<tr>
+													<td><img src="pages/framework/images/timeline/tick.gif"
+														width="17" height="17"></td>
+													<td class="timelineboldgray"><mifos:mifoslabel
+														name="moratorium.categoryinfo" bundle="moratoriumUIResources" /></td>
+												</tr>
+											</table>
+											</td>
+											<td width="25%" align="center">
+											<table border="0" cellspacing="0" cellpadding="0">
+												<tr>
+													<td><img
+														src="pages/framework/images/timeline/tick.gif"
+														width="17" height="17"></td>
+													<td class="timelineboldgray"><mifos:mifoslabel
+												name="moratorium.info" bundle="moratoriumUIResources" /></td>
+												</tr>
+											</table>
+											</td>											
+											<td width="25%" align="right">
+											<table border="0" cellspacing="0" cellpadding="0">
+												<tr>
+													<td><img
+														src="pages/framework/images/timeline/bigarrow.gif"
+														width="17" height="17"></td>
+													<td class="timelineboldorange"><mifos:mifoslabel
+												name="moratorium.review" bundle="moratoriumUIResources" /></td>
+												</tr>
+											</table>
+											</td>
+										</tr>
+									</table>									
+							</td>
+						</tr>
+					</table>
+					<table width="90%" border="0" align="center" cellpadding="0"
+						cellspacing="0" class="bluetableborder">
+						<tr>
+							<td width="70%" height="24" align="left" valign="top"
+								class="paddingleftCreates">
+							<table width="98%" border="0" cellspacing="0" cellpadding="3">								
+                                <tr>
+									<td class="headingorange">								
+										<span class="heading"> 
+											<mifos:mifoslabel name="moratorium.define" /> -
+										</span>
+									<mifos:mifoslabel name="moratorium.reviewAndSubmit" /></td>
+								</tr>
+								<tr>
+									<td>
+										<span class="fontnormal">
+											<mifos:mifoslabel name="moratorium.confirmDetailInfo" />											
+										</span>
+									</td>
+								</tr>
+								<tr>
+									<td>
+										<span class="fontnormalbold">
+											<mifos:mifoslabel name="moratorium.clientName" isColonRequired="Yes"/>
+										</span>&nbsp;
+										<span class="fontnormal">
+											<c:out value="${BusinessKey.officeName}"/>
+										</span>
+									</td>
+								</tr>								
+							</table>
+							<br>
+							<table width="96%" border="0" cellspacing="0" cellpadding="0">
+								<tr>
+									<td>
+										<span class="fontnormalbold">
+											<mifos:mifoslabel isColonRequired="Yes" name="moratorium.StartDate" bundle="moratoriumUIResources"/>
+										</span>&nbsp;
+										<span class="fontnormal">
+										<c:out value="${sessionScope.moratoriumActionForm.moratoriumFromDateDD}"/>/<c:out value="${sessionScope.moratoriumActionForm.moratoriumFromDateMM}"/>/<c:out value="${sessionScope.moratoriumActionForm.moratoriumFromDateYY}"/>
+										</span>
+									</td>									
+								</tr>
+								<tr>
+									<td>
+										<span class="fontnormalbold">
+											<mifos:mifoslabel isColonRequired="Yes" name="moratorium.EndDate" bundle="moratoriumUIResources"/>
+										</span>&nbsp;
+										<span class="fontnormal">
+										<c:out value="${sessionScope.moratoriumActionForm.moratoriumEndDateDD}"/>/<c:out value="${sessionScope.moratoriumActionForm.moratoriumEndDateMM}"/>/<c:out value="${sessionScope.moratoriumActionForm.moratoriumEndDateYY}"/>
+										</span>
+									</td>									
+								</tr>
+								<tr>
+									<td>
+										<span class="fontnormalbold">
+											<mifos:mifoslabel isColonRequired="Yes" name="moratorium.notes" bundle="moratoriumUIResources"/>
+										</span>
+									</td>									
+								</tr>
+								<tr>
+									<td class="fontnormal">
+										<span class="fontnormal">
+											<c:out value="${sessionScope.moratoriumActionForm.moratoriumNotes}"/>
+										</span>
+									</td>
+								</tr>
+								<tr></tr><tr></tr>
+								<tr></tr><tr></tr>
+								<tr></tr><tr></tr>
+								<tr>
+									<td align="left" valign="top">
+					                    <html-el:button property="btn" style="width:200px;" styleClass="insidebuttn" onclick="goToEditPage(this.form);">
+					                    	<mifos:mifoslabel name="moratorium.editLabel" bundle="moratoriumUIResources"></mifos:mifoslabel>
+					                    </html-el:button>
+				                    </td>
+				                </tr>
+							</table><br>
+							<table width="96%" border="0" cellspacing="0" cellpadding="0">
+								<tr>
+									<td align="center">
+										<html-el:submit styleClass="buttn" style="width:70px;">
+											<mifos:mifoslabel name="moratorium.submit" />
+										</html-el:submit>
+									    &nbsp;&nbsp;
+										<html-el:button property="cancelButton" styleClass="cancelbuttn" style="width:70px;" onclick="fun_cancel(this.form);">
+											<mifos:mifoslabel name="accounts.cancel" />
+										</html-el:button>
+									</td>
+								</tr>
+							</table>
+							<br>
+					</table>
+					</td>
+				</tr>
+			</table>			
+			<html-el:hidden property="currentFlowKey" value="${requestScope.currentFlowKey}" />			
+		</html-el:form>
+	</tiles:put>
+</tiles:insert>
Index: src/org/mifos/doc-root/application/moratorium/jsp/configureMoratorium.jsp
===================================================================
--- src/org/mifos/doc-root/application/moratorium/jsp/configureMoratorium.jsp	(revision 0)
+++ src/org/mifos/doc-root/application/moratorium/jsp/configureMoratorium.jsp	(revision 0)
@@ -0,0 +1,172 @@
+<!--
+
+/**
+
+ * configureMoratorium.jsp    version: 1.0
+
+
+
+ * Copyright (c) 2005-2006 Grameen Foundation USA
+
+ * 1029 Vermont Avenue, NW, Suite 400, Washington DC 20005
+
+ * All rights reserved.
+
+
+
+ * Apache License
+ * Copyright (c) 2005-2006 Grameen Foundation USA
+ *
+
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License. You may obtain
+ * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
+ *
+
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and limitations under the
+
+ * License.
+ *
+ * See also http://www.apache.org/licenses/LICENSE-2.0.html for an explanation of the license
+
+ * and how it is applied.
+
+ *
+
+ */
+
+-->
+
+<%@taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
+<%@taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
+<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
+<%@taglib uri="/tags/mifos-html" prefix="mifos"%>
+<%@taglib uri="http://struts.apache.org/tags-html-el" prefix="html-el"%>
+<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles"%>
+<%@ taglib uri="/sessionaccess" prefix="session"%>
+
+<tiles:insert definition=".create">
+	<tiles:put name="body" type="string">
+		<script language="javascript">
+		<!--
+			function fnCancel(form) {
+				form.action="AdminAction.do?method=load";
+				form.submit();
+			}
+		//-->
+		</script>
+		<html-el:form action="/moratoriumAction.do?method=loadSearch">
+			<table width="100%" border="0" cellspacing="0" cellpadding="0">
+				<tr>
+					<td height="350" align="left" valign="top" bgcolor="#FFFFFF">
+					<table width="90%" border="0" align="center" cellpadding="0"
+						cellspacing="0">
+						<tr>
+							<td align="center" class="heading">&nbsp;</td>
+						</tr>
+					</table>
+					<table width="90%" border="0" align="center" cellpadding="0"
+						cellspacing="0">
+						<tr>
+							<td class="bluetablehead">
+							<table width="100%" border="0" cellspacing="0" cellpadding="0">
+								<tr>
+									<td width="27%" align="left">
+									<table border="0" cellspacing="0" cellpadding="0">
+										<tr>
+											<td><html-el:img
+												src="pages/framework/images/timeline/bigarrow.gif"
+												width="17" height="17" /></td>
+											<td class="timelineboldorange"><mifos:mifoslabel
+												name="moratorium.moratoriumcatinfo" bundle="moratoriumUIResources" /></td>
+										</tr>
+									</table>
+									</td>
+									<td width="73%" align="right">
+									<table border="0" cellspacing="0" cellpadding="0">
+										<tr>
+											<td><html-el:img
+												src="pages/framework/images/timeline/orangearrow.gif"
+												width="17" height="17" /></td>
+											<td class="timelineboldorangelight"><mifos:mifoslabel
+												name="moratorium.review" bundle="moratoriumUIResources" /></td>
+										</tr>
+									</table>
+									</td>
+								</tr>
+							</table>
+							</td>
+						</tr>
+					</table>
+					<table width="90%" border="0" align="center" cellpadding="0"
+						cellspacing="0" class="bluetableborder">
+						<tr>
+							<td align="left" valign="top" class="paddingleftCreates">
+							<table width="93%" border="0" cellpadding="3" cellspacing="0">
+								<tr>
+									<td class="headingorange"><span class="heading"><mifos:mifoslabel
+										name="moratorium.define" bundle="moratoriumUIResources" /> - </span><mifos:mifoslabel
+										name="moratorium.categoryinfo" bundle="moratoriumUIResources" /></td>
+								</tr>
+								<tr>
+									<td class="fontnormal"><mifos:mifoslabel
+										name="moratorium.compfields" bundle="moratoriumUIResources" />
+									<mifos:mifoslabel name="moratorium.clickcanc"
+										bundle="moratoriumUIResources" /><br>
+									
+								</tr>
+								<tr>
+									<td>
+										<table width="100%">
+											<tr>
+												<td class="fontnormal" halign="center">
+													<html-el:radio property="searchString" value="1"/>
+													<mifos:mifoslabel name="moratorium.applyForOffice" bundle="moratoriumUIResources" />
+												</td>
+											</tr>
+										</table>
+									</td>
+								</tr>
+								<tr>
+									<td>
+										<table width="100%">	
+											<tr>
+												<td class="fontnormal" halign="center">
+													<html-el:radio property="searchString" value="2"/>
+													<mifos:mifoslabel name="moratorium.applyForClient" bundle="moratoriumUIResources" />
+												</td>
+											</tr>
+										</table>
+									</td>
+								</tr>								
+							</table>
+							<br>							
+							<table width="93%" border="0" cellpadding="0" cellspacing="0">
+								<tr>
+									<td align="center"><html-el:submit styleClass="buttn"
+										style="width:70px">
+										<mifos:mifoslabel name="moratorium.preview"
+											bundle="moratoriumUIResources" />
+									</html-el:submit> &nbsp; <html-el:button property="cancel"
+										styleClass="cancelbuttn" style="width:70px"
+										onclick="javascript:fnCancel(this.form)">
+										<mifos:mifoslabel name="moratorium.cancel"
+											bundle="moratoriumUIResources" />
+									</html-el:button></td>
+								</tr>
+							</table>
+							<br>
+							</td>
+						</tr>
+					</table>
+					<br>
+					</td>
+				</tr>
+			</table>
+			<html-el:hidden property="currentFlowKey" value="${requestScope.currentFlowKey}" />
+		</html-el:form>
+	</tiles:put>
+</tiles:insert>
Index: src/org/mifos/doc-root/application/moratorium/jsp/applyMoratoriumConfirm.jsp
===================================================================
--- src/org/mifos/doc-root/application/moratorium/jsp/applyMoratoriumConfirm.jsp	(revision 0)
+++ src/org/mifos/doc-root/application/moratorium/jsp/applyMoratoriumConfirm.jsp	(revision 0)
@@ -0,0 +1,221 @@
+<!-- 
+
+/**
+
+ * applyMoratoriumConfirm.jsp    version: 1.0
+
+ 
+
+ * Copyright (c) 2005-2006 Grameen Foundation USA
+
+ * 1029 Vermont Avenue, NW, Suite 400, Washington DC 20005
+
+ * All rights reserved.
+
+ 
+
+ * Apache License 
+ * Copyright (c) 2005-2006 Grameen Foundation USA 
+ * 
+
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License. You may obtain
+ * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 
+ *
+
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and limitations under the 
+
+ * License. 
+ * 
+ * See also http://www.apache.org/licenses/LICENSE-2.0.html for an explanation of the license 
+
+ * and how it is applied. 
+
+ *
+
+ */
+
+-->
+
+<%@taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
+<%@taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
+<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
+<%@taglib uri="/tags/mifos-html" prefix="mifos"%>
+<%@ taglib uri="/tags/date" prefix="date"%>
+<%@taglib uri="http://struts.apache.org/tags-html-el" prefix="html-el"%>
+<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
+<%@ taglib uri="/tags/struts-tiles" prefix="tiles"%>
+<%@ taglib uri="/sessionaccess" prefix="session"%>
+
+<tiles:insert definition=".withoutmenu">
+	<tiles:put name="body" type="string">
+		<script>
+				function fun_cancel(form) {
+				form.action="AdminAction.do?method=load";
+				form.submit();
+			}
+			
+			function goToEditPage(form){
+			form.action="moratoriumAction.do?method=previous";
+			form.submit();
+		  }
+		</script>
+
+		<html-el:form method="post" action="/moratoriumAction.do?method=createConfirmed">
+		<c:set value="${session:getFromSession(sessionScope.flowManager,requestScope.currentFlowKey,'BusinessKey')}" var="BusinessKey" />
+			<html-el:hidden property="customerId" value="${BusinessKey.customerId}" />
+			<table width="100%" border="0" cellspacing="0" cellpadding="0">
+				<tr>
+					<td height="470" align="left" valign="top" bgcolor="#FFFFFF">
+					<table width="90%" border="0" align="center" cellpadding="0"
+						cellspacing="0">
+						<tr>
+							<td align="center" class="heading">&nbsp;</td>
+						</tr>
+					</table>
+					<table width="90%" border="0" align="center" cellpadding="0"
+						cellspacing="0">
+						<tr>
+							<td class="bluetablehead">							
+									<table width="100%" border="0" cellspacing="0" cellpadding="0">
+										<tr>
+											<td width="25%">
+											<table border="0" cellspacing="0" cellpadding="0">
+												<tr>
+													<td><img src="pages/framework/images/timeline/tick.gif"
+														width="17" height="17"></td>
+													<td class="timelineboldgray"><mifos:mifoslabel
+														name="moratorium.categoryinfo" bundle="moratoriumUIResources" /></td>
+												</tr>
+											</table>
+											</td>
+											<td width="25%" align="center">
+											<table border="0" cellspacing="0" cellpadding="0">
+												<tr>
+													<td><img
+														src="pages/framework/images/timeline/tick.gif"
+														width="17" height="17"></td>
+													<td class="timelineboldgray"><mifos:mifoslabel
+												name="moratorium.info" bundle="moratoriumUIResources" /></td>
+												</tr>
+											</table>
+											</td>											
+											<td width="25%" align="right">
+											<table border="0" cellspacing="0" cellpadding="0">
+												<tr>
+													<td><img
+														src="pages/framework/images/timeline/bigarrow.gif"
+														width="17" height="17"></td>
+													<td class="timelineboldorange"><mifos:mifoslabel
+												name="moratorium.review" bundle="moratoriumUIResources" /></td>
+												</tr>
+											</table>
+											</td>
+										</tr>
+									</table>									
+							</td>
+						</tr>
+					</table>
+					<table width="90%" border="0" align="center" cellpadding="0"
+						cellspacing="0" class="bluetableborder">
+						<tr>
+							<td width="70%" height="24" align="left" valign="top"
+								class="paddingleftCreates">
+							<table width="98%" border="0" cellspacing="0" cellpadding="3">								
+                                <tr>
+									<td class="headingorange">								
+										<span class="heading"> 
+											<mifos:mifoslabel name="moratorium.define" /> -
+										</span>
+									<mifos:mifoslabel name="moratorium.reviewAndSubmit" /></td>
+								</tr>
+								<tr>
+									<td>
+										<span class="fontnormal">
+											<mifos:mifoslabel name="moratorium.confirmDetailInfo" />											
+										</span>
+									</td>
+								</tr>
+								<tr>
+									<td>
+										<span class="fontnormalbold">
+											<mifos:mifoslabel name="moratorium.clientName" isColonRequired="Yes"/>
+										</span>&nbsp;
+										<span class="fontnormal">
+											<c:out value="${BusinessKey.displayName}"/>
+										</span>
+									</td>
+								</tr>								
+							</table>
+							<br>
+							<table width="96%" border="0" cellspacing="0" cellpadding="0">
+								<tr>
+									<td>
+										<span class="fontnormalbold">
+											<mifos:mifoslabel isColonRequired="Yes" name="moratorium.StartDate" bundle="moratoriumUIResources"/>
+										</span>&nbsp;
+										<span class="fontnormal">
+										<c:out value="${sessionScope.moratoriumActionForm.moratoriumFromDateDD}"/>/<c:out value="${sessionScope.moratoriumActionForm.moratoriumFromDateMM}"/>/<c:out value="${sessionScope.moratoriumActionForm.moratoriumFromDateYY}"/>
+										</span>
+									</td>									
+								</tr>
+								<tr>
+									<td>
+										<span class="fontnormalbold">
+											<mifos:mifoslabel isColonRequired="Yes" name="moratorium.EndDate" bundle="moratoriumUIResources"/>
+										</span>&nbsp;
+										<span class="fontnormal">
+										<c:out value="${sessionScope.moratoriumActionForm.moratoriumEndDateDD}"/>/<c:out value="${sessionScope.moratoriumActionForm.moratoriumEndDateMM}"/>/<c:out value="${sessionScope.moratoriumActionForm.moratoriumEndDateYY}"/>
+										</span>
+									</td>									
+								</tr>
+								<tr>
+									<td>
+										<span class="fontnormalbold">
+											<mifos:mifoslabel isColonRequired="Yes" name="moratorium.notes" bundle="moratoriumUIResources"/>
+										</span>
+									</td>									
+								</tr>
+								<tr>
+									<td class="fontnormal">
+										<span class="fontnormal">
+											<c:out value="${sessionScope.moratoriumActionForm.moratoriumNotes}"/>
+										</span>
+									</td>
+								</tr>
+								<tr></tr><tr></tr>
+								<tr></tr><tr></tr>
+								<tr></tr><tr></tr>
+								<tr>
+									<td align="left" valign="top">
+					                    <html-el:button property="btn" style="width:200px;" styleClass="insidebuttn" onclick="goToEditPage(this.form);">
+					                    	<mifos:mifoslabel name="moratorium.editLabel" bundle="moratoriumUIResources"></mifos:mifoslabel>
+					                    </html-el:button>
+				                    </td>
+				                </tr>
+							</table><br>
+							<table width="96%" border="0" cellspacing="0" cellpadding="0">
+								<tr>
+									<td align="center">
+										<html-el:submit styleClass="buttn" style="width:70px;">
+											<mifos:mifoslabel name="moratorium.submit" />
+										</html-el:submit>
+									    &nbsp;&nbsp;
+										<html-el:button property="cancelButton" styleClass="cancelbuttn" style="width:70px;" onclick="fun_cancel(this.form);">
+											<mifos:mifoslabel name="accounts.cancel" />
+										</html-el:button>
+									</td>
+								</tr>
+							</table>
+							<br>
+					</table>
+					</td>
+				</tr>
+			</table>			
+			<html-el:hidden property="currentFlowKey" value="${requestScope.currentFlowKey}" />			
+		</html-el:form>
+	</tiles:put>
+</tiles:insert>
Index: src/org/mifos/doc-root/application/moratorium/jsp/applyBranchMoratoriumConfirm.jsp
===================================================================
--- src/org/mifos/doc-root/application/moratorium/jsp/applyBranchMoratoriumConfirm.jsp	(revision 0)
+++ src/org/mifos/doc-root/application/moratorium/jsp/applyBranchMoratoriumConfirm.jsp	(revision 0)
@@ -0,0 +1,221 @@
+<!-- 
+
+/**
+
+ * applyBranchMoratoriumConfirm.jsp    version: 1.0
+
+ 
+
+ * Copyright (c) 2005-2006 Grameen Foundation USA
+
+ * 1029 Vermont Avenue, NW, Suite 400, Washington DC 20005
+
+ * All rights reserved.
+
+ 
+
+ * Apache License 
+ * Copyright (c) 2005-2006 Grameen Foundation USA 
+ * 
+
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License. You may obtain
+ * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 
+ *
+
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and limitations under the 
+
+ * License. 
+ * 
+ * See also http://www.apache.org/licenses/LICENSE-2.0.html for an explanation of the license 
+
+ * and how it is applied. 
+
+ *
+
+ */
+
+-->
+
+<%@taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
+<%@taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
+<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
+<%@taglib uri="/tags/mifos-html" prefix="mifos"%>
+<%@ taglib uri="/tags/date" prefix="date"%>
+<%@taglib uri="http://struts.apache.org/tags-html-el" prefix="html-el"%>
+<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
+<%@ taglib uri="/tags/struts-tiles" prefix="tiles"%>
+<%@ taglib uri="/sessionaccess" prefix="session"%>
+
+<tiles:insert definition=".withoutmenu">
+	<tiles:put name="body" type="string">
+		<script>
+				function fun_cancel(form) {
+				form.action="AdminAction.do?method=load";
+				form.submit();
+			}
+			
+			function goToEditPage(form){
+			form.action="moratoriumAction.do?method=previous";
+			form.submit();
+		  }
+		</script>
+
+		<html-el:form method="post" action="/moratoriumAction.do?method=createConfirmed">
+		<c:set value="${session:getFromSession(sessionScope.flowManager,requestScope.currentFlowKey,'BusinessKey')}" var="BusinessKey" />
+			<html-el:hidden property="officeId" value="${BusinessKey.officeId}" />
+			<table width="100%" border="0" cellspacing="0" cellpadding="0">
+				<tr>
+					<td height="470" align="left" valign="top" bgcolor="#FFFFFF">
+					<table width="90%" border="0" align="center" cellpadding="0"
+						cellspacing="0">
+						<tr>
+							<td align="center" class="heading">&nbsp;</td>
+						</tr>
+					</table>
+					<table width="90%" border="0" align="center" cellpadding="0"
+						cellspacing="0">
+						<tr>
+							<td class="bluetablehead">							
+									<table width="100%" border="0" cellspacing="0" cellpadding="0">
+										<tr>
+											<td width="25%">
+											<table border="0" cellspacing="0" cellpadding="0">
+												<tr>
+													<td><img src="pages/framework/images/timeline/tick.gif"
+														width="17" height="17"></td>
+													<td class="timelineboldgray"><mifos:mifoslabel
+														name="moratorium.categoryinfo" bundle="moratoriumUIResources" /></td>
+												</tr>
+											</table>
+											</td>
+											<td width="25%" align="center">
+											<table border="0" cellspacing="0" cellpadding="0">
+												<tr>
+													<td><img
+														src="pages/framework/images/timeline/tick.gif"
+														width="17" height="17"></td>
+													<td class="timelineboldgray"><mifos:mifoslabel
+												name="moratorium.info" bundle="moratoriumUIResources" /></td>
+												</tr>
+											</table>
+											</td>											
+											<td width="25%" align="right">
+											<table border="0" cellspacing="0" cellpadding="0">
+												<tr>
+													<td><img
+														src="pages/framework/images/timeline/bigarrow.gif"
+														width="17" height="17"></td>
+													<td class="timelineboldorange"><mifos:mifoslabel
+												name="moratorium.review" bundle="moratoriumUIResources" /></td>
+												</tr>
+											</table>
+											</td>
+										</tr>
+									</table>									
+							</td>
+						</tr>
+					</table>
+					<table width="90%" border="0" align="center" cellpadding="0"
+						cellspacing="0" class="bluetableborder">
+						<tr>
+							<td width="70%" height="24" align="left" valign="top"
+								class="paddingleftCreates">
+							<table width="98%" border="0" cellspacing="0" cellpadding="3">								
+                                <tr>
+									<td class="headingorange">								
+										<span class="heading"> 
+											<mifos:mifoslabel name="moratorium.define" /> -
+										</span>
+									<mifos:mifoslabel name="moratorium.reviewAndSubmit" /></td>
+								</tr>
+								<tr>
+									<td>
+										<span class="fontnormal">
+											<mifos:mifoslabel name="moratorium.confirmDetailInfo" />											
+										</span>
+									</td>
+								</tr>
+								<tr>
+									<td>
+										<span class="fontnormalbold">
+											<mifos:mifoslabel name="moratorium.clientName" isColonRequired="Yes"/>
+										</span>&nbsp;
+										<span class="fontnormal">
+											<c:out value="${BusinessKey.officeName}"/>
+										</span>
+									</td>
+								</tr>								
+							</table>
+							<br>
+							<table width="96%" border="0" cellspacing="0" cellpadding="0">
+								<tr>
+									<td>
+										<span class="fontnormalbold">
+											<mifos:mifoslabel isColonRequired="Yes" name="moratorium.StartDate" bundle="moratoriumUIResources"/>
+										</span>&nbsp;
+										<span class="fontnormal">
+										<c:out value="${sessionScope.moratoriumActionForm.moratoriumFromDateDD}"/>/<c:out value="${sessionScope.moratoriumActionForm.moratoriumFromDateMM}"/>/<c:out value="${sessionScope.moratoriumActionForm.moratoriumFromDateYY}"/>
+										</span>
+									</td>									
+								</tr>
+								<tr>
+									<td>
+										<span class="fontnormalbold">
+											<mifos:mifoslabel isColonRequired="Yes" name="moratorium.EndDate" bundle="moratoriumUIResources"/>
+										</span>&nbsp;
+										<span class="fontnormal">
+										<c:out value="${sessionScope.moratoriumActionForm.moratoriumEndDateDD}"/>/<c:out value="${sessionScope.moratoriumActionForm.moratoriumEndDateMM}"/>/<c:out value="${sessionScope.moratoriumActionForm.moratoriumEndDateYY}"/>
+										</span>
+									</td>									
+								</tr>
+								<tr>
+									<td>
+										<span class="fontnormalbold">
+											<mifos:mifoslabel isColonRequired="Yes" name="moratorium.notes" bundle="moratoriumUIResources"/>
+										</span>
+									</td>									
+								</tr>
+								<tr>
+									<td class="fontnormal">
+										<span class="fontnormal">
+											<c:out value="${sessionScope.moratoriumActionForm.moratoriumNotes}"/>
+										</span>
+									</td>
+								</tr>
+								<tr></tr><tr></tr>
+								<tr></tr><tr></tr>
+								<tr></tr><tr></tr>
+								<tr>
+									<td align="left" valign="top">
+					                    <html-el:button property="btn" style="width:200px;" styleClass="insidebuttn" onclick="goToEditPage(this.form);">
+					                    	<mifos:mifoslabel name="moratorium.editLabel" bundle="moratoriumUIResources"></mifos:mifoslabel>
+					                    </html-el:button>
+				                    </td>
+				                </tr>
+							</table><br>
+							<table width="96%" border="0" cellspacing="0" cellpadding="0">
+								<tr>
+									<td align="center">
+										<html-el:submit styleClass="buttn" style="width:70px;">
+											<mifos:mifoslabel name="moratorium.submit" />
+										</html-el:submit>
+									    &nbsp;&nbsp;
+										<html-el:button property="cancelButton" styleClass="cancelbuttn" style="width:70px;" onclick="fun_cancel(this.form);">
+											<mifos:mifoslabel name="accounts.cancel" />
+										</html-el:button>
+									</td>
+								</tr>
+							</table>
+							<br>
+					</table>
+					</td>
+				</tr>
+			</table>			
+			<html-el:hidden property="currentFlowKey" value="${requestScope.currentFlowKey}" />			
+		</html-el:form>
+	</tiles:put>
+</tiles:insert>
Index: src/org/mifos/doc-root/application/moratorium/jsp/applyMoratorium.jsp
===================================================================
--- src/org/mifos/doc-root/application/moratorium/jsp/applyMoratorium.jsp	(revision 0)
+++ src/org/mifos/doc-root/application/moratorium/jsp/applyMoratorium.jsp	(revision 0)
@@ -0,0 +1,204 @@
+<!-- 
+
+/**
+
+ * applyMoratorium.jsp    version: 1.0
+
+ 
+
+ * Copyright (c) 2005-2006 Grameen Foundation USA
+
+ * 1029 Vermont Avenue, NW, Suite 400, Washington DC 20005
+
+ * All rights reserved.
+
+ 
+
+ * Apache License 
+ * Copyright (c) 2005-2006 Grameen Foundation USA 
+ * 
+
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License. You may obtain
+ * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 
+ *
+
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and limitations under the 
+
+ * License. 
+ * 
+ * See also http://www.apache.org/licenses/LICENSE-2.0.html for an explanation of the license 
+
+ * and how it is applied. 
+
+ *
+
+ */
+
+-->
+
+<%@taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
+<%@taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
+<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
+<%@taglib uri="/tags/mifos-html" prefix="mifos"%>
+<%@ taglib uri="/tags/date" prefix="date"%>
+<%@taglib uri="http://struts.apache.org/tags-html-el" prefix="html-el"%>
+<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
+<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles"%>
+<%@ taglib uri="/sessionaccess" prefix="session"%>
+<%@ taglib uri="/mifos/customtags" prefix="mifoscustom"%>
+<%@ taglib uri="/mifos/custom-tags" prefix="customtags"%>
+<tiles:insert definition=".withoutmenu">
+	<tiles:put name="body" type="string">
+		<script>
+				function fnCancel(form) {
+				form.action="AdminAction.do?method=load";
+				form.submit();
+			}
+		</script>
+
+		<SCRIPT SRC="pages/framework/js/date.js"></SCRIPT>
+		<html-el:form method="post"
+			action="/moratoriumAction.do?method=create">
+			<c:set value="${session:getFromSession(sessionScope.flowManager,requestScope.currentFlowKey,'BusinessKey')}" var="BusinessKey" />
+				   <!-- This hidden variable is being used in the next page -->
+			<html-el:hidden property="customerId" value="${BusinessKey.customerId}" />			
+			<html-el:hidden property="globalCustNum" value="${BusinessKey.globalCustNum}"/>
+				global customer no : <c:out value="${BusinessKey.globalCustNum}"/>
+			<table width="100%" border="0" cellspacing="0" cellpadding="0">
+				<tr>
+					<td height="470" align="left" valign="top" bgcolor="#FFFFFF">
+					<table width="90%" border="0" align="center" cellpadding="0"
+						cellspacing="0">
+						<tr>
+							<td align="center" class="heading">&nbsp;</td>
+						</tr>
+					</table>
+					<table width="90%" border="0" align="center" cellpadding="0"
+						cellspacing="0">
+						<tr>
+							<td class="bluetablehead">							
+									<table width="100%" border="0" cellspacing="0" cellpadding="0">
+										<tr>
+											<td width="25%">
+											<table border="0" cellspacing="0" cellpadding="0">
+												<tr>
+													<td><img src="pages/framework/images/timeline/tick.gif"
+														width="17" height="17"></td>
+													<td class="timelineboldgray"><mifos:mifoslabel
+														name="moratorium.categoryinfo" bundle="moratoriumUIResources" /></td>
+												</tr>
+											</table>
+											</td>
+											<td width="25%" align="center">
+											<table border="0" cellspacing="0" cellpadding="0">
+												<tr>
+													<td><img
+														src="pages/framework/images/timeline/bigarrow.gif"
+														width="17" height="17"></td>
+													<td class="timelineboldorange"><mifos:mifoslabel
+												name="moratorium.info" bundle="moratoriumUIResources" /></td>
+												</tr>
+											</table>
+											</td>											
+											<td width="25%" align="right">
+											<table border="0" cellspacing="0" cellpadding="0">
+												<tr>
+													<td><img
+														src="pages/framework/images/timeline/orangearrow.gif"
+														width="17" height="17"></td>
+													<td class="timelineboldorangelight"><mifos:mifoslabel
+												name="moratorium.review" bundle="moratoriumUIResources" /></td>
+												</tr>
+											</table>
+											</td>
+										</tr>
+									</table>									
+							</td>
+						</tr>
+					</table>
+					<table width="90%" border="0" align="center" cellpadding="0"
+						cellspacing="0" class="bluetableborder">
+						<tr>
+							<td width="70%" height="24" align="left" valign="top"
+								class="paddingleftCreates">
+							<table width="98%" border="0" cellspacing="0" cellpadding="3">								
+                                <tr>
+									<td class="headingorange">								
+										<span class="heading"> 
+											<mifos:mifoslabel name="moratorium.define" /> -
+										</span>
+									<mifos:mifoslabel name="moratorium.enterInfo" /></td>
+								</tr>
+								<tr>
+									<td class="fontnormalbold">
+										<span class="fontnormal">
+											<mifos:mifoslabel name="moratorium.enterDetailInfo1" />
+											<mifos:mifoslabel mandatory="yes" name="moratorium.enterDetailInfo2" />
+										</span>
+									</td>
+								</tr>
+								<tr>
+									<td class="fontnormalbold">
+										<span class="fontnormalbold">
+											<mifos:mifoslabel name="moratorium.clientName" isColonRequired="Yes"/>
+										</span>&nbsp;
+										<span class="fontnormal">
+											<c:out value="${BusinessKey.displayName}"/>
+										</span>
+									</td>
+								</tr>
+								<tr><logic:messagesPresent>
+								<td><br><font class="fontnormalRedBold"><html-el:errors bundle="moratoriumUIResources" /></font></td>
+								</logic:messagesPresent>
+								</tr>
+							</table>
+							<br>
+							<table width="96%" border="0" cellspacing="0" cellpadding="0">
+								<tr>
+									<td align="right" class="fontnormal"><mifos:mifoslabel
+										mandatory="yes" isColonRequired="Yes" name="moratorium.StartDate" bundle="moratoriumUIResources"/></td>
+									<td class="fontnormal"><date:datetag renderstyle="simple" property="moratoriumFromDate" /></td>
+								</tr>
+								<tr>
+									<td align="right" class="fontnormal"><mifos:mifoslabel
+										mandatory="yes" isColonRequired="Yes" name="moratorium.EndDate" bundle="moratoriumUIResources"/></td>
+									<td class="fontnormal"><date:datetag renderstyle="simple" property="moratoriumEndDate"/></td>
+								</tr>
+								<tr>
+									<td align="right" class="fontnormal"><mifos:mifoslabel
+										isColonRequired="Yes" name="moratorium.notes" bundle="moratoriumUIResources"/></td>
+									<td class="fontnormal">
+									<html-el:textarea property="moratoriumNotes" style="width:120px; height:90px;">
+									</html-el:textarea>
+									</td>
+								</tr>								
+							</table><br>
+							<table width="96%" border="0" cellspacing="0" cellpadding="0">
+								<tr>
+									<td align="center">
+										<html-el:submit property="continueButton" styleClass="buttn" style="width:70px;">
+											<mifos:mifoslabel name="moratorium.continue" />
+										</html-el:submit>
+									    &nbsp;&nbsp;
+										<html-el:button property="cancelButton" styleClass="cancelbuttn" style="width:70px;" onclick="javascript:fnCancel(this.form)">
+											<mifos:mifoslabel name="accounts.cancel" />
+										</html-el:button>
+									</td>
+								</tr>
+							</table>							
+							<br>
+					</table>
+					</td>
+				</tr>
+			</table>
+            <html:hidden property="perspective" value="${custSearchActionForm.perspective}"/>
+            <html:hidden property="method" value="create" />
+			<html-el:hidden property="currentFlowKey" value="${requestScope.currentFlowKey}" />
+			
+		</html-el:form>
+	</tiles:put>
+</tiles:insert>
Index: src/org/mifos/doc-root/application/moratorium/jsp/applyMoratoriumConfirm.jsp
===================================================================
--- src/org/mifos/doc-root/application/moratorium/jsp/applyMoratoriumConfirm.jsp	(revision 0)
+++ src/org/mifos/doc-root/application/moratorium/jsp/applyMoratoriumConfirm.jsp	(revision 0)
@@ -0,0 +1,221 @@
+<!-- 
+
+/**
+
+ * applyMoratoriumConfirm.jsp    version: 1.0
+
+ 
+
+ * Copyright (c) 2005-2006 Grameen Foundation USA
+
+ * 1029 Vermont Avenue, NW, Suite 400, Washington DC 20005
+
+ * All rights reserved.
+
+ 
+
+ * Apache License 
+ * Copyright (c) 2005-2006 Grameen Foundation USA 
+ * 
+
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License. You may obtain
+ * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 
+ *
+
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and limitations under the 
+
+ * License. 
+ * 
+ * See also http://www.apache.org/licenses/LICENSE-2.0.html for an explanation of the license 
+
+ * and how it is applied. 
+
+ *
+
+ */
+
+-->
+
+<%@taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
+<%@taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
+<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
+<%@taglib uri="/tags/mifos-html" prefix="mifos"%>
+<%@ taglib uri="/tags/date" prefix="date"%>
+<%@taglib uri="http://struts.apache.org/tags-html-el" prefix="html-el"%>
+<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
+<%@ taglib uri="/tags/struts-tiles" prefix="tiles"%>
+<%@ taglib uri="/sessionaccess" prefix="session"%>
+
+<tiles:insert definition=".withoutmenu">
+	<tiles:put name="body" type="string">
+		<script>
+				function fun_cancel(form) {
+				form.action="AdminAction.do?method=load";
+				form.submit();
+			}
+			
+			function goToEditPage(form){
+			form.action="moratoriumAction.do?method=previous";
+			form.submit();
+		  }
+		</script>
+
+		<html-el:form method="post" action="/moratoriumAction.do?method=createConfirmed">
+		<c:set value="${session:getFromSession(sessionScope.flowManager,requestScope.currentFlowKey,'BusinessKey')}" var="BusinessKey" />
+			<html-el:hidden property="customerId" value="${BusinessKey.customerId}" />
+			<table width="100%" border="0" cellspacing="0" cellpadding="0">
+				<tr>
+					<td height="470" align="left" valign="top" bgcolor="#FFFFFF">
+					<table width="90%" border="0" align="center" cellpadding="0"
+						cellspacing="0">
+						<tr>
+							<td align="center" class="heading">&nbsp;</td>
+						</tr>
+					</table>
+					<table width="90%" border="0" align="center" cellpadding="0"
+						cellspacing="0">
+						<tr>
+							<td class="bluetablehead">							
+									<table width="100%" border="0" cellspacing="0" cellpadding="0">
+										<tr>
+											<td width="25%">
+											<table border="0" cellspacing="0" cellpadding="0">
+												<tr>
+													<td><img src="pages/framework/images/timeline/tick.gif"
+														width="17" height="17"></td>
+													<td class="timelineboldgray"><mifos:mifoslabel
+														name="moratorium.categoryinfo" bundle="moratoriumUIResources" /></td>
+												</tr>
+											</table>
+											</td>
+											<td width="25%" align="center">
+											<table border="0" cellspacing="0" cellpadding="0">
+												<tr>
+													<td><img
+														src="pages/framework/images/timeline/tick.gif"
+														width="17" height="17"></td>
+													<td class="timelineboldgray"><mifos:mifoslabel
+												name="moratorium.info" bundle="moratoriumUIResources" /></td>
+												</tr>
+											</table>
+											</td>											
+											<td width="25%" align="right">
+											<table border="0" cellspacing="0" cellpadding="0">
+												<tr>
+													<td><img
+														src="pages/framework/images/timeline/bigarrow.gif"
+														width="17" height="17"></td>
+													<td class="timelineboldorange"><mifos:mifoslabel
+												name="moratorium.review" bundle="moratoriumUIResources" /></td>
+												</tr>
+											</table>
+											</td>
+										</tr>
+									</table>									
+							</td>
+						</tr>
+					</table>
+					<table width="90%" border="0" align="center" cellpadding="0"
+						cellspacing="0" class="bluetableborder">
+						<tr>
+							<td width="70%" height="24" align="left" valign="top"
+								class="paddingleftCreates">
+							<table width="98%" border="0" cellspacing="0" cellpadding="3">								
+                                <tr>
+									<td class="headingorange">								
+										<span class="heading"> 
+											<mifos:mifoslabel name="moratorium.define" /> -
+										</span>
+									<mifos:mifoslabel name="moratorium.reviewAndSubmit" /></td>
+								</tr>
+								<tr>
+									<td>
+										<span class="fontnormal">
+											<mifos:mifoslabel name="moratorium.confirmDetailInfo" />											
+										</span>
+									</td>
+								</tr>
+								<tr>
+									<td>
+										<span class="fontnormalbold">
+											<mifos:mifoslabel name="moratorium.clientName" isColonRequired="Yes"/>
+										</span>&nbsp;
+										<span class="fontnormal">
+											<c:out value="${BusinessKey.displayName}"/>
+										</span>
+									</td>
+								</tr>								
+							</table>
+							<br>
+							<table width="96%" border="0" cellspacing="0" cellpadding="0">
+								<tr>
+									<td>
+										<span class="fontnormalbold">
+											<mifos:mifoslabel isColonRequired="Yes" name="moratorium.StartDate" bundle="moratoriumUIResources"/>
+										</span>&nbsp;
+										<span class="fontnormal">
+										<c:out value="${sessionScope.moratoriumActionForm.moratoriumFromDateDD}"/>/<c:out value="${sessionScope.moratoriumActionForm.moratoriumFromDateMM}"/>/<c:out value="${sessionScope.moratoriumActionForm.moratoriumFromDateYY}"/>
+										</span>
+									</td>									
+								</tr>
+								<tr>
+									<td>
+										<span class="fontnormalbold">
+											<mifos:mifoslabel isColonRequired="Yes" name="moratorium.EndDate" bundle="moratoriumUIResources"/>
+										</span>&nbsp;
+										<span class="fontnormal">
+										<c:out value="${sessionScope.moratoriumActionForm.moratoriumEndDateDD}"/>/<c:out value="${sessionScope.moratoriumActionForm.moratoriumEndDateMM}"/>/<c:out value="${sessionScope.moratoriumActionForm.moratoriumEndDateYY}"/>
+										</span>
+									</td>									
+								</tr>
+								<tr>
+									<td>
+										<span class="fontnormalbold">
+											<mifos:mifoslabel isColonRequired="Yes" name="moratorium.notes" bundle="moratoriumUIResources"/>
+										</span>
+									</td>									
+								</tr>
+								<tr>
+									<td class="fontnormal">
+										<span class="fontnormal">
+											<c:out value="${sessionScope.moratoriumActionForm.moratoriumNotes}"/>
+										</span>
+									</td>
+								</tr>
+								<tr></tr><tr></tr>
+								<tr></tr><tr></tr>
+								<tr></tr><tr></tr>
+								<tr>
+									<td align="left" valign="top">
+					                    <html-el:button property="btn" style="width:200px;" styleClass="insidebuttn" onclick="goToEditPage(this.form);">
+					                    	<mifos:mifoslabel name="moratorium.editLabel" bundle="moratoriumUIResources"></mifos:mifoslabel>
+					                    </html-el:button>
+				                    </td>
+				                </tr>
+							</table><br>
+							<table width="96%" border="0" cellspacing="0" cellpadding="0">
+								<tr>
+									<td align="center">
+										<html-el:submit styleClass="buttn" style="width:70px;">
+											<mifos:mifoslabel name="moratorium.submit" />
+										</html-el:submit>
+									    &nbsp;&nbsp;
+										<html-el:button property="cancelButton" styleClass="cancelbuttn" style="width:70px;" onclick="fun_cancel(this.form);">
+											<mifos:mifoslabel name="accounts.cancel" />
+										</html-el:button>
+									</td>
+								</tr>
+							</table>
+							<br>
+					</table>
+					</td>
+				</tr>
+			</table>			
+			<html-el:hidden property="currentFlowKey" value="${requestScope.currentFlowKey}" />			
+		</html-el:form>
+	</tiles:put>
+</tiles:insert>
Index: src/org/mifos/doc-root/application/moratorium/jsp/applyMoratoriumForBranch.jsp
===================================================================
--- src/org/mifos/doc-root/application/moratorium/jsp/applyMoratoriumForBranch.jsp	(revision 0)
+++ src/org/mifos/doc-root/application/moratorium/jsp/applyMoratoriumForBranch.jsp	(revision 0)
@@ -0,0 +1,204 @@
+<!-- 
+
+/**
+
+ * applyMoratoriumForBranch.jsp    version: 1.0
+
+ 
+
+ * Copyright (c) 2005-2006 Grameen Foundation USA
+
+ * 1029 Vermont Avenue, NW, Suite 400, Washington DC 20005
+
+ * All rights reserved.
+
+ 
+
+ * Apache License 
+ * Copyright (c) 2005-2006 Grameen Foundation USA 
+ * 
+
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License. You may obtain
+ * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 
+ *
+
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and limitations under the 
+
+ * License. 
+ * 
+ * See also http://www.apache.org/licenses/LICENSE-2.0.html for an explanation of the license 
+
+ * and how it is applied. 
+
+ *
+
+ */
+
+-->
+
+<%@taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
+<%@taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
+<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
+<%@taglib uri="/tags/mifos-html" prefix="mifos"%>
+<%@ taglib uri="/tags/date" prefix="date"%>
+<%@taglib uri="http://struts.apache.org/tags-html-el" prefix="html-el"%>
+<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
+<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles"%>
+<%@ taglib uri="/sessionaccess" prefix="session"%>
+<%@ taglib uri="/mifos/customtags" prefix="mifoscustom"%>
+<%@ taglib uri="/mifos/custom-tags" prefix="customtags"%>
+<tiles:insert definition=".withoutmenu">
+	<tiles:put name="body" type="string">
+		<script>
+				function fnCancel(form) {
+				form.action="AdminAction.do?method=load";
+				form.submit();
+			}
+		</script>
+
+		<SCRIPT SRC="pages/framework/js/date.js"></SCRIPT>
+		<html-el:form method="post"
+			action="/moratoriumAction.do?method=create">
+			<c:set value="${session:getFromSession(sessionScope.flowManager,requestScope.currentFlowKey,'BusinessKey')}" var="BusinessKey" />
+				   <!-- This hidden variable is being used in the next page -->
+			<html-el:hidden property="officeId" value="${BusinessKey.officeId}" />			
+			<html-el:hidden property="globalOfficeNum" value="${BusinessKey.globalOfficeNum}"/>
+				global office no : <c:out value="${BusinessKey.globalOfficeNum}"/>
+			<table width="100%" border="0" cellspacing="0" cellpadding="0">
+				<tr>
+					<td height="470" align="left" valign="top" bgcolor="#FFFFFF">
+					<table width="90%" border="0" align="center" cellpadding="0"
+						cellspacing="0">
+						<tr>
+							<td align="center" class="heading">&nbsp;</td>
+						</tr>
+					</table>
+					<table width="90%" border="0" align="center" cellpadding="0"
+						cellspacing="0">
+						<tr>
+							<td class="bluetablehead">							
+									<table width="100%" border="0" cellspacing="0" cellpadding="0">
+										<tr>
+											<td width="25%">
+											<table border="0" cellspacing="0" cellpadding="0">
+												<tr>
+													<td><img src="pages/framework/images/timeline/tick.gif"
+														width="17" height="17"></td>
+													<td class="timelineboldgray"><mifos:mifoslabel
+														name="moratorium.categoryinfo" bundle="moratoriumUIResources" /></td>
+												</tr>
+											</table>
+											</td>
+											<td width="25%" align="center">
+											<table border="0" cellspacing="0" cellpadding="0">
+												<tr>
+													<td><img
+														src="pages/framework/images/timeline/bigarrow.gif"
+														width="17" height="17"></td>
+													<td class="timelineboldorange"><mifos:mifoslabel
+												name="moratorium.info" bundle="moratoriumUIResources" /></td>
+												</tr>
+											</table>
+											</td>											
+											<td width="25%" align="right">
+											<table border="0" cellspacing="0" cellpadding="0">
+												<tr>
+													<td><img
+														src="pages/framework/images/timeline/orangearrow.gif"
+														width="17" height="17"></td>
+													<td class="timelineboldorangelight"><mifos:mifoslabel
+												name="moratorium.review" bundle="moratoriumUIResources" /></td>
+												</tr>
+											</table>
+											</td>
+										</tr>
+									</table>									
+							</td>
+						</tr>
+					</table>
+					<table width="90%" border="0" align="center" cellpadding="0"
+						cellspacing="0" class="bluetableborder">
+						<tr>
+							<td width="70%" height="24" align="left" valign="top"
+								class="paddingleftCreates">
+							<table width="98%" border="0" cellspacing="0" cellpadding="3">								
+                                <tr>
+									<td class="headingorange">								
+										<span class="heading"> 
+											<mifos:mifoslabel name="moratorium.define" /> -
+										</span>
+									<mifos:mifoslabel name="moratorium.enterInfo" /></td>
+								</tr>
+								<tr>
+									<td class="fontnormalbold">
+										<span class="fontnormal">
+											<mifos:mifoslabel name="moratorium.enterDetailInfo1" />
+											<mifos:mifoslabel mandatory="yes" name="moratorium.enterDetailInfo2" />
+										</span>
+									</td>
+								</tr>
+								<tr>
+									<td class="fontnormalbold">
+										<span class="fontnormalbold">
+											<mifos:mifoslabel name="moratorium.clientName" isColonRequired="Yes"/>
+										</span>&nbsp;
+										<span class="fontnormal">
+											<c:out value="${BusinessKey.officeName}"/>
+										</span>
+									</td>
+								</tr>
+								<tr><logic:messagesPresent>
+								<td><br><font class="fontnormalRedBold"><html-el:errors bundle="moratoriumUIResources" /></font></td>
+								</logic:messagesPresent>
+								</tr>
+							</table>
+							<br>
+							<table width="96%" border="0" cellspacing="0" cellpadding="0">
+								<tr>
+									<td align="right" class="fontnormal"><mifos:mifoslabel
+										mandatory="yes" isColonRequired="Yes" name="moratorium.StartDate" bundle="moratoriumUIResources"/></td>
+									<td class="fontnormal"><date:datetag renderstyle="simple" property="moratoriumFromDate" /></td>
+								</tr>
+								<tr>
+									<td align="right" class="fontnormal"><mifos:mifoslabel
+										mandatory="yes" isColonRequired="Yes" name="moratorium.EndDate" bundle="moratoriumUIResources"/></td>
+									<td class="fontnormal"><date:datetag renderstyle="simple" property="moratoriumEndDate"/></td>
+								</tr>
+								<tr>
+									<td align="right" class="fontnormal"><mifos:mifoslabel
+										isColonRequired="Yes" name="moratorium.notes" bundle="moratoriumUIResources"/></td>
+									<td class="fontnormal">
+									<html-el:textarea property="moratoriumNotes" style="width:120px; height:90px;">
+									</html-el:textarea>
+									</td>
+								</tr>								
+							</table><br>
+							<table width="96%" border="0" cellspacing="0" cellpadding="0">
+								<tr>
+									<td align="center">
+										<html-el:submit property="continueButton" styleClass="buttn" style="width:70px;">
+											<mifos:mifoslabel name="moratorium.continue" />
+										</html-el:submit>
+									    &nbsp;&nbsp;
+										<html-el:button property="cancelButton" styleClass="cancelbuttn" style="width:70px;" onclick="javascript:fnCancel(this.form)">
+											<mifos:mifoslabel name="accounts.cancel" />
+										</html-el:button>
+									</td>
+								</tr>
+							</table>							
+							<br>
+					</table>
+					</td>
+				</tr>
+			</table>
+            
+            <html:hidden property="method" value="create" />
+			<html-el:hidden property="currentFlowKey" value="${requestScope.currentFlowKey}" />
+			
+		</html-el:form>
+	</tiles:put>
+</tiles:insert>
Index: src/org/mifos/doc-root/application/moratorium/jsp/configureBranchMoratorium.jsp
===================================================================
--- src/org/mifos/doc-root/application/moratorium/jsp/configureBranchMoratorium.jsp	(revision 0)
+++ src/org/mifos/doc-root/application/moratorium/jsp/configureBranchMoratorium.jsp	(revision 0)
@@ -0,0 +1,239 @@
+<!-- 
+
+/**
+
+ * configureBranchMoratorium.jsp    version: 1.0
+
+ 
+
+ * Copyright (c) 2005-2006 Grameen Foundation USA
+
+ * 1029 Vermont Avenue, NW, Suite 400, Washington DC 20005
+
+ * All rights reserved.
+
+ 
+
+ * Apache License 
+ * Copyright (c) 2005-2006 Grameen Foundation USA 
+ * 
+
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License. You may obtain
+ * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 
+ *
+
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and limitations under the 
+
+ * License. 
+ * 
+ * See also http://www.apache.org/licenses/LICENSE-2.0.html for an explanation of the license 
+
+ * and how it is applied. 
+
+ *
+
+ */
+
+-->
+
+
+<%@taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
+<%@taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
+<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
+<%@taglib uri="/tags/mifos-html" prefix="mifos"%>
+<%@taglib uri="http://struts.apache.org/tags-html-el" prefix="html-el"%>
+<%@ taglib uri="/tags/struts-tiles" prefix="tiles"%>
+<%@ taglib uri="/sessionaccess" prefix="session"%>
+
+<tiles:insert definition=".withoutmenu">
+	<tiles:put name="body" type="string">
+		<script language="javascript">
+		<!--
+			function fnCancel(form) {
+				form.action="AdminAction.do?method=load";
+				form.submit();
+			}
+		//-->
+		</script>
+		<html-el:form method="post"
+			action="/custSearchAction.do?method=search">
+			<table width="100%" border="0" cellspacing="0" cellpadding="0">
+				<tr>
+					<td height="470" align="left" valign="top" bgcolor="#FFFFFF">
+					<table width="90%" border="0" align="center" cellpadding="0"
+						cellspacing="0">
+						<tr>
+							<td align="center" class="heading">&nbsp;</td>
+						</tr>
+					</table>
+					<table width="90%" border="0" align="center" cellpadding="0"
+						cellspacing="0">
+						<tr>
+							<td class="bluetablehead">						
+							<table width="100%" border="0" cellspacing="0" cellpadding="0">
+								<tr>
+									<td width="25%">
+									<table border="0" cellspacing="0" cellpadding="0">
+										<tr>
+											<td><img src="pages/framework/images/timeline/bigarrow.gif"
+												width="17" height="17"></td>
+											<td class="timelineboldorange"><mifos:mifoslabel
+												name="moratorium.categoryinfo" bundle="moratoriumUIResources" /></td>
+										</tr>
+									</table>
+									</td>									
+									<td width="25%" align="right">
+									<table border="0" cellspacing="0" cellpadding="0">
+										<tr>
+											<td><img
+												src="pages/framework/images/timeline/orangearrow.gif"
+												width="17" height="17"></td>
+											<td class="timelineboldorangelight"><mifos:mifoslabel
+												name="moratorium.info" bundle="moratoriumUIResources" /></td>
+										</tr>
+									</table>
+									</td>
+									<td width="25%" align="right">
+									<table border="0" cellspacing="0" cellpadding="0">
+										<tr>
+											<td><img
+												src="pages/framework/images/timeline/orangearrow.gif"
+												width="17" height="17"></td>
+											<td class="timelineboldorangelight"><mifos:mifoslabel
+												name="moratorium.review" bundle="moratoriumUIResources" /></td>
+										</tr>
+									</table>
+									</td>
+								</tr>
+							</table>						
+							</td>
+						</tr>
+					</table>
+				
+					<table width="90%" border="0" align="center" cellpadding="0"
+						cellspacing="0" class="bluetableborder">
+						<tr>
+							<td width="70%" height="24" align="left" valign="top"
+								class="paddingleftCreates">
+							<table width="98%" border="0" cellspacing="0" cellpadding="3">                                
+                                <tr>
+									<td class="headingorange">								
+										<span class="heading"> 
+											<mifos:mifoslabel name="moratorium.define" /> -
+										</span>
+									<mifos:mifoslabel name="moratorium.categoryinfo" /></td>
+								</tr>
+								<tr>
+									<td class="fontnormalbold">
+										<span class="fontnormal">
+											<mifos:mifoslabel name="moratorium.enter_search_criteria_for_branch" />
+										</span>
+									</td>
+								</tr>
+								<tr>
+									<td>
+										<font class="fontnormalRedBold">
+											<html-el:errors bundle="CustomerSearchUIResources" /> 
+										</font>
+									</td>
+								</tr>
+							</table>
+							
+							<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
+								<tr>
+									<td><c:set var="parentOffice" /> <c:set var="branch" />
+										<c:choose>
+											<c:when test="${empty session:getFromSession(sessionScope.flowManager,requestScope.currentFlowKey,'branchOfficeList')}">
+												<c:set var="branch" value="level" />
+												<br>
+												<table width="95%" border="0" cellspacing="0" cellpadding="0">
+													<tr>
+														<td width="61%"><span class="fontnormalbold"> <mifos:mifoslabel
+															name="Office.labelBranchOffice" bundle="OfficeUIResources" />
+														</span></td>
+														<td width="39%" align="right"></td>
+													</tr>
+												</table>
+											</c:when>
+											<c:otherwise>
+												<c:forEach var="office" items="${session:getFromSession(sessionScope.flowManager,requestScope.currentFlowKey,'branchOfficeList')}"
+													varStatus="counter">
+													<c:if
+														test="${office.level.id == OfficeLevel.BRANCHOFFICE.value && empty branch}">
+														<c:set var="branch" value="level" />
+														<br>
+														<table width="95%" border="0" cellspacing="0" cellpadding="0">
+															<tr>
+																<td width="61%"><span class="fontnormalbold"> <c:out
+																	value="${office.level.name}"></c:out> </span></td>
+																<td width="39%" align="right"></td>
+															</tr>
+														</table>
+													</c:if>
+													<c:if
+														test="${ !empty parentOffice  && parentOffice != office.parentOffice.officeName}">
+														<br>
+														<span class="fontnormal"><c:out
+															value="${office.parentOffice.officeName}" /></span>
+													</c:if>
+													<c:if test="${empty parentOffice}">
+														<span class="fontnormal"><c:out
+															value="${office.parentOffice.officeName}" /></span>
+														<c:set var="parentOffice"
+															value="${office.parentOffice.officeName}" />
+														<c:set var="branch" value="${office.parentOffice.officeName}" />
+													</c:if>
+													<table width="90%" border="0" cellspacing="0" cellpadding="0">
+														<tr class="fontnormal">
+															<td width="1%"><img
+																src="pages/framework/images/bullet_circle.gif" width="9"
+																height="11"></td>
+															<td width="99%"><html-el:link
+																href="moratoriumAction.do?method=loadForBranch&officeId=${office.officeId}&randomNUm=${sessionScope.randomNUm}">
+																<c:out value="${office.officeName}" />
+															</html-el:link> &nbsp;&nbsp;&nbsp; <c:if
+																test="${office.status.id == OfficeStatus.INACTIVE.value}">
+																<mifos:MifosImage id="inactive" moduleName="office" />
+																<c:out value="${office.status.name}" />
+															</c:if></td>
+														</tr>
+													</table>
+												</c:forEach>
+											</c:otherwise>
+										</c:choose>
+									</td>
+								</tr>
+								<tr>
+									<td align="center" class="blueline">&nbsp;</td>
+				                </tr>
+							</table>
+							
+							<br>
+							<table width="90%" border="0" align="center" cellspacing="0" cellpadding="3">								
+								<tr class="fontnormal">									
+									<td align="center"><br>									
+									<html-el:button property="cancelButton"
+											onclick="javascript:fnCancel(this.form)"
+											styleClass="cancelbuttn" style="width:70px;">
+											<mifos:mifoslabel name="accounts.cancel" />
+										</html-el:button>
+									</td>
+								</tr>
+							</table><br>
+							</td>
+						</tr>
+					</table><br>
+					</td>
+				</tr>
+			</table>
+			<html:hidden property="method" value="search" />
+			<html:hidden property="perspective" value="${custSearchActionForm.perspective}"/>
+			<html-el:hidden property="currentFlowKey" value="${requestScope.currentFlowKey}" />
+			<html:hidden property="input" value="moratorium" />
+		</html-el:form>
+	</tiles:put>
+</tiles:insert>
Index: src/org/mifos/doc-root/application/moratorium/jsp/configureClientMoratorium.jsp
===================================================================
--- src/org/mifos/doc-root/application/moratorium/jsp/configureClientMoratorium.jsp	(revision 0)
+++ src/org/mifos/doc-root/application/moratorium/jsp/configureClientMoratorium.jsp	(revision 0)
@@ -0,0 +1,179 @@
+<!-- 
+
+/**
+
+ * configureClientMoratorium.jsp    version: 1.0
+
+ 
+
+ * Copyright (c) 2005-2006 Grameen Foundation USA
+
+ * 1029 Vermont Avenue, NW, Suite 400, Washington DC 20005
+
+ * All rights reserved.
+
+ 
+
+ * Apache License 
+ * Copyright (c) 2005-2006 Grameen Foundation USA 
+ * 
+
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License. You may obtain
+ * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 
+ *
+
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and limitations under the 
+
+ * License. 
+ * 
+ * See also http://www.apache.org/licenses/LICENSE-2.0.html for an explanation of the license 
+
+ * and how it is applied. 
+
+ *
+
+ */
+
+-->
+
+
+<%@taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
+<%@taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
+<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
+<%@taglib uri="/tags/mifos-html" prefix="mifos"%>
+<%@taglib uri="http://struts.apache.org/tags-html-el" prefix="html-el"%>
+<%@ taglib uri="/tags/struts-tiles" prefix="tiles"%>
+
+<tiles:insert definition=".withoutmenu">
+	<tiles:put name="body" type="string">
+		<script language="javascript">
+		<!--
+			function fnCancel(form) {
+				form.action="AdminAction.do?method=load";
+				form.submit();
+			}
+		//-->
+		</script>
+		<html-el:form method="post"
+			action="/custSearchAction.do?method=search">
+			<table width="100%" border="0" cellspacing="0" cellpadding="0">
+				<tr>
+					<td height="470" align="left" valign="top" bgcolor="#FFFFFF">
+					<table width="90%" border="0" align="center" cellpadding="0"
+						cellspacing="0">
+						<tr>
+							<td align="center" class="heading">&nbsp;</td>
+						</tr>
+					</table>
+					<table width="90%" border="0" align="center" cellpadding="0"
+						cellspacing="0">
+						<tr>
+							<td class="bluetablehead">						
+							<table width="100%" border="0" cellspacing="0" cellpadding="0">
+								<tr>
+									<td width="25%">
+									<table border="0" cellspacing="0" cellpadding="0">
+										<tr>
+											<td><img src="pages/framework/images/timeline/bigarrow.gif"
+												width="17" height="17"></td>
+											<td class="timelineboldorange"><mifos:mifoslabel
+												name="moratorium.categoryinfo" bundle="moratoriumUIResources" /></td>
+										</tr>
+									</table>
+									</td>									
+									<td width="25%" align="right">
+									<table border="0" cellspacing="0" cellpadding="0">
+										<tr>
+											<td><img
+												src="pages/framework/images/timeline/orangearrow.gif"
+												width="17" height="17"></td>
+											<td class="timelineboldorangelight"><mifos:mifoslabel
+												name="moratorium.info" bundle="moratoriumUIResources" /></td>
+										</tr>
+									</table>
+									</td>
+									<td width="25%" align="right">
+									<table border="0" cellspacing="0" cellpadding="0">
+										<tr>
+											<td><img
+												src="pages/framework/images/timeline/orangearrow.gif"
+												width="17" height="17"></td>
+											<td class="timelineboldorangelight"><mifos:mifoslabel
+												name="moratorium.review" bundle="moratoriumUIResources" /></td>
+										</tr>
+									</table>
+									</td>
+								</tr>
+							</table>						
+							</td>
+						</tr>
+					</table>
+				
+					<table width="90%" border="0" align="center" cellpadding="0"
+						cellspacing="0" class="bluetableborder">
+						<tr>
+							<td width="70%" height="24" align="left" valign="top"
+								class="paddingleftCreates">
+							<table width="98%" border="0" cellspacing="0" cellpadding="3">                                
+                                <tr>
+									<td class="headingorange">								
+										<span class="heading"> 
+											<mifos:mifoslabel name="moratorium.define" /> -
+										</span>
+									<mifos:mifoslabel name="moratorium.categoryinfo" /></td>
+								</tr>
+								<tr>
+									<td class="fontnormalbold">
+										<span class="fontnormal">
+											<mifos:mifoslabel name="moratorium.enter_search_criteria" />
+										</span>
+									</td>
+								</tr>
+								<tr>
+									<td>
+										<font class="fontnormalRedBold">
+											<html-el:errors bundle="CustomerSearchUIResources" /> 
+										</font>
+									</td>
+								</tr>
+							</table>
+							<br>
+							<table width="90%" border="0" cellspacing="0" cellpadding="3">
+								<tr class="fontnormal">
+									<td align="right"><mifos:mifoslabel
+										name="moratorium.client_type" />:</td>
+									<td><html-el:text styleId="111"
+										property="searchString" maxlength="200"/> </td>
+								</tr>
+								<tr class="fontnormal">
+									<td width="30%">&nbsp;</td>
+									<td width="70%"><br>
+									<html-el:submit property="searchButton" styleClass="buttn"
+										style="width:70px;">
+										<mifos:mifoslabel name="accounts.search" />
+									</html-el:submit>&nbsp;
+									<html-el:button property="cancelButton"
+											onclick="javascript:fnCancel(this.form)"
+											styleClass="cancelbuttn" style="width:70px;">
+											<mifos:mifoslabel name="accounts.cancel" />
+										</html-el:button>
+									</td>
+								</tr>
+							</table><br>
+							</td>
+						</tr>
+					</table><br>
+					</td>
+				</tr>
+			</table>
+			<html:hidden property="method" value="search" />
+			<html:hidden property="perspective" value="${custSearchActionForm.perspective}"/>
+			<html-el:hidden property="currentFlowKey" value="${requestScope.currentFlowKey}" />
+			<html:hidden property="input" value="moratorium" />
+		</html-el:form>
+	</tiles:put>
+</tiles:insert>
Index: src/org/mifos/doc-root/application/moratorium/jsp/configureMoratorium.jsp
===================================================================
--- src/org/mifos/doc-root/application/moratorium/jsp/configureMoratorium.jsp	(revision 0)
+++ src/org/mifos/doc-root/application/moratorium/jsp/configureMoratorium.jsp	(revision 0)
@@ -0,0 +1,172 @@
+<!--
+
+/**
+
+ * configureMoratorium.jsp    version: 1.0
+
+
+
+ * Copyright (c) 2005-2006 Grameen Foundation USA
+
+ * 1029 Vermont Avenue, NW, Suite 400, Washington DC 20005
+
+ * All rights reserved.
+
+
+
+ * Apache License
+ * Copyright (c) 2005-2006 Grameen Foundation USA
+ *
+
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License. You may obtain
+ * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
+ *
+
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and limitations under the
+
+ * License.
+ *
+ * See also http://www.apache.org/licenses/LICENSE-2.0.html for an explanation of the license
+
+ * and how it is applied.
+
+ *
+
+ */
+
+-->
+
+<%@taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
+<%@taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
+<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
+<%@taglib uri="/tags/mifos-html" prefix="mifos"%>
+<%@taglib uri="http://struts.apache.org/tags-html-el" prefix="html-el"%>
+<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles"%>
+<%@ taglib uri="/sessionaccess" prefix="session"%>
+
+<tiles:insert definition=".create">
+	<tiles:put name="body" type="string">
+		<script language="javascript">
+		<!--
+			function fnCancel(form) {
+				form.action="AdminAction.do?method=load";
+				form.submit();
+			}
+		//-->
+		</script>
+		<html-el:form action="/moratoriumAction.do?method=loadSearch">
+			<table width="100%" border="0" cellspacing="0" cellpadding="0">
+				<tr>
+					<td height="350" align="left" valign="top" bgcolor="#FFFFFF">
+					<table width="90%" border="0" align="center" cellpadding="0"
+						cellspacing="0">
+						<tr>
+							<td align="center" class="heading">&nbsp;</td>
+						</tr>
+					</table>
+					<table width="90%" border="0" align="center" cellpadding="0"
+						cellspacing="0">
+						<tr>
+							<td class="bluetablehead">
+							<table width="100%" border="0" cellspacing="0" cellpadding="0">
+								<tr>
+									<td width="27%" align="left">
+									<table border="0" cellspacing="0" cellpadding="0">
+										<tr>
+											<td><html-el:img
+												src="pages/framework/images/timeline/bigarrow.gif"
+												width="17" height="17" /></td>
+											<td class="timelineboldorange"><mifos:mifoslabel
+												name="moratorium.moratoriumcatinfo" bundle="moratoriumUIResources" /></td>
+										</tr>
+									</table>
+									</td>
+									<td width="73%" align="right">
+									<table border="0" cellspacing="0" cellpadding="0">
+										<tr>
+											<td><html-el:img
+												src="pages/framework/images/timeline/orangearrow.gif"
+												width="17" height="17" /></td>
+											<td class="timelineboldorangelight"><mifos:mifoslabel
+												name="moratorium.review" bundle="moratoriumUIResources" /></td>
+										</tr>
+									</table>
+									</td>
+								</tr>
+							</table>
+							</td>
+						</tr>
+					</table>
+					<table width="90%" border="0" align="center" cellpadding="0"
+						cellspacing="0" class="bluetableborder">
+						<tr>
+							<td align="left" valign="top" class="paddingleftCreates">
+							<table width="93%" border="0" cellpadding="3" cellspacing="0">
+								<tr>
+									<td class="headingorange"><span class="heading"><mifos:mifoslabel
+										name="moratorium.define" bundle="moratoriumUIResources" /> - </span><mifos:mifoslabel
+										name="moratorium.categoryinfo" bundle="moratoriumUIResources" /></td>
+								</tr>
+								<tr>
+									<td class="fontnormal"><mifos:mifoslabel
+										name="moratorium.compfields" bundle="moratoriumUIResources" />
+									<mifos:mifoslabel name="moratorium.clickcanc"
+										bundle="moratoriumUIResources" /><br>
+									
+								</tr>
+								<tr>
+									<td>
+										<table width="100%">
+											<tr>
+												<td class="fontnormal" halign="center">
+													<html-el:radio property="searchString" value="1"/>
+													<mifos:mifoslabel name="moratorium.applyForOffice" bundle="moratoriumUIResources" />
+												</td>
+											</tr>
+										</table>
+									</td>
+								</tr>
+								<tr>
+									<td>
+										<table width="100%">	
+											<tr>
+												<td class="fontnormal" halign="center">
+													<html-el:radio property="searchString" value="2"/>
+													<mifos:mifoslabel name="moratorium.applyForClient" bundle="moratoriumUIResources" />
+												</td>
+											</tr>
+										</table>
+									</td>
+								</tr>								
+							</table>
+							<br>							
+							<table width="93%" border="0" cellpadding="0" cellspacing="0">
+								<tr>
+									<td align="center"><html-el:submit styleClass="buttn"
+										style="width:70px">
+										<mifos:mifoslabel name="moratorium.preview"
+											bundle="moratoriumUIResources" />
+									</html-el:submit> &nbsp; <html-el:button property="cancel"
+										styleClass="cancelbuttn" style="width:70px"
+										onclick="javascript:fnCancel(this.form)">
+										<mifos:mifoslabel name="moratorium.cancel"
+											bundle="moratoriumUIResources" />
+									</html-el:button></td>
+								</tr>
+							</table>
+							<br>
+							</td>
+						</tr>
+					</table>
+					<br>
+					</td>
+				</tr>
+			</table>
+			<html-el:hidden property="currentFlowKey" value="${requestScope.currentFlowKey}" />
+		</html-el:form>
+	</tiles:put>
+</tiles:insert>
Index: src/org/mifos/doc-root/application/moratorium/jsp/editMoratoriums.jsp
===================================================================
--- src/org/mifos/doc-root/application/moratorium/jsp/editMoratoriums.jsp	(revision 0)
+++ src/org/mifos/doc-root/application/moratorium/jsp/editMoratoriums.jsp	(revision 0)
@@ -0,0 +1,168 @@
+<!--
+/**
+
+* editMoratoriums.jsp    version: 1.0
+
+
+
+* Copyright (c) 2005-2006 Grameen Foundation USA
+
+* 1029 Vermont Avenue, NW, Suite 400, Washington DC 20005
+
+* All rights reserved.
+
+
+
+* Apache License
+* Copyright (c) 2005-2006 Grameen Foundation USA
+*
+
+* Licensed under the Apache License, Version 2.0 (the "License"); you may
+* not use this file except in compliance with the License. You may obtain
+* a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
+*
+
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and limitations under the
+
+* License.
+*
+* See also http://www.apache.org/licenses/LICENSE-2.0.html for an explanation of the license
+
+* and how it is applied.
+
+*
+* 
+*/
+ -->
+
+<%@ taglib uri="/tags/struts-tiles" prefix="tiles"%>
+<%@ taglib uri="/tags/struts-html-el" prefix="html-el"%>
+<%@ taglib uri="/tags/mifos-html" prefix="mifos"%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+<%@ taglib uri="/sessionaccess" prefix="session"%>
+<%@ taglib uri="/tags/date" prefix="date"%>
+<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
+<tiles:insert definition=".view">
+<tiles:put name="body" type="string">
+<script language="javascript">
+		<!--
+			function fnCancel(form) {
+				form.action="AdminAction.do?method=load";
+				form.submit();
+			}
+		//-->
+		</script>
+<html-el:form action="/moratoriumAction.do?method=editPreview">
+<c:set value="${session:getFromSession(sessionScope.flowManager,requestScope.currentFlowKey,'BusinessKey')}" var="BusinessKey" />
+<table width="95%" border="0" cellpadding="0" cellspacing="0">
+        <tr>
+          <td class="bluetablehead05">
+	          <span class="fontnormal8pt">
+	          	 <html-el:link action="AdminAction.do?method=load&randomNUm=${sessionScope.randomNUm}">
+					<mifos:mifoslabel name="moratorium.labelLinkAdmin" bundle="moratoriumUIResources"/>	
+				</html-el:link> /
+	          </span>
+	          <span class="fontnormal8pt">
+	          	<html-el:link action="moratoriumAction.do?method=get&randomNUm=${sessionScope.randomNUm}">
+          			<mifos:mifoslabel name="moratorium.labelLinkViewMoratoriums1" bundle="moratoriumUIResources"/>          			
+          		</html-el:link> /
+          	   </span>
+          	   <span class="fontnormal8ptbold">
+          			<mifos:mifoslabel name="moratorium.labelViewDetails" bundle="moratoriumUIResources"/>          			
+          	   </span>
+          </td>
+        </tr>
+      </table>
+      <table width="95%" border="0" cellpadding="0" cellspacing="0">
+        <tr>
+          <td width="70%" align="left" valign="top" class="paddingL15T15"><table width="98%" border="0" cellspacing="0" cellpadding="3">
+            <tr>
+              <td width="35%">
+              	<span class="heading">
+    	          	<c:out value="${BusinessKey.appliedTo}"/>
+    	        </span> - 	            
+              	<span class="headingorange">
+              	   <mifos:mifoslabel name="moratorium.labelEditMoratoriums" bundle="moratoriumUIResources"/>
+              	</span>
+              </td>
+            </tr>
+            
+            <tr>
+			  <td class="fontnormalbold">			     
+	            <span class="fontnormal">
+					<mifos:mifoslabel name="moratorium.labelEditMoratoriumsInfo1" bundle="moratoriumUIResources" />
+					<mifos:mifoslabel mandatory="yes" name="moratorium.labelEditMoratoriumsInfo2" bundle="moratoriumUIResources" />
+				</span>
+            	 <br><br>
+                 
+              </td>
+            </tr>
+            
+            <tr>
+            	<logic:messagesPresent>
+            		<td>
+            			<br><font class="fontnormalRedBold"><html-el:errors bundle="moratoriumUIResources" /></font>
+            		</td>
+				</logic:messagesPresent>
+			</tr>
+            
+            <tr>
+				<td class="fontnormalbold">
+					<span class="fontnormalbold">
+						<mifos:mifoslabel name="moratorium.labelEditMoratoriumDetails" />
+					</span>					
+				</td>
+			</tr>    
+          </table>
+          
+	        <table width="96%" border="0" cellspacing="0" cellpadding="0">
+				<tr>
+					<td align="right" class="fontnormal">
+						<mifos:mifoslabel isColonRequired="Yes" name="moratorium.StartDate" bundle="moratoriumUIResources"/>
+					</td>
+					<td class="fontnormal"><date:datetag renderstyle="simple" isDisabled="Yes" property="moratoriumFromDate" /></td>
+				</tr>
+				<tr>
+					<td align="right" class="fontnormal">
+						<mifos:mifoslabel mandatory="yes" isColonRequired="Yes" name="moratorium.EndDate" bundle="moratoriumUIResources"/>
+					</td>
+					<td class="fontnormal"><date:datetag renderstyle="simple" property="moratoriumEndDate"/></td>
+				</tr>
+				<tr>
+					<td align="right" class="fontnormal">
+						<mifos:mifoslabel isColonRequired="Yes" name="moratorium.notes" bundle="moratoriumUIResources"/>
+					</td>
+					<td class="fontnormal">
+						<html-el:textarea property="moratoriumNotes" disabled="true" style="width:240px; height:90px;"></html-el:textarea>
+					</td>
+				</tr>								
+			</table><br>
+			<table width="96%" border="0" cellspacing="0" cellpadding="0">
+				<tr>
+					<td align="center">
+						<html-el:submit property="Preview" styleClass="buttn" style="width:70px;">
+							<mifos:mifoslabel name="moratorium.preview" bundle="moratoriumUIResources" />
+						</html-el:submit>
+						&nbsp;&nbsp;
+						<html-el:button property="cancelButton" styleClass="cancelbuttn" style="width:70px;" onclick="javascript:fnCancel(this.form)">
+							<mifos:mifoslabel name="moratorium.cancel" bundle="moratoriumUIResources" />
+						</html-el:button>
+					</td>
+				</tr>
+			</table>                      
+          
+          
+            <br>
+          </td>
+          </tr>
+      </table>
+      <br>
+   	  <html-el:hidden property="currentFlowKey" value="${requestScope.currentFlowKey}" />
+   	  <html-el:hidden property="moratoriumId" value="${BusinessKey.moratoriumId}" />
+   	  <html-el:hidden property="officeId" value="${BusinessKey.officeId}" />
+      </html-el:form>
+</tiles:put>
+</tiles:insert>
Index: src/org/mifos/doc-root/application/moratorium/jsp/editMoratoriumsPreview.jsp
===================================================================
--- src/org/mifos/doc-root/application/moratorium/jsp/editMoratoriumsPreview.jsp	(revision 0)
+++ src/org/mifos/doc-root/application/moratorium/jsp/editMoratoriumsPreview.jsp	(revision 0)
@@ -0,0 +1,181 @@
+<!--
+/**
+
+* editMoratoriumsPreview.jsp    version: 1.0
+
+
+
+* Copyright (c) 2005-2006 Grameen Foundation USA
+
+* 1029 Vermont Avenue, NW, Suite 400, Washington DC 20005
+
+* All rights reserved.
+
+
+
+* Apache License
+* Copyright (c) 2005-2006 Grameen Foundation USA
+*
+
+* Licensed under the Apache License, Version 2.0 (the "License"); you may
+* not use this file except in compliance with the License. You may obtain
+* a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
+*
+
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and limitations under the
+
+* License.
+*
+* See also http://www.apache.org/licenses/LICENSE-2.0.html for an explanation of the license
+
+* and how it is applied.
+
+*
+* 
+*/
+ -->
+
+<%@ taglib uri="/tags/struts-tiles" prefix="tiles"%>
+<%@ taglib uri="/tags/struts-html-el" prefix="html-el"%>
+<%@ taglib uri="/tags/mifos-html" prefix="mifos"%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+<%@ taglib uri="/sessionaccess" prefix="session"%>
+<%@ taglib uri="/tags/date" prefix="date"%>
+<tiles:insert definition=".view">
+<tiles:put name="body" type="string">		
+		<script>
+				function fnCancel(form) {
+				form.action="AdminAction.do?method=load";
+				form.submit();
+			}
+			
+			function goToEditPage(form){
+			form.action="moratoriumAction.do?method=previousEdit";
+			form.submit();
+		  }
+		</script>
+<html-el:form action="/moratoriumAction.do?method=updateMoratorium">
+<c:set value="${session:getFromSession(sessionScope.flowManager,requestScope.currentFlowKey,'BusinessKey')}" var="BusinessKey" />
+<table width="95%" border="0" cellpadding="0" cellspacing="0">
+        <tr>
+          <td class="bluetablehead05">
+	          <span class="fontnormal8pt">
+	          	 <html-el:link action="AdminAction.do?method=load&randomNUm=${sessionScope.randomNUm}">
+					<mifos:mifoslabel name="moratorium.labelLinkAdmin" bundle="moratoriumUIResources"/>	
+				</html-el:link> /
+	          </span>
+	          <span class="fontnormal8pt">
+	          	<html-el:link action="moratoriumAction.do?method=get&randomNUm=${sessionScope.randomNUm}">
+          			<mifos:mifoslabel name="moratorium.labelLinkViewMoratoriums1" bundle="moratoriumUIResources"/>          			
+          		</html-el:link> /
+          	   </span>
+          	   <span class="fontnormal8ptbold">
+          			<mifos:mifoslabel name="moratorium.labelViewDetails" bundle="moratoriumUIResources"/>          			
+          	   </span>
+          </td>
+        </tr>
+      </table>
+      <table width="95%" border="0" cellpadding="0" cellspacing="0">
+        <tr>
+          <td width="70%" align="left" valign="top" class="paddingL15T15"><table width="98%" border="0" cellspacing="0" cellpadding="3">
+            <tr>
+              <td width="35%">
+              	<span class="heading">
+    	          	<c:out value="${BusinessKey.appliedTo}"/>
+    	        </span> - 	            
+              	<span class="headingorange">
+              	   <mifos:mifoslabel name="moratorium.labelPreviewEditMoratoriums" bundle="moratoriumUIResources"/>
+              	</span>
+              </td>
+            </tr>
+            
+            <tr>
+			  <td class="fontnormalbold">			     
+	            <span class="fontnormal">
+					<mifos:mifoslabel name="moratorium.labelPreviewEditMoratoriumsInfo1" bundle="moratoriumUIResources" />					
+				</span>
+            	 <br><br>
+                 
+              </td>
+            </tr>
+            
+            <tr>
+				<td class="fontnormalbold">
+					<span class="fontnormalbold">
+						<mifos:mifoslabel name="moratorium.labelEditMoratoriumDetails" />
+					</span>					
+				</td>
+			</tr>    
+          </table>
+          
+	        <table width="96%" border="0" cellspacing="0" cellpadding="0">	        	
+				<tr>
+					<td>
+						<span class="fontnormalbold">
+							<mifos:mifoslabel isColonRequired="Yes" name="moratorium.StartDate" bundle="moratoriumUIResources"/>
+						</span>&nbsp;
+						<span class="fontnormal">
+							<c:out value="${sessionScope.moratoriumActionForm.moratoriumFromDateDD}"/>/<c:out value="${sessionScope.moratoriumActionForm.moratoriumFromDateMM}"/>/<c:out value="${sessionScope.moratoriumActionForm.moratoriumFromDateYY}"/>
+						</span>
+					</td>									
+				</tr>
+				<tr>
+					<td>
+						<span class="fontnormalbold">
+							<mifos:mifoslabel isColonRequired="Yes" name="moratorium.EndDate" bundle="moratoriumUIResources"/>
+						</span>&nbsp;
+						<span class="fontnormal">
+							<c:out value="${sessionScope.moratoriumActionForm.moratoriumEndDateDD}"/>/<c:out value="${sessionScope.moratoriumActionForm.moratoriumEndDateMM}"/>/<c:out value="${sessionScope.moratoriumActionForm.moratoriumEndDateYY}"/>
+						</span>
+					</td>									
+				</tr>
+				<tr>
+					<td>
+						<span class="fontnormalbold">
+							<mifos:mifoslabel isColonRequired="Yes" name="moratorium.notes" bundle="moratoriumUIResources"/>
+						</span>
+					</td>									
+				</tr>
+				<tr>
+					<td class="fontnormal">
+						<span class="fontnormal">
+							<c:out value="${sessionScope.moratoriumActionForm.moratoriumNotes}"/>
+						</span>
+					</td>
+				</tr>
+				<tr></tr><tr></tr>
+				<tr></tr><tr></tr>
+				<tr></tr><tr></tr>
+				<tr>
+					<td align="left" valign="top">
+						<html-el:button property="btn" style="width:200px;" styleClass="insidebuttn" onclick="goToEditPage(this.form);">
+					    	<mifos:mifoslabel name="moratorium.editLabel" bundle="moratoriumUIResources"></mifos:mifoslabel>
+					    </html-el:button>
+				    </td>
+				</tr>								
+			</table><br>
+			<table width="96%" border="0" cellspacing="0" cellpadding="0">
+				<tr>
+					<td align="center">
+						<html-el:submit styleClass="buttn" style="width:70px;">
+							<mifos:mifoslabel name="moratorium.submit" />
+						</html-el:submit>
+						&nbsp;&nbsp;
+						<html-el:button property="cancelButton" styleClass="cancelbuttn" style="width:70px;" onclick="fnCancel(this.form);">
+							<mifos:mifoslabel name="moratorium.cancel" bundle="moratoriumUIResources" />
+						</html-el:button>
+					</td>
+				</tr>
+			</table>
+            <br>
+          </td>
+          </tr>
+      </table>
+      <br>
+   	  <html-el:hidden property="currentFlowKey" value="${requestScope.currentFlowKey}" />   	  
+      </html-el:form>
+</tiles:put>
+</tiles:insert>
Index: src/org/mifos/doc-root/application/moratorium/jsp/moratoriumSearchResults.jsp
===================================================================
--- src/org/mifos/doc-root/application/moratorium/jsp/moratoriumSearchResults.jsp	(revision 0)
+++ src/org/mifos/doc-root/application/moratorium/jsp/moratoriumSearchResults.jsp	(revision 0)
@@ -0,0 +1,177 @@
+<!-- 
+
+/**
+
+ * moratoriumSearchResults.jsp    version: 1.0
+
+ 
+
+ * Copyright (c) 2005-2006 Grameen Foundation USA
+
+ * 1029 Vermont Avenue, NW, Suite 400, Washington DC 20005
+
+ * All rights reserved.
+
+ 
+
+ * Apache License 
+ * Copyright (c) 2005-2006 Grameen Foundation USA 
+ * 
+
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License. You may obtain
+ * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 
+ *
+
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and limitations under the 
+
+ * License. 
+ * 
+ * See also http://www.apache.org/licenses/LICENSE-2.0.html for an explanation of the license 
+
+ * and how it is applied. 
+
+ *
+
+ */
+
+-->
+
+<%@taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
+<%@taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
+<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
+<%@taglib uri="/tags/mifos-html" prefix="mifos"%>
+<%@taglib uri="http://struts.apache.org/tags-html-el" prefix="html-el"%>
+<%@ taglib uri="/tags/struts-tiles" prefix="tiles"%>
+<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
+
+<tiles:insert definition=".withoutmenu">
+	<tiles:put name="body" type="string">
+		<script>
+				function fnCancel(form) {
+				form.action="AdminAction.do?method=load";
+				form.submit();
+			}
+		</script>
+
+		<html-el:form method="post"
+			action="/custSearchAction.do?method=search">			
+			<table width="100%" border="0" cellspacing="0" cellpadding="0">
+				<tr>
+					<td height="470" align="left" valign="top" bgcolor="#FFFFFF">
+					<table width="90%" border="0" align="center" cellpadding="0"
+						cellspacing="0">
+						<tr>
+							<td align="center" class="heading">&nbsp;</td>
+						</tr>
+					</table>
+					<table width="90%" border="0" align="center" cellpadding="0"
+						cellspacing="0">
+						<tr>
+							<td class="bluetablehead">							
+									<table width="100%" border="0" cellspacing="0" cellpadding="0">
+										<tr>
+											<td width="25%">
+											<table border="0" cellspacing="0" cellpadding="0">
+												<tr>
+													<td><img src="pages/framework/images/timeline/bigarrow.gif"
+														width="17" height="17"></td>
+													<td class="timelineboldorange"><mifos:mifoslabel
+														name="moratorium.categoryinfo" bundle="moratoriumUIResources" /></td>
+												</tr>
+											</table>
+											</td>
+											<td width="25%" align="center">
+											<table border="0" cellspacing="0" cellpadding="0">
+												<tr>
+													<td><img
+														src="pages/framework/images/timeline/orangearrow.gif"
+														width="17" height="17"></td>
+													<td class="timelineboldorangelight"><mifos:mifoslabel
+												name="moratorium.info" bundle="moratoriumUIResources" /></td>
+												</tr>
+											</table>
+											</td>											
+											<td width="25%" align="right">
+											<table border="0" cellspacing="0" cellpadding="0">
+												<tr>
+													<td><img
+														src="pages/framework/images/timeline/orangearrow.gif"
+														width="17" height="17"></td>
+													<td class="timelineboldorangelight"><mifos:mifoslabel
+												name="moratorium.review" bundle="moratoriumUIResources" /></td>
+												</tr>
+											</table>
+											</td>
+										</tr>
+									</table>									
+							</td>
+						</tr>
+					</table>
+					<table width="90%" border="0" align="center" cellpadding="0"
+						cellspacing="0" class="bluetableborder">
+						<tr>
+							<td width="70%" height="24" align="left" valign="top"
+								class="paddingleftCreates">
+							<table width="98%" border="0" cellspacing="0" cellpadding="3">								
+                                <tr>
+									<td class="headingorange">								
+										<span class="heading"> 
+											<mifos:mifoslabel name="moratorium.define" /> -
+										</span>
+									<mifos:mifoslabel name="moratorium.categoryinfo" /></td>
+								</tr>
+								<tr>
+									<td class="fontnormalbold">
+										<span class="fontnormal">
+											<mifos:mifoslabel name="moratorium.enter_search_criteria" />
+										</span>
+									</td>
+								</tr>
+								<tr><logic:messagesPresent>
+								<td><br><font class="fontnormalRedBold"><html-el:errors bundle="accountsUIResources" /></font></td>
+								</logic:messagesPresent>
+								</tr>
+							</table>
+							<br>
+							<table width="96%" border="0" cellspacing="0" cellpadding="0">
+								<tr align="left">
+									<td class="fontnormal"><mifos:mifoslabel
+										name="accounts.search_for" />:&nbsp; <html-el:text
+										styleId="111" property="searchString" maxlength="200"/> &nbsp;
+									<html-el:submit property="searchButton" styleClass="buttn"
+										style="width:70px;">
+										<mifos:mifoslabel name="accounts.search" />
+									</html-el:submit></td>
+								</tr>
+								<tr class="fontnormal">
+									<td>
+										<mifos:mifostabletagdata name="moratorium" key="moratoriumSearch" 
+										type="single" width="100%" border="0" cellspacing="0" cellpadding="0" />										
+								   </td>
+								</tr>
+							</table><br>
+							<table width="96%" border="0" cellspacing="0" cellpadding="0">
+								<tr>
+									<td align="center"><html-el:button property="cancelButton"
+										styleClass="cancelbuttn" style="width:70px;"
+										onclick="javascript:fnCancel(this.form)">
+										<mifos:mifoslabel name="accounts.cancel" />
+									</html-el:button></td>
+								</tr>
+							</table>
+							<br>
+					</table>
+					</td>
+				</tr>
+			</table>
+            <html:hidden property="perspective" value="${custSearchActionForm.perspective}"/>
+            <html:hidden property="method" value="search" />
+			<html-el:hidden property="currentFlowKey" value="${requestScope.currentFlowKey}" />
+			
+		</html-el:form>
+	</tiles:put>
+</tiles:insert>
Index: src/org/mifos/doc-root/application/moratorium/jsp/viewMoratoriums.jsp
===================================================================
--- src/org/mifos/doc-root/application/moratorium/jsp/viewMoratoriums.jsp	(revision 0)
+++ src/org/mifos/doc-root/application/moratorium/jsp/viewMoratoriums.jsp	(revision 0)
@@ -0,0 +1,185 @@
+<!--
+/**
+
+* viewMoratoriums.jsp    version: 1.0
+
+
+
+* Copyright (c) 2005-2006 Grameen Foundation USA
+
+* 1029 Vermont Avenue, NW, Suite 400, Washington DC 20005
+
+* All rights reserved.
+
+
+
+* Apache License
+* Copyright (c) 2005-2006 Grameen Foundation USA
+*
+
+* Licensed under the Apache License, Version 2.0 (the "License"); you may
+* not use this file except in compliance with the License. You may obtain
+* a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
+*
+
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and limitations under the
+
+* License.
+*
+* See also http://www.apache.org/licenses/LICENSE-2.0.html for an explanation of the license
+
+* and how it is applied.
+
+*
+* 
+*/
+ -->
+
+<%@ taglib uri="/tags/struts-tiles" prefix="tiles"%>
+<%@ taglib uri="/tags/struts-html-el" prefix="html-el"%>
+<%@ taglib uri="/tags/mifos-html" prefix="mifos"%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+<%@ taglib uri="/sessionaccess" prefix="session"%>
+
+<tiles:insert definition=".view">
+<tiles:put name="body" type="string">
+<html-el:form action="/moratoriumAction.do">
+<table width="95%" border="0" cellpadding="0" cellspacing="0">
+        <tr>
+          <td class="bluetablehead05">
+	          <span class="fontnormal8pt">
+	          	 <html-el:link action="AdminAction.do?method=load&randomNUm=${sessionScope.randomNUm}">
+					<mifos:mifoslabel name="moratorium.labelLinkAdmin" bundle="moratoriumUIResources"/>	
+				</html-el:link> /
+	          </span><span class="fontnormal8ptbold">
+          			<mifos:mifoslabel name="moratorium.labelLinkViewMoratoriums1" bundle="moratoriumUIResources"/>          			
+          	   </span>
+          </td>
+        </tr>
+      </table>
+      <table width="95%" border="0" cellpadding="0" cellspacing="0">
+        <tr>
+          <td width="70%" align="left" valign="top" class="paddingL15T15"><table width="98%" border="0" cellspacing="0" cellpadding="3">
+            <tr>
+              <td width="35%">	            
+              	<span class="headingorange">
+              	   <mifos:mifoslabel name="moratorium.labelLinkViewMoratoriums2" bundle="moratoriumUIResources"/>
+              	</span>
+              </td>
+            </tr>
+            
+            <tr>
+			  <td class="fontnormalbold">
+			     <span class="fontnormal">
+	                <mifos:mifoslabel name="moratorium.labelLinkListMOratoriums" bundle="moratoriumUIResources"/>
+	                <mifos:mifoslabel name="moratorium.labelLinkClickHere" bundle="moratoriumUIResources"/>
+					<html-el:link action="moratoriumAction.do?method=configure&currentFlowKey=${requestScope.currentFlowKey}">
+						<mifos:mifoslabel name="moratorium.labelAddNewMoratorium" bundle="moratoriumUIResources"/>
+					</html-el:link>
+	             </span>
+            	 <br><br>
+                 
+              </td>
+            </tr>    
+          </table>
+          
+	        
+            <span class="fontnormalbold">
+			  <mifos:mifoslabel name="moratorium.labelActiveMoratoriums" bundle="moratoriumUIResources"/>			  
+    	    </span>
+            <br><br>
+            <table width="98%" border="0" cellpadding="3" cellspacing="0">
+              <tr>              
+                <td width="11%" class="drawtablehd">
+               		 <mifos:mifoslabel name="moratorium.labelAppliedTo" bundle="moratoriumUIResources"/>
+                </td>
+                <td width="20%" class="drawtablehd">
+               		 <mifos:mifoslabel name="moratorium.labelStartDateEndDate" bundle="moratoriumUIResources"/>
+                </td>
+                <td width="12%" class="drawtablehd">
+                	<mifos:mifoslabel name="moratorium.labelCreatedBy" bundle="moratoriumUIResources"/>
+				</td>
+				<td width="50%" class="drawtablehd">
+                	<mifos:mifoslabel name="moratorium.labelNotes" bundle="moratoriumUIResources"/>
+				</td>
+				<td width="7%" class="drawtablehd">
+                	&nbsp;
+				</td>
+              </tr>
+              <c:forEach var="moratorium" items="${requestScope.openMoratoriums}" >
+	              <tr>
+	                <td width="11%" class="drawtablerow">${moratorium.appliedTo}</td>
+	                <td width="20%" class="drawtablerow">${moratorium.startDate} - ${moratorium.endDate}</td>
+	                <td width="12%" class="drawtablerow">${moratorium.morCreatedBy}</td>
+	                <td width="50%" class="drawtablerow">${moratorium.notes}</td>
+	                <td width="7%" class="drawtablerow">
+	                	<html-el:link href="moratoriumAction.do?method=edit&moratoriumId=${moratorium.moratoriumId}&customerId=${moratorium.customerId}&officeId=${moratorium.officeId}&currentFlowKey=${requestScope.currentFlowKey}">
+	                		<mifos:mifoslabel name="moratorium.edit" bundle="moratoriumUIResources" />						
+						</html-el:link>
+					</td>
+	              </tr>
+              </c:forEach>           
+              <tr>
+                <td width="11%" class="drawtablerow">&nbsp;</td>
+                <td width="20%" class="drawtablerow">&nbsp;</td>
+                <td width="12%" class="drawtablerow">&nbsp;</td>
+                <td width="50%" class="drawtablerow">&nbsp;</td>
+                <td width="7%" class="drawtablerow">&nbsp;</td>
+              </tr>             
+            </table>
+            
+            <span class="fontnormalbold">
+			  <mifos:mifoslabel name="moratorium.labelClosedMoratoriums" bundle="moratoriumUIResources"/>			  
+    	    </span>
+            <br><br>
+            <table width="98%" border="0" cellpadding="3" cellspacing="0">
+              <tr>              
+                <td width="11%" class="drawtablehd">
+               		 <mifos:mifoslabel name="moratorium.labelAppliedTo" bundle="moratoriumUIResources"/>
+                </td>
+                <td width="20%" class="drawtablehd">
+               		 <mifos:mifoslabel name="moratorium.labelStartDateEndDate" bundle="moratoriumUIResources"/>
+                </td>
+                <td width="12%" class="drawtablehd">
+                	<mifos:mifoslabel name="moratorium.labelCreatedBy" bundle="moratoriumUIResources"/>
+				</td>
+				<td width="50%" class="drawtablehd">
+                	<mifos:mifoslabel name="moratorium.labelNotes" bundle="moratoriumUIResources"/>
+				</td>
+				<td width="7%" class="drawtablehd">
+                	&nbsp;
+				</td>
+              </tr>
+              <c:forEach var="moratorium" items="${requestScope.closedMoratoriums}" >
+	              <tr>
+	                <td width="11%" class="drawtablerow">${moratorium.appliedTo}</td>
+	                <td width="20%" class="drawtablerow">${moratorium.startDate} - ${moratorium.endDate}</td>
+	                <td width="12%" class="drawtablerow">${moratorium.morCreatedBy}</td>
+	                <td width="50%" class="drawtablerow">${moratorium.notes}</td>
+	                <td width="7%" class="drawtablerow">
+	                	<a href="#" disabled>Edit </a>
+					</td>	                
+	              </tr>
+              </c:forEach>           
+              <tr>
+                <td width="11%" class="drawtablerow">&nbsp;</td>
+                <td width="20%" class="drawtablerow">&nbsp;</td>
+                <td width="12%" class="drawtablerow">&nbsp;</td>
+                <td width="50%" class="drawtablerow">&nbsp;</td>
+                <td width="7%" class="drawtablerow">&nbsp;</td>
+              </tr>             
+            </table>            
+          
+          
+            <br>
+          </td>
+          </tr>
+      </table>
+      <br>
+   	  <html-el:hidden property="currentFlowKey" value="${requestScope.currentFlowKey}" />
+      </html-el:form>
+</tiles:put>
+</tiles:insert>
Index: src/org/mifos/framework/security/util/ActivityMapper.java
===================================================================
--- src/org/mifos/framework/security/util/ActivityMapper.java	(revision 12167)
+++ src/org/mifos/framework/security/util/ActivityMapper.java	(working copy)
@@ -58,6 +58,7 @@
 import org.mifos.application.holiday.struts.action.HolidayAction;
 import org.mifos.application.login.struts.action.LoginAction;
 import org.mifos.application.meeting.struts.action.MeetingAction;
+import org.mifos.application.moratorium.struts.action.MoratoriumAction;
 import org.mifos.application.personnel.struts.action.PersonAction;
 import org.mifos.application.personnel.struts.action.PersonnelNoteAction;
 import org.mifos.application.personnel.struts.action.PersonnelSettingsAction;
@@ -257,6 +258,9 @@
 		parseActionSecurity(PPIAction.getSecurity());
 		parseActionSecurity(AcceptedPaymentTypeAction.getSecurity());
 		parseActionSecurity(ReportsCategoryAction.getSecurity());
+		
+		// for moratorium module
+		parseActionSecurity(MoratoriumAction.getSecurity());
 	}
 
 	private void addCustomerSearchMappings() {
Index: src/org/mifos/framework/struts/action/SearchAction.java
===================================================================
--- src/org/mifos/framework/struts/action/SearchAction.java	(revision 12167)
+++ src/org/mifos/framework/struts/action/SearchAction.java	(working copy)
@@ -8,6 +8,7 @@
 import org.apache.struts.action.ActionMapping;
 import org.mifos.application.accounts.util.helpers.AccountTypes;
 import org.mifos.application.customer.exceptions.CustomerException;
+import org.mifos.application.customer.struts.actionforms.CustSearchActionForm;
 import org.mifos.application.customer.util.helpers.CustomerLevel;
 import org.mifos.application.util.helpers.ActionForwards;
 import org.mifos.framework.business.service.BusinessService;
@@ -81,7 +82,12 @@
 	public ActionForward search(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)throws Exception {
 		cleanUpSearch(request);
 		SessionUtils.setQueryResultAttribute(Constants.SEARCH_RESULTS,getSearchResult(form),request);
-		return mapping.findForward(ActionForwards.search_success.toString());
+		CustSearchActionForm actionForm = (CustSearchActionForm) form;
+		// changed for moratorium
+		if(actionForm.getInput() != null && actionForm.getInput().equals("moratorium"))
+			return mapping.findForward(ActionForwards.moratorium_search_success.toString());
+		else
+			return mapping.findForward(ActionForwards.search_success.toString());
 	}
 	
 	protected QueryResult getSearchResult(ActionForm form) throws Exception{
Index: src/org/mifos/framework/util/resources/hibernate.cfg.xml
===================================================================
--- src/org/mifos/framework/util/resources/hibernate.cfg.xml	(revision 12167)
+++ src/org/mifos/framework/util/resources/hibernate.cfg.xml	(working copy)
@@ -207,6 +207,9 @@
     	<mapping resource="org/mifos/application/surveys/business/SurveyQuestion.hbm.xml"/>
     	<mapping resource="org/mifos/application/acceptedpaymenttype/business/AcceptedPaymentType.hbm.xml" />
 		<mapping resource="org/mifos/application/acceptedpaymenttype/business/TransactionTypeEntity.hbm.xml" />
+		
+		<!-- Mapping files for moratorium module -->
+		<mapping resource="org/mifos/application/moratorium/business/MoratoriumBO.hbm.xml" />
 			 
 	</session-factory>
 
Index: src/org/mifos/META-INF/struts-config.xml
===================================================================
--- src/org/mifos/META-INF/struts-config.xml	(revision 12167)
+++ src/org/mifos/META-INF/struts-config.xml	(working copy)
@@ -144,6 +144,9 @@
 		<!-- End Products mix -->
 		<!--  Accepted Payment Type Form -->
 		<form-bean name="acceptedpaymenttypeactionform" type="org.mifos.application.acceptedpaymenttype.struts.actionform.AcceptedPaymentTypeActionForm"></form-bean>
+		
+		<!-- Moratorium module -->
+		<form-bean name="moratoriumActionForm" type="org.mifos.application.moratorium.struts.actionforms.MoratoriumActionForm"></form-bean>
 
 	</form-beans>
 
@@ -227,7 +230,7 @@
 			<forward name="mainSearch_failure" path="/pages/application/customer/jsp/search_result.jsp" />
 			<forward name="getHomePage_success" path="/pages/application/customer/jsp/home.jsp" />
 			<forward name="loadallbranches_success" path="/custSearchAction.do?method=mainSearch" />
-
+			<forward name="moratorium_search_success" 	path="/pages/application/moratorium/jsp/moratoriumSearchResults.jsp"/>
     </action>
 	<action path="/customerAccountAction"
 				type="org.mifos.application.customer.struts.action.CustomerAccountAction"
@@ -1362,7 +1365,35 @@
              <forward name="update_success" path="/AdminAction.do?method=load" redirect="true"/>
              <forward name="get_success" path="/pages/application/ppi/jsp/get.jsp"/>             
         </action>
-
+		
+		<!-- added for moratorium [start] -->
+		<action path="/moratoriumAction"
+          type="org.mifos.application.moratorium.struts.action.MoratoriumAction"
+          parameter="method"
+          scope="session"
+          validate="true"
+          input="/moratoriumAction.do?method=validate" 
+          name="moratoriumActionForm">
+             <forward name="configure" path="/pages/application/moratorium/jsp/configureMoratorium.jsp"/>
+             <forward name="loadSearch" path="/pages/application/moratorium/jsp/configureClientMoratorium.jsp"/>             
+             <forward name="loadSearchForBranch" path="/pages/application/moratorium/jsp/configureBranchMoratorium.jsp"/>
+             <forward name="load" path="/pages/application/moratorium/jsp/applyMoratorium.jsp"/>
+             <forward name="loadForBranch" path="/pages/application/moratorium/jsp/applyMoratoriumForBranch.jsp"/>
+             <forward name="create" path="/pages/application/moratorium/jsp/applyMoratoriumConfirm.jsp"/>
+             <forward name="createForBranch" path="/pages/application/moratorium/jsp/applyBranchMoratoriumConfirm.jsp"/>             
+             <forward name="previewCreateMoratorium_failure" path="/pages/application/moratorium/jsp/applyMoratorium.jsp"/>
+             <forward name="previewCreateBranchMoratorium_failure" path="/pages/application/moratorium/jsp/applyMoratoriumForBranch.jsp"/>
+             <forward name="get_success" path="/pages/application/moratorium/jsp/viewMoratoriums.jsp"/>
+             <forward name="edit_success" path="/pages/application/moratorium/jsp/editMoratoriums.jsp"/>
+             <forward name="editpreview_success" path="/pages/application/moratorium/jsp/editMoratoriumsPreview.jsp"/>
+             <forward name="update_success" path="/moratoriumAction.do?method=get"/>
+             <forward name="editPreviewMoratorium_failure" path="/pages/application/moratorium/jsp/editMoratoriums.jsp"/>
+             <forward name="create_success" path="/AdminAction.do?method=load"></forward>
+             <forward name="previous_success" path="/pages/application/moratorium/jsp/applyMoratorium.jsp"></forward>
+             <forward name="previous_success_for_branch" path="/pages/application/moratorium/jsp/applyMoratoriumForBranch.jsp"></forward>
+             <forward name="edit_previous_success" path="/pages/application/moratorium/jsp/editMoratoriums.jsp"></forward>
+        </action>
+        <!-- added for moratorium [end] -->
 	</action-mappings>
 
 	<controller nocache="false" processorClass="org.mifos.framework.struts.action.MifosRequestProcessor" contentType="text/html; charset=UTF-8"></controller>
@@ -1419,6 +1450,9 @@
     <message-resources key="PPIUIResources" parameter="org.mifos.application.ppi.util.resources.PPIUIResources" factory="org.mifos.framework.struts.tags.MifosPropertyMessageResourcesFactory"/>
     <!--  Accepted Payment Type resources -->
     <message-resources key="acceptedPaymentTypeUIResources" parameter="org.mifos.application.acceptedpaymenttype.util.resources.AcceptedPaymentTypeUIResources"  ></message-resources>
+    
+    <!-- Moratorium resources -->
+    <message-resources key="moratoriumUIResources" parameter="org.mifos.application.moratorium.util.resources.MoratoriumUIResources" factory="org.mifos.framework.struts.tags.MifosPropertyMessageResourcesFactory" />
 
 	<plug-in className="org.mifos.framework.struts.plugin.InitializerPlugin"/>
 	<plug-in className="org.apache.struts.tiles.TilesPlugin">
Index: test/org/mifos/application/customer/business/service/TestCustomerBusinessService.java
===================================================================
--- test/org/mifos/application/customer/business/service/TestCustomerBusinessService.java	(revision 12167)
+++ test/org/mifos/application/customer/business/service/TestCustomerBusinessService.java	(working copy)
@@ -1032,4 +1032,13 @@
 				loanOffering2);
 		clientSavingsAccount = getSavingsAccount(client, "SavingPrd11", "abc2");
 	}
+	
+	// added for moratorium [start]
+	public void testSearchCenterGroupAndClient() throws Exception {
+		createInitialCustomers();
+		QueryResult queryResult = new CustomerBusinessService()
+				.searchCenterGroupClient("cl", Short.valueOf("1"));
+		assertNotNull(queryResult);
+	}
+	// added for moratorium [end]
 }
Index: test/org/mifos/application/customer/persistence/TestCustomerPersistence.java
===================================================================
--- test/org/mifos/application/customer/persistence/TestCustomerPersistence.java	(revision 12167)
+++ test/org/mifos/application/customer/persistence/TestCustomerPersistence.java	(working copy)
@@ -1242,4 +1242,15 @@
 				AccountState.LOANACC_ACTIVEINGOODSTANDING, startDate,
 				loanOffering);
 	}
+	
+	// added for moratorium [start]
+	public void testSearchCenterGropAndClient() throws Exception {
+		createCustomers(CustomerStatus.CENTER_ACTIVE,
+				CustomerStatus.GROUP_ACTIVE, CustomerStatus.CLIENT_ACTIVE);
+		HibernateUtil.commitTransaction();
+		QueryResult queryResult = new CustomerPersistence().searchCenterGroupClient(
+				"C", Short.valueOf("1"));
+		assertNotNull(queryResult);
+	}
+	// added for moratorium [end]
 }
Index: test/org/mifos/application/customer/struts-config.xml
===================================================================
--- test/org/mifos/application/customer/struts-config.xml	(revision 12167)
+++ test/org/mifos/application/customer/struts-config.xml	(working copy)
@@ -69,7 +69,7 @@
 			<forward name="mainSearch_failure" path="/pages/application/customer/jsp/search_result.jsp" />
 			<forward name="getHomePage_success" path="/pages/application/customer/jsp/home.jsp" />
 			<forward name="loadallbranches_success" path="/custSearchAction.do?method=mainSearch" />
-        		
+        	<forward name="moratorium_search_success" 	path="/pages/application/moratorium/jsp/moratoriumSearchResults.jsp"/>	
        	</action>
   		<action path="/custApplyAdjustment" type="org.mifos.application.customer.struts.action.CustomerApplyAdjustmentAction" 
       		name="custApplyAdjustmentActionForm" 
Index: test/org/mifos/application/customer/struts/action/TestCustSearchAction.java
===================================================================
--- test/org/mifos/application/customer/struts/action/TestCustSearchAction.java	(revision 12167)
+++ test/org/mifos/application/customer/struts/action/TestCustSearchAction.java	(working copy)
@@ -261,4 +261,18 @@
 		center = TestObjectFactory.createCenter("Center",
 				meeting);
 	}
+	
+	// added for moratorium [start]
+	public void testSearchForMoratorium()throws Exception{
+		createGroupWithCenter();
+		addActionAndMethod(Methods.search.toString());
+		addRequestParameter("input", "moratorium");
+		addRequestParameter("searchString", "gr");
+		actionPerform();
+		verifyNoActionErrors();
+		verifyNoActionMessages();
+		verifyForward("moratorium_search_success");
+		veryfyResults();
+	}
+	// added for moratorium [end]
 }
Index: test/org/mifos/application/moratorium/struts-config.xml
===================================================================
--- test/org/mifos/application/moratorium/struts-config.xml	(revision 0)
+++ test/org/mifos/application/moratorium/struts-config.xml	(revision 0)
@@ -0,0 +1,96 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN"
+"http://jakarta.apache.org/struts/dtdt/struts-config_1_2.dtd">
+
+
+<struts-config>
+	<form-beans>
+		<!-- Moratorium module -->
+		<form-bean name="moratoriumActionForm" type="org.mifos.application.moratorium.struts.actionforms.MoratoriumActionForm"></form-bean>		
+	</form-beans>
+	
+	<global-exceptions>
+		<exception type="org.mifos.framework.exceptions.SystemException" 
+			handler="org.mifos.framework.exceptions.MifosExceptionHandler" 
+			key="exception.framework.SystemException" 
+			scope="request" 
+			path="/pages/framework/jsp/error.jsp" />
+		<exception type="org.mifos.framework.exceptions.ApplicationException" 
+			handler="org.mifos.framework.exceptions.MifosExceptionHandler" 
+			key="exception.framework.ApplicationException" 
+			scope="request" />
+		<exception type="org.mifos.framework.exceptions.PageExpiredException" 
+			handler="org.mifos.framework.exceptions.MifosExceptionHandler" 
+			key="exception.framework.PageExpiredException" 
+			scope="request" 
+			path="/pages/framework/jsp/pageexpirederror.jsp"/>
+		<exception type="org.mifos.framework.exceptions.ConnectionNotFoundException" 
+			handler="org.mifos.framework.exceptions.MifosExceptionHandler" 
+			key="exception.framework.ConnectionNotFoundException" 
+			scope="request" path="/pages/framework/jsp/error.jsp" />
+		<exception type="org.mifos.framework.exceptions.ServiceUnavailableException" 
+			handler="org.mifos.framework.exceptions.MifosExceptionHandler" 
+			key="exception.framework.ServiceUnavailableException" 
+			scope="request" path="/pages/framework/jsp/error.jsp" />		
+	</global-exceptions>
+
+	<global-forwards>
+		<forward name="welcome" path="/loginAction.do?method=load" />
+		<forward name="load_main_page" path="/pages/application/login/jsp/login.jsp"></forward>
+	</global-forwards>
+	
+	<action-mappings>
+		<action path="/custSearchAction" type="org.mifos.application.customer.struts.action.CustSearchAction"
+  			name="custSearchActionForm"
+       		parameter="method"
+       		scope="session">
+       		<forward name="loadSearch_success" 	path="/pages/application/customer/jsp/cust_search_account.jsp"/>
+      		<forward name="search_success" 	path="/pages/application/customer/jsp/cust_search_account_results.jsp"/>
+        	<forward name="search_failure" 	path="/pages/application/customer/jsp/cust_search_account.jsp"/>
+ 			<forward name="load_success" path="/pages/application/customer/jsp/clients_accounts.jsp" />
+			<forward name="load_branch" path="/pages/application/customer/jsp/branch_search_loanofficer.jsp" />
+			<forward name="load_loanofficer" path="/pages/application/customer/jsp/branch_search.jsp" />
+			<forward name="mainSearch_success" path="/pages/application/customer/jsp/search_result.jsp" />
+			<forward name="mainSearch_failure" path="/pages/application/customer/jsp/search_result.jsp" />
+			<forward name="getHomePage_success" path="/pages/application/customer/jsp/home.jsp" />
+			<forward name="loadallbranches_success" path="/custSearchAction.do?method=mainSearch" />
+			<forward name="moratorium_search_success" 	path="/pages/application/moratorium/jsp/moratoriumSearchResults.jsp"/>
+    	</action>
+    
+    	<action path="/moratoriumAction"
+          type="org.mifos.application.moratorium.struts.action.MoratoriumAction"
+          parameter="method"
+          scope="session"
+          validate="true"
+          input="/moratoriumAction.do?method=validate" 
+          name="moratoriumActionForm">
+             <forward name="configure" path="/pages/application/moratorium/jsp/configureMoratorium.jsp"/>
+             <forward name="loadSearch" path="/pages/application/moratorium/jsp/configureClientMoratorium.jsp"/>             
+             <forward name="loadSearchForBranch" path="/pages/application/moratorium/jsp/configureBranchMoratorium.jsp"/>
+             <forward name="load" path="/pages/application/moratorium/jsp/applyMoratorium.jsp"/>
+             <forward name="loadForBranch" path="/pages/application/moratorium/jsp/applyMoratoriumForBranch.jsp"/>
+             <forward name="create" path="/pages/application/moratorium/jsp/applyMoratoriumConfirm.jsp"/>
+             <forward name="createForBranch" path="/pages/application/moratorium/jsp/applyBranchMoratoriumConfirm.jsp"/>             
+             <forward name="previewCreateMoratorium_failure" path="/pages/application/moratorium/jsp/applyMoratorium.jsp"/>
+             <forward name="previewCreateBranchMoratorium_failure" path="/pages/application/moratorium/jsp/applyMoratoriumForBranch.jsp"/>
+             <forward name="get_success" path="/pages/application/moratorium/jsp/viewMoratoriums.jsp"/>
+             <forward name="edit_success" path="/pages/application/moratorium/jsp/editMoratoriums.jsp"/>
+             <forward name="editpreview_success" path="/pages/application/moratorium/jsp/editMoratoriumsPreview.jsp"/>
+             <forward name="update_success" path="/moratoriumAction.do?method=get"/>
+             <forward name="editPreviewMoratorium_failure" path="/pages/application/moratorium/jsp/editMoratoriums.jsp"/>
+             <forward name="create_success" path="/AdminAction.do?method=load"></forward>
+             <forward name="previous_success" path="/pages/application/moratorium/jsp/applyMoratorium.jsp"></forward>
+             <forward name="previous_success_for_branch" path="/pages/application/moratorium/jsp/applyMoratoriumForBranch.jsp"></forward>
+             <forward name="edit_previous_success" path="/pages/application/moratorium/jsp/editMoratoriums.jsp"></forward>
+        </action>		
+	</action-mappings>
+	
+	<!-- Moratorium resources -->
+    <message-resources key="moratoriumUIResources" parameter="org.mifos.application.moratorium.util.resources.MoratoriumUIResources" factory="org.mifos.framework.struts.tags.MifosPropertyMessageResourcesFactory" />
+	
+	<plug-in className="org.apache.struts.validator.ValidatorPlugIn">
+		<set-property property="pathnames" value="org/mifos/application/moratorium/validation.xml,org/mifos/application/moratorium/validator-rules.xml" />
+		<set-property property="stopOnFirstError" value="false" />
+	</plug-in>
+</struts-config>
Index: test/org/mifos/application/moratorium/validation.xml
===================================================================
--- test/org/mifos/application/moratorium/validation.xml	(revision 0)
+++ test/org/mifos/application/moratorium/validation.xml	(revision 0)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+
+<!DOCTYPE form-validation PUBLIC
+          "-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.1.3//EN"
+          "http://jakarta.apache.org/commons/dtds/validator_1_1_3.dtd">
+
+<form-validation>
+</form-validation>
Index: test/org/mifos/application/moratorium/validator-rules.xml
===================================================================
--- test/org/mifos/application/moratorium/validator-rules.xml	(revision 0)
+++ test/org/mifos/application/moratorium/validator-rules.xml	(revision 0)
@@ -0,0 +1,49 @@
+<!DOCTYPE form-validation PUBLIC
+          "-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.1.3//EN"
+          "http://jakarta.apache.org/commons/dtds/validator_1_1_3.dtd">
+<!--
+  $Id: validator-rules.xml 9724 2006-06-01 08:11:20Z mohmmed $
+
+   This file contains the default Struts Validator pluggable validator
+   definitions.  It should be placed somewhere under /WEB-INF and
+   referenced in the struts-config.xml under the plug-in element
+   for the ValidatorPlugIn.
+
+      <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
+        <set-property property="pathnames" value="/WEB-INF/validator-rules.xml,
+                                                  /WEB-INF/validation.xml"/>
+      </plug-in>
+
+   These are the default error messages associated with
+   each validator defined in this file.  They should be
+   added to your projects ApplicationResources.properties
+   file or you can associate new ones by modifying the
+   pluggable validators msg attributes in this file.
+
+   # Struts Validator Error Messages
+   errors.required={0} is required.
+   errors.minlength={0} can not be less than {1} characters.
+   errors.maxlength={0} can not be greater than {1} characters.
+   errors.invalid={0} is invalid.
+
+   errors.byte={0} must be a byte.
+   errors.short={0} must be a short.
+   errors.integer={0} must be an integer.
+   errors.long={0} must be a long.
+   errors.float={0} must be a float.
+   errors.double={0} must be a double.
+
+   errors.date={0} is not a date.
+   errors.range={0} is not in the range {1} through {2}.
+   errors.creditcard={0} is an invalid credit card number.
+   errors.email={0} is an invalid e-mail address.
+
+   Note: Starting in Struts 1.2.0 the default javascript definitions have
+         been consolidated to commons-validator. The default can be overridden
+         by supplying a <javascript> element with a CDATA section, just as
+         in struts 1.1.
+
+-->
+
+<form-validation>
+</form-validation>
Index: test/org/mifos/application/moratorium/business/TestMoratoriumBO.java
===================================================================
--- test/org/mifos/application/moratorium/business/TestMoratoriumBO.java	(revision 0)
+++ test/org/mifos/application/moratorium/business/TestMoratoriumBO.java	(revision 0)
@@ -0,0 +1,47 @@
+package org.mifos.application.moratorium.business;
+
+import org.mifos.framework.MifosTestCase;
+import org.mifos.framework.hibernate.helper.HibernateUtil;
+import org.mifos.framework.util.helpers.TestObjectFactory;
+
+public class TestMoratoriumBO extends MifosTestCase {
+
+private MoratoriumBO moratoriumBO = null;	
+	
+	@Override
+	protected void setUp() throws Exception {
+		super.setUp();
+	}
+	
+	@Override
+	protected void tearDown() throws Exception {
+		moratoriumBO = (MoratoriumBO) HibernateUtil.getSessionTL().get(
+				MoratoriumBO.class, moratoriumBO.getMoratoriumId());
+		
+		TestObjectFactory.cleanUp(moratoriumBO);		
+		HibernateUtil.closeSession();
+		super.tearDown();
+	}
+	
+	public void testAddMoratorium()throws Exception{
+		moratoriumBO = new MoratoriumBO();
+		moratoriumBO.setAppliedTo("test get moratoriums");
+		moratoriumBO.setStartDate(null);
+		moratoriumBO.setEndDate(null);			
+		moratoriumBO.setMorCreatedBy("created for test case");
+		moratoriumBO.setNotes("created for test case");
+		moratoriumBO.setCustomerId("1");
+		moratoriumBO.setOfficeId("1");
+		moratoriumBO.save();
+		
+		HibernateUtil.commitTransaction();
+		HibernateUtil.closeSession();
+		
+		moratoriumBO = (MoratoriumBO) HibernateUtil.getSessionTL().get(
+				MoratoriumBO.class, moratoriumBO.getMoratoriumId());
+		
+		assertEquals("test get moratoriums", moratoriumBO.getAppliedTo());
+		assertEquals("1", moratoriumBO.getCustomerId());
+		assertEquals("1", moratoriumBO.getOfficeId());
+	}
+}
Index: test/org/mifos/application/moratorium/business/service/TestMoratoriumBusinessService.java
===================================================================
--- test/org/mifos/application/moratorium/business/service/TestMoratoriumBusinessService.java	(revision 0)
+++ test/org/mifos/application/moratorium/business/service/TestMoratoriumBusinessService.java	(revision 0)
@@ -0,0 +1,104 @@
+package org.mifos.application.moratorium.business.service;
+
+import java.util.List;
+
+import org.mifos.application.moratorium.business.MoratoriumBO;
+import org.mifos.framework.MifosTestCase;
+import org.mifos.framework.hibernate.helper.HibernateUtil;
+import org.mifos.framework.util.helpers.TestObjectFactory;
+
+public class TestMoratoriumBusinessService extends MifosTestCase {
+	
+	private MoratoriumBO moratoriumBO = null;	
+	
+	@Override
+	protected void setUp() throws Exception {
+		super.setUp();
+	}
+	
+	@Override
+	protected void tearDown() throws Exception {
+		moratoriumBO = (MoratoriumBO) HibernateUtil.getSessionTL().get(
+				MoratoriumBO.class, moratoriumBO.getMoratoriumId());
+		
+		TestObjectFactory.cleanUp(moratoriumBO);		
+		HibernateUtil.closeSession();
+		super.tearDown();
+	}
+	
+	public void testGetMoratoriums() throws Exception {
+		moratoriumBO = new MoratoriumBO();
+		moratoriumBO.setAppliedTo("test get moratoriums");
+		moratoriumBO.setStartDate(null);
+		moratoriumBO.setEndDate(null);			
+		moratoriumBO.setMorCreatedBy("created for test case");
+		moratoriumBO.setNotes("created for test case");
+		moratoriumBO.setCustomerId("1");
+		moratoriumBO.setOfficeId("1");
+		moratoriumBO.save();
+		
+		HibernateUtil.commitTransaction();
+		HibernateUtil.closeSession();
+		
+		List<MoratoriumBO> moratoriums = new MoratoriumBusinessService().getMoratoriums();
+		assertNotNull(moratoriums);
+		assertEquals(1, moratoriums.size());
+	}
+	
+	public void testGetMoratoriumById() throws Exception{
+		moratoriumBO = new MoratoriumBO();
+		moratoriumBO.setAppliedTo("test get moratoriums");
+		moratoriumBO.setStartDate(null);
+		moratoriumBO.setEndDate(null);			
+		moratoriumBO.setMorCreatedBy("created for test case");
+		moratoriumBO.setNotes("created for test case");
+		moratoriumBO.setCustomerId("1");
+		moratoriumBO.setOfficeId("1");
+		moratoriumBO.save();
+		
+		HibernateUtil.commitTransaction();
+		HibernateUtil.closeSession();
+		
+		List<MoratoriumBO> moratorium = new MoratoriumBusinessService().getMoratoriumById("2");
+		assertNotNull(moratorium);
+		assertEquals(1, moratorium.size());
+	}
+	
+	public void testGetMoratoriumByCustomerId() throws Exception{
+		moratoriumBO = new MoratoriumBO();
+		moratoriumBO.setAppliedTo("test get moratoriums");
+		moratoriumBO.setStartDate(null);
+		moratoriumBO.setEndDate(null);			
+		moratoriumBO.setMorCreatedBy("created for test case");
+		moratoriumBO.setNotes("created for test case");
+		moratoriumBO.setCustomerId("1");
+		moratoriumBO.setOfficeId("1");
+		moratoriumBO.save();
+		
+		HibernateUtil.commitTransaction();
+		HibernateUtil.closeSession();
+		
+		List<MoratoriumBO> moratorium = new MoratoriumBusinessService().getMoratoriumByCustomerId("1");
+		assertNotNull(moratorium);
+		assertEquals(1, moratorium.size());
+	}
+	
+	public void testGetMoratoriumByOfficeId() throws Exception{
+		moratoriumBO = new MoratoriumBO();
+		moratoriumBO.setAppliedTo("test get moratoriums");
+		moratoriumBO.setStartDate(null);
+		moratoriumBO.setEndDate(null);			
+		moratoriumBO.setMorCreatedBy("created for test case");
+		moratoriumBO.setNotes("created for test case");
+		moratoriumBO.setCustomerId("1");
+		moratoriumBO.setOfficeId("1");
+		moratoriumBO.save();
+		
+		HibernateUtil.commitTransaction();
+		HibernateUtil.closeSession();
+		
+		List<MoratoriumBO> moratorium = new MoratoriumBusinessService().getMoratoriumByOfficeId("1");
+		assertNotNull(moratorium);
+		assertEquals(1, moratorium.size());
+	}
+}
Index: test/org/mifos/application/moratorium/business/service/TestMoratoriumBusinessService.java
===================================================================
--- test/org/mifos/application/moratorium/business/service/TestMoratoriumBusinessService.java	(revision 0)
+++ test/org/mifos/application/moratorium/business/service/TestMoratoriumBusinessService.java	(revision 0)
@@ -0,0 +1,104 @@
+package org.mifos.application.moratorium.business.service;
+
+import java.util.List;
+
+import org.mifos.application.moratorium.business.MoratoriumBO;
+import org.mifos.framework.MifosTestCase;
+import org.mifos.framework.hibernate.helper.HibernateUtil;
+import org.mifos.framework.util.helpers.TestObjectFactory;
+
+public class TestMoratoriumBusinessService extends MifosTestCase {
+	
+	private MoratoriumBO moratoriumBO = null;	
+	
+	@Override
+	protected void setUp() throws Exception {
+		super.setUp();
+	}
+	
+	@Override
+	protected void tearDown() throws Exception {
+		moratoriumBO = (MoratoriumBO) HibernateUtil.getSessionTL().get(
+				MoratoriumBO.class, moratoriumBO.getMoratoriumId());
+		
+		TestObjectFactory.cleanUp(moratoriumBO);		
+		HibernateUtil.closeSession();
+		super.tearDown();
+	}
+	
+	public void testGetMoratoriums() throws Exception {
+		moratoriumBO = new MoratoriumBO();
+		moratoriumBO.setAppliedTo("test get moratoriums");
+		moratoriumBO.setStartDate(null);
+		moratoriumBO.setEndDate(null);			
+		moratoriumBO.setMorCreatedBy("created for test case");
+		moratoriumBO.setNotes("created for test case");
+		moratoriumBO.setCustomerId("1");
+		moratoriumBO.setOfficeId("1");
+		moratoriumBO.save();
+		
+		HibernateUtil.commitTransaction();
+		HibernateUtil.closeSession();
+		
+		List<MoratoriumBO> moratoriums = new MoratoriumBusinessService().getMoratoriums();
+		assertNotNull(moratoriums);
+		assertEquals(1, moratoriums.size());
+	}
+	
+	public void testGetMoratoriumById() throws Exception{
+		moratoriumBO = new MoratoriumBO();
+		moratoriumBO.setAppliedTo("test get moratoriums");
+		moratoriumBO.setStartDate(null);
+		moratoriumBO.setEndDate(null);			
+		moratoriumBO.setMorCreatedBy("created for test case");
+		moratoriumBO.setNotes("created for test case");
+		moratoriumBO.setCustomerId("1");
+		moratoriumBO.setOfficeId("1");
+		moratoriumBO.save();
+		
+		HibernateUtil.commitTransaction();
+		HibernateUtil.closeSession();
+		
+		List<MoratoriumBO> moratorium = new MoratoriumBusinessService().getMoratoriumById("2");
+		assertNotNull(moratorium);
+		assertEquals(1, moratorium.size());
+	}
+	
+	public void testGetMoratoriumByCustomerId() throws Exception{
+		moratoriumBO = new MoratoriumBO();
+		moratoriumBO.setAppliedTo("test get moratoriums");
+		moratoriumBO.setStartDate(null);
+		moratoriumBO.setEndDate(null);			
+		moratoriumBO.setMorCreatedBy("created for test case");
+		moratoriumBO.setNotes("created for test case");
+		moratoriumBO.setCustomerId("1");
+		moratoriumBO.setOfficeId("1");
+		moratoriumBO.save();
+		
+		HibernateUtil.commitTransaction();
+		HibernateUtil.closeSession();
+		
+		List<MoratoriumBO> moratorium = new MoratoriumBusinessService().getMoratoriumByCustomerId("1");
+		assertNotNull(moratorium);
+		assertEquals(1, moratorium.size());
+	}
+	
+	public void testGetMoratoriumByOfficeId() throws Exception{
+		moratoriumBO = new MoratoriumBO();
+		moratoriumBO.setAppliedTo("test get moratoriums");
+		moratoriumBO.setStartDate(null);
+		moratoriumBO.setEndDate(null);			
+		moratoriumBO.setMorCreatedBy("created for test case");
+		moratoriumBO.setNotes("created for test case");
+		moratoriumBO.setCustomerId("1");
+		moratoriumBO.setOfficeId("1");
+		moratoriumBO.save();
+		
+		HibernateUtil.commitTransaction();
+		HibernateUtil.closeSession();
+		
+		List<MoratoriumBO> moratorium = new MoratoriumBusinessService().getMoratoriumByOfficeId("1");
+		assertNotNull(moratorium);
+		assertEquals(1, moratorium.size());
+	}
+}
Index: test/org/mifos/application/moratorium/business/TestMoratoriumBO.java
===================================================================
--- test/org/mifos/application/moratorium/business/TestMoratoriumBO.java	(revision 0)
+++ test/org/mifos/application/moratorium/business/TestMoratoriumBO.java	(revision 0)
@@ -0,0 +1,47 @@
+package org.mifos.application.moratorium.business;
+
+import org.mifos.framework.MifosTestCase;
+import org.mifos.framework.hibernate.helper.HibernateUtil;
+import org.mifos.framework.util.helpers.TestObjectFactory;
+
+public class TestMoratoriumBO extends MifosTestCase {
+
+private MoratoriumBO moratoriumBO = null;	
+	
+	@Override
+	protected void setUp() throws Exception {
+		super.setUp();
+	}
+	
+	@Override
+	protected void tearDown() throws Exception {
+		moratoriumBO = (MoratoriumBO) HibernateUtil.getSessionTL().get(
+				MoratoriumBO.class, moratoriumBO.getMoratoriumId());
+		
+		TestObjectFactory.cleanUp(moratoriumBO);		
+		HibernateUtil.closeSession();
+		super.tearDown();
+	}
+	
+	public void testAddMoratorium()throws Exception{
+		moratoriumBO = new MoratoriumBO();
+		moratoriumBO.setAppliedTo("test get moratoriums");
+		moratoriumBO.setStartDate(null);
+		moratoriumBO.setEndDate(null);			
+		moratoriumBO.setMorCreatedBy("created for test case");
+		moratoriumBO.setNotes("created for test case");
+		moratoriumBO.setCustomerId("1");
+		moratoriumBO.setOfficeId("1");
+		moratoriumBO.save();
+		
+		HibernateUtil.commitTransaction();
+		HibernateUtil.closeSession();
+		
+		moratoriumBO = (MoratoriumBO) HibernateUtil.getSessionTL().get(
+				MoratoriumBO.class, moratoriumBO.getMoratoriumId());
+		
+		assertEquals("test get moratoriums", moratoriumBO.getAppliedTo());
+		assertEquals("1", moratoriumBO.getCustomerId());
+		assertEquals("1", moratoriumBO.getOfficeId());
+	}
+}
Index: test/org/mifos/application/moratorium/persistence/TestMoratoriumPersistence.java
===================================================================
--- test/org/mifos/application/moratorium/persistence/TestMoratoriumPersistence.java	(revision 0)
+++ test/org/mifos/application/moratorium/persistence/TestMoratoriumPersistence.java	(revision 0)
@@ -0,0 +1,104 @@
+package org.mifos.application.moratorium.persistence;
+
+import java.util.List;
+
+import org.mifos.application.moratorium.business.MoratoriumBO;
+import org.mifos.framework.MifosTestCase;
+import org.mifos.framework.hibernate.helper.HibernateUtil;
+import org.mifos.framework.util.helpers.TestObjectFactory;
+
+public class TestMoratoriumPersistence extends MifosTestCase {
+	
+	private MoratoriumBO moratoriumBO = null;
+	
+	@Override
+	protected void setUp() throws Exception {
+		super.setUp();
+	}
+	
+	@Override
+	protected void tearDown() throws Exception {
+		moratoriumBO = (MoratoriumBO) HibernateUtil.getSessionTL().get(
+				MoratoriumBO.class, moratoriumBO.getMoratoriumId());
+		
+		TestObjectFactory.cleanUp(moratoriumBO);		
+		HibernateUtil.closeSession();
+		super.tearDown();
+	}
+	
+	public void testGetMoratoriums() throws Exception {
+		moratoriumBO = new MoratoriumBO();
+		moratoriumBO.setAppliedTo("test get moratoriums");
+		moratoriumBO.setStartDate(null);
+		moratoriumBO.setEndDate(null);			
+		moratoriumBO.setMorCreatedBy("created for test case");
+		moratoriumBO.setNotes("created for test case");
+		moratoriumBO.setCustomerId("1");
+		moratoriumBO.setOfficeId("1");
+		moratoriumBO.save();
+		
+		HibernateUtil.commitTransaction();
+		HibernateUtil.closeSession();
+		
+		List<MoratoriumBO> moratoriums = new MoratoriumPersistence().getMoratoriums();
+		assertNotNull(moratoriums);
+		assertEquals(1, moratoriums.size());
+	}
+	
+	public void testGetMoratoriumById() throws Exception{
+		moratoriumBO = new MoratoriumBO();
+		moratoriumBO.setAppliedTo("test get moratoriums");
+		moratoriumBO.setStartDate(null);
+		moratoriumBO.setEndDate(null);			
+		moratoriumBO.setMorCreatedBy("created for test case");
+		moratoriumBO.setNotes("created for test case");
+		moratoriumBO.setCustomerId("1");
+		moratoriumBO.setOfficeId("1");
+		moratoriumBO.save();
+		
+		HibernateUtil.commitTransaction();
+		HibernateUtil.closeSession();
+		
+		List<MoratoriumBO> moratorium = new MoratoriumPersistence().getMoratoriumById("2");
+		assertNotNull(moratorium);
+		assertEquals(1, moratorium.size());
+	}
+	
+	public void testGetMoratoriumByCustomerId() throws Exception{
+		moratoriumBO = new MoratoriumBO();
+		moratoriumBO.setAppliedTo("test get moratoriums");
+		moratoriumBO.setStartDate(null);
+		moratoriumBO.setEndDate(null);			
+		moratoriumBO.setMorCreatedBy("created for test case");
+		moratoriumBO.setNotes("created for test case");
+		moratoriumBO.setCustomerId("1");
+		moratoriumBO.setOfficeId("1");
+		moratoriumBO.save();
+		
+		HibernateUtil.commitTransaction();
+		HibernateUtil.closeSession();
+		
+		List<MoratoriumBO> moratorium = new MoratoriumPersistence().getMoratoriumByCustomerId("1");
+		assertNotNull(moratorium);
+		assertEquals(1, moratorium.size());
+	}
+	
+	public void testGetMoratoriumByOfficeId() throws Exception{
+		moratoriumBO = new MoratoriumBO();
+		moratoriumBO.setAppliedTo("test get moratoriums");
+		moratoriumBO.setStartDate(null);
+		moratoriumBO.setEndDate(null);			
+		moratoriumBO.setMorCreatedBy("created for test case");
+		moratoriumBO.setNotes("created for test case");
+		moratoriumBO.setCustomerId("1");
+		moratoriumBO.setOfficeId("1");
+		moratoriumBO.save();
+		
+		HibernateUtil.commitTransaction();
+		HibernateUtil.closeSession();
+		
+		List<MoratoriumBO> moratorium = new MoratoriumPersistence().getMoratoriumByOfficeId("1");
+		assertNotNull(moratorium);
+		assertEquals(1, moratorium.size());
+	}
+}
Index: test/org/mifos/application/moratorium/persistence/TestMoratoriumPersistence.java
===================================================================
--- test/org/mifos/application/moratorium/persistence/TestMoratoriumPersistence.java	(revision 0)
+++ test/org/mifos/application/moratorium/persistence/TestMoratoriumPersistence.java	(revision 0)
@@ -0,0 +1,104 @@
+package org.mifos.application.moratorium.persistence;
+
+import java.util.List;
+
+import org.mifos.application.moratorium.business.MoratoriumBO;
+import org.mifos.framework.MifosTestCase;
+import org.mifos.framework.hibernate.helper.HibernateUtil;
+import org.mifos.framework.util.helpers.TestObjectFactory;
+
+public class TestMoratoriumPersistence extends MifosTestCase {
+	
+	private MoratoriumBO moratoriumBO = null;
+	
+	@Override
+	protected void setUp() throws Exception {
+		super.setUp();
+	}
+	
+	@Override
+	protected void tearDown() throws Exception {
+		moratoriumBO = (MoratoriumBO) HibernateUtil.getSessionTL().get(
+				MoratoriumBO.class, moratoriumBO.getMoratoriumId());
+		
+		TestObjectFactory.cleanUp(moratoriumBO);		
+		HibernateUtil.closeSession();
+		super.tearDown();
+	}
+	
+	public void testGetMoratoriums() throws Exception {
+		moratoriumBO = new MoratoriumBO();
+		moratoriumBO.setAppliedTo("test get moratoriums");
+		moratoriumBO.setStartDate(null);
+		moratoriumBO.setEndDate(null);			
+		moratoriumBO.setMorCreatedBy("created for test case");
+		moratoriumBO.setNotes("created for test case");
+		moratoriumBO.setCustomerId("1");
+		moratoriumBO.setOfficeId("1");
+		moratoriumBO.save();
+		
+		HibernateUtil.commitTransaction();
+		HibernateUtil.closeSession();
+		
+		List<MoratoriumBO> moratoriums = new MoratoriumPersistence().getMoratoriums();
+		assertNotNull(moratoriums);
+		assertEquals(1, moratoriums.size());
+	}
+	
+	public void testGetMoratoriumById() throws Exception{
+		moratoriumBO = new MoratoriumBO();
+		moratoriumBO.setAppliedTo("test get moratoriums");
+		moratoriumBO.setStartDate(null);
+		moratoriumBO.setEndDate(null);			
+		moratoriumBO.setMorCreatedBy("created for test case");
+		moratoriumBO.setNotes("created for test case");
+		moratoriumBO.setCustomerId("1");
+		moratoriumBO.setOfficeId("1");
+		moratoriumBO.save();
+		
+		HibernateUtil.commitTransaction();
+		HibernateUtil.closeSession();
+		
+		List<MoratoriumBO> moratorium = new MoratoriumPersistence().getMoratoriumById("2");
+		assertNotNull(moratorium);
+		assertEquals(1, moratorium.size());
+	}
+	
+	public void testGetMoratoriumByCustomerId() throws Exception{
+		moratoriumBO = new MoratoriumBO();
+		moratoriumBO.setAppliedTo("test get moratoriums");
+		moratoriumBO.setStartDate(null);
+		moratoriumBO.setEndDate(null);			
+		moratoriumBO.setMorCreatedBy("created for test case");
+		moratoriumBO.setNotes("created for test case");
+		moratoriumBO.setCustomerId("1");
+		moratoriumBO.setOfficeId("1");
+		moratoriumBO.save();
+		
+		HibernateUtil.commitTransaction();
+		HibernateUtil.closeSession();
+		
+		List<MoratoriumBO> moratorium = new MoratoriumPersistence().getMoratoriumByCustomerId("1");
+		assertNotNull(moratorium);
+		assertEquals(1, moratorium.size());
+	}
+	
+	public void testGetMoratoriumByOfficeId() throws Exception{
+		moratoriumBO = new MoratoriumBO();
+		moratoriumBO.setAppliedTo("test get moratoriums");
+		moratoriumBO.setStartDate(null);
+		moratoriumBO.setEndDate(null);			
+		moratoriumBO.setMorCreatedBy("created for test case");
+		moratoriumBO.setNotes("created for test case");
+		moratoriumBO.setCustomerId("1");
+		moratoriumBO.setOfficeId("1");
+		moratoriumBO.save();
+		
+		HibernateUtil.commitTransaction();
+		HibernateUtil.closeSession();
+		
+		List<MoratoriumBO> moratorium = new MoratoriumPersistence().getMoratoriumByOfficeId("1");
+		assertNotNull(moratorium);
+		assertEquals(1, moratorium.size());
+	}
+}
Index: test/org/mifos/application/moratorium/struts-config.xml
===================================================================
--- test/org/mifos/application/moratorium/struts-config.xml	(revision 0)
+++ test/org/mifos/application/moratorium/struts-config.xml	(revision 0)
@@ -0,0 +1,96 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN"
+"http://jakarta.apache.org/struts/dtdt/struts-config_1_2.dtd">
+
+
+<struts-config>
+	<form-beans>
+		<!-- Moratorium module -->
+		<form-bean name="moratoriumActionForm" type="org.mifos.application.moratorium.struts.actionforms.MoratoriumActionForm"></form-bean>		
+	</form-beans>
+	
+	<global-exceptions>
+		<exception type="org.mifos.framework.exceptions.SystemException" 
+			handler="org.mifos.framework.exceptions.MifosExceptionHandler" 
+			key="exception.framework.SystemException" 
+			scope="request" 
+			path="/pages/framework/jsp/error.jsp" />
+		<exception type="org.mifos.framework.exceptions.ApplicationException" 
+			handler="org.mifos.framework.exceptions.MifosExceptionHandler" 
+			key="exception.framework.ApplicationException" 
+			scope="request" />
+		<exception type="org.mifos.framework.exceptions.PageExpiredException" 
+			handler="org.mifos.framework.exceptions.MifosExceptionHandler" 
+			key="exception.framework.PageExpiredException" 
+			scope="request" 
+			path="/pages/framework/jsp/pageexpirederror.jsp"/>
+		<exception type="org.mifos.framework.exceptions.ConnectionNotFoundException" 
+			handler="org.mifos.framework.exceptions.MifosExceptionHandler" 
+			key="exception.framework.ConnectionNotFoundException" 
+			scope="request" path="/pages/framework/jsp/error.jsp" />
+		<exception type="org.mifos.framework.exceptions.ServiceUnavailableException" 
+			handler="org.mifos.framework.exceptions.MifosExceptionHandler" 
+			key="exception.framework.ServiceUnavailableException" 
+			scope="request" path="/pages/framework/jsp/error.jsp" />		
+	</global-exceptions>
+
+	<global-forwards>
+		<forward name="welcome" path="/loginAction.do?method=load" />
+		<forward name="load_main_page" path="/pages/application/login/jsp/login.jsp"></forward>
+	</global-forwards>
+	
+	<action-mappings>
+		<action path="/custSearchAction" type="org.mifos.application.customer.struts.action.CustSearchAction"
+  			name="custSearchActionForm"
+       		parameter="method"
+       		scope="session">
+       		<forward name="loadSearch_success" 	path="/pages/application/customer/jsp/cust_search_account.jsp"/>
+      		<forward name="search_success" 	path="/pages/application/customer/jsp/cust_search_account_results.jsp"/>
+        	<forward name="search_failure" 	path="/pages/application/customer/jsp/cust_search_account.jsp"/>
+ 			<forward name="load_success" path="/pages/application/customer/jsp/clients_accounts.jsp" />
+			<forward name="load_branch" path="/pages/application/customer/jsp/branch_search_loanofficer.jsp" />
+			<forward name="load_loanofficer" path="/pages/application/customer/jsp/branch_search.jsp" />
+			<forward name="mainSearch_success" path="/pages/application/customer/jsp/search_result.jsp" />
+			<forward name="mainSearch_failure" path="/pages/application/customer/jsp/search_result.jsp" />
+			<forward name="getHomePage_success" path="/pages/application/customer/jsp/home.jsp" />
+			<forward name="loadallbranches_success" path="/custSearchAction.do?method=mainSearch" />
+			<forward name="moratorium_search_success" 	path="/pages/application/moratorium/jsp/moratoriumSearchResults.jsp"/>
+    	</action>
+    
+    	<action path="/moratoriumAction"
+          type="org.mifos.application.moratorium.struts.action.MoratoriumAction"
+          parameter="method"
+          scope="session"
+          validate="true"
+          input="/moratoriumAction.do?method=validate" 
+          name="moratoriumActionForm">
+             <forward name="configure" path="/pages/application/moratorium/jsp/configureMoratorium.jsp"/>
+             <forward name="loadSearch" path="/pages/application/moratorium/jsp/configureClientMoratorium.jsp"/>             
+             <forward name="loadSearchForBranch" path="/pages/application/moratorium/jsp/configureBranchMoratorium.jsp"/>
+             <forward name="load" path="/pages/application/moratorium/jsp/applyMoratorium.jsp"/>
+             <forward name="loadForBranch" path="/pages/application/moratorium/jsp/applyMoratoriumForBranch.jsp"/>
+             <forward name="create" path="/pages/application/moratorium/jsp/applyMoratoriumConfirm.jsp"/>
+             <forward name="createForBranch" path="/pages/application/moratorium/jsp/applyBranchMoratoriumConfirm.jsp"/>             
+             <forward name="previewCreateMoratorium_failure" path="/pages/application/moratorium/jsp/applyMoratorium.jsp"/>
+             <forward name="previewCreateBranchMoratorium_failure" path="/pages/application/moratorium/jsp/applyMoratoriumForBranch.jsp"/>
+             <forward name="get_success" path="/pages/application/moratorium/jsp/viewMoratoriums.jsp"/>
+             <forward name="edit_success" path="/pages/application/moratorium/jsp/editMoratoriums.jsp"/>
+             <forward name="editpreview_success" path="/pages/application/moratorium/jsp/editMoratoriumsPreview.jsp"/>
+             <forward name="update_success" path="/moratoriumAction.do?method=get"/>
+             <forward name="editPreviewMoratorium_failure" path="/pages/application/moratorium/jsp/editMoratoriums.jsp"/>
+             <forward name="create_success" path="/AdminAction.do?method=load"></forward>
+             <forward name="previous_success" path="/pages/application/moratorium/jsp/applyMoratorium.jsp"></forward>
+             <forward name="previous_success_for_branch" path="/pages/application/moratorium/jsp/applyMoratoriumForBranch.jsp"></forward>
+             <forward name="edit_previous_success" path="/pages/application/moratorium/jsp/editMoratoriums.jsp"></forward>
+        </action>		
+	</action-mappings>
+	
+	<!-- Moratorium resources -->
+    <message-resources key="moratoriumUIResources" parameter="org.mifos.application.moratorium.util.resources.MoratoriumUIResources" factory="org.mifos.framework.struts.tags.MifosPropertyMessageResourcesFactory" />
+	
+	<plug-in className="org.apache.struts.validator.ValidatorPlugIn">
+		<set-property property="pathnames" value="org/mifos/application/moratorium/validation.xml,org/mifos/application/moratorium/validator-rules.xml" />
+		<set-property property="stopOnFirstError" value="false" />
+	</plug-in>
+</struts-config>
Index: test/org/mifos/application/moratorium/struts/action/TestMoratoriumAction.java
===================================================================
--- test/org/mifos/application/moratorium/struts/action/TestMoratoriumAction.java	(revision 0)
+++ test/org/mifos/application/moratorium/struts/action/TestMoratoriumAction.java	(revision 0)
@@ -0,0 +1,413 @@
+package org.mifos.application.moratorium.struts.action;
+
+import java.sql.Date;
+import java.util.Calendar;
+import java.util.GregorianCalendar;
+import java.util.Iterator;
+import java.util.List;
+
+import org.mifos.application.customer.business.CustomerBO;
+import org.mifos.application.customer.util.helpers.CustomerStatus;
+import org.mifos.application.meeting.business.MeetingBO;
+import org.mifos.application.moratorium.business.MoratoriumBO;
+import org.mifos.application.moratorium.business.service.MoratoriumBusinessService;
+import org.mifos.application.moratorium.struts.actionforms.MoratoriumActionForm;
+import org.mifos.framework.MifosMockStrutsTestCase;
+import org.mifos.framework.hibernate.helper.HibernateUtil;
+import org.mifos.framework.security.util.UserContext;
+import org.mifos.framework.util.helpers.Constants;
+import org.mifos.framework.util.helpers.DateUtils;
+import org.mifos.framework.util.helpers.ResourceLoader;
+import org.mifos.framework.util.helpers.TestObjectFactory;
+
+public class TestMoratoriumAction extends MifosMockStrutsTestCase {
+	
+	private String flowKey;
+	
+	private CustomerBO client;
+
+	private CustomerBO group;
+
+	private CustomerBO center;
+
+	@Override
+	protected void setUp() throws Exception {
+		super.setUp();
+		setServletConfigFile(ResourceLoader.getURI("WEB-INF/web.xml")
+				.getPath());
+		setConfigFile(ResourceLoader.getURI(
+				"org/mifos/application/moratorium/struts-config.xml")
+				.getPath());
+		UserContext userContext = TestObjectFactory.getContext();
+		request.getSession().setAttribute(Constants.USERCONTEXT, userContext);		
+		flowKey = createFlow(request, MoratoriumAction.class);
+	}
+	
+	@Override
+	protected void tearDown() throws Exception {
+		TestObjectFactory.cleanUp(client);
+		TestObjectFactory.cleanUp(group);
+		TestObjectFactory.cleanUp(center);
+		HibernateUtil.closeSession();
+		super.tearDown();
+	}
+	
+	public void testCreateForClient() throws Exception {
+		createInitialObjects();
+		setRequestPathInfo("/moratoriumAction");
+		addRequestParameter("method", "create");
+		addRequestParameter("customerId", String.valueOf(client.getCustomerId()));
+		addRequestParameter(Constants.CURRENTFLOWKEY, flowKey);
+		
+		// get today's date
+		Calendar currentCalendar = new GregorianCalendar();
+		int year = currentCalendar.get(Calendar.YEAR);
+		int month = currentCalendar.get(Calendar.MONTH) + 1;
+		int day = currentCalendar.get(Calendar.DAY_OF_MONTH);
+		String moratoriumFromDateDD = String.valueOf(day + 1);
+		String moratoriumFromDateMM = String.valueOf(month);
+		String moratoriumFromDateYY = String.valueOf(year);
+		String moratoriumEndDateDD = String.valueOf(day + 2);
+		String moratoriumEndDateMM = String.valueOf(month);
+		String moratoriumEndDateYY = String.valueOf(year);		
+		
+		addRequestParameter("moratoriumFromDateDD", moratoriumFromDateDD);
+		addRequestParameter("moratoriumFromDateMM", moratoriumFromDateMM);
+		addRequestParameter("moratoriumFromDateYY", moratoriumFromDateYY);		
+		addRequestParameter("moratoriumEndDateDD", moratoriumEndDateDD);
+		addRequestParameter("moratoriumEndDateMM", moratoriumEndDateMM);
+		addRequestParameter("moratoriumEndDateYY", moratoriumEndDateYY);
+		
+		actionPerform();
+		verifyNoActionErrors();
+		verifyNoActionMessages();
+		verifyForward("create");
+		assertNotNull(request.getAttribute(Constants.CURRENTFLOWKEY));
+	}
+	
+	public void testCreateForOffice() throws Exception {
+		createInitialObjects();
+		setRequestPathInfo("/moratoriumAction");
+		addRequestParameter("method", "create");
+		addRequestParameter("officeId", "1");
+		addRequestParameter(Constants.CURRENTFLOWKEY, flowKey);
+		
+		// get today's date
+		Calendar currentCalendar = new GregorianCalendar();
+		int year = currentCalendar.get(Calendar.YEAR);
+		int month = currentCalendar.get(Calendar.MONTH) + 1;
+		int day = currentCalendar.get(Calendar.DAY_OF_MONTH);
+		String moratoriumFromDateDD = String.valueOf(day + 1);
+		String moratoriumFromDateMM = String.valueOf(month);
+		String moratoriumFromDateYY = String.valueOf(year);
+		String moratoriumEndDateDD = String.valueOf(day + 2);
+		String moratoriumEndDateMM = String.valueOf(month);
+		String moratoriumEndDateYY = String.valueOf(year);		
+		
+		addRequestParameter("moratoriumFromDateDD", moratoriumFromDateDD);
+		addRequestParameter("moratoriumFromDateMM", moratoriumFromDateMM);
+		addRequestParameter("moratoriumFromDateYY", moratoriumFromDateYY);		
+		addRequestParameter("moratoriumEndDateDD", moratoriumEndDateDD);
+		addRequestParameter("moratoriumEndDateMM", moratoriumEndDateMM);
+		addRequestParameter("moratoriumEndDateYY", moratoriumEndDateYY);
+		
+		actionPerform();
+		verifyNoActionErrors();
+		verifyNoActionMessages();
+		verifyForward("createForBranch");
+		assertNotNull(request.getAttribute(Constants.CURRENTFLOWKEY));
+	}
+	
+	public void testCreateConfirmedForClient() throws Exception {
+		createInitialObjects();
+		setRequestPathInfo("/moratoriumAction");
+		addRequestParameter("method", "createConfirmed");
+		addRequestParameter("customerId", String.valueOf(client.getCustomerId()));
+		addRequestParameter(Constants.CURRENTFLOWKEY, flowKey);
+		
+		// get today's date
+		Calendar currentCalendar = new GregorianCalendar();
+		int year = currentCalendar.get(Calendar.YEAR);
+		int month = currentCalendar.get(Calendar.MONTH) + 1;
+		int day = currentCalendar.get(Calendar.DAY_OF_MONTH);
+		String moratoriumFromDateDD = String.valueOf(day + 1);
+		String moratoriumFromDateMM = String.valueOf(month);
+		String moratoriumFromDateYY = String.valueOf(year);
+		String moratoriumEndDateDD = String.valueOf(day + 2);
+		String moratoriumEndDateMM = String.valueOf(month);
+		String moratoriumEndDateYY = String.valueOf(year);		
+		
+		addRequestParameter("moratoriumFromDateDD", moratoriumFromDateDD);
+		addRequestParameter("moratoriumFromDateMM", moratoriumFromDateMM);
+		addRequestParameter("moratoriumFromDateYY", moratoriumFromDateYY);		
+		addRequestParameter("moratoriumEndDateDD", moratoriumEndDateDD);
+		addRequestParameter("moratoriumEndDateMM", moratoriumEndDateMM);
+		addRequestParameter("moratoriumEndDateYY", moratoriumEndDateYY);
+		
+		MoratoriumActionForm form = new MoratoriumActionForm();
+		form.setMoratoriumFromDateDD(moratoriumFromDateDD);
+		form.setMoratoriumFromDateMM(moratoriumFromDateMM);
+		form.setMoratoriumFromDateYY(moratoriumFromDateYY);
+		form.setMoratoriumEndDateDD(moratoriumEndDateDD);
+		form.setMoratoriumEndDateMM(moratoriumEndDateMM);
+		form.setMoratoriumEndDateYY(moratoriumEndDateYY);
+		form.setMoratoriumNotes("inserted for testing, while running test case");
+		Date fromDate = null;
+		fromDate = DateUtils.getDateAsSentFromBrowser(moratoriumFromDateDD + "/" + moratoriumFromDateMM + "/" + moratoriumFromDateYY);
+		form.setFromDate(fromDate);
+		Date endDate = null;
+		endDate = DateUtils.getDateAsSentFromBrowser(moratoriumEndDateDD + "/" + moratoriumEndDateMM + "/" + moratoriumEndDateYY);
+		form.setEndDate(endDate);
+		setActionForm(form);
+		actionPerform();
+		verifyNoActionErrors();
+		verifyNoActionMessages();
+		verifyForward("create_success");
+		assertNotNull(request.getAttribute(Constants.CURRENTFLOWKEY));
+	}
+	
+	public void testCreateConfirmedForOffice() throws Exception {
+		createInitialObjects();
+		setRequestPathInfo("/moratoriumAction");
+		addRequestParameter("method", "createConfirmed");
+		// officeId >> 3, it is for TestBranchOffice, it is inserted by testdbinsertionscript.sql
+		addRequestParameter("officeId", String.valueOf("3"));
+		addRequestParameter(Constants.CURRENTFLOWKEY, flowKey);
+		
+		// get today's date
+		Calendar currentCalendar = new GregorianCalendar();
+		int year = currentCalendar.get(Calendar.YEAR);
+		int month = currentCalendar.get(Calendar.MONTH) + 1;
+		int day = currentCalendar.get(Calendar.DAY_OF_MONTH);
+		String moratoriumFromDateDD = String.valueOf(day + 1);
+		String moratoriumFromDateMM = String.valueOf(month);
+		String moratoriumFromDateYY = String.valueOf(year);
+		String moratoriumEndDateDD = String.valueOf(day + 2);
+		String moratoriumEndDateMM = String.valueOf(month);
+		String moratoriumEndDateYY = String.valueOf(year);		
+		
+		addRequestParameter("moratoriumFromDateDD", moratoriumFromDateDD);
+		addRequestParameter("moratoriumFromDateMM", moratoriumFromDateMM);
+		addRequestParameter("moratoriumFromDateYY", moratoriumFromDateYY);		
+		addRequestParameter("moratoriumEndDateDD", moratoriumEndDateDD);
+		addRequestParameter("moratoriumEndDateMM", moratoriumEndDateMM);
+		addRequestParameter("moratoriumEndDateYY", moratoriumEndDateYY);
+		
+		MoratoriumActionForm form = new MoratoriumActionForm();
+		form.setMoratoriumFromDateDD(moratoriumFromDateDD);
+		form.setMoratoriumFromDateMM(moratoriumFromDateMM);
+		form.setMoratoriumFromDateYY(moratoriumFromDateYY);
+		form.setMoratoriumEndDateDD(moratoriumEndDateDD);
+		form.setMoratoriumEndDateMM(moratoriumEndDateMM);
+		form.setMoratoriumEndDateYY(moratoriumEndDateYY);
+		form.setMoratoriumNotes("inserted for testing, while running test case");
+		Date fromDate = null;
+		fromDate = DateUtils.getDateAsSentFromBrowser(moratoriumFromDateDD + "/" + moratoriumFromDateMM + "/" + moratoriumFromDateYY);
+		form.setFromDate(fromDate);
+		Date endDate = null;
+		endDate = DateUtils.getDateAsSentFromBrowser(moratoriumEndDateDD + "/" + moratoriumEndDateMM + "/" + moratoriumEndDateYY);
+		form.setEndDate(endDate);
+		setActionForm(form);
+		actionPerform();
+		verifyNoActionErrors();
+		verifyNoActionMessages();
+		verifyForward("create_success");
+		assertNotNull(request.getAttribute(Constants.CURRENTFLOWKEY));
+	}
+	
+	public void testEditForClient() throws Exception {
+		createInitialObjects();
+		setRequestPathInfo("/moratoriumAction");
+		addRequestParameter("method", "edit");
+		addRequestParameter(Constants.CURRENTFLOWKEY, flowKey);
+		
+		String customerId = null;
+		String moratoriumId = null;
+		List moratoriumList = getMoratoriumBizService().getMoratoriums();
+		if(moratoriumList != null && moratoriumList.size() != 0)
+		{
+			Iterator<MoratoriumBO> iter = moratoriumList.iterator();
+			while (iter.hasNext()) 
+			{
+				MoratoriumBO moratoriumBO = iter.next();
+				if(moratoriumBO.getCustomerId() != null)
+				{
+					customerId = moratoriumBO.getCustomerId();
+					moratoriumId = String.valueOf(moratoriumBO.getMoratoriumId());
+					break;
+				}
+			}
+		}
+		
+		if(customerId != null)
+		{
+			addRequestParameter("customerId", customerId);
+			addRequestParameter("moratoriumId", moratoriumId);
+			actionPerform();
+			verifyNoActionErrors();
+			verifyNoActionMessages();
+			verifyForward("edit_success");
+			assertNotNull(request.getAttribute(Constants.CURRENTFLOWKEY));
+		}
+	}
+	
+	public void testEditForOffice() throws Exception {
+		createInitialObjects();
+		setRequestPathInfo("/moratoriumAction");
+		addRequestParameter("method", "edit");
+		addRequestParameter(Constants.CURRENTFLOWKEY, flowKey);
+		
+		String officeId = null;
+		String moratoriumId = null;
+		List moratoriumList = getMoratoriumBizService().getMoratoriums();
+		if(moratoriumList != null && moratoriumList.size() != 0)
+		{
+			Iterator<MoratoriumBO> iter = moratoriumList.iterator();
+			while (iter.hasNext()) 
+			{
+				MoratoriumBO moratoriumBO = iter.next();
+				if(moratoriumBO.getOfficeId() != null)
+				{
+					officeId = moratoriumBO.getOfficeId();
+					moratoriumId = String.valueOf(moratoriumBO.getMoratoriumId());
+					break;
+				}
+			}
+		}
+		
+		if(officeId != null)
+		{
+			addRequestParameter("officeId", officeId);
+			addRequestParameter("moratoriumId", moratoriumId);
+			actionPerform();
+			verifyNoActionErrors();
+			verifyNoActionMessages();
+			verifyForward("edit_success");
+			assertNotNull(request.getAttribute(Constants.CURRENTFLOWKEY));
+		}
+	}
+	
+	public void testEditPreviewForClient() throws Exception {
+		createInitialObjects();
+		setRequestPathInfo("/moratoriumAction");
+		addRequestParameter("method", "editPreview");
+		addRequestParameter(Constants.CURRENTFLOWKEY, flowKey);
+		
+		// get today's date
+		Calendar currentCalendar = new GregorianCalendar();
+		int year = currentCalendar.get(Calendar.YEAR);
+		int month = currentCalendar.get(Calendar.MONTH) + 1;
+		int day = currentCalendar.get(Calendar.DAY_OF_MONTH);
+		String moratoriumFromDateDD = String.valueOf(day + 1);
+		String moratoriumFromDateMM = String.valueOf(month);
+		String moratoriumFromDateYY = String.valueOf(year);
+		String moratoriumEndDateDD = String.valueOf(day + 2);
+		String moratoriumEndDateMM = String.valueOf(month);
+		String moratoriumEndDateYY = String.valueOf(year);		
+		
+		addRequestParameter("moratoriumFromDateDD", moratoriumFromDateDD);
+		addRequestParameter("moratoriumFromDateMM", moratoriumFromDateMM);
+		addRequestParameter("moratoriumFromDateYY", moratoriumFromDateYY);		
+		addRequestParameter("moratoriumEndDateDD", moratoriumEndDateDD);
+		addRequestParameter("moratoriumEndDateMM", moratoriumEndDateMM);
+		addRequestParameter("moratoriumEndDateYY", moratoriumEndDateYY);
+		
+		String customerId = null;
+		String moratoriumId = null;
+		List moratoriumList = getMoratoriumBizService().getMoratoriums();
+		if(moratoriumList != null && moratoriumList.size() != 0)
+		{
+			Iterator<MoratoriumBO> iter = moratoriumList.iterator();
+			while (iter.hasNext()) 
+			{
+				MoratoriumBO moratoriumBO = iter.next();
+				if(moratoriumBO.getCustomerId() != null)
+				{
+					customerId = moratoriumBO.getCustomerId();
+					moratoriumId = String.valueOf(moratoriumBO.getMoratoriumId());
+					break;
+				}
+			}
+		}
+		
+		if(customerId != null)
+		{
+			addRequestParameter("customerId", customerId);
+			addRequestParameter("moratoriumId", moratoriumId);
+			actionPerform();
+			verifyNoActionErrors();
+			verifyNoActionMessages();
+			verifyForward("editpreview_success");
+			assertNotNull(request.getAttribute(Constants.CURRENTFLOWKEY));
+		}
+	}
+	
+	public void testEditPreviewForOffice() throws Exception {
+		createInitialObjects();
+		setRequestPathInfo("/moratoriumAction");
+		addRequestParameter("method", "editPreview");
+		addRequestParameter(Constants.CURRENTFLOWKEY, flowKey);
+		
+		// get today's date
+		Calendar currentCalendar = new GregorianCalendar();
+		int year = currentCalendar.get(Calendar.YEAR);
+		int month = currentCalendar.get(Calendar.MONTH) + 1;
+		int day = currentCalendar.get(Calendar.DAY_OF_MONTH);
+		String moratoriumFromDateDD = String.valueOf(day + 1);
+		String moratoriumFromDateMM = String.valueOf(month);
+		String moratoriumFromDateYY = String.valueOf(year);
+		String moratoriumEndDateDD = String.valueOf(day + 2);
+		String moratoriumEndDateMM = String.valueOf(month);
+		String moratoriumEndDateYY = String.valueOf(year);		
+		
+		addRequestParameter("moratoriumFromDateDD", moratoriumFromDateDD);
+		addRequestParameter("moratoriumFromDateMM", moratoriumFromDateMM);
+		addRequestParameter("moratoriumFromDateYY", moratoriumFromDateYY);		
+		addRequestParameter("moratoriumEndDateDD", moratoriumEndDateDD);
+		addRequestParameter("moratoriumEndDateMM", moratoriumEndDateMM);
+		addRequestParameter("moratoriumEndDateYY", moratoriumEndDateYY);
+		
+		String officeId = null;
+		String moratoriumId = null;
+		List moratoriumList = getMoratoriumBizService().getMoratoriums();
+		if(moratoriumList != null && moratoriumList.size() != 0)
+		{
+			Iterator<MoratoriumBO> iter = moratoriumList.iterator();
+			while (iter.hasNext()) 
+			{
+				MoratoriumBO moratoriumBO = iter.next();
+				if(moratoriumBO.getOfficeId() != null)
+				{
+					officeId = moratoriumBO.getOfficeId();
+					moratoriumId = String.valueOf(moratoriumBO.getMoratoriumId());
+					break;
+				}
+			}
+		}
+		
+		if(officeId != null)
+		{
+			addRequestParameter("officeId", officeId);
+			addRequestParameter("moratoriumId", moratoriumId);
+			actionPerform();
+			verifyNoActionErrors();
+			verifyNoActionMessages();
+			verifyForward("editpreview_success");
+			assertNotNull(request.getAttribute(Constants.CURRENTFLOWKEY));
+		}
+	}
+	
+	private void createInitialObjects() {
+		MeetingBO meeting = TestObjectFactory.createMeeting(TestObjectFactory
+				.getTypicalMeeting());
+		center = TestObjectFactory.createCenter("Center", meeting);
+		group = TestObjectFactory.createGroupUnderCenter("Group", CustomerStatus.GROUP_ACTIVE, center);
+		client = TestObjectFactory.createClient("Client", 
+				CustomerStatus.CLIENT_ACTIVE,
+				group);
+	}
+	
+	private MoratoriumBusinessService getMoratoriumBizService() {
+		return new MoratoriumBusinessService();
+	}
+}
Index: test/org/mifos/application/moratorium/struts/action/TestMoratoriumAction.java
===================================================================
--- test/org/mifos/application/moratorium/struts/action/TestMoratoriumAction.java	(revision 0)
+++ test/org/mifos/application/moratorium/struts/action/TestMoratoriumAction.java	(revision 0)
@@ -0,0 +1,413 @@
+package org.mifos.application.moratorium.struts.action;
+
+import java.sql.Date;
+import java.util.Calendar;
+import java.util.GregorianCalendar;
+import java.util.Iterator;
+import java.util.List;
+
+import org.mifos.application.customer.business.CustomerBO;
+import org.mifos.application.customer.util.helpers.CustomerStatus;
+import org.mifos.application.meeting.business.MeetingBO;
+import org.mifos.application.moratorium.business.MoratoriumBO;
+import org.mifos.application.moratorium.business.service.MoratoriumBusinessService;
+import org.mifos.application.moratorium.struts.actionforms.MoratoriumActionForm;
+import org.mifos.framework.MifosMockStrutsTestCase;
+import org.mifos.framework.hibernate.helper.HibernateUtil;
+import org.mifos.framework.security.util.UserContext;
+import org.mifos.framework.util.helpers.Constants;
+import org.mifos.framework.util.helpers.DateUtils;
+import org.mifos.framework.util.helpers.ResourceLoader;
+import org.mifos.framework.util.helpers.TestObjectFactory;
+
+public class TestMoratoriumAction extends MifosMockStrutsTestCase {
+	
+	private String flowKey;
+	
+	private CustomerBO client;
+
+	private CustomerBO group;
+
+	private CustomerBO center;
+
+	@Override
+	protected void setUp() throws Exception {
+		super.setUp();
+		setServletConfigFile(ResourceLoader.getURI("WEB-INF/web.xml")
+				.getPath());
+		setConfigFile(ResourceLoader.getURI(
+				"org/mifos/application/moratorium/struts-config.xml")
+				.getPath());
+		UserContext userContext = TestObjectFactory.getContext();
+		request.getSession().setAttribute(Constants.USERCONTEXT, userContext);		
+		flowKey = createFlow(request, MoratoriumAction.class);
+	}
+	
+	@Override
+	protected void tearDown() throws Exception {
+		TestObjectFactory.cleanUp(client);
+		TestObjectFactory.cleanUp(group);
+		TestObjectFactory.cleanUp(center);
+		HibernateUtil.closeSession();
+		super.tearDown();
+	}
+	
+	public void testCreateForClient() throws Exception {
+		createInitialObjects();
+		setRequestPathInfo("/moratoriumAction");
+		addRequestParameter("method", "create");
+		addRequestParameter("customerId", String.valueOf(client.getCustomerId()));
+		addRequestParameter(Constants.CURRENTFLOWKEY, flowKey);
+		
+		// get today's date
+		Calendar currentCalendar = new GregorianCalendar();
+		int year = currentCalendar.get(Calendar.YEAR);
+		int month = currentCalendar.get(Calendar.MONTH) + 1;
+		int day = currentCalendar.get(Calendar.DAY_OF_MONTH);
+		String moratoriumFromDateDD = String.valueOf(day + 1);
+		String moratoriumFromDateMM = String.valueOf(month);
+		String moratoriumFromDateYY = String.valueOf(year);
+		String moratoriumEndDateDD = String.valueOf(day + 2);
+		String moratoriumEndDateMM = String.valueOf(month);
+		String moratoriumEndDateYY = String.valueOf(year);		
+		
+		addRequestParameter("moratoriumFromDateDD", moratoriumFromDateDD);
+		addRequestParameter("moratoriumFromDateMM", moratoriumFromDateMM);
+		addRequestParameter("moratoriumFromDateYY", moratoriumFromDateYY);		
+		addRequestParameter("moratoriumEndDateDD", moratoriumEndDateDD);
+		addRequestParameter("moratoriumEndDateMM", moratoriumEndDateMM);
+		addRequestParameter("moratoriumEndDateYY", moratoriumEndDateYY);
+		
+		actionPerform();
+		verifyNoActionErrors();
+		verifyNoActionMessages();
+		verifyForward("create");
+		assertNotNull(request.getAttribute(Constants.CURRENTFLOWKEY));
+	}
+	
+	public void testCreateForOffice() throws Exception {
+		createInitialObjects();
+		setRequestPathInfo("/moratoriumAction");
+		addRequestParameter("method", "create");
+		addRequestParameter("officeId", "1");
+		addRequestParameter(Constants.CURRENTFLOWKEY, flowKey);
+		
+		// get today's date
+		Calendar currentCalendar = new GregorianCalendar();
+		int year = currentCalendar.get(Calendar.YEAR);
+		int month = currentCalendar.get(Calendar.MONTH) + 1;
+		int day = currentCalendar.get(Calendar.DAY_OF_MONTH);
+		String moratoriumFromDateDD = String.valueOf(day + 1);
+		String moratoriumFromDateMM = String.valueOf(month);
+		String moratoriumFromDateYY = String.valueOf(year);
+		String moratoriumEndDateDD = String.valueOf(day + 2);
+		String moratoriumEndDateMM = String.valueOf(month);
+		String moratoriumEndDateYY = String.valueOf(year);		
+		
+		addRequestParameter("moratoriumFromDateDD", moratoriumFromDateDD);
+		addRequestParameter("moratoriumFromDateMM", moratoriumFromDateMM);
+		addRequestParameter("moratoriumFromDateYY", moratoriumFromDateYY);		
+		addRequestParameter("moratoriumEndDateDD", moratoriumEndDateDD);
+		addRequestParameter("moratoriumEndDateMM", moratoriumEndDateMM);
+		addRequestParameter("moratoriumEndDateYY", moratoriumEndDateYY);
+		
+		actionPerform();
+		verifyNoActionErrors();
+		verifyNoActionMessages();
+		verifyForward("createForBranch");
+		assertNotNull(request.getAttribute(Constants.CURRENTFLOWKEY));
+	}
+	
+	public void testCreateConfirmedForClient() throws Exception {
+		createInitialObjects();
+		setRequestPathInfo("/moratoriumAction");
+		addRequestParameter("method", "createConfirmed");
+		addRequestParameter("customerId", String.valueOf(client.getCustomerId()));
+		addRequestParameter(Constants.CURRENTFLOWKEY, flowKey);
+		
+		// get today's date
+		Calendar currentCalendar = new GregorianCalendar();
+		int year = currentCalendar.get(Calendar.YEAR);
+		int month = currentCalendar.get(Calendar.MONTH) + 1;
+		int day = currentCalendar.get(Calendar.DAY_OF_MONTH);
+		String moratoriumFromDateDD = String.valueOf(day + 1);
+		String moratoriumFromDateMM = String.valueOf(month);
+		String moratoriumFromDateYY = String.valueOf(year);
+		String moratoriumEndDateDD = String.valueOf(day + 2);
+		String moratoriumEndDateMM = String.valueOf(month);
+		String moratoriumEndDateYY = String.valueOf(year);		
+		
+		addRequestParameter("moratoriumFromDateDD", moratoriumFromDateDD);
+		addRequestParameter("moratoriumFromDateMM", moratoriumFromDateMM);
+		addRequestParameter("moratoriumFromDateYY", moratoriumFromDateYY);		
+		addRequestParameter("moratoriumEndDateDD", moratoriumEndDateDD);
+		addRequestParameter("moratoriumEndDateMM", moratoriumEndDateMM);
+		addRequestParameter("moratoriumEndDateYY", moratoriumEndDateYY);
+		
+		MoratoriumActionForm form = new MoratoriumActionForm();
+		form.setMoratoriumFromDateDD(moratoriumFromDateDD);
+		form.setMoratoriumFromDateMM(moratoriumFromDateMM);
+		form.setMoratoriumFromDateYY(moratoriumFromDateYY);
+		form.setMoratoriumEndDateDD(moratoriumEndDateDD);
+		form.setMoratoriumEndDateMM(moratoriumEndDateMM);
+		form.setMoratoriumEndDateYY(moratoriumEndDateYY);
+		form.setMoratoriumNotes("inserted for testing, while running test case");
+		Date fromDate = null;
+		fromDate = DateUtils.getDateAsSentFromBrowser(moratoriumFromDateDD + "/" + moratoriumFromDateMM + "/" + moratoriumFromDateYY);
+		form.setFromDate(fromDate);
+		Date endDate = null;
+		endDate = DateUtils.getDateAsSentFromBrowser(moratoriumEndDateDD + "/" + moratoriumEndDateMM + "/" + moratoriumEndDateYY);
+		form.setEndDate(endDate);
+		setActionForm(form);
+		actionPerform();
+		verifyNoActionErrors();
+		verifyNoActionMessages();
+		verifyForward("create_success");
+		assertNotNull(request.getAttribute(Constants.CURRENTFLOWKEY));
+	}
+	
+	public void testCreateConfirmedForOffice() throws Exception {
+		createInitialObjects();
+		setRequestPathInfo("/moratoriumAction");
+		addRequestParameter("method", "createConfirmed");
+		// officeId >> 3, it is for TestBranchOffice, it is inserted by testdbinsertionscript.sql
+		addRequestParameter("officeId", String.valueOf("3"));
+		addRequestParameter(Constants.CURRENTFLOWKEY, flowKey);
+		
+		// get today's date
+		Calendar currentCalendar = new GregorianCalendar();
+		int year = currentCalendar.get(Calendar.YEAR);
+		int month = currentCalendar.get(Calendar.MONTH) + 1;
+		int day = currentCalendar.get(Calendar.DAY_OF_MONTH);
+		String moratoriumFromDateDD = String.valueOf(day + 1);
+		String moratoriumFromDateMM = String.valueOf(month);
+		String moratoriumFromDateYY = String.valueOf(year);
+		String moratoriumEndDateDD = String.valueOf(day + 2);
+		String moratoriumEndDateMM = String.valueOf(month);
+		String moratoriumEndDateYY = String.valueOf(year);		
+		
+		addRequestParameter("moratoriumFromDateDD", moratoriumFromDateDD);
+		addRequestParameter("moratoriumFromDateMM", moratoriumFromDateMM);
+		addRequestParameter("moratoriumFromDateYY", moratoriumFromDateYY);		
+		addRequestParameter("moratoriumEndDateDD", moratoriumEndDateDD);
+		addRequestParameter("moratoriumEndDateMM", moratoriumEndDateMM);
+		addRequestParameter("moratoriumEndDateYY", moratoriumEndDateYY);
+		
+		MoratoriumActionForm form = new MoratoriumActionForm();
+		form.setMoratoriumFromDateDD(moratoriumFromDateDD);
+		form.setMoratoriumFromDateMM(moratoriumFromDateMM);
+		form.setMoratoriumFromDateYY(moratoriumFromDateYY);
+		form.setMoratoriumEndDateDD(moratoriumEndDateDD);
+		form.setMoratoriumEndDateMM(moratoriumEndDateMM);
+		form.setMoratoriumEndDateYY(moratoriumEndDateYY);
+		form.setMoratoriumNotes("inserted for testing, while running test case");
+		Date fromDate = null;
+		fromDate = DateUtils.getDateAsSentFromBrowser(moratoriumFromDateDD + "/" + moratoriumFromDateMM + "/" + moratoriumFromDateYY);
+		form.setFromDate(fromDate);
+		Date endDate = null;
+		endDate = DateUtils.getDateAsSentFromBrowser(moratoriumEndDateDD + "/" + moratoriumEndDateMM + "/" + moratoriumEndDateYY);
+		form.setEndDate(endDate);
+		setActionForm(form);
+		actionPerform();
+		verifyNoActionErrors();
+		verifyNoActionMessages();
+		verifyForward("create_success");
+		assertNotNull(request.getAttribute(Constants.CURRENTFLOWKEY));
+	}
+	
+	public void testEditForClient() throws Exception {
+		createInitialObjects();
+		setRequestPathInfo("/moratoriumAction");
+		addRequestParameter("method", "edit");
+		addRequestParameter(Constants.CURRENTFLOWKEY, flowKey);
+		
+		String customerId = null;
+		String moratoriumId = null;
+		List moratoriumList = getMoratoriumBizService().getMoratoriums();
+		if(moratoriumList != null && moratoriumList.size() != 0)
+		{
+			Iterator<MoratoriumBO> iter = moratoriumList.iterator();
+			while (iter.hasNext()) 
+			{
+				MoratoriumBO moratoriumBO = iter.next();
+				if(moratoriumBO.getCustomerId() != null)
+				{
+					customerId = moratoriumBO.getCustomerId();
+					moratoriumId = String.valueOf(moratoriumBO.getMoratoriumId());
+					break;
+				}
+			}
+		}
+		
+		if(customerId != null)
+		{
+			addRequestParameter("customerId", customerId);
+			addRequestParameter("moratoriumId", moratoriumId);
+			actionPerform();
+			verifyNoActionErrors();
+			verifyNoActionMessages();
+			verifyForward("edit_success");
+			assertNotNull(request.getAttribute(Constants.CURRENTFLOWKEY));
+		}
+	}
+	
+	public void testEditForOffice() throws Exception {
+		createInitialObjects();
+		setRequestPathInfo("/moratoriumAction");
+		addRequestParameter("method", "edit");
+		addRequestParameter(Constants.CURRENTFLOWKEY, flowKey);
+		
+		String officeId = null;
+		String moratoriumId = null;
+		List moratoriumList = getMoratoriumBizService().getMoratoriums();
+		if(moratoriumList != null && moratoriumList.size() != 0)
+		{
+			Iterator<MoratoriumBO> iter = moratoriumList.iterator();
+			while (iter.hasNext()) 
+			{
+				MoratoriumBO moratoriumBO = iter.next();
+				if(moratoriumBO.getOfficeId() != null)
+				{
+					officeId = moratoriumBO.getOfficeId();
+					moratoriumId = String.valueOf(moratoriumBO.getMoratoriumId());
+					break;
+				}
+			}
+		}
+		
+		if(officeId != null)
+		{
+			addRequestParameter("officeId", officeId);
+			addRequestParameter("moratoriumId", moratoriumId);
+			actionPerform();
+			verifyNoActionErrors();
+			verifyNoActionMessages();
+			verifyForward("edit_success");
+			assertNotNull(request.getAttribute(Constants.CURRENTFLOWKEY));
+		}
+	}
+	
+	public void testEditPreviewForClient() throws Exception {
+		createInitialObjects();
+		setRequestPathInfo("/moratoriumAction");
+		addRequestParameter("method", "editPreview");
+		addRequestParameter(Constants.CURRENTFLOWKEY, flowKey);
+		
+		// get today's date
+		Calendar currentCalendar = new GregorianCalendar();
+		int year = currentCalendar.get(Calendar.YEAR);
+		int month = currentCalendar.get(Calendar.MONTH) + 1;
+		int day = currentCalendar.get(Calendar.DAY_OF_MONTH);
+		String moratoriumFromDateDD = String.valueOf(day + 1);
+		String moratoriumFromDateMM = String.valueOf(month);
+		String moratoriumFromDateYY = String.valueOf(year);
+		String moratoriumEndDateDD = String.valueOf(day + 2);
+		String moratoriumEndDateMM = String.valueOf(month);
+		String moratoriumEndDateYY = String.valueOf(year);		
+		
+		addRequestParameter("moratoriumFromDateDD", moratoriumFromDateDD);
+		addRequestParameter("moratoriumFromDateMM", moratoriumFromDateMM);
+		addRequestParameter("moratoriumFromDateYY", moratoriumFromDateYY);		
+		addRequestParameter("moratoriumEndDateDD", moratoriumEndDateDD);
+		addRequestParameter("moratoriumEndDateMM", moratoriumEndDateMM);
+		addRequestParameter("moratoriumEndDateYY", moratoriumEndDateYY);
+		
+		String customerId = null;
+		String moratoriumId = null;
+		List moratoriumList = getMoratoriumBizService().getMoratoriums();
+		if(moratoriumList != null && moratoriumList.size() != 0)
+		{
+			Iterator<MoratoriumBO> iter = moratoriumList.iterator();
+			while (iter.hasNext()) 
+			{
+				MoratoriumBO moratoriumBO = iter.next();
+				if(moratoriumBO.getCustomerId() != null)
+				{
+					customerId = moratoriumBO.getCustomerId();
+					moratoriumId = String.valueOf(moratoriumBO.getMoratoriumId());
+					break;
+				}
+			}
+		}
+		
+		if(customerId != null)
+		{
+			addRequestParameter("customerId", customerId);
+			addRequestParameter("moratoriumId", moratoriumId);
+			actionPerform();
+			verifyNoActionErrors();
+			verifyNoActionMessages();
+			verifyForward("editpreview_success");
+			assertNotNull(request.getAttribute(Constants.CURRENTFLOWKEY));
+		}
+	}
+	
+	public void testEditPreviewForOffice() throws Exception {
+		createInitialObjects();
+		setRequestPathInfo("/moratoriumAction");
+		addRequestParameter("method", "editPreview");
+		addRequestParameter(Constants.CURRENTFLOWKEY, flowKey);
+		
+		// get today's date
+		Calendar currentCalendar = new GregorianCalendar();
+		int year = currentCalendar.get(Calendar.YEAR);
+		int month = currentCalendar.get(Calendar.MONTH) + 1;
+		int day = currentCalendar.get(Calendar.DAY_OF_MONTH);
+		String moratoriumFromDateDD = String.valueOf(day + 1);
+		String moratoriumFromDateMM = String.valueOf(month);
+		String moratoriumFromDateYY = String.valueOf(year);
+		String moratoriumEndDateDD = String.valueOf(day + 2);
+		String moratoriumEndDateMM = String.valueOf(month);
+		String moratoriumEndDateYY = String.valueOf(year);		
+		
+		addRequestParameter("moratoriumFromDateDD", moratoriumFromDateDD);
+		addRequestParameter("moratoriumFromDateMM", moratoriumFromDateMM);
+		addRequestParameter("moratoriumFromDateYY", moratoriumFromDateYY);		
+		addRequestParameter("moratoriumEndDateDD", moratoriumEndDateDD);
+		addRequestParameter("moratoriumEndDateMM", moratoriumEndDateMM);
+		addRequestParameter("moratoriumEndDateYY", moratoriumEndDateYY);
+		
+		String officeId = null;
+		String moratoriumId = null;
+		List moratoriumList = getMoratoriumBizService().getMoratoriums();
+		if(moratoriumList != null && moratoriumList.size() != 0)
+		{
+			Iterator<MoratoriumBO> iter = moratoriumList.iterator();
+			while (iter.hasNext()) 
+			{
+				MoratoriumBO moratoriumBO = iter.next();
+				if(moratoriumBO.getOfficeId() != null)
+				{
+					officeId = moratoriumBO.getOfficeId();
+					moratoriumId = String.valueOf(moratoriumBO.getMoratoriumId());
+					break;
+				}
+			}
+		}
+		
+		if(officeId != null)
+		{
+			addRequestParameter("officeId", officeId);
+			addRequestParameter("moratoriumId", moratoriumId);
+			actionPerform();
+			verifyNoActionErrors();
+			verifyNoActionMessages();
+			verifyForward("editpreview_success");
+			assertNotNull(request.getAttribute(Constants.CURRENTFLOWKEY));
+		}
+	}
+	
+	private void createInitialObjects() {
+		MeetingBO meeting = TestObjectFactory.createMeeting(TestObjectFactory
+				.getTypicalMeeting());
+		center = TestObjectFactory.createCenter("Center", meeting);
+		group = TestObjectFactory.createGroupUnderCenter("Group", CustomerStatus.GROUP_ACTIVE, center);
+		client = TestObjectFactory.createClient("Client", 
+				CustomerStatus.CLIENT_ACTIVE,
+				group);
+	}
+	
+	private MoratoriumBusinessService getMoratoriumBizService() {
+		return new MoratoriumBusinessService();
+	}
+}
Index: test/org/mifos/application/moratorium/struts/actionforms/TestMoratoriumActionForm.java
===================================================================
--- test/org/mifos/application/moratorium/struts/actionforms/TestMoratoriumActionForm.java	(revision 0)
+++ test/org/mifos/application/moratorium/struts/actionforms/TestMoratoriumActionForm.java	(revision 0)
@@ -0,0 +1,182 @@
+package org.mifos.application.moratorium.struts.actionforms;
+
+import java.util.Calendar;
+import java.util.GregorianCalendar;
+
+import org.apache.struts.action.ActionErrors;
+import org.apache.struts.action.ActionMapping;
+import org.apache.struts.action.ActionMessage;
+import org.mifos.application.moratorium.util.resources.MoratoriumConstants;
+import org.mifos.framework.MifosMockStrutsTestCase;
+import org.mifos.framework.security.util.UserContext;
+import org.mifos.framework.util.helpers.Constants;
+import org.mifos.framework.util.helpers.ResourceLoader;
+import org.mifos.framework.util.helpers.TestObjectFactory;
+
+public class TestMoratoriumActionForm extends MifosMockStrutsTestCase  {
+	
+	UserContext userContext = null;
+	
+	@Override
+	protected void setUp() throws Exception {
+		super.setUp();				
+		setConfigFile(ResourceLoader
+				.getURI(
+						"org/mifos/application/moratorium/struts-config.xml")
+				.getPath());
+		
+		userContext = TestObjectFactory.getContext();
+		request.getSession().setAttribute(Constants.USERCONTEXT, userContext);
+	}
+	
+	public void testValidFromDate() throws Exception {		
+		addRequestParameter("method", "create");
+		addRequestParameter("moratoriumLst", "");
+		
+		// get today's date
+		Calendar currentCalendar = new GregorianCalendar();
+		int year = currentCalendar.get(Calendar.YEAR);
+		int month = currentCalendar.get(Calendar.MONTH) + 1;
+		int day = currentCalendar.get(Calendar.DAY_OF_MONTH);
+		String moratoriumFromDateDD = String.valueOf(day + 1);
+		String moratoriumFromDateMM = String.valueOf(month);
+		String moratoriumFromDateYY = String.valueOf(year);
+		String moratoriumEndDateDD = String.valueOf(day + 2);
+		String moratoriumEndDateMM = String.valueOf(month);
+		String moratoriumEndDateYY = String.valueOf(year);
+		
+		MoratoriumActionForm form = new MoratoriumActionForm();
+		ActionErrors errors = new ActionErrors();
+		form.setMoratoriumFromDateDD(moratoriumFromDateDD);
+		form.setMoratoriumFromDateMM(moratoriumFromDateMM);
+		form.setMoratoriumFromDateYY(moratoriumFromDateYY);
+		form.setMoratoriumEndDateDD(moratoriumEndDateDD);
+		form.setMoratoriumEndDateMM(moratoriumEndDateMM);
+		form.setMoratoriumEndDateYY(moratoriumEndDateYY);
+		
+		errors = form.validate(new ActionMapping(), request);
+		assertEquals(0, errors.size());
+	}
+	
+	public void testInValidFromDate() throws Exception {		
+		addRequestParameter("method", "create");
+		addRequestParameter("moratoriumLst", "");
+		
+		// get today's date
+		Calendar currentCalendar = new GregorianCalendar();
+		int year = currentCalendar.get(Calendar.YEAR);
+		int month = currentCalendar.get(Calendar.MONTH) + 1;
+		int day = currentCalendar.get(Calendar.DAY_OF_MONTH);
+		String moratoriumFromDateDD = String.valueOf(day -35);
+		String moratoriumFromDateMM = String.valueOf(month);
+		String moratoriumFromDateYY = String.valueOf(year);
+		String moratoriumEndDateDD = String.valueOf(day + 2);
+		String moratoriumEndDateMM = String.valueOf(month);
+		String moratoriumEndDateYY = String.valueOf(year);
+		
+		MoratoriumActionForm form = new MoratoriumActionForm();
+		ActionErrors errors = new ActionErrors();
+		form.setMoratoriumFromDateDD(moratoriumFromDateDD);
+		form.setMoratoriumFromDateMM(moratoriumFromDateMM);
+		form.setMoratoriumFromDateYY(moratoriumFromDateYY);
+		form.setMoratoriumEndDateDD(moratoriumEndDateDD);
+		form.setMoratoriumEndDateMM(moratoriumEndDateMM);
+		form.setMoratoriumEndDateYY(moratoriumEndDateYY);
+		
+		errors = form.validate(new ActionMapping(), request);
+		assertEquals(1, errors.size());
+		ActionMessage message = (ActionMessage) errors.get().next();
+		assertEquals(MoratoriumConstants.INVALIDFROMDATE, message.getKey());
+	}
+	
+	public void testInValidFormatForFromDate() throws Exception {		
+		addRequestParameter("method", "create");
+		addRequestParameter("moratoriumLst", "");
+		
+		// get today's date
+		Calendar currentCalendar = new GregorianCalendar();
+		int year = currentCalendar.get(Calendar.YEAR);
+		int month = currentCalendar.get(Calendar.MONTH) + 1;
+		int day = currentCalendar.get(Calendar.DAY_OF_MONTH);		
+		String moratoriumFromDateMM = String.valueOf(month);
+		String moratoriumFromDateYY = String.valueOf(year);
+		String moratoriumEndDateDD = String.valueOf(day + 2);
+		String moratoriumEndDateMM = String.valueOf(month);
+		String moratoriumEndDateYY = String.valueOf(year);
+		
+		MoratoriumActionForm form = new MoratoriumActionForm();
+		ActionErrors errors = new ActionErrors();
+		form.setMoratoriumFromDateDD("asdf");
+		form.setMoratoriumFromDateMM(moratoriumFromDateMM);
+		form.setMoratoriumFromDateYY(moratoriumFromDateYY);
+		form.setMoratoriumEndDateDD(moratoriumEndDateDD);
+		form.setMoratoriumEndDateMM(moratoriumEndDateMM);
+		form.setMoratoriumEndDateYY(moratoriumEndDateYY);
+		
+		errors = form.validate(new ActionMapping(), request);
+		assertEquals(1, errors.size());
+		ActionMessage message = (ActionMessage) errors.get().next();
+		assertEquals(MoratoriumConstants.INVALID_FORMAT_FOR_FROM_DATE, message.getKey());
+	}
+	
+	public void testInValidEndDate() throws Exception {		
+		addRequestParameter("method", "create");
+		addRequestParameter("moratoriumLst", "");
+		
+		// get today's date
+		Calendar currentCalendar = new GregorianCalendar();
+		int year = currentCalendar.get(Calendar.YEAR);
+		int month = currentCalendar.get(Calendar.MONTH) + 1;
+		int day = currentCalendar.get(Calendar.DAY_OF_MONTH);
+		String moratoriumFromDateDD = String.valueOf(day + 1);
+		String moratoriumFromDateMM = String.valueOf(month);
+		String moratoriumFromDateYY = String.valueOf(year);
+		String moratoriumEndDateDD = String.valueOf(day - 2);
+		String moratoriumEndDateMM = String.valueOf(month);
+		String moratoriumEndDateYY = String.valueOf(year);
+		
+		MoratoriumActionForm form = new MoratoriumActionForm();
+		ActionErrors errors = new ActionErrors();
+		form.setMoratoriumFromDateDD(moratoriumFromDateDD);
+		form.setMoratoriumFromDateMM(moratoriumFromDateMM);
+		form.setMoratoriumFromDateYY(moratoriumFromDateYY);
+		form.setMoratoriumEndDateDD(moratoriumEndDateDD);
+		form.setMoratoriumEndDateMM(moratoriumEndDateMM);
+		form.setMoratoriumEndDateYY(moratoriumEndDateYY);
+		
+		errors = form.validate(new ActionMapping(), request);
+		assertEquals(1, errors.size());
+		ActionMessage message = (ActionMessage) errors.get().next();
+		assertEquals(MoratoriumConstants.INVALIDENDDATE, message.getKey());
+	}
+	
+	public void testInValidFormatForEndDate() throws Exception {		
+		addRequestParameter("method", "create");
+		addRequestParameter("moratoriumLst", "");
+		
+		// get today's date
+		Calendar currentCalendar = new GregorianCalendar();
+		int year = currentCalendar.get(Calendar.YEAR);
+		int month = currentCalendar.get(Calendar.MONTH) + 1;
+		int day = currentCalendar.get(Calendar.DAY_OF_MONTH);
+		String moratoriumFromDateDD = String.valueOf(day + 1);
+		String moratoriumFromDateMM = String.valueOf(month);
+		String moratoriumFromDateYY = String.valueOf(year);		
+		String moratoriumEndDateMM = String.valueOf(month);
+		String moratoriumEndDateYY = String.valueOf(year);
+		
+		MoratoriumActionForm form = new MoratoriumActionForm();
+		ActionErrors errors = new ActionErrors();		
+		form.setMoratoriumFromDateDD(moratoriumFromDateDD);
+		form.setMoratoriumFromDateMM(moratoriumFromDateMM);
+		form.setMoratoriumFromDateYY(moratoriumFromDateYY);
+		form.setMoratoriumEndDateDD("asdf");
+		form.setMoratoriumEndDateMM(moratoriumEndDateMM);
+		form.setMoratoriumEndDateYY(moratoriumEndDateYY);
+		
+		errors = form.validate(new ActionMapping(), request);
+		assertEquals(1, errors.size());
+		ActionMessage message = (ActionMessage) errors.get().next();
+		assertEquals(MoratoriumConstants.INVALID_FORMAT_FOR_END_DATE, message.getKey());
+	}
+}
Index: test/org/mifos/application/moratorium/struts/actionforms/TestMoratoriumActionForm.java
===================================================================
--- test/org/mifos/application/moratorium/struts/actionforms/TestMoratoriumActionForm.java	(revision 0)
+++ test/org/mifos/application/moratorium/struts/actionforms/TestMoratoriumActionForm.java	(revision 0)
@@ -0,0 +1,182 @@
+package org.mifos.application.moratorium.struts.actionforms;
+
+import java.util.Calendar;
+import java.util.GregorianCalendar;
+
+import org.apache.struts.action.ActionErrors;
+import org.apache.struts.action.ActionMapping;
+import org.apache.struts.action.ActionMessage;
+import org.mifos.application.moratorium.util.resources.MoratoriumConstants;
+import org.mifos.framework.MifosMockStrutsTestCase;
+import org.mifos.framework.security.util.UserContext;
+import org.mifos.framework.util.helpers.Constants;
+import org.mifos.framework.util.helpers.ResourceLoader;
+import org.mifos.framework.util.helpers.TestObjectFactory;
+
+public class TestMoratoriumActionForm extends MifosMockStrutsTestCase  {
+	
+	UserContext userContext = null;
+	
+	@Override
+	protected void setUp() throws Exception {
+		super.setUp();				
+		setConfigFile(ResourceLoader
+				.getURI(
+						"org/mifos/application/moratorium/struts-config.xml")
+				.getPath());
+		
+		userContext = TestObjectFactory.getContext();
+		request.getSession().setAttribute(Constants.USERCONTEXT, userContext);
+	}
+	
+	public void testValidFromDate() throws Exception {		
+		addRequestParameter("method", "create");
+		addRequestParameter("moratoriumLst", "");
+		
+		// get today's date
+		Calendar currentCalendar = new GregorianCalendar();
+		int year = currentCalendar.get(Calendar.YEAR);
+		int month = currentCalendar.get(Calendar.MONTH) + 1;
+		int day = currentCalendar.get(Calendar.DAY_OF_MONTH);
+		String moratoriumFromDateDD = String.valueOf(day + 1);
+		String moratoriumFromDateMM = String.valueOf(month);
+		String moratoriumFromDateYY = String.valueOf(year);
+		String moratoriumEndDateDD = String.valueOf(day + 2);
+		String moratoriumEndDateMM = String.valueOf(month);
+		String moratoriumEndDateYY = String.valueOf(year);
+		
+		MoratoriumActionForm form = new MoratoriumActionForm();
+		ActionErrors errors = new ActionErrors();
+		form.setMoratoriumFromDateDD(moratoriumFromDateDD);
+		form.setMoratoriumFromDateMM(moratoriumFromDateMM);
+		form.setMoratoriumFromDateYY(moratoriumFromDateYY);
+		form.setMoratoriumEndDateDD(moratoriumEndDateDD);
+		form.setMoratoriumEndDateMM(moratoriumEndDateMM);
+		form.setMoratoriumEndDateYY(moratoriumEndDateYY);
+		
+		errors = form.validate(new ActionMapping(), request);
+		assertEquals(0, errors.size());
+	}
+	
+	public void testInValidFromDate() throws Exception {		
+		addRequestParameter("method", "create");
+		addRequestParameter("moratoriumLst", "");
+		
+		// get today's date
+		Calendar currentCalendar = new GregorianCalendar();
+		int year = currentCalendar.get(Calendar.YEAR);
+		int month = currentCalendar.get(Calendar.MONTH) + 1;
+		int day = currentCalendar.get(Calendar.DAY_OF_MONTH);
+		String moratoriumFromDateDD = String.valueOf(day -35);
+		String moratoriumFromDateMM = String.valueOf(month);
+		String moratoriumFromDateYY = String.valueOf(year);
+		String moratoriumEndDateDD = String.valueOf(day + 2);
+		String moratoriumEndDateMM = String.valueOf(month);
+		String moratoriumEndDateYY = String.valueOf(year);
+		
+		MoratoriumActionForm form = new MoratoriumActionForm();
+		ActionErrors errors = new ActionErrors();
+		form.setMoratoriumFromDateDD(moratoriumFromDateDD);
+		form.setMoratoriumFromDateMM(moratoriumFromDateMM);
+		form.setMoratoriumFromDateYY(moratoriumFromDateYY);
+		form.setMoratoriumEndDateDD(moratoriumEndDateDD);
+		form.setMoratoriumEndDateMM(moratoriumEndDateMM);
+		form.setMoratoriumEndDateYY(moratoriumEndDateYY);
+		
+		errors = form.validate(new ActionMapping(), request);
+		assertEquals(1, errors.size());
+		ActionMessage message = (ActionMessage) errors.get().next();
+		assertEquals(MoratoriumConstants.INVALIDFROMDATE, message.getKey());
+	}
+	
+	public void testInValidFormatForFromDate() throws Exception {		
+		addRequestParameter("method", "create");
+		addRequestParameter("moratoriumLst", "");
+		
+		// get today's date
+		Calendar currentCalendar = new GregorianCalendar();
+		int year = currentCalendar.get(Calendar.YEAR);
+		int month = currentCalendar.get(Calendar.MONTH) + 1;
+		int day = currentCalendar.get(Calendar.DAY_OF_MONTH);		
+		String moratoriumFromDateMM = String.valueOf(month);
+		String moratoriumFromDateYY = String.valueOf(year);
+		String moratoriumEndDateDD = String.valueOf(day + 2);
+		String moratoriumEndDateMM = String.valueOf(month);
+		String moratoriumEndDateYY = String.valueOf(year);
+		
+		MoratoriumActionForm form = new MoratoriumActionForm();
+		ActionErrors errors = new ActionErrors();
+		form.setMoratoriumFromDateDD("asdf");
+		form.setMoratoriumFromDateMM(moratoriumFromDateMM);
+		form.setMoratoriumFromDateYY(moratoriumFromDateYY);
+		form.setMoratoriumEndDateDD(moratoriumEndDateDD);
+		form.setMoratoriumEndDateMM(moratoriumEndDateMM);
+		form.setMoratoriumEndDateYY(moratoriumEndDateYY);
+		
+		errors = form.validate(new ActionMapping(), request);
+		assertEquals(1, errors.size());
+		ActionMessage message = (ActionMessage) errors.get().next();
+		assertEquals(MoratoriumConstants.INVALID_FORMAT_FOR_FROM_DATE, message.getKey());
+	}
+	
+	public void testInValidEndDate() throws Exception {		
+		addRequestParameter("method", "create");
+		addRequestParameter("moratoriumLst", "");
+		
+		// get today's date
+		Calendar currentCalendar = new GregorianCalendar();
+		int year = currentCalendar.get(Calendar.YEAR);
+		int month = currentCalendar.get(Calendar.MONTH) + 1;
+		int day = currentCalendar.get(Calendar.DAY_OF_MONTH);
+		String moratoriumFromDateDD = String.valueOf(day + 1);
+		String moratoriumFromDateMM = String.valueOf(month);
+		String moratoriumFromDateYY = String.valueOf(year);
+		String moratoriumEndDateDD = String.valueOf(day - 2);
+		String moratoriumEndDateMM = String.valueOf(month);
+		String moratoriumEndDateYY = String.valueOf(year);
+		
+		MoratoriumActionForm form = new MoratoriumActionForm();
+		ActionErrors errors = new ActionErrors();
+		form.setMoratoriumFromDateDD(moratoriumFromDateDD);
+		form.setMoratoriumFromDateMM(moratoriumFromDateMM);
+		form.setMoratoriumFromDateYY(moratoriumFromDateYY);
+		form.setMoratoriumEndDateDD(moratoriumEndDateDD);
+		form.setMoratoriumEndDateMM(moratoriumEndDateMM);
+		form.setMoratoriumEndDateYY(moratoriumEndDateYY);
+		
+		errors = form.validate(new ActionMapping(), request);
+		assertEquals(1, errors.size());
+		ActionMessage message = (ActionMessage) errors.get().next();
+		assertEquals(MoratoriumConstants.INVALIDENDDATE, message.getKey());
+	}
+	
+	public void testInValidFormatForEndDate() throws Exception {		
+		addRequestParameter("method", "create");
+		addRequestParameter("moratoriumLst", "");
+		
+		// get today's date
+		Calendar currentCalendar = new GregorianCalendar();
+		int year = currentCalendar.get(Calendar.YEAR);
+		int month = currentCalendar.get(Calendar.MONTH) + 1;
+		int day = currentCalendar.get(Calendar.DAY_OF_MONTH);
+		String moratoriumFromDateDD = String.valueOf(day + 1);
+		String moratoriumFromDateMM = String.valueOf(month);
+		String moratoriumFromDateYY = String.valueOf(year);		
+		String moratoriumEndDateMM = String.valueOf(month);
+		String moratoriumEndDateYY = String.valueOf(year);
+		
+		MoratoriumActionForm form = new MoratoriumActionForm();
+		ActionErrors errors = new ActionErrors();		
+		form.setMoratoriumFromDateDD(moratoriumFromDateDD);
+		form.setMoratoriumFromDateMM(moratoriumFromDateMM);
+		form.setMoratoriumFromDateYY(moratoriumFromDateYY);
+		form.setMoratoriumEndDateDD("asdf");
+		form.setMoratoriumEndDateMM(moratoriumEndDateMM);
+		form.setMoratoriumEndDateYY(moratoriumEndDateYY);
+		
+		errors = form.validate(new ActionMapping(), request);
+		assertEquals(1, errors.size());
+		ActionMessage message = (ActionMessage) errors.get().next();
+		assertEquals(MoratoriumConstants.INVALID_FORMAT_FOR_END_DATE, message.getKey());
+	}
+}
Index: test/org/mifos/application/moratorium/util/resources/MoratoriumUIResources.properties
===================================================================
--- test/org/mifos/application/moratorium/util/resources/MoratoriumUIResources.properties	(revision 0)
+++ test/org/mifos/application/moratorium/util/resources/MoratoriumUIResources.properties	(revision 0)
@@ -0,0 +1,67 @@
+moratorium.moratoriumcatinfo=Search
+moratorium.review=Review &amp; submit
+moratorium.define=Apply Moratorium
+moratorium.categoryinfo=Search
+moratorium.compfields=Choose an option to apply either branch motatorium or client/group/center moratorium and click Continue.
+moratorium.clickcanc=Click Cancel to return to admin without submitting information.
+moratorium.applyForOffice=Apply Mfi/regional/ branch moratorium
+moratorium.applyForClient=Apply client/group/center moratorium
+moratorium.preview=Preview
+moratorium.cancel=Cancel
+moratorium.continue=Continue
+moratorium.enter_search_criteria_for_branch=To apply a moratorium on a branch, click on a branch from the list below. Click Cancel to return to Admin without submitting information.
+moratorium.info=Moratorium Information
+moratorium.enter_search_criteria=Enter a center/client/group name and click Search. Click Cancel to return to Admin without submitting information.
+moratorium.client_type=Center/Client/Group Name
+moratorium.enterInfo=Enter Moratorium Information
+moratorium.enterDetailInfo1=To apply a moratorium for the selected branch/center/client/group, enter the information below and click continue. Click cancel to return to admin without submitting any information.
+moratorium.enterDetailInfo2=Fields marked with an asterisk are required.
+moratorium.clientName=Name
+moratorium.StartDate=Start date
+moratorium.EndDate=End date
+moratorium.notes=Notes
+moratorium.reviewAndSubmit=Review & submit
+moratorium.confirmDetailInfo=The information entered by you is shown below. Click submit to confirm and cancel to return to admin without submitting information.
+moratorium.submit=Submit
+moratorium.editLabel=Edit moratorium information
+
+errors.fromdateformatexception=<li>Invalid format for Moratorium from date.</li>
+errors.enddateformatexception=<li>Invalid format for Moratorium end date.</li>
+errors.fromdateexception=<li>The Start Date can be set to a date earlier than the System Date as long as the Start Date is not 30 days earlier than the System Date.</li>
+errors.enddateexception=<li>Moratorium End Date can be either greater than or equal to From Date.</li>
+moratorium.FromDate=<li>From Date</li>
+moratorium.ToDate=<li>To Date</li>
+error.mandatory_field=<li>is mandatory</li>
+errors.mandatory.moratorium.from.date=<li>Moratorium From Date is mandatory.</li>
+errors.mandatory.moratorium.end.date=<li>Moratorium End Date is mandatory.</li>
+
+Customer.CreateFailed=<li>The creation of the moratorium could not be done.</li>
+
+# For view moratorium screen
+moratorium.labelLinkAdmin=Admin
+moratorium.labelLinkViewMoratoriums1=View moratoriums
+moratorium.labelLinkViewMoratoriums2=View Moratoriums
+moratorium.labelLinkListMOratoriums=Below is the list of moratoriums.
+moratorium.labelLinkClickHere=Click here to
+moratorium.labelAddNewMoratorium=apply new moratorium
+moratorium.labelActiveMoratoriums=Active Moratoriums
+moratorium.labelClosedMoratoriums=Closed Moratoriums
+moratorium.labelAppliedTo=Applied to
+moratorium.labelStartDateEndDate=Start Date - End Date
+moratorium.labelCreatedBy=Created By
+moratorium.labelNotes=Notes
+moratorium.edit=Edit
+
+# For moratorium edit screen
+moratorium.labelViewDetails=View moratorium details
+moratorium.labelEditMoratoriums=Edit Moratoriums
+moratorium.labelEditMoratoriumsInfo1=Complete the fields below. Then click Preview. Click Cancel to return to View Moratoriums page without submitting information.
+moratorium.labelEditMoratoriumsInfo2=Fields marked with an asterisk are required.
+moratorium.labelEditMoratoriumDetails=Edit moratorium details
+
+# For moratorium edit preview screen
+moratorium.labelPreviewEditMoratoriums=Preview edit moratorium
+moratorium.labelPreviewEditMoratoriumsInfo1=Preview the fields below. Then click Submit. Click Cancel to return to View moratoriums without submitting information.
+
+# For overlap validation
+moratorium.overlap=This moratorium overlaps with existing moratorium, please check view moratorium screen. 
\ No newline at end of file
Index: test/org/mifos/application/moratorium/util/resources/MoratoriumUIResources.properties
===================================================================
--- test/org/mifos/application/moratorium/util/resources/MoratoriumUIResources.properties	(revision 0)
+++ test/org/mifos/application/moratorium/util/resources/MoratoriumUIResources.properties	(revision 0)
@@ -0,0 +1,67 @@
+moratorium.moratoriumcatinfo=Search
+moratorium.review=Review &amp; submit
+moratorium.define=Apply Moratorium
+moratorium.categoryinfo=Search
+moratorium.compfields=Choose an option to apply either branch motatorium or client/group/center moratorium and click Continue.
+moratorium.clickcanc=Click Cancel to return to admin without submitting information.
+moratorium.applyForOffice=Apply Mfi/regional/ branch moratorium
+moratorium.applyForClient=Apply client/group/center moratorium
+moratorium.preview=Preview
+moratorium.cancel=Cancel
+moratorium.continue=Continue
+moratorium.enter_search_criteria_for_branch=To apply a moratorium on a branch, click on a branch from the list below. Click Cancel to return to Admin without submitting information.
+moratorium.info=Moratorium Information
+moratorium.enter_search_criteria=Enter a center/client/group name and click Search. Click Cancel to return to Admin without submitting information.
+moratorium.client_type=Center/Client/Group Name
+moratorium.enterInfo=Enter Moratorium Information
+moratorium.enterDetailInfo1=To apply a moratorium for the selected branch/center/client/group, enter the information below and click continue. Click cancel to return to admin without submitting any information.
+moratorium.enterDetailInfo2=Fields marked with an asterisk are required.
+moratorium.clientName=Name
+moratorium.StartDate=Start date
+moratorium.EndDate=End date
+moratorium.notes=Notes
+moratorium.reviewAndSubmit=Review & submit
+moratorium.confirmDetailInfo=The information entered by you is shown below. Click submit to confirm and cancel to return to admin without submitting information.
+moratorium.submit=Submit
+moratorium.editLabel=Edit moratorium information
+
+errors.fromdateformatexception=<li>Invalid format for Moratorium from date.</li>
+errors.enddateformatexception=<li>Invalid format for Moratorium end date.</li>
+errors.fromdateexception=<li>The Start Date can be set to a date earlier than the System Date as long as the Start Date is not 30 days earlier than the System Date.</li>
+errors.enddateexception=<li>Moratorium End Date can be either greater than or equal to From Date.</li>
+moratorium.FromDate=<li>From Date</li>
+moratorium.ToDate=<li>To Date</li>
+error.mandatory_field=<li>is mandatory</li>
+errors.mandatory.moratorium.from.date=<li>Moratorium From Date is mandatory.</li>
+errors.mandatory.moratorium.end.date=<li>Moratorium End Date is mandatory.</li>
+
+Customer.CreateFailed=<li>The creation of the moratorium could not be done.</li>
+
+# For view moratorium screen
+moratorium.labelLinkAdmin=Admin
+moratorium.labelLinkViewMoratoriums1=View moratoriums
+moratorium.labelLinkViewMoratoriums2=View Moratoriums
+moratorium.labelLinkListMOratoriums=Below is the list of moratoriums.
+moratorium.labelLinkClickHere=Click here to
+moratorium.labelAddNewMoratorium=apply new moratorium
+moratorium.labelActiveMoratoriums=Active Moratoriums
+moratorium.labelClosedMoratoriums=Closed Moratoriums
+moratorium.labelAppliedTo=Applied to
+moratorium.labelStartDateEndDate=Start Date - End Date
+moratorium.labelCreatedBy=Created By
+moratorium.labelNotes=Notes
+moratorium.edit=Edit
+
+# For moratorium edit screen
+moratorium.labelViewDetails=View moratorium details
+moratorium.labelEditMoratoriums=Edit Moratoriums
+moratorium.labelEditMoratoriumsInfo1=Complete the fields below. Then click Preview. Click Cancel to return to View Moratoriums page without submitting information.
+moratorium.labelEditMoratoriumsInfo2=Fields marked with an asterisk are required.
+moratorium.labelEditMoratoriumDetails=Edit moratorium details
+
+# For moratorium edit preview screen
+moratorium.labelPreviewEditMoratoriums=Preview edit moratorium
+moratorium.labelPreviewEditMoratoriumsInfo1=Preview the fields below. Then click Submit. Click Cancel to return to View moratoriums without submitting information.
+
+# For overlap validation
+moratorium.overlap=This moratorium overlaps with existing moratorium, please check view moratorium screen. 
\ No newline at end of file
Index: test/org/mifos/application/moratorium/validation.xml
===================================================================
--- test/org/mifos/application/moratorium/validation.xml	(revision 0)
+++ test/org/mifos/application/moratorium/validation.xml	(revision 0)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+
+<!DOCTYPE form-validation PUBLIC
+          "-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.1.3//EN"
+          "http://jakarta.apache.org/commons/dtds/validator_1_1_3.dtd">
+
+<form-validation>
+</form-validation>
Index: test/org/mifos/application/moratorium/validator-rules.xml
===================================================================
--- test/org/mifos/application/moratorium/validator-rules.xml	(revision 0)
+++ test/org/mifos/application/moratorium/validator-rules.xml	(revision 0)
@@ -0,0 +1,49 @@
+<!DOCTYPE form-validation PUBLIC
+          "-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.1.3//EN"
+          "http://jakarta.apache.org/commons/dtds/validator_1_1_3.dtd">
+<!--
+  $Id: validator-rules.xml 9724 2006-06-01 08:11:20Z mohmmed $
+
+   This file contains the default Struts Validator pluggable validator
+   definitions.  It should be placed somewhere under /WEB-INF and
+   referenced in the struts-config.xml under the plug-in element
+   for the ValidatorPlugIn.
+
+      <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
+        <set-property property="pathnames" value="/WEB-INF/validator-rules.xml,
+                                                  /WEB-INF/validation.xml"/>
+      </plug-in>
+
+   These are the default error messages associated with
+   each validator defined in this file.  They should be
+   added to your projects ApplicationResources.properties
+   file or you can associate new ones by modifying the
+   pluggable validators msg attributes in this file.
+
+   # Struts Validator Error Messages
+   errors.required={0} is required.
+   errors.minlength={0} can not be less than {1} characters.
+   errors.maxlength={0} can not be greater than {1} characters.
+   errors.invalid={0} is invalid.
+
+   errors.byte={0} must be a byte.
+   errors.short={0} must be a short.
+   errors.integer={0} must be an integer.
+   errors.long={0} must be a long.
+   errors.float={0} must be a float.
+   errors.double={0} must be a double.
+
+   errors.date={0} is not a date.
+   errors.range={0} is not in the range {1} through {2}.
+   errors.creditcard={0} is an invalid credit card number.
+   errors.email={0} is an invalid e-mail address.
+
+   Note: Starting in Struts 1.2.0 the default javascript definitions have
+         been consolidated to commons-validator. The default can be overridden
+         by supplying a <javascript> element with a CDATA section, just as
+         in struts 1.1.
+
+-->
+
+<form-validation>
+</form-validation>
Index: test/org/mifos/framework/util/helpers/TestObjectFactory.java
===================================================================
--- test/org/mifos/framework/util/helpers/TestObjectFactory.java	(revision 12167)
+++ test/org/mifos/framework/util/helpers/TestObjectFactory.java	(working copy)
@@ -137,6 +137,7 @@
 import org.mifos.application.meeting.util.helpers.MeetingType;
 import org.mifos.application.meeting.util.helpers.RecurrenceType;
 import org.mifos.application.meeting.util.helpers.WeekDay;
+import org.mifos.application.moratorium.business.MoratoriumBO;
 import org.mifos.application.office.business.OfficeBO;
 import org.mifos.application.office.util.helpers.OfficeLevel;
 import org.mifos.application.office.util.helpers.OperationMode;
@@ -2204,6 +2205,23 @@
  		}
  		return prdmix;
  	}
+ 	
+//  added for moratorium [start]
+ 	public static void cleanUp(MoratoriumBO moratoriumBO) {
+		if (null != moratoriumBO) {
+			deleteMoratorium(moratoriumBO);
+			moratoriumBO = null;
+		}
+	}
+	
+	public static void deleteMoratorium(MoratoriumBO moratoriumBO) {
+		Session session = HibernateUtil.getSessionTL();
+		session.lock(moratoriumBO, LockMode.UPGRADE);
+		Transaction transaction = HibernateUtil.startTransaction();
+		session.delete(moratoriumBO);
+		transaction.commit();
+	}
+ 	// added for moratorium [end]
 
  	public static final int SAMPLE_BUSINESS_ACTIVITY_2 = 2;
 	
