package ibase.webitm.ejb.mfg;

class InsertPlanDemand
{
}
/*	
	private String InsertPlanDemand(String winName, ArrayList list)
	{
		String xmlValues = "";
		xmlValues ="<?xml version=\"1.0\" encoding=\"utf-8\"?><Root>";
		xmlValues = xmlValues + "<Header>";
		SimpleDateFormat sdf = new SimpleDateFormat(genericUtility.getApplDateFormat());
		if(winName.equalsIgnoreCase("T_MPS_ORDER"))
		{
			public String tranId = "";  
			public String ordType = "";
			public String itemCode = "";
			public String siteCode = "";
			public String mrpRunId = "";
			public String addnOrder = "";
			public String status = "";
			public String routeCode = "";
			public String bomCode = "";
			public String projCode = "";
			public String chgUser = "";
			public String chgTerm = "";
			public String unit = "";
			public String acctCodeWp = "";
			public String cctrCodeWp = "";
		
			public double quantity = 0;
			public double yieldPerc = 0 ;
			public double curBatchQty = 0; 
		
			public String ordDate = "";
			public String planDueDate = "";
			public String dueDate = "";
			public String statusDate = "";
			public String chgDate = "";
		
		//	public java.sql.Timestamp ordDate = null;
		//	public java.sql.Timestamp planDueDate = null;
		//	public java.sql.Timestamp dueDate = null;
		//	public java.sql.Timestamp statusDate = null;
		//	public java.sql.Timestamp chgDate = null;
			
			logBuff.append("<win_name>").append(winName).append("</win_name>");
			logBuff.append("<tran_id>").append(tranId).append("</tran_id>");
			
			xmlBuff.append(	"<?xml version='1.0' encoding='UTF-8'?>\n").append("<Root>\n");
			xmlBuff.append("<DocumentRoot>");
			xmlBuff.append("<description>").append("Datawindow Root").append("</description>");
			xmlBuff.append("<group0>");
			xmlBuff.append("<description>").append("Group0 description").append("</description>");
			xmlBuff.append("<Header0>");
			xmlBuff.append("<objName><![CDATA[").append("mps_order").append("]]></objName>");
			xmlBuff.append("<pageContext><![CDATA[").append("1").append("]]></pageContext>");
			xmlBuff.append("<objContext><![CDATA[").append("1").append("]]></objContext>");
			xmlBuff.append("<editFlag><![CDATA[").append("A").append("]]></editFlag>");
			xmlBuff.append("<focusedColumn><![CDATA[").append("").append("]]></focusedColumn>");
			xmlBuff.append("<action><![CDATA[").append("SAVE").append("]]></action>");
			xmlBuff.append("<elementName><![CDATA[").append("").append("]]></elementName>");
			xmlBuff.append("<keyValue><![CDATA[").append("1").append("]]></keyValue>");
			xmlBuff.append("<taxKeyValue><![CDATA[").append("").append("]]></taxKeyValue>");
			xmlBuff.append("<saveLevel><![CDATA[").append("1").append("]]></saveLevel>");
			xmlBuff.append("<forcedSave><![CDATA[").append(true).append("]]></forcedSave>");
			xmlBuff.append("<taxInFocus><![CDATA[").append(false).append("]]></taxInFocus>");
			xmlBuff.append("<description>").append("Header0 members").append("</description>");

			MPSOrder mpsOrder = null;

			for(int count = 0; count<list.size(), count++)
			{
				mpsOrder = (MpsOrder)list.getMpsOrder(count);
				
				ordTypes = mpsOrder.getOrdTypes(count);
				itemCode = mpsOrder.getItemCode(count);
				siteCode = mpsOrder.getSiteCode(count);
				quantity = mpsOrder.getQuantity(count);
				ordDate = sdt.format(mpsOrder.getOrdDate(count))
				//mpsOrder.getOrdDate(count);
				planDueDate = sdt.format(mpsOrder.getPlanDueDate(count));
				//mpsOrder.getPlanDueDate(count);
				mrpRunId = mpsOrder.getMrpRunId(count);
				addnOrder = mpsOrder.getAddnOrder(count);
				dueDate = sdt.format();
				//mpsOrder.getDueDate(count);
				status = mpsOrder.getStatus(count);
				statusDate = sdt.format();
				//mpsOrder.getStatusDate(count);
				yieldPerc = mpsOrder.getYieldPerc(count);
				routeCode = mpsOrder.getRouteCode(count);
				bomCode = mpsOrder.getBomCode(count);
				projCode = mpsOrder.getProjCode(count);
				chgDate = sdt.format();
				//mpsOrder.getChgDate(count);
				chgUser = mpsOrder.getChgUser(count);
				chgTerm = mpsOrder.getChgTerm(count);
				unit = mpsOrder.getUnit(count);
				acctCodeWp = mpsOrder.getAcctCodeWp(count);
				cctrCodeWp = mpsOrder.getCctrCodeWp(count);
				curBatchQty = mpsOrder.getCurBatchQty(count);
				stdQty = mpsOrder.getStdQty(count);
				demandQty =  = mpsOrder.getDemandQty(count);

				xmlValues = xmlValues + "<Detail>" + (count+1);
				xmlValues = xmlValues + "<order_type><![CDATA[" + ordType + "]]></order_type>";
				xmlValues = xmlValues + "<item_code><![CDATA[" + itemCode + "]]></item_code>";												
				xmlValues = xmlValues + "<site_code><![CDATA[" + siteCode + "]]></site_code>";
				xmlValues = xmlValues + "<quantity><![CDATA[" + quantity + "]]></quantity>";
				xmlValues = xmlValues + "<order_date><![CDATA[" + ordDate + "]]></order_date>";
				xmlValues = xmlValues + "<plan_due_date><![CDATA[" + planDueDate + "]]></plan_due_date>";
				xmlValues = xmlValues + "<mrp_run_id><![CDATA[" + mrpRunId + "]]></mrp_run_id>";
				xmlValues = xmlValues + "<addn_order><![CDATA[" + addnOrder + "]]></addn_order>";
				xmlValues = xmlValues + "<due_date><![CDATA[" + dueDate + "]]></due_date>";
				xmlValues = xmlValues + "<status><![CDATA[" + status + "]]></status>";
				xmlValues = xmlValues + "<status_date><![CDATA[" + statusDate + "]]></status_date>";
				xmlValues = xmlValues + "<yield_perc><![CDATA[" + yieldPerc + "]]></yield_perc>";
				xmlValues = xmlValues + "<route_code><![CDATA[" + routeCode + "]]></route_code>";
				xmlValues = xmlValues + "<bom_code><![CDATA[" + bomCode + "]]></bom_code>";
				xmlValues = xmlValues + "<proj_code><![CDATA[" + projCode + "]]></proj_code>";
				xmlValues = xmlValues + "<change_date><![CDATA[" + chgDate + "]]></change_date>";
				xmlValues = xmlValues + "<change_user><![CDATA[" + chgUser + "]]></change_user>";
				xmlValues = xmlValues + "<change_term><![CDATA[" + chgTerm + "]]></change_term>";												
				xmlValues = xmlValues + "<unit><![CDATA[" + unit + "]]></unit>";
				xmlValues = xmlValues + "<acct_code_wp><![CDATA[" + acctCodeWp + "]]></acct_code_wp>";
				xmlValues = xmlValues + "<cctr_code_wp><![CDATA[" + cctrCodeWp + "]]></cctr_code_wp>";
				xmlValues = xmlValues + "<cur_batch_qty><![CDATA[" + curBatchQty + "]]></cur_batch_qty>";
				xmlValues = xmlValues + "<std_qty><![CDATA[" + stdQty + "]]></std_qty>";								
				xmlValues = xmlValues + "<demand_qty><![CDATA[" + demandQty + "]]></demand_qty>";
				
				xmlValues = xmlValues + "</Detail>" + (count+1);
			}	
			xmlBuff.append("</Header0>");
			xmlBuff.append("</group0>");
			xmlBuff.append("</DocumentRoot>");
			xmlBuff.append("</Root>\r\n");
			
			
		}
		if(winName.equalsIgnoreCase("T_DIST_DEMAND"))
		{
			public String tranId = "";
			public String siteCode = "";
			public String itemCode = "";
			public String unit = "";
			public String siteCodeSrc = "";
			final String status = "T";
			public String chgUser = "";
			public String chgTerm = "";
		
			public double qtyRequired = 0;
		
			public String tranDate = "";
			public String planDueDate = "";
			public String dueDateOrd = "";
			public String dueDate = "";
			public String chgDate = "";
		
		//	public java.sql.Timestamp tranDate = null;
		//	public java.sql.Timestamp planDueDate = null;
		//	public java.sql.Timestamp dueDateOrd = null;
		//	public java.sql.Timestamp dueDate = null;
		//	public java.sql.Timestamp chgDate = null;
			
			logBuff.append("<win_name>").append(winName).append("</win_name>");
			logBuff.append("<tran_id>").append(tranId).append("</tran_id>");
			
			xmlBuff.append(	"<?xml version='1.0' encoding='UTF-8'?>\n").append("<Root>\n");
			xmlBuff.append("<DocumentRoot>");
			xmlBuff.append("<description>").append("Datawindow Root").append("</description>");
			xmlBuff.append("<group0>");
			xmlBuff.append("<description>").append("Group0 description").append("</description>");
			xmlBuff.append("<Header0>");
			xmlBuff.append("<objName><![CDATA[").append("dist_demand").append("]]></objName>");
			xmlBuff.append("<pageContext><![CDATA[").append("1").append("]]></pageContext>");
			xmlBuff.append("<objContext><![CDATA[").append("1").append("]]></objContext>");
			xmlBuff.append("<editFlag><![CDATA[").append("A").append("]]></editFlag>");
			xmlBuff.append("<focusedColumn><![CDATA[").append("").append("]]></focusedColumn>");
			xmlBuff.append("<action><![CDATA[").append("SAVE").append("]]></action>");
			xmlBuff.append("<elementName><![CDATA[").append("").append("]]></elementName>");
			xmlBuff.append("<keyValue><![CDATA[").append("1").append("]]></keyValue>");
			xmlBuff.append("<taxKeyValue><![CDATA[").append("").append("]]></taxKeyValue>");
			xmlBuff.append("<saveLevel><![CDATA[").append("1").append("]]></saveLevel>");
			xmlBuff.append("<forcedSave><![CDATA[").append(true).append("]]></forcedSave>");
			xmlBuff.append("<taxInFocus><![CDATA[").append(false).append("]]></taxInFocus>");
			xmlBuff.append("<description>").append("Header0 members").append("</description>");
			
			DistDemand distDemand = new DistDemand();
			for(int count = 0; count<list.size(), count++)
			{
				distDemand = (DistDemand)list.getDistDemand(count);
				
				tranDate = distDemand.getTranDate(count);
				siteCode = distDemand.getSiteCode(count);
				itemCode = distDemand.getItemCode(count);
				planDueDate = dueDate = sdt.format(distDemand.getPlanDueDate(count));
				//distDemand.getPlanDueDate(count);
				dueDate = sdt.format(distDemand.getDueDate(count));
				//distDemand.getDueDate(count);
				qtyRequired = distDemand.getQtyRequired(count);
				unit = distDemand.getUnit(count);
				siteCodeSource = distDemand.getSiteCodeSource(count);
				dueDateOrd = distDemand.getDueDateOrd(count);
				chgDate = sdt.format(distDemand.getChgDate(count));
				//distDemand.getChgDate(count);
				chgUser = distDemand.getChgUser(count);
				chgTerm = distDemand.getChgTerm(count);
				
				xmlValues = xmlValues + "<Detail>" + (count+1);
				xmlValues = xmlValues + "<tran_date><![CDATA[" + tranDate + "]]></tran_date>";
				xmlValues = xmlValues + "<site_code><![CDATA[" + siteCode + "]]></site_code>";
				xmlValues = xmlValues + "<item_code><![CDATA[" + itemCode + "]]></item_code>";												
				xmlValues = xmlValues + "<plan_due_date><![CDATA[" + planDueDate + "]]></plan_due_date>";
				xmlValues = xmlValues + "<due_date><![CDATA[" + dueDate + "]]></due_date>";
				xmlValues = xmlValues + "<qty_required><![CDATA[" + qtyRequired + "]]></qty_required>";
				xmlValues = xmlValues + "<unit><![CDATA[" + unit + "]]></unit>";
				xmlValues = xmlValues + "<site_code_source><![CDATA[" + siteCodeSource + "]]></site_code_source>";
				xmlValues = xmlValues + "<status><![CDATA[" + status + "]]></status>";										
				xmlValues = xmlValues + "<due_date_ord><![CDATA[" + dueDateOrd + "]]></due_date_ord>";
				xmlValues = xmlValues + "<change_date><![CDATA[" + chgDate + "]]></change_date>";
				xmlValues = xmlValues + "<change_user><![CDATA[" + chgUser + "]]></change_user>";										
				xmlValues = xmlValues + "<change_term><![CDATA[" + chgTerm + "]]></change_term>";
				
				xmlValues = xmlValues + "</Detail>" + (count+1);
			}
			xmlBuff.append("</Header0>");
			xmlBuff.append("</group0>");
			xmlBuff.append("</DocumentRoot>");
			xmlBuff.append("</Root>\r\n");
		}
		
		if(winName.equalsIgnoreCase("T_INDENT"))
		{
			public String indNo = "";
			final String indType = "M";
		    public String deptCode = "";
			public String itemCode = "";
			public String itemDescr= "";
			public String unitInd = "";
			public String unitStd = "";
			public String siteCode = "";
			public String siteCodeDlv = "";
			public String siteCodeAcct = "";
			public String siteCodeCust = "";
			public String aprCode = "";
			final String priority = "R";
			public String acctCode = "";		
			public String cctrCode = "";
			public String empCodePur = "";
			public String empCodeReq = "";
			public String suppCodePref = "";
			public String packCode = "";
			final String status = "T";
			public String chgUser = "";
			public String chgTerm = "";
		
			public double purLeadTime = 0 ;
			public double quantity = 0;
			public double quantityStdUom = 0;
			public double ordQuantity = 0;
			public double purcRate = 0;
			public double convQtyStdUom = 0;
		
			public String indDate = "";
			public String planDate = "";
			public String reqDate = "";
			public String chgDate = "";
		
		//	public java.sql.Timestamp indDate = null;
		//	public java.sql.Timestamp planDate = null;
		//	public java.sql.Timestamp reqDate = null;	
		//	public java.sql.Timestamp chgDate = null;
		
			logBuff.append("<win_name>").append(winName).append("</win_name>");
			logBuff.append("<ind_no>").append(indNo).append("</ind_no>");
			
			xmlBuff.append(	"<?xml version='1.0' encoding='UTF-8'?>\n").append("<Root>\n");
			xmlBuff.append("<DocumentRoot>");
			xmlBuff.append("<description>").append("Datawindow Root").append("</description>");
			xmlBuff.append("<group0>");
			xmlBuff.append("<description>").append("Group0 description").append("</description>");
			xmlBuff.append("<Header0>");
			xmlBuff.append("<objName><![CDATA[").append("indent").append("]]></objName>");
			xmlBuff.append("<pageContext><![CDATA[").append("1").append("]]></pageContext>");
			xmlBuff.append("<objContext><![CDATA[").append("1").append("]]></objContext>");
			xmlBuff.append("<editFlag><![CDATA[").append("A").append("]]></editFlag>");
			xmlBuff.append("<focusedColumn><![CDATA[").append("").append("]]></focusedColumn>");
			xmlBuff.append("<action><![CDATA[").append("SAVE").append("]]></action>");
			xmlBuff.append("<elementName><![CDATA[").append("").append("]]></elementName>");
			xmlBuff.append("<keyValue><![CDATA[").append("1").append("]]></keyValue>");
			xmlBuff.append("<taxKeyValue><![CDATA[").append("").append("]]></taxKeyValue>");
			xmlBuff.append("<saveLevel><![CDATA[").append("1").append("]]></saveLevel>");
			xmlBuff.append("<forcedSave><![CDATA[").append(true).append("]]></forcedSave>");
			xmlBuff.append("<taxInFocus><![CDATA[").append(false).append("]]></taxInFocus>");
			xmlBuff.append("<description>").append("Header0 members").append("</description>");
			
			Indent indent = new Indent();
			for(int count = 0; count<list.size(), count++)
			{
				indent = (Indent)list.getIndent(count);
				
				tranDate = sdt.format(indent.getTranDate(count));
				//indent.getTranDate(count);
				tranIdIndent = indent.getTranIdIndent(count);
				indDate = sdt.format(indent.getIndDate(count));
				//indent.getIndDate(count);
				deptCode = indent.getindType(count);
				tranDate = sdt.format(indent.getTranDate(count));
				//indent.getTranDate(count);
				plansdt.format(indent.getPlanDueDate(count));
				//indent.getPlanDueDate(count);
				reqDate = sdt.format(indent.getReqDate(count));
				//indent.getReqDate(count);
				itemCode = indent.getItemCode(count);
				itemDesc = indent.getItemDesc(count);
				quantity = indent.getQuantity(count);
				quantityStdUom = indent.getQuantityStdUom(count);
				unitInd = indent.getUnitInd(count);
				unitStd = indent.getUnitStd(count);
				siteCode = indent.getSiteCode(count);
				siteCodeDlv = indent.getSiteCodeDlv(count);
				siteCodeAcct = indent.getSiteCodeAcct(count);
				aprCode = indent.getAprCode(count);
				acctCode = indent.getAcctCode(count);
				cctrCode = indent.getCctrCode(count);
				empCodePur = indent.geTempCodePur(count);
				empCodeReq = indent.getEmpCodeReq(count);
				suppCodePref = indent.getSuppCodePref(count);
				purcRate = indent.getPurcRate(count);
				packCode = indent.getPackCode(count);
				chgDate = indent.getChgDate(count);
				chgUser = indent.getChgUser(count);
				chgTerm = indent.getChgTerm(count);
				purLeadTime = indent.getPurLeadTime(count);
				convQtyStduom = indent.getConvQtyStduom(count);

				xmlValues = xmlValues + "<Detail>" + (count+1);
				xmlValues = xmlValues + "<tran_date><![CDATA[" + tranDate + "]]></tran_date>";
				xmlValues = xmlValues + "<tran_id_indent><![CDATA[" + tranIdIndent + "]]></tran_id_indent>";
				xmlValues = xmlValues + "<indent_date><![CDATA[" + indDate + "]]></indent_date>";
				xmlValues = xmlValues + "<indent_type><![CDATA[" + indType + "]]></indent_type>";												
				xmlValues = xmlValues + "<dept_code><![CDATA[" + deptCode + "]]></dept_code>";
				xmlValues = xmlValues + "<plan_due_date><![CDATA[" + planDueDate + "]]></plan_due_date>";
				xmlValues = xmlValues + "<req_date><![CDATA[" + reqDate + "]]></req_date>";
				xmlValues = xmlValues + "<item_code><![CDATA[" + itemCode + "]]></item_code>";
				xmlValues = xmlValues + "<item_desc><![CDATA[" + itemDesc + "]]></item_desc>";
				xmlValues = xmlValues + "<quantity><![CDATA[" + quantity + "]]></quantity>";
				xmlValues = xmlValues + "<quantity_std_uom><![CDATA[" + quantityStdUom + "]]></quantity_std_uom>";
				xmlValues = xmlValues + "<unit_ind><![CDATA[" + unitInd + "]]></unit_ind>";
				xmlValues = xmlValues + "<unit_std><![CDATA[" + unitStd + "]]></unit_std>";
				xmlValues = xmlValues + "<site_code><![CDATA[" + siteCode + "]]></site_code>";
				xmlValues = xmlValues + "<site_code_dlv><![CDATA[" + siteCodeDlv + "]]></site_code_dlv>";
				xmlValues = xmlValues + "<site_code_acct><![CDATA[" + siteCodeAcct + "]]></site_code_acct>";
				xmlValues = xmlValues + "<apr_code><![CDATA[" + aprCode + "]]></apr_code>";
				xmlValues = xmlValues + "<priority><![CDATA[" + priority + "]]></priority>";
				xmlValues = xmlValues + "<acct_code><![CDATA[" + acctCode + "]]></acct_code>";
				xmlValues = xmlValues + "<cctr_code><![CDATA[" + cctrCode + "]]></cctr_code>";
				xmlValues = xmlValues + "<emp_code_pur><![CDATA[" + empCodePur + "]]></emp_code_pur>";
				xmlValues = xmlValues + "<emp_code_req><![CDATA[" + empCodeReq + "]]></emp_code_req>";
				xmlValues = xmlValues + "<supp_code_pref><![CDATA[" + suppCodePref + "]]></supp_code_pref>";
				xmlValues = xmlValues + "<purc_rate><![CDATA[" + purcRate + "]]></purc_rate>";
				xmlValues = xmlValues + "<pack_code><![CDATA[" + packCode + "]]></pack_ode>";	
				xmlValues = xmlValues + "<status><![CDATA[" + status + "]]></status>";
				xmlValues = xmlValues + "<change_date><![CDATA[" + chgDate + "]]></change_date>";
				xmlValues = xmlValues + "<change_user><![CDATA[" + chgUser + "]]></change_user>";
				xmlValues = xmlValues + "<change_term><![CDATA[" + chgTerm + "]]></change_term>";
				xmlValues = xmlValues + "<pur_lead_time><![CDATA[" + purLeadTime + "]]></pur_lead_time>";
				xmlValues = xmlValues + "<conv_qty_std_oum><![CDATA[" + convQtyStduom + "]]></conv_qty_std_oum>";
				
				xmlValues = xmlValues + "</Detail>" + (count+1);
			}
			xmlBuff.append("</Header0>");
			xmlBuff.append("</group0>");
			xmlBuff.append("</DocumentRoot>");
			xmlBuff.append("</Root>\r\n");

		}

		if(winName.equalsIgnoreCase("T_INDEPENDENT_DEMAND"))
		{
			public String tranId = "";
			public String siteCode = "";
			public String siteCodeCust = "";
			public String itemCode = "";
			public String unit = "";
			public String unitStd = "";
			public String status = "T";			
			
			public double  quantity = 0;
			public double  quantityStdUom = 0;
			public double  convQtyStdUom = 1;
		
			public String tranDate = "";
			public String planDueDate = "";
			public String dueDate = "";
			
		//	public java.sql.Timestamp tranDate = null;
		//	public java.sql.Timestamp planDueDate = null;
		//	public java.sql.Timestamp dueDate = null;
			
			logBuff.append("<win_name>").append(winName).append("</win_name>");
			logBuff.append("<tran_id>").append(tranId).append("</tran_id>");
			
			xmlBuff.append(	"<?xml version='1.0' encoding='UTF-8'?>\n").append("<Root>\n");
			xmlBuff.append("<DocumentRoot>");
			xmlBuff.append("<description>").append("Datawindow Root").append("</description>");
			xmlBuff.append("<group0>");
			xmlBuff.append("<description>").append("Group0 description").append("</description>");
			xmlBuff.append("<Header0>");
			xmlBuff.append("<objName><![CDATA[").append("independent_demand").append("]]></objName>");
			xmlBuff.append("<pageContext><![CDATA[").append("1").append("]]></pageContext>");
			xmlBuff.append("<objContext><![CDATA[").append("1").append("]]></objContext>");
			xmlBuff.append("<editFlag><![CDATA[").append("A").append("]]></editFlag>");
			xmlBuff.append("<focusedColumn><![CDATA[").append("").append("]]></focusedColumn>");
			xmlBuff.append("<action><![CDATA[").append("SAVE").append("]]></action>");
			xmlBuff.append("<elementName><![CDATA[").append("").append("]]></elementName>");
			xmlBuff.append("<keyValue><![CDATA[").append("1").append("]]></keyValue>");
			xmlBuff.append("<taxKeyValue><![CDATA[").append("").append("]]></taxKeyValue>");
			xmlBuff.append("<saveLevel><![CDATA[").append("1").append("]]></saveLevel>");
			xmlBuff.append("<forcedSave><![CDATA[").append(true).append("]]></forcedSave>");
			xmlBuff.append("<taxInFocus><![CDATA[").append(false).append("]]></taxInFocus>");
			xmlBuff.append("<description>").append("Header0 members").append("</description>");
			
			IndependentDemand independentDemand = new IndependentDemand();
			for(int count = 0; count<list.size(), count++)
			{
				independentDemand = (IndependentDemand)list.getIndependentDemand(count);				
				
				siteCode = independentDemand.getSiteCode(count);
				siteCodeCust = independentDemand.getSiteCodeCust(count);
				itemCode = independentDemand.getItemCode(count);
				unit = independentDemand.getUnit(count);
				unitStd = independentDemand.getUnitStd(count);
				quantity = independentDemand.getQuantity(count);
				quantityStdUom = independentDemand.getQuantityStdUom(count);
				convQtyStdUom = indent.getConvQtyStduom(count);
				tranDate = sdt.format(indent.getTranDate(count));
				//indent.getTranDate(count);
				planDueDate = sdt.format(indent.getPlanDueDate(count));
				//indent.getPlanDueDate(count);
				dueDate = sdt.format(indent.getDueDate(count));
				//indent.getDueDate(count);
				
				xmlValues = xmlValues + "<Detail>" + (count+1);
				xmlValues = xmlValues + "<site_code><![CDATA[" + siteCode + "]]></site_code>";
				xmlValues = xmlValues + "<site_code_cust><![CDATA[" + siteCodeCust + "]]></site_code_cust>";
				xmlValues = xmlValues + "<item_code><![CDATA[" + itemCode + "]]></item_code>";
				xmlValues = xmlValues + "<unit><![CDATA[" + unit + "]]></unit>";
				xmlValues = xmlValues + "<unit_std><![CDATA[" + unitStd + "]]></unit_std>";
				xmlValues = xmlValues + "<status><![CDATA[" + status + "]]></status>";
				xmlValues = xmlValues + "<quantity><![CDATA[" + quantity + "]]></quantity>";
				xmlValues = xmlValues + "<quantity_std_uom><![CDATA[" + quantityStdUom + "]]></quantity_std_uom>";
				xmlValues = xmlValues + "<conv_qty_std_oum><![CDATA[" + convQtyStdUom + "]]></conv_qty_std_oum>";
				xmlValues = xmlValues + "<tran_date><![CDATA[" + tranDate + "]]></tran_date>";
				xmlValues = xmlValues + "<plan_due_date><![CDATA[" + plaDueDate + "]]></plan_due_date>";
				xmlValues = xmlValues + "<due_date><![CDATA[" + dueDate + "]]></due_date>";
				
				xmlValues = xmlValues + "</Detail>" + (count+1);
			}
			xmlBuff.append("</Header0>");
			xmlBuff.append("</group0>");
			xmlBuff.append("</DocumentRoot>");
			xmlBuff.append("</Root>\r\n");
		}
		xmlValues = xmlValues + "</Header>";
		xmlValues = xmlValues + "</Root>";
		String errStr = saveData(xmlValues);
	}
	
	private String saveData(String xmlString)throws ITMException
	{
	  System.out.println("saving data...........");
	  InitialContext ctx = null;
	  String retString = null;
	  try
	  {
		   AppConnectParm appConnect = new AppConnectParm();
		   ctx = new InitialContext(appConnect.getProperty());
		   MasterStatefulHome masterStatefulHome = (MasterStatefulHome)ctx.lookup("MasterStateful");
		   MasterStateful masterStateful = masterStatefulHome.create();
		   String [] authencate = new String[2];
		   authencate[0] = userId;
		   authencate[1] = userId;
		   retString = masterStateful.processRequest(authencate, logInSite, true, xmlString);
	  }
	  catch(ITMException itme)
	  {
	    System.out.println("ITMException :UpdatePlanDemand :saveData :==>");
		throw itme;
	  }
	  catch(Exception e)
	  {
	  	System.out.println("Exception :UpdatePlanDemand :saveData :==>");
		throw new ITMException(e);
	  }
	  return retString;
	}
*/