	var jsrsContextPoolSize = 0;
	var jsrsContextMaxPool = 10;	var jsrsContextPool = new Array();
	var jsrsBrowser = jsrsBrowserSniff();
	
	//Roamer Wu 2003-09-23 判断是否是加载草稿
	var isLoadDraft = 0;
	//徐辉 2005-03-11 判断是否是销售出库，采购入库单调订单
	var isLoadOrder = 0;
	//徐辉 2004-12-9 grid中查找商品上次定位行
	var GridSearchRow=1;

	// constructor for context object
	function jsrsContextObj( contextID ) {
		// properties
		this.id = contextID;
		this.busy = true;
		this.callback = null;
		this.container = contextCreateContainer( contextID );
		// methods
		this.callURL = contextCallURL;
		this.getPayload = contextGetPayload;
		this.setVisibility = contextSetVisibility;
	}

	// method functions are not privately scoped 
	// because Netscape's debugger chokes on private functions
	function contextCreateContainer( containerName ) {
		// creates hidden container to receive server data 
		var container;
		switch(jsrsBrowser) {
			case "NS":
				container = new Layer(100);
				container.name = containerName;
				container.visibility = "hidden";
				container.clip.width = 100;
				container.clip.height = 100;
				break;
			case "IE":
				document.body.insertAdjacentHTML( "afterBegin", '<span id="SPAN' + containerName + '"></span>' );
				var span = document.all( "SPAN" + containerName );
				var html = '<iframe name="' + containerName + '" src=""></iframe>';
				span.innerHTML = html;
				span.style.display = "none";
				container = window.frames[ containerName ];
				break;
			case "MOZ":
				var span = document.createElement("SPAN");
				span.id = "SPAN" + containerName;
				document.body.appendChild( span );
				var iframe = document.createElement("IFRAME");
				iframe.name = containerName;
				span.appendChild( iframe );
				container = iframe;
				break;
		}
		return container;
	}

	function contextCallURL(URL) {
		switch(jsrsBrowser) {
			case "NS":
				this.container.src = URL;
				break;
			case "IE":
				this.container.document.location.replace(URL);
				break;
			case "MOZ":
				this.container.src = "";
				this.container.src = URL;
				break;
		}
	}

	function contextGetPayload() {
		switch(jsrsBrowser) {
			case "NS":
				return this.container.document.forms["jsrs_Form"].elements["jsrs_Payload"].value;
			case "IE":
				return this.container.document.forms["jsrs_Form"]["jsrs_Payload"].value;
			case "MOZ":
				return window.frames[this.container.name].document.forms["jsrs_Form"]["jsrs_Payload"].value;
		}
	}

	function contextSetVisibility(vis) {
		switch(jsrsBrowser) {
			case "NS":
				this.container.visibility = (vis)? 'show' : 'hidden';
				break;
			case "IE":
				document.all("SPAN" + this.id ).style.display = (vis)? '' : 'none';
				break;
			case "MOZ":
				document.getElementById("SPAN" + this.id).style.visibility = (vis)? '' : 'hidden';
				this.container.width = (vis)? 250 : 0;
				this.container.height = (vis)? 100 : 0;
				break;
		}
	}

	// end of context constructor
	function jsrsGetContextID() {
		var contextObj;
		for ( var i = 1; i <= jsrsContextPoolSize; i++ ) {
			contextObj = jsrsContextPool[ "jsrs" + i ];
			if ( !contextObj.busy ) {
				contextObj.busy = true;
				return contextObj.id;
			}
		}
		// if we got here, there are no existing free contexts
		if ( jsrsContextPoolSize <= jsrsContextMaxPool ) {
			// create new context
			var contextID = "jsrs" + (++jsrsContextPoolSize);
			jsrsContextPool[contextID] = new jsrsContextObj(contextID);
			return contextID;
		}
		else {
			alert( "jsrs Error:  context pool full" );
			return null;
		}
	}

	function jsrsExecute( rspage, callback, func, parms, visibility ) {
		// call a server routine from client code
		//
		// rspage      - href to asp file
		// callback    - function to call on return 
		//               or null if no return needed
		//               (passes returned string to callback)
		// func        - sub or function name  to call
		// parm        - string parameter to function
		//               or array of string parameters if more than one
		// visibility  - optional boolean to make container visible for debugging

		// get context
		var contextObj = jsrsContextPool[jsrsGetContextID()];
		contextObj.callback = callback;
		var vis = (visibility == null)? false : visibility;
		contextObj.setVisibility( vis );

		// build URL to call
		var URL = rspage;

		// always send context
		URL += "?C=" + contextObj.id;

		// func and parms are optional
		if ( func != null ) {
			URL += "&F=" + escape(func);
			if ( parms != null ) {
				if ( typeof(parms) == "string" ) {
					// single parameter
					URL += "&P0=[" + escape(parms+'') + "]";
				}
				else {
					// assume parms is array of strings
					for ( var i = 0; i < parms.length; i++ ) {
						URL += "&P" + i + "=[" + escape(parms[i]+'') + "]";
					}
				}	// parm type
			}	// parms
		}	// func

		// make the call
		contextObj.callURL(URL);
	
		return contextObj.id;
	}

	function jsrsLoaded(contextID) {
		// get context object and invoke callback
		var contextObj = jsrsContextPool[contextID];
		if( contextObj.callback != null ) {
			eval(contextObj.callback + "('" + jsrsUnescape( contextObj.getPayload() ) + "')");
			//contextObj.callback( jsrsUnescape( contextObj.getPayload() ), contextID );
		}
		// clean up and return context to pool
		contextObj.callback = null;
		contextObj.busy = false;
	}

	function jsrsError(contextID, str) {
		alert(unescape(str));
		jsrsContextPool[contextID].busy = false
	}

	function jsrsUnescape(str) {
		// payload has slashes escaped with whacks
		return str.replace( /\\\//g, "/" );
	}

	function jsrsBrowserSniff() {
		if (document.layers) return "NS";
		if (document.all) return "IE";
		if (document.getElementById) return "MOZ";
		return "OTHER";
	}

/////////////////////////////////////////////////
//
// user functions

	function jsrsArrayFromString(s, delim) {
		// rebuild an array returned from server as string
		// optional delimiter defaults to ~
		var d = (delim == null)? '~' : delim;
		return s.split(d);
	}

	// Author: 王跃
	// Last Modified Date：11-08-2001
	// Description：定义客户端的 JavaScipt函数、变量

	var ImageA = new Image();
	var ImageB = new Image();
	ImageA.src = "../Common/NDELETE.GIF"
	ImageB.src = "../Common/HDELETE.GIF"

	// 定义客户端表格
	function ClientTable(ob, id, name, BGCOLOR, TDBGCOLOR) {	// id：标识表格的类型
		this.id = id;
		this.name = name;
		this.BGCOLOR = BGCOLOR;
		this.TDBGCOLOR = TDBGCOLOR;
		this.ob = ob;
		this.Disable = false;
		this.Row = 0;
		this.Col = 0;
		this.tempRow = 0;
		this.tempCol = 0;
		this.intGridLines=16;			//尹毅 2006.5.15 默认显示行数
    
		this.blurSearch = null;		// 局部更新时模糊查找的回调函数
		this.TreeSearch = null;		// 树型结构查找回调函数
		this.Condition = null;

		this.Init = Init;		// 初始化表格
		this.Data = new Array();
		this.Title = new Array();
		this.cols = 0;
		this.rows = 0;			// 数据行
		this.SumRow = "";
		this.TitleRow = "";
		this.editkeydown = "";
		this.SumCols = new Array();	// 需要求合计的列
		this.ColWidth = new Array();
		this.ColEditName = new Array();
		this.DisableCols = new Array();
		this.NumericCols = new Array();
		this.ResultCols = new Array();
		this.FormatCols = new Array();
		this.IniCols = new Array();
		this.IniColValues = new Array();

		this.FormatSumCols = new Array();

		this.AddRowData = AddRowData; //尹毅 2006.5.16 合并addrow,loadrow的功能，提高读入速度
		this.AddRow = AddRow;
		this.DeleteRow = DeleteRow;
		this.Refresh = Refresh;
		this.Sum = Sum;
		this.Create = Create;
		this.InDisableCols = InDisableCols;
		this.InNumericCols = InNumericCols;
		this.InIniCols = InIniCols;
		this.InSumCols = InSumCols;

		this.FormatCol = FormatCol;
		this.Validate = Validate;
		this.Validate_All = Validate_All; //尹毅 2006.6.19 全部有效性验证，返回无效行号的字符串
		this.Validate_AllNotNull = Validate_AllNotNull; // 徐辉 2006-8-2 返回有效行行号字串
		this.GetWriteRowCount = GetWriteRowCount; //得到已有数据的行号
		this.GetReportData = GetReportData;
		this.ReadRow = ReadRow;
		this.LoadData = LoadData;
		this.AddData = AddData;
		this.LoadRow = LoadRow;
		this.Clear = Clear;
		this.WriteRowLastSum=WriteRowLastSum; //尹毅 2006.5.15 增加writerow的改进函数，提速，减少合计次数
		this.WriteRow = WriteRow;	// 写某行
		this.WriteCol = WriteCol;	// 写某列
		this.ChangeCol = ChangeCol; //改变某列
		this.WriteCell = WriteCell;	// 写某一单元格

		this.GetResultColValue = GetResultColValue;
		this.CheckIsNumber = CheckIsNumber;
		this.RefreshAll = RefreshAll;
		//////////////////
		this.PostDetialData = PostDetialData;

		// 局部更新
		this.LocalUpdateCol = new Array();
		this.LocalUpdate = LocalUpdate;
		this.MyCallBack = MyCallBack;
		this.bLocalUpdate = true;

		this.editChange = "";
		this.InLocalUpdateCol = InLocalUpdateCol;
	
		// 2002-03-26
		this.GetTotal = GetTotal;
		this.ReCal = ReCal;

		// 2002-04-02
		this.GetSerialData = GetSerialData;

		// 加鼠标双击事件回调函数 2002-07-05
		this.dbClick = null;
		this.MouseDbClickCols = new Array();
		this.isInMouseDbClickCols = isInMouseDbClickCols;
		this.WriteUnit2 = WriteUnit2;	// 写双单位
		this.WriteUnit2O = WriteUnit2O;	// 双grid出库grid写双单位
		this.WriteUnit2I = WriteUnit2I;	// 双grid入库grid写双单位

		// 2002-07-12
		this.HiddenArray = new Array();	// 用于附加隐藏字段的保存

		// 得到表格数据列数
		this.GetDataCols = GetDataCols;
		this.GetCell = GetCell;		// 得到某一单元格的值

		this.UpdateInTime = true;	// 是否立即计算合计

		// 2003-03-03	配置 “列” 显示数组
		this.HiddenColsArray = new Array();
		// 2003-06-04	Grid 表格是否有效
		this.GridIfDisabled = GridIfDisabled;
		// 2003-06-14	取 Grid 中的序列号信息
		this.ReadSerialRow = ReadSerialRow;
		// 2003-06-14	肖伟	序列号打印数据传输的数组数 (ColData)
		this.SerialGoRow = 0;
		// 2003-07-14	卢春	按单据列 ( 如：商品编号 ) 进行排序
		this.BillSort = BillSort;
		
		this.adjSerialRowData = adjSerialRowData;		//2003-09-15 Roamer Wu	原始单据中序列号单独打印，读取数据(调整行数据)
		this.GetSerialTotal = GetSerialTotal;			//2003-09-23 Roamer Wu  检查序列号总数，并设定一张单据中序列号输入的上限。
		this.GetSerialTotals = GetSerialTotals;			//2004-04-12 chen_qihua  检查序列号总数，并设定一张单据中序列号输入的上限。(因为生产折装单的处理不一样而加，他的出入库序列号可以相同)
		this.specialproperty = "";						//2003-12-10 Roamer Wu　GRID特殊附加属性，在创建单据时，根据此属性作特别判断。
		this.GridSpecial = "0";
		this.SearchInGrid=SearchInGrid;					//2004-12-9 徐辉 Grid中定位商品编号，商品名称
	}

	// 检查指定列是否位于鼠标双击列
	function isInMouseDbClickCols(col) {
		for ( var i = 0; i < this.MouseDbClickCols.length; i++ ) {
			if (this.MouseDbClickCols[i]==col) break;
		}
		if ( i >= this.MouseDbClickCols.length) return false;
		else return true;
	}

	// 销售折扣单抹零
	function ReCal(oldtotal,newtotal) {
		if ( this.id != 13 && this.id != 1521 ) return;
		if ( parseFloat(oldtotal) == 0 ) return;
		var temprow = new Array();
		var temptotal = new Array();
		var v;
		var temprows = -1;
		var currtotal = 0;
		
		//
		var tTotalName;
		if( this.id == 13){
			tTotalName = "Total_Edit";
		}
		else if(this.id ==1521){
			tTotalName = "OTotal_Edit";
		}

		// 改行数据有效并且金额有效
		for ( var i = 1; i <= this.rows; i++ )
			if ( this.Validate(i) && (!isNaN(parseFloat(document.all(tTotalName + i).value)))) {
				temprows = temprows + 1;
				temprow[temprows] = i;
				temptotal[temprows] = parseFloat(document.all(tTotalName + i).value);
		}

		if ( temprows == -1 ) return;

		for ( var j = 0; j <= temprows; j++ ) {
			if ( j == temprows ) {
				v = newtotal - currtotal;
				document.all(tTotalName + temprow[j]).value = Math.round(v*100)/100;
				this.Refresh(temprow[j],19,0);
			}
			else {
				v = temptotal[j] * newtotal / oldtotal;
				v = this.FormatCol(v,19);
				document.all(tTotalName + temprow[j]).value = Math.round(v*100)/100;
				this.Refresh(temprow[j],19,0);
				currtotal = currtotal + v;
			}
		}
		if ( this.UpdateInTime )
			this.Sum();
	}

	function InDisableCols(col) {
		for ( var j = 0; j < this.DisableCols.length; j++ ) {
			if ( col == this.DisableCols[j]) return true;
		}
		return false;
	}

	function InNumericCols(col) {
		for ( var i = 0; i < this.NumericCols.length; i++ ) {
			if ( this.NumericCols[i] == col ) return true;
		}
		return false;
	}

	function Init() {
		var i, j, strColsDisplay, strSumValueDisplay;
		strColsDisplay = "";
		strSumValueDisplay = "";
		switch( parseInt(this.id) ) {
			case 0:		// 调价单
				this.cols = 18;	// 商品录入 不含税
				

				this.LocalUpdateCol[0] = 1;	// 局部更新列
				this.LocalUpdateCol[1] = 2;	// 局部更新列

				this.HiddenArray[0] = "isUnitTow";
				this.HiddenArray[1] = "0";
				this.HiddenArray[2] = "UnitRate";
				this.HiddenArray[3] = "1";
				this.HiddenArray[4] = "UnitOne";	//小单位
				this.HiddenArray[5] = "";		// 默认为空
				this.HiddenArray[6] = "UnitTwo";	// 大单位
				this.HiddenArray[7] = "";		// 默认为空
				this.HiddenArray[8] = "InputCostPrice";	// 成本单价
				this.HiddenArray[9] = "0";		// 默认为0
				this.HiddenArray[10] = "GoodsNumberPrice";	// 批次单价
				this.HiddenArray[11] = "-1";		// 默认为0
				this.HiddenArray[12] = "HandZeroCost";	// 0成本出入库专用
				this.HiddenArray[13] = "0";		// 默认为0
				

				// 鼠标双击列
				this.MouseDbClickCols[0] = 3;
				this.MouseDbClickCols[1] = 11;

				this.Title[0]	= "No.";
				this.Title[1]	= "商品编号";
				this.Title[2]	= "商品全名";
				this.Title[3]	= "单位";
				this.Title[4]	= "条形码";
				this.Title[5]	= "规格";
				this.Title[6]	= "型号";
				this.Title[7]	= "产地";
				this.Title[8]	= "生产日期";
				this.Title[9]	= "效期至";
				this.Title[10]	= "批号";
				this.Title[11]	= "数量";
				this.Title[12]  = "单位关系";
				this.Title[13]	= "辅助单位";
				this.Title[14]	= "单价";
				this.Title[15]	= "金额";
				this.Title[16]	= "备注";
				this.Title[17]	= "多编码";

				this.SumCols[0] = 11;
				this.SumCols[1] = 15;

				this.FormatSumCols[0] = 11;
				this.FormatSumCols[1] = 1;
				this.FormatSumCols[2] = 15;
				this.FormatSumCols[3] = 2;

				this.NumericCols[0] = 11;
				this.NumericCols[1] = 14;
				this.NumericCols[2] = 15;

				this.FormatCols[0] = 11;
				this.FormatCols[1] = 1;		// 第一种格式 ( 小数保留 4 位 )
				this.FormatCols[2] = 14;
				this.FormatCols[3] = 1;
				this.FormatCols[4] = 15;
				this.FormatCols[5] = 2;		// 第二种格式 ( 小数保留 2 位 )

				this.ResultCols[0] = ";";
				this.ResultCols[1] = 11;
				this.ResultCols[2] = "*";
				this.ResultCols[3] = 14;
				this.ResultCols[4] = "=";
				this.ResultCols[5] = 15;
				this.ResultCols[6] = ";";

				if ( this.Disable ) {
					this.DisableCols[0]	= 1;
					this.DisableCols[1]	= 2;
					this.DisableCols[2]	= 3;
					this.DisableCols[3]	= 4;
					this.DisableCols[4]	= 5;
					this.DisableCols[5]	= 6;
					this.DisableCols[6]	= 7;
					this.DisableCols[7]	= 8;
					this.DisableCols[8]	= 9;
					this.DisableCols[9]	= 10;
					this.DisableCols[10]	= 11;
					this.DisableCols[11]	= 12;
					this.DisableCols[12]	= 13;
					this.DisableCols[13]	= 14;
					this.DisableCols[14]	= 15;
					this.DisableCols[15]	= 16;
					this.DisableCols[16]	= 17;
				}
				else {
					this.DisableCols[0]	= 3;
					this.DisableCols[1]	= 4;
					this.DisableCols[2]	= 5;
					this.DisableCols[3]	= 6;
					this.DisableCols[4]	= 7;
					this.DisableCols[5]	= 8;
					this.DisableCols[6]	= 9;
					this.DisableCols[7]	= 10;
					this.DisableCols[8]	= 12;
					this.DisableCols[9]	= 13;
					this.DisableCols[10]	= 15;
					this.DisableCols[11]	= 17;
				}

				this.ColWidth[0]	= 25;
				this.ColWidth[1]	= 100;
				this.ColWidth[2]	= 150;
				this.ColWidth[3]	= 40;
				this.ColWidth[4]	= 100;
				this.ColWidth[5]	= 80;
				this.ColWidth[6]	= 80;
				this.ColWidth[7]	= 100;
				this.ColWidth[8]	= 80;
				this.ColWidth[9]	= 80;
				this.ColWidth[10]	= 80;
				this.ColWidth[11]	= 80;
				this.ColWidth[12]	= 80;
				this.ColWidth[13]	= 100;
				this.ColWidth[14]	= 80;
				this.ColWidth[15]	= 80;
				this.ColWidth[16]	= 100;
				this.ColWidth[17]	= 100;

				this.ColEditName[0]	= "";
				this.ColEditName[1]	= "UserCode_Edit";
				this.ColEditName[2]	= "FullName_Edit";
				this.ColEditName[3]	= "Unit_Edit";
				this.ColEditName[4]	= "EntryCode_Edit";
				this.ColEditName[5]	= "Standard_Edit";
				this.ColEditName[6]	= "Type_Edit";
				this.ColEditName[7]	= "Area_Edit";
				this.ColEditName[8]	= "ProduceDate_Edit";
				this.ColEditName[9]	= "ValidDate_Edit";
				this.ColEditName[10]	= "GoodsNumber_Edit";
				this.ColEditName[11]	= "Qty_Edit";
				this.ColEditName[12] = "UnitRate_Edit";
				this.ColEditName[13] = "AssistantUnit_Edit";
				this.ColEditName[14]	= "Price_Edit";
				this.ColEditName[15]	= "Total_Edit";
				this.ColEditName[16]	= "Base_Edit";
				this.ColEditName[17]	= "CustomerCode_Edit";

				this.SumRow = "<tr class=\"ClientTablesum\" id=\"SumRow\" height=\"20px\"><td>合计</td>";strColsDisplay = 1;
				
				
				for ( i = 1; i < this.cols; i++ ) {
					// Judge If Display The Grid Cols
					for ( j = 1; j < this.HiddenColsArray.length; j++ ) {
						if ( this.HiddenColsArray[j] == this.ColEditName[i] ) {
							strColsDisplay = 0;
							break;
						}
						else
							strColsDisplay = 1;
						
					}
					for ( j = 0; j < this.SumCols.length; j++ ) {
						if ( i == parseInt(this.SumCols[j]) ) {
							strSumValueDisplay = "<span id=\"" + this.name + "Total" + this.SumCols[j] + "\" style=\"color:#000000\">&nbsp;0</span>";break;
						}
						else
							strSumValueDisplay = "&nbsp;";
					}
					if ( strColsDisplay == 1 ) {
						this.SumRow = this.SumRow + "<td>" + strSumValueDisplay + "</td>";
					}
					else{
						this.SumRow = this.SumRow + "<td style='display:none'>" + strSumValueDisplay + "</td>";
					}
				}

				if ( !this.Disable ) {	// 删除列所占用的单元格
					this.SumRow = this.SumRow + "<td>&nbsp;</td>";
				}
				this.SumRow = this.SumRow + "</tr>";

				//if ( !this.Disable )
				//	this.SumRow="<tr class=ClientTablesum id=SumRow height=20px><td colspan=4>&nbsp;合计</td><td><span id="+this.name+"Total4 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td><span id="+this.name+"Total6 style='color:#000000'>&nbsp;0</span><td>&nbsp;</td><td>&nbsp;</td></tr>";
				//else
				//	this.SumRow="<tr class=ClientTablesum id=SumRow height=20px><td colspan=4>&nbsp;合计</td><td><span id="+this.name+"Total4 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td><span id="+this.name+"Total6 style='color:#000000'>&nbsp;0</span><td>&nbsp;</td></tr>";

				break;
			case 1:	// 变价调拨单
				this.cols = 18;	// 商品录入 不含税

				// 局部更新列
				this.LocalUpdateCol[0] = 1;	// 序列号
				this.LocalUpdateCol[1] = 2;	// 商品编号
				this.LocalUpdateCol[2] = 3;	// 商品名称

				// 每行隐含域名、值数组
				this.HiddenArray[0] = "isUnitTow";
				this.HiddenArray[1] = "0";
				this.HiddenArray[2] = "UnitRate";
				this.HiddenArray[3] = "1";
				this.HiddenArray[4] = "IfSerial";
				this.HiddenArray[5] = "0";
				this.HiddenArray[6] = "SerialOut";	// 所有出库序列号字串
				this.HiddenArray[7] = "";		// 默认为空，各序列号以逗号 ( я ) 分隔
				this.HiddenArray[8] = "UnitOne";	//小单位
				this.HiddenArray[9] = "";		// 默认为空
				this.HiddenArray[10] = "UnitTwo";	// 大单位
				this.HiddenArray[11] = "";		// 默认为空
				this.HiddenArray[12] = "InputCostPrice";	// 成本单价
				this.HiddenArray[13] = "0";		// 默认为0
				this.HiddenArray[14] = "GoodsNumberPrice";	// 批次单价
				this.HiddenArray[15] = "-1";		// 默认为0
				this.HiddenArray[16] = "HandZeroCost";	// 0成本出入库专用
				this.HiddenArray[17] = "0";		// 默认为0

				// 鼠标双击列
				this.MouseDbClickCols[0] = 1;
				this.MouseDbClickCols[1] = 4;
				this.MouseDbClickCols[2] = 12;

				// 初始化表头
				this.Title[0] = "No.";
				this.Title[1] = "序列号";
				this.Title[2] = "商品编号";
				this.Title[3] = "商品全名";
				this.Title[4] = "单位";
				this.Title[5] = "条形码";
				this.Title[6] = "规格";
				this.Title[7] = "型号";
				this.Title[8] = "产地";
				this.Title[9] = "生产日期";
				this.Title[10] = "效期至";
				this.Title[11] = "批号";
				this.Title[12] = "数量";
				this.Title[13] = "单位关系";
				this.Title[14] = "辅助单位";
				this.Title[15] = "单价";
				this.Title[16] = "金额";
				this.Title[17] = "备注";

				this.SumCols[0] = 12;
				this.SumCols[1] = 16;

				this.FormatSumCols[0] = 12;
				this.FormatSumCols[1] = 1;
				this.FormatSumCols[2] = 16;
				this.FormatSumCols[3] = 2;

				this.NumericCols[0] = 12;
				this.NumericCols[1] = 15;
				this.NumericCols[2] = 16;

				this.FormatCols[0] = 12;
				this.FormatCols[1] = 1;		// 第一种格式(小数保留4位)
				this.FormatCols[2] = 15;
				this.FormatCols[3] = 1;
				this.FormatCols[4] = 16;
				this.FormatCols[5] = 2;		// 第二种格式(小数保留2位)

				this.ResultCols[0] = ";";
				this.ResultCols[1] = 12;
				this.ResultCols[2] = "*";
				this.ResultCols[3] = 15;
				this.ResultCols[4] = "=";
				this.ResultCols[5] = 16;
				this.ResultCols[6] = ";";

				if ( this.Disable ) {
					this.DisableCols[0]	= 1;
					this.DisableCols[1]	= 2;
					this.DisableCols[2]	= 3;
					this.DisableCols[3]	= 4;
					this.DisableCols[4]	= 5;
					this.DisableCols[5]	= 6;
					this.DisableCols[6]	= 7;
					this.DisableCols[7]	= 8;
					this.DisableCols[8]	= 9;
					this.DisableCols[9]	= 10;
					this.DisableCols[10]	= 11;
					this.DisableCols[11]	= 12;
					this.DisableCols[12]	= 13;
					this.DisableCols[13]	= 14;
					this.DisableCols[14]	= 15;
					this.DisableCols[15]	= 16;
				}
				else {
					this.DisableCols[0]	= 4;
					this.DisableCols[1]	= 5;
					this.DisableCols[2]	= 6;
					this.DisableCols[3]	= 7;
					this.DisableCols[4]	= 8;
					this.DisableCols[5]	= 9;
					this.DisableCols[6]	= 10;
					this.DisableCols[7]	= 11;
					this.DisableCols[8]	= 13;
					this.DisableCols[9]	= 14;
					this.DisableCols[10]= 16;
				}
				this.ColWidth[0]	= 25;
				this.ColWidth[1]	= 100;
				this.ColWidth[2]	= 100;
				this.ColWidth[3]	= 150;
				this.ColWidth[4]	= 40;
				this.ColWidth[5]	= 100;
				this.ColWidth[6]	= 80;
				this.ColWidth[7]	= 80;
				this.ColWidth[8]	= 100;
				this.ColWidth[9]	= 80;
				this.ColWidth[10]	= 80;
				this.ColWidth[11]	= 80;
				this.ColWidth[12]	= 80;
				this.ColWidth[13]	= 80;
				this.ColWidth[14]	= 100;
				this.ColWidth[15]	= 80;
				this.ColWidth[16]	= 80;
				this.ColWidth[17]	= 100;

				this.ColEditName[0]	= "";
				this.ColEditName[1]	= "SerialSel_Edit";
				this.ColEditName[2]	= "UserCode_Edit";
				this.ColEditName[3]	= "FullName_Edit";
				this.ColEditName[4]	= "Unit_Edit";
				this.ColEditName[5]	= "EntryCode_Edit";
				this.ColEditName[6]	= "Standard_Edit";
				this.ColEditName[7]	= "Type_Edit";
				this.ColEditName[8]	= "Area_Edit";
				this.ColEditName[9]	= "ProduceDate_Edit";
				this.ColEditName[10]	= "ValidDate_Edit";
				this.ColEditName[11]	= "GoodsNumber_Edit";
				this.ColEditName[12]	= "Qty_Edit";
				this.ColEditName[13]	= "UnitRate_Edit";
				this.ColEditName[14]	= "AssistantUnit_Edit";
				this.ColEditName[15]	= "Price_Edit";
				this.ColEditName[16]	= "Total_Edit";
				this.ColEditName[17]	= "Base_Edit";

				this.SumRow = "<tr class=\"ClientTablesum\" id=\"SumRow\" height=\"20px\"><td>合计</td>";strColsDisplay = 1;
				
				
				for ( i = 1; i < this.cols; i++ ) {
					// Judge If Display The Grid Cols
					for ( j = 1; j < this.HiddenColsArray.length; j++ ) {
						if ( this.HiddenColsArray[j] == this.ColEditName[i] ) {
							strColsDisplay = 0;
							break;
						}
						else
							strColsDisplay = 1;
						
					}
					for ( j = 0; j < this.SumCols.length; j++ ) {
						if ( i == parseInt(this.SumCols[j]) ) {
							strSumValueDisplay = "<span id=\"" + this.name + "Total" + this.SumCols[j] + "\" style=\"color:#000000\">&nbsp;0</span>";break;
						}
						else
							strSumValueDisplay = "&nbsp;";
					}
					if ( strColsDisplay == 1 ) {
						this.SumRow = this.SumRow + "<td>" + strSumValueDisplay + "</td>";
					}
					else{
						this.SumRow = this.SumRow + "<td style='display:none'>" + strSumValueDisplay + "</td>";
					}
				}

				if ( !this.Disable ) {	// 删除列所占用的单元格
					this.SumRow = this.SumRow + "<td>&nbsp;</td>";
				}
				this.SumRow = this.SumRow + "</tr>";

				//if ( !this.Disable )
				//	this.SumRow="<tr class=ClientTablesum id=SumRow height=20px><td colspan=4>&nbsp;合计</td><td><span id="+this.name+"Total4 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td><span id="+this.name+"Total6 style='color:#000000'>&nbsp;0</span><td>&nbsp;</td><td>&nbsp;</td></tr>";
				//else
				//	this.SumRow="<tr class=ClientTablesum id=SumRow height=20px><td colspan=4>&nbsp;合计</td><td><span id="+this.name+"Total4 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td><span id="+this.name+"Total6 style='color:#000000'>&nbsp;0</span><td>&nbsp;</td></tr>";

				break;

			case 2:		// 销售单
				this.cols = 23;		// 商品录入 含税

				// 局部更新列
				this.LocalUpdateCol[0] = 1;	// 序列号
				this.LocalUpdateCol[1] = 2;	// 商品编号
				this.LocalUpdateCol[2] = 3;	// 商品名称

				// 每行隐含域名、值数组
				this.HiddenArray[0] = "OrderId";	// 订单 ID 值
				this.HiddenArray[1] = "-1";		// 初始值
				this.HiddenArray[2] = "isUnitTow";	// 该行是否双单位
				this.HiddenArray[3] = "0";		// 默认不是双单位
				this.HiddenArray[4] = "UnitRate";	// 双单位换算关系
				this.HiddenArray[5] = "1";		// 默认换算关系为 1
				this.HiddenArray[6] = "IfSerial"	// 是否采用序列号强制管理
				this.HiddenArray[7] = "0";		// 默认为 0 ；0：非序列号强制管理；1：序列号强制管理
				this.HiddenArray[8] = "SerialOut";	// 所有出库序列号字串
				this.HiddenArray[9] = "";		// 默认为空，各序列号以逗号 ( я ) 分隔
				this.HiddenArray[10] = "UnitOne";	//小单位
				this.HiddenArray[11] = "";		// 默认为空
				this.HiddenArray[12] = "UnitTwo";	// 大单位
				this.HiddenArray[13] = "";		// 默认为空
				// ===================================add by chen_qihua 2004-6-18 采购退货，销售退货加隐含列
				this.HiddenArray[14] = "InputCostPrice";	// 成本单价
				this.HiddenArray[15] = "0";		// 默认为)
				this.HiddenArray[16] = "ID";	// 采购退货，销售退货关联的原来单据的商品的过账ID号
				this.HiddenArray[17] = "";		// 默认为空
				this.HiddenArray[18] = "OldID";	// 采购退货，销售退货关联的原来单据ID
				this.HiddenArray[19] = "";		// 默认为空
				this.HiddenArray[20] = "GoodsNumberPrice";	// 批次成本价
				this.HiddenArray[21] = "-1";		// 默认未-1
				this.HiddenArray[22] = "HandZeroCost";	// 0成本出入库专用
				this.HiddenArray[23] = "0";		// 默认未0
				
				
				// 鼠标双击列
				this.MouseDbClickCols[0] = 1;
				this.MouseDbClickCols[1] = 4;
				this.MouseDbClickCols[2] = 12;

				this.Title[0]	= "No.";
				this.Title[1]	= "序列号";
				this.Title[2]	= "商品编号";
				this.Title[3]	= "商品全名";
				this.Title[4]	= "单位";
				this.Title[5]	= "条形码";
				this.Title[6]	= "规格";
				this.Title[7]	= "型号";
				this.Title[8]	= "产地";
				this.Title[9]	= "生产日期";
				this.Title[10]	= "效期至";
				this.Title[11]	= "批号";
				this.Title[12]   = "数量";
				this.Title[13]  = "单位关系";
				this.Title[14]	= "辅助单位";
				this.Title[15]	= "单价";
				this.Title[16]	= "金额";
				this.Title[17]	= "税率";
				this.Title[18]	= "含税单价";
				this.Title[19]	= "价税合计";
				this.Title[20]	= "备注";
				this.Title[21]	= "未完成订货数量";
				this.Title[22]	= "多编码";

				this.SumCols[0] = 12;
				this.SumCols[1] = 16;
				this.SumCols[2] = 19;

				this.FormatSumCols[0] = 12;
				this.FormatSumCols[1] = 1;
				this.FormatSumCols[2] = 16;
				this.FormatSumCols[3] = 2;
				this.FormatSumCols[4] = 19;
				this.FormatSumCols[5] = 2;

				this.IniCols[0] = 17;
				if ( typeof(this.IniColValues[0]) != "undefined" )
					this.IniCols[1] = this.IniColValues[0];
				else
					this.IniCols[1] = 17;	// 默认 17 点税
     
				// 销售单数量加入缺省值 1
				if ( typeof(this.IniColValues[1]) != "undefined" ) {
					this.IniCols[2] = 12;
					this.IniCols[3] = 1;
				}

				this.NumericCols[0] = 12;
				this.NumericCols[1] = 18;
				this.NumericCols[2] = 15;
				this.NumericCols[3] = 19;

				if (this.Disable) {
					this.DisableCols[0]	= 1;
					this.DisableCols[1]	= 2;
					this.DisableCols[2]	= 3;
					this.DisableCols[3]	= 4;
					this.DisableCols[4]	= 5;
					this.DisableCols[5]	= 6;
					this.DisableCols[6]	= 7;
					this.DisableCols[7]	= 8;
					this.DisableCols[8]	= 9;
					this.DisableCols[9]	= 10;
					this.DisableCols[10]	= 11;
					this.DisableCols[11]	= 12;
					this.DisableCols[12]	= 13;
					this.DisableCols[13]	= 14;
					this.DisableCols[14]	= 15;
					this.DisableCols[15]	= 16;
					this.DisableCols[16]	= 17;
					this.DisableCols[17]	= 18;
					this.DisableCols[18]	= 19;
					this.DisableCols[19]	= 20;
					this.DisableCols[20]	= 21;
					this.DisableCols[21]	= 22;
				}
				else {
					//委托代销退货，销售退货录入批次日期
					if ( Grid.specialproperty == "WTDXTH" || Grid.specialproperty == "XSTH" ){
						this.DisableCols[0]	= 4;
						this.DisableCols[1]	= 5;
						this.DisableCols[2]	= 6;
						this.DisableCols[3]	= 7;
						this.DisableCols[4]	= 8;
						this.DisableCols[5] = 13;
						this.DisableCols[6] = 14;
						this.DisableCols[7]	= 16;
						this.DisableCols[8]	= 17;
						this.DisableCols[9]	= 21;
						this.DisableCols[10]	= 22;
					}
					else{
						this.DisableCols[0]	= 4;
						this.DisableCols[1]	= 5;
						this.DisableCols[2]	= 6;
						this.DisableCols[3]	= 7;
						this.DisableCols[4]	= 8;
						this.DisableCols[5]	= 9;  
						this.DisableCols[6] = 10;
						this.DisableCols[7] = 11;
						this.DisableCols[8] = 13;
						this.DisableCols[9] = 14;
						this.DisableCols[10]	= 16;
						this.DisableCols[11]	= 17;
						this.DisableCols[12]	= 21;
						this.DisableCols[13]	= 22;
					}
				}

				this.FormatCols[0] = 12;		// 数量
				this.FormatCols[1] = 1;		// 第一种格式(小数保留4位)
				this.FormatCols[2] = 18;	// 含税单价
				this.FormatCols[3] = 1;
				this.FormatCols[4] = 16;	// 金额
				this.FormatCols[5] = 2;
				this.FormatCols[6] = 19;	// 价税合计
				this.FormatCols[7] = 2;		// 第二种格式(小数保留2位)
				this.FormatCols[8] = 15;	// 单价
				this.FormatCols[9] = 1;

				this.ResultCols[0] = 12;     //需要数量变化需从新计算的列
				this.ResultCols[1] = 15;	//徐辉 添加税前单价列 2004-4-23,2004-9-15 添加价税合计
				this.ResultCols[2] = 18;
				this.ResultCols[3] = 19;

				this.ColWidth[0]	= 25;
				this.ColWidth[1]	= 100;
				this.ColWidth[2]	= 100;
				this.ColWidth[3]	= 150;
				this.ColWidth[4]	= 40;
				this.ColWidth[5]	= 100;
				this.ColWidth[6]	= 80;
				this.ColWidth[7]	= 80;
				this.ColWidth[8]	= 100;
				this.ColWidth[9]	= 80;
				this.ColWidth[10]	= 80;
				this.ColWidth[11]	= 80;
				this.ColWidth[12]	= 80;
				this.ColWidth[13]	= 80;
				this.ColWidth[14]	= 100;
				this.ColWidth[15]	= 80;
				this.ColWidth[16]	= 80;
				this.ColWidth[17]	= 40;
				this.ColWidth[18]	= 80;
				this.ColWidth[19]	= 80;
				this.ColWidth[20]	= 100;
				this.ColWidth[21]	= 100;
				this.ColWidth[22]	= 100;

				this.ColEditName[0]	= "";
				this.ColEditName[1]	= "SerialSel_Edit";
				this.ColEditName[2]	= "UserCode_Edit";
				this.ColEditName[3]	= "FullName_Edit";
				this.ColEditName[4]	= "Unit_Edit";
				this.ColEditName[5]	= "EntryCode_Edit";
				this.ColEditName[6]	= "Standard_Edit";
				this.ColEditName[7]	= "Type_Edit";
				this.ColEditName[8]	= "Area_Edit";
				this.ColEditName[9]	= "ProduceDate_Edit";
				this.ColEditName[10]	= "ValidDate_Edit";
				this.ColEditName[11]	= "GoodsNumber_Edit";
				this.ColEditName[12]	= "Qty_Edit";
				this.ColEditName[13]	= "UnitRate_Edit";
				this.ColEditName[14]	= "AssistantUnit_Edit";
				this.ColEditName[15]	= "Price_Edit";
				this.ColEditName[16]	= "NoTaxTotal_Edit";
				this.ColEditName[17]	= "TaxRate_Edit";
				this.ColEditName[18]	= "TaxPrice_Edit";
				this.ColEditName[19]	= "Total_Edit";
				this.ColEditName[20]	= "Base_Edit";
				this.ColEditName[21]	= "PlanQty_Edit";
				this.ColEditName[22]	= "CustomerCode_Edit";

				this.SumRow = "<tr class=\"ClientTablesum\" id=\"SumRow\" height=\"20px\"><td>合计</td>";strColsDisplay = 1;
				
				
				for ( i = 1; i < this.cols; i++ ) {
					// Judge If Display The Grid Cols
					for ( j = 1; j < this.HiddenColsArray.length; j++ ) {
						if ( this.HiddenColsArray[j] == this.ColEditName[i] ) {
							strColsDisplay = 0;
							break;
						}
						else
							strColsDisplay = 1;
						
					}
					for ( j = 0; j < this.SumCols.length; j++ ) {
						if ( i == parseInt(this.SumCols[j]) ) {
							strSumValueDisplay = "<span id=\"" + this.name + "Total" + this.SumCols[j] + "\" style=\"color:#000000\">&nbsp;0</span>";break;
						}
						else
							strSumValueDisplay = "&nbsp;";
					}
					if ( strColsDisplay == 1 ) {
						this.SumRow = this.SumRow + "<td>" + strSumValueDisplay + "</td>";
					}
					else{
						this.SumRow = this.SumRow + "<td style='display:none'>" + strSumValueDisplay + "</td>";
					}
				}

				if ( !this.Disable ) {	// 删除列所占用的单元格
					this.SumRow = this.SumRow + "<td>&nbsp;</td>";
				}
				this.SumRow = this.SumRow + "</tr>";

				//if ( !this.Disable )
				//	this.SumRow="<tr class=ClientTablesum id=SumRow height=20px><td colspan=4>&nbsp;合计</td><td><span id="+this.name+"Total4 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td><span id="+this.name+"Total6 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td>&nbsp;</td><td><span id="+this.name+"Total9 style='color:#000000'>&nbsp;0</span><td>&nbsp;</td><td>&nbsp;</td></tr>";
				//else
				//	this.SumRow="<tr class=ClientTablesum id=SumRow height=20px><td colspan=4>&nbsp;合计</td><td><span id="+this.name+"Total4 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td><span id="+this.name+"Total6 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td>&nbsp;</td><td><span id="+this.name+"Total9 style='color:#000000'>&nbsp;0</span><td>&nbsp;</td></tr>";

				break;

			case 3:		// 调账单
				this.cols = 5;

				this.LocalUpdateCol[0] = 1;	// 局部更新列
				this.LocalUpdateCol[1] = 2;	// 局部更新列

				this.HiddenArray[0] = "isUnitTow";
				this.HiddenArray[1] = "0";
				this.HiddenArray[2] = "UnitRate";
				this.HiddenArray[3] = "1";

				this.Title[0] = "No.";
				this.Title[1] = "单位编号";
				this.Title[2] = "单位全名";
				this.Title[3] = "金额";
				this.Title[4] = "备注";

				this.SumCols[0] = 3;

				this.FormatSumCols[0] = 3;
				this.FormatSumCols[1] = 2;

				this.NumericCols[0] = 3;

				this.FormatCols[0] = 3;
				this.FormatCols[1] = 2;		// 第二种格式 ( 小数保留 2 位 )

				if ( this.Disable ) {
					this.DisableCols[0] = 1;
					this.DisableCols[1] = 2;
					this.DisableCols[2] = 3;
					this.DisableCols[3] = 4;
				}

				this.ColWidth[0] = 25;
				this.ColWidth[1] = 100;
				this.ColWidth[2] = 200;
				this.ColWidth[3] = 80;
				this.ColWidth[4] = 250;

				this.ColEditName[0] = "";
				this.ColEditName[1] = "UserCode_Edit";
				this.ColEditName[2] = "FullName_Edit";
				this.ColEditName[3] = "Total_Edit";
				this.ColEditName[4] = "Base_Edit";

				if ( !this.Disable )
					this.SumRow = "<tr class=ClientTablesum id=SumRow height=20px><td>合计</td><td></td><td></td><td><span id="+this.name+"Total3 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td>&nbsp;</td></tr>";
				else
					this.SumRow = "<tr class=ClientTablesum id=SumRow height=20px><td>合计</td><td></td><td></td><td><span id="+this.name+"Total3 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td></tr>";

				break;

			case 22:	// 借欠类单据 (除借进开单)
				this.cols = 11;

				// 局部更新列
				this.LocalUpdateCol[0] = 1;	// 序列号
				this.LocalUpdateCol[1] = 2;	// 商品编号
				this.LocalUpdateCol[2] = 3;	// 商品全名

				this.HiddenArray[0] = "isUnitTow";
				this.HiddenArray[1] = "0";
				this.HiddenArray[2] = "UnitRate";
				this.HiddenArray[3] = "1";
				this.HiddenArray[4] = "IfSerial";
				this.HiddenArray[5] = "0";
				this.HiddenArray[6] = "SerialOut";	// 所有出库序列号字串
				this.HiddenArray[7] = "";		// 默认为空，各序列号以逗号 ( я ) 分隔

				// 鼠标双击列
				this.MouseDbClickCols[0] = 1;
				this.MouseDbClickCols[1] = 4;

				this.Title[0] = "No.";
				this.Title[1] = "序列号"
				this.Title[2] = "商品编号";
				this.Title[3] = "商品全名";
				this.Title[4] = "单位";
				this.Title[5] = "条形码";
				this.Title[6] = "规格";
				this.Title[7] = "型号";
				this.Title[8] = "产地";
				this.Title[9] = "数量";
				this.Title[10] = "备注";

				this.SumCols[0] = 9;

				this.FormatSumCols[0] = 9;
				this.FormatSumCols[1] = 1;

				this.NumericCols[0] = 9;

				this.FormatCols[0] = 9;
				this.FormatCols[1] = 1;		// 第一种格式 ( 小数保留 4 位 )

				if ( this.Disable ) {
					this.DisableCols[0] = 1;
					this.DisableCols[1] = 2;
					this.DisableCols[2] = 3;
					this.DisableCols[3] = 4;
					this.DisableCols[4] = 5;
					this.DisableCols[5] = 6;
					this.DisableCols[6] = 7;
					this.DisableCols[7] = 8;
					this.DisableCols[8] = 9;
					this.DisableCols[9] = 10;
				}
				else {
					this.DisableCols[0] = 4;
					this.DisableCols[1] = 5;
					this.DisableCols[2] = 6;
					this.DisableCols[3] = 7;
					this.DisableCols[4] = 8;
				}

				this.ColWidth[0] = 25;
				this.ColWidth[1] = 100;
				this.ColWidth[2] = 100;
				this.ColWidth[3] = 150;
				this.ColWidth[4] = 40;
				this.ColWidth[5] = 100;
				this.ColWidth[6] = 80;
				this.ColWidth[7] = 80;
				this.ColWidth[8] = 100;
				this.ColWidth[9] = 80;
				this.ColWidth[10] = 100;

				this.ColEditName[0] = "";
				this.ColEditName[1] = "SerialSel_Edit";
				this.ColEditName[2] = "UserCode_Edit";
				this.ColEditName[3] = "FullName_Edit";
				this.ColEditName[4] = "Unit_Edit";
				this.ColEditName[5] = "EntryCode_Edit";
				this.ColEditName[6] = "Standard_Edit";
				this.ColEditName[7] = "Type_Edit";
				this.ColEditName[8] = "Area_Edit";
				this.ColEditName[9] = "Qty_Edit";
				this.ColEditName[10] = "Base_Edit";

				this.SumRow = "<tr class=\"ClientTablesum\" id=\"SumRow\" height=\"20px\"><td>合计</td>";strColsDisplay = 1;
				
				
				for ( i = 1; i < this.cols; i++ ) {
					// Judge If Display The Grid Cols
					for ( j = 1; j < this.HiddenColsArray.length; j++ ) {
						if ( this.HiddenColsArray[j] == this.ColEditName[i] ) {
							strColsDisplay = 0;
							break;
						}
						else
							strColsDisplay = 1;
						
					}
					for ( j = 0; j < this.SumCols.length; j++ ) {
						if ( i == parseInt(this.SumCols[j]) ) {
							strSumValueDisplay = "<span id=\"" + this.name + "Total" + this.SumCols[j] + "\" style=\"color:#000000\">&nbsp;0</span>";break;
						}
						else
							strSumValueDisplay = "&nbsp;";
					}
					if ( strColsDisplay == 1 ) {
						this.SumRow = this.SumRow + "<td>" + strSumValueDisplay + "</td>";
					}
					else{
						this.SumRow = this.SumRow + "<td style='display:none'>" + strSumValueDisplay + "</td>";
					}
				}

				if ( !this.Disable ) {	// 删除列所占用的单元格
					this.SumRow = this.SumRow + "<td>&nbsp;</td>";
				}
				this.SumRow = this.SumRow + "</tr>";

				//if ( !this.Disable )
				//	this.SumRow="<tr class=ClientTablesum id=SumRow height=20px><td colspan=4>&nbsp;合计</td><td><span id="+this.name+"Total4 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td>&nbsp;</td></tr>";
				//else
				//	this.SumRow="<tr class=ClientTablesum id=SumRow height=20px><td colspan=4>&nbsp;合计</td><td><span id="+this.name+"Total4 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td></tr>";

				break;

			case 25:	// 借进开单
				this.cols = 11;

				// 局部更新列
				this.LocalUpdateCol[0] = 1;	// 商品编号
				this.LocalUpdateCol[1] = 2;	// 商品全名

				this.HiddenArray[0] = "isUnitTow";
				this.HiddenArray[1] = "0";
				this.HiddenArray[2] = "UnitRate";
				this.HiddenArray[3] = "1";
				this.HiddenArray[4] = "IfSerial";
				this.HiddenArray[5] = "0";
				this.HiddenArray[6] = "SerialIn";	// 所有入库序列号字串
				this.HiddenArray[7] = "";		// 默认为空，各序列号以逗号 ( я ) 分隔

				// 鼠标双击列
				this.MouseDbClickCols[0] = 3;
				this.MouseDbClickCols[1] = 10;

				this.Title[0] = "No.";
				this.Title[1] = "商品编号";
				this.Title[2] = "商品全名";
				this.Title[3] = "单位";
				this.Title[4] = "条形码";
				this.Title[5] = "规格";
				this.Title[6] = "型号";
				this.Title[7] = "产地";
				this.Title[8] = "数量";
				this.Title[9] = "备注";
				this.Title[10] = "序列号"

				this.SumCols[0] = 8;

				this.FormatSumCols[0] = 8;
				this.FormatSumCols[1] = 1;

				this.NumericCols[0] = 8;

				this.FormatCols[0] = 8;
				this.FormatCols[1] = 1;		// 第一种格式 ( 小数保留 4 位 )

				if ( this.Disable ) {
					this.DisableCols[0] = 1;
					this.DisableCols[1] = 2;
					this.DisableCols[2] = 3;
					this.DisableCols[3] = 4;
					this.DisableCols[4] = 5;
					this.DisableCols[5] = 6;
					this.DisableCols[6] = 7;
					this.DisableCols[7] = 8;
					this.DisableCols[8] = 9;
					this.DisableCols[9] = 10;
				}
				else {
					this.DisableCols[0] = 3;
					this.DisableCols[1] = 4;
					this.DisableCols[2] = 5;
					this.DisableCols[3] = 6;
					this.DisableCols[4] = 7;
				}

				this.ColWidth[0] = 25;
				this.ColWidth[1] = 100;
				this.ColWidth[2] = 150;
				this.ColWidth[3] = 40;
				this.ColWidth[4] = 100;
				this.ColWidth[5] = 80;
				this.ColWidth[6] = 80;
				this.ColWidth[7] = 100;
				this.ColWidth[8] = 80;
				this.ColWidth[9] = 100;
				this.ColWidth[10] = 100;

				this.ColEditName[0] = "";
				this.ColEditName[1] = "UserCode_Edit";
				this.ColEditName[2] = "FullName_Edit";
				this.ColEditName[3] = "Unit_Edit";
				this.ColEditName[4] = "EntryCode_Edit";
				this.ColEditName[5] = "Standard_Edit";
				this.ColEditName[6] = "Type_Edit";
				this.ColEditName[7] = "Area_Edit";
				this.ColEditName[8] = "Qty_Edit";
				this.ColEditName[9] = "Base_Edit";
				this.ColEditName[10] = "Serial_Edit";

				this.SumRow = "<tr class=\"ClientTablesum\" id=\"SumRow\" height=\"20px\"><td>合计</td>";strColsDisplay = 1;
				
				
				for ( i = 1; i < this.cols; i++ ) {
					// Judge If Display The Grid Cols
					for ( j = 1; j < this.HiddenColsArray.length; j++ ) {
						if ( this.HiddenColsArray[j] == this.ColEditName[i] ) {
							strColsDisplay = 0;
							break;
						}
						else
							strColsDisplay = 1;
						
					}
					for ( j = 0; j < this.SumCols.length; j++ ) {
						if ( i == parseInt(this.SumCols[j]) ) {
							strSumValueDisplay = "<span id=\"" + this.name + "Total" + this.SumCols[j] + "\" style=\"color:#000000\">&nbsp;0</span>";break;
						}
						else
							strSumValueDisplay = "&nbsp;";
					}
					if ( strColsDisplay == 1 ) {
						this.SumRow = this.SumRow + "<td>" + strSumValueDisplay + "</td>";
					}
					else{
						this.SumRow = this.SumRow + "<td style='display:none'>" + strSumValueDisplay + "</td>";
					}
				}

				if ( !this.Disable ) {	// 删除列所占用的单元格
					this.SumRow = this.SumRow + "<td>&nbsp;</td>";
				}
				this.SumRow = this.SumRow + "</tr>";

				//if ( !this.Disable )
				//	this.SumRow="<tr class=ClientTablesum id=SumRow height=20px><td colspan=4>&nbsp;合计</td><td><span id="+this.name+"Total4 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td>&nbsp;</td></tr>";
				//else
				//	this.SumRow="<tr class=ClientTablesum id=SumRow height=20px><td colspan=4>&nbsp;合计</td><td><span id="+this.name+"Total4 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td></tr>";

				break;

			case 4:		//报损单、赠送单
				if ( this.specialproperty == "BSD" ){ //报损单
					this.cols = 18;	//商品录入 不含税

					// 局部更新列
					this.LocalUpdateCol[0] = 1;	// 序列号
					this.LocalUpdateCol[1] = 2;	// 商品编号
					this.LocalUpdateCol[2] = 3;	// 商品名称

					this.HiddenArray[0] = "isUnitTow";
					this.HiddenArray[1] = "0";
					this.HiddenArray[2] = "UnitRate";
					this.HiddenArray[3] = "1";
					this.HiddenArray[4] = "IfSerial";
					this.HiddenArray[5] = "0";
					this.HiddenArray[6] = "SerialOut";	// 所有出库序列号字串
					this.HiddenArray[7] = "";		// 默认为空，各序列号以逗号 ( я ) 分隔
					this.HiddenArray[8] = "UnitOne";	//小单位
					this.HiddenArray[9] = "";		// 默认为空
					this.HiddenArray[10] = "UnitTwo";	// 大单位
					this.HiddenArray[11] = "";		// 默认为空
					this.HiddenArray[12] = "InputCostPrice";	// 成本单价
					this.HiddenArray[13] = "0";		// 默认为0
					this.HiddenArray[14] = "GoodsNumberPrice";	// 批次成本单价
					this.HiddenArray[15] = "-1";		// 默认未-1
					this.HiddenArray[16] = "HandZeroCost";	// 0成本出入库专用
					this.HiddenArray[17] = "0";		// 默认未0

					// 鼠标双击列
					this.MouseDbClickCols[0] = 1;
					this.MouseDbClickCols[1] = 4;
					this.MouseDbClickCols[2] = 12;

					this.Title[0]	= "No.";
					this.Title[1]	= "序列号";
					this.Title[2]	= "商品编号";
					this.Title[3]	= "商品全名";
					this.Title[4]	= "单位";
					this.Title[5]	= "条形码";
					this.Title[6]	= "规格";
					this.Title[7]	= "型号";
					this.Title[8]	= "产地";
					this.Title[9]	= "生产日期";
					this.Title[10]	= "效期至";
					this.Title[11]	= "批号";
					this.Title[12]	= "数量";
					this.Title[13]  = "单位关系";
					this.Title[14]	= "辅助单位";
					this.Title[15]	= "成本单价";
					this.Title[16]	= "成本金额";
					this.Title[17]	= "备注";

					this.SumCols[0] = 12;
					this.SumCols[1] = 16;

					this.FormatSumCols[0] = 12;
					this.FormatSumCols[1] = 1;
					this.FormatSumCols[2] = 16;
					this.FormatSumCols[3] = 2;
					

					this.NumericCols[0] = 12;
					this.NumericCols[1] = 15;
					this.NumericCols[2] = 16;
					
					this.ResultCols[0] = ";";
					this.ResultCols[1] = 12;
					this.ResultCols[2] = "*";
					this.ResultCols[3] = 15;
					this.ResultCols[4] = "=";
					this.ResultCols[5] = 16;
					this.ResultCols[6] = ";";


					this.FormatCols[0] = 12;
					this.FormatCols[1] = 1;	// 第一种格式(小数保留4位)
					this.FormatCols[2] = 15;
					this.FormatCols[3] = 1;	// 第一种格式(小数保留4位)
					this.FormatCols[4] = 16;
					this.FormatCols[5] = 2;	// 第一种格式(小数保留4位)
				

					if ( this.Disable ) {
						this.DisableCols[0] = 1;
						this.DisableCols[1] = 2;
						this.DisableCols[2] = 3;
						this.DisableCols[3] = 4;
						this.DisableCols[4] = 5;
						this.DisableCols[5] = 6;
						this.DisableCols[6] = 7;
						this.DisableCols[7] = 8;
						this.DisableCols[8] = 9;
						this.DisableCols[9] = 10;
						this.DisableCols[10]	= 11;
						this.DisableCols[11]	= 12;
						this.DisableCols[12]	= 13;
						this.DisableCols[13]	= 14;
						this.DisableCols[14]	= 15;
						this.DisableCols[15]	= 16;
						this.DisableCols[16]	= 17;
					}
					else {
						this.DisableCols[0] = 4;
						this.DisableCols[1] = 5;
						this.DisableCols[2] = 6;
						this.DisableCols[3] = 7;
						this.DisableCols[4] = 8;
						this.DisableCols[5] = 9;
						this.DisableCols[6] = 10;
						this.DisableCols[7] = 11;
						this.DisableCols[8] = 13;
						this.DisableCols[9] = 14;
						this.DisableCols[10] = 15;
						this.DisableCols[11] = 16;
					}

					this.ColWidth[0]	= 25;
					this.ColWidth[1]	= 100;
					this.ColWidth[2]	= 100;
					this.ColWidth[3]	= 150;
					this.ColWidth[4]	= 40;
					this.ColWidth[5]	= 100;
					this.ColWidth[6]	= 80;
					this.ColWidth[7]	= 80;
					this.ColWidth[8]	= 100;
					this.ColWidth[9]	= 80;
					this.ColWidth[10]	= 80;
					this.ColWidth[11]	= 80;
					this.ColWidth[12]	= 80;
					this.ColWidth[13]	= 80;
					this.ColWidth[14]	= 100;
					this.ColWidth[15]	= 80;
					this.ColWidth[16]	= 80;
					this.ColWidth[17]	= 100;

					this.ColEditName[0]	= "";
					this.ColEditName[1]	= "SerialSel_Edit";
					this.ColEditName[2]	= "UserCode_Edit";
					this.ColEditName[3]	= "FullName_Edit";
					this.ColEditName[4]	= "Unit_Edit";
					this.ColEditName[5]	= "EntryCode_Edit";
					this.ColEditName[6]	= "Standard_Edit";
					this.ColEditName[7]	= "Type_Edit";
					this.ColEditName[8]	= "Area_Edit";
					this.ColEditName[9]	= "ProduceDate_Edit";
					this.ColEditName[10]	= "ValidDate_Edit";
					this.ColEditName[11]	= "GoodsNumber_Edit";
					this.ColEditName[12]	= "Qty_Edit";
					this.ColEditName[13]	= "UnitRate_Edit";
					this.ColEditName[14]	= "AssistantUnit_Edit";
					this.ColEditName[15]	= "Price_Edit";
					this.ColEditName[16]	= "Total_Edit";
					this.ColEditName[17]	= "Base_Edit";

					this.SumRow = "<tr class=\"ClientTablesum\" id=\"SumRow\" height=\"20px\"><td>合计</td>";strColsDisplay = 1;
				
				
					for ( i = 1; i < this.cols; i++ ) {
						// Judge If Display The Grid Cols
						for ( j = 1; j < this.HiddenColsArray.length; j++ ) {
							if ( this.HiddenColsArray[j] == this.ColEditName[i] ) {
								strColsDisplay = 0;
								break;
							}
							else
								strColsDisplay = 1;
							
						}
						for ( j = 0; j < this.SumCols.length; j++ ) {
							if ( i == parseInt(this.SumCols[j]) ) {
								strSumValueDisplay = "<span id=\"" + this.name + "Total" + this.SumCols[j] + "\" style=\"color:#000000\">&nbsp;0</span>";break;
							}
							else
								strSumValueDisplay = "&nbsp;";
						}
						if ( strColsDisplay == 1 ) {
							this.SumRow = this.SumRow + "<td>" + strSumValueDisplay + "</td>";
						}
						else{
							this.SumRow = this.SumRow + "<td style='display:none'>" + strSumValueDisplay + "</td>";
						}
					}

					if ( !this.Disable ) {	// 删除列所占用的单元格
						this.SumRow = this.SumRow + "<td>&nbsp;</td>";
					}
					this.SumRow = this.SumRow + "</tr>";

					//if ( !this.Disable )
					//	this.SumRow="<tr class=ClientTablesum id=SumRow height=20px><td colspan=4>&nbsp;合计</td><td><span id="+this.name+"Total4 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td>&nbsp;</td></tr>";
					//else
					//	this.SumRow="<tr class=ClientTablesum id=SumRow height=20px><td colspan=4>&nbsp;合计</td><td><span id="+this.name+"Total4 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td></tr>";
				}
				else{
					//赠送单、同价调拨单（只显示数量）
					this.cols = 16;	//商品录入 不含税

					// 局部更新列
					this.LocalUpdateCol[0] = 1;	// 序列号
					this.LocalUpdateCol[1] = 2;	// 商品编号
					this.LocalUpdateCol[2] = 3;	// 商品名称

					this.HiddenArray[0] = "isUnitTow";
					this.HiddenArray[1] = "0";
					this.HiddenArray[2] = "UnitRate";
					this.HiddenArray[3] = "1";
					this.HiddenArray[4] = "IfSerial";
					this.HiddenArray[5] = "0";
					this.HiddenArray[6] = "SerialOut";	// 所有出库序列号字串
					this.HiddenArray[7] = "";		// 默认为空，各序列号以逗号 ( я ) 分隔
					this.HiddenArray[8] = "UnitOne";	//小单位
					this.HiddenArray[9] = "";		// 默认为空
					this.HiddenArray[10] = "UnitTwo";	// 大单位
					this.HiddenArray[11] = "";		// 默认为空
					this.HiddenArray[12] = "InputCostPrice";	// 成本单价
					this.HiddenArray[13] = "0";		// 默认为0
					this.HiddenArray[14] = "GoodsNumberPrice";	// 库存批次价格
					this.HiddenArray[15] = "-1";		// 默认未-1
					this.HiddenArray[16] = "HandZeroCost";	// 0成本出入库专用
					this.HiddenArray[17] = "0";		// 默认未0

					// 鼠标双击列
					this.MouseDbClickCols[0] = 1;
					this.MouseDbClickCols[1] = 4;
					this.MouseDbClickCols[2] = 12;

					this.Title[0]	= "No.";
					this.Title[1]	= "序列号";
					this.Title[2]	= "商品编号";
					this.Title[3]	= "商品全名";
					this.Title[4]	= "单位";
					this.Title[5]	= "条形码";
					this.Title[6]	= "规格";
					this.Title[7]	= "型号";
					this.Title[8]	= "产地";
					this.Title[9]	= "生产日期";
					this.Title[10]	= "效期至";
					this.Title[11]	= "批号";
					this.Title[12]	= "数量";
					this.Title[13]  = "单位关系";
					this.Title[14]	= "辅助单位";
					this.Title[15]	= "备注";

					this.SumCols[0] = 12;

					this.FormatSumCols[0] = 12;
					this.FormatSumCols[1] = 1;

					this.NumericCols[0] = 12;

					this.FormatCols[0] = 12;
					this.FormatCols[1] = 1;	// 第一种格式(小数保留4位)
				

					if ( this.Disable ) {
						this.DisableCols[0] = 1;
						this.DisableCols[1] = 2;
						this.DisableCols[2] = 3;
						this.DisableCols[3] = 4;
						this.DisableCols[4] = 5;
						this.DisableCols[5] = 6;
						this.DisableCols[6] = 7;
						this.DisableCols[7] = 8;
						this.DisableCols[8] = 9;
						this.DisableCols[9] = 10;
						this.DisableCols[10]	= 11;
						this.DisableCols[11]	= 12;
						this.DisableCols[12]	= 13;
						this.DisableCols[13]	= 14;
						this.DisableCols[14]	= 15;
					}
					else {
						this.DisableCols[0] = 4;
						this.DisableCols[1] = 5;
						this.DisableCols[2] = 6;
						this.DisableCols[3] = 7;
						this.DisableCols[4] = 8;
						this.DisableCols[5] = 9;
						this.DisableCols[6] = 10;
						this.DisableCols[7] = 11;
						this.DisableCols[8] = 13;
						this.DisableCols[9] = 14;
					}

					this.ColWidth[0]	= 25;
					this.ColWidth[1]	= 100;
					this.ColWidth[2]	= 100;
					this.ColWidth[3]	= 150;
					this.ColWidth[4]	= 40;
					this.ColWidth[5]	= 100;
					this.ColWidth[6]	= 80;
					this.ColWidth[7]	= 80;
					this.ColWidth[8]	= 100;
					this.ColWidth[9]	= 80;
					this.ColWidth[10]	= 80;
					this.ColWidth[11]	= 80;
					this.ColWidth[12]	= 80;
					this.ColWidth[13]	= 80;
					this.ColWidth[14]	= 100;
					this.ColWidth[15]	= 100;

					this.ColEditName[0]	= "";
					this.ColEditName[1]	= "SerialSel_Edit";
					this.ColEditName[2]	= "UserCode_Edit";
					this.ColEditName[3]	= "FullName_Edit";
					this.ColEditName[4]	= "Unit_Edit";
					this.ColEditName[5]	= "EntryCode_Edit";
					this.ColEditName[6]	= "Standard_Edit";
					this.ColEditName[7]	= "Type_Edit";
					this.ColEditName[8]	= "Area_Edit";
					this.ColEditName[9]	= "ProduceDate_Edit";
					this.ColEditName[10]	= "ValidDate_Edit";
					this.ColEditName[11]	= "GoodsNumber_Edit";
					this.ColEditName[12]	= "Qty_Edit";
					this.ColEditName[13]	= "UnitRate_Edit";
					this.ColEditName[14]	= "AssistantUnit_Edit";
					this.ColEditName[15]	= "Base_Edit";

					this.SumRow = "<tr class=\"ClientTablesum\" id=\"SumRow\" height=\"20px\"><td>合计</td>";strColsDisplay = 1;
				
				
					for ( i = 1; i < this.cols; i++ ) {
						// Judge If Display The Grid Cols
						for ( j = 1; j < this.HiddenColsArray.length; j++ ) {
							if ( this.HiddenColsArray[j] == this.ColEditName[i] ) {
								strColsDisplay = 0;
								break;
							}
							else
								strColsDisplay = 1;
							
						}
						for ( j = 0; j < this.SumCols.length; j++ ) {
							if ( i == parseInt(this.SumCols[j]) ) {
								strSumValueDisplay = "<span id=\"" + this.name + "Total" + this.SumCols[j] + "\" style=\"color:#000000\">&nbsp;0</span>";break;
							}
							else
								strSumValueDisplay = "&nbsp;";
						}
						if ( strColsDisplay == 1 ) {
							this.SumRow = this.SumRow + "<td>" + strSumValueDisplay + "</td>";
						}
						else{
							this.SumRow = this.SumRow + "<td style='display:none'>" + strSumValueDisplay + "</td>";
						}
					}

					if ( !this.Disable ) {	// 删除列所占用的单元格
						this.SumRow = this.SumRow + "<td>&nbsp;</td>";
					}
					this.SumRow = this.SumRow + "</tr>";

					//if ( !this.Disable )
					//	this.SumRow="<tr class=ClientTablesum id=SumRow height=20px><td colspan=4>&nbsp;合计</td><td><span id="+this.name+"Total4 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td>&nbsp;</td></tr>";
					//else
					//	this.SumRow="<tr class=ClientTablesum id=SumRow height=20px><td colspan=4>&nbsp;合计</td><td><span id="+this.name+"Total4 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td></tr>";
				}
				break;

			case 23:		// 报溢单、获赠单
				if ( this.specialproperty == "BYD" ){
					this.cols = 18;	//商品录入 不含税

					this.LocalUpdateCol[0] = 1;	// 局部更新列
					this.LocalUpdateCol[1] = 2;	// 局部更新列

					this.HiddenArray[0] = "isUnitTow";
					this.HiddenArray[1] = "0";
					this.HiddenArray[2] = "UnitRate";
					this.HiddenArray[3] = "1";
					this.HiddenArray[4] = "IfSerial";
					this.HiddenArray[5] = "0";
					this.HiddenArray[6] = "SerialIn";	// 所有入库序列号字串
					this.HiddenArray[7] = "";		// 默认为空，各序列号以逗号 ( я ) 分隔
					this.HiddenArray[8] = "UnitOne";	//小单位
					this.HiddenArray[9] = "";		// 默认为空
					this.HiddenArray[10] = "UnitTwo";	// 大单位
					this.HiddenArray[11] = "";		// 默认为空
					this.HiddenArray[12] = "InputCostPrice";	// 成本单价
					this.HiddenArray[13] = "0";		// 默认为0
					this.HiddenArray[14] = "GoodsNumberPrice";	// 库存批次成本价
					this.HiddenArray[15] = "-1";		// 默认未-1
					this.HiddenArray[16] = "HandZeroCost";	// 0成本出入库专用
					this.HiddenArray[17] = "0";		// 默认为0


					// 鼠标双击列
					this.MouseDbClickCols[0] = 3;
					this.MouseDbClickCols[1] = 17;

					this.Title[0] = "No.";
					this.Title[1] = "商品编号";
					this.Title[2] = "商品全名";
					this.Title[3] = "单位";
					this.Title[4] = "条形码";
					this.Title[5] = "规格";
					this.Title[6] = "型号";
					this.Title[7] = "产地";
					this.Title[8] = "生产日期";
					this.Title[9] = "效期至";
					this.Title[10] = "批号";
					this.Title[11] = "数量";
					this.Title[12]  = "单位关系";
					this.Title[13] = "辅助单位";
					this.Title[14] = "成本单价";
					this.Title[15] = "成本金额";
					this.Title[16] = "备注";
					this.Title[17] = "序列号"


					this.SumCols[0] = 11;
					this.SumCols[1] = 15;

					this.FormatSumCols[0] = 11;
					this.FormatSumCols[1] = 1;
					this.FormatSumCols[2] = 15;
					this.FormatSumCols[3] = 2;


					this.NumericCols[0] = 11;
					this.NumericCols[1] = 14;
					this.NumericCols[2] = 15;
				
					this.ResultCols[0] = ";";
					this.ResultCols[1] = 11;
					this.ResultCols[2] = "*";
					this.ResultCols[3] = 14;
					this.ResultCols[4] = "=";
					this.ResultCols[5] = 15;
					this.ResultCols[6] = ";";

					this.FormatCols[0] = 11;
					this.FormatCols[1] = 1;	// 第一种格式(小数保留4位)
					this.FormatCols[2] = 14;
					this.FormatCols[3] = 1;	// 第一种格式(小数保留4位)
					this.FormatCols[4] = 15;
					this.FormatCols[5] = 2;	// 第二种格式(小数保留2位)

					if ( this.Disable ) {
						this.DisableCols[0] = 1;
						this.DisableCols[1] = 2;
						this.DisableCols[2] = 3;
						this.DisableCols[3] = 4;
						this.DisableCols[4] = 5;
						this.DisableCols[5] = 6;
						this.DisableCols[6] = 7;
						this.DisableCols[7] = 8;
						this.DisableCols[8] = 9;
						this.DisableCols[9] = 10;
						this.DisableCols[10]	= 11;
						this.DisableCols[11]	= 12;
						this.DisableCols[12]	= 13;
						this.DisableCols[13]	= 14;
						this.DisableCols[14]	= 15;
						this.DisableCols[15]	= 16;
						this.DisableCols[16]	= 17;
					}
					else {
						this.DisableCols[0] = 3;
						this.DisableCols[1] = 4;
						this.DisableCols[2] = 5;
						this.DisableCols[3] = 6;
						this.DisableCols[4] = 7;
						this.DisableCols[5] = 12;
						this.DisableCols[6] = 13;
						this.DisableCols[7] = 14;
						this.DisableCols[8] = 15;
					}

					this.ColWidth[0]	= 25;
					this.ColWidth[1]	= 100;
					this.ColWidth[2]	= 150;
					this.ColWidth[3]	= 40;
					this.ColWidth[4]	= 100;
					this.ColWidth[5]	= 80;
					this.ColWidth[6]	= 80;
					this.ColWidth[7]	= 100;
					this.ColWidth[8]	= 80;
					this.ColWidth[9]	= 80;
					this.ColWidth[10]	= 80;
					this.ColWidth[11]	= 80;
					this.ColWidth[12]	= 80;
					this.ColWidth[13]	= 100;
					this.ColWidth[14]	= 80;
					this.ColWidth[15]	= 80;
					this.ColWidth[16]	= 100;
					this.ColWidth[17]	= 100;


					this.ColEditName[0]	= "";
					this.ColEditName[1]	= "UserCode_Edit";
					this.ColEditName[2]	= "FullName_Edit";
					this.ColEditName[3]	= "Unit_Edit";
					this.ColEditName[4]	= "EntryCode_Edit";
					this.ColEditName[5]	= "Standard_Edit";
					this.ColEditName[6]	= "Type_Edit";
					this.ColEditName[7]	= "Area_Edit";
					this.ColEditName[8]	= "ProduceDate_Edit";
					this.ColEditName[9] = "ValidDate_Edit";
					this.ColEditName[10]	= "GoodsNumber_Edit";
					this.ColEditName[11]	= "Qty_Edit";
					this.ColEditName[12]	= "UnitRate_Edit";
					this.ColEditName[13]	= "AssistantUnit_Edit";
					this.ColEditName[14]	= "Price_Edit";
					this.ColEditName[15]	= "Total_Edit";
					this.ColEditName[16]	= "Base_Edit";
					this.ColEditName[17]	= "Serial_Edit";

					this.SumRow = "<tr class=\"ClientTablesum\" id=\"SumRow\" height=\"20px\"><td>合计</td>";strColsDisplay = 1;
				
				
					for ( i = 1; i < this.cols; i++ ) {
						// Judge If Display The Grid Cols
						for ( j = 1; j < this.HiddenColsArray.length; j++ ) {
							if ( this.HiddenColsArray[j] == this.ColEditName[i] ) {
								strColsDisplay = 0;
								break;
							}
							else
								strColsDisplay = 1;
							
						}
						for ( j = 0; j < this.SumCols.length; j++ ) {
							if ( i == parseInt(this.SumCols[j]) ) {
								strSumValueDisplay = "<span id=\"" + this.name + "Total" + this.SumCols[j] + "\" style=\"color:#000000\">&nbsp;0</span>";break;
							}
							else
								strSumValueDisplay = "&nbsp;";
						}
						if ( strColsDisplay == 1 ) {
							this.SumRow = this.SumRow + "<td>" + strSumValueDisplay + "</td>";
						}
						else{
							this.SumRow = this.SumRow + "<td style='display:none'>" + strSumValueDisplay + "</td>";
						}
					}

					if ( !this.Disable ) {	// 删除列所占用的单元格
						this.SumRow = this.SumRow + "<td>&nbsp;</td>";
					}
					this.SumRow = this.SumRow + "</tr>";

					//if ( !this.Disable )
					//	this.SumRow="<tr class=ClientTablesum id=SumRow height=20px><td colspan=4>&nbsp;合计</td><td><span id="+this.name+"Total4 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td>&nbsp;</td></tr>";
					//else
					//	this.SumRow="<tr class=ClientTablesum id=SumRow height=20px><td colspan=4>&nbsp;合计</td><td><span id="+this.name+"Total4 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td></tr>";

				}
				else{ //获赠单
					this.cols = 16;	//商品录入 不含税

					this.LocalUpdateCol[0] = 1;	// 局部更新列
					this.LocalUpdateCol[1] = 2;	// 局部更新列

					this.HiddenArray[0] = "isUnitTow";
					this.HiddenArray[1] = "0";
					this.HiddenArray[2] = "UnitRate";
					this.HiddenArray[3] = "1";
					this.HiddenArray[4] = "IfSerial";
					this.HiddenArray[5] = "0";
					this.HiddenArray[6] = "SerialIn";	// 所有入库序列号字串
					this.HiddenArray[7] = "";		// 默认为空，各序列号以逗号 ( я ) 分隔
					this.HiddenArray[8] = "UnitOne";	//小单位
					this.HiddenArray[9] = "";		// 默认为空
					this.HiddenArray[10] = "UnitTwo";	// 大单位
					this.HiddenArray[11] = "";		// 默认为空
					this.HiddenArray[12] = "InputCostPrice";	// 成本单价
					this.HiddenArray[13] = "0";		// 默认为0
					this.HiddenArray[14] = "GoodsNumberPrice";	// 库存批次成本价
					this.HiddenArray[15] = "-1";		// 默认未-1
					this.HiddenArray[16] = "HandZeroCost";	// 0成本出入库专用
					this.HiddenArray[17] = "0";		// 默认为0


					// 鼠标双击列
					this.MouseDbClickCols[0] = 3;
					this.MouseDbClickCols[1] = 15;

					this.Title[0] = "No.";
					this.Title[1] = "商品编号";
					this.Title[2] = "商品全名";
					this.Title[3] = "单位";
					this.Title[4] = "条形码";
					this.Title[5] = "规格";
					this.Title[6] = "型号";
					this.Title[7] = "产地";
					this.Title[8] = "生产日期";
					this.Title[9] = "效期至";
					this.Title[10] = "批号";
					this.Title[11] = "数量";
					this.Title[12]  = "单位关系";
					this.Title[13] = "辅助单位";
					this.Title[14] = "备注";
					this.Title[15] = "序列号"


					this.SumCols[0] = 11;

					this.FormatSumCols[0] = 11;
					this.FormatSumCols[1] = 1;

					this.NumericCols[0] = 11;
				

					this.FormatCols[0] = 11;
					this.FormatCols[1] = 1;	// 第一种格式(小数保留4位)

					if ( this.Disable ) {
						this.DisableCols[0] = 1;
						this.DisableCols[1] = 2;
						this.DisableCols[2] = 3;
						this.DisableCols[3] = 4;
						this.DisableCols[4] = 5;
						this.DisableCols[5] = 6;
						this.DisableCols[6] = 7;
						this.DisableCols[7] = 8;
						this.DisableCols[8] = 9;
						this.DisableCols[9] = 10;
						this.DisableCols[10]	= 11;
						this.DisableCols[11]	= 12;
						this.DisableCols[12]	= 13;
						this.DisableCols[13]	= 14;
						this.DisableCols[14]	= 15;
					}
					else {
						this.DisableCols[0] = 3;
						this.DisableCols[1] = 4;
						this.DisableCols[2] = 5;
						this.DisableCols[3] = 6;
						this.DisableCols[4] = 7;
						this.DisableCols[5] = 12;
						this.DisableCols[6] = 13;
					}

					this.ColWidth[0]	= 25;
					this.ColWidth[1]	= 100;
					this.ColWidth[2]	= 150;
					this.ColWidth[3]	= 40;
					this.ColWidth[4]	= 100;
					this.ColWidth[5]	= 80;
					this.ColWidth[6]	= 80;
					this.ColWidth[7]	= 100;
					this.ColWidth[8]	= 80;
					this.ColWidth[9]	= 80;
					this.ColWidth[10]	= 80;
					this.ColWidth[11]	= 80;
					this.ColWidth[12]	= 80;
					this.ColWidth[13]	= 100;
					this.ColWidth[14]	= 100;
					this.ColWidth[15]	= 100;


					this.ColEditName[0]	= "";
					this.ColEditName[1]	= "UserCode_Edit";
					this.ColEditName[2]	= "FullName_Edit";
					this.ColEditName[3]	= "Unit_Edit";
					this.ColEditName[4]	= "EntryCode_Edit";
					this.ColEditName[5]	= "Standard_Edit";
					this.ColEditName[6]	= "Type_Edit";
					this.ColEditName[7]	= "Area_Edit";
					this.ColEditName[8]	= "ProduceDate_Edit";
					this.ColEditName[9]	= "ValidDate_Edit";
					this.ColEditName[10]= "GoodsNumber_Edit";
					this.ColEditName[11]= "Qty_Edit";
					this.ColEditName[12] = "UnitRate_Edit";
					this.ColEditName[13] = "AssistantUnit_Edit";
					this.ColEditName[14] = "Base_Edit";
					this.ColEditName[15] = "Serial_Edit";

					this.SumRow = "<tr class=\"ClientTablesum\" id=\"SumRow\" height=\"20px\"><td>合计</td>";strColsDisplay = 1;
				
				
					for ( i = 1; i < this.cols; i++ ) {
						// Judge If Display The Grid Cols
						for ( j = 1; j < this.HiddenColsArray.length; j++ ) {
							if ( this.HiddenColsArray[j] == this.ColEditName[i] ) {
								strColsDisplay = 0;
								break;
							}
							else
								strColsDisplay = 1;
							
						}
						for ( j = 0; j < this.SumCols.length; j++ ) {
							if ( i == parseInt(this.SumCols[j]) ) {
								strSumValueDisplay = "<span id=\"" + this.name + "Total" + this.SumCols[j] + "\" style=\"color:#000000\">&nbsp;0</span>";break;
							}
							else
								strSumValueDisplay = "&nbsp;";
						}
						if ( strColsDisplay == 1 ) {
							this.SumRow = this.SumRow + "<td>" + strSumValueDisplay + "</td>";
						}
						else{
							this.SumRow = this.SumRow + "<td style='display:none'>" + strSumValueDisplay + "</td>";
						}
					}

					if ( !this.Disable ) {	// 删除列所占用的单元格
						this.SumRow = this.SumRow + "<td>&nbsp;</td>";
					}
					this.SumRow = this.SumRow + "</tr>";

					//if ( !this.Disable )
					//	this.SumRow="<tr class=ClientTablesum id=SumRow height=20px><td colspan=4>&nbsp;合计</td><td><span id="+this.name+"Total4 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td>&nbsp;</td></tr>";
					//else
					//	this.SumRow="<tr class=ClientTablesum id=SumRow height=20px><td colspan=4>&nbsp;合计</td><td><span id="+this.name+"Total4 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td></tr>";
				}
				break;

			case 5:		// 收款单
				this.cols = 5;

				// 局部更新列
				this.LocalUpdateCol[0] = 1;	// 编号
				this.LocalUpdateCol[1] = 2;	// 全名

				this.HiddenArray[0] = "isUnitTow";
				this.HiddenArray[1] = "0";
				this.HiddenArray[2] = "UnitRate";
				this.HiddenArray[3] = "1";

				this.Title[0]	= "No.";
				this.Title[1]	= "账户编号";
				this.Title[2]	= "账户全名";
				this.Title[3]	= "金额";
				this.Title[4]	= "备注";

				this.SumCols[0] = 3;

				this.FormatSumCols[0] = 3;
				this.FormatSumCols[1] = 2;

				this.NumericCols[0] = 3;

				this.FormatCols[0] = 3;
				this.FormatCols[1] = 2;		// 第二种格式 ( 小数保留 2 位 )

				if ( this.Disable ) {
					this.DisableCols[0]	= 1;
					this.DisableCols[1]	= 2;
					this.DisableCols[2]	= 3;
					this.DisableCols[3]	= 4;
				}

				this.ColWidth[0]	= 25;
				this.ColWidth[1]	= 100;
				this.ColWidth[2]	= 200;
				this.ColWidth[3]	= 100;
				this.ColWidth[4]	= 150;

				this.ColEditName[0]	= "";
				this.ColEditName[1]	= "UserCode_Edit";
				this.ColEditName[2]	= "FullName_Edit";
				this.ColEditName[3]	= "Total_Edit";
				this.ColEditName[4]	= "Base_Edit";

				if ( !this.Disable )
					this.SumRow = "<tr class=ClientTablesum id=SumRow height=20px><td>合计</td><td></td><td></td><td><span id="+this.name+"Total3 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td>&nbsp;</td></tr>";
				else
					this.SumRow = "<tr class=ClientTablesum id=SumRow height=20px><td>合计</td><td></td><td></td><td><span id="+this.name+"Total3 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td></tr>";

				break;
/////////////////////////////////////////////////////////////////尹毅 准备改动
			case 6:		// 商品拆装单 - 出库
				this.cols = 16;		//**

				this.LocalUpdateCol[0] = 1;	// 局部更新列
				this.LocalUpdateCol[1] = 2;	// 局部更新列
				this.LocalUpdateCol[2] = 3;	// 局部更新列

				this.HiddenArray[0] = "isUnitTow";
				this.HiddenArray[1] = "0";
				this.HiddenArray[2] = "UnitRate";
				this.HiddenArray[3] = "1";
				this.HiddenArray[4] = "OIfSerial";
				this.HiddenArray[5] = "0";
				this.HiddenArray[6] = "SerialOut";	// 所有出库序列号字串
				this.HiddenArray[7] = "";		// 默认为空，各序列号以逗号 ( я ) 分隔
				this.HiddenArray[8] = "InputCostPrice";	// 成本单价
				this.HiddenArray[9] = "0";		// 默认为0
				this.HiddenArray[10] = "OGoodsNumberPrice";	// 批次单价
				this.HiddenArray[11] = "-1";		// 默认未-1
				this.HiddenArray[12] = "OHandZeroCost";	// 0成本出入库专用
				this.HiddenArray[13] = "0";		// 默认未0

				// 鼠标双击列
				this.MouseDbClickCols[0] = 1;
				this.MouseDbClickCols[1] = 12;

				// 初始化表头
				this.Title[0]	= "No.";
				this.Title[1]	= "序列号";
				this.Title[2]	= "商品编号";
				this.Title[3]	= "商品全名";
				this.Title[4]   = "单位";			//**
				this.Title[5]	= "条形码";
				this.Title[6]	= "规格";
				this.Title[7]	= "型号";
				this.Title[8]	= "产地";
				this.Title[9]	= "生产日期";
				this.Title[10]	= "效期至";
				this.Title[11]	= "批号";
				this.Title[12]	= "出库数量";
				this.Title[13]	= "成本单价";
				this.Title[14]	= "成本金额";
				this.Title[15]	= "备注";

				this.SumCols[0] = 12;
				this.SumCols[1] = 14;

				this.FormatSumCols[0] = 12;
				this.FormatSumCols[1] = 1;
				this.FormatSumCols[2] = 14;
				this.FormatSumCols[3] = 2;

				this.NumericCols[0] = 12;
				this.NumericCols[1] = 13;
				this.NumericCols[2] = 14;

				this.FormatCols[0] = 12;
				this.FormatCols[1] = 1;		// 第一种格式(小数保留4位)
				this.FormatCols[2] = 13;
				this.FormatCols[3] = 1;		// 第一种格式(小数保留4位)
				this.FormatCols[4] = 14;
				this.FormatCols[5] = 2;		// 第二种格式(小数保留2位)

				this.ResultCols[0] = ";";
				this.ResultCols[1] = 12;
				this.ResultCols[2] = "*";
				this.ResultCols[3] = 13;
				this.ResultCols[4] = "=";
				this.ResultCols[5] = 14;
				this.ResultCols[6] = ";";

				if ( this.Disable ) {
					this.DisableCols[0]	= 1;
					this.DisableCols[1]	= 2;
					this.DisableCols[2]	= 3;
					this.DisableCols[3]	= 4;
					this.DisableCols[4]	= 5;
					this.DisableCols[5]	= 6;
					this.DisableCols[6]	= 7;
					this.DisableCols[7]	= 8;
					this.DisableCols[8]	= 9;
					this.DisableCols[9]	= 10;
					this.DisableCols[10]= 11;	
					this.DisableCols[11] =12;			//**
					this.DisableCols[12]= 13;
					this.DisableCols[13]= 14;
					this.DisableCols[14]= 15;
				}
				else {
					this.DisableCols[0]	= 4;
					this.DisableCols[1]	= 5;
					this.DisableCols[2]	= 6;
					this.DisableCols[3]	= 7;	
					this.DisableCols[4]	= 8;				
					this.DisableCols[5]	= 9;
					this.DisableCols[6]	= 10;
					this.DisableCols[7]	= 11;
					this.DisableCols[8]	= 13;
					this.DisableCols[9]	= 14;
				}

				this.ColWidth[0]	= 25;
				this.ColWidth[1]	= 100;
				this.ColWidth[2]	= 100;
				this.ColWidth[3]	= 150;
				this.ColWidth[4]	= 40;				//**
				this.ColWidth[5]	= 100;
				this.ColWidth[6]	= 80;
				this.ColWidth[7]	= 80;
				this.ColWidth[8]	= 100;
				this.ColWidth[9]	= 80;
				this.ColWidth[10]	= 80;
				this.ColWidth[11]	= 80;
				this.ColWidth[12]	= 80;
				this.ColWidth[13]	= 80;
				this.ColWidth[14]	= 80;
				this.ColWidth[15]	= 100;
				

				this.ColEditName[0]	= "";
				this.ColEditName[1]	= "SerialSel_Edit";
				this.ColEditName[2]	= "OUserCode_Edit";
				this.ColEditName[3]	= "OFullName_Edit";
				this.ColEditName[4]	= "OUnit_Edit";			//**
				this.ColEditName[5]	= "OEntryCode_Edit";
				this.ColEditName[6]	= "OStandard_Edit";
				this.ColEditName[7]	= "OType_Edit";
				this.ColEditName[8]	= "OArea_Edit";
				this.ColEditName[9]	= "OProduceDate_Edit";
				this.ColEditName[10]	= "OValidDate_Edit";
				this.ColEditName[11]	= "OGoodsNumber_Edit";
				this.ColEditName[12]	= "OQty_Edit";
				this.ColEditName[13]	= "OPrice_Edit";
				this.ColEditName[14]	= "OTotal_Edit";
				this.ColEditName[15]	= "OBase_Edit";
				

				this.SumRow = "<tr class=\"ClientTablesum\" id=\"SumRow\" height=\"20px\"><td>合计</td>";strColsDisplay = 1;
				
				for ( i = 1; i < this.cols; i++ ) {
					// Judge If Display The Grid Cols
					for ( j = 1; j < this.HiddenColsArray.length; j++ ) {
						if ( this.HiddenColsArray[j] == this.ColEditName[i] ) {
							strColsDisplay = 0;
							break;
						}
						else
							strColsDisplay = 1;
						
					}
					for ( j = 0; j < this.SumCols.length; j++ ) {
						if ( i == parseInt(this.SumCols[j]) ) {
							strSumValueDisplay = "<span id=\"" + this.name + "Total" + this.SumCols[j] + "\" style=\"color:#000000\">&nbsp;0</span>";break;
						}
						else
							strSumValueDisplay = "&nbsp;";
					}
					if ( strColsDisplay == 1 ) {
						this.SumRow = this.SumRow + "<td>" + strSumValueDisplay + "</td>";
					}
					else{
						this.SumRow = this.SumRow + "<td style='display:none'>" + strSumValueDisplay + "</td>";
					}
				}

				if ( !this.Disable ) {	// 删除列所占用的单元格
					this.SumRow = this.SumRow + "<td>&nbsp;</td>";
				}
				this.SumRow = this.SumRow + "</tr>";

				//if ( !this.Disable )
				//	this.SumRow="<tr class=ClientTablesum id=SumRow height=20px><td>合计</td><td></td><td></td><td><span id="+this.name+"Total3 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td><span id="+this.name+"Total5 style='color:#000000'>&nbsp;0</span><td>&nbsp;</td><td>&nbsp;</td></tr>";
				//else
				//	this.SumRow="<tr class=ClientTablesum id=SumRow height=20px><td>合计</td><td></td><td></td><td><span id="+this.name+"Total3 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td><span id="+this.name+"Total5 style='color:#000000'>&nbsp;0</span><td>&nbsp;</td></tr>";

				break;
			case 7:		// 商品拆装单 - 入库
				this.cols = 16;

				this.LocalUpdateCol[0] = 1;	// 局部更新列
				this.LocalUpdateCol[1] = 2;	// 局部更新列

				this.HiddenArray[0] = "isUnitTow";
				this.HiddenArray[1] = "0";
				this.HiddenArray[2] = "UnitRate";
				this.HiddenArray[3] = "1";
				this.HiddenArray[4] = "IIfSerial";
				this.HiddenArray[5] = "0";
				this.HiddenArray[6] = "SerialIn";	// 所有入库序列号字串
				this.HiddenArray[7] = "";		// 默认为空，各序列号以逗号 ( я ) 分隔
				this.HiddenArray[8] = "IGoodsNumberPrice";	//批次单价
				this.HiddenArray[9] = "-1";		// 默认未-1
				this.HiddenArray[10] = "IHandZeroCost";	// 0成本出入库专用
				this.HiddenArray[11] = "0";		// 默认未0
				
				
				// 鼠标双击列
				this.MouseDbClickCols[0] = 15;

				this.Title[0]	= "No.";
				this.Title[1]	= "商品编号";
				this.Title[2]	= "商品全名";
				this.Title[3]	= "单位";
				this.Title[4]	= "条形码";
				this.Title[5]	= "规格";
				this.Title[6]	= "型号";
				this.Title[7]	= "产地";
				this.Title[8]	= "生产日期";
				this.Title[9]	= "效期至";
				this.Title[10]	= "批号";
				this.Title[11]	= "入库数量";
				this.Title[12]	= "成本单价";
				this.Title[13]	= "成本金额";
				this.Title[14]	= "备注";
				this.Title[15]	= "序列号";

				this.SumCols[0] = 11;
				this.SumCols[1] = 13;

				this.FormatSumCols[0] = 11;
				this.FormatSumCols[1] = 1;
				this.FormatSumCols[2] = 13;
				this.FormatSumCols[3] = 2;

				this.NumericCols[0] = 11;
				this.NumericCols[1] = 12;
				this.NumericCols[2] = 13;

				this.FormatCols[0] = 11;
				this.FormatCols[1] = 1;		// 第一种格式(小数保留4位)
				this.FormatCols[2] = 12;
				this.FormatCols[3] = 1;		// 第一种格式(小数保留4位)
				this.FormatCols[4] = 13;
				this.FormatCols[5] = 2;		// 第二种格式(小数保留2位)

				this.ResultCols[0] = ";";
				this.ResultCols[1] = 11;
				this.ResultCols[2] = "*";
				this.ResultCols[3] = 12;
				this.ResultCols[4] = "=";
				this.ResultCols[5] = 13;
				this.ResultCols[6] = ";";

				if ( this.Disable ) {
					this.DisableCols[0]	= 1;
					this.DisableCols[1]	= 2;
					this.DisableCols[2]	= 3;
					this.DisableCols[3]	= 4;
					this.DisableCols[4]	= 5;
					this.DisableCols[5]	= 6;
					this.DisableCols[6]	= 7;
					this.DisableCols[7]	= 8;
					this.DisableCols[8]	= 9;
					this.DisableCols[9]	= 10;
					this.DisableCols[10]	= 11;
					this.DisableCols[11]	= 12;
					this.DisableCols[12]	= 13;
					this.DisableCols[13]	= 14;
					this.DisableCols[14]	= 15;
				}
				else {
					this.DisableCols[0]	= 3;
					this.DisableCols[1]	= 4;
					this.DisableCols[2]	= 5;
					this.DisableCols[3]	= 6;
					this.DisableCols[4]	= 7;					
					this.DisableCols[5]	= 13;
				}

				this.ColWidth[0]	= 25;
				this.ColWidth[1]	= 100;
				this.ColWidth[2]	= 150;
				this.ColWidth[3]	= 40;
				this.ColWidth[4]	= 100;
				this.ColWidth[5]	= 80;
				this.ColWidth[6]	= 80;
				this.ColWidth[7]	= 100;
				this.ColWidth[8]	= 80;
				this.ColWidth[9]	= 80;
				this.ColWidth[10]	= 80;
				this.ColWidth[11]	= 80;
				this.ColWidth[12]	= 80;
				this.ColWidth[13]	= 80;
				this.ColWidth[14]	= 100;
				this.ColWidth[15]	= 100;

				this.ColEditName[0]	= "";
				this.ColEditName[1]	= "IUserCode_Edit";
				this.ColEditName[2]	= "IFullName_Edit";
				this.ColEditName[3]	= "IUnit_Edit";			//**
				this.ColEditName[4]	= "IEntryCode_Edit";
				this.ColEditName[5]	= "IStandard_Edit";
				this.ColEditName[6]	= "IType_Edit";
				this.ColEditName[7]	= "IArea_Edit";
				this.ColEditName[8]	= "IProduceDate_Edit";
				this.ColEditName[9]	= "IValidDate_Edit";
				this.ColEditName[10]	= "IGoodsNumber_Edit";
				this.ColEditName[11]	= "IQty_Edit";
				this.ColEditName[12]	= "IPrice_Edit";
				this.ColEditName[13]	= "ITotal_Edit";
				this.ColEditName[14]	= "IBase_Edit";
				this.ColEditName[15]	= "Serial_Edit";

				this.SumRow = "<tr class=\"ClientTablesum\" id=\"SumRow\" height=\"20px\"><td>合计</td>";strColsDisplay = 1;
				
				
				for ( i = 1; i < this.cols; i++ ) {
					// Judge If Display The Grid Cols
					for ( j = 1; j < this.HiddenColsArray.length; j++ ) {
						if ( this.HiddenColsArray[j] == this.ColEditName[i] ) {
							strColsDisplay = 0;
							break;
						}
						else
							strColsDisplay = 1;
						
					}
					for ( j = 0; j < this.SumCols.length; j++ ) {
						if ( i == parseInt(this.SumCols[j]) ) {
							strSumValueDisplay = "<span id=\"" + this.name + "Total" + this.SumCols[j] + "\" style=\"color:#000000\">&nbsp;0</span>";break;
						}
						else
							strSumValueDisplay = "&nbsp;";
					}
					if ( strColsDisplay == 1 ) {
						this.SumRow = this.SumRow + "<td>" + strSumValueDisplay + "</td>";
					}
					else{
						this.SumRow = this.SumRow + "<td style='display:none'>" + strSumValueDisplay + "</td>";
					}
				}

				if ( !this.Disable ) {	// 删除列所占用的单元格
					this.SumRow = this.SumRow + "<td>&nbsp;</td>";
				}
				this.SumRow = this.SumRow + "</tr>";

				//if ( !this.Disable )
				//	this.SumRow="<tr class=ClientTablesum id=SumRow height=20px><td>合计</td><td></td><td></td><td><span id="+this.name+"Total3 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td><span id="+this.name+"Total5 style='color:#000000'>&nbsp;0</span><td>&nbsp;</td><td>&nbsp;</td></tr>";
				//else
				//	this.SumRow="<tr class=ClientTablesum id=SumRow height=20px><td>合计</td><td></td><td></td><td><span id="+this.name+"Total3 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td><span id="+this.name+"Total5 style='color:#000000'>&nbsp;0</span><td>&nbsp;</td></tr>";

				break;
			case 8:		// 调账单
				this.cols = 5;

				this.LocalUpdateCol[0] = 1;	// 局部更新列
				this.LocalUpdateCol[1] = 2;	// 局部更新列

				this.HiddenArray[0] = "isUnitTow";
				this.HiddenArray[1] = "0";
				this.HiddenArray[2] = "UnitRate";
				this.HiddenArray[3] = "1";

				this.Title[0] = "No.";
				this.Title[1] = "单位编号";
				this.Title[2] = "单位全名";
				this.Title[3] = "金额";
				this.Title[4] = "备注";

				this.SumCols[0] = 3;

				this.FormatSumCols[0] = 3;
				this.FormatSumCols[1] = 2;

				this.NumericCols[0] = 3;

				this.FormatCols[0] = 3;
				this.FormatCols[1] = 2;		// 第二种格式 ( 小数保留 2 位 )

				if ( this.Disable ) {
					this.DisableCols[0] = 1;
					this.DisableCols[1] = 2;
					this.DisableCols[2] = 3;
					this.DisableCols[3] = 4;
				}

				this.ColWidth[0] = 25;
				this.ColWidth[1] = 100;
				this.ColWidth[2] = 200;
				this.ColWidth[3] = 80;
				this.ColWidth[4] = 250;

				this.ColEditName[0] = "";
				this.ColEditName[1] = "UserCode_Edit";
				this.ColEditName[2] = "FullName_Edit";
				this.ColEditName[3] = "Total_Edit";
				this.ColEditName[4] = "Base_Edit";

				if ( !this.Disable )
					this.SumRow = "<tr class=ClientTablesum id=SumRow height=20px><td>合计</td><td></td><td></td><td><span id="+this.name+"Total3 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td>&nbsp;</td></tr>";
				else
					this.SumRow = "<tr class=ClientTablesum id=SumRow height=20px><td>合计</td><td></td><td></td><td><span id="+this.name+"Total3 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td></tr>";

				break;

			case 9:		// 其他收款单
				this.cols = 5;

				this.LocalUpdateCol[0] = 1;	// 局部更新列
				this.LocalUpdateCol[1] = 2;	// 局部更新列

				this.HiddenArray[0] = "isUnitTow";
				this.HiddenArray[1] = "0";
				this.HiddenArray[2] = "UnitRate";
				this.HiddenArray[3] = "1";

				this.Title[0] = "No.";
				this.Title[1] = "收入项目编号";
				this.Title[2] = "收入项目全名";
				this.Title[3] = "金额";
				this.Title[4] = "备注";

				this.SumCols[0] = 3;

				this.FormatSumCols[0] = 3;
				this.FormatSumCols[1] = 2;

				this.NumericCols[0] = 3;

				this.FormatCols[0] = 3;
				this.FormatCols[1] = 2;		// 第二种格式 ( 小数保留 2 位 )

				if ( this.Disable ) {
					this.DisableCols[0] = 1;
					this.DisableCols[1] = 2;
					this.DisableCols[2] = 3;
					this.DisableCols[3] = 4;
				}

				this.ColWidth[0]  = 25;
				this.ColWidth[1] = 100;
				this.ColWidth[2] = 200;
				this.ColWidth[3] = 80;
				this.ColWidth[4] = 250;

				this.ColEditName[0] = "";
				this.ColEditName[1] = "UserCode_Edit";
				this.ColEditName[2] = "FullName_Edit";
				this.ColEditName[3] = "Total_Edit";
				this.ColEditName[4] = "Base_Edit";

				if ( !this.Disable )
					this.SumRow = "<tr class=ClientTablesum id=SumRow height=20px><td>合计</td><td></td><td></td><td><span id="+this.name+"Total3 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td>&nbsp;</td></tr>";
				else
					this.SumRow = "<tr class=ClientTablesum id=SumRow height=20px><td>合计</td><td></td><td></td><td><span id="+this.name+"Total3 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td></tr>";

				break;

			case 10:	// 费用单
				this.cols = 5;

				this.LocalUpdateCol[0] = 1;	// 局部更新列
				this.LocalUpdateCol[1] = 2;	// 局部更新列

				this.HiddenArray[0] = "isUnitTow";
				this.HiddenArray[1] = "0";
				this.HiddenArray[2] = "UnitRate";
				this.HiddenArray[3] = "1";

				this.Title[0] = "No.";
				this.Title[1] = "费用项目编号";
				this.Title[2] = "费用项目全名";
				this.Title[3] = "金额";
				this.Title[4] = "备注";

				this.SumCols[0] = 3;

				this.FormatSumCols[0] = 3;

				this.FormatSumCols[1] = 2;

				this.NumericCols[0] = 3;

				this.FormatCols[0] = 3;
				this.FormatCols[1] = 2;		// 第二种格式 ( 小数保留 2 位 )

				if ( this.Disable ) {
					this.DisableCols[0] = 1;
					this.DisableCols[1] = 2;
					this.DisableCols[2] = 3;
					this.DisableCols[3] = 4;
				}

				this.ColWidth[0] = 25;
				this.ColWidth[1] = 100;
				this.ColWidth[2] = 200;
				this.ColWidth[3] = 80;
				this.ColWidth[4] = 250;

				this.ColEditName[0] = "";
				this.ColEditName[1] = "UserCode_Edit";
				this.ColEditName[2] = "FullName_Edit";
				this.ColEditName[3] = "Total_Edit";
				this.ColEditName[4] = "Base_Edit";

				if ( !this.Disable )
					this.SumRow = "<tr class=ClientTablesum id=SumRow height=20px><td>合计</td><td></td><td></td><td><span id="+this.name+"Total3 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td>&nbsp;</td></tr>";
				else
					this.SumRow = "<tr class=ClientTablesum id=SumRow height=20px><td>合计</td><td></td><td></td><td><span id="+this.name+"Total3 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td></tr>";

				break;
	
			case 11:	// 转款单
				this.cols = 5;

				this.LocalUpdateCol[0] = 1;	// 局部更新列
				this.LocalUpdateCol[1] = 2;	// 局部更新列

				this.HiddenArray[0] = "isUnitTow";
				this.HiddenArray[1] = "0";
				this.HiddenArray[2] = "UnitRate";
				this.HiddenArray[3] = "1";

				this.Title[0] = "No.";
				this.Title[1] = "收款账户编号";
				this.Title[2] = "收款账户全名";
				this.Title[3] = "金额";
				this.Title[4] = "备注";

				this.SumCols[0] = 3;

				this.FormatSumCols[0] = 3;
				this.FormatSumCols[1] = 2;

				this.NumericCols[0] = 3;

				this.FormatCols[0] = 3;
				this.FormatCols[1] = 2;		// 第二种格式 ( 小数保留 2 位 )

				if ( this.Disable ) {
					this.DisableCols[0] = 1;
					this.DisableCols[1] = 2;
					this.DisableCols[2] = 3;
					this.DisableCols[3] = 4;
				}

				this.ColWidth[0] = 25;
				this.ColWidth[1] = 100;
				this.ColWidth[2] = 200;
				this.ColWidth[3] = 80;
				this.ColWidth[4] = 250;

				this.ColEditName[0] = "";
				this.ColEditName[1] = "UserCode_Edit";
				this.ColEditName[2] = "FullName_Edit";
				this.ColEditName[3] = "Total_Edit";
				this.ColEditName[4] = "Base_Edit";

				if ( !this.Disable )
					this.SumRow = "<tr class=ClientTablesum id=SumRow height=20px><td>合计</td><td></td><td></td><td><span id="+this.name+"Total3 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td>&nbsp;</td></tr>";
				else
					this.SumRow = "<tr class=ClientTablesum id=SumRow height=20px><td>合计</td><td></td><td></td><td><span id="+this.name+"Total3 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td></tr>";

				break;

			case 12:	// 进货单
				this.cols = 23;		// 商品录入 含税

				this.LocalUpdateCol[0] = 1;	// 局部更新列
				this.LocalUpdateCol[1] = 2;	// 局部更新列

				// 每行隐含域名、值数组
				this.HiddenArray[0] = "OrderId";	// 订单 ID 值
				this.HiddenArray[1] = "-1";		// 初始值
				this.HiddenArray[2] = "isUnitTow";	// 该行是否双单位
				this.HiddenArray[3] = "0";		// 默认不是双单位
				this.HiddenArray[4] = "UnitRate";	// 双单位换算关系
				this.HiddenArray[5] = "1";		// 默认换算关系为 1
				this.HiddenArray[6] = "IfSerial"	// 是否采用序列号强制管理
				this.HiddenArray[7] = "0";		// 默认为 0 ；0：非序列号强制管理；1：序列号强制管理
				this.HiddenArray[8] = "SerialIn";	// 所有入库序列号字串
				this.HiddenArray[9] = "";		// 默认为空，各序列号以逗号 ( я ) 分隔
				this.HiddenArray[10] = "UnitOne";	//小单位
				this.HiddenArray[11] = "";		// 默认为空
				this.HiddenArray[12] = "UnitTwo";	// 大单位
				this.HiddenArray[13] = "";		// 默认为空
				this.HiddenArray[14] = "InputCostPrice";	// 成本单价
				this.HiddenArray[15] = "0";		// 默认为0

				// 鼠标双击列
				this.MouseDbClickCols[0] = 3;
				this.MouseDbClickCols[1] = 21;

				// 初始化表头
				this.Title[0]	= "No.";
				this.Title[1]	= "商品编号";
				this.Title[2]	= "商品全名";
				this.Title[3]	= "单位";
				this.Title[4]	= "条形码";
				this.Title[5]	= "规格";
				this.Title[6]	= "型号";
				this.Title[7]	= "产地";
				this.Title[8]	= "生产日期";
				this.Title[9]	= "效期至";
				this.Title[10]	= "批号";
				this.Title[11]	= "数量";
				this.Title[12]  = "单位关系";
				this.Title[13]	= "辅助单位";
				this.Title[14]	= "单价";
				this.Title[15]	= "金额";
				this.Title[16]	= "税率";
				this.Title[17]	= "含税单价";
				this.Title[18]	= "价税合计";
				this.Title[19]	= "备注";
				this.Title[20]	= "未完成订货数量";
				this.Title[21]	= "序列号";
				this.Title[22]	= "多编码";

				this.SumCols[0] = 11;
				this.SumCols[1] = 15;
				this.SumCols[2] = 18;

				this.FormatSumCols[0] = 11;
				this.FormatSumCols[1] = 1;
				this.FormatSumCols[2] = 15;
				this.FormatSumCols[3] = 2;
				this.FormatSumCols[4] = 18;
				this.FormatSumCols[5] = 2;

				this.IniCols[0] = 16;
				if ( typeof(this.IniColValues[0]) != "undefined" )
					this.IniCols[1] = this.IniColValues[0];
				else
					this.IniCols[1] = "17";

				this.NumericCols[0] = 11;
				this.NumericCols[1] = 14;
				this.NumericCols[2] = 15;
				this.NumericCols[3] = 17;
				this.NumericCols[4] = 18;

				if ( this.Disable ) {
					this.DisableCols[0]	= 1;
					this.DisableCols[1]	= 2;
					this.DisableCols[2]	= 3;
					this.DisableCols[3]	= 4;
					this.DisableCols[4]	= 5;
					this.DisableCols[5]	= 6;
					this.DisableCols[6]	= 7;
					this.DisableCols[7]	= 8;
					this.DisableCols[8]	= 9;
					this.DisableCols[9]	= 10;
					this.DisableCols[10]	= 11;
					this.DisableCols[11]	= 12;
					this.DisableCols[12]	= 13;
					this.DisableCols[13]	= 14;
					this.DisableCols[14]	= 15;
					this.DisableCols[15]	= 16;
					this.DisableCols[16]	= 17;
					this.DisableCols[17]	= 18;
					this.DisableCols[18]	= 19;
					this.DisableCols[19]	= 20;
					this.DisableCols[20]	= 21;
					this.DisableCols[21]	= 22;
				}
				else {
					this.DisableCols[0]	= 3;
					this.DisableCols[1]	= 4;
					this.DisableCols[2]	= 5;
					this.DisableCols[3]	= 6;
					this.DisableCols[4]	= 7;
					//this.DisableCols[5]	= 14;  //税前单价可修改 2004-4-22 徐辉 
					this.DisableCols[5]	= 12;
					this.DisableCols[6]	= 13;
					this.DisableCols[7]	= 15;
					this.DisableCols[8]	= 16;
					this.DisableCols[9]	= 20
					this.DisableCols[10]= 22
				}

				this.FormatCols[0] = 11;		// 数量
				this.FormatCols[1] = 1;		// 第一种格式(小数保留4位)
				this.FormatCols[2] = 17;	// 含税单价
				this.FormatCols[3] = 1;
				this.FormatCols[4] = 15;	// 金额
				this.FormatCols[5] = 2;
				this.FormatCols[6] = 18;	// 价税合计
				this.FormatCols[7] = 2;		//第二种格式(小数保留2位)
				this.FormatCols[8] = 14;    //单价
				this.FormatCols[9] = 1;

				this.ResultCols[0] = 11;
				this.ResultCols[1] = 14;
				this.ResultCols[2] = 17;
				this.ResultCols[3] = 18;
 	 
				this.ColWidth[0]	= 25;
				this.ColWidth[1]	= 100;
				this.ColWidth[2]	= 150;
				this.ColWidth[3]	= 40;
				this.ColWidth[4]	= 100;
				this.ColWidth[5]	= 80;
				this.ColWidth[6]	= 80;
				this.ColWidth[7]	= 100;
				this.ColWidth[8]	= 80;
				this.ColWidth[9]	= 80;
				this.ColWidth[10]	= 80;
				this.ColWidth[11]	= 80;
				this.ColWidth[12]	= 80;
				this.ColWidth[13]	= 100;
				this.ColWidth[14]	= 80;
				this.ColWidth[15]	= 80;
				this.ColWidth[16]	= 40;
				this.ColWidth[17]	= 80;
				this.ColWidth[18]	= 80;
				this.ColWidth[19]	= 100;
				this.ColWidth[20]	= 100;
				this.ColWidth[21]	= 100;
				this.ColWidth[22]	= 100;

				this.ColEditName[0]	= "";
				this.ColEditName[1]	= "UserCode_Edit";
				this.ColEditName[2]	= "FullName_Edit";
				this.ColEditName[3]	= "Unit_Edit";
				this.ColEditName[4]	= "EntryCode_Edit";
				this.ColEditName[5]	= "Standard_Edit";
				this.ColEditName[6]	= "Type_Edit";
				this.ColEditName[7]	= "Area_Edit";
				this.ColEditName[8]	= "ProduceDate_Edit";
				this.ColEditName[9]	= "ValidDate_Edit";
				this.ColEditName[10] = "GoodsNumber_Edit";
				this.ColEditName[11]	= "Qty_Edit";
				this.ColEditName[12]	= "UnitRate_Edit";
				this.ColEditName[13]	= "AssistantUnit_Edit";
				this.ColEditName[14]	= "Price_Edit";
				this.ColEditName[15]	= "NoTaxTotal_Edit";
				this.ColEditName[16]	= "TaxRate_Edit";
				this.ColEditName[17]	= "TaxPrice_Edit";
				this.ColEditName[18]	= "Total_Edit";
				this.ColEditName[19]	= "Base_Edit";
				this.ColEditName[20]	= "PlanQty_Edit";
				this.ColEditName[21]	= "Serial_Edit";
				this.ColEditName[22]	= "CustomerCode_Edit";

				this.SumRow = "<tr class=\"ClientTablesum\" id=\"SumRow\" height=\"20px\"><td>合计</td>";strColsDisplay = 1;
				
				
				for ( i = 1; i < this.cols; i++ ) {
					// Judge If Display The Grid Cols
					for ( j = 1; j < this.HiddenColsArray.length; j++ ) {
						if ( this.HiddenColsArray[j] == this.ColEditName[i] ) {
							strColsDisplay = 0;
							break;
						}
						else
							strColsDisplay = 1;
						
					}
					for ( j = 0; j < this.SumCols.length; j++ ) {
						if ( i == parseInt(this.SumCols[j]) ) {
							strSumValueDisplay = "<span id=\"" + this.name + "Total" + this.SumCols[j] + "\" style=\"color:#000000\">&nbsp;0</span>";break;
						}
						else
							strSumValueDisplay = "&nbsp;";
					}
					if ( strColsDisplay == 1 ) {
						this.SumRow = this.SumRow + "<td>" + strSumValueDisplay + "</td>";
					}
					else{
						this.SumRow = this.SumRow + "<td style='display:none'>" + strSumValueDisplay + "</td>";
					}
				}

				if ( !this.Disable ) {	// 删除列所占用的单元格
					this.SumRow = this.SumRow + "<td>&nbsp;</td>";
				}
				this.SumRow = this.SumRow + "</tr>";

				//if ( !this.Disable )
				//	this.SumRow="<tr class=ClientTablesum id=SumRow height=20px><td colspan=4>&nbsp;合计</td><td><span id="+this.name+"Total4 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td><span id="+this.name+"Total6 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td>&nbsp;</td><td><span id="+this.name+"Total9 style='color:#000000'>&nbsp;0</span><td>&nbsp;</td><td>&nbsp;</td></tr>";
				//else
				//	this.SumRow="<tr class=ClientTablesum id=SumRow height=20px><td colspan=4>&nbsp;合计</td><td><span id="+this.name+"Total4 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td><span id="+this.name+"Total6 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td>&nbsp;</td><td><span id="+this.name+"Total9 style='color:#000000'>&nbsp;0</span><td>&nbsp;</td></tr>";

				break;

			case 13:	// 销售单折扣
				this.cols = 23;		// 商品录入 折扣

				// 局部更新列
				this.LocalUpdateCol[0] = 1;	// 序列号
				this.LocalUpdateCol[1] = 2;	// 商品编号
				this.LocalUpdateCol[2] = 3;	// 商品名称

				// 每行隐含域名、值数组
				this.HiddenArray[0] = "OrderId";	// 订单 ID 值
				this.HiddenArray[1] = "-1";		// 初始值
				this.HiddenArray[2] = "isUnitTow";	// 该行是否双单位
				this.HiddenArray[3] = "0";		// 默认不是双单位
				this.HiddenArray[4] = "UnitRate";	// 双单位换算关系
				this.HiddenArray[5] = "1";		// 默认换算关系为 1
				this.HiddenArray[6] = "IfSerial"	// 是否采用序列号强制管理
				this.HiddenArray[7] = "0";		// 默认为 0 ；0：非序列号强制管理；1：序列号强制管理
				this.HiddenArray[8] = "SerialOut";	// 所有出库序列号字串
				this.HiddenArray[9] = "";		// 默认为空，各序列号以逗号 ( я ) 分隔
				this.HiddenArray[10] = "UnitOne";	//小单位
				this.HiddenArray[11] = "";		// 默认为空
				this.HiddenArray[12] = "UnitTwo";	// 大单位
				this.HiddenArray[13] = "";		// 默认为空
				// ===================================add by chen_qihua 2004-6-18 采购退货，销售退货加隐含列
				this.HiddenArray[14] = "InputCostPrice";	// 成本单价
				this.HiddenArray[15] = "0";		// 默认为0
				this.HiddenArray[16] = "ID";	// 采购退货，销售退货关联的原来单据的商品的过账ID号
				this.HiddenArray[17] = "";		// 默认为空
				this.HiddenArray[18] = "OldID";	// 采购退货，销售退货关联的原来单据ID
				this.HiddenArray[19] = "";		// 默认为空
				this.HiddenArray[20] = "GoodsNumberPrice";	// 库存批次价格 手工指定法添加
				this.HiddenArray[21] = "-1";		// 默认未-1
				this.HiddenArray[22] = "HandZeroCost";	// 0成本出入库专用
				this.HiddenArray[23] = "0";		// 默认未0
				
				// 鼠标双击列
				this.MouseDbClickCols[0] = 1;
				this.MouseDbClickCols[1] = 4;
				this.MouseDbClickCols[2] = 12;

				// 初始化表头
				this.Title[0]	= "No.";
				this.Title[1]	= "序列号";
				this.Title[2]	= "商品编号";
				this.Title[3]	= "商品全名";
				this.Title[4]	= "单位";
				this.Title[5]	= "条形码";
				this.Title[6]	= "规格";
				this.Title[7]	= "型号";
				this.Title[8]	= "产地";
				this.Title[9]	= "生产日期";
				this.Title[10]	= "效期至";
				this.Title[11]	= "批号";
				this.Title[12]	= "数量";
				this.Title[13]  = "单位关系";
				this.Title[14]	= "辅助单位";
				this.Title[15]	= "单价";
				this.Title[16]	= "金额";
				this.Title[17]	= "扣率";
				this.Title[18]	= "折后单价";
				this.Title[19]	= "折后金额";
				this.Title[20]	= "备注";
				this.Title[21]	= "未完成订货数量";
				this.Title[22]	= "多编码";

				this.SumCols[0] = 12;
				this.SumCols[1] = 16;
				this.SumCols[2] = 19;

				this.FormatSumCols[0] = 12;
				this.FormatSumCols[1] = 1;
				this.FormatSumCols[2] = 16;
				this.FormatSumCols[3] = 2;
				this.FormatSumCols[4] = 19;
				this.FormatSumCols[5] = 2;

				this.IniCols[0] = 17;
				if ( typeof(this.IniColValues[0]) != "undefined" )
					this.IniCols[1] = this.IniColValues[0];
				else
					this.IniCols[1] = 1;

				// 销售单数量加入缺省值 1
				if ( typeof(this.IniColValues[1]) != "undefined" ) {
					this.IniCols[2] = 12;
					this.IniCols[3] = 1;
				}

				this.NumericCols[0] = 12;
				this.NumericCols[1] = 15;  //徐辉 2004-4-23 添加扣前单价
				this.NumericCols[2] = 17;
				this.NumericCols[3] = 18;
				this.NumericCols[4] = 19;

				if ( this.Disable ) {
					this.DisableCols[0]	= 1;
					this.DisableCols[1]	= 2;
					this.DisableCols[2]	= 3;
					this.DisableCols[3]	= 4;
					this.DisableCols[4]	= 5;
					this.DisableCols[5]	= 6;
					this.DisableCols[6]	= 7;
					this.DisableCols[7]	= 8;
					this.DisableCols[8]	= 9;
					this.DisableCols[9]	= 10;
					this.DisableCols[10]	= 11;
					this.DisableCols[11]	= 12;
					this.DisableCols[12]	= 13;
					this.DisableCols[13]	= 14;
					this.DisableCols[14]	= 15;
					this.DisableCols[15]	= 16;
					this.DisableCols[16]	= 17;
					this.DisableCols[17]	= 18;
					this.DisableCols[18]	= 19;
					this.DisableCols[19]	= 20;
					this.DisableCols[20]	= 21;
					this.DisableCols[21]	= 22;
				}
				else {
					//委托代销退货，销售退货录入批次日期
					if ( Grid.specialproperty == "WTDXTH" || Grid.specialproperty == "XSTH" ){
						this.DisableCols[0] = 4;
						this.DisableCols[1] = 5;
						this.DisableCols[2] = 6;
						this.DisableCols[3] = 7;
						this.DisableCols[4] = 8;
						this.DisableCols[5] = 13;
						this.DisableCols[6] = 14;
						this.DisableCols[7] = 16;
						this.DisableCols[8] = 21;
						this.DisableCols[9] = 22;
					}
					else{
						this.DisableCols[0] = 4;
						this.DisableCols[1] = 5;
						this.DisableCols[2] = 6;
						this.DisableCols[3] = 7;
						this.DisableCols[4] = 8;
						this.DisableCols[5] = 9; 
						this.DisableCols[6] = 10;
						this.DisableCols[7] = 11;
						this.DisableCols[8] = 13;
						this.DisableCols[9] = 14;
						this.DisableCols[10] = 16;
						this.DisableCols[11] = 21;
						this.DisableCols[12] = 22;
					} 
				}

				this.FormatCols[0]	= 12;	// 数量
				this.FormatCols[1]	= 1;	// 第一种格式(小数保留4位)
				this.FormatCols[2]	= 18;	// 折后单价
				this.FormatCols[3]	= 1;
				this.FormatCols[4]	= 16;	// 金额
				this.FormatCols[5]	= 2;
				this.FormatCols[6]	= 19;	// 折后金额
				this.FormatCols[7]	= 2;	// 第二种格式(小数保留2位)
				this.FormatCols[8]	= 15;	// 单价
				this.FormatCols[9]	= 1;
				this.FormatCols[10]	= 17;	//折扣率
				this.FormatCols[11]	= 1;

				// 计算折后金额
				this.ResultCols[0] = 12;
				this.ResultCols[1] = 15;
				this.ResultCols[2] = 17;
				this.ResultCols[3] = 18;
				this.ResultCols[4] = 19;
	 
				this.ColWidth[0]	= 25;
				this.ColWidth[1]	= 100;
				this.ColWidth[2]	= 100;
				this.ColWidth[3]	= 150;
				this.ColWidth[4]	= 40;
				this.ColWidth[5]	= 100;
				this.ColWidth[6]	= 80;
				this.ColWidth[7]	= 80;
				this.ColWidth[8]	= 100;
				this.ColWidth[9]	= 80;
				this.ColWidth[10]	= 80;
				this.ColWidth[11]	= 80;
				this.ColWidth[12]	= 80;
				this.ColWidth[13]	= 80;
				this.ColWidth[14]	= 100;
				this.ColWidth[15]	= 80;
				this.ColWidth[16]	= 80;
				this.ColWidth[17]	= 40;
				this.ColWidth[18]	= 80;
				this.ColWidth[19]	= 80;
				this.ColWidth[20]	= 100;
				this.ColWidth[21]	= 100;
				this.ColWidth[22]	= 100;

				this.ColEditName[0]	= "";
				this.ColEditName[1]	= "SerialSel_Edit";
				this.ColEditName[2]	= "UserCode_Edit";
				this.ColEditName[3]	= "FullName_Edit";
				this.ColEditName[4]	= "Unit_Edit";
				this.ColEditName[5]	= "EntryCode_Edit";
				this.ColEditName[6]	= "Standard_Edit";
				this.ColEditName[7]	= "Type_Edit";
				this.ColEditName[8]	= "Area_Edit";
				this.ColEditName[9]	= "ProduceDate_Edit";
				this.ColEditName[10]	= "ValidDate_Edit";
				this.ColEditName[11]	= "GoodsNumber_Edit";
				this.ColEditName[12]	= "Qty_Edit";
				this.ColEditName[13]	= "UnitRate_Edit";
				this.ColEditName[14]	= "AssistantUnit_Edit";
				this.ColEditName[15]	= "Price_Edit";
				this.ColEditName[16]	= "NoDiscountTotal_Edit";
				this.ColEditName[17]	= "Discount_Edit";
				this.ColEditName[18]	= "DiscountPrice_Edit";
				this.ColEditName[19]	= "Total_Edit";
				this.ColEditName[20]	= "Base_Edit";
				this.ColEditName[21]	= "PlanQty_Edit";
				this.ColEditName[22]	= "CustomerCode_Edit";

				this.SumRow = "<tr class=\"ClientTablesum\" id=\"SumRow\" height=\"20px\"><td>合计</td>";strColsDisplay = 1;
				
				
				
				for ( i = 1; i < this.cols; i++ ) {
					// Judge If Display The Grid Cols
					for ( j = 1; j < this.HiddenColsArray.length; j++ ) {
						if ( this.HiddenColsArray[j] == this.ColEditName[i] ) {
							strColsDisplay = 0;
							break;
						}
						else
							strColsDisplay = 1;
						
					}
					for ( j = 0; j < this.SumCols.length; j++ ) {
						if ( i == parseInt(this.SumCols[j]) ) {
							strSumValueDisplay = "<span id=\"" + this.name + "Total" + this.SumCols[j] + "\" style=\"color:#000000\">&nbsp;0</span>";break;
						}
						else
							strSumValueDisplay = "&nbsp;";
					}
					if ( strColsDisplay == 1 ) {
						this.SumRow = this.SumRow + "<td>" + strSumValueDisplay + "</td>";
					}
					else{
						this.SumRow = this.SumRow + "<td style='display:none'>" + strSumValueDisplay + "</td>";
					}
				}

				if ( !this.Disable ) {	// 删除列所占用的单元格
					this.SumRow = this.SumRow + "<td>&nbsp;</td>";
				}
				this.SumRow = this.SumRow + "</tr>";

				//if ( !this.Disable )
				//	this.SumRow="<tr class=ClientTablesum id=SumRow height=20px><td colspan=4>&nbsp;合计</td><td><span id="+this.name+"Total4 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td><span id="+this.name+"Total6 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td>&nbsp;</td><td><span id="+this.name+"Total9 style='color:#000000'>&nbsp;0</span><td>&nbsp;</td><td>&nbsp;</td></tr>";
				//else
				//	this.SumRow="<tr class=ClientTablesum id=SumRow height=20px><td colspan=4>&nbsp;合计</td><td><span id="+this.name+"Total4 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td><span id="+this.name+"Total6 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td>&nbsp;</td><td><span id="+this.name+"Total9 style='color:#000000'>&nbsp;0</span><td>&nbsp;</td></tr>";

				break;

			case 14:	// 进货单折扣
				this.cols = 23;		// 商品录入 折扣

				this.LocalUpdateCol[0] = 1;	// 局部更新列
				this.LocalUpdateCol[1] = 2;	// 局部更新列

				// 每行隐含域名、值数组
				this.HiddenArray[0] = "OrderId";	// 订单 ID 值
				this.HiddenArray[1] = "-1";		// 初始值
				this.HiddenArray[2] = "isUnitTow";	// 该行是否双单位
				this.HiddenArray[3] = "0";		// 默认不是双单位
				this.HiddenArray[4] = "UnitRate";	// 双单位换算关系
				this.HiddenArray[5] = "1";		// 默认换算关系为 1
				this.HiddenArray[6] = "IfSerial"	// 是否采用序列号强制管理
				this.HiddenArray[7] = "0";		// 默认为 0 ；0：非序列号强制管理；1：序列号强制管理
				this.HiddenArray[8] = "SerialIn";	// 所有入库序列号字串
				this.HiddenArray[9] = "";		// 默认为空，各序列号以逗号 ( я ) 分隔
				this.HiddenArray[10] = "UnitOne";	//小单位
				this.HiddenArray[11] = "";		// 默认为空
				this.HiddenArray[12] = "UnitTwo";	// 大单位
				this.HiddenArray[13] = "";		// 默认为空
				this.HiddenArray[14] = "InputCostPrice";	// 成本单价
				this.HiddenArray[15] = "0";		// 默认为0
	 

				// 鼠标双击列
				this.MouseDbClickCols[0] = 3;
				this.MouseDbClickCols[1] = 21;

				this.Title[0]	= "No.";
				this.Title[1]	= "商品编号";
				this.Title[2]	= "商品全名";
				this.Title[3]	= "单位";
				this.Title[4]	= "条形码";
				this.Title[5]	= "规格";
				this.Title[6]	= "型号";
				this.Title[7]	= "产地";
				this.Title[8]	= "生产日期";
				this.Title[9]	= "效期至";
				this.Title[10]	= "批号";
				this.Title[11]	= "数量";
				this.Title[12]	= "单位关系";
				this.Title[13]	= "辅助单位";
				this.Title[14]	= "单价";
				this.Title[15]	= "金额";
				this.Title[16]	= "扣率";
				this.Title[17]	= "折后单价";
				this.Title[18]	= "折后金额";
				this.Title[19]	= "备注";
				this.Title[20]	= "未完成订货数量";
				this.Title[21]	= "序列号";
				this.Title[22]	= "多编码";

				this.SumCols[0] = 11;
				this.SumCols[1] = 15;
				this.SumCols[2] = 18;

				this.FormatSumCols[0] = 11;
				this.FormatSumCols[1] = 1;
				this.FormatSumCols[2] = 15;
				this.FormatSumCols[3] = 2;
				this.FormatSumCols[4] = 18;
				this.FormatSumCols[5] = 2;

				this.IniCols[0] = 16;
				if ( typeof(this.IniColValues[0]) != "undefined" )
					this.IniCols[1] = this.IniColValues[0];
				else
					this.IniCols[1] = 1;

				this.NumericCols[0] = 11;
				this.NumericCols[1] = 14;
				this.NumericCols[2] = 15;
				this.NumericCols[3] = 16;
				this.NumericCols[4] = 17;
				this.NumericCols[5] = 18;

				if ( this.Disable ) {
					this.DisableCols[0]	= 1;
					this.DisableCols[1]	= 2;
					this.DisableCols[2]	= 3;
					this.DisableCols[3]	= 4;
					this.DisableCols[4]	= 5;
					this.DisableCols[5]	= 6;
					this.DisableCols[6]	= 7;
					this.DisableCols[7]	= 8;
					this.DisableCols[8]	= 9;
					this.DisableCols[9]	= 10;
					this.DisableCols[10]	= 11;
					this.DisableCols[11]	= 12;
					this.DisableCols[12]	= 13;
					this.DisableCols[13]	= 14;
					this.DisableCols[14]	= 15;
					this.DisableCols[15]	= 16;
					this.DisableCols[16]	= 17;
					this.DisableCols[17]	= 18;
					this.DisableCols[18]	= 19;
					this.DisableCols[19]	= 20;
					this.DisableCols[20]	= 21;
					this.DisableCols[21]	= 22;
				}
				else {
					this.DisableCols[0]	= 3;
					this.DisableCols[1]	= 4;
					this.DisableCols[2]	= 5;
					this.DisableCols[3]	= 6;
					this.DisableCols[4]	= 7;
					//this.DisableCols[5]	= 14; //折前单价可修改 2004-4-22 徐辉
					this.DisableCols[5]	= 12;
					this.DisableCols[6]	= 13;
					this.DisableCols[7]	= 15;
					this.DisableCols[8]	= 20
					this.DisableCols[9]	= 22
				}

				this.FormatCols[0]	= 11;	// 数量
				this.FormatCols[1]	= 1;	// 第一种格式(小数保留4位)
				this.FormatCols[2]	= 17;	// 折后单价
				this.FormatCols[3]	= 1;
				this.FormatCols[4]	= 15;	// 金额
				this.FormatCols[5]	= 2;
				this.FormatCols[6]	= 18;	// 折后金额
				this.FormatCols[7]	= 2;	// 第二种格式(小数保留2位)
				this.FormatCols[8]	= 14;	// 单价
				this.FormatCols[9]	= 1;
				this.FormatCols[10]	= 16;	//折扣率
				this.FormatCols[11]	= 1;

				this.ResultCols[0] = 11;
				this.ResultCols[1] = 14;
				this.ResultCols[2] = 15;
				this.ResultCols[3] = 16
				this.ResultCols[4] = 17;
				this.ResultCols[5] = 18;

				this.ColWidth[0]	= 25;
				this.ColWidth[1]	= 100;
				this.ColWidth[2]	= 150;
				this.ColWidth[3]	= 40;
				this.ColWidth[4]	= 100;
				this.ColWidth[5]	= 80;
				this.ColWidth[6]	= 80;
				this.ColWidth[7]	= 100;
				this.ColWidth[8]	= 80;
				this.ColWidth[9]	= 80;
				this.ColWidth[10]	= 80;
				this.ColWidth[11]	= 80;
				this.ColWidth[12]	= 80;
				this.ColWidth[13]	= 100;
				this.ColWidth[14]	= 80;
				this.ColWidth[15]	= 80;
				this.ColWidth[16]	= 40;
				this.ColWidth[17]	= 80;
				this.ColWidth[18]	= 80;
				this.ColWidth[19]	= 100;
				this.ColWidth[20]	= 100;
				this.ColWidth[21]	= 100;
				this.ColWidth[22]	= 100;

				this.ColEditName[0]	= "";
				this.ColEditName[1]	= "UserCode_Edit";
				this.ColEditName[2]	= "FullName_Edit";
				this.ColEditName[3]	= "Unit_Edit";
				this.ColEditName[4]	= "EntryCode_Edit";
				this.ColEditName[5]	= "Standard_Edit";
				this.ColEditName[6]	= "Type_Edit";
				this.ColEditName[7]	= "Area_Edit";
				this.ColEditName[8]	= "ProduceDate_Edit";
				this.ColEditName[9]	= "ValidDate_Edit";
				this.ColEditName[10] = "GoodsNumber_Edit";
				this.ColEditName[11]	= "Qty_Edit";
				this.ColEditName[12]	= "UnitRate_Edit";
				this.ColEditName[13]	= "AssistantUnit_Edit";
				this.ColEditName[14]	= "Price_Edit";
				this.ColEditName[15]	= "NoDiscountTotal_Edit";
				this.ColEditName[16]	= "Discount_Edit";
				this.ColEditName[17]	= "DiscountPrice_Edit";
				this.ColEditName[18]	= "Total_Edit";
				this.ColEditName[19]	= "Base_Edit";
				this.ColEditName[20]	= "PlanQty_Edit";
				this.ColEditName[21]	= "Serial_Edit";
				this.ColEditName[22]	= "CustomerCode_Edit";

				this.SumRow = "<tr class=\"ClientTablesum\" id=\"SumRow\" height=\"20px\"><td>合计</td>";strColsDisplay = 1;
				
				
				for ( i = 1; i < this.cols; i++ ) {
					// Judge If Display The Grid Cols
					for ( j = 1; j < this.HiddenColsArray.length; j++ ) {
						if ( this.HiddenColsArray[j] == this.ColEditName[i] ) {
							strColsDisplay = 0;
							break;
						}
						else
							strColsDisplay = 1;
						
					}
					for ( j = 0; j < this.SumCols.length; j++ ) {
						if ( i == parseInt(this.SumCols[j]) ) {
							strSumValueDisplay = "<span id=\"" + this.name + "Total" + this.SumCols[j] + "\" style=\"color:#000000\">&nbsp;0</span>";break;
						}
						else
							strSumValueDisplay = "&nbsp;";
					}
					if ( strColsDisplay == 1 ) {
						this.SumRow = this.SumRow + "<td>" + strSumValueDisplay + "</td>";
					}
					else{
						this.SumRow = this.SumRow + "<td style='display:none'>" + strSumValueDisplay + "</td>";
					}
				}

				if ( !this.Disable ) {	// 删除列所占用的单元格
					this.SumRow = this.SumRow + "<td>&nbsp;</td>";
				}
				this.SumRow = this.SumRow + "</tr>";

				//if ( !this.Disable )
				//	this.SumRow="<tr class=ClientTablesum id=SumRow height=20px><td colspan=4>&nbsp;合计</td><td><span id="+this.name+"Total4 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td><span id="+this.name+"Total6 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td>&nbsp;</td><td><span id="+this.name+"Total9 style='color:#000000'>&nbsp;0</span><td>&nbsp;</td><td>&nbsp;</td></tr>";
				//else
				//	this.SumRow="<tr class=ClientTablesum id=SumRow height=20px><td colspan=4>&nbsp;合计</td><td><span id="+this.name+"Total4 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td><span id="+this.name+"Total6 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td>&nbsp;</td><td><span id="+this.name+"Total9 style='color:#000000'>&nbsp;0</span><td>&nbsp;</td></tr>";

				break;
 
			case 20:	// 销售订单
				this.cols = 16;

				this.LocalUpdateCol[0] = 1;	// 局部更新列
				this.LocalUpdateCol[1] = 2;	// 局部更新列

				this.HiddenArray[0] = "OrderID";
				this.HiddenArray[1] = "-1";
				this.HiddenArray[2] = "isUnitTow";
				this.HiddenArray[3] = "0";
				this.HiddenArray[4] = "UnitRate";
				this.HiddenArray[5] = "1";
				this.HiddenArray[6] = "IfSerial"	// 是否采用序列号强制管理
				this.HiddenArray[7] = "0";		// 默认为 0 ；0：非序列号强制管理；1：序列号强制管理
				this.HiddenArray[8] = "UnitOne";	//小单位
				this.HiddenArray[9] = "";		// 默认为空
				this.HiddenArray[10] = "UnitTwo";	// 大单位
				this.HiddenArray[11] = "";		// 默认为空			
				
		
				// 鼠标双击列
				this.MouseDbClickCols[0] = 3;

				// 初始化表头
				this.Title[0]	= "No.";
				this.Title[1]	= "商品编号";
				this.Title[2]	= "商品全名";
				this.Title[3]	= "单位";
				this.Title[4]	= "条形码";
				this.Title[5]	= "规格";
				this.Title[6]	= "型号";
				this.Title[7]	= "产地";
				this.Title[8]	= "数量"
				this.Title[9]  = "单位关系";
				this.Title[10]	= "辅助单位";;
				this.Title[11]	= "单价";
				this.Title[12]	= "金额";
				this.Title[13]	= "已发货数量";
				this.Title[14]	= "备注";
				this.Title[15]	= "多编码";

				this.SumCols[0] = 8;
				this.SumCols[1] = 12;
				this.SumCols[2] = 13;

				this.FormatSumCols[0] = 8;
				this.FormatSumCols[1] = 1;
				this.FormatSumCols[2] = 12;
				this.FormatSumCols[3] = 2;
				this.FormatSumCols[4] = 13;
				this.FormatSumCols[5] = 1;


				this.NumericCols[0] = 8;
				this.NumericCols[1] = 11;

				this.FormatCols[0] = 8;
				this.FormatCols[1] = 1;		// 第一种格式 ( 小数保留 4 位 )
				this.FormatCols[2] = 11;
				this.FormatCols[3] = 1;
				this.FormatCols[4] = 12;
				this.FormatCols[5] = 2;		// 第二种格式 ( 小数保留 2 位 )

				this.ResultCols[0] = ";";
				this.ResultCols[1] = 8;
				this.ResultCols[2] = "*";
				this.ResultCols[3] = 11;
				this.ResultCols[4] = "=";
				this.ResultCols[5] = 12;
				this.ResultCols[6] = ";";

				if ( this.Disable ) {
					this.DisableCols[0]	= 1;
					this.DisableCols[1]	= 2;
					this.DisableCols[2]	= 3;
					this.DisableCols[3]	= 4;
					this.DisableCols[4]	= 5;
					this.DisableCols[5]	= 6;
					this.DisableCols[6]	= 7;
					this.DisableCols[7]	= 8;
					this.DisableCols[8]	= 9;
					this.DisableCols[9]	= 10;
					this.DisableCols[10]	= 11;
					this.DisableCols[11]	= 12;
					this.DisableCols[12]	= 13;
					this.DisableCols[13]	= 14;
					this.DisableCols[14]	= 15;
				}
				else {
					this.DisableCols[0]	= 3;
					this.DisableCols[1]	= 4;
					this.DisableCols[2]	= 5;
					this.DisableCols[3]	= 6;
					this.DisableCols[4]	= 7;
					this.DisableCols[5]	= 9;
					this.DisableCols[6]	= 10;
					this.DisableCols[7]	= 12;
					this.DisableCols[8]	= 13;
					this.DisableCols[9]	= 15;
				}

				this.ColWidth[0]	= 25;
				this.ColWidth[1]	= 100;
				this.ColWidth[2]	= 150;
				this.ColWidth[3]	= 40;
				this.ColWidth[4]	= 100;
				this.ColWidth[5]	= 80;
				this.ColWidth[6]	= 80;
				this.ColWidth[7]	= 100;
				this.ColWidth[8]	= 80;
				this.ColWidth[9]	= 80;
				this.ColWidth[10]	= 100;
				this.ColWidth[11]	= 80;
				this.ColWidth[12]	= 80;
				this.ColWidth[13]	= 80;
				this.ColWidth[14]	= 100;
				this.ColWidth[15]	= 100;

				this.ColEditName[0]	= "";
				this.ColEditName[1]	= "UserCode_Edit";
				this.ColEditName[2]	= "FullName_Edit";
				this.ColEditName[3]	= "Unit_Edit";
				this.ColEditName[4]	= "EntryCode_Edit";
				this.ColEditName[5]	= "Standard_Edit";
				this.ColEditName[6]	= "Type_Edit";
				this.ColEditName[7]	= "Area_Edit";
				this.ColEditName[8]	= "Qty_Edit";
				this.ColEditName[9]	= "UnitRate_Edit";
				this.ColEditName[10]	= "AssistantUnit_Edit";
				this.ColEditName[11]	= "Price_Edit";
				this.ColEditName[12]	= "Total_Edit";
				this.ColEditName[13]	= "ConsignmentQty_Edit";
				this.ColEditName[14]	= "Comment_Edit";
				this.ColEditName[15]	= "CustomerCode_Edit";

				this.SumRow = "<tr class=\"ClientTablesum\" id=\"SumRow\" height=\"20px\"><td>合计</td>";strColsDisplay = 1;
				
				
				for ( i = 1; i < this.cols; i++ ) {
					// Judge If Display The Grid Cols
					for ( j = 1; j < this.HiddenColsArray.length; j++ ) {
						if ( this.HiddenColsArray[j] == this.ColEditName[i] ) {
							strColsDisplay = 0;
							break;
						}
						else
							strColsDisplay = 1;
						
					}
					for ( j = 0; j < this.SumCols.length; j++ ) {
						if ( i == parseInt(this.SumCols[j]) ) {
							strSumValueDisplay = "<span id=\"" + this.name + "Total" + this.SumCols[j] + "\" style=\"color:#000000\">&nbsp;0</span>";break;
						}
						else
							strSumValueDisplay = "&nbsp;";
					}
					if ( strColsDisplay == 1 ) {
						this.SumRow = this.SumRow + "<td>" + strSumValueDisplay + "</td>";
					}
					else{
						this.SumRow = this.SumRow + "<td style='display:none'>" + strSumValueDisplay + "</td>";
					}
				}

				if ( !this.Disable ) {	// 删除列所占用的单元格
					this.SumRow = this.SumRow + "<td>&nbsp;</td>";
				}
				this.SumRow = this.SumRow + "</tr>";

				//if ( !this.Disable )
				//	this.SumRow="<tr class=ClientTablesum id=SumRow height=20px><td colspan=4>&nbsp;合计</td><td><span id="+this.name+"Total4 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td><span id="+this.name+"Total6 style='color:#000000'>&nbsp;0</span></td><td><span id="+this.name+"Total7 style='color:#000000'>&nbsp;0</span><td>&nbsp;</td><td>&nbsp;</td></tr>";
				//else
				//	this.SumRow="<tr class=ClientTablesum id=SumRow height=20px><td colspan=4>&nbsp;合计</td><td><span id="+this.name+"Total4 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td><span id="+this.name+"Total6 style='color:#000000'>&nbsp;0</span></td><td><span id="+this.name+"Total7 style='color:#000000'>&nbsp;0</span><td>&nbsp;</td></tr>";

				break;

			case 21:	// 采购订单
				this.cols = 16;

				this.LocalUpdateCol[0] = 1;	// 局部更新列
				this.LocalUpdateCol[1] = 2;	// 局部更新列

				this.HiddenArray[0] = "OrderID";
				this.HiddenArray[1] = "-1";
				this.HiddenArray[2] = "isUnitTow";
				this.HiddenArray[3] = "0";
				this.HiddenArray[4] = "UnitRate";
				this.HiddenArray[5] = "1";
				this.HiddenArray[6] = "IfSerial"	// 是否采用序列号强制管理
				this.HiddenArray[7] = "0";		// 默认为 0 ；0：非序列号强制管理；1：序列号强制管理
				this.HiddenArray[8] = "UnitOne";	//小单位
				this.HiddenArray[9] = "";		// 默认为空
				this.HiddenArray[10] = "UnitTwo";	// 大单位
				this.HiddenArray[11] = "";		// 默认为空	

				// 鼠标双击列
				this.MouseDbClickCols[0] = 3;

				// 初始化表头
				this.Title[0]	= "No.";
				this.Title[1]	= "商品编号";
				this.Title[2]	= "商品全名";
				this.Title[3]	= "单位";
				this.Title[4]	= "条形码";
				this.Title[5]	= "规格";
				this.Title[6]	= "型号";
				this.Title[7]	= "产地";
				this.Title[8]	= "数量";
				this.Title[9]  = "单位关系";
				this.Title[10]	= "辅助单位";
				this.Title[11]	= "单价";
				this.Title[12]	= "金额";
				this.Title[13]	= "已收货数量";
				this.Title[14]	= "备注";
				this.Title[15]	= "多编码";

				this.SumCols[0] = 8;
				this.SumCols[1] = 12;
				this.SumCols[2] = 13;

				this.FormatSumCols[0] = 8;
				this.FormatSumCols[1] = 1;
				this.FormatSumCols[2] = 12;
				this.FormatSumCols[3] = 2;
				this.FormatSumCols[4] = 13;
				this.FormatSumCols[5] = 1;

				this.NumericCols[0] = 8;
				this.NumericCols[1] = 11;

				this.FormatCols[0] = 8;
				this.FormatCols[1] = 1;		// 第一种格式 ( 小数保留 4 位 )
				this.FormatCols[2] = 11;
				this.FormatCols[3] = 1;
				this.FormatCols[4] = 12;
				this.FormatCols[5] = 2;		// 第二种格式 ( 小数保留 2 位 )

				this.ResultCols[0] = ";";
				this.ResultCols[1] = 8;
				this.ResultCols[2] = "*";
				this.ResultCols[3] = 11;
				this.ResultCols[4] = "=";
				this.ResultCols[5] = 12;
				this.ResultCols[6] = ";";

				if ( this.Disable ) {
					this.DisableCols[0]	= 1;
					this.DisableCols[1]	= 2;
					this.DisableCols[2]	= 3;
					this.DisableCols[3]	= 4;
					this.DisableCols[4]	= 5;
					this.DisableCols[5]	= 6;
					this.DisableCols[6]	= 7;
					this.DisableCols[7]	= 8;
					this.DisableCols[8]	= 9;
					this.DisableCols[9]	= 10;
					this.DisableCols[10]	= 11;
					this.DisableCols[11]	= 12;
					this.DisableCols[12]	= 13;
					this.DisableCols[13]	= 14;
					this.DisableCols[14]	= 15;
				}
				else {
					this.DisableCols[0]	= 3;
					this.DisableCols[1]	= 4;
					this.DisableCols[2]	= 5;
					this.DisableCols[3]	= 6;
					this.DisableCols[4]	= 7;
					this.DisableCols[5]	= 9;
					this.DisableCols[6]	= 10;
					this.DisableCols[7]	= 12;
					this.DisableCols[8]	= 13;
					this.DisableCols[9]	= 15;
				}

				this.ColWidth[0]	= 25;
				this.ColWidth[1]	= 100;
				this.ColWidth[2]	= 150;
				this.ColWidth[3]	= 40;
				this.ColWidth[4]	= 100;
				this.ColWidth[5]	= 80;
				this.ColWidth[6]	= 80;
				this.ColWidth[7]	= 100;
				this.ColWidth[8]	= 80;
				this.ColWidth[9]	= 80;
				this.ColWidth[10]	= 100;
				this.ColWidth[11]	= 80;
				this.ColWidth[12]	= 80;
				this.ColWidth[13]	= 80;
				this.ColWidth[14]	= 100;
				this.ColWidth[15]	= 100;

				this.ColEditName[0]	= "";
				this.ColEditName[1]	= "UserCode_Edit";
				this.ColEditName[2]	= "FullName_Edit";
				this.ColEditName[3]	= "Unit_Edit";
				this.ColEditName[4]	= "EntryCode_Edit";
				this.ColEditName[5]	= "Standard_Edit";
				this.ColEditName[6]	= "Type_Edit";
				this.ColEditName[7]	= "Area_Edit";
				this.ColEditName[8]	= "Qty_Edit";
				this.ColEditName[9]	= "UnitRate_Edit";
				this.ColEditName[10]	= "AssistantUnit_Edit";
				this.ColEditName[11]	= "Price_Edit";
				this.ColEditName[12]	= "Total_Edit";
				this.ColEditName[13]	= "ConsignmentQty_Edit";
				this.ColEditName[14]	= "Comment_Edit";
				this.ColEditName[15]	= "CustomerCode_Edit";

				this.SumRow = "<tr class=\"ClientTablesum\" id=\"SumRow\" height=\"20px\"><td>合计</td>";strColsDisplay = 1;
				
				
				for ( i = 1; i < this.cols; i++ ) {
					// Judge If Display The Grid Cols
					for ( j = 1; j < this.HiddenColsArray.length; j++ ) {
						if ( this.HiddenColsArray[j] == this.ColEditName[i] ) {
							strColsDisplay = 0;
							break;
						}
						else
							strColsDisplay = 1;
						
					}
					for ( j = 0; j < this.SumCols.length; j++ ) {
						if ( i == parseInt(this.SumCols[j]) ) {
							strSumValueDisplay = "<span id=\"" + this.name + "Total" + this.SumCols[j] + "\" style=\"color:#000000\">&nbsp;0</span>";break;
						}
						else
							strSumValueDisplay = "&nbsp;";
					}
					if ( strColsDisplay == 1 ) {
						this.SumRow = this.SumRow + "<td>" + strSumValueDisplay + "</td>";
					}
					else{
						this.SumRow = this.SumRow + "<td style='display:none'>" + strSumValueDisplay + "</td>";
					}
				}

				if ( !this.Disable ) {	// 删除列所占用的单元格
					this.SumRow = this.SumRow + "<td>&nbsp;</td>";
				}
				this.SumRow = this.SumRow + "</tr>";

				//if ( !this.Disable )
				//	this.SumRow="<tr class=ClientTablesum id=SumRow height=20px><td colspan=4>&nbsp;合计</td><td><span id="+this.name+"Total4 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td><span id="+this.name+"Total6 style='color:#000000'>&nbsp;0</span></td><td><span id="+this.name+"Total7 style='color:#000000'>&nbsp;0</span><td>&nbsp;</td><td>&nbsp;</td></tr>";
				//else
				//	this.SumRow="<tr class=ClientTablesum id=SumRow height=20px><td colspan=4>&nbsp;合计</td><td><span id="+this.name+"Total4 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td><span id="+this.name+"Total6 style='color:#000000'>&nbsp;0</span></td><td><span id="+this.name+"Total7 style='color:#000000'>&nbsp;0</span><td>&nbsp;</td></tr>";

				break;
 
			case 15:	// 销售普通格式
				this.cols = 20;

				// 局部更新列
				this.LocalUpdateCol[0] = 1;	// 序列号
				this.LocalUpdateCol[1] = 2;	// 商品编号
				this.LocalUpdateCol[2] = 3;	// 商品名称

				// 每行隐含域名、值数组
				this.HiddenArray[0] = "OrderId";	// 订单 ID 值
				this.HiddenArray[1] = "-1";		// 初始值
				this.HiddenArray[2] = "isUnitTow";	// 该行是否双单位
				this.HiddenArray[3] = "0";		// 默认不是双单位
				this.HiddenArray[4] = "UnitRate";	// 双单位换算关系
				this.HiddenArray[5] = "1";		// 默认换算关系为 1
				this.HiddenArray[6] = "IfSerial"	// 是否采用序列号强制管理
				this.HiddenArray[7] = "0";		// 默认为 0 ；0：非序列号强制管理；1：序列号强制管理
				this.HiddenArray[8] = "SerialOut";	// 所有出库序列号字串
				this.HiddenArray[9] = "";		// 默认为空，各序列号以逗号 ( я ) 分隔
				this.HiddenArray[10] = "UnitOne";	//小单位
				this.HiddenArray[11] = "";		// 默认为空
				this.HiddenArray[12] = "UnitTwo";	// 大单位
				this.HiddenArray[13] = "";		// 默认为空
				// ===================================add by chen_qihua 2004-6-18 采购退货，销售退货加隐含列
				this.HiddenArray[14] = "InputCostPrice";	// 成本单价
				this.HiddenArray[15] = "0";		// 默认为)
				this.HiddenArray[16] = "ID";	// 采购退货，销售退货关联的原来单据的商品的过账ID号
				this.HiddenArray[17] = "";		// 默认为空
				this.HiddenArray[18] = "OldID";	// 采购退货，销售退货关联的原来单据ID
				this.HiddenArray[19] = "";		// 默认为空
				this.HiddenArray[20] = "GoodsNumberPrice";	// 采购退货，销售退货关联的原来单据ID
				this.HiddenArray[21] = "-1";		// 默认为空
				this.HiddenArray[22] = "HandZeroCost";	// 0成本出入库专用
				this.HiddenArray[23] = "0";		// 默认未0
				
				// 鼠标双击列
				this.MouseDbClickCols[0] = 1;
				this.MouseDbClickCols[1] = 4;
				this.MouseDbClickCols[2] = 12;

				// 初始化表头
				this.Title[0]	= "No.";
				this.Title[1]	= "序列号";
				this.Title[2]	= "商品编号";
				this.Title[3]	= "商品全名";
				this.Title[4]	= "单位";
				this.Title[5]	= "条形码";
				this.Title[6]	= "规格";
				this.Title[7]	= "型号";
				this.Title[8]	= "产地";
				this.Title[9]	= "生产日期";
				this.Title[10]	= "效期至";
				this.Title[11]	= "批号";
				this.Title[12]	= "数量";
				this.Title[13]  = "单位关系";
				this.Title[14]	= "辅助单位";
				this.Title[15]	= "单价";
				this.Title[16]	= "金额";
				this.Title[17]	= "备注";
				this.Title[18]	= "未完成订货数量";
				this.Title[19]	= "多编码";

				// 需要合计的列
				this.SumCols[0] = 12;
				this.SumCols[1] = 16;

				this.FormatSumCols[0] = 12;
				this.FormatSumCols[1] = 1;
				this.FormatSumCols[2] = 16;
				this.FormatSumCols[3] = 2;

				this.NumericCols[0] = 12;
				this.NumericCols[1] = 15;
				this.NumericCols[2] = 16;

				this.FormatCols[0] = 12;
				this.FormatCols[1] = 1;	// 第一种格式 ( 小数保留4位 )
				this.FormatCols[2] = 15;
				this.FormatCols[3] = 1;
				this.FormatCols[4] = 16;
				this.FormatCols[5] = 2;	// 第二种格式 ( 小数保留2位 )

				this.ResultCols[0] = ";";
				this.ResultCols[1] = 12;
				this.ResultCols[2] = "*";
				this.ResultCols[3] = 15;
				this.ResultCols[4] = "=";
				this.ResultCols[5] = 16;
				this.ResultCols[6] = ";";

				// 只读列，Disable 用于显示单据明细时用
				if ( this.Disable ) {
					this.DisableCols[0]	= 1;
					this.DisableCols[1]	= 2;
					this.DisableCols[2]	= 3;
					this.DisableCols[3]	= 4;
					this.DisableCols[4]	= 5;
					this.DisableCols[5]	= 6;
					this.DisableCols[6]	= 7;
					this.DisableCols[7]	= 8;
					this.DisableCols[8]	= 9;
					this.DisableCols[9]	= 12;
					this.DisableCols[10]	= 13;
					this.DisableCols[11]	= 14;
					this.DisableCols[12]	= 10;
					this.DisableCols[13]	= 11;
					this.DisableCols[14]	= 15;
					this.DisableCols[15]	= 16;
					this.DisableCols[16]	= 17;
					this.DisableCols[17]	= 18;
					this.DisableCols[18]	= 19;
				}
				else {	// 正常情况是“单位”、“条形码”、“规格”、“型号”、“产地”、“金额”列为只读
					//委托代销退货，销售退货录入批次日期
					if ( Grid.specialproperty == "WTDXTH" || Grid.specialproperty == "XSTH" ){
						this.DisableCols[0] = 4;
						this.DisableCols[1] = 5;
						this.DisableCols[2] = 6;
						this.DisableCols[3] = 7;
						this.DisableCols[4] = 8;
						this.DisableCols[5] = 13;
						this.DisableCols[6] = 14;
						this.DisableCols[7] = 18;
						this.DisableCols[8] = 19;
					}
					else{
						this.DisableCols[0] = 4;
						this.DisableCols[1] = 5;
						this.DisableCols[2] = 6;
						this.DisableCols[3] = 7;
						this.DisableCols[4] = 8;
						this.DisableCols[5] = 9;
						this.DisableCols[6] = 10;
						this.DisableCols[7] = 11;
						this.DisableCols[8] = 13;
						this.DisableCols[9] = 14;
						this.DisableCols[10] = 18;
						this.DisableCols[11] = 19;
					}
				}

				this.ColWidth[0]	= 25;
				this.ColWidth[1]	= 100;
				this.ColWidth[2]	= 100;
				this.ColWidth[3]	= 150;
				this.ColWidth[4]	= 40;
				this.ColWidth[5]	= 100;
				this.ColWidth[6]	= 80;
				this.ColWidth[7]	= 80;
				this.ColWidth[8]	= 100;
				this.ColWidth[9]	= 80;
				this.ColWidth[10]	= 80;
				this.ColWidth[11]	= 80;
				this.ColWidth[12]	= 80;
				this.ColWidth[13]	= 80;
				this.ColWidth[14]	= 100;
				this.ColWidth[15]	= 80;
				this.ColWidth[16]	= 100;
				this.ColWidth[17]	= 100;
				this.ColWidth[18]	= 100;
				this.ColWidth[19]	= 100;

				this.ColEditName[0]	= "";
				this.ColEditName[1]	= "SerialSel_Edit";
				this.ColEditName[2]	= "UserCode_Edit";
				this.ColEditName[3]	= "FullName_Edit";
				this.ColEditName[4]	= "Unit_Edit";
				this.ColEditName[5]	= "EntryCode_Edit";
				this.ColEditName[6]	= "Standard_Edit";
				this.ColEditName[7]	= "Type_Edit";
				this.ColEditName[8]	= "Area_Edit";
				this.ColEditName[9]	= "ProduceDate_Edit";
				this.ColEditName[10]	= "ValidDate_Edit";
				this.ColEditName[11]	= "GoodsNumber_Edit";
				this.ColEditName[12]	= "Qty_Edit";
				this.ColEditName[13]	= "UnitRate_Edit";
				this.ColEditName[14]	= "AssistantUnit_Edit";
				this.ColEditName[15]	= "Price_Edit";
				this.ColEditName[16]	= "Total_Edit";
				this.ColEditName[17]	= "Base_Edit";
				this.ColEditName[18]	= "PlanQty_Edit";
				this.ColEditName[19]	= "CustomerCode_Edit";
				

				// 销售单数量加入缺省值 1
				this.IniCols[0] = 12;
				if ( typeof(this.IniColValues[1]) != "undefined" ) {
					this.IniCols[1] = 1;
				}
				else{
					this.IniCols[1] = '';
				}

				this.SumRow = "<tr class=\"ClientTablesum\" id=\"SumRow\" height=\"20px\"><td>合计</td>";strColsDisplay = 1;
				
				
				for ( i = 1; i < this.cols; i++ ) {
					// Judge If Display The Grid Cols
					for ( j = 1; j < this.HiddenColsArray.length; j++ ) {
						if ( this.HiddenColsArray[j] == this.ColEditName[i] ) {
							strColsDisplay = 0;
							break;
						}
						else
							strColsDisplay = 1;
						
					}
					for ( j = 0; j < this.SumCols.length; j++ ) {
						if ( i == parseInt(this.SumCols[j]) ) {
							strSumValueDisplay = "<span id=\"" + this.name + "Total" + this.SumCols[j] + "\" style=\"color:#000000\">&nbsp;0</span>";break;
						}
						else
							strSumValueDisplay = "&nbsp;";
					}
					if ( strColsDisplay == 1 ) {
						this.SumRow = this.SumRow + "<td>" + strSumValueDisplay + "</td>";
					}
					else{
						this.SumRow = this.SumRow + "<td style='display:none'>" + strSumValueDisplay + "</td>";
					}
				}

				if ( !this.Disable ) {	// 删除列所占用的单元格
					this.SumRow = this.SumRow + "<td>&nbsp;</td>";
				}
				this.SumRow = this.SumRow + "</tr>";

				//if ( !this.Disable )
				//	this.SumRow="<tr class=ClientTablesum id=SumRow height=20px><td colspan=4>&nbsp;合计</td><td><span id="+this.name+"Total4 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td><span id="+this.name+"Total6 style='color:#000000'>&nbsp;0</span><td>&nbsp;</td><td>&nbsp;</td></tr>";
				//else
				//	this.SumRow="<tr class=ClientTablesum id=SumRow height=20px><td colspan=4>&nbsp;合计</td><td><span id="+this.name+"Total4 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td><span id="+this.name+"Total6 style='color:#000000'>&nbsp;0</span><td>&nbsp;</td></tr>";
				break;

			case 16:	// 采购入库单普通格式，商品录入 不含税
				this.cols = 20;
				this.LocalUpdateCol[0] = 1;		// 局部更新列 - 商品编号
				this.LocalUpdateCol[1] = 2;		// 局部更新列 - 商品名称

				// 每行隐含域名、值数组
				this.HiddenArray[0] = "OrderId";	// 订单 ID 值
				this.HiddenArray[1] = "-1";		// 初始值
				this.HiddenArray[2] = "isUnitTow";	// 该行是否双单位
				this.HiddenArray[3] = "0";		// 默认不是双单位
				this.HiddenArray[4] = "UnitRate";	// 双单位换算关系
				this.HiddenArray[5] = "1";		// 默认换算关系为 1
				this.HiddenArray[6] = "IfSerial";	// 是否采用序列号强制管理
				this.HiddenArray[7] = "0";		// 默认为 0 ；0：非序列号强制管理；1：序列号强制管理
				this.HiddenArray[8] = "SerialIn";	// 所有入库序列号字串
				this.HiddenArray[9] = "";		// 默认为空，各序列号以逗号 ( я ) 分隔
				this.HiddenArray[10] = "UnitOne";	//小单位
				this.HiddenArray[11] = "";		// 默认为空
				this.HiddenArray[12] = "UnitTwo";	// 大单位
				this.HiddenArray[13] = "";		// 默认为空
				this.HiddenArray[14] = "InputCostPrice";	// 成本单价
				this.HiddenArray[15] = "0";		// 默认为0

				// 鼠标双击列
				this.MouseDbClickCols[0] = 3;
				this.MouseDbClickCols[1] = 18;

				// 初始化表头各列中文名
				this.Title[0]	= "No.";
				this.Title[1]	= "商品编号";
				this.Title[2]	= "商品全名";
				this.Title[3]	= "单位";
				this.Title[4]	= "条形码";
				this.Title[5]	= "规格";
				this.Title[6]	= "型号";
				this.Title[7]	= "产地";
				this.Title[8]	= "生产日期";
				this.Title[9]	= "效期至";
				this.Title[10]	= "批号";
				this.Title[11]	= "数量";
				this.Title[12]  = "单位关系";
				this.Title[13]	= "辅助单位";
				this.Title[14]	= "单价";
				this.Title[15]	= "金额";
				this.Title[16]	= "备注";
				this.Title[17]  = "未完成订货数量";
				this.Title[18]	= "序列号";
				this.Title[19]	= "多编码";
				

				// 需要合计的列
				this.SumCols[0] = 11;
				this.SumCols[1] = 15;

				this.FormatSumCols[0] = 11;
				this.FormatSumCols[1] = 1;
				this.FormatSumCols[2] = 15;
				this.FormatSumCols[3] = 2;

				this.NumericCols[0] = 11;
				this.NumericCols[1] = 14;
				this.NumericCols[2] = 15;

				this.FormatCols[0] = 11;
				this.FormatCols[1] = 1;			// 第一种格式 ( 小数保留4位 )
				this.FormatCols[2] = 14;
				this.FormatCols[3] = 1;
				this.FormatCols[4] = 15;
				this.FormatCols[5] = 2;			// 第二种格式 ( 小数保留2位 )

				this.ResultCols[0] = ";";
				this.ResultCols[1] = 11;
				this.ResultCols[2] = "*";
				this.ResultCols[3] = 14;
				this.ResultCols[4] = "=";
				this.ResultCols[5] = 15;
				this.ResultCols[6] = ";";

				// 只读列，Disable 用于显示单据明细时用
				if ( this.Disable ) {
					this.DisableCols[0]	= 1;
					this.DisableCols[1]	= 2;
					this.DisableCols[2]	= 3;
					this.DisableCols[3]	= 4;
					this.DisableCols[4]	= 5;
					this.DisableCols[5]	= 6;
					this.DisableCols[6]	= 7;
					this.DisableCols[7]	= 8;
					this.DisableCols[8]	= 9;
					this.DisableCols[9]	= 10;
					this.DisableCols[10]	= 11;
					this.DisableCols[11]	= 12;
					this.DisableCols[12]	= 13;
					this.DisableCols[13]	= 14;
					this.DisableCols[14]	= 15;
					this.DisableCols[15]	= 16;
					this.DisableCols[16]	= 17;
					this.DisableCols[17]	= 18;
					this.DisableCols[18]	= 19;
				}
				else {	// 正常情况是“单位”、“条形码”、“规格”、“型号”、“产地”、“金额”列为只读
					this.DisableCols[0] = 3;
					this.DisableCols[1] = 4;
					this.DisableCols[2] = 5;
					this.DisableCols[3] = 6;
					this.DisableCols[4] = 7;
					this.DisableCols[5] = 12;
					this.DisableCols[6] = 13;
					this.DisableCols[7] = 17;
					this.DisableCols[8] = 19;
				}

				// 每列的宽度
				this.ColWidth[0]	= 25;
				this.ColWidth[1]	= 100;
				this.ColWidth[2]	= 150;
				this.ColWidth[3]	= 40;
				this.ColWidth[4]	= 100;
				this.ColWidth[5]	= 80;
				this.ColWidth[6]	= 80;
				this.ColWidth[7]	= 100;
				this.ColWidth[8]	= 80;
				this.ColWidth[9]	= 80;
				this.ColWidth[10]	= 80;
				this.ColWidth[11]	= 80;
				this.ColWidth[12]	= 80;
				this.ColWidth[13]	= 80;
				this.ColWidth[14]	= 100;
				this.ColWidth[15]	= 80;
				this.ColWidth[16]	= 100;
				this.ColWidth[17]	= 100;
				this.ColWidth[18]	= 100;
				this.ColWidth[19]	= 100;

				// 定义各列的域名称
				this.ColEditName[0]	= "";
				this.ColEditName[1]	= "UserCode_Edit";
				this.ColEditName[2]	= "FullName_Edit";
				this.ColEditName[3]	= "Unit_Edit";
				this.ColEditName[4]	= "EntryCode_Edit";
				this.ColEditName[5]	= "Standard_Edit";
				this.ColEditName[6]	= "Type_Edit";
				this.ColEditName[7]	= "Area_Edit";
				this.ColEditName[8]	= "ProduceDate_Edit";
				this.ColEditName[9]	= "ValidDate_Edit";
				this.ColEditName[10] = "GoodsNumber_Edit";
				this.ColEditName[11]	= "Qty_Edit";
				this.ColEditName[12]	= "UnitRate_Edit";
				this.ColEditName[13]	= "AssistantUnit_Edit";
				this.ColEditName[14]	= "Price_Edit";
				this.ColEditName[15]	= "Total_Edit";
				this.ColEditName[16]	= "Base_Edit";
				this.ColEditName[17]	= "PlanQty_Edit";
				this.ColEditName[18]	= "Serial_Edit";
				this.ColEditName[19]	= "CustomerCode_Edit";
				

				this.SumRow = "<tr class=\"ClientTablesum\" id=\"SumRow\" height=\"20px\"><td>合计</td>";strColsDisplay = 1;
				
				
				for ( i = 1; i < this.cols; i++ ) {
					// Judge If Display The Grid Cols
					for ( j = 1; j < this.HiddenColsArray.length; j++ ) {
						if ( this.HiddenColsArray[j] == this.ColEditName[i] ) {
							strColsDisplay = 0;
							break;
						}
						else
							strColsDisplay = 1;
						
					}
					for ( j = 0; j < this.SumCols.length; j++ ) {
						if ( i == parseInt(this.SumCols[j]) ) {
							strSumValueDisplay = "<span id=\"" + this.name + "Total" + this.SumCols[j] + "\" style=\"color:#000000\">&nbsp;0</span>";break;
						}
						else
							strSumValueDisplay = "&nbsp;";
					}
					if ( strColsDisplay == 1 ) {
						this.SumRow = this.SumRow + "<td>" + strSumValueDisplay + "</td>";
					}
					else{
						this.SumRow = this.SumRow + "<td style='display:none'>" + strSumValueDisplay + "</td>";
					}
				}

				if ( !this.Disable ) {	// 删除列所占用的单元格
					this.SumRow = this.SumRow + "<td>&nbsp;</td>";
				}
				this.SumRow = this.SumRow + "</tr>";

				break;

			case 17:	// 新增按单结算
				this.cols = 8;
				this.HiddenArray[0] = "BillNumberID";
				this.HiddenArray[1] = "0";

				// 初始化表头
				this.Title[0] = "No.";
				this.Title[1] = "日期";
				this.Title[2] = "单据编号";
				this.Title[3] = "经手人";
				this.Title[4] = "发生金额";
				this.Title[5] = "已结算金额";
				this.Title[6] = "未结算金额";
				this.Title[7] = "本次结算金额";

				this.ResultCols[0] = 5;

				this.SumCols[0] = 4;
				this.SumCols[1] = 5;
				this.SumCols[2] = 6;
				this.SumCols[3] = 7;

				this.FormatSumCols[0] = 4;
				this.FormatSumCols[1] = 2;
				this.FormatSumCols[2] = 5;
				this.FormatSumCols[3] = 2;
				this.FormatSumCols[4] = 6;
				this.FormatSumCols[5] = 2;
				this.FormatSumCols[6] = 7;
				this.FormatSumCols[7] = 2;

				this.NumericCols[0] = 4;
				this.NumericCols[1] = 5;
				this.NumericCols[2] = 6;
				this.NumericCols[3] = 7;

				this.FormatCols[0] = 4;
				this.FormatCols[1] = 2;		// 第一种格式 ( 小数保留 4 位 )
				this.FormatCols[2] = 5;
				this.FormatCols[3] = 2;
				this.FormatCols[4] = 6;
				this.FormatCols[5] = 2;		// 第一种格式 ( 小数保留 4 位 )
				this.FormatCols[6] = 7;
				this.FormatCols[7] = 2;
     
				if ( this.Disable ) {
					this.DisableCols[0] = 1;
					this.DisableCols[1] = 2;
					this.DisableCols[2] = 3;
					this.DisableCols[3] = 4;
					this.DisableCols[4] = 5;
					this.DisableCols[5] = 6;
					this.DisableCols[6] = 7;
				}
				else {
					this.DisableCols[0] = 1;
					this.DisableCols[1] = 2;
					this.DisableCols[2] = 3;
					this.DisableCols[3] = 4;
					this.DisableCols[4] = 5;
					this.DisableCols[5] = 6;
				}

				this.ColWidth[0] = 25;
				this.ColWidth[1] = 100;
				this.ColWidth[2] = 120;
				this.ColWidth[3] = 90;
				this.ColWidth[4] = 80;
				this.ColWidth[5] = 80;
				this.ColWidth[6] = 80;
				this.ColWidth[7] = 80;

				this.ColEditName[0] = "";
				this.ColEditName[1] = "Date_Edit";
				this.ColEditName[2] = "BillCode_Edit";
				this.ColEditName[3] = "Employee_Edit";
				this.ColEditName[4] = "HappenTotal_Edit";
				this.ColEditName[5] = "OKTotal_Edit";
				this.ColEditName[6] = "UnCompleteToal_Edit";
				this.ColEditName[7] = "CompleteToal_Edit";

				if ( !this.Disable )
					this.SumRow = "<tr class=ClientTablesum id=SumRow height=20px><td>合计</td><td></td><td></td><td></td><td><span id="+this.name+"Total4 style='color:#000000'>&nbsp;0</span></td><td><span id="+this.name+"Total5 style='color:#000000'>&nbsp;0</span></td><td><span id="+this.name+"Total6 style='color:#000000'>&nbsp;0</span></td><td><span id="+this.name+"Total7 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td></tr>";
				else
					this.SumRow = "<tr class=ClientTablesum id=SumRow height=20px><td>合计</td><td></td><td></td><td></td><td><span id="+this.name+"Total4 style='color:#000000'>&nbsp;0</span></td><td><span id="+this.name+"Total5 style='color:#000000'>&nbsp;0</span></td><td><span id="+this.name+"Total6 style='color:#000000'>&nbsp;0</span></td><td><span id="+this.name+"Total7 style='color:#000000'>&nbsp;0</span></td></tr>";

				break;

			case 18:	// 固定资产购买、固定资产变卖、固定资产折旧
				this.cols = 5;

				this.LocalUpdateCol[0] = 1;	// 局部更新列
				this.LocalUpdateCol[1] = 2;	// 局部更新列

				this.HiddenArray[0] = "isUnitTow";
				this.HiddenArray[1] = "0";
				this.HiddenArray[2] = "UnitRate";
				this.HiddenArray[3] = "1";

				this.Title[0] = "No.";
				this.Title[1] = "固定资产编号";
				this.Title[2] = "固定资产全名";
				this.Title[3] = "金额";
				this.Title[4] = "备注";

				this.SumCols[0] = 3;

				this.FormatSumCols[0] = 3;
				this.FormatSumCols[1] = 2;

				this.NumericCols[0] = 3;

				this.FormatCols[0] = 3;
				this.FormatCols[1] = 2;		// 第二种格式 ( 小数保留 2 位 )

				if ( this.Disable ) {
					this.DisableCols[0] = 1;
					this.DisableCols[1] = 2;
					this.DisableCols[2] = 3;
					this.DisableCols[3] = 4;
				}

				this.ColWidth[0] = 25;
				this.ColWidth[1] = 100;
				this.ColWidth[2] = 200;
				this.ColWidth[3] = 80;
				this.ColWidth[4] = 250;

				this.ColEditName[0] = "";
				this.ColEditName[1] = "UserCode_Edit";
				this.ColEditName[2] = "FullName_Edit";
				this.ColEditName[3] = "Total_Edit";
				this.ColEditName[4] = "Base_Edit";

				if ( !this.Disable ) {
					this.SumRow = "<tr class=\"ClientTablesum\" id=\"SumRow\" height=\"20px\"><td>合计</td><td></td><td></td><td><span id=\"" + this.name + "Total3\" style=\"color:#000000\">&nbsp;0</span></td><td>&nbsp;</td><td>&nbsp;</td></tr>";
				}
				else {
					this.SumRow = "<tr class=\"ClientTablesum\" id=\"SumRow\" height=\"20px\"><td>合计</td><td></td><td></td><td><span id=\"" + this.name + "Total3\" style=\"color:#000000\">&nbsp;0</span></td><td>&nbsp;</td></tr>";
				}

				break;

			case 24:		// 货位分配单：入库、出库、调拨

				this.cols = 17;

				if (this.specialproperty == "DF")
					this.cols = 19;

				this.LocalUpdateCol[0] = 2;	// 局部更新列
				this.LocalUpdateCol[1] = 3;	// 局部更新列

				this.HiddenArray[0] = "isUnitTow";
				this.HiddenArray[1] = "0";
				this.HiddenArray[2] = "UnitRate";
				this.HiddenArray[3] = "1";
				this.HiddenArray[4] = "IfSerial";
				this.HiddenArray[5] = "0";
				this.HiddenArray[6] = "SerialOut";		// 所有出库序列号字串
				this.HiddenArray[7] = "";				// 默认为空，各序列号以逗号 ( я ) 分隔
				this.HiddenArray[8] = "UnitOne";	//小单位
				this.HiddenArray[9] = "";		// 默认为空
				this.HiddenArray[10] = "UnitTwo";	// 大单位
				this.HiddenArray[11] = "";		// 默认为空


				// 鼠标双击列
				this.MouseDbClickCols[0] = 1;
				this.MouseDbClickCols[1] = 4;

				this.Title[0]	= "No.";
				this.Title[1]	= "序列号";
				this.Title[2]	= "商品编号";
				this.Title[3]	= "商品全名";
				this.Title[4]	= "单位";
				this.Title[5]	= "条形码";
				this.Title[6]	= "规格";
				this.Title[7]	= "型号";
				this.Title[8]	= "产地";
				this.Title[9]	= "数量";
				this.Title[10]  = "单位关系";
				this.Title[11]	= "辅助单位";
				this.Title[12]	= "单价";
				this.Title[13]	= "金额";

				switch (this.specialproperty){
					case "RF":
						this.Title[14]	= "货位编号";
						this.Title[15]	= "入库货位";
						this.Title[16]	= "备注";
						break;
					case "CF":
						this.Title[14]	= "货位编号";
						this.Title[15]	= "出库货位";
						this.Title[16]	= "备注";
						break;
					case "DF":
						this.Title[14]	= "货位编号";
						this.Title[15]	= "出库货位";
						this.Title[16]	= "货位编号";
						this.Title[17]	= "入库货位";
						this.Title[18]	= "备注";
						break;
				}

				this.SumCols[0] = 9;
				this.SumCols[1] = 13;

				this.FormatSumCols[0] = 9;
				this.FormatSumCols[1] = 1;
				this.FormatSumCols[2] = 12;
				this.FormatSumCols[3] = 1;
				this.FormatSumCols[4] = 13;
				this.FormatSumCols[5] = 2;

				this.NumericCols[0] = 9;
				this.NumericCols[1] = 12;
				this.NumericCols[2] = 13;

				this.FormatCols[0] = 9;
				this.FormatCols[1] = 1;	// 第一种格式(小数保留4位)
				this.FormatCols[2] = 12;
				this.FormatCols[3] = 1;
				this.FormatCols[4] = 13;
				this.FormatCols[5] = 2;
				
				this.ResultCols[0] = ";";
				this.ResultCols[1] = 8;
				this.ResultCols[2] = "*";
				this.ResultCols[3] = 9;
				this.ResultCols[4] = "=";
				//this.ResultCols[5] = 12;
				//this.ResultCols[6] = ";";

				if ( this.Disable ) {
					this.DisableCols[0] = 1;
					this.DisableCols[1] = 2;
					this.DisableCols[2] = 3;
					this.DisableCols[3] = 4;
					this.DisableCols[4] = 5;
					this.DisableCols[5] = 6;
					this.DisableCols[6] = 7;
					this.DisableCols[7] = 8;
					this.DisableCols[8] = 9;
					this.DisableCols[9]	= 10;
					this.DisableCols[10]= 11;
					this.DisableCols[11] = 12;
					this.DisableCols[12] = 13;
					this.DisableCols[13] = 14;
					this.DisableCols[14] = 15;
					this.DisableCols[15] = 16;
					if (this.specialproperty == "DF")
					{
						this.DisableCols[16] = 17;
						this.DisableCols[17] = 18;
					}
				}
				else {
					this.DisableCols[0] = 4;
					this.DisableCols[1] = 5;
					this.DisableCols[2] = 6;
					this.DisableCols[3] = 7;
					this.DisableCols[4] = 8;
					this.DisableCols[5] = 10;
					this.DisableCols[6] = 11;
					this.DisableCols[7] = 12;
					this.DisableCols[8] = 13;
				}

				this.ColWidth[0]	= 22;
				this.ColWidth[1]	= 100;
				this.ColWidth[2]	= 100;
				this.ColWidth[3]	= 120;
				this.ColWidth[4]	= 40;
				this.ColWidth[5]	= 70;
				this.ColWidth[6]	= 70;
				this.ColWidth[7]	= 70;
				this.ColWidth[8]	= 50;
				this.ColWidth[9]	= 60;
				this.ColWidth[10]	= 60;
				this.ColWidth[11]	= 80;
				this.ColWidth[12]	= 60;
				this.ColWidth[13]	= 60;
				this.ColWidth[14]	= 80;
				this.ColWidth[15]	= 120;
				this.ColWidth[16]	= 80;
				if (this.specialproperty == "DF")
					this.ColWidth[17]	= 120;
					this.ColWidth[18]	= 80;

				this.ColEditName[0]	= "";
				this.ColEditName[1]	= "SerialSel_Edit";
				this.ColEditName[2]	= "UserCode_Edit";
				this.ColEditName[3]	= "FullName_Edit";
				this.ColEditName[4]	= "Unit_Edit";
				this.ColEditName[5]	= "EntryCode_Edit";
				this.ColEditName[6]	= "Standard_Edit";
				this.ColEditName[7]	= "Type_Edit";
				this.ColEditName[8]	= "Area_Edit";
				this.ColEditName[9]	= "Qty_Edit";
				this.ColEditName[10]	= "UnitRate_Edit";
				this.ColEditName[11]	= "AssistantUnit_Edit";
				this.ColEditName[12]	= "Price_Edit";
				this.ColEditName[13]	= "Total_Edit";

				switch (this.specialproperty){
					case "RF":
						this.ColEditName[14]	= "LocalInCode_Edit";
						this.ColEditName[15]	= "LocalIn_Edit";
						this.ColEditName[16]	= "Base_Edit";
						break;
					case "CF":
						this.ColEditName[14]	= "LocalOutCode_Edit";
						this.ColEditName[15]	= "LocalOut_Edit";
						this.ColEditName[16]	= "Base_Edit";
						break;
					case "DF":
						this.ColEditName[14]	= "LocalOutCode_Edit";
						this.ColEditName[15]	= "LocalOut_Edit";
						this.ColEditName[16]	= "LocalInCode_Edit";
						this.ColEditName[17]	= "LocalIn_Edit";
						this.ColEditName[18]	= "Base_Edit";
						break;
				}

				this.SumRow = "<tr class=\"ClientTablesum\" id=\"SumRow\" height=\"20px\"><td>合计</td>";strColsDisplay = 1;
				
				
				for ( i = 1; i < this.cols; i++ ) {
					// Judge If Display The Grid Cols
					for ( j = 1; j < this.HiddenColsArray.length; j++ ) {
						if ( this.HiddenColsArray[j] == this.ColEditName[i] ) {
							strColsDisplay = 0;
							break;
						}
						else
							strColsDisplay = 1;
						
					}
					for ( j = 0; j < this.SumCols.length; j++ ) {
						if ( i == parseInt(this.SumCols[j]) ) {
							strSumValueDisplay = "<span id=\"" + this.name + "Total" + this.SumCols[j] + "\" style=\"color:#000000\">&nbsp;0</span>";break;
						}
						else
							strSumValueDisplay = "&nbsp;";
					}
					if ( strColsDisplay == 1 ) {
						this.SumRow = this.SumRow + "<td>" + strSumValueDisplay + "</td>";
					}
					else{
						this.SumRow = this.SumRow + "<td style='display:none'>" + strSumValueDisplay + "</td>";
					}
				}

				if ( !this.Disable ) {	// 删除列所占用的单元格
					this.SumRow = this.SumRow + "<td>&nbsp;</td>";
				}
				this.SumRow = this.SumRow + "</tr>";


				break;

			case 26:		// 维修受理单、换货单 - 出库
				this.cols = 15;

				this.LocalUpdateCol[0] = 1;	// 局部更新列
				this.LocalUpdateCol[1] = 2;	// 局部更新列
				this.LocalUpdateCol[2] = 3;	// 局部更新列

				this.HiddenArray[0] = "isUnitTow";
				this.HiddenArray[1] = "0";
				this.HiddenArray[2] = "UnitRate";
				this.HiddenArray[3] = "1";
				this.HiddenArray[4] = "OIfSerial";
				this.HiddenArray[5] = "0";
				this.HiddenArray[6] = "SerialOut";	// 所有出库序列号字串
				this.HiddenArray[7] = "";		// 默认为空，各序列号以逗号 ( я ) 分隔
				this.HiddenArray[8] = "InputCostPrice";	// 成本单价
				this.HiddenArray[9] = "0";		// 默认为0
				this.HiddenArray[10] = "OGoodsNumberPrice";	// 批次单价
				this.HiddenArray[11] = "-1";		// 默认未-1
				this.HiddenArray[12] = "OHandZeroCost";	// 0成本出入库专用
				this.HiddenArray[13] = "0";		// 默认未0
				

				// 鼠标双击列
				this.MouseDbClickCols[0] = 1;
				this.MouseDbClickCols[1] = 11;

				// 初始化表头
				this.Title[0]	= "No.";
				this.Title[1]	= "序列号";
				this.Title[2]	= "商品编号";
				this.Title[3]	= "商品全名";
				this.Title[4]	= "条形码";
				this.Title[5]	= "规格";
				this.Title[6]	= "型号";
				this.Title[7]	= "产地";
				this.Title[8]	= "生产日期";
				this.Title[9]	= "效期至";
				this.Title[10]	= "批号";
				this.Title[11]	= "出库数量";
				this.Title[12]	= "单价";
				this.Title[13]	= "金额";
				this.Title[14]	= "备注";

				this.SumCols[0] = 11;
				this.SumCols[1] = 13;

				this.FormatSumCols[0] = 11;
				this.FormatSumCols[1] = 1;
				this.FormatSumCols[2] = 13;
				this.FormatSumCols[3] = 2;

				this.NumericCols[0] = 11;
				this.NumericCols[1] = 12;
				this.NumericCols[2] = 13;

				this.FormatCols[0] = 11;
				this.FormatCols[1] = 1;		// 第一种格式(小数保留4位)
				this.FormatCols[2] = 12;
				this.FormatCols[3] = 1;		// 第一种格式(小数保留4位)
				this.FormatCols[4] = 13;
				this.FormatCols[5] = 2;		// 第二种格式(小数保留2位)

				this.ResultCols[0] = ";";
				this.ResultCols[1] = 11;
				this.ResultCols[2] = "*";
				this.ResultCols[3] = 12;
				this.ResultCols[4] = "=";
				this.ResultCols[5] = 13;
				this.ResultCols[6] = ";";

				if ( this.Disable ) {
					this.DisableCols[0]	= 1;
					this.DisableCols[1]	= 2;
					this.DisableCols[2]	= 3;
					this.DisableCols[3]	= 4;
					this.DisableCols[4]	= 5;
					this.DisableCols[5]	= 6;
					this.DisableCols[6]	= 7;
					this.DisableCols[7]	= 8;
					this.DisableCols[8]	= 9;
					this.DisableCols[9]	= 10;
					this.DisableCols[10]	= 11;
					this.DisableCols[11]	= 12;
					this.DisableCols[12]	= 13;
					this.DisableCols[13]	= 14;
				}
				else {
					this.DisableCols[0]	= 4;
					this.DisableCols[1]	= 5;
					this.DisableCols[2]	= 6;
					this.DisableCols[3]	= 7;
					this.DisableCols[4]	= 8;
					this.DisableCols[5]	= 9;
					this.DisableCols[6]	= 10;					
					this.DisableCols[7]	= 13;
				}

				this.ColWidth[0]	= 25;
				this.ColWidth[1]	= 100;
				this.ColWidth[2]	= 100;
				this.ColWidth[3]	= 150;
				this.ColWidth[4]	= 100;
				this.ColWidth[5]	= 80;
				this.ColWidth[6]	= 80;
				this.ColWidth[7]	= 100;
				this.ColWidth[8]	= 80;
				this.ColWidth[9]	= 80;
				this.ColWidth[10]	= 80;
				this.ColWidth[11]	= 80;
				this.ColWidth[12]	= 80;
				this.ColWidth[13]	= 80;
				this.ColWidth[14]	= 100;

				this.ColEditName[0]	= "";
				this.ColEditName[1]	= "SerialSel_Edit";
				this.ColEditName[2]	= "OUserCode_Edit";
				this.ColEditName[3]	= "OFullName_Edit";
				this.ColEditName[4]	= "OEntryCode_Edit";
				this.ColEditName[5]	= "OStandard_Edit";
				this.ColEditName[6]	= "OType_Edit";
				this.ColEditName[7]	= "OArea_Edit";
				this.ColEditName[8]	= "OProduceDate_Edit";
				this.ColEditName[9]	= "OValidDate_Edit";
				this.ColEditName[10]	= "OGoodsNumber_Edit";
				this.ColEditName[11]	= "OQty_Edit";
				this.ColEditName[12]	= "OPrice_Edit";
				this.ColEditName[13]	= "OTotal_Edit";
				this.ColEditName[14]	= "OBase_Edit";

				this.SumRow = "<tr class=\"ClientTablesum\" id=\"SumRow\" height=\"20px\"><td>合计</td>";strColsDisplay = 1;
				
				
				for ( i = 1; i < this.cols; i++ ) {
					// Judge If Display The Grid Cols
					for ( j = 1; j < this.HiddenColsArray.length; j++ ) {
						if ( this.HiddenColsArray[j] == this.ColEditName[i] ) {
							strColsDisplay = 0;
							break;
						}
						else
							strColsDisplay = 1;
						
					}
					for ( j = 0; j < this.SumCols.length; j++ ) {
						if ( i == parseInt(this.SumCols[j]) ) {
							strSumValueDisplay = "<span id=\"" + this.name + "Total" + this.SumCols[j] + "\" style=\"color:#000000\">&nbsp;0</span>";break;
						}
						else
							strSumValueDisplay = "&nbsp;";
					}
					if ( strColsDisplay == 1 ) {
						this.SumRow = this.SumRow + "<td>" + strSumValueDisplay + "</td>";
					}
					else{
						this.SumRow = this.SumRow + "<td style='display:none'>" + strSumValueDisplay + "</td>";
					}
				}

				if ( !this.Disable ) {	// 删除列所占用的单元格
					this.SumRow = this.SumRow + "<td>&nbsp;</td>";
				}
				this.SumRow = this.SumRow + "</tr>";

				//if ( !this.Disable )
				//	this.SumRow="<tr class=ClientTablesum id=SumRow height=20px><td colspan=3>&nbsp;合计</td><td><span id="+this.name+"Total3 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td><span id="+this.name+"Total5 style='color:#000000'>&nbsp;0</span><td>&nbsp;</td><td>&nbsp;</td></tr>";
				//else
				//	this.SumRow="<tr class=ClientTablesum id=SumRow height=20px><td colspan=3>&nbsp;合计</td><td><span id="+this.name+"Total3 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td><span id="+this.name+"Total5 style='color:#000000'>&nbsp;0</span><td>&nbsp;</td></tr>";

				break;
			case 27:		// 维修受理单、换货单 - 入库
				this.cols = 15;

				this.LocalUpdateCol[0] = 1;	// 局部更新列
				this.LocalUpdateCol[1] = 2;	// 局部更新列

				this.HiddenArray[0] = "isUnitTow";
				this.HiddenArray[1] = "0";
				this.HiddenArray[2] = "UnitRate";
				this.HiddenArray[3] = "1";
				this.HiddenArray[4] = "IIfSerial";
				this.HiddenArray[5] = "0";
				this.HiddenArray[6] = "SerialIn";	// 所有入库序列号字串
				this.HiddenArray[7] = "";		// 默认为空，各序列号以逗号 ( я ) 分隔
				this.HiddenArray[8] = "IGoodsNumberPrice";	//批次单价
				this.HiddenArray[9] = "-1";		// 默认未-1
				this.HiddenArray[10] = "IHandZeroCost";	// 0成本出入库专用
				this.HiddenArray[11] = "0";		// 默认未0
				

				// 鼠标双击列
				this.MouseDbClickCols[0] = 14;

				this.Title[0]	= "No.";
				this.Title[1]	= "商品编号";
				this.Title[2]	= "商品全名";
				this.Title[3]	= "条形码";
				this.Title[4]	= "规格";
				this.Title[5]	= "型号";
				this.Title[6]	= "产地";
				this.Title[7]	= "生产日期";
				this.Title[8]	= "效期至";
				this.Title[9]	= "批号";
				this.Title[10]	= "入库数量";
				this.Title[11]	= "单价";
				this.Title[12]	= "金额";
				this.Title[13]	= "备注";
				this.Title[14]	= "序列号";

				this.SumCols[0] = 10;
				this.SumCols[1] = 12;

				this.FormatSumCols[0] = 10;
				this.FormatSumCols[1] = 1;
				this.FormatSumCols[2] = 12;
				this.FormatSumCols[3] = 2;

				this.NumericCols[0] = 10;
				this.NumericCols[1] = 11;
				this.NumericCols[2] = 12;

				this.FormatCols[0] = 10;
				this.FormatCols[1] = 1;		// 第一种格式(小数保留4位)
				this.FormatCols[2] = 11;
				this.FormatCols[3] = 1;		// 第一种格式(小数保留4位)
				this.FormatCols[4] = 12;
				this.FormatCols[5] = 2;		// 第二种格式(小数保留2位)

				this.ResultCols[0] = ";";
				this.ResultCols[1] = 10;
				this.ResultCols[2] = "*";
				this.ResultCols[3] = 11;
				this.ResultCols[4] = "=";
				this.ResultCols[5] = 12;
				this.ResultCols[6] = ";";

				if ( this.Disable ) {
					this.DisableCols[0]	= 1;
					this.DisableCols[1]	= 2;
					this.DisableCols[2]	= 3;
					this.DisableCols[3]	= 4;
					this.DisableCols[4]	= 5;
					this.DisableCols[5]	= 6;
					this.DisableCols[6]	= 7;
					this.DisableCols[7]	= 8;
					this.DisableCols[8]	= 9;
					this.DisableCols[9]	= 10;
					this.DisableCols[10]	= 11;
					this.DisableCols[11]	= 12;
					this.DisableCols[12]	= 13;
					this.DisableCols[13]	= 14;
				}
				else {
					this.DisableCols[0]	= 3;
					this.DisableCols[1]	= 4;
					this.DisableCols[2]	= 5;
					this.DisableCols[3]	= 6;					
					this.DisableCols[4]	= 12;
				}

				this.ColWidth[0]	= 25;
				this.ColWidth[1]	= 100;
				this.ColWidth[2]	= 150;
				this.ColWidth[3]	= 100;
				this.ColWidth[4]	= 80;
				this.ColWidth[5]	= 80;
				this.ColWidth[6]	= 100;
				this.ColWidth[7]	= 80;
				this.ColWidth[8]	= 80;
				this.ColWidth[9]	= 80;
				this.ColWidth[10]	= 80;
				this.ColWidth[11]	= 80;
				this.ColWidth[12]	= 80;
				this.ColWidth[13]	= 100;
				this.ColWidth[14]	= 100;

				this.ColEditName[0]	= "";
				this.ColEditName[1]	= "IUserCode_Edit";
				this.ColEditName[2]	= "IFullName_Edit";
				this.ColEditName[3]	= "IEntryCode_Edit";
				this.ColEditName[4]	= "IStandard_Edit";
				this.ColEditName[5]	= "IType_Edit";
				this.ColEditName[6]	= "IArea_Edit";
				this.ColEditName[7]	= "IProduceDate_Edit";
				this.ColEditName[8]	= "IValidDate_Edit";
				this.ColEditName[9]	= "IGoodsNumber_Edit";
				this.ColEditName[10]	= "IQty_Edit";
				this.ColEditName[11]	= "IPrice_Edit";
				this.ColEditName[12]	= "ITotal_Edit";
				this.ColEditName[13]	= "IBase_Edit";
				this.ColEditName[14]	= "Serial_Edit";

				this.SumRow = "<tr class=\"ClientTablesum\" id=\"SumRow\" height=\"20px\"><td>合计</td>";strColsDisplay = 1;
				
				
				for ( i = 1; i < this.cols; i++ ) {
					// Judge If Display The Grid Cols
					for ( j = 1; j < this.HiddenColsArray.length; j++ ) {
						if ( this.HiddenColsArray[j] == this.ColEditName[i] ) {
							strColsDisplay = 0;
							break;
						}
						else
							strColsDisplay = 1;
						
					}
					for ( j = 0; j < this.SumCols.length; j++ ) {
						if ( i == parseInt(this.SumCols[j]) ) {
							strSumValueDisplay = "<span id=\"" + this.name + "Total" + this.SumCols[j] + "\" style=\"color:#000000\">&nbsp;0</span>";break;
						}
						else
							strSumValueDisplay = "&nbsp;";
					}
					if ( strColsDisplay == 1 ) {
						this.SumRow = this.SumRow + "<td>" + strSumValueDisplay + "</td>";
					}
					else{
						this.SumRow = this.SumRow + "<td style='display:none'>" + strSumValueDisplay + "</td>";
					}
				}

				if ( !this.Disable ) {	// 删除列所占用的单元格
					this.SumRow = this.SumRow + "<td>&nbsp;</td>";
				}
				this.SumRow = this.SumRow + "</tr>";

				//if ( !this.Disable )
				//	this.SumRow="<tr class=ClientTablesum id=SumRow height=20px><td colspan=3>&nbsp;合计</td><td><span id="+this.name+"Total3 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td><span id="+this.name+"Total5 style='color:#000000'>&nbsp;0</span><td>&nbsp;</td><td>&nbsp;</td></tr>";
				//else
				//	this.SumRow="<tr class=ClientTablesum id=SumRow height=20px><td colspan=3>&nbsp;合计</td><td><span id="+this.name+"Total3 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td><span id="+this.name+"Total5 style='color:#000000'>&nbsp;0</span><td>&nbsp;</td></tr>";

				break;
				
			case 28:		// 同价调拨单(显示单价金额)
				this.cols = 18;	//商品录入 不含税

				// 局部更新列
				this.LocalUpdateCol[0] = 1;	// 序列号
				this.LocalUpdateCol[1] = 2;	// 商品编号
				this.LocalUpdateCol[2] = 3;	// 商品名称

				this.HiddenArray[0] = "isUnitTow";
				this.HiddenArray[1] = "0";
				this.HiddenArray[2] = "UnitRate";
				this.HiddenArray[3] = "1";
				this.HiddenArray[4] = "IfSerial";
				this.HiddenArray[5] = "0";
				this.HiddenArray[6] = "SerialOut";	// 所有出库序列号字串
				this.HiddenArray[7] = "";		// 默认为空，各序列号以逗号 ( я ) 分隔
				this.HiddenArray[8] = "UnitOne";	//小单位
				this.HiddenArray[9] = "";		// 默认为空
				this.HiddenArray[10] = "UnitTwo";	// 大单位
				this.HiddenArray[11] = "";		// 默认为空
				this.HiddenArray[12] = "InputCostPrice";	// 成本单价
				this.HiddenArray[13] = "0";		// 默认为0
				this.HiddenArray[14] = "GoodsNumberPrice";	// 手工指定法批次单价
				this.HiddenArray[15] = "-1";		// 默认未-1
				this.HiddenArray[16] = "HandZeroCost";	// 0成本出入库专用
				this.HiddenArray[17] = "0";		// 默认为0


				// 鼠标双击列
				this.MouseDbClickCols[0] = 1;
				this.MouseDbClickCols[1] = 4;
				this.MouseDbClickCols[2] = 12;

				this.Title[0]	= "No.";
				this.Title[1]	= "序列号";
				this.Title[2]	= "商品编号";
				this.Title[3]	= "商品全名";
				this.Title[4]	= "单位";
				this.Title[5]	= "条形码";
				this.Title[6]	= "规格";
				this.Title[7]	= "型号";
				this.Title[8]	= "产地";
				this.Title[9]	= "生产日期";
				this.Title[10]	= "效期至";
				this.Title[11]	= "批号";
				this.Title[12]	= "数量";
				this.Title[13]  = "单位关系";
				this.Title[14]	= "辅助单位";
				if ( this.specialproperty == "CBDJ" ){
					this.Title[15]	= "成本单价";
					this.Title[16]	= "成本金额";
				}
				else{
					this.Title[15]	= "单价";
					this.Title[16]	= "金额";
				}
				this.Title[17]	= "备注";

				this.SumCols[0] = 12;
				this.SumCols[1] = 16;
				
				this.FormatSumCols[0] = 12;
				this.FormatSumCols[1] = 1;
				this.FormatSumCols[2] = 16;
				this.FormatSumCols[3] = 1;
				

				this.NumericCols[0] = 12;
				this.NumericCols[1] = 15;
				this.NumericCols[2] = 16;

				this.FormatCols[0] = 12;
				this.FormatCols[1] = 1;	// 第一种格式(小数保留4位)
				this.FormatCols[2] = 15;
				this.FormatCols[3] = 1;	// 第一种格式(小数保留4位)
				this.FormatCols[4] = 16;
				this.FormatCols[5] = 2;	// 第二种格式(小数保留2位)

				if ( this.Disable ) {
					this.DisableCols[0] = 1;
					this.DisableCols[1] = 2;
					this.DisableCols[2] = 3;
					this.DisableCols[3] = 4;
					this.DisableCols[4] = 5;
					this.DisableCols[5] = 6;
					this.DisableCols[6] = 7;
					this.DisableCols[7] = 8;
					this.DisableCols[8] = 9;
					this.DisableCols[9] = 10;
					this.DisableCols[10] = 11;
					this.DisableCols[11] = 12;
					this.DisableCols[12]	= 13;
					this.DisableCols[13]	= 14;
					this.DisableCols[14]	= 15;
					this.DisableCols[15]	= 16;
					this.DisableCols[16]	= 17;
				}
				else {
					this.DisableCols[0] = 4;
					this.DisableCols[1] = 5;
					this.DisableCols[2] = 6;
					this.DisableCols[3] = 7;
					this.DisableCols[4] = 8;
					this.DisableCols[5] = 9;
					this.DisableCols[6] = 10;
					this.DisableCols[7] = 11;
					this.DisableCols[8] = 13;
					this.DisableCols[9] = 14;
					if ( this.specialproperty == "CBDJ" ){
						this.DisableCols[10] = 15;
						this.DisableCols[11] = 16;
					}
				}
				
				
				this.ResultCols[0] = 12;     //需要数量变化需从新计算的列
				this.ResultCols[1] = 15;	//徐辉 添加税前单价列 2004-4-23
				this.ResultCols[2] = 16;
				
				
				this.ColWidth[0]	= 25;
				this.ColWidth[1]	= 100;
				this.ColWidth[2]	= 100;
				this.ColWidth[3]	= 150;
				this.ColWidth[4]	= 40;
				this.ColWidth[5]	= 100;
				this.ColWidth[6]	= 80;
				this.ColWidth[7]	= 80;
				this.ColWidth[8]	= 100;
				this.ColWidth[9]	= 80;
				this.ColWidth[10]	= 80;
				this.ColWidth[11]	= 80;
				this.ColWidth[12]	= 80;
				this.ColWidth[13]	= 80;
				this.ColWidth[14]	= 100;
				this.ColWidth[15]	= 80;
				this.ColWidth[16]	= 80;
				this.ColWidth[17]	= 100;

				this.ColEditName[0]	= "";
				this.ColEditName[1]	= "SerialSel_Edit";
				this.ColEditName[2]	= "UserCode_Edit";
				this.ColEditName[3]	= "FullName_Edit";
				this.ColEditName[4]	= "Unit_Edit";
				this.ColEditName[5]	= "EntryCode_Edit";
				this.ColEditName[6]	= "Standard_Edit";
				this.ColEditName[7]	= "Type_Edit";
				this.ColEditName[8]	= "Area_Edit";
				this.ColEditName[9]	= "ProduceDate_Edit";
				this.ColEditName[10]	= "ValidDate_Edit";
				this.ColEditName[11]	= "GoodsNumber_Edit";
				this.ColEditName[12]	= "Qty_Edit";
				this.ColEditName[13]	= "UnitRate_Edit";
				this.ColEditName[14]	= "AssistantUnit_Edit";
				this.ColEditName[15]	= "Price_Edit";
				this.ColEditName[16]	= "Total_Edit";
				this.ColEditName[17]	= "Base_Edit";

				this.SumRow = "<tr class=\"ClientTablesum\" id=\"SumRow\" height=\"20px\"><td>合计</td>";strColsDisplay = 1;
				
				
				for ( i = 1; i < this.cols; i++ ) {
					// Judge If Display The Grid Cols
					for ( j = 1; j < this.HiddenColsArray.length; j++ ) {
						if ( this.HiddenColsArray[j] == this.ColEditName[i] ) {
							strColsDisplay = 0;
							break;
						}
						else
							strColsDisplay = 1;
						
					}
					for ( j = 0; j < this.SumCols.length; j++ ) {
						if ( i == parseInt(this.SumCols[j]) ) {
							strSumValueDisplay = "<span id=\"" + this.name + "Total" + this.SumCols[j] + "\" style=\"color:#000000\">&nbsp;0</span>";break;
						}
						else
							strSumValueDisplay = "&nbsp;";
					}
					if ( strColsDisplay == 1 ) {
						this.SumRow = this.SumRow + "<td>" + strSumValueDisplay + "</td>";
					}
					else{
						this.SumRow = this.SumRow + "<td style='display:none'>" + strSumValueDisplay + "</td>";
					}
				}
				
				if ( !this.Disable ) {	// 删除列所占用的单元格
					this.SumRow = this.SumRow + "<td>&nbsp;</td>";
				}
				this.SumRow = this.SumRow + "</tr>";

				//if ( !this.Disable )
				//	this.SumRow="<tr class=ClientTablesum id=SumRow height=20px><td colspan=4>&nbsp;合计</td><td><span id="+this.name+"Total4 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td>&nbsp;</td></tr>";
				//else
				//	this.SumRow="<tr class=ClientTablesum id=SumRow height=20px><td colspan=4>&nbsp;合计</td><td><span id="+this.name+"Total4 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td></tr>";

				break;
			case 29:	// 销售税率格式订单
				this.cols = 19;

				this.LocalUpdateCol[0] = 1;	// 局部更新列
				this.LocalUpdateCol[1] = 2;	// 局部更新列

				this.HiddenArray[0] = "OrderID";
				this.HiddenArray[1] = "-1";
				this.HiddenArray[2] = "isUnitTow";
				this.HiddenArray[3] = "0";
				this.HiddenArray[4] = "UnitRate";
				this.HiddenArray[5] = "1";
				this.HiddenArray[6] = "IfSerial"	// 是否采用序列号强制管理
				this.HiddenArray[7] = "0";		// 默认为 0 ；0：非序列号强制管理；1：序列号强制管理
				this.HiddenArray[8] = "UnitOne";	//小单位
				this.HiddenArray[9] = "";		// 默认为空
				this.HiddenArray[10] = "UnitTwo";	// 大单位
				this.HiddenArray[11] = "";		// 默认为空			
				
		
				// 鼠标双击列
				this.MouseDbClickCols[0] = 3;

				// 初始化表头
				this.Title[0]	= "No.";
				this.Title[1]	= "商品编号";
				this.Title[2]	= "商品全名";
				this.Title[3]	= "单位";
				this.Title[4]	= "条形码";
				this.Title[5]	= "规格";
				this.Title[6]	= "型号";
				this.Title[7]	= "产地";
				this.Title[8]	= "数量"
				this.Title[9]  = "单位关系";
				this.Title[10]	= "辅助单位";;
				this.Title[11]	= "单价";
				this.Title[12]	= "金额";
				this.Title[13]	= "税率";
				this.Title[14]	= "税后单价";
				this.Title[15]	= "税后金额";
				this.Title[16]	= "已发货数量";
				this.Title[17]	= "备注";
				this.Title[18]	= "多编码";

				this.SumCols[0] = 8;
				this.SumCols[1] = 12;
				this.SumCols[2] = 15;
				this.SumCols[3] = 16;
				
				this.IniCols[0] = 13;
				if ( typeof(this.IniColValues[0]) != "undefined" )
					this.IniCols[1] = this.IniColValues[0];
				else
					this.IniCols[1] = 17;	// 默认 17 点税

				this.FormatSumCols[0] = 8;
				this.FormatSumCols[1] = 1;
				this.FormatSumCols[2] = 12;
				this.FormatSumCols[3] = 2;
				this.FormatSumCols[4] = 15;
				this.FormatSumCols[5] = 2;
				this.FormatSumCols[6] = 16;
				this.FormatSumCols[7] = 1;


				this.NumericCols[0] = 8;
				this.NumericCols[1] = 11;
				this.NumericCols[2] = 12;
				this.NumericCols[3] = 13;
				this.NumericCols[4] = 14;
				this.NumericCols[5] = 15;
				this.NumericCols[6] = 16;

				this.FormatCols[0] = 8;
				this.FormatCols[1] = 1;		// 第一种格式 ( 小数保留 4 位 )
				this.FormatCols[2] = 11;
				this.FormatCols[3] = 1;
				this.FormatCols[4] = 12;
				this.FormatCols[5] = 2;		// 第二种格式 ( 小数保留 2 位 )
				this.FormatCols[6] = 13;
				this.FormatCols[7] = 1;
				this.FormatCols[8] = 14;
				this.FormatCols[9] = 1;
				this.FormatCols[10] = 15;
				this.FormatCols[11] = 2;
				this.FormatCols[12] = 16;
				this.FormatCols[13] = 1;

				this.ResultCols[0] = 8;
				this.ResultCols[1] = 11;
				this.ResultCols[2] = 13;
				this.ResultCols[3] = 14;
				this.ResultCols[4] = 15

				if ( this.Disable ) {
					this.DisableCols[0]	= 1;
					this.DisableCols[1]	= 2;
					this.DisableCols[2]	= 3;
					this.DisableCols[3]	= 4;
					this.DisableCols[4]	= 5;
					this.DisableCols[5]	= 6;
					this.DisableCols[6]	= 7;
					this.DisableCols[7]	= 8;
					this.DisableCols[8]	= 9;
					this.DisableCols[9]	= 10;
					this.DisableCols[10]	= 11;
					this.DisableCols[11]	= 12;
					this.DisableCols[12]	= 13;
					this.DisableCols[13]	= 14;
					this.DisableCols[14]	= 15;
					this.DisableCols[15]	= 16;
					this.DisableCols[16]	= 17;
					this.DisableCols[17]	= 18;
				}
				else {
					this.DisableCols[0]	= 3;
					this.DisableCols[1]	= 4;
					this.DisableCols[2]	= 5;
					this.DisableCols[3]	= 6;
					this.DisableCols[4]	= 7;
					this.DisableCols[5]	= 9;
					this.DisableCols[6]	= 10;
					this.DisableCols[7]	= 12;
					this.DisableCols[8]	= 13;
					this.DisableCols[9]= 16;
					this.DisableCols[10]= 18;
				}

				this.ColWidth[0]	= 25;
				this.ColWidth[1]	= 100;
				this.ColWidth[2]	= 150;
				this.ColWidth[3]	= 40;
				this.ColWidth[4]	= 100;
				this.ColWidth[5]	= 80;
				this.ColWidth[6]	= 80;
				this.ColWidth[7]	= 100;
				this.ColWidth[8]	= 80;
				this.ColWidth[9]	= 80;
				this.ColWidth[10]	= 100;
				this.ColWidth[11]	= 80;
				this.ColWidth[12]	= 80;
				this.ColWidth[13]	= 80;
				this.ColWidth[14]	= 80;
				this.ColWidth[15]	= 80;
				this.ColWidth[16]	= 80;
				this.ColWidth[17]	= 100;
				this.ColWidth[18]	= 100;

				this.ColEditName[0]	= "";
				this.ColEditName[1]	= "UserCode_Edit";
				this.ColEditName[2]	= "FullName_Edit";
				this.ColEditName[3]	= "Unit_Edit";
				this.ColEditName[4]	= "EntryCode_Edit";
				this.ColEditName[5]	= "Standard_Edit";
				this.ColEditName[6]	= "Type_Edit";
				this.ColEditName[7]	= "Area_Edit";
				this.ColEditName[8]	= "Qty_Edit";
				this.ColEditName[9]	= "UnitRate_Edit";
				this.ColEditName[10]	= "AssistantUnit_Edit";
				this.ColEditName[11]	= "Price_Edit";
				this.ColEditName[12]	= "NoTaxTotal_Edit";
				this.ColEditName[13]	= "TaxRate_Edit";
				this.ColEditName[14]	= "TaxPrice_Edit";
				this.ColEditName[15]	= "Total_Edit";
				this.ColEditName[16]	= "ConsignmentQty_Edit";
				this.ColEditName[17]	= "Comment_Edit";
				this.ColEditName[18]	= "CustomerCode_Edit";

				this.SumRow = "<tr class=\"ClientTablesum\" id=\"SumRow\" height=\"20px\"><td>合计</td>";strColsDisplay = 1;
				
				
				for ( i = 1; i < this.cols; i++ ) {
					// Judge If Display The Grid Cols
					for ( j = 1; j < this.HiddenColsArray.length; j++ ) {
						if ( this.HiddenColsArray[j] == this.ColEditName[i] ) {
							strColsDisplay = 0;
							break;
						}
						else
							strColsDisplay = 1;
						
					}
					for ( j = 0; j < this.SumCols.length; j++ ) {
						if ( i == parseInt(this.SumCols[j]) ) {
							strSumValueDisplay = "<span id=\"" + this.name + "Total" + this.SumCols[j] + "\" style=\"color:#000000\">&nbsp;0</span>";break;
						}
						else
							strSumValueDisplay = "&nbsp;";
					}
					if ( strColsDisplay == 1 ) {
						this.SumRow = this.SumRow + "<td>" + strSumValueDisplay + "</td>";
					}
					else{
						this.SumRow = this.SumRow + "<td style='display:none'>" + strSumValueDisplay + "</td>";
					}
				}

				if ( !this.Disable ) {	// 删除列所占用的单元格
					this.SumRow = this.SumRow + "<td>&nbsp;</td>";
				}
				this.SumRow = this.SumRow + "</tr>";

				//if ( !this.Disable )
				//	this.SumRow="<tr class=ClientTablesum id=SumRow height=20px><td colspan=4>&nbsp;合计</td><td><span id="+this.name+"Total4 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td><span id="+this.name+"Total6 style='color:#000000'>&nbsp;0</span></td><td><span id="+this.name+"Total7 style='color:#000000'>&nbsp;0</span><td>&nbsp;</td><td>&nbsp;</td></tr>";
				//else
				//	this.SumRow="<tr class=ClientTablesum id=SumRow height=20px><td colspan=4>&nbsp;合计</td><td><span id="+this.name+"Total4 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td><span id="+this.name+"Total6 style='color:#000000'>&nbsp;0</span></td><td><span id="+this.name+"Total7 style='color:#000000'>&nbsp;0</span><td>&nbsp;</td></tr>";

				break;
			case 30:	// 销售订单折扣
				this.cols = 19;		// 商品录入 折扣

				// 局部更新列
				this.LocalUpdateCol[0] = 1;	// 商品编号
				this.LocalUpdateCol[1] = 2;	// 商品名称

				this.HiddenArray[0] = "OrderID";
				this.HiddenArray[1] = "-1";
				this.HiddenArray[2] = "isUnitTow";
				this.HiddenArray[3] = "0";
				this.HiddenArray[4] = "UnitRate";
				this.HiddenArray[5] = "1";
				this.HiddenArray[6] = "IfSerial"	// 是否采用序列号强制管理
				this.HiddenArray[7] = "0";		// 默认为 0 ；0：非序列号强制管理；1：序列号强制管理
				this.HiddenArray[8] = "UnitOne";	//小单位
				this.HiddenArray[9] = "";		// 默认为空
				this.HiddenArray[10] = "UnitTwo";	// 大单位
				this.HiddenArray[11] = "";		// 默认为空			
				
				// 鼠标双击列
				this.MouseDbClickCols[0] = 3;

				// 初始化表头
				this.Title[0]	= "No.";
				this.Title[1]	= "商品编号";
				this.Title[2]	= "商品全名";
				this.Title[3]	= "单位";
				this.Title[4]	= "条形码";
				this.Title[5]	= "规格";
				this.Title[6]	= "型号";
				this.Title[7]	= "产地";
				this.Title[8]	= "数量";
				this.Title[9]  = "单位关系";
				this.Title[10]	= "辅助单位";
				this.Title[11]	= "单价";
				this.Title[12]	= "金额";
				this.Title[13]	= "扣率";
				this.Title[14]	= "折后单价";
				this.Title[15]	= "折后金额";
				this.Title[16]	= "已发货数量";
				this.Title[17]	= "备注";
				this.Title[18]	= "多编码";

				this.SumCols[0] = 8;
				this.SumCols[1] = 12;
				this.SumCols[2] = 15;
				this.SumCols[3] = 16;

				this.FormatSumCols[0] = 8;
				this.FormatSumCols[1] = 1;
				this.FormatSumCols[2] = 12;
				this.FormatSumCols[3] = 2;
				this.FormatSumCols[4] = 15;
				this.FormatSumCols[5] = 2;
				this.FormatSumCols[6] = 16;
				this.FormatSumCols[7] = 1;

				this.IniCols[0] = 13;
				if ( typeof(this.IniColValues[0]) != "undefined" )
					this.IniCols[1] = this.IniColValues[0];
				else
					this.IniCols[1] = 1;

				// 销售单数量加入缺省值 1
				if ( typeof(this.IniColValues[1]) != "undefined" ) {
					this.IniCols[2] = 8;
					this.IniCols[3] = 1;
				}

				this.NumericCols[0] = 8;
				this.NumericCols[1] = 11;  //徐辉 2004-4-23 添加扣前单价
				this.NumericCols[2] = 12;
				this.NumericCols[3] = 13
				this.NumericCols[4] = 14;
				this.NumericCols[5] = 15;
				this.NumericCols[6] = 16;

				if ( this.Disable ) {
					this.DisableCols[0]	= 1;
					this.DisableCols[1]	= 2;
					this.DisableCols[2]	= 3;
					this.DisableCols[3]	= 4;
					this.DisableCols[4]	= 5;
					this.DisableCols[5]	= 6;
					this.DisableCols[6]	= 7;
					this.DisableCols[7]	= 8;
					this.DisableCols[8]	= 9;
					this.DisableCols[9]	= 10;
					this.DisableCols[10]	= 11;
					this.DisableCols[11]	= 12;
					this.DisableCols[12]	= 13;
					this.DisableCols[13]	= 14;
					this.DisableCols[14]	= 15;
					this.DisableCols[15]	= 16;
					this.DisableCols[16]	= 17;
					this.DisableCols[17]	= 18;
				}
				else {
					this.DisableCols[0] = 3;
					this.DisableCols[1] = 4;
					this.DisableCols[2] = 5;
					this.DisableCols[3] = 6;
					this.DisableCols[4] = 7;
					//this.DisableCols[5] = 10; //徐辉 2004-4-22 折前单价可修改 
					this.DisableCols[5] = 9;
					this.DisableCols[6] = 10;
					this.DisableCols[7] = 12;
					this.DisableCols[8] = 16;
					this.DisableCols[9] = 18;
				}

				this.FormatCols[0]	= 8;	// 数量
				this.FormatCols[1]	= 1;	// 第一种格式(小数保留4位)
				this.FormatCols[2]	= 14;	// 折后单价
				this.FormatCols[3]	= 1;
				this.FormatCols[4]	= 12;	// 金额
				this.FormatCols[5]	= 2;
				this.FormatCols[6]	= 15;	// 折后金额
				this.FormatCols[7]	= 2;	// 第二种格式(小数保留2位)
				this.FormatCols[8]	= 11;	// 单价
				this.FormatCols[9]	= 1;
				this.FormatCols[10]	= 13;	//折扣率
				this.FormatCols[11]	= 1;

				// 计算折后金额
				this.ResultCols[0] = 8;
				this.ResultCols[1] = 11;
				this.ResultCols[2] = 13;
				this.ResultCols[3] = 14;
				this.ResultCols[4] = 15;
	 
				this.ColWidth[0]	= 25;
				this.ColWidth[1]	= 100;
				this.ColWidth[2]	= 150;
				this.ColWidth[3]	= 40;
				this.ColWidth[4]	= 100;
				this.ColWidth[5]	= 80;
				this.ColWidth[6]	= 80;
				this.ColWidth[7]	= 100;
				this.ColWidth[8]	= 80;
				this.ColWidth[9]	= 80;
				this.ColWidth[10]	= 100;
				this.ColWidth[11]	= 80;
				this.ColWidth[12]	= 80;
				this.ColWidth[13]	= 40;
				this.ColWidth[14]	= 80;
				this.ColWidth[15]	= 80;
				this.ColWidth[16]	= 80;
				this.ColWidth[17]	= 100;
				this.ColWidth[18]	= 100;

				this.ColEditName[0]	= "";
				this.ColEditName[1]	= "UserCode_Edit";
				this.ColEditName[2]	= "FullName_Edit";
				this.ColEditName[3]	= "Unit_Edit";
				this.ColEditName[4]	= "EntryCode_Edit";
				this.ColEditName[5]	= "Standard_Edit";
				this.ColEditName[6]	= "Type_Edit";
				this.ColEditName[7]	= "Area_Edit";
				this.ColEditName[8]	= "Qty_Edit";
				this.ColEditName[9]	= "UnitRate_Edit";
				this.ColEditName[10]	= "AssistantUnit_Edit";
				this.ColEditName[11]	= "Price_Edit";
				this.ColEditName[12]	= "NoDiscountTotal_Edit";
				this.ColEditName[13]	= "Discount_Edit";
				this.ColEditName[14]	= "DiscountPrice_Edit";
				this.ColEditName[15]	= "Total_Edit";
				this.ColEditName[16]	= "ConsignmentQty_Edit";
				this.ColEditName[17]	= "Comment_Edit";
				this.ColEditName[18]	= "CustomerCode_Edit";

				this.SumRow = "<tr class=\"ClientTablesum\" id=\"SumRow\" height=\"20px\"><td>合计</td>";strColsDisplay = 1;
				
				
				for ( i = 1; i < this.cols; i++ ) {
					// Judge If Display The Grid Cols
					for ( j = 1; j < this.HiddenColsArray.length; j++ ) {
						if ( this.HiddenColsArray[j] == this.ColEditName[i] ) {
							strColsDisplay = 0;
							break;
						}
						else
							strColsDisplay = 1;
						
					}
					for ( j = 0; j < this.SumCols.length; j++ ) {
						if ( i == parseInt(this.SumCols[j]) ) {
							strSumValueDisplay = "<span id=\"" + this.name + "Total" + this.SumCols[j] + "\" style=\"color:#000000\">&nbsp;0</span>";break;
						}
						else
							strSumValueDisplay = "&nbsp;";
					}
					if ( strColsDisplay == 1 ) {
						this.SumRow = this.SumRow + "<td>" + strSumValueDisplay + "</td>";
					}
					else{
						this.SumRow = this.SumRow + "<td style='display:none'>" + strSumValueDisplay + "</td>";
					}
				}

				if ( !this.Disable ) {	// 删除列所占用的单元格
					this.SumRow = this.SumRow + "<td>&nbsp;</td>";
				}
				this.SumRow = this.SumRow + "</tr>";

				//if ( !this.Disable )
				//	this.SumRow="<tr class=ClientTablesum id=SumRow height=20px><td colspan=4>&nbsp;合计</td><td><span id="+this.name+"Total4 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td><span id="+this.name+"Total6 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td>&nbsp;</td><td><span id="+this.name+"Total9 style='color:#000000'>&nbsp;0</span><td>&nbsp;</td><td>&nbsp;</td></tr>";
				//else
				//	this.SumRow="<tr class=ClientTablesum id=SumRow height=20px><td colspan=4>&nbsp;合计</td><td><span id="+this.name+"Total4 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td><span id="+this.name+"Total6 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td>&nbsp;</td><td><span id="+this.name+"Total9 style='color:#000000'>&nbsp;0</span><td>&nbsp;</td></tr>";

				break;
			case 31:	// 采购订单税率格式
				this.cols = 19;		// 商品录入 含税

				this.LocalUpdateCol[0] = 1;	// 局部更新列
				this.LocalUpdateCol[1] = 2;	// 局部更新列

				// 每行隐含域名、值数组
				this.HiddenArray[0] = "OrderId";	// 订单 ID 值
				this.HiddenArray[1] = "-1";		// 初始值
				this.HiddenArray[2] = "isUnitTow";	// 该行是否双单位
				this.HiddenArray[3] = "0";		// 默认不是双单位
				this.HiddenArray[4] = "UnitRate";	// 双单位换算关系
				this.HiddenArray[5] = "1";		// 默认换算关系为 1
				this.HiddenArray[6] = "IfSerial"	// 是否采用序列号强制管理
				this.HiddenArray[7] = "0";		// 默认为 0 ；0：非序列号强制管理；1：序列号强制管理
				this.HiddenArray[8] = "UnitOne";	//小单位
				this.HiddenArray[9] = "";		// 默认为空
				this.HiddenArray[10] = "UnitTwo";	// 大单位
				this.HiddenArray[11] = "";		// 默认为空

				// 鼠标双击列
				this.MouseDbClickCols[0] = 3;

				// 初始化表头
				this.Title[0]	= "No.";
				this.Title[1]	= "商品编号";
				this.Title[2]	= "商品全名";
				this.Title[3]	= "单位";
				this.Title[4]	= "条形码";
				this.Title[5]	= "规格";
				this.Title[6]	= "型号";
				this.Title[7]	= "产地";
				this.Title[8]	= "数量";
				this.Title[9]   = "单位关系";
				this.Title[10]	= "辅助单位";
				this.Title[11]	= "单价";
				this.Title[12]	= "金额";
				this.Title[13]	= "税率";
				this.Title[14]	= "含税单价";
				this.Title[15]	= "价税合计";
				this.Title[16]	= "已收货数量";
				this.Title[17]	= "备注";
				this.Title[18]	= "多编码";

				this.SumCols[0] = 8;
				this.SumCols[1] = 12;
				this.SumCols[2] = 15;
				this.SumCols[3] = 16;

				this.FormatSumCols[0] = 8;
				this.FormatSumCols[1] = 1;
				this.FormatSumCols[2] = 12;
				this.FormatSumCols[3] = 2;
				this.FormatSumCols[4] = 15;
				this.FormatSumCols[5] = 2;
				this.FormatSumCols[6] = 16;
				this.FormatSumCols[7] = 1;

				this.IniCols[0] = 13;
				if ( typeof(this.IniColValues[0]) != "undefined" )
					this.IniCols[1] = this.IniColValues[0];
				else
					this.IniCols[1] = "17";

				this.NumericCols[0] = 8;
				this.NumericCols[1] = 11;
				this.NumericCols[2] = 14;
				this.NumericCols[3] = 15;
				this.NumericCols[4] = 16;

				if ( this.Disable ) {
					this.DisableCols[0]	= 1;
					this.DisableCols[1]	= 2;
					this.DisableCols[2]	= 3;
					this.DisableCols[3]	= 4;
					this.DisableCols[4]	= 5;
					this.DisableCols[5]	= 6;
					this.DisableCols[6]	= 7;
					this.DisableCols[7]	= 8;
					this.DisableCols[8]	= 9;
					this.DisableCols[9]	= 10;
					this.DisableCols[10]	= 11;
					this.DisableCols[11]	= 12;
					this.DisableCols[12]	= 13;
					this.DisableCols[13]	= 14;
					this.DisableCols[14]	= 15;
					this.DisableCols[15]	= 16;
					this.DisableCols[16]	= 17;
					this.DisableCols[17]	= 18;
				}
				else {
					this.DisableCols[0]	= 3;
					this.DisableCols[1]	= 4;
					this.DisableCols[2]	= 5;
					this.DisableCols[3]	= 6;
					this.DisableCols[4]	= 7;
					//this.DisableCols[5]	= 11;  //税前单价可修改 2004-4-22 徐辉 
					this.DisableCols[5]	= 9;
					this.DisableCols[6]	= 10;
					this.DisableCols[7]	= 12;
					this.DisableCols[8]	= 13;
					this.DisableCols[9]	= 16;
					this.DisableCols[10]	= 18;
				}

				this.FormatCols[0] = 8;		// 数量
				this.FormatCols[1] = 1;		// 第一种格式(小数保留4位)
				this.FormatCols[2] = 14;	// 含税单价
				this.FormatCols[3] = 1;
				this.FormatCols[4] = 12;	// 金额
				this.FormatCols[5] = 2;
				this.FormatCols[6] = 15;	// 价税合计
				this.FormatCols[7] = 2;		//第二种格式(小数保留2位)
				this.FormatCols[8] = 11;    //单价
				this.FormatCols[9] = 1;
				this.FormatCols[10] = 16;    //已发货数量
				this.FormatCols[11] = 1;

				this.ResultCols[0] = 8;
				this.ResultCols[1] = 11
				this.ResultCols[2] = 14
				this.ResultCols[3] = 15
 	 
				this.ColWidth[0]	= 25;
				this.ColWidth[1]	= 100;
				this.ColWidth[2]	= 150;
				this.ColWidth[3]	= 40;
				this.ColWidth[4]	= 100;
				this.ColWidth[5]	= 80;
				this.ColWidth[6]	= 80;
				this.ColWidth[7]	= 100;
				this.ColWidth[8]	= 80;
				this.ColWidth[9]	= 80;
				this.ColWidth[10]	= 100;
				this.ColWidth[11]	= 80;
				this.ColWidth[12]	= 80;
				this.ColWidth[13]	= 40;
				this.ColWidth[14]	= 80;
				this.ColWidth[15]	= 80;
				this.ColWidth[16]	= 80;
				this.ColWidth[17]	= 100;
				this.ColWidth[18]	= 100;

				this.ColEditName[0]	= "";
				this.ColEditName[1]	= "UserCode_Edit";
				this.ColEditName[2]	= "FullName_Edit";
				this.ColEditName[3]	= "Unit_Edit";
				this.ColEditName[4]	= "EntryCode_Edit";
				this.ColEditName[5]	= "Standard_Edit";
				this.ColEditName[6]	= "Type_Edit";
				this.ColEditName[7]	= "Area_Edit";
				this.ColEditName[8]	= "Qty_Edit";
				this.ColEditName[9]	= "UnitRate_Edit";
				this.ColEditName[10]	= "AssistantUnit_Edit";
				this.ColEditName[11]	= "Price_Edit";
				this.ColEditName[12]	= "NoTaxTotal_Edit";
				this.ColEditName[13]	= "TaxRate_Edit";
				this.ColEditName[14]	= "TaxPrice_Edit";
				this.ColEditName[15]	= "Total_Edit";
				this.ColEditName[16]	= "ConsignmentQty_Edit";
				this.ColEditName[17]	= "Comment_Edit";
				this.ColEditName[18]	= "CustomerCode_Edit";

				this.SumRow = "<tr class=\"ClientTablesum\" id=\"SumRow\" height=\"20px\"><td>合计</td>";strColsDisplay = 1;
				
				
				for ( i = 1; i < this.cols; i++ ) {
					// Judge If Display The Grid Cols
					for ( j = 1; j < this.HiddenColsArray.length; j++ ) {
						if ( this.HiddenColsArray[j] == this.ColEditName[i] ) {
							strColsDisplay = 0;
							break;
						}
						else
							strColsDisplay = 1;
						
					}
					for ( j = 0; j < this.SumCols.length; j++ ) {
						if ( i == parseInt(this.SumCols[j]) ) {
							strSumValueDisplay = "<span id=\"" + this.name + "Total" + this.SumCols[j] + "\" style=\"color:#000000\">&nbsp;0</span>";break;
						}
						else
							strSumValueDisplay = "&nbsp;";
					}
					if ( strColsDisplay == 1 ) {
						this.SumRow = this.SumRow + "<td>" + strSumValueDisplay + "</td>";
					}
					else{
						this.SumRow = this.SumRow + "<td style='display:none'>" + strSumValueDisplay + "</td>";
					}
				}

				if ( !this.Disable ) {	// 删除列所占用的单元格
					this.SumRow = this.SumRow + "<td>&nbsp;</td>";
				}
				this.SumRow = this.SumRow + "</tr>";

				//if ( !this.Disable )
				//	this.SumRow="<tr class=ClientTablesum id=SumRow height=20px><td colspan=4>&nbsp;合计</td><td><span id="+this.name+"Total4 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td><span id="+this.name+"Total6 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td>&nbsp;</td><td><span id="+this.name+"Total9 style='color:#000000'>&nbsp;0</span><td>&nbsp;</td><td>&nbsp;</td></tr>";
				//else
				//	this.SumRow="<tr class=ClientTablesum id=SumRow height=20px><td colspan=4>&nbsp;合计</td><td><span id="+this.name+"Total4 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td><span id="+this.name+"Total6 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td>&nbsp;</td><td><span id="+this.name+"Total9 style='color:#000000'>&nbsp;0</span><td>&nbsp;</td></tr>";

				break;
			case 32:	// 采购订单折扣
				this.cols = 19;		// 商品录入 折扣

				this.LocalUpdateCol[0] = 1;	// 局部更新列
				this.LocalUpdateCol[1] = 2;	// 局部更新列

				// 每行隐含域名、值数组
				this.HiddenArray[0] = "OrderId";	// 订单 ID 值
				this.HiddenArray[1] = "-1";		// 初始值
				this.HiddenArray[2] = "isUnitTow";	// 该行是否双单位
				this.HiddenArray[3] = "0";		// 默认不是双单位
				this.HiddenArray[4] = "UnitRate";	// 双单位换算关系
				this.HiddenArray[5] = "1";		// 默认换算关系为 1
				this.HiddenArray[6] = "IfSerial"	// 是否采用序列号强制管理
				this.HiddenArray[7] = "0";		// 默认为 0 ；0：非序列号强制管理；1：序列号强制管理
				this.HiddenArray[8] = "UnitOne";	//小单位
				this.HiddenArray[9] = "";		// 默认为空
				this.HiddenArray[10] = "UnitTwo";	// 大单位
				this.HiddenArray[11] = "";		// 默认为空
	 

				// 鼠标双击列
				this.MouseDbClickCols[0] = 3;
				this.MouseDbClickCols[1] = 17;

				this.Title[0]	= "No.";
				this.Title[1]	= "商品编号";
				this.Title[2]	= "商品全名";
				this.Title[3]	= "单位";
				this.Title[4]	= "条形码";
				this.Title[5]	= "规格";
				this.Title[6]	= "型号";
				this.Title[7]	= "产地";
				this.Title[8]	= "数量";
				this.Title[9]	= "单位关系";
				this.Title[10]	= "辅助单位";
				this.Title[11]	= "单价";
				this.Title[12]	= "金额";
				this.Title[13]	= "扣率";
				this.Title[14]	= "折后单价";
				this.Title[15]	= "折后金额";
				this.Title[16]	= "已收货数量";
				this.Title[17]	= "备注";
				this.Title[18]	= "多编码";

				this.SumCols[0] = 8;
				this.SumCols[1] = 12;
				this.SumCols[2] = 15;
				this.SumCols[3] = 16;

				this.FormatSumCols[0] = 8;
				this.FormatSumCols[1] = 1;
				this.FormatSumCols[2] = 12;
				this.FormatSumCols[3] = 2;
				this.FormatSumCols[4] = 15;
				this.FormatSumCols[5] = 2;
				this.FormatSumCols[6] = 16;
				this.FormatSumCols[7] = 1;

				this.IniCols[0] = 13;
				if ( typeof(this.IniColValues[0]) != "undefined" )
					this.IniCols[1] = this.IniColValues[0];
				else
					this.IniCols[1] = 1;

				this.NumericCols[0] = 8;
				this.NumericCols[1] = 11;
				this.NumericCols[2] = 13;
				this.NumericCols[3] = 14;
				this.NumericCols[4] = 15;
				this.NumericCols[5] = 16;

				if ( this.Disable ) {
					this.DisableCols[0]	= 1;
					this.DisableCols[1]	= 2;
					this.DisableCols[2]	= 3;
					this.DisableCols[3]	= 4;
					this.DisableCols[4]	= 5;
					this.DisableCols[5]	= 6;
					this.DisableCols[6]	= 7;
					this.DisableCols[7]	= 8;
					this.DisableCols[8]	= 9;
					this.DisableCols[9]	= 10;
					this.DisableCols[10]	= 11;
					this.DisableCols[11]	= 12;
					this.DisableCols[12]	= 13;
					this.DisableCols[13]	= 14;
					this.DisableCols[14]	= 15;
					this.DisableCols[15]	= 16;
					this.DisableCols[16]	= 17;
					this.DisableCols[17]	= 18;
				}
				else {
					this.DisableCols[0]	= 3;
					this.DisableCols[1]	= 4;
					this.DisableCols[2]	= 5;
					this.DisableCols[3]	= 6;
					this.DisableCols[4]	= 7;
					//this.DisableCols[5]	= 11; //折前单价可修改 2004-4-22 徐辉
					this.DisableCols[5]	= 9;
					this.DisableCols[6]	= 10;
					this.DisableCols[7]	= 12;
					this.DisableCols[8]	= 16;
					this.DisableCols[9]	= 18;
				}

				this.FormatCols[0]	= 8;	// 数量
				this.FormatCols[1]	= 1;	// 第一种格式(小数保留4位)
				this.FormatCols[2]	= 14;	// 折后单价
				this.FormatCols[3]	= 1;
				this.FormatCols[4]	= 12;	// 金额
				this.FormatCols[5]	= 2;
				this.FormatCols[6]	= 15;	// 折后金额
				this.FormatCols[7]	= 2;	// 第二种格式(小数保留2位)
				this.FormatCols[8]	= 11;	// 单价
				this.FormatCols[9]	= 1;
				this.FormatCols[10]	= 13;	//折扣率
				this.FormatCols[11]	= 1;
				this.FormatCols[12]	= 16;	//折扣率
				this.FormatCols[13]	= 1;

				this.ResultCols[0] = 8;
				this.ResultCols[1] = 11;
				this.ResultCols[2] = 12;
				this.ResultCols[3] = 13
				this.ResultCols[4] = 14;
				this.ResultCols[5] = 15;

				this.ColWidth[0]	= 25;
				this.ColWidth[1]	= 100;
				this.ColWidth[2]	= 150;
				this.ColWidth[3]	= 40;
				this.ColWidth[4]	= 100;
				this.ColWidth[5]	= 80;
				this.ColWidth[6]	= 80;
				this.ColWidth[7]	= 100;
				this.ColWidth[8]	= 80;
				this.ColWidth[9]	= 80;
				this.ColWidth[10]	= 100;
				this.ColWidth[11]	= 80;
				this.ColWidth[12]	= 80;
				this.ColWidth[13]	= 40;
				this.ColWidth[14]	= 80;
				this.ColWidth[15]	= 80;
				this.ColWidth[16]	= 80;
				this.ColWidth[17]	= 100;
				this.ColWidth[18]	= 100;

				this.ColEditName[0]	= "";
				this.ColEditName[1]	= "UserCode_Edit";
				this.ColEditName[2]	= "FullName_Edit";
				this.ColEditName[3]	= "Unit_Edit";
				this.ColEditName[4]	= "EntryCode_Edit";
				this.ColEditName[5]	= "Standard_Edit";
				this.ColEditName[6]	= "Type_Edit";
				this.ColEditName[7]	= "Area_Edit";
				this.ColEditName[8]	= "Qty_Edit";
				this.ColEditName[9]	= "UnitRate_Edit";
				this.ColEditName[10]	= "AssistantUnit_Edit";
				this.ColEditName[11]	= "Price_Edit";
				this.ColEditName[12]	= "NoDiscountTotal_Edit";
				this.ColEditName[13]	= "Discount_Edit";
				this.ColEditName[14]	= "DiscountPrice_Edit";
				this.ColEditName[15]	= "Total_Edit";
				this.ColEditName[16]	= "ConsignmentQty_Edit";
				this.ColEditName[17]	= "Comment_Edit";
				this.ColEditName[18]	= "CustomerCode_Edit";

				this.SumRow = "<tr class=\"ClientTablesum\" id=\"SumRow\" height=\"20px\"><td>合计</td>";strColsDisplay = 1;
				
				
				for ( i = 1; i < this.cols; i++ ) {
					// Judge If Display The Grid Cols
					for ( j = 1; j < this.HiddenColsArray.length; j++ ) {
						if ( this.HiddenColsArray[j] == this.ColEditName[i] ) {
							strColsDisplay = 0;
							break;
						}
						else
							strColsDisplay = 1;
						
					}
					for ( j = 0; j < this.SumCols.length; j++ ) {
						if ( i == parseInt(this.SumCols[j]) ) {
							strSumValueDisplay = "<span id=\"" + this.name + "Total" + this.SumCols[j] + "\" style=\"color:#000000\">&nbsp;0</span>";break;
						}
						else
							strSumValueDisplay = "&nbsp;";
					}
					if ( strColsDisplay == 1 ) {
						this.SumRow = this.SumRow + "<td>" + strSumValueDisplay + "</td>";
					}
					else{
						this.SumRow = this.SumRow + "<td style='display:none'>" + strSumValueDisplay + "</td>";
					}
				}

				if ( !this.Disable ) {	// 删除列所占用的单元格
					this.SumRow = this.SumRow + "<td>&nbsp;</td>";
				}
				this.SumRow = this.SumRow + "</tr>";

				//if ( !this.Disable )
				//	this.SumRow="<tr class=ClientTablesum id=SumRow height=20px><td colspan=4>&nbsp;合计</td><td><span id="+this.name+"Total4 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td><span id="+this.name+"Total6 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td>&nbsp;</td><td><span id="+this.name+"Total9 style='color:#000000'>&nbsp;0</span><td>&nbsp;</td><td>&nbsp;</td></tr>";
				//else
				//	this.SumRow="<tr class=ClientTablesum id=SumRow height=20px><td colspan=4>&nbsp;合计</td><td><span id="+this.name+"Total4 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td><span id="+this.name+"Total6 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td>&nbsp;</td><td><span id="+this.name+"Total9 style='color:#000000'>&nbsp;0</span><td>&nbsp;</td></tr>";

				break;
			case 33:	// 会计凭证
				this.cols = 6;

				this.LocalUpdateCol[0] = 2;	// 局部更新列

				this.HiddenArray[0] = "isUnitTow";
				this.HiddenArray[1] = "0";
				this.HiddenArray[2] = "UnitRate";
				this.HiddenArray[3] = "1";

				this.Title[0] = "No.";
				this.Title[1] = "摘要";
				this.Title[2] = "总账科目";
				this.Title[3] = "明细科目";
				this.Title[4] = "借方";
				this.Title[5] = "贷方";

				this.SumCols[0] = 4;
				this.SumCols[1] = 5;

				this.FormatSumCols[0] = 4;
				this.FormatSumCols[1] = 2;
				this.FormatSumCols[2] = 5;
				this.FormatSumCols[3] = 2;

				this.NumericCols[0] = 4;
				this.NumericCols[1] = 5;

				this.FormatCols[0] = 4;
				this.FormatCols[1] = 2;
				this.FormatCols[2] = 5;		// 第二种格式 ( 小数保留 2 位 )
				this.FormatCols[3] = 2;

				if ( this.Disable ) {
					this.DisableCols[0] = 1;
					this.DisableCols[1] = 2;
					this.DisableCols[2] = 3;
					this.DisableCols[3] = 4;
					this.DisableCols[4] = 5;
				}
				else{
					this.DisableCols[0] = 3;
				}

				this.ColWidth[0] = 25;
				this.ColWidth[1] = 250;
				this.ColWidth[2] = 100;
				this.ColWidth[3] = 100;
				this.ColWidth[4] = 80;
				this.ColWidth[5] = 80;

				this.ColEditName[0] = "";
				this.ColEditName[1] = "Base_Edit";
				this.ColEditName[2] = "Type_Edit";
				this.ColEditName[3] = "FullName_Edit";
				this.ColEditName[4] = "DebitTotal_Edit";
				this.ColEditName[5] = "CreditTotal_Edit";

				if ( !this.Disable )
					this.SumRow = "<tr class=ClientTablesum id=SumRow height=20px><td>合计</td><td></td><td></td><td></td><td><span id="+this.name+"Total4 style='color:#000000'>&nbsp;0</span></td><td><span id="+this.name+"Total5 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td></tr>";
				else
					this.SumRow = "<tr class=ClientTablesum id=SumRow height=20px><td>合计</td><td></td><td></td><td></td><td><span id="+this.name+"Total4 style='color:#000000'>&nbsp;0</span></td><td><span id="+this.name+"Total5 style='color:#000000'>&nbsp;0</span></td></tr>";

				break;
			case 1511:	// 销售换货普通格式(出库)
				this.cols = 19;

				// 局部更新列
				this.LocalUpdateCol[0] = 1;	// 序列号
				this.LocalUpdateCol[1] = 2;	// 商品编号
				this.LocalUpdateCol[2] = 3;	// 商品名称

				// 每行隐含域名、值数组
				this.HiddenArray[0] = "OOrderId";	// 订单 ID 值
				this.HiddenArray[1] = "-1";		// 初始值
				this.HiddenArray[2] = "OisUnitTow";	// 该行是否双单位
				this.HiddenArray[3] = "0";		// 默认不是双单位
				this.HiddenArray[4] = "OUnitRate";	// 双单位换算关系
				this.HiddenArray[5] = "1";		// 默认换算关系为 1
				this.HiddenArray[6] = "OIfSerial"	// 是否采用序列号强制管理
				this.HiddenArray[7] = "0";		// 默认为 0 ；0：非序列号强制管理；1：序列号强制管理
				this.HiddenArray[8] = "OSerialOut";	// 所有出库序列号字串
				this.HiddenArray[9] = "";		// 默认为空，各序列号以逗号 ( я ) 分隔
				this.HiddenArray[10] = "OUnitOne";	//小单位
				this.HiddenArray[11] = "";		// 默认为空
				this.HiddenArray[12] = "OUnitTwo";	// 大单位
				this.HiddenArray[13] = "";		// 默认为空
				// ===================================add by chen_qihua 2004-6-18 采购退货，销售退货加隐含列
				this.HiddenArray[14] = "OInputCostPrice";	// 成本单价
				this.HiddenArray[15] = "0";		// 默认为)
				this.HiddenArray[16] = "OID";	// 采购退货，销售退货关联的原来单据的商品的过账ID号
				this.HiddenArray[17] = "";		// 默认为空
				this.HiddenArray[18] = "OOldID";	// 采购退货，销售退货关联的原来单据ID
				this.HiddenArray[19] = "";		// 默认为空
				this.HiddenArray[20] = "OGoodsNumberPrice";	// 采购退货，销售退货关联的原来单据ID
				this.HiddenArray[21] = "-1";		// 默认未-1
				this.HiddenArray[22] = "OHandZeroCost";	// 0成本出入库专用
				this.HiddenArray[23] = "0";		// 默认未0
				
				// 鼠标双击列
				this.MouseDbClickCols[0] = 1;
				this.MouseDbClickCols[1] = 4;
				this.MouseDbClickCols[2] = 12;

				// 初始化表头
				this.Title[0]	= "No.";
				this.Title[1]	= "序列号";
				this.Title[2]	= "商品编号";
				this.Title[3]	= "商品全名";
				this.Title[4]	= "单位";
				this.Title[5]	= "条形码";
				this.Title[6]	= "规格";
				this.Title[7]	= "型号";
				this.Title[8]	= "产地";
				this.Title[9]	= "生产日期";
				this.Title[10]	= "效期至";
				this.Title[11]	= "批号";
				this.Title[12]	= "出库数量";
				this.Title[13]  = "单位关系";
				this.Title[14]	= "辅助单位";
				this.Title[15]	= "单价";
				this.Title[16]	= "金额";
				this.Title[17]	= "备注";
				this.Title[18]	= "多编码";

				// 需要合计的列
				this.SumCols[0] = 12;
				this.SumCols[1] = 16;

				this.FormatSumCols[0] = 12;
				this.FormatSumCols[1] = 1;
				this.FormatSumCols[2] = 16;
				this.FormatSumCols[3] = 2;

				this.NumericCols[0] = 12;
				this.NumericCols[1] = 15;
				this.NumericCols[2] = 16;

				this.FormatCols[0] = 12;
				this.FormatCols[1] = 1;	// 第一种格式 ( 小数保留4位 )
				this.FormatCols[2] = 15;
				this.FormatCols[3] = 1;
				this.FormatCols[4] = 16;
				this.FormatCols[5] = 2;	// 第二种格式 ( 小数保留2位 )

				this.ResultCols[0] = ";";
				this.ResultCols[1] = 12;
				this.ResultCols[2] = "*";
				this.ResultCols[3] = 15;
				this.ResultCols[4] = "=";
				this.ResultCols[5] = 16;
				this.ResultCols[6] = ";";

				// 只读列，Disable 用于显示单据明细时用
				if ( this.Disable ) {
					this.DisableCols[0]	= 1;
					this.DisableCols[1]	= 2;
					this.DisableCols[2]	= 3;
					this.DisableCols[3]	= 4;
					this.DisableCols[4]	= 5;
					this.DisableCols[5]	= 6;
					this.DisableCols[6]	= 7;
					this.DisableCols[7]	= 8;
					this.DisableCols[8]	= 9;
					this.DisableCols[9]	= 10;
					this.DisableCols[10]	= 11;
					this.DisableCols[11]	= 12;
					this.DisableCols[12]	= 13;
					this.DisableCols[13]	= 14;
					this.DisableCols[14]	= 15;
					this.DisableCols[15]	= 16;
					this.DisableCols[16]	= 17;
					this.DisableCols[17]	= 18;
				}
				else {	// 正常情况是“单位”、“条形码”、“规格”、“型号”、“产地”、“金额”列为只读
					this.DisableCols[0] = 4;
					this.DisableCols[1] = 5;
					this.DisableCols[2] = 6;
					this.DisableCols[3] = 7;
					this.DisableCols[4] = 8;
					this.DisableCols[5] = 9;
					this.DisableCols[6] = 10;
					this.DisableCols[7] = 11;
					this.DisableCols[8] = 13;
					this.DisableCols[9] = 14;
					this.DisableCols[10] = 18;
				}

				this.ColWidth[0]	= 25;
				this.ColWidth[1]	= 100;
				this.ColWidth[2]	= 100;
				this.ColWidth[3]	= 150;
				this.ColWidth[4]	= 40;
				this.ColWidth[5]	= 100;
				this.ColWidth[6]	= 80;
				this.ColWidth[7]	= 80;
				this.ColWidth[8]	= 100;
				this.ColWidth[9]	= 80;
				this.ColWidth[10]	= 80;
				this.ColWidth[11]	= 80;
				this.ColWidth[12]	= 80;
				this.ColWidth[13]	= 80;
				this.ColWidth[14]	= 100;
				this.ColWidth[15]	= 80;
				this.ColWidth[16]	= 100;
				this.ColWidth[17]	= 100;
				this.ColWidth[18]	= 100;

				this.ColEditName[0]	= "";
				this.ColEditName[1]	= "OSerialSel_Edit";
				this.ColEditName[2]	= "OUserCode_Edit";
				this.ColEditName[3]	= "OFullName_Edit";
				this.ColEditName[4]	= "OUnit_Edit";
				this.ColEditName[5]	= "OEntryCode_Edit";
				this.ColEditName[6]	= "OStandard_Edit";
				this.ColEditName[7]	= "OType_Edit";
				this.ColEditName[8]	= "OArea_Edit";
				this.ColEditName[9]	= "OProduceDate_Edit";
				this.ColEditName[10]	= "OValidDate_Edit";
				this.ColEditName[11]	= "OGoodsNumber_Edit";
				this.ColEditName[12]	= "OQty_Edit";
				this.ColEditName[13]	= "OUnitRate_Edit";
				this.ColEditName[14]	= "OAssistantUnit_Edit";
				this.ColEditName[15]	= "OPrice_Edit";
				this.ColEditName[16]	= "OTotal_Edit";
				this.ColEditName[17]	= "OBase_Edit";
				this.ColEditName[18]	= "OCustomerCode_Edit";
				
				

				// 销售单数量加入缺省值 1
				this.IniCols[0] = 12;
				if ( typeof(this.IniColValues[1]) != "undefined" ) {
					this.IniCols[1] = 1;
				}
				else{
					this.IniCols[1] = '';
				}

				this.SumRow = "<tr class=\"ClientTablesum\" id=\"SumRow\" height=\"20px\"><td>合计</td>";strColsDisplay = 1;
				
				
				for ( i = 1; i < this.cols; i++ ) {
					// Judge If Display The Grid Cols
					for ( j = 1; j < this.HiddenColsArray.length; j++ ) {
						if ( this.HiddenColsArray[j] == this.ColEditName[i] ) {
							strColsDisplay = 0;
							break;
						}
						else
							strColsDisplay = 1;
						
					}
					for ( j = 0; j < this.SumCols.length; j++ ) {
						if ( i == parseInt(this.SumCols[j]) ) {
							strSumValueDisplay = "<span id=\"" + this.name + "Total" + this.SumCols[j] + "\" style=\"color:#000000\">&nbsp;0</span>";break;
						}
						else
							strSumValueDisplay = "&nbsp;";
					}
					if ( strColsDisplay == 1 ) {
						this.SumRow = this.SumRow + "<td>" + strSumValueDisplay + "</td>";
					}
					else{
						this.SumRow = this.SumRow + "<td style='display:none'>" + strSumValueDisplay + "</td>";
					}
				}

				if ( !this.Disable ) {	// 删除列所占用的单元格
					this.SumRow = this.SumRow + "<td>&nbsp;</td>";
				}
				this.SumRow = this.SumRow + "</tr>";

				//if ( !this.Disable )
				//	this.SumRow="<tr class=ClientTablesum id=SumRow height=20px><td colspan=4>&nbsp;合计</td><td><span id="+this.name+"Total4 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td><span id="+this.name+"Total6 style='color:#000000'>&nbsp;0</span><td>&nbsp;</td><td>&nbsp;</td></tr>";
				//else
				//	this.SumRow="<tr class=ClientTablesum id=SumRow height=20px><td colspan=4>&nbsp;合计</td><td><span id="+this.name+"Total4 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td><span id="+this.name+"Total6 style='color:#000000'>&nbsp;0</span><td>&nbsp;</td></tr>";
				break;
			case 1512:	// 销售换货普通格式(入库)
				this.cols = 19;

				// 局部更新列
				this.LocalUpdateCol[0] = 1;	// 序列号
				this.LocalUpdateCol[1] = 2;	// 商品编号
				this.LocalUpdateCol[2] = 3;	// 商品名称

				// 每行隐含域名、值数组
				this.HiddenArray[0] = "IOrderId";	// 订单 ID 值
				this.HiddenArray[1] = "-1";		// 初始值
				this.HiddenArray[2] = "IisUnitTow";	// 该行是否双单位
				this.HiddenArray[3] = "0";		// 默认不是双单位
				this.HiddenArray[4] = "IUnitRate";	// 双单位换算关系
				this.HiddenArray[5] = "1";		// 默认换算关系为 1
				this.HiddenArray[6] = "IIfSerial"	// 是否采用序列号强制管理
				this.HiddenArray[7] = "0";		// 默认为 0 ；0：非序列号强制管理；1：序列号强制管理
				this.HiddenArray[8] = "ISerialOut";	// 所有入库序列号字串
				this.HiddenArray[9] = "";		// 默认为空，各序列号以逗号 ( я ) 分隔
				this.HiddenArray[10] = "IUnitOne";	//小单位
				this.HiddenArray[11] = "";		// 默认为空
				this.HiddenArray[12] = "IUnitTwo";	// 大单位
				this.HiddenArray[13] = "";		// 默认为空
				// ===================================add by chen_qihua 2004-6-18 采购退货，销售退货加隐含列
				this.HiddenArray[14] = "IInputCostPrice";	// 成本单价
				this.HiddenArray[15] = "0";		// 默认为)
				this.HiddenArray[16] = "IID";	// 采购退货，销售退货关联的原来单据的商品的过账ID号
				this.HiddenArray[17] = "";		// 默认为空
				this.HiddenArray[18] = "IOldID";	// 采购退货，销售退货关联的原来单据ID
				this.HiddenArray[19] = "";		// 默认为空
				this.HiddenArray[20] = "IGoodsNumberPrice";	// 采购退货，销售退货关联的原来单据ID
				this.HiddenArray[21] = "-1";		// 默认未-1
				this.HiddenArray[22] = "IHandZeroCost";	// 0成本出入库专用
				this.HiddenArray[23] = "0";		// 默认未0
				
				// 鼠标双击列
				this.MouseDbClickCols[0] = 1;
				this.MouseDbClickCols[1] = 4;
				
				// 初始化表头
				this.Title[0]	= "No.";
				this.Title[1]	= "序列号";
				this.Title[2]	= "商品编号";
				this.Title[3]	= "商品全名";
				this.Title[4]	= "单位";
				this.Title[5]	= "条形码";
				this.Title[6]	= "规格";
				this.Title[7]	= "型号";
				this.Title[8]	= "产地";
				this.Title[9]	= "生产日期";
				this.Title[10]	= "效期至";
				this.Title[11]	= "批号";
				this.Title[12]	= "入库数量";
				this.Title[13]  = "单位关系";
				this.Title[14]	= "辅助单位";
				this.Title[15]	= "单价";
				this.Title[16]	= "金额";
				this.Title[17]	= "备注";
				this.Title[18]	= "多编码";

				// 需要合计的列
				this.SumCols[0] = 12;
				this.SumCols[1] = 16;

				this.FormatSumCols[0] = 12;
				this.FormatSumCols[1] = 1;
				this.FormatSumCols[2] = 16;
				this.FormatSumCols[3] = 2;

				this.NumericCols[0] = 12;
				this.NumericCols[1] = 15;
				this.NumericCols[2] = 16;

				this.FormatCols[0] = 12;
				this.FormatCols[1] = 1;	// 第一种格式 ( 小数保留4位 )
				this.FormatCols[2] = 15;
				this.FormatCols[3] = 1;
				this.FormatCols[4] = 16;
				this.FormatCols[5] = 2;	// 第二种格式 ( 小数保留2位 )

				this.ResultCols[0] = ";";
				this.ResultCols[1] = 12;
				this.ResultCols[2] = "*";
				this.ResultCols[3] = 15;
				this.ResultCols[4] = "=";
				this.ResultCols[5] = 16;
				this.ResultCols[6] = ";";

				// 只读列，Disable 用于显示单据明细时用
				if ( this.Disable ) {
					this.DisableCols[0]	= 1;
					this.DisableCols[1]	= 2;
					this.DisableCols[2]	= 3;
					this.DisableCols[3]	= 4;
					this.DisableCols[4]	= 5;
					this.DisableCols[5]	= 6;
					this.DisableCols[6]	= 7;
					this.DisableCols[7]	= 8;
					this.DisableCols[8]	= 9;
					this.DisableCols[9]	= 10;
					this.DisableCols[10]	= 11;
					this.DisableCols[11]	= 12;
					this.DisableCols[12]	= 13;
					this.DisableCols[13]	= 14;
					this.DisableCols[14]	= 15;
					this.DisableCols[15]	= 16;
					this.DisableCols[16]	= 17;
					this.DisableCols[17]	= 18;
				}
				else {	// 正常情况是“单位”、“条形码”、“规格”、“型号”、“产地”、“金额”列为只读
					this.DisableCols[0] = 4;
					this.DisableCols[1] = 5;
					this.DisableCols[2] = 6;
					this.DisableCols[3] = 7;
					this.DisableCols[4] = 8;
					this.DisableCols[5] = 13;
					this.DisableCols[6] = 14;
					this.DisableCols[7] = 18;
				}

				this.ColWidth[0]	= 25;
				this.ColWidth[1]	= 100;
				this.ColWidth[2]	= 100;
				this.ColWidth[3]	= 150;
				this.ColWidth[4]	= 40;
				this.ColWidth[5]	= 100;
				this.ColWidth[6]	= 80;
				this.ColWidth[7]	= 80;
				this.ColWidth[8]	= 100;
				this.ColWidth[9]	= 80;
				this.ColWidth[10]	= 80;
				this.ColWidth[11]	= 80;
				this.ColWidth[12]	= 80;
				this.ColWidth[13]	= 80;
				this.ColWidth[14]	= 100;
				this.ColWidth[15]	= 80;
				this.ColWidth[16]	= 100;
				this.ColWidth[17]	= 100;
				this.ColWidth[18]	= 100;

				this.ColEditName[0]	= "";
				this.ColEditName[1]	= "ISerialSel_Edit";
				this.ColEditName[2]	= "IUserCode_Edit";
				this.ColEditName[3]	= "IFullName_Edit";
				this.ColEditName[4]	= "IUnit_Edit";
				this.ColEditName[5]	= "IEntryCode_Edit";
				this.ColEditName[6]	= "IStandard_Edit";
				this.ColEditName[7]	= "IType_Edit";
				this.ColEditName[8]	= "IArea_Edit";
				this.ColEditName[9]	= "IProduceDate_Edit";
				this.ColEditName[10]	= "IValidDate_Edit";
				this.ColEditName[11]	= "IGoodsNumber_Edit";
				this.ColEditName[12]	= "IQty_Edit";
				this.ColEditName[13]	= "IUnitRate_Edit";
				this.ColEditName[14]	= "IAssistantUnit_Edit";
				this.ColEditName[15]	= "IPrice_Edit";
				this.ColEditName[16]	= "ITotal_Edit";
				this.ColEditName[17]	= "IBase_Edit";
				this.ColEditName[18]	= "ICustomerCode_Edit";
				

				// 销售单数量加入缺省值 1
				this.IniCols[0] = 12;
				if ( typeof(this.IniColValues[1]) != "undefined" ) {
					this.IniCols[1] = 1;
				}
				else{
					this.IniCols[1] = '';
				}

				this.SumRow = "<tr class=\"ClientTablesum\" id=\"SumRow\" height=\"20px\"><td>合计</td>";strColsDisplay = 1;
				
				
				for ( i = 1; i < this.cols; i++ ) {
					// Judge If Display The Grid Cols
					for ( j = 1; j < this.HiddenColsArray.length; j++ ) {
						if ( this.HiddenColsArray[j] == this.ColEditName[i] ) {
							strColsDisplay = 0;
							break;
						}
						else
							strColsDisplay = 1;
						
					}
					for ( j = 0; j < this.SumCols.length; j++ ) {
						if ( i == parseInt(this.SumCols[j]) ) {
							strSumValueDisplay = "<span id=\"" + this.name + "Total" + this.SumCols[j] + "\" style=\"color:#000000\">&nbsp;0</span>";break;
						}
						else
							strSumValueDisplay = "&nbsp;";
					}
					if ( strColsDisplay == 1 ) {
						this.SumRow = this.SumRow + "<td>" + strSumValueDisplay + "</td>";
					}
					else{
						this.SumRow = this.SumRow + "<td style='display:none'>" + strSumValueDisplay + "</td>";
					}
				}

				if ( !this.Disable ) {	// 删除列所占用的单元格
					this.SumRow = this.SumRow + "<td>&nbsp;</td>";
				}
				this.SumRow = this.SumRow + "</tr>";

				//if ( !this.Disable )
				//	this.SumRow="<tr class=ClientTablesum id=SumRow height=20px><td colspan=4>&nbsp;合计</td><td><span id="+this.name+"Total4 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td><span id="+this.name+"Total6 style='color:#000000'>&nbsp;0</span><td>&nbsp;</td><td>&nbsp;</td></tr>";
				//else
				//	this.SumRow="<tr class=ClientTablesum id=SumRow height=20px><td colspan=4>&nbsp;合计</td><td><span id="+this.name+"Total4 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td><span id="+this.name+"Total6 style='color:#000000'>&nbsp;0</span><td>&nbsp;</td></tr>";
				break;
			case 1521:		// 3.7 销售换货(出)  折扣格式 
				this.cols = 22;		// 商品录入 折扣

				// 局部更新列
				this.LocalUpdateCol[0] = 1;	// 序列号
				this.LocalUpdateCol[1] = 2;	// 商品编号
				this.LocalUpdateCol[2] = 3;	// 商品名称

				// 每行隐含域名、值数组
				this.HiddenArray[0] = "OOrderId";	// 订单 ID 值
				this.HiddenArray[1] = "-1";		// 初始值
				this.HiddenArray[2] = "OisUnitTow";	// 该行是否双单位
				this.HiddenArray[3] = "0";		// 默认不是双单位
				this.HiddenArray[4] = "OUnitRate";	// 双单位换算关系
				this.HiddenArray[5] = "1";		// 默认换算关系为 1
				this.HiddenArray[6] = "OIfSerial"	// 是否采用序列号强制管理
				this.HiddenArray[7] = "0";		// 默认为 0 ；0：非序列号强制管理；1：序列号强制管理
				this.HiddenArray[8] = "OSerialOut";	// 所有出库序列号字串
				this.HiddenArray[9] = "";		// 默认为空，各序列号以逗号 ( я ) 分隔
				this.HiddenArray[10] = "OUnitOne";	//小单位
				this.HiddenArray[11] = "";		// 默认为空
				this.HiddenArray[12] = "OUnitTwo";	// 大单位
				this.HiddenArray[13] = "";		// 默认为空
				// ===================================add by chen_qihua 2004-6-18 采购退货，销售退货加隐含列
				this.HiddenArray[14] = "OInputCostPrice";	// 成本单价
				this.HiddenArray[15] = "0";		// 默认为0
				this.HiddenArray[16] = "ID";	// 采购退货，销售退货关联的原来单据的商品的过账ID号
				this.HiddenArray[17] = "";		// 默认为空
				this.HiddenArray[18] = "OldID";	// 采购退货，销售退货关联的原来单据ID
				this.HiddenArray[19] = "";		// 默认为空
				this.HiddenArray[20] = "OGoodsNumberPrice";	// 库存批次价格 手工指定法添加
				this.HiddenArray[21] = "-1";		// 默认未-1
				this.HiddenArray[22] = "OHandZeroCost";	// 0成本出入库专用
				this.HiddenArray[23] = "0";		// 默认未0
				
				// 鼠标双击列
				this.MouseDbClickCols[0] = 1;
				this.MouseDbClickCols[1] = 4;
				this.MouseDbClickCols[2] = 12;

				// 初始化表头
				this.Title[0]	= "No.";
				this.Title[1]	= "序列号";
				this.Title[2]	= "商品编号";
				this.Title[3]	= "商品全名";
				this.Title[4]	= "单位";
				this.Title[5]	= "条形码";
				this.Title[6]	= "规格";
				this.Title[7]	= "型号";
				this.Title[8]	= "产地";
				this.Title[9]	= "生产日期";
				this.Title[10]	= "效期至";
				this.Title[11]	= "批号";
				this.Title[12]	= "出库数量";
				this.Title[13]  = "单位关系";
				this.Title[14]	= "辅助单位";
				this.Title[15]	= "单价";
				this.Title[16]	= "金额";
				this.Title[17]	= "扣率";
				this.Title[18]	= "折后单价";
				this.Title[19]	= "折后金额";
				this.Title[20]	= "备注";
				this.Title[21]	= "多编码";

				this.SumCols[0] = 12;
				this.SumCols[1] = 16;
				this.SumCols[2] = 19;

				this.FormatSumCols[0] = 12;
				this.FormatSumCols[1] = 1;
				this.FormatSumCols[2] = 16;
				this.FormatSumCols[3] = 2;
				this.FormatSumCols[4] = 19;
				this.FormatSumCols[5] = 2;

				this.IniCols[0] = 17;
				if ( typeof(this.IniColValues[0]) != "undefined" )
					this.IniCols[1] = this.IniColValues[0];
				else
					this.IniCols[1] = 1;

				// 销售单数量加入缺省值 1
				if ( typeof(this.IniColValues[1]) != "undefined" ) {
					this.IniCols[2] = 12;
					this.IniCols[3] = 1;
				}

				this.NumericCols[0] = 12;
				this.NumericCols[1] = 15;  //徐辉 2004-4-23 添加扣前单价
				this.NumericCols[2] = 17;
				this.NumericCols[3] = 18;
				this.NumericCols[4] = 19;

				if ( this.Disable ) {
					this.DisableCols[0]	= 1;
					this.DisableCols[1]	= 2;
					this.DisableCols[2]	= 3;
					this.DisableCols[3]	= 4;
					this.DisableCols[4]	= 5;
					this.DisableCols[5]	= 6;
					this.DisableCols[6]	= 7;
					this.DisableCols[7]	= 8;
					this.DisableCols[8]	= 9;
					this.DisableCols[9]	= 10;
					this.DisableCols[10]	= 11;
					this.DisableCols[11]	= 12;
					this.DisableCols[12]	= 13;
					this.DisableCols[13]	= 14;
					this.DisableCols[14]	= 15;
					this.DisableCols[15]	= 16;
					this.DisableCols[16]	= 17;
					this.DisableCols[17]	= 18;
					this.DisableCols[18]	= 19;
					this.DisableCols[19]	= 20;
					this.DisableCols[20]	= 21;
				}
				else {
					this.DisableCols[0] = 4;
					this.DisableCols[1] = 5;
					this.DisableCols[2] = 6;
					this.DisableCols[3] = 7;
					this.DisableCols[4] = 8;
					this.DisableCols[5] = 9; 
					this.DisableCols[6] = 10;
					this.DisableCols[7] = 11;
					this.DisableCols[8] = 13;
					this.DisableCols[9] = 14;
					this.DisableCols[10] = 16;
					this.DisableCols[11] = 21;
				}

				this.FormatCols[0]	= 12;	// 数量
				this.FormatCols[1]	= 1;	// 第一种格式(小数保留4位)
				this.FormatCols[2]	= 18;	// 折后单价
				this.FormatCols[3]	= 1;
				this.FormatCols[4]	= 16;	// 金额
				this.FormatCols[5]	= 2;
				this.FormatCols[6]	= 19;	// 折后金额
				this.FormatCols[7]	= 2;	// 第二种格式(小数保留2位)
				this.FormatCols[8]	= 15;	// 单价
				this.FormatCols[9]	= 1;
				this.FormatCols[10]	= 17;	//折扣率
				this.FormatCols[11]	= 1;

				// 计算折后金额
				this.ResultCols[0] = 12;
				this.ResultCols[1] = 15;
				this.ResultCols[2] = 17;
				this.ResultCols[3] = 18;
				this.ResultCols[4] = 19;
	 
				this.ColWidth[0]	= 25;
				this.ColWidth[1]	= 100;
				this.ColWidth[2]	= 100;
				this.ColWidth[3]	= 150;
				this.ColWidth[4]	= 40;
				this.ColWidth[5]	= 100;
				this.ColWidth[6]	= 80;
				this.ColWidth[7]	= 80;
				this.ColWidth[8]	= 100;
				this.ColWidth[9]	= 80;
				this.ColWidth[10]	= 80;
				this.ColWidth[11]	= 80;
				this.ColWidth[12]	= 80;
				this.ColWidth[13]	= 80;
				this.ColWidth[14]	= 100;
				this.ColWidth[15]	= 80;
				this.ColWidth[16]	= 80;
				this.ColWidth[17]	= 40;
				this.ColWidth[18]	= 80;
				this.ColWidth[19]	= 80;
				this.ColWidth[20]	= 100;
				this.ColWidth[21]	= 100;

				this.ColEditName[0]	= "";
				this.ColEditName[1]	= "OSerialSel_Edit";
				this.ColEditName[2]	= "OUserCode_Edit";
				this.ColEditName[3]	= "OFullName_Edit";
				this.ColEditName[4]	= "OUnit_Edit";
				this.ColEditName[5]	= "OEntryCode_Edit";
				this.ColEditName[6]	= "OStandard_Edit";
				this.ColEditName[7]	= "OType_Edit";
				this.ColEditName[8]	= "OArea_Edit";
				this.ColEditName[9]	= "OProduceDate_Edit";
				this.ColEditName[10]	= "OValidDate_Edit";
				this.ColEditName[11]	= "OGoodsNumber_Edit";
				this.ColEditName[12]	= "OQty_Edit";
				this.ColEditName[13]	= "OUnitRate_Edit";
				this.ColEditName[14]	= "OAssistantUnit_Edit";
				this.ColEditName[15]	= "OPrice_Edit";
				this.ColEditName[16]	= "ONoDiscountTotal_Edit";
				this.ColEditName[17]	= "ODiscount_Edit";
				this.ColEditName[18]	= "ODiscountPrice_Edit";
				this.ColEditName[19]	= "OTotal_Edit";
				this.ColEditName[20]	= "OBase_Edit";
				this.ColEditName[21]	= "OCustomerCode_Edit";

				this.SumRow = "<tr class=\"ClientTablesum\" id=\"SumRow\" height=\"20px\"><td>合计</td>";strColsDisplay = 1;
				
				
				
				for ( i = 1; i < this.cols; i++ ) {
					// Judge If Display The Grid Cols
					for ( j = 1; j < this.HiddenColsArray.length; j++ ) {
						if ( this.HiddenColsArray[j] == this.ColEditName[i] ) {
							strColsDisplay = 0;
							break;
						}
						else
							strColsDisplay = 1;
						
					}
					for ( j = 0; j < this.SumCols.length; j++ ) {
						if ( i == parseInt(this.SumCols[j]) ) {
							strSumValueDisplay = "<span id=\"" + this.name + "Total" + this.SumCols[j] + "\" style=\"color:#000000\">&nbsp;0</span>";break;
						}
						else
							strSumValueDisplay = "&nbsp;";
					}
					if ( strColsDisplay == 1 ) {
						this.SumRow = this.SumRow + "<td>" + strSumValueDisplay + "</td>";
					}
					else{
						this.SumRow = this.SumRow + "<td style='display:none'>" + strSumValueDisplay + "</td>";
					}
				}

				if ( !this.Disable ) {	// 删除列所占用的单元格
					this.SumRow = this.SumRow + "<td>&nbsp;</td>";
				}
				this.SumRow = this.SumRow + "</tr>";

				//if ( !this.Disable )
				//	this.SumRow="<tr class=ClientTablesum id=SumRow height=20px><td colspan=4>&nbsp;合计</td><td><span id="+this.name+"Total4 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td><span id="+this.name+"Total6 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td>&nbsp;</td><td><span id="+this.name+"Total9 style='color:#000000'>&nbsp;0</span><td>&nbsp;</td><td>&nbsp;</td></tr>";
				//else
				//	this.SumRow="<tr class=ClientTablesum id=SumRow height=20px><td colspan=4>&nbsp;合计</td><td><span id="+this.name+"Total4 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td><span id="+this.name+"Total6 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td>&nbsp;</td><td><span id="+this.name+"Total9 style='color:#000000'>&nbsp;0</span><td>&nbsp;</td></tr>";

				break;
			case 1522:	// 销售换货(入) 折扣格式 
				this.cols = 22;		// 商品录入 折扣

				// 局部更新列
				this.LocalUpdateCol[0] = 1;	// 序列号
				this.LocalUpdateCol[1] = 2;	// 商品编号
				this.LocalUpdateCol[2] = 3;	// 商品名称

				// 每行隐含域名、值数组
				this.HiddenArray[0] = "IOrderId";	// 订单 ID 值
				this.HiddenArray[1] = "-1";		// 初始值
				this.HiddenArray[2] = "IisUnitTow";	// 该行是否双单位
				this.HiddenArray[3] = "0";		// 默认不是双单位
				this.HiddenArray[4] = "IUnitRate";	// 双单位换算关系
				this.HiddenArray[5] = "1";		// 默认换算关系为 1
				this.HiddenArray[6] = "IIfSerial"	// 是否采用序列号强制管理
				this.HiddenArray[7] = "0";		// 默认为 0 ；0：非序列号强制管理；1：序列号强制管理
				this.HiddenArray[8] = "ISerialOut";	// 所有出库序列号字串
				this.HiddenArray[9] = "";		// 默认为空，各序列号以逗号 ( я ) 分隔
				this.HiddenArray[10] = "IUnitOne";	//小单位
				this.HiddenArray[11] = "";		// 默认为空
				this.HiddenArray[12] = "IUnitTwo";	// 大单位
				this.HiddenArray[13] = "";		// 默认为空
				// ===================================add by chen_qihua 2004-6-18 采购退货，销售退货加隐含列
				this.HiddenArray[14] = "IInputCostPrice";	// 成本单价
				this.HiddenArray[15] = "0";		// 默认为0
				this.HiddenArray[16] = "IID";	// 采购退货，销售退货关联的原来单据的商品的过账ID号
				this.HiddenArray[17] = "";		// 默认为空
				this.HiddenArray[18] = "IOldID";	// 采购退货，销售退货关联的原来单据ID
				this.HiddenArray[19] = "";		// 默认为空
				this.HiddenArray[20] = "IGoodsNumberPrice";	// 库存批次价格 手工指定法添加
				this.HiddenArray[21] = "-1";		// 默认未-1
				this.HiddenArray[22] = "IHandZeroCost";	// 0成本出入库专用
				this.HiddenArray[23] = "0";		// 默认未0
				
				// 鼠标双击列
				this.MouseDbClickCols[0] = 1;
				this.MouseDbClickCols[1] = 4;

				// 初始化表头
				this.Title[0]	= "No.";
				this.Title[1]	= "序列号";
				this.Title[2]	= "商品编号";
				this.Title[3]	= "商品全名";
				this.Title[4]	= "单位";
				this.Title[5]	= "条形码";
				this.Title[6]	= "规格";
				this.Title[7]	= "型号";
				this.Title[8]	= "产地";
				this.Title[9]	= "生产日期";
				this.Title[10]	= "效期至";
				this.Title[11]	= "批号";
				this.Title[12]	= "入库数量";
				this.Title[13]  = "单位关系";
				this.Title[14]	= "辅助单位";
				this.Title[15]	= "单价";
				this.Title[16]	= "金额";
				this.Title[17]	= "扣率";
				this.Title[18]	= "折后单价";
				this.Title[19]	= "折后金额";
				this.Title[20]	= "备注";
				this.Title[21]	= "多编码";

				this.SumCols[0] = 12;
				this.SumCols[1] = 16;
				this.SumCols[2] = 19;

				this.FormatSumCols[0] = 12;
				this.FormatSumCols[1] = 1;
				this.FormatSumCols[2] = 16;
				this.FormatSumCols[3] = 2;
				this.FormatSumCols[4] = 19;
				this.FormatSumCols[5] = 2;

				this.IniCols[0] = 17;
				if ( typeof(this.IniColValues[0]) != "undefined" )
					this.IniCols[1] = this.IniColValues[0];
				else
					this.IniCols[1] = 1;

				// 销售单数量加入缺省值 1
				if ( typeof(this.IniColValues[1]) != "undefined" ) {
					this.IniCols[2] = 12;
					this.IniCols[3] = 1;
				}

				this.NumericCols[0] = 12;
				this.NumericCols[1] = 15;  //徐辉 2004-4-23 添加扣前单价
				this.NumericCols[2] = 17;
				this.NumericCols[3] = 18;
				this.NumericCols[4] = 19;

				if ( this.Disable ) {
					this.DisableCols[0]	= 1;
					this.DisableCols[1]	= 2;
					this.DisableCols[2]	= 3;
					this.DisableCols[3]	= 4;
					this.DisableCols[4]	= 5;
					this.DisableCols[5]	= 6;
					this.DisableCols[6]	= 7;
					this.DisableCols[7]	= 8;
					this.DisableCols[8]	= 9;
					this.DisableCols[9]	= 10;
					this.DisableCols[10]	= 11;
					this.DisableCols[11]	= 12;
					this.DisableCols[12]	= 13;
					this.DisableCols[13]	= 14;
					this.DisableCols[14]	= 15;
					this.DisableCols[15]	= 16;
					this.DisableCols[16]	= 17;
					this.DisableCols[17]	= 18;
					this.DisableCols[18]	= 19;
					this.DisableCols[19]	= 20;
					this.DisableCols[20]	= 21;
				}
				else {
					this.DisableCols[0] = 4;
					this.DisableCols[1] = 5;
					this.DisableCols[2] = 6;
					this.DisableCols[3] = 7;
					this.DisableCols[4] = 8;
					this.DisableCols[5] = 13;
					this.DisableCols[6] = 14;
					this.DisableCols[7] = 16;
					this.DisableCols[8] = 21;
				}

				this.FormatCols[0]	= 12;	// 数量
				this.FormatCols[1]	= 1;	// 第一种格式(小数保留4位)
				this.FormatCols[2]	= 18;	// 折后单价
				this.FormatCols[3]	= 1;
				this.FormatCols[4]	= 16;	// 金额
				this.FormatCols[5]	= 2;
				this.FormatCols[6]	= 19;	// 折后金额
				this.FormatCols[7]	= 2;	// 第二种格式(小数保留2位)
				this.FormatCols[8]	= 15;	// 单价
				this.FormatCols[9]	= 1;
				this.FormatCols[10]	= 17;	//折扣率
				this.FormatCols[11]	= 1;

				// 计算折后金额
				this.ResultCols[0] = 12;
				this.ResultCols[1] = 15;
				this.ResultCols[2] = 17;
				this.ResultCols[3] = 18;
				this.ResultCols[4] = 19;
	 
				this.ColWidth[0]	= 25;
				this.ColWidth[1]	= 100;
				this.ColWidth[2]	= 100;
				this.ColWidth[3]	= 150;
				this.ColWidth[4]	= 40;
				this.ColWidth[5]	= 100;
				this.ColWidth[6]	= 80;
				this.ColWidth[7]	= 80;
				this.ColWidth[8]	= 100;
				this.ColWidth[9]	= 80;
				this.ColWidth[10]	= 80;
				this.ColWidth[11]	= 80;
				this.ColWidth[12]	= 80;
				this.ColWidth[13]	= 80;
				this.ColWidth[14]	= 100;
				this.ColWidth[15]	= 80;
				this.ColWidth[16]	= 80;
				this.ColWidth[17]	= 40;
				this.ColWidth[18]	= 80;
				this.ColWidth[19]	= 80;
				this.ColWidth[20]	= 100;
				this.ColWidth[21]	= 100;

				this.ColEditName[0]	= "";
				this.ColEditName[1]	= "ISerialSel_Edit";
				this.ColEditName[2]	= "IUserCode_Edit";
				this.ColEditName[3]	= "IFullName_Edit";
				this.ColEditName[4]	= "IUnit_Edit";
				this.ColEditName[5]	= "IEntryCode_Edit";
				this.ColEditName[6]	= "IStandard_Edit";
				this.ColEditName[7]	= "IType_Edit";
				this.ColEditName[8]	= "IArea_Edit";
				this.ColEditName[9]	= "IProduceDate_Edit";
				this.ColEditName[10]	= "IValidDate_Edit";
				this.ColEditName[11]	= "IGoodsNumber_Edit";
				this.ColEditName[12]	= "IQty_Edit";
				this.ColEditName[13]	= "IUnitRate_Edit";
				this.ColEditName[14]	= "IAssistantUnit_Edit";
				this.ColEditName[15]	= "IPrice_Edit";
				this.ColEditName[16]	= "INoDiscountTotal_Edit";
				this.ColEditName[17]	= "IDiscount_Edit";
				this.ColEditName[18]	= "IDiscountPrice_Edit";
				this.ColEditName[19]	= "ITotal_Edit";
				this.ColEditName[20]	= "IBase_Edit";
				this.ColEditName[21]	= "ICustomerCode_Edit";

				this.SumRow = "<tr class=\"ClientTablesum\" id=\"SumRow\" height=\"20px\"><td>合计</td>";strColsDisplay = 1;
				
				
				
				for ( i = 1; i < this.cols; i++ ) {
					// Judge If Display The Grid Cols
					for ( j = 1; j < this.HiddenColsArray.length; j++ ) {
						if ( this.HiddenColsArray[j] == this.ColEditName[i] ) {
							strColsDisplay = 0;
							break;
						}
						else
							strColsDisplay = 1;
						
					}
					for ( j = 0; j < this.SumCols.length; j++ ) {
						if ( i == parseInt(this.SumCols[j]) ) {
							strSumValueDisplay = "<span id=\"" + this.name + "Total" + this.SumCols[j] + "\" style=\"color:#000000\">&nbsp;0</span>";break;
						}
						else
							strSumValueDisplay = "&nbsp;";
					}
					if ( strColsDisplay == 1 ) {
						this.SumRow = this.SumRow + "<td>" + strSumValueDisplay + "</td>";
					}
					else{
						this.SumRow = this.SumRow + "<td style='display:none'>" + strSumValueDisplay + "</td>";
					}
				}

				if ( !this.Disable ) {	// 删除列所占用的单元格
					this.SumRow = this.SumRow + "<td>&nbsp;</td>";
				}
				this.SumRow = this.SumRow + "</tr>";

				//if ( !this.Disable )
				//	this.SumRow="<tr class=ClientTablesum id=SumRow height=20px><td colspan=4>&nbsp;合计</td><td><span id="+this.name+"Total4 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td><span id="+this.name+"Total6 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td>&nbsp;</td><td><span id="+this.name+"Total9 style='color:#000000'>&nbsp;0</span><td>&nbsp;</td><td>&nbsp;</td></tr>";
				//else
				//	this.SumRow="<tr class=ClientTablesum id=SumRow height=20px><td colspan=4>&nbsp;合计</td><td><span id="+this.name+"Total4 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td><span id="+this.name+"Total6 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td>&nbsp;</td><td><span id="+this.name+"Total9 style='color:#000000'>&nbsp;0</span><td>&nbsp;</td></tr>";

				break;
			case 1531:		// 销售换货(出)  税率
				this.cols = 22;		// 商品录入 含税

				// 局部更新列
				this.LocalUpdateCol[0] = 1;	// 序列号
				this.LocalUpdateCol[1] = 2;	// 商品编号
				this.LocalUpdateCol[2] = 3;	// 商品名称

				// 每行隐含域名、值数组
				this.HiddenArray[0] = "OOrderId";	// 订单 ID 值
				this.HiddenArray[1] = "-1";		// 初始值
				this.HiddenArray[2] = "OisUnitTow";	// 该行是否双单位
				this.HiddenArray[3] = "0";		// 默认不是双单位
				this.HiddenArray[4] = "OUnitRate";	// 双单位换算关系
				this.HiddenArray[5] = "1";		// 默认换算关系为 1
				this.HiddenArray[6] = "OIfSerial"	// 是否采用序列号强制管理
				this.HiddenArray[7] = "0";		// 默认为 0 ；0：非序列号强制管理；1：序列号强制管理
				this.HiddenArray[8] = "OSerialOut";	// 所有出库序列号字串
				this.HiddenArray[9] = "";		// 默认为空，各序列号以逗号 ( я ) 分隔
				this.HiddenArray[10] = "OUnitOne";	//小单位
				this.HiddenArray[11] = "";		// 默认为空
				this.HiddenArray[12] = "OUnitTwo";	// 大单位
				this.HiddenArray[13] = "";		// 默认为空
				// ===================================add by chen_qihua 2004-6-18 采购退货，销售退货加隐含列
				this.HiddenArray[14] = "OInputCostPrice";	// 成本单价
				this.HiddenArray[15] = "0";		// 默认为)
				this.HiddenArray[16] = "OID";	// 采购退货，销售退货关联的原来单据的商品的过账ID号
				this.HiddenArray[17] = "";		// 默认为空
				this.HiddenArray[18] = "OOldID";	// 采购退货，销售退货关联的原来单据ID
				this.HiddenArray[19] = "";		// 默认为空
				this.HiddenArray[20] = "OGoodsNumberPrice";	// 批次成本价
				this.HiddenArray[21] = "-1";		// 默认未-1
				this.HiddenArray[22] = "OHandZeroCost";	// 0成本出入库专用
				this.HiddenArray[23] = "0";		// 默认未0
				
				
				// 鼠标双击列
				this.MouseDbClickCols[0] = 1;
				this.MouseDbClickCols[1] = 4;
				this.MouseDbClickCols[2] = 12;

				this.Title[0]	= "No.";
				this.Title[1]	= "序列号";
				this.Title[2]	= "商品编号";
				this.Title[3]	= "商品全名";
				this.Title[4]	= "单位";
				this.Title[5]	= "条形码";
				this.Title[6]	= "规格";
				this.Title[7]	= "型号";
				this.Title[8]	= "产地";
				this.Title[9]	= "生产日期";
				this.Title[10]	= "效期至";
				this.Title[11]	= "批号";
				this.Title[12]  = "出库数量";
				this.Title[13]  = "单位关系";
				this.Title[14]	= "辅助单位";
				this.Title[15]	= "单价";
				this.Title[16]	= "金额";
				this.Title[17]	= "税率";
				this.Title[18]	= "含税单价";
				this.Title[19]	= "价税合计";
				this.Title[20]	= "备注";
				this.Title[21]	= "多编码";

				this.SumCols[0] = 12;
				this.SumCols[1] = 16;
				this.SumCols[2] = 19;

				this.FormatSumCols[0] = 12;
				this.FormatSumCols[1] = 1;
				this.FormatSumCols[2] = 16;
				this.FormatSumCols[3] = 2;
				this.FormatSumCols[4] = 19;
				this.FormatSumCols[5] = 2;

				this.IniCols[0] = 17;
				if ( typeof(this.IniColValues[0]) != "undefined" )
					this.IniCols[1] = this.IniColValues[0];
				else
					this.IniCols[1] = 17;	// 默认 17 点税
     
				// 销售单数量加入缺省值 1
				if ( typeof(this.IniColValues[1]) != "undefined" ) {
					this.IniCols[2] = 12;
					this.IniCols[3] = 1;
				}

				this.NumericCols[0] = 12;
				this.NumericCols[1] = 16;
				this.NumericCols[2] = 18;
				this.NumericCols[3] = 15;
				this.NumericCols[4] = 19;

				if (this.Disable) {
					this.DisableCols[0]	= 1;
					this.DisableCols[1]	= 2;
					this.DisableCols[2]	= 3;
					this.DisableCols[3]	= 4;
					this.DisableCols[4]	= 5;
					this.DisableCols[5]	= 6;
					this.DisableCols[6]	= 7;
					this.DisableCols[7]	= 8;
					this.DisableCols[8]	= 9;
					this.DisableCols[9]	= 10;
					this.DisableCols[10]	= 11;
					this.DisableCols[11]	= 12;
					this.DisableCols[12]	= 13;
					this.DisableCols[13]	= 14;
					this.DisableCols[14]	= 15;
					this.DisableCols[15]	= 16;
					this.DisableCols[16]	= 17;
					this.DisableCols[17]	= 18;
					this.DisableCols[18]	= 19;
					this.DisableCols[19]	= 20;
					this.DisableCols[20]	= 21;
				}
				else {
					this.DisableCols[0]	= 4;
					this.DisableCols[1]	= 5;
					this.DisableCols[2]	= 6;
					this.DisableCols[3]	= 7;
					this.DisableCols[4]	= 8;
					this.DisableCols[5]	= 9;  
					this.DisableCols[6] = 10;
					this.DisableCols[7] = 11;
					this.DisableCols[8] = 13;
					this.DisableCols[9] = 14;
					this.DisableCols[10]	= 16;
					this.DisableCols[11]	= 17;
					this.DisableCols[12]	= 21;
				}

				this.FormatCols[0] = 12;		// 数量
				this.FormatCols[1] = 1;		// 第一种格式(小数保留4位)
				this.FormatCols[2] = 18;	// 含税单价
				this.FormatCols[3] = 1;
				this.FormatCols[4] = 16;	// 金额
				this.FormatCols[5] = 2;
				this.FormatCols[6] = 19;	// 价税合计
				this.FormatCols[7] = 2;		// 第二种格式(小数保留2位)
				this.FormatCols[8] = 15;	// 单价
				this.FormatCols[9] = 1;

				this.ResultCols[0] = 12;     //需要数量变化需从新计算的列
				this.ResultCols[1] = 15;     //需要数量变化需从新计算的列
				this.ResultCols[2] = 16;	//徐辉 添加税前单价列 2004-4-23,2004-9-15 添加价税合计
				this.ResultCols[3] = 18;
				this.ResultCols[4] = 19;

				this.ColWidth[0]	= 25;
				this.ColWidth[1]	= 100;
				this.ColWidth[2]	= 100;
				this.ColWidth[3]	= 150;
				this.ColWidth[4]	= 40;
				this.ColWidth[5]	= 100;
				this.ColWidth[6]	= 80;
				this.ColWidth[7]	= 80;
				this.ColWidth[8]	= 100;
				this.ColWidth[9]	= 80;
				this.ColWidth[10]	= 80;
				this.ColWidth[11]	= 80;
				this.ColWidth[12]	= 80;
				this.ColWidth[13]	= 80;
				this.ColWidth[14]	= 100;
				this.ColWidth[15]	= 80;
				this.ColWidth[16]	= 80;
				this.ColWidth[17]	= 40;
				this.ColWidth[18]	= 80;
				this.ColWidth[19]	= 80;
				this.ColWidth[20]	= 100;
				this.ColWidth[21]	= 100;

				this.ColEditName[0]	= "";
				this.ColEditName[1]	= "OSerialSel_Edit";
				this.ColEditName[2]	= "OUserCode_Edit";
				this.ColEditName[3]	= "OFullName_Edit";
				this.ColEditName[4]	= "OUnit_Edit";
				this.ColEditName[5]	= "OEntryCode_Edit";
				this.ColEditName[6]	= "OStandard_Edit";
				this.ColEditName[7]	= "OType_Edit";
				this.ColEditName[8]	= "OArea_Edit";
				this.ColEditName[9]	= "OProduceDate_Edit";
				this.ColEditName[10]	= "OValidDate_Edit";
				this.ColEditName[11]	= "OGoodsNumber_Edit";
				this.ColEditName[12]	= "OQty_Edit";
				this.ColEditName[13]	= "OUnitRate_Edit";
				this.ColEditName[14]	= "OAssistantUnit_Edit";
				this.ColEditName[15]	= "OPrice_Edit";
				this.ColEditName[16]	= "ONoTaxTotal_Edit";
				this.ColEditName[17]	= "OTaxRate_Edit";
				this.ColEditName[18]	= "OTaxPrice_Edit";
				this.ColEditName[19]	= "OTotal_Edit";
				this.ColEditName[20]	= "OBase_Edit";
				this.ColEditName[21]	= "OCustomerCode_Edit";

				this.SumRow = "<tr class=\"ClientTablesum\" id=\"SumRow\" height=\"20px\"><td>合计</td>";strColsDisplay = 1;
				
				
				for ( i = 1; i < this.cols; i++ ) {
					// Judge If Display The Grid Cols
					for ( j = 1; j < this.HiddenColsArray.length; j++ ) {
						if ( this.HiddenColsArray[j] == this.ColEditName[i] ) {
							strColsDisplay = 0;
							break;
						}
						else
							strColsDisplay = 1;
						
					}
					for ( j = 0; j < this.SumCols.length; j++ ) {
						if ( i == parseInt(this.SumCols[j]) ) {
							strSumValueDisplay = "<span id=\"" + this.name + "Total" + this.SumCols[j] + "\" style=\"color:#000000\">&nbsp;0</span>";break;
						}
						else
							strSumValueDisplay = "&nbsp;";
					}
					if ( strColsDisplay == 1 ) {
						this.SumRow = this.SumRow + "<td>" + strSumValueDisplay + "</td>";
					}
					else{
						this.SumRow = this.SumRow + "<td style='display:none'>" + strSumValueDisplay + "</td>";
					}
				}

				if ( !this.Disable ) {	// 删除列所占用的单元格
					this.SumRow = this.SumRow + "<td>&nbsp;</td>";
				}
				this.SumRow = this.SumRow + "</tr>";

				//if ( !this.Disable )
				//	this.SumRow="<tr class=ClientTablesum id=SumRow height=20px><td colspan=4>&nbsp;合计</td><td><span id="+this.name+"Total4 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td><span id="+this.name+"Total6 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td>&nbsp;</td><td><span id="+this.name+"Total9 style='color:#000000'>&nbsp;0</span><td>&nbsp;</td><td>&nbsp;</td></tr>";
				//else
				//	this.SumRow="<tr class=ClientTablesum id=SumRow height=20px><td colspan=4>&nbsp;合计</td><td><span id="+this.name+"Total4 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td><span id="+this.name+"Total6 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td>&nbsp;</td><td><span id="+this.name+"Total9 style='color:#000000'>&nbsp;0</span><td>&nbsp;</td></tr>";

				break;
			case 1532:		// 销售换货(入) 税率
				this.cols = 22;		// 商品录入 含税

				// 局部更新列
				this.LocalUpdateCol[0] = 1;	// 序列号
				this.LocalUpdateCol[1] = 2;	// 商品编号
				this.LocalUpdateCol[2] = 3;	// 商品名称

				// 每行隐含域名、值数组
				this.HiddenArray[0] = "IOrderId";	// 订单 ID 值
				this.HiddenArray[1] = "-1";		// 初始值
				this.HiddenArray[2] = "IisUnitTow";	// 该行是否双单位
				this.HiddenArray[3] = "0";		// 默认不是双单位
				this.HiddenArray[4] = "IUnitRate";	// 双单位换算关系
				this.HiddenArray[5] = "1";		// 默认换算关系为 1
				this.HiddenArray[6] = "IIfSerial"	// 是否采用序列号强制管理
				this.HiddenArray[7] = "0";		// 默认为 0 ；0：非序列号强制管理；1：序列号强制管理
				this.HiddenArray[8] = "ISerialOut";	// 所有出库序列号字串
				this.HiddenArray[9] = "";		// 默认为空，各序列号以逗号 ( я ) 分隔
				this.HiddenArray[10] = "IUnitOne";	//小单位
				this.HiddenArray[11] = "";		// 默认为空
				this.HiddenArray[12] = "IUnitTwo";	// 大单位
				this.HiddenArray[13] = "";		// 默认为空
				// ===================================add by chen_qihua 2004-6-18 采购退货，销售退货加隐含列
				this.HiddenArray[14] = "IInputCostPrice";	// 成本单价
				this.HiddenArray[15] = "0";		// 默认为)
				this.HiddenArray[16] = "IID";	// 采购退货，销售退货关联的原来单据的商品的过账ID号
				this.HiddenArray[17] = "";		// 默认为空
				this.HiddenArray[18] = "IOldID";	// 采购退货，销售退货关联的原来单据ID
				this.HiddenArray[19] = "";		// 默认为空
				this.HiddenArray[20] = "IGoodsNumberPrice";	// 批次成本价
				this.HiddenArray[21] = "-1";		// 默认未-1
				this.HiddenArray[22] = "IHandZeroCost";	// 0成本出入库专用
				this.HiddenArray[23] = "0";		// 默认未0
				
				
				// 鼠标双击列
				this.MouseDbClickCols[0] = 1;
				this.MouseDbClickCols[1] = 4;

				this.Title[0]	= "No.";
				this.Title[1]	= "序列号";
				this.Title[2]	= "商品编号";
				this.Title[3]	= "商品全名";
				this.Title[4]	= "单位";
				this.Title[5]	= "条形码";
				this.Title[6]	= "规格";
				this.Title[7]	= "型号";
				this.Title[8]	= "产地";
				this.Title[9]	= "生产日期";
				this.Title[10]	= "效期至";
				this.Title[11]	= "批号";
				this.Title[12]   = "入库数量";
				this.Title[13]  = "单位关系";
				this.Title[14]	= "辅助单位";
				this.Title[15]	= "单价";
				this.Title[16]	= "金额";
				this.Title[17]	= "税率";
				this.Title[18]	= "含税单价";
				this.Title[19]	= "价税合计";
				this.Title[20]	= "备注";
				this.Title[21]	= "多编码";

				this.SumCols[0] = 12;
				this.SumCols[1] = 16;
				this.SumCols[2] = 19;

				this.FormatSumCols[0] = 12;
				this.FormatSumCols[1] = 1;
				this.FormatSumCols[2] = 16;
				this.FormatSumCols[3] = 2;
				this.FormatSumCols[4] = 19;
				this.FormatSumCols[5] = 2;

				this.IniCols[0] = 17;
				if ( typeof(this.IniColValues[0]) != "undefined" )
					this.IniCols[1] = this.IniColValues[0];
				else
					this.IniCols[1] = 17;	// 默认 17 点税
     
				// 销售单数量加入缺省值 1
				if ( typeof(this.IniColValues[1]) != "undefined" ) {
					this.IniCols[2] = 12;
					this.IniCols[3] = 1;
				}

				this.NumericCols[0] = 12;
				this.NumericCols[1] = 18;
				this.NumericCols[2] = 15;
				this.NumericCols[3] = 19;

				if (this.Disable) {
					this.DisableCols[0]	= 1;
					this.DisableCols[1]	= 2;
					this.DisableCols[2]	= 3;
					this.DisableCols[3]	= 4;
					this.DisableCols[4]	= 5;
					this.DisableCols[5]	= 6;
					this.DisableCols[6]	= 7;
					this.DisableCols[7]	= 8;
					this.DisableCols[8]	= 9;
					this.DisableCols[9]	= 10;
					this.DisableCols[10]	= 11;
					this.DisableCols[11]	= 12;
					this.DisableCols[12]	= 13;
					this.DisableCols[13]	= 14;
					this.DisableCols[14]	= 15;
					this.DisableCols[15]	= 16;
					this.DisableCols[16]	= 17;
					this.DisableCols[17]	= 18;
					this.DisableCols[18]	= 19;
					this.DisableCols[19]	= 20;
					this.DisableCols[20]	= 21;
				}
				else {
					this.DisableCols[0]	= 4;
					this.DisableCols[1]	= 5;
					this.DisableCols[2]	= 6;
					this.DisableCols[3]	= 7;
					this.DisableCols[4]	= 8;
					this.DisableCols[5] = 13;
					this.DisableCols[6] = 14;
					this.DisableCols[7]	= 16;
					this.DisableCols[8]	= 17;
					this.DisableCols[9]	= 21;
				}

				this.FormatCols[0] = 12;		// 数量
				this.FormatCols[1] = 1;		// 第一种格式(小数保留4位)
				this.FormatCols[2] = 18;	// 含税单价
				this.FormatCols[3] = 1;
				this.FormatCols[4] = 16;	// 金额
				this.FormatCols[5] = 2;
				this.FormatCols[6] = 19;	// 价税合计
				this.FormatCols[7] = 2;		// 第二种格式(小数保留2位)
				this.FormatCols[8] = 15;	// 单价
				this.FormatCols[9] = 1;

				this.ResultCols[0] = 12;     //需要数量变化需从新计算的列
				this.ResultCols[1] = 15;	//徐辉 添加税前单价列 2004-4-23,2004-9-15 添加价税合计
				this.ResultCols[2] = 18;
				this.ResultCols[3] = 19;

				this.ColWidth[0]	= 25;
				this.ColWidth[1]	= 100;
				this.ColWidth[2]	= 100;
				this.ColWidth[3]	= 150;
				this.ColWidth[4]	= 40;
				this.ColWidth[5]	= 100;
				this.ColWidth[6]	= 80;
				this.ColWidth[7]	= 80;
				this.ColWidth[8]	= 100;
				this.ColWidth[9]	= 80;
				this.ColWidth[10]	= 80;
				this.ColWidth[11]	= 80;
				this.ColWidth[12]	= 80;
				this.ColWidth[13]	= 80;
				this.ColWidth[14]	= 100;
				this.ColWidth[15]	= 80;
				this.ColWidth[16]	= 80;
				this.ColWidth[17]	= 40;
				this.ColWidth[18]	= 80;
				this.ColWidth[19]	= 80;
				this.ColWidth[20]	= 100;
				this.ColWidth[21]	= 100;

				this.ColEditName[0]	= "";
				this.ColEditName[1]	= "ISerialSel_Edit";
				this.ColEditName[2]	= "IUserCode_Edit";
				this.ColEditName[3]	= "IFullName_Edit";
				this.ColEditName[4]	= "IUnit_Edit";
				this.ColEditName[5]	= "IEntryCode_Edit";
				this.ColEditName[6]	= "IStandard_Edit";
				this.ColEditName[7]	= "IType_Edit";
				this.ColEditName[8]	= "IArea_Edit";
				this.ColEditName[9]	= "IProduceDate_Edit";
				this.ColEditName[10]	= "IValidDate_Edit";
				this.ColEditName[11]	= "IGoodsNumber_Edit";
				this.ColEditName[12]	= "IQty_Edit";
				this.ColEditName[13]	= "IUnitRate_Edit";
				this.ColEditName[14]	= "IAssistantUnit_Edit";
				this.ColEditName[15]	= "IPrice_Edit";
				this.ColEditName[16]	= "INoTaxTotal_Edit";
				this.ColEditName[17]	= "ITaxRate_Edit";
				this.ColEditName[18]	= "ITaxPrice_Edit";
				this.ColEditName[19]	= "ITotal_Edit";
				this.ColEditName[20]	= "IBase_Edit";
				this.ColEditName[21]	= "ICustomerCode_Edit";

				this.SumRow = "<tr class=\"ClientTablesum\" id=\"SumRow\" height=\"20px\"><td>合计</td>";strColsDisplay = 1;
				
				
				for ( i = 1; i < this.cols; i++ ) {
					// Judge If Display The Grid Cols
					for ( j = 1; j < this.HiddenColsArray.length; j++ ) {
						if ( this.HiddenColsArray[j] == this.ColEditName[i] ) {
							strColsDisplay = 0;
							break;
						}
						else
							strColsDisplay = 1;
						
					}
					for ( j = 0; j < this.SumCols.length; j++ ) {
						if ( i == parseInt(this.SumCols[j]) ) {
							strSumValueDisplay = "<span id=\"" + this.name + "Total" + this.SumCols[j] + "\" style=\"color:#000000\">&nbsp;0</span>";break;
						}
						else
							strSumValueDisplay = "&nbsp;";
					}
					if ( strColsDisplay == 1 ) {
						this.SumRow = this.SumRow + "<td>" + strSumValueDisplay + "</td>";
					}
					else{
						this.SumRow = this.SumRow + "<td style='display:none'>" + strSumValueDisplay + "</td>";
					}
				}

				if ( !this.Disable ) {	// 删除列所占用的单元格
					this.SumRow = this.SumRow + "<td>&nbsp;</td>";
				}
				this.SumRow = this.SumRow + "</tr>";

				//if ( !this.Disable )
				//	this.SumRow="<tr class=ClientTablesum id=SumRow height=20px><td colspan=4>&nbsp;合计</td><td><span id="+this.name+"Total4 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td><span id="+this.name+"Total6 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td>&nbsp;</td><td><span id="+this.name+"Total9 style='color:#000000'>&nbsp;0</span><td>&nbsp;</td><td>&nbsp;</td></tr>";
				//else
				//	this.SumRow="<tr class=ClientTablesum id=SumRow height=20px><td colspan=4>&nbsp;合计</td><td><span id="+this.name+"Total4 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td><span id="+this.name+"Total6 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td>&nbsp;</td><td><span id="+this.name+"Total9 style='color:#000000'>&nbsp;0</span><td>&nbsp;</td></tr>";

				break;
			case 1513:	// 采购换货(入) 普通
				this.cols = 19;
				this.LocalUpdateCol[0] = 1;		// 局部更新列 - 商品编号
				this.LocalUpdateCol[1] = 2;		// 局部更新列 - 商品名称

				// 每行隐含域名、值数组
				this.HiddenArray[0] = "IOrderId";	// 订单 ID 值
				this.HiddenArray[1] = "-1";		// 初始值
				this.HiddenArray[2] = "IisUnitTow";	// 该行是否双单位
				this.HiddenArray[3] = "0";		// 默认不是双单位
				this.HiddenArray[4] = "IUnitRate";	// 双单位换算关系
				this.HiddenArray[5] = "1";		// 默认换算关系为 1
				this.HiddenArray[6] = "IIfSerial";	// 是否采用序列号强制管理
				this.HiddenArray[7] = "0";		// 默认为 0 ；0：非序列号强制管理；1：序列号强制管理
				this.HiddenArray[8] = "SerialIn";	// 所有入库序列号字串
				this.HiddenArray[9] = "";		// 默认为空，各序列号以逗号 ( я ) 分隔
				this.HiddenArray[10] = "IUnitOne";	//小单位
				this.HiddenArray[11] = "";		// 默认为空
				this.HiddenArray[12] = "IUnitTwo";	// 大单位
				this.HiddenArray[13] = "";		// 默认为空
				this.HiddenArray[14] = "IInputCostPrice";	// 成本单价
				this.HiddenArray[15] = "-1";		// 默认未-1
				this.HiddenArray[16] = "IHandZeroCost";	// 0成本出入库专用
				this.HiddenArray[17] = "0";		// 默认为0

				// 鼠标双击列
				this.MouseDbClickCols[0] = 3;
				this.MouseDbClickCols[1] = 17;

				// 初始化表头各列中文名
				this.Title[0]	= "No.";
				this.Title[1]	= "商品编号";
				this.Title[2]	= "商品全名";
				this.Title[3]	= "单位";
				this.Title[4]	= "条形码";
				this.Title[5]	= "规格";
				this.Title[6]	= "型号";
				this.Title[7]	= "产地";
				this.Title[8]	= "生产日期";
				this.Title[9]	= "效期至";
				this.Title[10]	= "批号";
				this.Title[11]	= "入库数量";
				this.Title[12]  = "单位关系";
				this.Title[13]	= "辅助单位";
				this.Title[14]	= "单价";
				this.Title[15]	= "金额";
				this.Title[16]	= "备注";
				this.Title[17]	= "序列号";
				this.Title[18]	= "多编码";
				

				// 需要合计的列
				this.SumCols[0] = 11;
				this.SumCols[1] = 15;

				this.FormatSumCols[0] = 11;
				this.FormatSumCols[1] = 1;
				this.FormatSumCols[2] = 15;
				this.FormatSumCols[3] = 2;

				this.NumericCols[0] = 11;
				this.NumericCols[1] = 14;
				this.NumericCols[2] = 15;

				this.FormatCols[0] = 11;
				this.FormatCols[1] = 1;			// 第一种格式 ( 小数保留4位 )
				this.FormatCols[2] = 14;
				this.FormatCols[3] = 1;
				this.FormatCols[4] = 15;
				this.FormatCols[5] = 2;			// 第二种格式 ( 小数保留2位 )

				this.ResultCols[0] = ";";
				this.ResultCols[1] = 11;
				this.ResultCols[2] = "*";
				this.ResultCols[3] = 14;
				this.ResultCols[4] = "=";
				this.ResultCols[5] = 15;
				this.ResultCols[6] = ";";

				// 只读列，Disable 用于显示单据明细时用
				if ( this.Disable ) {
					this.DisableCols[0]	= 1;
					this.DisableCols[1]	= 2;
					this.DisableCols[2]	= 3;
					this.DisableCols[3]	= 4;
					this.DisableCols[4]	= 5;
					this.DisableCols[5]	= 6;
					this.DisableCols[6]	= 7;
					this.DisableCols[7]	= 8;
					this.DisableCols[8]	= 9;
					this.DisableCols[9]	= 10;
					this.DisableCols[10]	= 11;
					this.DisableCols[11]	= 12;
					this.DisableCols[12]	= 13;
					this.DisableCols[13]	= 14;
					this.DisableCols[14]	= 15;
					this.DisableCols[15]	= 16;
					this.DisableCols[16]	= 17;
					this.DisableCols[17]	= 18;
				}
				else {	// 正常情况是“单位”、“条形码”、“规格”、“型号”、“产地”、“金额”列为只读
					this.DisableCols[0] = 3;
					this.DisableCols[1] = 4;
					this.DisableCols[2] = 5;
					this.DisableCols[3] = 6;
					this.DisableCols[4] = 7;
					this.DisableCols[5] = 12;
					this.DisableCols[6] = 13;
					this.DisableCols[7] = 18;
				}

				// 每列的宽度
				this.ColWidth[0]	= 25;
				this.ColWidth[1]	= 100;
				this.ColWidth[2]	= 150;
				this.ColWidth[3]	= 40;
				this.ColWidth[4]	= 100;
				this.ColWidth[5]	= 80;
				this.ColWidth[6]	= 80;
				this.ColWidth[7]	= 100;
				this.ColWidth[8]	= 80;
				this.ColWidth[9]	= 80;
				this.ColWidth[10]	= 80;
				this.ColWidth[11]	= 80;
				this.ColWidth[12]	= 80;
				this.ColWidth[13]	= 80;
				this.ColWidth[14]	= 80;
				this.ColWidth[15]	= 80;
				this.ColWidth[16]	= 100;
				this.ColWidth[17]	= 100;
				this.ColWidth[18]	= 100;

				// 定义各列的域名称
				this.ColEditName[0]	= "";
				this.ColEditName[1]	= "IUserCode_Edit";
				this.ColEditName[2]	= "IFullName_Edit";
				this.ColEditName[3]	= "IUnit_Edit";
				this.ColEditName[4]	= "IEntryCode_Edit";
				this.ColEditName[5]	= "IStandard_Edit";
				this.ColEditName[6]	= "IType_Edit";
				this.ColEditName[7]	= "IArea_Edit";
				this.ColEditName[8]	= "IProduceDate_Edit";
				this.ColEditName[9]	= "IValidDate_Edit";
				this.ColEditName[10] = "IGoodsNumber_Edit";
				this.ColEditName[11]	= "IQty_Edit";
				this.ColEditName[12]	= "IUnitRate_Edit";
				this.ColEditName[13]	= "IAssistantUnit_Edit";
				this.ColEditName[14]	= "IPrice_Edit";
				this.ColEditName[15]	= "ITotal_Edit";
				this.ColEditName[16]	= "IBase_Edit";
				this.ColEditName[17]	= "Serial_Edit";
				this.ColEditName[18]	= "ICustomerCode_Edit";
				

				this.SumRow = "<tr class=\"ClientTablesum\" id=\"SumRow\" height=\"20px\"><td>合计</td>";strColsDisplay = 1;
				
				
				for ( i = 1; i < this.cols; i++ ) {
					// Judge If Display The Grid Cols
					for ( j = 1; j < this.HiddenColsArray.length; j++ ) {
						if ( this.HiddenColsArray[j] == this.ColEditName[i] ) {
							strColsDisplay = 0;
							break;
						}
						else
							strColsDisplay = 1;
						
					}
					for ( j = 0; j < this.SumCols.length; j++ ) {
						if ( i == parseInt(this.SumCols[j]) ) {
							strSumValueDisplay = "<span id=\"" + this.name + "Total" + this.SumCols[j] + "\" style=\"color:#000000\">&nbsp;0</span>";break;
						}
						else
							strSumValueDisplay = "&nbsp;";
					}
					if ( strColsDisplay == 1 ) {
						this.SumRow = this.SumRow + "<td>" + strSumValueDisplay + "</td>";
					}
					else{
						this.SumRow = this.SumRow + "<td style='display:none'>" + strSumValueDisplay + "</td>";
					}
				}

				if ( !this.Disable ) {	// 删除列所占用的单元格
					this.SumRow = this.SumRow + "<td>&nbsp;</td>";
				}
				this.SumRow = this.SumRow + "</tr>";

				break;
			case 1523:	// 采购换货 入库 折扣
				this.cols = 22;		// 商品录入 折扣

				this.LocalUpdateCol[0] = 1;	// 局部更新列
				this.LocalUpdateCol[1] = 2;	// 局部更新列

				// 每行隐含域名、值数组
				this.HiddenArray[0] = "IOrderId";	// 订单 ID 值
				this.HiddenArray[1] = "-1";		// 初始值
				this.HiddenArray[2] = "IisUnitTow";	// 该行是否双单位
				this.HiddenArray[3] = "0";		// 默认不是双单位
				this.HiddenArray[4] = "IUnitRate";	// 双单位换算关系
				this.HiddenArray[5] = "1";		// 默认换算关系为 1
				this.HiddenArray[6] = "IIfSerial"	// 是否采用序列号强制管理
				this.HiddenArray[7] = "0";		// 默认为 0 ；0：非序列号强制管理；1：序列号强制管理
				this.HiddenArray[8] = "SerialIn";	// 所有入库序列号字串
				this.HiddenArray[9] = "";		// 默认为空，各序列号以逗号 ( я ) 分隔
				this.HiddenArray[10] = "IUnitOne";	//小单位
				this.HiddenArray[11] = "";		// 默认为空
				this.HiddenArray[12] = "IUnitTwo";	// 大单位
				this.HiddenArray[13] = "";		// 默认为空
				this.HiddenArray[14] = "IInputCostPrice";	// 成本单价
				this.HiddenArray[15] = "-1";		// 默认未-1
				this.HiddenArray[16] = "IHandZeroCost";	// 0成本出入库专用
				this.HiddenArray[17] = "0";		// 默认为0
	 

				// 鼠标双击列
				this.MouseDbClickCols[0] = 3;
				this.MouseDbClickCols[1] = 20;

				this.Title[0]	= "No.";
				this.Title[1]	= "商品编号";
				this.Title[2]	= "商品全名";
				this.Title[3]	= "单位";
				this.Title[4]	= "条形码";
				this.Title[5]	= "规格";
				this.Title[6]	= "型号";
				this.Title[7]	= "产地";
				this.Title[8]	= "生产日期";
				this.Title[9]	= "效期至";
				this.Title[10]	= "批号";
				this.Title[11]	= "入库数量";
				this.Title[12]	= "单位关系";
				this.Title[13]	= "辅助单位";
				this.Title[14]	= "单价";
				this.Title[15]	= "金额";
				this.Title[16]	= "扣率";
				this.Title[17]	= "折后单价";
				this.Title[18]	= "折后金额";
				this.Title[19]	= "备注";
				this.Title[20]	= "序列号";
				this.Title[21]	= "多编码";

				this.SumCols[0] = 11;
				this.SumCols[1] = 15;
				this.SumCols[2] = 18;

				this.FormatSumCols[0] = 11;
				this.FormatSumCols[1] = 1;
				this.FormatSumCols[2] = 15;
				this.FormatSumCols[3] = 2;
				this.FormatSumCols[4] = 18;
				this.FormatSumCols[5] = 2;

				this.IniCols[0] = 16;
				if ( typeof(this.IniColValues[0]) != "undefined" )
					this.IniCols[1] = this.IniColValues[0];
				else
					this.IniCols[1] = 1;

				this.NumericCols[0] = 11;
				this.NumericCols[1] = 14;
				this.NumericCols[2] = 15;
				this.NumericCols[3] = 16;
				this.NumericCols[4] = 17;
				this.NumericCols[5] = 18;

				if ( this.Disable ) {
					this.DisableCols[0]	= 1;
					this.DisableCols[1]	= 2;
					this.DisableCols[2]	= 3;
					this.DisableCols[3]	= 4;
					this.DisableCols[4]	= 5;
					this.DisableCols[5]	= 6;
					this.DisableCols[6]	= 7;
					this.DisableCols[7]	= 8;
					this.DisableCols[8]	= 9;
					this.DisableCols[9]	= 10;
					this.DisableCols[10]	= 11;
					this.DisableCols[11]	= 12;
					this.DisableCols[12]	= 13;
					this.DisableCols[13]	= 14;
					this.DisableCols[14]	= 15;
					this.DisableCols[15]	= 16;
					this.DisableCols[16]	= 17;
					this.DisableCols[17]	= 18;
					this.DisableCols[18]	= 19;
					this.DisableCols[19]	= 20;
					this.DisableCols[20]	= 21;
				}
				else {
					this.DisableCols[0]	= 3;
					this.DisableCols[1]	= 4;
					this.DisableCols[2]	= 5;
					this.DisableCols[3]	= 6;
					this.DisableCols[4]	= 7;
					//this.DisableCols[5]	= 14; //折前单价可修改 2004-4-22 徐辉
					this.DisableCols[5]	= 12;
					this.DisableCols[6]	= 13;
					this.DisableCols[7]	= 15;
					this.DisableCols[8]	= 21;
				}

				this.FormatCols[0]	= 11;	// 数量
				this.FormatCols[1]	= 1;	// 第一种格式(小数保留4位)
				this.FormatCols[2]	= 17;	// 折后单价
				this.FormatCols[3]	= 1;
				this.FormatCols[4]	= 15;	// 金额
				this.FormatCols[5]	= 2;
				this.FormatCols[6]	= 18;	// 折后金额
				this.FormatCols[7]	= 2;	// 第二种格式(小数保留2位)
				this.FormatCols[8]	= 14;	// 单价
				this.FormatCols[9]	= 1;
				this.FormatCols[10]	= 16;	//折扣率
				this.FormatCols[11]	= 1;

				this.ResultCols[0] = 11;
				this.ResultCols[1] = 14;
				this.ResultCols[2] = 15;
				this.ResultCols[3] = 16
				this.ResultCols[4] = 17;
				this.ResultCols[5] = 18;

				this.ColWidth[0]	= 25;
				this.ColWidth[1]	= 100;
				this.ColWidth[2]	= 150;
				this.ColWidth[3]	= 40;
				this.ColWidth[4]	= 100;
				this.ColWidth[5]	= 80;
				this.ColWidth[6]	= 80;
				this.ColWidth[7]	= 100;
				this.ColWidth[8]	= 80;
				this.ColWidth[9]	= 80;
				this.ColWidth[10]	= 80;
				this.ColWidth[11]	= 80;
				this.ColWidth[12]	= 80;
				this.ColWidth[13]	= 100;
				this.ColWidth[14]	= 80;
				this.ColWidth[15]	= 80;
				this.ColWidth[16]	= 40;
				this.ColWidth[17]	= 80;
				this.ColWidth[18]	= 80;
				this.ColWidth[19]	= 100;
				this.ColWidth[20]	= 100;
				this.ColWidth[21]	= 100;

				this.ColEditName[0]	= "";
				this.ColEditName[1]	= "IUserCode_Edit";
				this.ColEditName[2]	= "IFullName_Edit";
				this.ColEditName[3]	= "IUnit_Edit";
				this.ColEditName[4]	= "IEntryCode_Edit";
				this.ColEditName[5]	= "IStandard_Edit";
				this.ColEditName[6]	= "IType_Edit";
				this.ColEditName[7]	= "IArea_Edit";
				this.ColEditName[8]	= "IProduceDate_Edit";
				this.ColEditName[9]	= "IValidDate_Edit";
				this.ColEditName[10] = "IGoodsNumber_Edit";
				this.ColEditName[11]	= "IQty_Edit";
				this.ColEditName[12]	= "IUnitRate_Edit";
				this.ColEditName[13]	= "IAssistantUnit_Edit";
				this.ColEditName[14]	= "IPrice_Edit";
				this.ColEditName[15]	= "INoDiscountTotal_Edit";
				this.ColEditName[16]	= "IDiscount_Edit";
				this.ColEditName[17]	= "IDiscountPrice_Edit";
				this.ColEditName[18]	= "ITotal_Edit";
				this.ColEditName[19]	= "IBase_Edit";
				this.ColEditName[20]	= "Serial_Edit";
				this.ColEditName[21]	= "ICustomerCode_Edit";

				this.SumRow = "<tr class=\"ClientTablesum\" id=\"SumRow\" height=\"20px\"><td>合计</td>";strColsDisplay = 1;
				
				
				for ( i = 1; i < this.cols; i++ ) {
					// Judge If Display The Grid Cols
					for ( j = 1; j < this.HiddenColsArray.length; j++ ) {
						if ( this.HiddenColsArray[j] == this.ColEditName[i] ) {
							strColsDisplay = 0;
							break;
						}
						else
							strColsDisplay = 1;
						
					}
					for ( j = 0; j < this.SumCols.length; j++ ) {
						if ( i == parseInt(this.SumCols[j]) ) {
							strSumValueDisplay = "<span id=\"" + this.name + "Total" + this.SumCols[j] + "\" style=\"color:#000000\">&nbsp;0</span>";break;
						}
						else
							strSumValueDisplay = "&nbsp;";
					}
					if ( strColsDisplay == 1 ) {
						this.SumRow = this.SumRow + "<td>" + strSumValueDisplay + "</td>";
					}
					else{
						this.SumRow = this.SumRow + "<td style='display:none'>" + strSumValueDisplay + "</td>";
					}
				}

				if ( !this.Disable ) {	// 删除列所占用的单元格
					this.SumRow = this.SumRow + "<td>&nbsp;</td>";
				}
				this.SumRow = this.SumRow + "</tr>";

				//if ( !this.Disable )
				//	this.SumRow="<tr class=ClientTablesum id=SumRow height=20px><td colspan=4>&nbsp;合计</td><td><span id="+this.name+"Total4 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td><span id="+this.name+"Total6 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td>&nbsp;</td><td><span id="+this.name+"Total9 style='color:#000000'>&nbsp;0</span><td>&nbsp;</td><td>&nbsp;</td></tr>";
				//else
				//	this.SumRow="<tr class=ClientTablesum id=SumRow height=20px><td colspan=4>&nbsp;合计</td><td><span id="+this.name+"Total4 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td><span id="+this.name+"Total6 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td>&nbsp;</td><td><span id="+this.name+"Total9 style='color:#000000'>&nbsp;0</span><td>&nbsp;</td></tr>";

				break;
			case 1533:	// 采购换货 入库 税率
				this.cols = 22;		// 商品录入 含税

				this.LocalUpdateCol[0] = 1;	// 局部更新列
				this.LocalUpdateCol[1] = 2;	// 局部更新列

				// 每行隐含域名、值数组
				this.HiddenArray[0] = "IOrderId";	// 订单 ID 值
				this.HiddenArray[1] = "-1";		// 初始值
				this.HiddenArray[2] = "IisUnitTow";	// 该行是否双单位
				this.HiddenArray[3] = "0";		// 默认不是双单位
				this.HiddenArray[4] = "IUnitRate";	// 双单位换算关系
				this.HiddenArray[5] = "1";		// 默认换算关系为 1
				this.HiddenArray[6] = "IIfSerial"	// 是否采用序列号强制管理
				this.HiddenArray[7] = "0";		// 默认为 0 ；0：非序列号强制管理；1：序列号强制管理
				this.HiddenArray[8] = "SerialIn";	// 所有入库序列号字串
				this.HiddenArray[9] = "";		// 默认为空，各序列号以逗号 ( я ) 分隔
				this.HiddenArray[10] = "IUnitOne";	//小单位
				this.HiddenArray[11] = "";		// 默认为空
				this.HiddenArray[12] = "IUnitTwo";	// 大单位
				this.HiddenArray[13] = "";		// 默认为空
				this.HiddenArray[14] = "IInputCostPrice";	// 成本单价
				this.HiddenArray[15] = "-1";		// 默认未-1
				this.HiddenArray[16] = "IHandZeroCost";	// 成本单价
				this.HiddenArray[17] = "0";		// 默认为0


				// 鼠标双击列
				this.MouseDbClickCols[0] = 3;
				this.MouseDbClickCols[1] = 20;

				// 初始化表头
				this.Title[0]	= "No.";
				this.Title[1]	= "商品编号";
				this.Title[2]	= "商品全名";
				this.Title[3]	= "单位";
				this.Title[4]	= "条形码";
				this.Title[5]	= "规格";
				this.Title[6]	= "型号";
				this.Title[7]	= "产地";
				this.Title[8]	= "生产日期";
				this.Title[9]	= "效期至";
				this.Title[10]	= "批号";
				this.Title[11]	= "入库数量";
				this.Title[12]  = "单位关系";
				this.Title[13]	= "辅助单位";
				this.Title[14]	= "单价";
				this.Title[15]	= "金额";
				this.Title[16]	= "税率";
				this.Title[17]	= "含税单价";
				this.Title[18]	= "价税合计";
				this.Title[19]	= "备注";
				this.Title[20]	= "序列号";
				this.Title[21]	= "多编码";

				this.SumCols[0] = 11;
				this.SumCols[1] = 15;
				this.SumCols[2] = 18;

				this.FormatSumCols[0] = 11;
				this.FormatSumCols[1] = 1;
				this.FormatSumCols[2] = 15;
				this.FormatSumCols[3] = 2;
				this.FormatSumCols[4] = 18;
				this.FormatSumCols[5] = 2;

				this.IniCols[0] = 16;
				if ( typeof(this.IniColValues[0]) != "undefined" )
					this.IniCols[1] = this.IniColValues[0];
				else
					this.IniCols[1] = "17";

				this.NumericCols[0] = 11;
				this.NumericCols[1] = 14;
				this.NumericCols[2] = 15;
				this.NumericCols[3] = 17;
				this.NumericCols[4] = 18;

				if ( this.Disable ) {
					this.DisableCols[0]	= 1;
					this.DisableCols[1]	= 2;
					this.DisableCols[2]	= 3;
					this.DisableCols[3]	= 4;
					this.DisableCols[4]	= 5;
					this.DisableCols[5]	= 6;
					this.DisableCols[6]	= 7;
					this.DisableCols[7]	= 8;
					this.DisableCols[8]	= 9;
					this.DisableCols[9]	= 10;
					this.DisableCols[10]	= 11;
					this.DisableCols[11]	= 12;
					this.DisableCols[12]	= 13;
					this.DisableCols[13]	= 14;
					this.DisableCols[14]	= 15;
					this.DisableCols[15]	= 16;
					this.DisableCols[16]	= 17;
					this.DisableCols[17]	= 18;
					this.DisableCols[18]	= 19;
					this.DisableCols[19]	= 20;
					this.DisableCols[20]	= 21;
				}
				else {
					this.DisableCols[0]	= 3;
					this.DisableCols[1]	= 4;
					this.DisableCols[2]	= 5;
					this.DisableCols[3]	= 6;
					this.DisableCols[4]	= 7;
					//this.DisableCols[5]	= 14;  //税前单价可修改 2004-4-22 徐辉 
					this.DisableCols[5]	= 12;
					this.DisableCols[6]	= 13;
					this.DisableCols[7]	= 15;
					this.DisableCols[8]	= 16;
					this.DisableCols[9]	= 21;
				}

				this.FormatCols[0] = 11;		// 数量
				this.FormatCols[1] = 1;		// 第一种格式(小数保留4位)
				this.FormatCols[2] = 17;	// 含税单价
				this.FormatCols[3] = 1;
				this.FormatCols[4] = 15;	// 金额
				this.FormatCols[5] = 2;
				this.FormatCols[6] = 18;	// 价税合计
				this.FormatCols[7] = 2;		//第二种格式(小数保留2位)
				this.FormatCols[8] = 14;    //单价
				this.FormatCols[9] = 1;

				this.ResultCols[0] = 11;
				this.ResultCols[1] = 14;
				this.ResultCols[2] = 17;
				this.ResultCols[3] = 18;
 	 
				this.ColWidth[0]	= 25;
				this.ColWidth[1]	= 100;
				this.ColWidth[2]	= 150;
				this.ColWidth[3]	= 40;
				this.ColWidth[4]	= 100;
				this.ColWidth[5]	= 80;
				this.ColWidth[6]	= 80;
				this.ColWidth[7]	= 100;
				this.ColWidth[8]	= 80;
				this.ColWidth[9]	= 80;
				this.ColWidth[10]	= 80;
				this.ColWidth[11]	= 80;
				this.ColWidth[12]	= 80;
				this.ColWidth[13]	= 100;
				this.ColWidth[14]	= 80;
				this.ColWidth[15]	= 80;
				this.ColWidth[16]	= 40;
				this.ColWidth[17]	= 80;
				this.ColWidth[18]	= 80;
				this.ColWidth[19]	= 100;
				this.ColWidth[20]	= 100;
				this.ColWidth[21]	= 100;

				this.ColEditName[0]	= "";
				this.ColEditName[1]	= "IUserCode_Edit";
				this.ColEditName[2]	= "IFullName_Edit";
				this.ColEditName[3]	= "IUnit_Edit";
				this.ColEditName[4]	= "IEntryCode_Edit";
				this.ColEditName[5]	= "IStandard_Edit";
				this.ColEditName[6]	= "IType_Edit";
				this.ColEditName[7]	= "IArea_Edit";
				this.ColEditName[8]	= "IProduceDate_Edit";
				this.ColEditName[9]	= "IValidDate_Edit";
				this.ColEditName[10] = "IGoodsNumber_Edit";
				this.ColEditName[11]	= "IQty_Edit";
				this.ColEditName[12]	= "IUnitRate_Edit";
				this.ColEditName[13]	= "IAssistantUnit_Edit";
				this.ColEditName[14]	= "IPrice_Edit";
				this.ColEditName[15]	= "INoTaxTotal_Edit";
				this.ColEditName[16]	= "ITaxRate_Edit";
				this.ColEditName[17]	= "ITaxPrice_Edit";
				this.ColEditName[18]	= "ITotal_Edit";
				this.ColEditName[19]	= "IBase_Edit";
				this.ColEditName[20]	= "Serial_Edit";
				this.ColEditName[21]	= "ICustomerCode_Edit";

				this.SumRow = "<tr class=\"ClientTablesum\" id=\"SumRow\" height=\"20px\"><td>合计</td>";strColsDisplay = 1;
				
				
				for ( i = 1; i < this.cols; i++ ) {
					// Judge If Display The Grid Cols
					for ( j = 1; j < this.HiddenColsArray.length; j++ ) {
						if ( this.HiddenColsArray[j] == this.ColEditName[i] ) {
							strColsDisplay = 0;
							break;
						}
						else
							strColsDisplay = 1;
						
					}
					for ( j = 0; j < this.SumCols.length; j++ ) {
						if ( i == parseInt(this.SumCols[j]) ) {
							strSumValueDisplay = "<span id=\"" + this.name + "Total" + this.SumCols[j] + "\" style=\"color:#000000\">&nbsp;0</span>";break;
						}
						else
							strSumValueDisplay = "&nbsp;";
					}
					if ( strColsDisplay == 1 ) {
						this.SumRow = this.SumRow + "<td>" + strSumValueDisplay + "</td>";
					}
					else{
						this.SumRow = this.SumRow + "<td style='display:none'>" + strSumValueDisplay + "</td>";
					}
				}

				if ( !this.Disable ) {	// 删除列所占用的单元格
					this.SumRow = this.SumRow + "<td>&nbsp;</td>";
				}
				this.SumRow = this.SumRow + "</tr>";

				//if ( !this.Disable )
				//	this.SumRow="<tr class=ClientTablesum id=SumRow height=20px><td colspan=4>&nbsp;合计</td><td><span id="+this.name+"Total4 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td><span id="+this.name+"Total6 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td>&nbsp;</td><td><span id="+this.name+"Total9 style='color:#000000'>&nbsp;0</span><td>&nbsp;</td><td>&nbsp;</td></tr>";
				//else
				//	this.SumRow="<tr class=ClientTablesum id=SumRow height=20px><td colspan=4>&nbsp;合计</td><td><span id="+this.name+"Total4 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td><span id="+this.name+"Total6 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td>&nbsp;</td><td><span id="+this.name+"Total9 style='color:#000000'>&nbsp;0</span><td>&nbsp;</td></tr>";

				break;
			case 1514:	// 采购换货(出) 普通
				this.cols = 19;

				// 局部更新列
				this.LocalUpdateCol[0] = 1;	// 序列号
				this.LocalUpdateCol[1] = 2;	// 商品编号
				this.LocalUpdateCol[2] = 3;	// 商品名称

				// 每行隐含域名、值数组
				this.HiddenArray[0] = "OOrderId";	// 订单 ID 值
				this.HiddenArray[1] = "-1";		// 初始值
				this.HiddenArray[2] = "OisUnitTow";	// 该行是否双单位
				this.HiddenArray[3] = "0";		// 默认不是双单位
				this.HiddenArray[4] = "OUnitRate";	// 双单位换算关系
				this.HiddenArray[5] = "1";		// 默认换算关系为 1
				this.HiddenArray[6] = "OIfSerial"	// 是否采用序列号强制管理
				this.HiddenArray[7] = "0";		// 默认为 0 ；0：非序列号强制管理；1：序列号强制管理
				this.HiddenArray[8] = "SerialOut";	// 所有出库序列号字串
				this.HiddenArray[9] = "";		// 默认为空，各序列号以逗号 ( я ) 分隔
				this.HiddenArray[10] = "OUnitOne";	//小单位
				this.HiddenArray[11] = "";		// 默认为空
				this.HiddenArray[12] = "OUnitTwo";	// 大单位
				this.HiddenArray[13] = "";		// 默认为空
				// ===================================add by chen_qihua 2004-6-18 采购退货，销售退货加隐含列
				this.HiddenArray[14] = "OInputCostPrice";	// 成本单价
				this.HiddenArray[15] = "0";		// 默认为)
				this.HiddenArray[16] = "OID";	// 采购退货，销售退货关联的原来单据的商品的过账ID号
				this.HiddenArray[17] = "";		// 默认为空
				this.HiddenArray[18] = "OOldID";	// 采购退货，销售退货关联的原来单据ID
				this.HiddenArray[19] = "";		// 默认为空
				this.HiddenArray[20] = "OGoodsNumberPrice";	// 采购退货，销售退货关联的原来单据ID
				this.HiddenArray[21] = "-1";		// 默认未-1
				this.HiddenArray[22] = "OHandZeroCost";	// 0成本出入库专用
				this.HiddenArray[23] = "0";		// 默认未0
				
				// 鼠标双击列
				this.MouseDbClickCols[0] = 1;
				this.MouseDbClickCols[1] = 4;
				this.MouseDbClickCols[2] = 12;

				// 初始化表头
				this.Title[0]	= "No.";
				this.Title[1]	= "序列号";
				this.Title[2]	= "商品编号";
				this.Title[3]	= "商品全名";
				this.Title[4]	= "单位";
				this.Title[5]	= "条形码";
				this.Title[6]	= "规格";
				this.Title[7]	= "型号";
				this.Title[8]	= "产地";
				this.Title[9]	= "生产日期";
				this.Title[10]	= "效期至";
				this.Title[11]	= "批号";
				this.Title[12]	= "出库数量";
				this.Title[13]  = "单位关系";
				this.Title[14]	= "辅助单位";
				this.Title[15]	= "单价";
				this.Title[16]	= "金额";
				this.Title[17]	= "备注";
				this.Title[18]	= "多编码";

				// 需要合计的列
				this.SumCols[0] = 12;
				this.SumCols[1] = 16;

				this.FormatSumCols[0] = 12;
				this.FormatSumCols[1] = 1;
				this.FormatSumCols[2] = 16;
				this.FormatSumCols[3] = 2;

				this.NumericCols[0] = 12;
				this.NumericCols[1] = 15;
				this.NumericCols[2] = 16;

				this.FormatCols[0] = 12;
				this.FormatCols[1] = 1;	// 第一种格式 ( 小数保留4位 )
				this.FormatCols[2] = 15;
				this.FormatCols[3] = 1;
				this.FormatCols[4] = 16;
				this.FormatCols[5] = 2;	// 第二种格式 ( 小数保留2位 )

				this.ResultCols[0] = ";";
				this.ResultCols[1] = 12;
				this.ResultCols[2] = "*";
				this.ResultCols[3] = 15;
				this.ResultCols[4] = "=";
				this.ResultCols[5] = 16;
				this.ResultCols[6] = ";";

				// 只读列，Disable 用于显示单据明细时用
				if ( this.Disable ) {
					this.DisableCols[0]	= 1;
					this.DisableCols[1]	= 2;
					this.DisableCols[2]	= 3;
					this.DisableCols[3]	= 4;
					this.DisableCols[4]	= 5;
					this.DisableCols[5]	= 6;
					this.DisableCols[6]	= 7;
					this.DisableCols[7]	= 8;
					this.DisableCols[8]	= 9;
					this.DisableCols[9]	= 12;
					this.DisableCols[10]	= 13;
					this.DisableCols[11]	= 14;
					this.DisableCols[12]	= 10;
					this.DisableCols[13]	= 11;
					this.DisableCols[14]	= 15;
					this.DisableCols[15]	= 16;
					this.DisableCols[16]	= 17;
					this.DisableCols[17]	= 18;
				}
				else {	// 正常情况是“单位”、“条形码”、“规格”、“型号”、“产地”、“金额”列为只读
					this.DisableCols[0] = 4;
					this.DisableCols[1] = 5;
					this.DisableCols[2] = 6;
					this.DisableCols[3] = 7;
					this.DisableCols[4] = 8;
					this.DisableCols[5] = 9;
					this.DisableCols[6] = 10;
					this.DisableCols[7] = 11;
					this.DisableCols[8] = 13;
					this.DisableCols[9] = 14;
					this.DisableCols[10] = 18;
				}

				this.ColWidth[0]	= 25;
				this.ColWidth[1]	= 100;
				this.ColWidth[2]	= 100;
				this.ColWidth[3]	= 150;
				this.ColWidth[4]	= 40;
				this.ColWidth[5]	= 100;
				this.ColWidth[6]	= 80;
				this.ColWidth[7]	= 80;
				this.ColWidth[8]	= 100;
				this.ColWidth[9]	= 80;
				this.ColWidth[10]	= 80;
				this.ColWidth[11]	= 80;
				this.ColWidth[12]	= 80;
				this.ColWidth[13]	= 80;
				this.ColWidth[14]	= 100;
				this.ColWidth[15]	= 80;
				this.ColWidth[16]	= 80;
				this.ColWidth[17]	= 100;
				this.ColWidth[18]	= 100;

				this.ColEditName[0]	= "";
				this.ColEditName[1]	= "SerialSel_Edit";
				this.ColEditName[2]	= "OUserCode_Edit";
				this.ColEditName[3]	= "OFullName_Edit";
				this.ColEditName[4]	= "OUnit_Edit";
				this.ColEditName[5]	= "OEntryCode_Edit";
				this.ColEditName[6]	= "OStandard_Edit";
				this.ColEditName[7]	= "OType_Edit";
				this.ColEditName[8]	= "OArea_Edit";
				this.ColEditName[9]	= "OProduceDate_Edit";
				this.ColEditName[10]	= "OValidDate_Edit";
				this.ColEditName[11]	= "OGoodsNumber_Edit";
				this.ColEditName[12]	= "OQty_Edit";
				this.ColEditName[13]	= "OUnitRate_Edit";
				this.ColEditName[14]	= "OAssistantUnit_Edit";
				this.ColEditName[15]	= "OPrice_Edit";
				this.ColEditName[16]	= "OTotal_Edit";
				this.ColEditName[17]	= "OBase_Edit";
				this.ColEditName[18]	= "OCustomerCode_Edit";
				

				// 销售单数量加入缺省值 1
				this.IniCols[0] = 12;
				if ( typeof(this.IniColValues[1]) != "undefined" ) {
					this.IniCols[1] = 1;
				}
				else{
					this.IniCols[1] = '';
				}

				this.SumRow = "<tr class=\"ClientTablesum\" id=\"SumRow\" height=\"20px\"><td>合计</td>";strColsDisplay = 1;
				
				
				for ( i = 1; i < this.cols; i++ ) {
					// Judge If Display The Grid Cols
					for ( j = 1; j < this.HiddenColsArray.length; j++ ) {
						if ( this.HiddenColsArray[j] == this.ColEditName[i] ) {
							strColsDisplay = 0;
							break;
						}
						else
							strColsDisplay = 1;
						
					}
					for ( j = 0; j < this.SumCols.length; j++ ) {
						if ( i == parseInt(this.SumCols[j]) ) {
							strSumValueDisplay = "<span id=\"" + this.name + "Total" + this.SumCols[j] + "\" style=\"color:#000000\">&nbsp;0</span>";break;
						}
						else
							strSumValueDisplay = "&nbsp;";
					}
					if ( strColsDisplay == 1 ) {
						this.SumRow = this.SumRow + "<td>" + strSumValueDisplay + "</td>";
					}
					else{
						this.SumRow = this.SumRow + "<td style='display:none'>" + strSumValueDisplay + "</td>";
					}
				}

				if ( !this.Disable ) {	// 删除列所占用的单元格
					this.SumRow = this.SumRow + "<td>&nbsp;</td>";
				}
				this.SumRow = this.SumRow + "</tr>";

				//if ( !this.Disable )
				//	this.SumRow="<tr class=ClientTablesum id=SumRow height=20px><td colspan=4>&nbsp;合计</td><td><span id="+this.name+"Total4 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td><span id="+this.name+"Total6 style='color:#000000'>&nbsp;0</span><td>&nbsp;</td><td>&nbsp;</td></tr>";
				//else
				//	this.SumRow="<tr class=ClientTablesum id=SumRow height=20px><td colspan=4>&nbsp;合计</td><td><span id="+this.name+"Total4 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td><span id="+this.name+"Total6 style='color:#000000'>&nbsp;0</span><td>&nbsp;</td></tr>";
				break;
			case 1524:	// 采购换货 出库 折扣
				this.cols = 22;		// 商品录入 折扣

				// 局部更新列
				this.LocalUpdateCol[0] = 1;	// 序列号
				this.LocalUpdateCol[1] = 2;	// 商品编号
				this.LocalUpdateCol[2] = 3;	// 商品名称

				// 每行隐含域名、值数组
				this.HiddenArray[0] = "OOrderId";	// 订单 ID 值
				this.HiddenArray[1] = "-1";		// 初始值
				this.HiddenArray[2] = "OisUnitTow";	// 该行是否双单位
				this.HiddenArray[3] = "0";		// 默认不是双单位
				this.HiddenArray[4] = "OUnitRate";	// 双单位换算关系
				this.HiddenArray[5] = "1";		// 默认换算关系为 1
				this.HiddenArray[6] = "OIfSerial"	// 是否采用序列号强制管理
				this.HiddenArray[7] = "0";		// 默认为 0 ；0：非序列号强制管理；1：序列号强制管理
				this.HiddenArray[8] = "SerialOut";	// 所有出库序列号字串
				this.HiddenArray[9] = "";		// 默认为空，各序列号以逗号 ( я ) 分隔
				this.HiddenArray[10] = "OUnitOne";	//小单位
				this.HiddenArray[11] = "";		// 默认为空
				this.HiddenArray[12] = "OUnitTwo";	// 大单位
				this.HiddenArray[13] = "";		// 默认为空
				// ===================================add by chen_qihua 2004-6-18 采购退货，销售退货加隐含列
				this.HiddenArray[14] = "OInputCostPrice";	// 成本单价
				this.HiddenArray[15] = "0";		// 默认为0
				this.HiddenArray[16] = "OID";	// 采购退货，销售退货关联的原来单据的商品的过账ID号
				this.HiddenArray[17] = "";		// 默认为空
				this.HiddenArray[18] = "OOldID";	// 采购退货，销售退货关联的原来单据ID
				this.HiddenArray[19] = "";		// 默认为空
				this.HiddenArray[20] = "OGoodsNumberPrice";	// 库存批次价格 手工指定法添加
				this.HiddenArray[21] = "-1";		// 默认未-1
				this.HiddenArray[22] = "OHandZeroCost";	// 0成本出入库专用
				this.HiddenArray[23] = "0";		// 默认未0
				
				// 鼠标双击列
				this.MouseDbClickCols[0] = 1;
				this.MouseDbClickCols[1] = 4;
				this.MouseDbClickCols[2] = 12;

				// 初始化表头
				this.Title[0]	= "No.";
				this.Title[1]	= "序列号";
				this.Title[2]	= "商品编号";
				this.Title[3]	= "商品全名";
				this.Title[4]	= "单位";
				this.Title[5]	= "条形码";
				this.Title[6]	= "规格";
				this.Title[7]	= "型号";
				this.Title[8]	= "产地";
				this.Title[9]	= "生产日期";
				this.Title[10]	= "效期至";
				this.Title[11]	= "批号";
				this.Title[12]	= "出库数量";
				this.Title[13]  = "单位关系";
				this.Title[14]	= "辅助单位";
				this.Title[15]	= "单价";
				this.Title[16]	= "金额";
				this.Title[17]	= "扣率";
				this.Title[18]	= "折后单价";
				this.Title[19]	= "折后金额";
				this.Title[20]	= "备注";
				this.Title[21]	= "多编码";

				this.SumCols[0] = 12;
				this.SumCols[1] = 16;
				this.SumCols[2] = 19;

				this.FormatSumCols[0] = 12;
				this.FormatSumCols[1] = 1;
				this.FormatSumCols[2] = 16;
				this.FormatSumCols[3] = 2;
				this.FormatSumCols[4] = 19;
				this.FormatSumCols[5] = 2;

				this.IniCols[0] = 17;
				if ( typeof(this.IniColValues[0]) != "undefined" )
					this.IniCols[1] = this.IniColValues[0];
				else
					this.IniCols[1] = 1;

				// 销售单数量加入缺省值 1
				if ( typeof(this.IniColValues[1]) != "undefined" ) {
					this.IniCols[2] = 12;
					this.IniCols[3] = 1;
				}

				this.NumericCols[0] = 12;
				this.NumericCols[1] = 15;  //徐辉 2004-4-23 添加扣前单价
				this.NumericCols[2] = 17;
				this.NumericCols[3] = 18;
				this.NumericCols[4] = 19;

				if ( this.Disable ) {
					this.DisableCols[0]	= 1;
					this.DisableCols[1]	= 2;
					this.DisableCols[2]	= 3;
					this.DisableCols[3]	= 4;
					this.DisableCols[4]	= 5;
					this.DisableCols[5]	= 6;
					this.DisableCols[6]	= 7;
					this.DisableCols[7]	= 8;
					this.DisableCols[8]	= 9;
					this.DisableCols[9]	= 10;
					this.DisableCols[10]	= 11;
					this.DisableCols[11]	= 12;
					this.DisableCols[12]	= 13;
					this.DisableCols[13]	= 14;
					this.DisableCols[14]	= 15;
					this.DisableCols[15]	= 16;
					this.DisableCols[16]	= 17;
					this.DisableCols[17]	= 18;
					this.DisableCols[18]	= 19;
					this.DisableCols[19]	= 20;
					this.DisableCols[20]	= 21;
				}
				else {
					this.DisableCols[0] = 4;
					this.DisableCols[1] = 5;
					this.DisableCols[2] = 6;
					this.DisableCols[3] = 7;
					this.DisableCols[4] = 8;
					this.DisableCols[5] = 9; 
					this.DisableCols[6] = 10;
					this.DisableCols[7] = 11;
					this.DisableCols[8] = 13;
					this.DisableCols[9] = 14;
					this.DisableCols[10] = 16;
					this.DisableCols[11] = 21;
				}

				this.FormatCols[0]	= 12;	// 数量
				this.FormatCols[1]	= 1;	// 第一种格式(小数保留4位)
				this.FormatCols[2]	= 18;	// 折后单价
				this.FormatCols[3]	= 1;
				this.FormatCols[4]	= 16;	// 金额
				this.FormatCols[5]	= 2;
				this.FormatCols[6]	= 19;	// 折后金额
				this.FormatCols[7]	= 2;	// 第二种格式(小数保留2位)
				this.FormatCols[8]	= 15;	// 单价
				this.FormatCols[9]	= 1;
				this.FormatCols[10]	= 17;	//折扣率
				this.FormatCols[11]	= 1;

				// 计算折后金额
				this.ResultCols[0] = 12;
				this.ResultCols[1] = 15;
				this.ResultCols[2] = 17;
				this.ResultCols[3] = 18;
				this.ResultCols[4] = 19;
	 
				this.ColWidth[0]	= 25;
				this.ColWidth[1]	= 100;
				this.ColWidth[2]	= 100;
				this.ColWidth[3]	= 150;
				this.ColWidth[4]	= 40;
				this.ColWidth[5]	= 100;
				this.ColWidth[6]	= 80;
				this.ColWidth[7]	= 80;
				this.ColWidth[8]	= 100;
				this.ColWidth[9]	= 80;
				this.ColWidth[10]	= 80;
				this.ColWidth[11]	= 80;
				this.ColWidth[12]	= 80;
				this.ColWidth[13]	= 80;
				this.ColWidth[14]	= 100;
				this.ColWidth[15]	= 80;
				this.ColWidth[16]	= 80;
				this.ColWidth[17]	= 40;
				this.ColWidth[18]	= 80;
				this.ColWidth[19]	= 80;
				this.ColWidth[20]	= 100;
				this.ColWidth[21]	= 100;

				this.ColEditName[0]	= "";
				this.ColEditName[1]	= "SerialSel_Edit";
				this.ColEditName[2]	= "OUserCode_Edit";
				this.ColEditName[3]	= "OFullName_Edit";
				this.ColEditName[4]	= "OUnit_Edit";
				this.ColEditName[5]	= "OEntryCode_Edit";
				this.ColEditName[6]	= "OStandard_Edit";
				this.ColEditName[7]	= "OType_Edit";
				this.ColEditName[8]	= "OArea_Edit";
				this.ColEditName[9]	= "OProduceDate_Edit";
				this.ColEditName[10]	= "OValidDate_Edit";
				this.ColEditName[11]	= "OGoodsNumber_Edit";
				this.ColEditName[12]	= "OQty_Edit";
				this.ColEditName[13]	= "OUnitRate_Edit";
				this.ColEditName[14]	= "OAssistantUnit_Edit";
				this.ColEditName[15]	= "OPrice_Edit";
				this.ColEditName[16]	= "ONoDiscountTotal_Edit";
				this.ColEditName[17]	= "ODiscount_Edit";
				this.ColEditName[18]	= "ODiscountPrice_Edit";
				this.ColEditName[19]	= "OTotal_Edit";
				this.ColEditName[20]	= "OBase_Edit";
				this.ColEditName[21]	= "OCustomerCode_Edit";

				this.SumRow = "<tr class=\"ClientTablesum\" id=\"SumRow\" height=\"20px\"><td>合计</td>";strColsDisplay = 1;
				
				
				
				for ( i = 1; i < this.cols; i++ ) {
					// Judge If Display The Grid Cols
					for ( j = 1; j < this.HiddenColsArray.length; j++ ) {
						if ( this.HiddenColsArray[j] == this.ColEditName[i] ) {
							strColsDisplay = 0;
							break;
						}
						else
							strColsDisplay = 1;
						
					}
					for ( j = 0; j < this.SumCols.length; j++ ) {
						if ( i == parseInt(this.SumCols[j]) ) {
							strSumValueDisplay = "<span id=\"" + this.name + "Total" + this.SumCols[j] + "\" style=\"color:#000000\">&nbsp;0</span>";break;
						}
						else
							strSumValueDisplay = "&nbsp;";
					}
					if ( strColsDisplay == 1 ) {
						this.SumRow = this.SumRow + "<td>" + strSumValueDisplay + "</td>";
					}
					else{
						this.SumRow = this.SumRow + "<td style='display:none'>" + strSumValueDisplay + "</td>";
					}
				}

				if ( !this.Disable ) {	// 删除列所占用的单元格
					this.SumRow = this.SumRow + "<td>&nbsp;</td>";
				}
				this.SumRow = this.SumRow + "</tr>";

				//if ( !this.Disable )
				//	this.SumRow="<tr class=ClientTablesum id=SumRow height=20px><td colspan=4>&nbsp;合计</td><td><span id="+this.name+"Total4 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td><span id="+this.name+"Total6 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td>&nbsp;</td><td><span id="+this.name+"Total9 style='color:#000000'>&nbsp;0</span><td>&nbsp;</td><td>&nbsp;</td></tr>";
				//else
				//	this.SumRow="<tr class=ClientTablesum id=SumRow height=20px><td colspan=4>&nbsp;合计</td><td><span id="+this.name+"Total4 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td><span id="+this.name+"Total6 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td>&nbsp;</td><td><span id="+this.name+"Total9 style='color:#000000'>&nbsp;0</span><td>&nbsp;</td></tr>";

				break;
			case 1534:		// 采购换货 出库 税率
				this.cols = 22;		// 商品录入 含税

				// 局部更新列
				this.LocalUpdateCol[0] = 1;	// 序列号
				this.LocalUpdateCol[1] = 2;	// 商品编号
				this.LocalUpdateCol[2] = 3;	// 商品名称

				// 每行隐含域名、值数组
				this.HiddenArray[0] = "OOrderId";	// 订单 ID 值
				this.HiddenArray[1] = "-1";		// 初始值
				this.HiddenArray[2] = "OisUnitTow";	// 该行是否双单位
				this.HiddenArray[3] = "0";		// 默认不是双单位
				this.HiddenArray[4] = "OUnitRate";	// 双单位换算关系
				this.HiddenArray[5] = "1";		// 默认换算关系为 1
				this.HiddenArray[6] = "OIfSerial"	// 是否采用序列号强制管理
				this.HiddenArray[7] = "0";		// 默认为 0 ；0：非序列号强制管理；1：序列号强制管理
				this.HiddenArray[8] = "SerialOut";	// 所有出库序列号字串
				this.HiddenArray[9] = "";		// 默认为空，各序列号以逗号 ( я ) 分隔
				this.HiddenArray[10] = "OUnitOne";	//小单位
				this.HiddenArray[11] = "";		// 默认为空
				this.HiddenArray[12] = "OUnitTwo";	// 大单位
				this.HiddenArray[13] = "";		// 默认为空
				// ===================================add by chen_qihua 2004-6-18 采购退货，销售退货加隐含列
				this.HiddenArray[14] = "OInputCostPrice";	// 成本单价
				this.HiddenArray[15] = "0";		// 默认为)
				this.HiddenArray[16] = "OID";	// 采购退货，销售退货关联的原来单据的商品的过账ID号
				this.HiddenArray[17] = "";		// 默认为空
				this.HiddenArray[18] = "OOldID";	// 采购退货，销售退货关联的原来单据ID
				this.HiddenArray[19] = "";		// 默认为空
				this.HiddenArray[20] = "OGoodsNumberPrice";	// 批次成本价
				this.HiddenArray[21] = "-1";		// 默认未-1
				this.HiddenArray[22] = "OHandZeroCost";	// 0成本出入库专用
				this.HiddenArray[23] = "0";		// 默认未0
				
				
				// 鼠标双击列
				this.MouseDbClickCols[0] = 1;
				this.MouseDbClickCols[1] = 4;
				this.MouseDbClickCols[2] = 12;

				this.Title[0]	= "No.";
				this.Title[1]	= "序列号";
				this.Title[2]	= "商品编号";
				this.Title[3]	= "商品全名";
				this.Title[4]	= "单位";
				this.Title[5]	= "条形码";
				this.Title[6]	= "规格";
				this.Title[7]	= "型号";
				this.Title[8]	= "产地";
				this.Title[9]	= "生产日期";
				this.Title[10]	= "效期至";
				this.Title[11]	= "批号";
				this.Title[12]   = "出库数量";
				this.Title[13]  = "单位关系";
				this.Title[14]	= "辅助单位";
				this.Title[15]	= "单价";
				this.Title[16]	= "金额";
				this.Title[17]	= "税率";
				this.Title[18]	= "含税单价";
				this.Title[19]	= "价税合计";
				this.Title[20]	= "备注";
				this.Title[21]	= "多编码";

				this.SumCols[0] = 12;
				this.SumCols[1] = 16;
				this.SumCols[2] = 19;

				this.FormatSumCols[0] = 12;
				this.FormatSumCols[1] = 1;
				this.FormatSumCols[2] = 16;
				this.FormatSumCols[3] = 2;
				this.FormatSumCols[4] = 19;
				this.FormatSumCols[5] = 2;

				this.IniCols[0] = 17;
				if ( typeof(this.IniColValues[0]) != "undefined" )
					this.IniCols[1] = this.IniColValues[0];
				else
					this.IniCols[1] = 17;	// 默认 17 点税
     
				// 销售单数量加入缺省值 1
				if ( typeof(this.IniColValues[1]) != "undefined" ) {
					this.IniCols[2] = 12;
					this.IniCols[3] = 1;
				}

				this.NumericCols[0] = 12;
				this.NumericCols[1] = 18;
				this.NumericCols[2] = 15;
				this.NumericCols[3] = 19;

				if (this.Disable) {
					this.DisableCols[0]	= 1;
					this.DisableCols[1]	= 2;
					this.DisableCols[2]	= 3;
					this.DisableCols[3]	= 4;
					this.DisableCols[4]	= 5;
					this.DisableCols[5]	= 6;
					this.DisableCols[6]	= 7;
					this.DisableCols[7]	= 8;
					this.DisableCols[8]	= 9;
					this.DisableCols[9]	= 10;
					this.DisableCols[10]	= 11;
					this.DisableCols[11]	= 12;
					this.DisableCols[12]	= 13;
					this.DisableCols[13]	= 14;
					this.DisableCols[14]	= 15;
					this.DisableCols[15]	= 16;
					this.DisableCols[16]	= 17;
					this.DisableCols[17]	= 18;
					this.DisableCols[18]	= 19;
					this.DisableCols[19]	= 20;
					this.DisableCols[21]	= 21;
				}
				else {
					this.DisableCols[0]	= 4;
					this.DisableCols[1]	= 5;
					this.DisableCols[2]	= 6;
					this.DisableCols[3]	= 7;
					this.DisableCols[4]	= 8;
					this.DisableCols[5]	= 9;  
					this.DisableCols[6] = 10;
					this.DisableCols[7] = 11;
					this.DisableCols[8] = 13;
					this.DisableCols[9] = 14;
					this.DisableCols[10]	= 16;
					this.DisableCols[11]	= 17;
					this.DisableCols[12]	= 21;
				}

				this.FormatCols[0] = 12;		// 数量
				this.FormatCols[1] = 1;		// 第一种格式(小数保留4位)
				this.FormatCols[2] = 18;	// 含税单价
				this.FormatCols[3] = 1;
				this.FormatCols[4] = 16;	// 金额
				this.FormatCols[5] = 2;
				this.FormatCols[6] = 19;	// 价税合计
				this.FormatCols[7] = 2;		// 第二种格式(小数保留2位)
				this.FormatCols[8] = 15;	// 单价
				this.FormatCols[9] = 1;

				this.ResultCols[0] = 12;     //需要数量变化需从新计算的列
				this.ResultCols[1] = 15;	//徐辉 添加税前单价列 2004-4-23,2004-9-15 添加价税合计
				this.ResultCols[2] = 18;
				this.ResultCols[3] = 19;

				this.ColWidth[0]	= 25;
				this.ColWidth[1]	= 100;
				this.ColWidth[2]	= 100;
				this.ColWidth[3]	= 150;
				this.ColWidth[4]	= 40;
				this.ColWidth[5]	= 100;
				this.ColWidth[6]	= 80;
				this.ColWidth[7]	= 80;
				this.ColWidth[8]	= 100;
				this.ColWidth[9]	= 80;
				this.ColWidth[10]	= 80;
				this.ColWidth[11]	= 80;
				this.ColWidth[12]	= 80;
				this.ColWidth[13]	= 80;
				this.ColWidth[14]	= 100;
				this.ColWidth[15]	= 80;
				this.ColWidth[16]	= 80;
				this.ColWidth[17]	= 40;
				this.ColWidth[18]	= 80;
				this.ColWidth[19]	= 80;
				this.ColWidth[20]	= 100;
				this.ColWidth[21]	= 100;

				this.ColEditName[0]	= "";
				this.ColEditName[1]	= "SerialSel_Edit";
				this.ColEditName[2]	= "OUserCode_Edit";
				this.ColEditName[3]	= "OFullName_Edit";
				this.ColEditName[4]	= "OUnit_Edit";
				this.ColEditName[5]	= "OEntryCode_Edit";
				this.ColEditName[6]	= "OStandard_Edit";
				this.ColEditName[7]	= "OType_Edit";
				this.ColEditName[8]	= "OArea_Edit";
				this.ColEditName[9]	= "OProduceDate_Edit";
				this.ColEditName[10]	= "OValidDate_Edit";
				this.ColEditName[11]	= "OGoodsNumber_Edit";
				this.ColEditName[12]	= "OQty_Edit";
				this.ColEditName[13]	= "OUnitRate_Edit";
				this.ColEditName[14]	= "OAssistantUnit_Edit";
				this.ColEditName[15]	= "OPrice_Edit";
				this.ColEditName[16]	= "ONoTaxTotal_Edit";
				this.ColEditName[17]	= "OTaxRate_Edit";
				this.ColEditName[18]	= "OTaxPrice_Edit";
				this.ColEditName[19]	= "OTotal_Edit";
				this.ColEditName[20]	= "OBase_Edit";
				this.ColEditName[21]	= "OCustomerCode_Edit";

				this.SumRow = "<tr class=\"ClientTablesum\" id=\"SumRow\" height=\"20px\"><td>合计</td>";strColsDisplay = 1;
				
				
				for ( i = 1; i < this.cols; i++ ) {
					// Judge If Display The Grid Cols
					for ( j = 1; j < this.HiddenColsArray.length; j++ ) {
						if ( this.HiddenColsArray[j] == this.ColEditName[i] ) {
							strColsDisplay = 0;
							break;
						}
						else
							strColsDisplay = 1;
						
					}
					for ( j = 0; j < this.SumCols.length; j++ ) {
						if ( i == parseInt(this.SumCols[j]) ) {
							strSumValueDisplay = "<span id=\"" + this.name + "Total" + this.SumCols[j] + "\" style=\"color:#000000\">&nbsp;0</span>";break;
						}
						else
							strSumValueDisplay = "&nbsp;";
					}
					if ( strColsDisplay == 1 ) {
						this.SumRow = this.SumRow + "<td>" + strSumValueDisplay + "</td>";
					}
					else{
						this.SumRow = this.SumRow + "<td style='display:none'>" + strSumValueDisplay + "</td>";
					}
				}

				if ( !this.Disable ) {	// 删除列所占用的单元格
					this.SumRow = this.SumRow + "<td>&nbsp;</td>";
				}
				this.SumRow = this.SumRow + "</tr>";

				//if ( !this.Disable )
				//	this.SumRow="<tr class=ClientTablesum id=SumRow height=20px><td colspan=4>&nbsp;合计</td><td><span id="+this.name+"Total4 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td><span id="+this.name+"Total6 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td>&nbsp;</td><td><span id="+this.name+"Total9 style='color:#000000'>&nbsp;0</span><td>&nbsp;</td><td>&nbsp;</td></tr>";
				//else
				//	this.SumRow="<tr class=ClientTablesum id=SumRow height=20px><td colspan=4>&nbsp;合计</td><td><span id="+this.name+"Total4 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td><span id="+this.name+"Total6 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td>&nbsp;</td><td><span id="+this.name+"Total9 style='color:#000000'>&nbsp;0</span><td>&nbsp;</td></tr>";

				break;
			case 34:	// 发票管理（销售，采购发票）
				this.cols = 18;

				this.LocalUpdateCol[0] = 1;	// 局部更新列
				this.LocalUpdateCol[1] = 2;	// 局部更新列

				this.HiddenArray[0] = "BillNumberID";
				this.HiddenArray[1] = "-1";	
				this.HiddenArray[2] = "PtypeID";
				this.HiddenArray[3] = "-1";	
				this.HiddenArray[4] = "KtypeID";
				this.HiddenArray[5] = "-1";		
				
		
				// 初始化表头
				this.Title[0]	= "No.";
				this.Title[1]	= "商品编号";
				this.Title[2]	= "商品全名";
				this.Title[3]	= "单位";
				this.Title[4]	= "条形码";
				this.Title[5]	= "规格";
				this.Title[6]	= "型号";
				this.Title[7]	= "产地";
				this.Title[8]	= "仓库";
				this.Title[9]	= "数量"
				this.Title[10]	= "单价";
				this.Title[11]	= "金额";
				this.Title[12]	= "税率";
				this.Title[13]	= "含税单价";
				this.Title[14]	= "价税合计";
				this.Title[15]	= "税额";
				this.Title[16]	= "单据编号";
				this.Title[17]	= "备注";

				this.SumCols[0] = 9;
				this.SumCols[1] = 11;
				this.SumCols[2] = 14;
				this.SumCols[3] = 15;
				
				this.FormatSumCols[0] = 9;
				this.FormatSumCols[1] = 1;
				this.FormatSumCols[2] = 11;
				this.FormatSumCols[3] = 2;
				this.FormatSumCols[4] = 14;
				this.FormatSumCols[5] = 2;
				this.FormatSumCols[6] = 15;
				this.FormatSumCols[7] = 2;
				
				this.IniCols[0] = 12;
				if ( typeof(this.IniColValues[0]) != "undefined" )
					this.IniCols[1] = this.IniColValues[0];
				else
					this.IniCols[1] = 17;	// 默认 17 点税


				this.NumericCols[0] = 9;
				this.NumericCols[1] = 10;
				this.NumericCols[2] = 11;
				this.NumericCols[3] = 12;
				this.NumericCols[4] = 13;
				this.NumericCols[5] = 14;
				this.NumericCols[6] = 15;

				this.FormatCols[0] = 9;
				this.FormatCols[1] = 1;		// 第一种格式 ( 小数保留 4 位 )
				this.FormatCols[2] = 10;
				this.FormatCols[3] = 1;
				this.FormatCols[4] = 11;
				this.FormatCols[5] = 2;		// 第二种格式 ( 小数保留 2 位 )
				this.FormatCols[6] = 12;
				this.FormatCols[7] = 1;
				this.FormatCols[8] = 13;
				this.FormatCols[9] = 1;
				this.FormatCols[10] = 14;
				this.FormatCols[11] = 2;
				this.FormatCols[12] = 15;
				this.FormatCols[13] = 1;

				this.ResultCols[0] = 9;
				this.ResultCols[1] = 10;
				this.ResultCols[2] = 11;
				this.ResultCols[3] = 13;
				this.ResultCols[4] = 14;
				this.ResultCols[5] = 15;
				

				if ( this.Disable ) {
					this.DisableCols[0]	= 1;
					this.DisableCols[1]	= 2;
					this.DisableCols[2]	= 3;
					this.DisableCols[3]	= 4;
					this.DisableCols[4]	= 5;
					this.DisableCols[5]	= 6;
					this.DisableCols[6]	= 7;
					this.DisableCols[7]	= 8;
					this.DisableCols[8]	= 9;
					this.DisableCols[9]	= 10;
					this.DisableCols[10]	= 11;
					this.DisableCols[11]	= 12;
					this.DisableCols[12]	= 13;
					this.DisableCols[13]	= 14;
					this.DisableCols[14]	= 15;
					this.DisableCols[15]	= 16;
					this.DisableCols[16]	= 17;
				}
				else {
					this.DisableCols[0]	= 1;
					this.DisableCols[1]	= 2;
					this.DisableCols[2]	= 3;
					this.DisableCols[3]	= 4;
					this.DisableCols[4]	= 5;
					this.DisableCols[5]	= 6;
					this.DisableCols[6]	= 7;
					this.DisableCols[7]	= 8;
					this.DisableCols[8]= 12;
					this.DisableCols[9]= 15;
					this.DisableCols[10]= 16;
				}

				this.ColWidth[0]	= 25;
				this.ColWidth[1]	= 100;
				this.ColWidth[2]	= 150;
				this.ColWidth[3]	= 40;
				this.ColWidth[4]	= 100;
				this.ColWidth[5]	= 80;
				this.ColWidth[6]	= 80;
				this.ColWidth[7]	= 100;
				this.ColWidth[8]	= 100;
				this.ColWidth[9]	= 80;
				this.ColWidth[10]	= 80;
				this.ColWidth[11]	= 80;
				this.ColWidth[12]	= 80;
				this.ColWidth[13]	= 80;
				this.ColWidth[14]	= 80;
				this.ColWidth[15]	= 80;
				this.ColWidth[16]	= 100;
				this.ColWidth[17]	= 100;

				this.ColEditName[0]	= "";
				this.ColEditName[1]	= "UserCode_Edit";
				this.ColEditName[2]	= "FullName_Edit";
				this.ColEditName[3]	= "Unit_Edit";
				this.ColEditName[4]	= "EntryCode_Edit";
				this.ColEditName[5]	= "Standard_Edit";
				this.ColEditName[6]	= "Type_Edit";
				this.ColEditName[7]	= "Area_Edit";
				this.ColEditName[8]	= "Stock_Edit";
				this.ColEditName[9]	= "Qty_Edit";
				this.ColEditName[10]	= "Price_Edit";
				this.ColEditName[11]	= "NoTaxTotal_Edit";
				this.ColEditName[12]	= "TaxRate_Edit";
				this.ColEditName[13]	= "TaxPrice_Edit";
				this.ColEditName[14]	= "Total_Edit";
				this.ColEditName[15]	= "TaxTotal_Edit";
				this.ColEditName[16]	= "BillCode_Edit";
				this.ColEditName[17]	= "Comment_Edit";

				this.SumRow = "<tr class=\"ClientTablesum\" id=\"SumRow\" height=\"20px\"><td>合计</td>";strColsDisplay = 1;
				
				
				for ( i = 1; i < this.cols; i++ ) {
					// Judge If Display The Grid Cols
					for ( j = 1; j < this.HiddenColsArray.length; j++ ) {
						if ( this.HiddenColsArray[j] == this.ColEditName[i] ) {
							strColsDisplay = 0;
							break;
						}
						else
							strColsDisplay = 1;
						
					}
					for ( j = 0; j < this.SumCols.length; j++ ) {
						if ( i == parseInt(this.SumCols[j]) ) {
							strSumValueDisplay = "<span id=\"" + this.name + "Total" + this.SumCols[j] + "\" style=\"color:#000000\">&nbsp;0</span>";break;
						}
						else
							strSumValueDisplay = "&nbsp;";
					}
					if ( strColsDisplay == 1 ) {
						this.SumRow = this.SumRow + "<td>" + strSumValueDisplay + "</td>";
					}
					else{
						this.SumRow = this.SumRow + "<td style='display:none'>" + strSumValueDisplay + "</td>";
					}
				}

				if ( !this.Disable ) {	// 删除列所占用的单元格
					this.SumRow = this.SumRow + "<td>&nbsp;</td>";
				}
				this.SumRow = this.SumRow + "</tr>";

				//if ( !this.Disable )
				//	this.SumRow="<tr class=ClientTablesum id=SumRow height=20px><td colspan=4>&nbsp;合计</td><td><span id="+this.name+"Total4 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td><span id="+this.name+"Total6 style='color:#000000'>&nbsp;0</span></td><td><span id="+this.name+"Total7 style='color:#000000'>&nbsp;0</span><td>&nbsp;</td><td>&nbsp;</td></tr>";
				//else
				//	this.SumRow="<tr class=ClientTablesum id=SumRow height=20px><td colspan=4>&nbsp;合计</td><td><span id="+this.name+"Total4 style='color:#000000'>&nbsp;0</span></td><td>&nbsp;</td><td><span id="+this.name+"Total6 style='color:#000000'>&nbsp;0</span></td><td><span id="+this.name+"Total7 style='color:#000000'>&nbsp;0</span><td>&nbsp;</td></tr>";

				break;
			case 35:	// 销售提成规则设置
				this.cols = 6;
				
				this.Title[0] = "No.";
				this.Title[1] = "商品编号";
				this.Title[2] = "商品名称";
				this.Title[3] = "业务员";
				this.Title[4] = "提成公式名称";
				this.Title[5] = "提成公式";


				if ( this.Disable ) {
					this.DisableCols[0] = 1;
					this.DisableCols[1] = 2;
					this.DisableCols[2] = 3;
					this.DisableCols[3] = 4;
					this.DisableCols[4] = 5;
				}
				else{
					this.DisableCols[0] = 5;
				}

				this.ColWidth[0] = 25;
				this.ColWidth[1] = 80;
				this.ColWidth[2] = 100;
				this.ColWidth[3] = 100;
				this.ColWidth[4] = 100;
				this.ColWidth[5] = 250;

				this.ColEditName[0] = "";
				this.ColEditName[1] = "UserCode_Edit";
				this.ColEditName[2] = "FullName_Edit";
				this.ColEditName[3] = "Employee_Edit";
				this.ColEditName[4] = "RuleCode_Edit";
				this.ColEditName[5] = "RuleExpression_Edit";

				break;

 		}

		this.TitleRow = "<tr class=\"ClientTablehead\" align=\"center\">";
		strColsDisplay = "";
		var strGridName;
		if ( this.ob == "Grid" ) strGridName = "Grid";
		if ( this.ob == "GridOut" ) strGridName = "GridOut";
		if ( this.ob == "GridIn" ) strGridName = "GridIn";
		for ( i = 0; i < this.cols; i++ ) {
			// Judge If Display The Grid Cols
			for ( j = 1; j < this.HiddenColsArray.length; j++ ) {
				if ( this.HiddenColsArray[j] == this.ColEditName[i] ) {
					strColsDisplay = " style=\"display:none\"";
					break;
				}
				else
					strColsDisplay = "";
			}
			if ( this.Title[i] == "商品编号" )
				if ( !this.Disable ){
					this.TitleRow = this.TitleRow + "<td nowrap height=\"20px\" width=\"" + this.ColWidth[i] + "\"" + strColsDisplay + "><span onClick=\"" + strGridName + ".BillSort('UserCode')\" style=\"cursor:hand\" title=\"按" + this.Title[i] + "排序\">" + this.Title[i] + "</span></td>";
				}
				else{
					this.TitleRow = this.TitleRow + "<td nowrap height=\"20px\" width=\"" + this.ColWidth[i] + "\"" + strColsDisplay + ">" + this.Title[i] + "</td>";
				}
			else {
				//同样生成表格，只是不显示 2006.06.19徐辉
				this.TitleRow = this.TitleRow + "<td nowrap height=\"20px\" width=\"" + this.ColWidth[i] + "\"" + strColsDisplay + ">" + this.Title[i] + "</td>";
			}
		}
		if ( !this.Disable )
			this.TitleRow = this.TitleRow + "<td nowrap width=\"15px\">&nbsp;</td>"
		this.TitleRow = this.TitleRow + "</tr>"
	}

	// 增加新的一条空行
	function AddRow() {
		if ( document.all("hdnBillType") != null ){
			if ( document.all("hdnBillType").value == "16" ){
				if ( this.rows >= 300 ) {
					alert("【系统提示】\n\n为了保障单据数据的正确性和稳定性，\n\n每张单据表格的录入行数不能超过 300 行！	\n\n若实际应用需超过行数限制，请分成两张或多张单据进行处理！	\n");
					return false;
				}
			}
			else{
				if ( this.rows >= 150 ) {
					alert("【系统提示】\n\n为了保障单据数据的正确性和稳定性，\n\n每张单据表格的录入行数不能超过 150 行！	\n\n若实际应用需超过行数限制，请分成两张或多张单据进行处理！	\n");
					return false;
				}
			}
		}
		else{
			if ( this.rows >= 150 ) {
				alert("【系统提示】\n\n为了保障单据数据的正确性和稳定性，\n\n每张单据表格的录入行数不能超过 150 行！	\n\n若实际应用需超过行数限制，请分成两张或多张单据进行处理！	\n");
				return false;
			}
		}
		var DisplayCols = new Array();		//尹毅 2006.6.5 记录不显示列
		var DisplayCols_num=0;				// 不显示列数量
		
		var ob;
		var orow, ocell;
		var v, r;
		var temp;
		var strfocus;
		var intIfDisplayCols;
		
		var isGridDisabled;          //   尹毅  2006.5.15  true--列不可编辑  false--可以编辑  在生成table之前判断列是否可以编辑 

		////////////////尹毅 2006.5.15 根据 "hdnGridReadOnly" 判断单据是否可以编辑
		
		if( (document.all("hdnGridReadOnly") != null) && (document.all("hdnGridReadOnly").value != '') ){
			if( document.all("hdnGridReadOnly").value == "1"){
				isGridDisabled = true;
			}
			else{
				isGridDisabled = false;
			}
		}
		else{
			isGridDisabled = false;
		}
		
		////////////////尹毅 2006.5.15 根据 "hdnGridReadOnly" 判断单据是否可以编辑
		
		intIfDisplayCols = 1
		ob = document.all(this.name);
		orow = ob.insertRow(this.rows+1)
				
		this.rows = this.rows + 1;
		orow.id = "Row" + this.rows;
		orow.name = "Row" + this.rows;
		orow.className = "ClientTablerow";		
		
		for ( var i = 0; i < this.cols; i++ ) {
			// Judge If Display The Grid Cols
			for ( var j = 1; j < this.HiddenColsArray.length; j++ ) {
				if ( this.HiddenColsArray[j] == this.ColEditName[i] ) {
					intIfDisplayCols = 0;
					break;
				}
				else
					intIfDisplayCols = 1;
				
			}
		
				//ocell = orow.insertCell();
				ocell = document.createElement("td");
				orow.appendChild(ocell);
				
				ocell.bgColor = this.TDBGCOLOR;
				//徐辉2006-06-08修改，添加行，所有列都写出来，隐藏列不让显示 开始
				if ( intIfDisplayCols == 0 ){
					DisplayCols[DisplayCols_num] = i ;		//尹毅 2006.6.5 记录不显示列
					DisplayCols_num += 1;
				}
				else{
					ocell.style.display = "block";
				}
				//徐辉2006-06-08修改，添加行，所有列都写出来，隐藏列不让显示 结束
				if ( i == 0 ) {		// 跳过第一列
					ocell.innerHTML = "&nbsp;" + this.rows;	// 序号列
				}
				else if( intIfDisplayCols == 0 ) {		//不显示列不加入控件 徐辉2006-06-08修改,徐辉2007-4-5修改 不显示列，照样生成input但disabled=true
					ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" id=\"" + this.ColEditName[i] + this.rows + "\" class=\"ClientTableflateditbox\" onFocus=\"getFocusPOS(this);this.style.background='#66FFFF';this.select()\" onBlur=\"this.style.background='#ffffff'\" " + " " + this.editChange + " " + this.editkeydown + " readonly disabled=\"true\"value=\"\">";
				}
				else {
					r = this.InIniCols(i);
					if ( r == -1 )
						v = "''";
					else
						v = this.IniCols[r+1];

					if ( this.isInMouseDbClickCols(i) )
						temp = "ondblclick=\"MouseDbClick('" + this.ob + "'," + this.rows + "," + i + ")\"";
					else
						temp = "";
					
					if ( this.InDisableCols(i) ) {	
						if ( this.ColEditName[i] == "Serial_Edit" ) {					
							if( isGridDisabled == false) {			////////////////////////尹毅 2006.5.15 在添加输入框前，根据isGridDisabled判断单据是否可以编辑
								ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" class=\"ClientTableflateditbox\" readonly  " + temp + " value=" + v + "><input type=\"hidden\" name=\"SerialIn" + this.rows + "\" value=\"\">";
							}
							else{
								ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" class=\"ClientTableflateditbox\" disabled  " + temp + " value=" + v + "><input type=\"hidden\" name=\"SerialIn" + this.rows + "\" value=\"\">";
							}
						}
						else if ( this.ColEditName[i] == "SerialSel_Edit" ) {	
							if( isGridDisabled == false){			////////////////////////尹毅 2006.5.15 在添加输入框前，根据isGridDisabled判断单据是否可以编辑
								ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" class=\"ClientTableflateditbox\" readonly " + temp + " value=" + v + "><input type=\"hidden\" name=\"SerialOut" + this.rows + "\" value=\"\">";
							}
							else{	
								ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" class=\"ClientTableflateditbox\" disabled  " + temp + "  value=" + v + "><input type=\"hidden\" name=\"SerialOut" + this.rows + "\" value=\"\">";
							}
						}
						else{
							if( isGridDisabled == false){			////////////////////////尹毅 2006.5.15 在添加输入框前，根据isGridDisabled判断单据是否可以编辑
								ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" class=\"ClientTableflateditbox\" readonly " + temp + "  value=" + v + ">";
							}
							else{
								ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" class=\"ClientTableflateditbox\" disabled  " + temp + "  value=" + v + ">";
							}
						}
					}
					else {
						strfocus = ";SetRowCol('" + this.ob + "'," + this.rows + "," + i + ")";
						if ( !this.InNumericCols(i) ) { // 非数据列
							if ( this.InLocalUpdateCol(i) ){
								if ( this.ColEditName[i] == "SerialSel_Edit" || this.ColEditName[i] == "OSerialSel_Edit" || this.ColEditName[i] == "ISerialSel_Edit" ){
									if( isGridDisabled == false){		////////////////////////尹毅 2006.5.15 在添加输入框前，根据isGridDisabled判断单据是否可以编辑							
										ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" id=\"" + this.ColEditName[i] + this.rows + "\" class=\"ClientTableflateditbox\" onFocus=\"getFocusPOS(this);this.style.background='#66FFFF'" + strfocus + ";this.select()\" onBlur=\"this.style.background='#ffffff';chkSerialNonChar(this)\" " + " " + this.editChange + " " + this.editkeydown + " " + temp + " value=" + v + ">";
									}
									else{														
										ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" id=\"" + this.ColEditName[i] + this.rows + "\" disabled class=\"ClientTableflateditbox\" onFocus=\"getFocusPOS(this);this.style.background='#66FFFF'" + strfocus + ";this.select()\" onBlur=\"this.style.background='#ffffff;chkSerialNonChar(this)\" " + " " + this.editChange + " " + this.editkeydown + " " + temp + " value=" + v + ">";
									}
								}
								else{
									if( isGridDisabled == false){		////////////////////////尹毅 2006.5.15 在添加输入框前，根据isGridDisabled判断单据是否可以编辑							
										ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" id=\"" + this.ColEditName[i] + this.rows + "\" class=\"ClientTableflateditbox\" onFocus=\"getFocusPOS(this);this.style.background='#66FFFF'" + strfocus + ";this.select()\" onBlur=\"this.style.background='#ffffff';chkNonChar(this)\" " + " " + this.editChange + " " + this.editkeydown + " " + temp + " value=" + v + ">";
									}
									else{														
										ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" id=\"" + this.ColEditName[i] + this.rows + "\" disabled class=\"ClientTableflateditbox\" onFocus=\"getFocusPOS(this);this.style.background='#66FFFF'" + strfocus + ";this.select()\" onBlur=\"this.style.background='#ffffff;chkNonChar(this)\" " + " " + this.editChange + " " + this.editkeydown + " " + temp + " value=" + v + ">";
									}
								}
							}
							else{
								if ( this.ColEditName[i] == "Base_Edit" || this.ColEditName[i] == "IBase_Edit" || this.ColEditName[i] == "OBase_Edit"){ //备注检验非法字符
									if( isGridDisabled == false){	////////////////////////尹毅 2006.5.15 在添加输入框前，根据isGridDisabled判断单据是否可以编辑
										ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" id=\"" + this.ColEditName[i] + this.rows + "\" class=\"ClientTableflateditbox\" onFocus=\"getFocusPOS(this);this.style.background='#66FFFF'" + strfocus + ";this.select()\" onBlur=\"this.style.background='#ffffff';chkNonChar(this)\" " + this.editkeydown + " " + temp + " value=" + v + " maxlength=125>";
									}
									else{					
										ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" id=\"" + this.ColEditName[i] + this.rows + "\" disabled class=\"ClientTableflateditbox\" onFocus=\"getFocusPOS(this);this.style.background='#66FFFF'" + strfocus + ";this.select()\" onBlur=\"this.style.background='#ffffff';chkNonChar(this)\" " + this.editkeydown + " " + temp + " value=" + v + " maxlength=125>";
									}
								}
								else if ( this.ColEditName[i] == "GoodsNumber_Edit" || this.ColEditName[i] == "IGoodsNumber_Edit" || this.ColEditName[i] == "OGoodsNumber_Edit"  ){ //批号
									if( isGridDisabled == false){	////////////////////////尹毅 2006.5.15 在添加输入框前，根据isGridDisabled判断单据是否可以编辑
										ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" id=\"" + this.ColEditName[i] + this.rows + "\" class=\"ClientTableflateditbox\" onFocus=\"getFocusPOS(this);this.style.background='#66FFFF'" + strfocus + ";this.select()\" onBlur=\"this.style.background='#ffffff';chkNonChar(this)\" " + this.editkeydown + " " + temp + " value=" + v + " maxlength=50>";
									}
									else{					
										ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" id=\"" + this.ColEditName[i] + this.rows + "\" disabled class=\"ClientTableflateditbox\" onFocus=\"getFocusPOS(this);this.style.background='#66FFFF'" + strfocus + ";this.select()\" onBlur=\"this.style.background='#ffffff';chkNonChar(this)\" " + this.editkeydown + " " + temp + " value=" + v + " maxlength=50>";
									}
								}
								else if (  this.ColEditName[i] == "ValidDate_Edit" || this.ColEditName[i] == "IValidDate_Edit"  || this.ColEditName[i] == "OValidDate_Edit" ){ //日期列检验日期是否正确 2007-04-05 xuhui
									if( isGridDisabled == false){	////////////////////////尹毅 2006.5.15 在添加输入框前，根据isGridDisabled判断单据是否可以编辑
										ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" id=\"" + this.ColEditName[i] + this.rows + "\" class=\"ClientTableflateditbox\" onFocus=\"getFocusPOS(this);this.style.background='#66FFFF'" + strfocus + ";this.select()\" onBlur=\"this.style.background='#ffffff';DateCheck(this)\" " + this.editkeydown + " " + temp + " value=" + v + " maxlength=10>";
									}
									else{					
										ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" id=\"" + this.ColEditName[i] + this.rows + "\" disabled class=\"ClientTableflateditbox\" onFocus=\"getFocusPOS(this);this.style.background='#66FFFF'" + strfocus + ";this.select()\" onBlur=\"this.style.background='#ffffff';DateCheck(this)\" " + this.editkeydown + " " + temp + " value=" + v + " maxlength=10>";
									}
								}
								else if ( this.ColEditName[i] == "ProduceDate_Edit"  || this.ColEditName[i] == "IProduceDate_Edit"  || this.ColEditName[i] == "OProduceDate_Edit"  ){ //生产日期列检验日期是否正确 2007-04-05 xuhui，计算效期至
									if( isGridDisabled == false){	////////////////////////尹毅 2006.5.15 在添加输入框前，根据isGridDisabled判断单据是否可以编辑
										ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" id=\"" + this.ColEditName[i] + this.rows + "\" class=\"ClientTableflateditbox\" onFocus=\"getFocusPOS(this);this.style.background='#66FFFF'" + strfocus + ";this.select()\" onBlur=\"this.style.background='#ffffff';GetValidDate(this," + this.rows + ")\" " + this.editkeydown + " " + temp + " value=" + v + " maxlength=10>";
									}
									else{					
										ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" id=\"" + this.ColEditName[i] + this.rows + "\" disabled class=\"ClientTableflateditbox\" onFocus=\"getFocusPOS(this);this.style.background='#66FFFF'" + strfocus + ";this.select()\" onBlur=\"this.style.background='#ffffff';GetValidDate(this," + this.rows + ")\" " + this.editkeydown + " " + temp + " value=" + v + " maxlength=10>";
									}
								}
								else if ( this.ColEditName[i] == "Serial_Edit"  ){ //录入序列号
									if( isGridDisabled == false){	////////////////////////尹毅 2006.5.15 在添加输入框前，根据isGridDisabled判断单据是否可以编辑
										ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" id=\"" + this.ColEditName[i] + this.rows + "\" class=\"ClientTableflateditbox\" onFocus=\"getFocusPOS(this);this.style.background='#66FFFF'" + strfocus + ";this.select()\" onBlur=\"this.style.background='#ffffff'\" " + this.editkeydown + " " + temp + " value=" + v + " maxlength=50>";
									}
									else{					
										ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" id=\"" + this.ColEditName[i] + this.rows + "\" disabled class=\"ClientTableflateditbox\" onFocus=\"getFocusPOS(this);this.style.background='#66FFFF'" + strfocus + ";this.select()\" onBlur=\"this.style.background='#ffffff'\" " + this.editkeydown + " " + temp + " value=" + v + " maxlength=50>";
									}
								}
								else{
									if( isGridDisabled == false){	////////////////////////尹毅 2006.5.15 在添加输入框前，根据isGridDisabled判断单据是否可以编辑	
										if ( this.id == 35 ){ //徐辉V4.1 添加销售提成规则单 特殊处理 添加getname(obj)
											ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" id=\"" + this.ColEditName[i] + this.rows + "\" class=\"ClientTableflateditbox\" onFocus=\"getFocusPOS(this);getname(this);this.style.background='#66FFFF'" + strfocus + ";this.select()\" onBlur=\"this.style.background='#ffffff';chkNonChar(this)\" " + this.editkeydown + " " + temp + " value=" + v + "  maxlength=125>";
										}
										else{
											ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" id=\"" + this.ColEditName[i] + this.rows + "\" class=\"ClientTableflateditbox\" onFocus=\"getFocusPOS(this);this.style.background='#66FFFF'" + strfocus + ";this.select()\" onBlur=\"this.style.background='#ffffff';chkNonChar(this)\" " + this.editkeydown + " " + temp + " value=" + v + "  maxlength=125>";
										}
									}
									else{
										ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" id=\"" + this.ColEditName[i] + this.rows + "\" disabled class=\"ClientTableflateditbox\" onFocus=\"getFocusPOS(this);this.style.background='#66FFFF'" + strfocus + ";this.select()\" onBlur=\"this.style.background='#ffffff';chkNonChar(this)\" " + this.editkeydown + " " + temp + " value=" + v + "  maxlength=125>";
									}
								}
							}
						}
						else {	// 数据列
							if ( this.id == 0 ){ //成本调价单全部仓库调价Grid特殊处理，添加行时数量只读
								if (  parent.VCH_HEAD.document.all.chkAllStock != null ){
									if ( parent.VCH_HEAD.document.all.chkAllStock.checked == true && this.ColEditName[i] == "Qty_Edit" ){
										if( isGridDisabled == false){  ////////////////////////尹毅 2006.5.15 在添加输入框前，根据isGridDisabled判断单据是否可以编辑		
											ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" id=\"" + this.ColEditName[i] + this.rows + "\" class=\"ClientTableflateditbox\" onFocus=\"getFocusPOS(this);this.style.background='#66FFFF'" + strfocus + ";this.select()\" onBlur=\"this.style.background='#ffffff';" + this.ob + ".Refresh(" + this.rows + "," + i + ",1)\"" + this.editkeydown + " onchange=\"" + this.ob + ".Refresh(" + this.rows + "," + i + ",1)\" " + temp + " value=" + v + " readOnly>";
										}
										else{
											ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" id=\"" + this.ColEditName[i] + this.rows + "\" disabled class=\"ClientTableflateditbox\" onFocus=\"getFocusPOS(this);this.style.background='#66FFFF'" + strfocus + ";this.select()\" onBlur=\"this.style.background='#ffffff';" + this.ob + ".Refresh(" + this.rows + "," + i + ",1)\"" + this.editkeydown + " onchange=\"" + this.ob + ".Refresh(" + this.rows + "," + i + ",1)\" " + temp + " value=" + v + " readOnly>";
										}
									}
									else{
										if( isGridDisabled == false){  ////////////////////////尹毅 2006.5.15 在添加输入框前，根据isGridDisabled判断单据是否可以编辑		
											ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" id=\"" + this.ColEditName[i] + this.rows + "\" class=\"ClientTableflateditbox\" onFocus=\"getFocusPOS(this);this.style.background='#66FFFF'" + strfocus + ";this.select()\" onBlur=\"this.style.background='#ffffff';" + this.ob + ".Refresh(" + this.rows + "," + i + ",1)\"" + this.editkeydown + " onchange=\"" + this.ob + ".Refresh(" + this.rows + "," + i + ",1)\" " + temp + " value=" + v + ">";
										}
										else{
											//手工指定法下审核通过草稿可以选批次
											if( this.ColEditName[i] == "Qty_Edit" || this.ColEditName[i] == "OQty_Edit" ){
												ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" id=\"" + this.ColEditName[i] + this.rows + "\" readonly class=\"ClientTableflateditbox\" onFocus=\"getFocusPOS(this);this.style.background='#66FFFF'" + strfocus + ";this.select()\" onBlur=\"this.style.background='#ffffff';" + this.ob + ".Refresh(" + this.rows + "," + i + ",1)\"" + this.editkeydown + " onchange=\"" + this.ob + ".Refresh(" + this.rows + "," + i + ",1)\" " + temp + " value=" + v + ">";
											}
											else{
												ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" id=\"" + this.ColEditName[i] + this.rows + "\" disabled class=\"ClientTableflateditbox\" onFocus=\"getFocusPOS(this);this.style.background='#66FFFF'" + strfocus + ";this.select()\" onBlur=\"this.style.background='#ffffff';" + this.ob + ".Refresh(" + this.rows + "," + i + ",1)\"" + this.editkeydown + " onchange=\"" + this.ob + ".Refresh(" + this.rows + "," + i + ",1)\" " + temp + " value=" + v + ">";
											}
										}
									}
								}
								else
								{
									if( isGridDisabled == false){	////////////////////////尹毅 2006.5.15 在添加输入框前，根据isGridDisabled判断单据是否可以编辑		
										ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" id=\"" + this.ColEditName[i] + this.rows + "\" class=\"ClientTableflateditbox\" onFocus=\"getFocusPOS(this);this.style.background='#66FFFF'" + strfocus + ";this.select()\" onBlur=\"this.style.background='#ffffff';" + this.ob + ".Refresh(" + this.rows + "," + i + ",1)\"" + this.editkeydown + " onchange=\"" + this.ob + ".Refresh(" + this.rows + "," + i + ",1)\" " + temp + " value=" + v + ">";
									}
									else{
										//手工指定法下审核通过草稿可以选批次
										if( this.ColEditName[i] == "Qty_Edit" || this.ColEditName[i] == "OQty_Edit" ){
											ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" id=\"" + this.ColEditName[i] + this.rows + "\" readonly class=\"ClientTableflateditbox\" onFocus=\"getFocusPOS(this);this.style.background='#66FFFF'" + strfocus + ";this.select()\" onBlur=\"this.style.background='#ffffff';" + this.ob + ".Refresh(" + this.rows + "," + i + ",1)\"" + this.editkeydown + " onchange=\"" + this.ob + ".Refresh(" + this.rows + "," + i + ",1)\" " + temp + " value=" + v + ">";
										}
										else{
											ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" id=\"" + this.ColEditName[i] + this.rows + "\" disabled class=\"ClientTableflateditbox\" onFocus=\"getFocusPOS(this);this.style.background='#66FFFF'" + strfocus + ";this.select()\" onBlur=\"this.style.background='#ffffff';" + this.ob + ".Refresh(" + this.rows + "," + i + ",1)\"" + this.editkeydown + " onchange=\"" + this.ob + ".Refresh(" + this.rows + "," + i + ",1)\" " + temp + " value=" + v + ">";
										}
									}
								}
							}
							else {
								if ( this.id != 17 ){
									if( isGridDisabled == false){   ////////////////////////尹毅 2006.5.15 在添加输入框前，根据isGridDisabled判断单据是否可以编辑		
										ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" id=\"" + this.ColEditName[i] + this.rows + "\"   class=\"ClientTableflateditbox\" onFocus=\"getFocusPOS(this);this.style.background='#66FFFF'" + strfocus + ";this.select()\" onBlur=\"this.style.background='#ffffff'\" " + this.editkeydown + " onchange=\"" + this.ob + ".Refresh(" + this.rows + "," + i + ",1)\" " + temp + " value=" + v + ">";
									}
									else{
										//手工指定法下审核通过草稿可以选批次								
										if(this.ColEditName[i] == "Qty_Edit"){
											ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" id=\"" + this.ColEditName[i] + this.rows + "\" readonly class=\"ClientTableflateditbox\" onFocus=\"getFocusPOS(this);this.style.background='#66FFFF'" + strfocus + ";this.select()\" onBlur=\"this.style.background='#ffffff'\" " + this.editkeydown + " onchange=\"" + this.ob + ".Refresh(" + this.rows + "," + i + ",1)\" " + temp + " value=" + v + ">";
										}
										else{
											ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" id=\"" + this.ColEditName[i] + this.rows + "\" disabled class=\"ClientTableflateditbox\" onFocus=\"getFocusPOS(this);this.style.background='#66FFFF'" + strfocus + ";this.select()\" onBlur=\"this.style.background='#ffffff'\" " + this.editkeydown + " onchange=\"" + this.ob + ".Refresh(" + this.rows + "," + i + ",1)\" " + temp + " value=" + v + ">";
										}
									}
								}	
								else{
									if( isGridDisabled == false){	////////////////////////尹毅 2006.5.15 在添加输入框前，根据isGridDisabled判断单据是否可以编辑		
										ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" id=\"" + this.ColEditName[i] + this.rows + "\" class=\"ClientTableflateditbox\" onFocus=\"getFocusPOS(this);this.style.background='#66FFFF'" + strfocus + ";this.select()\" onBlur=\"this.style.background='#ffffff';" + this.ob + ".Refresh(" + this.rows + "," + i + ",1)\"" + this.editkeydown + " onchange=\"" + this.ob + ".Refresh(" + this.rows + "," + i + ",1)\" " + temp + " value=" + v + ">";
									}
									else{
										alert(this.ColEditName[i]);
										//手工指定法下审核通过草稿可以选批次
										if( this.ColEditName[i] == "Qty_Edit" || this.ColEditName[i] == "OQty_Edit" ){
											ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" id=\"" + this.ColEditName[i] + this.rows + "\"  readonly class=\"ClientTableflateditbox\" onFocus=\"getFocusPOS(this);this.style.background='#66FFFF'" + strfocus + ";this.select()\" onBlur=\"this.style.background='#ffffff';" + this.ob + ".Refresh(" + this.rows + "," + i + ",1)\"" + this.editkeydown + " onchange=\"" + this.ob + ".Refresh(" + this.rows + "," + i + ",1)\" " + temp + " value=" + v + ">";
										}
										else{
											ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" id=\"" + this.ColEditName[i] + this.rows + "\"  disabled class=\"ClientTableflateditbox\" onFocus=\"getFocusPOS(this);this.style.background='#66FFFF'" + strfocus + ";this.select()\" onBlur=\"this.style.background='#ffffff';" + this.ob + ".Refresh(" + this.rows + "," + i + ",1)\"" + this.editkeydown + " onchange=\"" + this.ob + ".Refresh(" + this.rows + "," + i + ",1)\" " + temp + " value=" + v + ">";
										}
									}
								}
							}
						}
					}
			}	// End Judge
		}
			

		if ( !this.Disable ) {
			//ocell = orow.insertCell();
			ocell = document.createElement("td");
			orow.appendChild(ocell);
			temp = "";
			for ( i = 0; i < this.HiddenArray.length; ) {
				temp = temp + "<input type=\"hidden\" name=\"" + this.HiddenArray[i] + this.rows + "\" value=\"" + this.HiddenArray[i+1] + "\">";
				i = i + 2;
			}
			if ( !(this.specialproperty == "RF" || this.specialproperty == "CF") )	//出入货位不允许删除
				temp = temp + "<img src=\"../Common/NDELETE.gif\" width=\"16\" height=\"16\" style=\"cursor:hand\" onmouseover='this.src=ImageB.src' onmouseout='this.src=ImageA.src' onclick=\"" + this.ob + ".DeleteRow(" + this.rows + ")\">";
			ocell.innerHTML = temp;
			ocell.bgColor = this.TDBGCOLOR;
			ocell.title = "删除本行";
		}
		
		for(var i=0;i<DisplayCols_num;i++)
		{
			orow.cells[DisplayCols[i]].style.display = "none";	// 尹毅 2006.6.5 不显示列
		}
		
		if ( typeof(SetBillColsDisplay) == "function" ){//添加行单据列控制
			SetBillColsDisplay();
		}
		if ( typeof(SetBillColsDisplayIn) == "function" ){//添加行单据列控制
			SetBillColsDisplayIn();
		}
		if ( typeof(SetBillColsDisplayOut) == "function" ){//添加行单据列控制
			SetBillColsDisplayOut();
		}
	}
	//////////////////////////////////////尹毅 测试 2006.6.19////////////////////
	function DeleteRow(currow) {
		//var t1= new Date();
		//alert(currow);
		var ob, ed;
		var temp = new Array();

		if ( document.all("hdnGridReadOnly") != null ) {
			if ( document.all("hdnGridReadOnly").value == "1" ) {
				alert("【系统提示】\n\n对于已审核通过的单据，不能进行任何修改！	\n");
				return false;
			}
		}
 
		if ( this.rows == 0 ) return;

		if ( ( this.id == 20 || this.id == 21 || this.id == 29 || this.id == 30 || this.id == 31 || this.id == 32 ) && parseFloat(document.all("ConsignmentQty_Edit" + currow).value) != 0 && document.all("ConsignmentQty_Edit" + currow).value != "" ) {
			if ( this.id == 20 || this.id == 29  || this.id == 30 )
				alert("【系统提示】\n\n该行记录的 [ 已发货数量 ] 不为零，不能删除！	\n");
			if ( this.id == 21 || this.id == 31 || this.id == 32 )
				alert("【系统提示】\n\n该行记录的 [ 已收货数量 ] 不为零，不能删除！	\n");
			return false;
		}
		
		ob = document.all(this.name);
		
		var strIfSerialRow, strQtyEditRow
		if ( this.ob == "Grid") {
			strIfSerialRow	= "IfSerial"
			strQtyEditRow	= "Qty_Edit"
			if ( typeof(SetBillColsDisplay) == "function" ){
				SetBillColsDisplay();
			}
		}
			
		if ( this.ob == "GridOut" ) {
			strIfSerialRow	= "OIfSerial"
			strQtyEditRow	= "OQty_Edit"
			if ( typeof(SetBillColsDisplayOut) == "function" ){
				SetBillColsDisplayOut();
			}
		}
		if ( this.ob == "GridIn" ) {
			strIfSerialRow	= "IIfSerial"
			strQtyEditRow	= "IQty_Edit"
			if ( typeof(SetBillColsDisplayIn) == "function" ){
				SetBillColsDisplayIn();
			}
		}
		
		var n=1;
		
		for(i=currow+1;i<=this.rows;i++){
			for(j=0;j<=this.cols;j++){
				for(l=0;l<ob.rows[i].cells[j].children.length;l++){
					temp[n]=ob.rows[i].cells[j].children[l].value;
					n++;
				}
			}

		}
	
		n=1;
		var IfCheckSerial =false;
		if ( document.all("hdnSysMngSerial") != null && document.all(strIfSerialRow + "1") != null ){
			if ( document.all("hdnSysMngSerial").value == "1" ){
				IfCheckSerial=true;
			}
		}
		for(i=currow;i<this.rows;i++){
			for(j=0;j<=this.cols;j++){
				for(l=0;l<ob.rows[i].cells[j].children.length;l++){
					ob.rows[i].cells[j].children[l].value=temp[n];
					n++;
				}
			}
		}
		
		if ( this.ob == "Grid") {
			if ( typeof(SetBillColsDisplay) == "function" ){
				SetBillColsDisplay();
			}
		}
			
		if ( this.ob == "GridOut" ) {
			if ( typeof(SetBillColsDisplayOut) == "function" ){
				SetBillColsDisplayOut();
			}
		}
		if ( this.ob == "GridIn" ) {
			if ( typeof(SetBillColsDisplayIn) == "function" ){
				SetBillColsDisplayIn();
			}
		}
		
		ob.deleteRow(this.rows);
		this.rows = this.rows - 1;	
		
		if ( this.UpdateInTime == true ) {
			this.Sum();	// 重新计算合计值
		}	
		//var t2 = new Date();
		//alert(t2-t1);
	}
	
	function DeleteRow2(currow) {
		//alert(currow);
		var ob, ed;
		var temp = new Array();
		var tempHiddenArray = new Array();
		var j;
		var rowcount;
		var intLength;
 
		if ( document.all("hdnGridReadOnly") != null ) {
			if ( document.all("hdnGridReadOnly").value == "1" ) {
				alert("【系统提示】\n\n对于已审核通过的单据，不能进行任何修改！	\n");
				return false;
			}
		}
 
		if ( this.rows == 0 ) return;

		if ( ( this.id == 20 || this.id == 21 || this.id == 29 || this.id == 30 || this.id == 31 || this.id == 32 ) && parseFloat(document.all("ConsignmentQty_Edit" + currow).value) != 0 && document.all("ConsignmentQty_Edit" + currow).value != "" ) {
			if ( this.id == 20 || this.id == 29  || this.id == 30 )
				alert("【系统提示】\n\n该行记录的 [ 已发货数量 ] 不为零，不能删除！	\n");
			if ( this.id == 21 || this.id == 31 || this.id == 32 )
				alert("【系统提示】\n\n该行记录的 [ 已收货数量 ] 不为零，不能删除！	\n");
			return false;
		}
		
		ob = document.all(this.name);
		
		//alert("Row" + currow);
		ob.deleteRow(ob.rows("Row" + currow).rowIndex);
		this.rows = this.rows - 1;
				
		var temp_name="";
		var temp_name2="";
		var temp_name3="";
		var temp_len=1;
		
		//alert(ob.rows(currow).cells[18].children[5].name);
		//alert(ob.rows[0].cells.length);
		//alert(this.cols);
		/*for(i=0;i<11;i++)
		{
			alert(i+"**"+ob.rows[3].cells[18].children[i].name);
		}*/
		for( i=currow;i<=this.rows;i++)
		{
			if(i>9){
				temp_len = 2;
			}
			if(i>99){
				temp_len = 3;
			}
			ob.rows[i].name="Row"+i;
			ob.rows[i].id="Row"+i;
			//alert(ob.rows[i].id+"**"+ob.rows[i].name);
			for(j=0;j<=this.cols;j++)
			{
				if(j==0){	
					//alert(ob.rows[i].cells[j].innerHTML);
					ob.rows[i].cells[j].innerHTML="&nbsp;"+i;
				}
				else{
				
					//alert(j+"**"+ob.rows[i].cells[j].children[0].value);
					for(l=0;l<ob.rows[i].cells[j].children.length;l++)
					{
						//alert(ob.rows[i].cells[j].children[l].tagName);
						if(ob.rows[i].cells[j].children[l].tagName == "IMG"){
							if(typeof(ob.rows[i].cells[j].children[l].onclick=="function")){
								//alert(ob.rows[i].cells[j].children[l].onclick);
								ob.rows[i].cells[j].children[l].outerHTML=ob.rows[i].cells[j].children[l].outerHTML.replace(/onclick=Grid.DeleteRow\([0-9]*\)/,"onclick=Grid.DeleteRow(" +i+ ")") ;
								//alert(ob.rows[i].cells[j].children[l].outerHTML);
								//alert(ob.rows[i].cells[j].children[l].outerHTML.replace("onclick","aaaa"));
								//alert(ob.rows[i].cells[j].children[l].outerHTML);
								//ob.rows[i].cells[j].children[l].onclick=" Grid.DeleteRow(" +i+ ") ";
								//ob.rows[i].cells[j].children[l].onclick=functionstr;
								//alert(ob.rows[i].cells[j].children[l].onclick);
							}
						}
						else{
							temp_name=ob.rows[i].cells[j].children[l].name;
							temp_name2=temp_name;
							temp_name3=temp_name;
						
							temp_name=temp_name.substring(0,temp_name.length-temp_len);
							temp_name2=temp_name2.substring(temp_name2.length-temp_len,temp_name2.length);
						
							//alert(ob.rows[i].cells[j].children[l].name+"**"+(temp_name.length)+"**"+temp_len+"**"+temp_name2);			
							if(temp_name2 == (i+1)){
								temp_name+=i;
								
								ob.rows[i].cells[j].children[l].id=temp_name;
								ob.rows[i].cells[j].children[l].outerHTML=ob.rows[i].cells[j].children[l].outerHTML.replace(temp_name3,temp_name);
								
								//alert(i+"**"+ob.rows[i].cells[j].children[l].outerHTML.replace(temp_name3,temp_name));
								//ob.rows[i].cells[j].children[l].id=temp_name;
								//ob.rows[i].cells[j].children[l].name=temp_name;
								//alert(i+"**"+ob.rows[i].cells[j].children[l].id+"**"+ob.rows[i].cells[j].children[l].name+"**"+ob.rows[i].cells[j].innerHTML);
							}
						}				
					}
				}
			}
		}
		
		if ( this.UpdateInTime == true ) {
			this.Sum();	// 重新计算合计值
		}
		var s="";
		/*for(i=currow;i<=this.rows;i++){
			for(j=0;j<=this.cols;j++){
				for(l=0;l<ob.rows[i].cells[j].children.length;l++){
					s+="**"+ob.rows[i].cells[j].children[l].name;
					//alert(ob.rows[i].cells[j].children[l].name);
				}
			}
			alert(s);
			s="";
		}*/
		
		for(i=currow;i<=this.rows;i++){
			for(j=0;j<=this.cols;j++){
				//for(l=0;l<ob.rows[i].cells[j].children.length;l++){
					
					//alert(i+"**"+ob.rows[i].cells[j].innerHTML);
				//}
			}
			//alert(s);
			s="";
		}
			//alert(currow+"**"+ob.rows[currow].cells[18].innerHTML);
			//alert(ob.rows[currow].cells[18].children[10].onclick);
			//alert(ob.rows[currow].cells[18].children[10].src);

		
	}
	//////////////////////////////////////尹毅 测试 2006.6.19////////////////////
	// Delete The Grid Rows
	function DeleteRow1(currow) {
		var ob, ed;
		var temp = new Array();
		var tempHiddenArray = new Array();
		var j;
		var rowcount;
		var intLength;
 
		if ( document.all("hdnGridReadOnly") != null ) {
			if ( document.all("hdnGridReadOnly").value == "1" ) {
				alert("【系统提示】\n\n对于已审核通过的单据，不能进行任何修改！	\n");
				return false;
			}
		}
 
		if ( this.rows == 0 ) return;

		if ( ( this.id == 20 || this.id == 21 || this.id == 29 || this.id == 30 || this.id == 31 || this.id == 32 ) && parseFloat(document.all("ConsignmentQty_Edit" + currow).value) != 0 && document.all("ConsignmentQty_Edit" + currow).value != "" ) {
			if ( this.id == 20 || this.id == 29  || this.id == 30 )
				alert("【系统提示】\n\n该行记录的 [ 已发货数量 ] 不为零，不能删除！	\n");
			if ( this.id == 21 || this.id == 31 || this.id == 32 )
				alert("【系统提示】\n\n该行记录的 [ 已收货数量 ] 不为零，不能删除！	\n");
			return false;
		}
		
		ob = document.all(this.name);
		if ( currow == this.rows ) {
			ob.deleteRow(ob.rows("Row" + currow).rowIndex);
			this.rows = this.rows - 1;
		}
		else {
			var intIfDisplayCols = 1;
			intLength = this.HiddenArray.length/2;
			for ( var i = currow; i <= this.rows; i++ ) {
				if ( i != currow) {
					for ( var j = 1; j < this.cols; j++ ) {
						for ( var k = 1; k < this.HiddenColsArray.length; k++ ) {
							if ( this.ColEditName[j] == this.HiddenColsArray[k] ) {
								intIfDisplayCols = 0;
								break;
							}
							else
								intIfDisplayCols = 1;
						}
						if ( intIfDisplayCols == 1 ) {
							temp[(i-1)*(this.cols-1)+j-1] = document.all(this.ColEditName[j]+i).value;
						}
					}
					// 保存隐藏字段
					for( var l = 0; l < this.HiddenArray.length; ) {
						tempHiddenArray[(i-1)*intLength+l/2] = document.all(this.HiddenArray[l] + i).value;
						l = l + 2;
					}
				}
			}
	
			for ( var i = currow; i <= this.rows; i++ ) {
				for ( var j = 1; j < this.cols; j++ ) {
					temp[(i-1)*(this.cols-1)+j-1] = temp[i*(this.cols-1)+j-1];
				}
				for(var l = 0;l<this.HiddenArray.length;) {
					tempHiddenArray[(i-1)*intLength+l/2] = tempHiddenArray[i*intLength+l/2];
					l = l + 2;
				}
			}
			
			
			for ( var i = currow;i <= this.rows; i++ ) {
				ob.deleteRow(currow);
			}
			rowcount = this.rows - 1;
			this.rows = currow-1;
			for ( var i = currow; i <= rowcount; i++ ) {
				this.AddRow();
			}
			var strIfSerialRow, strQtyEditRow
			if ( this.ob == "Grid") {
				strIfSerialRow	= "IfSerial"
				strQtyEditRow	= "Qty_Edit"
				if ( typeof(SetBillColsDisplay) == "function" ){
					SetBillColsDisplay();
				}
			}
			
			if ( this.ob == "GridOut" ) {
				strIfSerialRow	= "OIfSerial"
				strQtyEditRow	= "OQty_Edit"
				if ( typeof(SetBillColsDisplayOut) == "function" ){
					SetBillColsDisplayOut();
				}
			}
			if ( this.ob == "GridIn" ) {
				strIfSerialRow	= "IIfSerial"
				strQtyEditRow	= "IQty_Edit"
				if ( typeof(SetBillColsDisplayIn) == "function" ){
					SetBillColsDisplayIn();
				}
			}
			
			

			intIfDisplayCols = 1;
			for ( var i = currow; i <= this.rows; i++ ) {
				for ( var j = 1; j < this.cols; j++ ) {
					for ( var k = 1; k < this.HiddenColsArray.length; k++ ) {
						if ( this.ColEditName[j] == this.HiddenColsArray[k] ) {
							intIfDisplayCols = 0;
							break;
						}
						else
							intIfDisplayCols = 1;
					}
					if ( intIfDisplayCols == 1 ) {
						document.all(this.ColEditName[j]+i).value = temp[(i-1)*(this.cols-1)+j-1];
					}
				}
				for ( var l = 0; l < this.HiddenArray.length; ) {
					document.all(this.HiddenArray[l]+i).value = tempHiddenArray[(i-1)*intLength+l/2];
					l = l + 2;
				}
				//是序列号强制管理商品数量栏还是disabled 2005-01-14
				if ( document.all("hdnSysMngSerial") != null && document.all(strIfSerialRow + "1") != null ) {
					if ( document.all("hdnSysMngSerial").value == "1" ) {
						if ( document.all(strIfSerialRow + i).value == "1" ) {
							document.all(strQtyEditRow + i).disabled = true;
						}
						else {
							document.all(strQtyEditRow + i).disabled = false;
						}
					}
				}
				//是序列号强制管理商品数量栏还是disabled 2005-01-14
			}
		}	// else结束
		if ( this.UpdateInTime == true ) {
			this.Sum();	// 重新计算合计值
		}
	}
	////////////////////////////////////尹毅 2006.5.16 增加函数addrowdata 作为addrow,loadrow的合并函数,提高录入速度
	function AddRowData(row)   //@@@
	{
			if ( document.all("hdnBillType") != null ){
				if ( document.all("hdnBillType").value == "16" ){
					if ( this.rows >= 300 ) {
						alert("【系统提示】\n\n为了保障单据数据的正确性和稳定性，\n\n每张单据表格的录入行数不能超过 300 行！	\n\n若实际应用需超过行数限制，请分成两张或多张单据进行处理！	\n");
						return false;
					}
				}
				else{
					if ( this.rows >= 150 ) {
						alert("【系统提示】\n\n为了保障单据数据的正确性和稳定性，\n\n每张单据表格的录入行数不能超过 150 行！	\n\n若实际应用需超过行数限制，请分成两张或多张单据进行处理！	\n");
						return false;
					}
				}
			}
			else{
				if ( this.rows >= 150 ) {
					alert("【系统提示】\n\n为了保障单据数据的正确性和稳定性，\n\n每张单据表格的录入行数不能超过 150 行！	\n\n若实际应用需超过行数限制，请分成两张或多张单据进行处理！	\n");
					return false;
				}
			}
			var DisplayCols = new Array();// 尹毅 2006.6.5 记录不显示列
			var DisplayCols_num=0;		// 不显示列数量
			
			var ob;
			var orow, ocell;
			var v, r;
			var temp;
			var strfocus;
			var intIfDisplayCols;
		
			var DataValue;
			
			var isGridDisabled=false;   //尹毅 在加入行是判断是否可读 提高审核过的草稿读入
			var ishdnGridReadOnly ;
			if( document.all("hdnGridReadOnly") != null ){
				ishdnGridReadOnly =  document.all("hdnGridReadOnly").value;
			
				if ((ishdnGridReadOnly == 1) && (ishdnGridReadOnly !="''")){
					isGridDisabled = true;
				}
				else{
					isGridDisabled = false;
				}
			}
			intIfDisplayCols=1;
			
			ob = document.all(this.name);	
			
			var funString;
			var timeoutId;
			funString = "AddRowData('"+row.toString()+"')";
			if ( ob == null ){
				timeoutId=setTimeout(funString,500);
				return false;
			}
			
			orow = ob.insertRow(this.rows+1);
			this.rows = this.rows + 1;
			orow.id = "Row" + this.rows;
			orow.name = "Row" + this.rows;
			orow.className = "ClientTablerow";
			
			for ( var i = 0; i < this.cols; i++ ) {			
				DataValue = this.Data[(row-1)*this.GetDataCols() + i - 1];
			
				if ( "Qty_Edit||IQty_Edit||OQty_Edit||Price_Edit||IPrice_Edit||OPrice_Edit||TaxPrice_Edit||ITaxPrice_Edit||OTaxPrice_Edit||DiscountPrice_Edit||IDiscountPrice_Edit||ODiscountPrice_Edit||Tax_Edit||ITax_Edit||OTax_Edit||Discount_Edit||IDiscount_Edit||ODiscount_Edit||Total_Edit||ITotal_Edit||OTotal_Edit||NoDiscountTotal_Edit||INoDiscountTotal_Edit||ONoDiscountTotal_Edit||NoTaxTotal_Edit||INoTaxTotal_Edit||ONoTaxTotal_Edit||ConsignmentQty_Edit".indexOf(this.ColEditName[i]) != -1 ){ //徐辉 2008.02.26 单据中小数0.7显示成 .7问题 修改
					if ( !isNaN(parseFloat(DataValue)) ){
						DataValue = parseFloat(DataValue);
					}
					else{
						DataValue = DataValue;
					}
				}
				
				// Judge If Display The Grid Cols
				for ( var j = 1; j < this.HiddenColsArray.length; j++ ) {
					if ( this.HiddenColsArray[j] == this.ColEditName[i] ){
						intIfDisplayCols = 0;
						break;
					}
					else
						intIfDisplayCols = 1;
				
				}
				
				if ( intIfDisplayCols == 0 ){ //不显示列添加空格
					//ocell = orow.insertCell();
					ocell = document.createElement("td");
					orow.appendChild(ocell);
					ocell.bgColor = this.TDBGCOLOR;
					DisplayCols[DisplayCols_num] = i ;	// 尹毅 2006.6.5 记录不显示列
					DisplayCols_num +=  1;
					
					//隐藏列也要添加控件xuhui2007-05-16
					r = this.InIniCols(i);
					if ( r == -1 )
						v = "''";
					else
						v = this.IniCols[r+1];
					if ( this.isInMouseDbClickCols(i) )
						temp = "ondblclick=\"MouseDbClick('" + this.ob + "'," + this.rows + "," + i + ")\"";
					else
						temp = "";	
						
					ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" id=\"" + this.ColEditName[i] + this.rows + "\" value ='"+DataValue+"' class=\"ClientTableflateditbox\" onFocus=\"getFocusPOS(this);this.style.background='#66FFFF';this.select()\" onBlur=\"this.style.background='#ffffff'\" " + " " + this.editChange + " " + this.editkeydown + " " + temp + "   readonly disabled=\"true\">";
				}
				else{
					//ocell = orow.insertCell();
					ocell = document.createElement("td");
					orow.appendChild(ocell);
					ocell.bgColor = this.TDBGCOLOR;
					ocell.style.display = "block";
					
					if ( i == 0 ) {		// 跳过第一列
						ocell.innerHTML = "&nbsp;" + this.rows;	// 序号列
					}
					else{
						
						r = this.InIniCols(i);
						if ( r == -1 )
							v = "''";
						else
							v = this.IniCols[r+1];
						if ( this.isInMouseDbClickCols(i) )
							temp = "ondblclick=\"MouseDbClick('" + this.ob + "'," + this.rows + "," + i + ")\"";
						else
							temp = "";	
							
						if( !this.Disable){				//非原始单据	
							if ( this.InDisableCols(i) ) {
							
								//////3.66 也改了 同下原始单据
								if ( this.ColEditName[i] == "Serial_Edit" ){
									if( isGridDisabled == false){
										ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" class=\"ClientTableflateditbox\" readonly value='" + DataValue + "' " + temp + "><input type=\"hidden\" name=\"SerialIn" + this.rows + "\" value=\""+DataValue+"\" >";
									}
									else{
										ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" class=\"ClientTableflateditbox\"   value='" +  DataValue + "' " + temp + "><input type=\"hidden\" name=\"SerialIn" + this.rows + "\" value=\""+DataValue+"\" >";
									}
								
								}
								else if ( this.ColEditName[i] == "SerialSel_Edit" ) {
									if( isGridDisabled == false){
										ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" class=\"ClientTableflateditbox\" readonly value='" +  DataValue + "' " + temp + "><input type=\"hidden\" name=\"SerialOut" + this.rows + "\" value=\""+DataValue+"\" >";
									}
									else{
										ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" class=\"ClientTableflateditbox\"  value='" + DataValue + "' " + temp + "><input type=\"hidden\" name=\"SerialOut" + this.rows + "\" value=\""+DataValue+"\" >";
									}
								}
								else if ( this.ColEditName[i] == "ISerialSel_Edit" ) {
									if( isGridDisabled == false){
										ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" class=\"ClientTableflateditbox\" readonly value='" +  DataValue + "' " + temp + "><input type=\"hidden\" name=\"ISerialOut" + this.rows + "\" value=\""+DataValue+"\" >";
									}
									else{
										ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" class=\"ClientTableflateditbox\"  value='" + DataValue + "' " + temp + "><input type=\"hidden\" name=\"ISerialOut" + this.rows + "\" value=\""+DataValue+"\" >";
									}
								}
								else if ( this.ColEditName[i] == "OSerialSel_Edit" ) {
									if( isGridDisabled == false){
										ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" class=\"ClientTableflateditbox\" readonly value='" +  DataValue + "' " + temp + "><input type=\"hidden\" name=\"OSerialOut" + this.rows + "\" value=\""+DataValue+"\" >";
									}
									else{
										ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" class=\"ClientTableflateditbox\"  value='" + DataValue + "' " + temp + "><input type=\"hidden\" name=\"OSerialOut" + this.rows + "\" value=\""+DataValue+"\" >";
									}
								}
								else{
									if( isGridDisabled == false){
										ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" class=\"ClientTableflateditbox\" readonly value='" +DataValue + "' " + temp + ">";
									}
									else{
										ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" class=\"ClientTableflateditbox\" disabled readonly value='" +DataValue + "' " + temp + ">";
									}
								}
								if ( this.Disable ) {	
									if ( this.ColEditName[i] == "SerialSel_Edit" || this.ColEditName[i] == "Serial_Edit" || this.ColEditName[i] == "ISerialSel_Edit"  ||this.ColEditName[i] == "OSerialSel_Edit"  ) {
										if ( this.ColEditName[i] == "SerialSel_Edit" ) {	
											alert(document.all("SerialOut" + row).value);	
											if ( document.all("SerialOut" + row).value != "" )
												document.all(this.ColEditName[i] + row).value = "√";
										}
										if ( this.ColEditName[i] == "Serial_Edit" ) {
											if ( document.all("SerialIn" + row).value != "" )
												document.all(this.ColEditName[i] + row).value = "√";
										}
									}
								}	
							}
							else {
								strfocus = ";SetRowCol('" + this.ob + "'," + this.rows + "," + i + ")";
								if ( !this.InNumericCols(i) ) { // 非数据列
									if ( this.InLocalUpdateCol(i) ){
										if ( this.ColEditName[i] == "SerialSel_Edit"  || this.ColEditName[i] == "ISerialSel_Edit"  ||this.ColEditName[i] == "OSerialSel_Edit"  ) {
											if( isGridDisabled == false){
												ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" id=\"" + this.ColEditName[i] + this.rows + "\" value ='"+DataValue+"' class=\"ClientTableflateditbox\" onFocus=\"getFocusPOS(this);this.style.background='#66FFFF'" + strfocus + ";this.select()\" onBlur=\"this.style.background='#ffffff';chkSerialNonChar(this)\" " + " " + this.editChange + " " + this.editkeydown + " " + temp + "  >";
											}
											else{						
												ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" id=\"" + this.ColEditName[i] + this.rows + "\" value ='"+DataValue+"' class=\"ClientTableflateditbox\" onFocus=\"getFocusPOS(this);this.style.background='#66FFFF'" + strfocus + ";this.select()\" onBlur=\"this.style.background='#ffffff';chkSerialNonChar(this)\" " + " " + this.editChange + " " + this.editkeydown + " " + temp + " >";
											}
										}
										else{
											if( isGridDisabled == false){
												ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" id=\"" + this.ColEditName[i] + this.rows + "\" value ='"+DataValue+"' class=\"ClientTableflateditbox\" onFocus=\"getFocusPOS(this);this.style.background='#66FFFF'" + strfocus + ";this.select()\" onBlur=\"this.style.background='#ffffff';chkNonChar(this)\" " + " " + this.editChange + " " + this.editkeydown + " " + temp + "  >";
											}
											else{						
												ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" id=\"" + this.ColEditName[i] + this.rows + "\" value ='"+DataValue+"' disabled class=\"ClientTableflateditbox\" onFocus=\"getFocusPOS(this);this.style.background='#66FFFF'" + strfocus + ";this.select()\" onBlur=\"this.style.background='#ffffff';chkNonChar(this)\" " + " " + this.editChange + " " + this.editkeydown + " " + temp + " >";
											}
										}
									}
									else{
										if ( this.ColEditName[i] == "Base_Edit" || this.ColEditName[i] == "IBase_Edit" || this.ColEditName[i] == "OBase_Edit"){ //备注检验非法字符
											if( isGridDisabled == false){
												ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" id=\"" + this.ColEditName[i] + this.rows + "\" value ='"+DataValue+"' class=\"ClientTableflateditbox\" onFocus=\"getFocusPOS(this);this.style.background='#66FFFF'" + strfocus + ";this.select()\" onBlur=\"this.style.background='#ffffff';chkNonChar(this)\" " + this.editkeydown + " " + temp + " value=" + DataValue + " maxlength=125>";
											}
											else{
												ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" id=\"" + this.ColEditName[i] + this.rows + "\" value ='"+DataValue+"' disabled class=\"ClientTableflateditbox\" onFocus=\"getFocusPOS(this);this.style.background='#66FFFF'" + strfocus + ";this.select()\" onBlur=\"this.style.background='#ffffff';chkNonChar(this)\" " + this.editkeydown + " " + temp + " value=" + DataValue + " maxlength=125>";
											}
										}
										else if ( this.ColEditName[i] == "GoodsNumber_Edit" || this.ColEditName[i] == "IGoodsNumber_Edit" || this.ColEditName[i] == "OGoodsNumber_Edit"  ){ //批号
											if( isGridDisabled == false){
												ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" id=\"" + this.ColEditName[i] + this.rows + "\" value ='"+DataValue+"' class=\"ClientTableflateditbox\" onFocus=\"getFocusPOS(this);this.style.background='#66FFFF'" + strfocus + ";this.select()\" onBlur=\"this.style.background='#ffffff';chkNonChar(this)\" " + this.editkeydown + " " + temp + " value=" + DataValue + " maxlength=50>";
											}
											else{
												ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" id=\"" + this.ColEditName[i] + this.rows + "\" value ='"+DataValue+"' disabled class=\"ClientTableflateditbox\" onFocus=\"getFocusPOS(this);this.style.background='#66FFFF'" + strfocus + ";this.select()\" onBlur=\"this.style.background='#ffffff';chkNonChar(this)\" " + this.editkeydown + " " + temp + " value=" + DataValue + " maxlength=50>";
											}
										}
										else if ( this.ColEditName[i] == "ProduceDate_Edit" || this.ColEditName[i] == "ValidDate_Edit" || this.ColEditName[i] == "IProduceDate_Edit" || this.ColEditName[i] == "IValidDate_Edit"  || this.ColEditName[i] == "OProduceDate_Edit" || this.ColEditName[i] == "OValidDate_Edit" ){ //日期列检验日期是否正确 2007-04-05 xuhui
											if( isGridDisabled == false){
												ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" id=\"" + this.ColEditName[i] + this.rows + "\" value ='"+DataValue+"' class=\"ClientTableflateditbox\" onFocus=\"getFocusPOS(this);this.style.background='#66FFFF'" + strfocus + ";this.select()\" onBlur=\"this.style.background='#ffffff';DateCheck(this)\" " + this.editkeydown + " " + temp + " value=" + DataValue + " maxlength=10>";
											}
											else{
												ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" id=\"" + this.ColEditName[i] + this.rows + "\" value ='"+DataValue+"' disabled class=\"ClientTableflateditbox\" onFocus=\"getFocusPOS(this);this.style.background='#66FFFF'" + strfocus + ";this.select()\" onBlur=\"this.style.background='#ffffff';DateCheck(this)\" " + this.editkeydown + " " + temp + " value=" + DataValue + " maxlength=10>";
											}
										}
										if ( this.ColEditName[i] == "Serial_Edit" ) {
											if( isGridDisabled == false){
												ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" id=\"" + this.ColEditName[i] + this.rows + "\" value ='"+DataValue+"' class=\"ClientTableflateditbox\" onFocus=\"getFocusPOS(this);this.style.background='#66FFFF'" + strfocus + ";this.select()\" onBlur=\"this.style.background='#ffffff'\" " + " " + this.editChange + " " + this.editkeydown + " " + temp + "  >";
											}
											else{						
												ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" id=\"" + this.ColEditName[i] + this.rows + "\" value ='"+DataValue+"' class=\"ClientTableflateditbox\" onFocus=\"getFocusPOS(this);this.style.background='#66FFFF'" + strfocus + ";this.select()\" onBlur=\"this.style.background='#ffffff'\" " + " " + this.editChange + " " + this.editkeydown + " " + temp + " >";
											}
										}
										else{
											if ( this.ColEditName[i] == "SerialSel_Edit" || this.ColEditName[i] == "ISerialSel_Edit"  ||this.ColEditName[i] == "OSerialSel_Edit"  ) {
												if( isGridDisabled == false){
													ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" id=\"" + this.ColEditName[i] + this.rows + "\" value ='"+DataValue+"' class=\"ClientTableflateditbox\" onFocus=\"getFocusPOS(this);this.style.background='#66FFFF'" + strfocus + ";this.select()\" onBlur=\"this.style.background='#ffffff';chkSerialNonChar(this)\" " + this.editkeydown + " " + temp + " value=" +DataValue + "  maxlength=125>";
												}
												else{
													ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" id=\"" + this.ColEditName[i] + this.rows + "\" value ='"+DataValue+"' class=\"ClientTableflateditbox\" onFocus=\"getFocusPOS(this);this.style.background='#66FFFF'" + strfocus + ";this.select()\" onBlur=\"this.style.background='#ffffff';chkSerialNonChar(this)\" " + this.editkeydown + " " + temp + " value=" + DataValue + "  maxlength=125>";
												}
											}
											else{
												if( isGridDisabled == false){
													if ( this.id == 35 ){ //徐辉V4.1 添加销售提成规则单 特殊处理 添加getname(obj)
														ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" id=\"" + this.ColEditName[i] + this.rows + "\" value ='"+DataValue+"' class=\"ClientTableflateditbox\" onFocus=\"getFocusPOS(this);getname(this);this.style.background='#66FFFF'" + strfocus + ";this.select()\" onBlur=\"this.style.background='#ffffff';chkNonChar(this)\" " + this.editkeydown + " " + temp + " value=" +DataValue + "  maxlength=125>";
													}
													else{
														ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" id=\"" + this.ColEditName[i] + this.rows + "\" value ='"+DataValue+"' class=\"ClientTableflateditbox\" onFocus=\"getFocusPOS(this);this.style.background='#66FFFF'" + strfocus + ";this.select()\" onBlur=\"this.style.background='#ffffff';chkNonChar(this)\" " + this.editkeydown + " " + temp + " value=" +DataValue + "  maxlength=125>";
													}
												}
												else{
													ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" id=\"" + this.ColEditName[i] + this.rows + "\" value ='"+DataValue+"' disabled class=\"ClientTableflateditbox\" onFocus=\"getFocusPOS(this);this.style.background='#66FFFF'" + strfocus + ";this.select()\" onBlur=\"this.style.background='#ffffff';chkNonChar(this)\" " + this.editkeydown + " " + temp + " value=" + DataValue + "  maxlength=125>";
												}
											}
										}
									}
								}
								else {	// 数据列
									if ( this.id == 0 ){ //成本调价单全部仓库调价Grid特殊处理，添加行时数量只读
										if (  parent.VCH_HEAD.document.all.chkAllStock != null ){			
											//加权平均算法下才有效		
											if ( parent.VCH_HEAD.document.all.chkAllStock.checked == true && this.ColEditName[i] == "Qty_Edit" ){
												if( isGridDisabled == false){
													ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" id=\"" + this.ColEditName[i] + this.rows + "\" value ='"+DataValue+"' class=\"ClientTableflateditbox\" onFocus=\"getFocusPOS(this);this.style.background='#66FFFF'" + strfocus + ";this.select()\" onBlur=\"this.style.background='#ffffff';" + this.ob + ".Refresh(" + this.rows + "," + i + ",1)\"" + this.editkeydown + " onchange=\"" + this.ob + ".Refresh(" + this.rows + "," + i + ",1)\" " + temp + " value=" + DataValue + " readOnly>";
												}
												else{		
													ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" id=\"" + this.ColEditName[i] + this.rows + "\" value ='"+DataValue+"' disabled class=\"ClientTableflateditbox\" onFocus=\"getFocusPOS(this);this.style.background='#66FFFF'" + strfocus + ";this.select()\" onBlur=\"this.style.background='#ffffff';" + this.ob + ".Refresh(" + this.rows + "," + i + ",1)\"" + this.editkeydown + " onchange=\"" + this.ob + ".Refresh(" + this.rows + "," + i + ",1)\" " + temp + " value=" + DataValue + " readOnly>";
												}
											}
											else{
												if( isGridDisabled == false){
													ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" id=\"" + this.ColEditName[i] + this.rows + "\"value ='"+DataValue+"'  class=\"ClientTableflateditbox\" onFocus=\"getFocusPOS(this);this.style.background='#66FFFF'" + strfocus + ";this.select()\" onBlur=\"this.style.background='#ffffff';" + this.ob + ".Refresh(" + this.rows + "," + i + ",1)\"" + this.editkeydown + " onchange=\"" + this.ob + ".Refresh(" + this.rows + "," + i + ",1)\" " + temp + " value=" +DataValue + ">";
												}
												else{
													//手工指定法下审核双击选批次
													if (  this.ColEditName[i] == "Qty_Edit" ){
														ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" id=\"" + this.ColEditName[i] + this.rows + "\" value ='"+DataValue+"' readonly class=\"ClientTableflateditbox\" onFocus=\"getFocusPOS(this);this.style.background='#66FFFF'" + strfocus + ";this.select()\" onBlur=\"this.style.background='#ffffff';" + this.ob + ".Refresh(" + this.rows + "," + i + ",1)\"" + this.editkeydown + " onchange=\"" + this.ob + ".Refresh(" + this.rows + "," + i + ",1)\" " + temp + " value=" +DataValue + ">";
													}
													else{
														ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" id=\"" + this.ColEditName[i] + this.rows + "\" value ='"+DataValue+"' disabled class=\"ClientTableflateditbox\" onFocus=\"getFocusPOS(this);this.style.background='#66FFFF'" + strfocus + ";this.select()\" onBlur=\"this.style.background='#ffffff';" + this.ob + ".Refresh(" + this.rows + "," + i + ",1)\"" + this.editkeydown + " onchange=\"" + this.ob + ".Refresh(" + this.rows + "," + i + ",1)\" " + temp + " value=" +DataValue + ">";
													}
												}
											}
										}
										else
										{
											if( isGridDisabled == false){
												ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" id=\"" + this.ColEditName[i] + this.rows + "\" value ='"+DataValue+"' class=\"ClientTableflateditbox\" onFocus=\"getFocusPOS(this);this.style.background='#66FFFF'" + strfocus + ";this.select()\" onBlur=\"this.style.background='#ffffff';" + this.ob + ".Refresh(" + this.rows + "," + i + ",1)\"" + this.editkeydown + " onchange=\"" + this.ob + ".Refresh(" + this.rows + "," + i + ",1)\" " + temp + " value=" + DataValue + ">";
											}
											else{
												ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" id=\"" + this.ColEditName[i] + this.rows + "\" value ='"+DataValue+"' disabled class=\"ClientTableflateditbox\" onFocus=\"getFocusPOS(this);this.style.background='#66FFFF'" + strfocus + ";this.select()\" onBlur=\"this.style.background='#ffffff';" + this.ob + ".Refresh(" + this.rows + "," + i + ",1)\"" + this.editkeydown + " onchange=\"" + this.ob + ".Refresh(" + this.rows + "," + i + ",1)\" " + temp + " value=" + DataValue + ">";
											}
										}
									}
									else{ 
										if ( this.id != 17 ){
											if( isGridDisabled == false){
												ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" id=\"" + this.ColEditName[i] + this.rows + "\"  value ='"+DataValue+"'  class=\"ClientTableflateditbox\" onFocus=\"getFocusPOS(this);this.style.background='#66FFFF'" + strfocus + ";this.select()\" onBlur=\"this.style.background='#ffffff'\" " + this.editkeydown + " onchange=\"" + this.ob + ".Refresh(" + this.rows + "," + i + ",1)\" " + temp + " value=" + DataValue + ">";
											}
											else{
												//手工指定法下审核双击选批次
												if( this.ColEditName[i] == "Qty_Edit" ||this.ColEditName[i] == "OQty_Edit" ){
													ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" id=\"" + this.ColEditName[i] + this.rows + "\" value ='"+DataValue+"'  readonly class=\"ClientTableflateditbox\" onFocus=\"getFocusPOS(this);this.style.background='#66FFFF'" + strfocus + ";this.select()\" onBlur=\"this.style.background='#ffffff'\" " + this.editkeydown + " onchange=\"" + this.ob + ".Refresh(" + this.rows + "," + i + ",1)\" " + temp + " value=" + DataValue + ">";
												}
												else{
													ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" id=\"" + this.ColEditName[i] + this.rows + "\"value ='"+DataValue+"'  disabled class=\"ClientTableflateditbox\" onFocus=\"getFocusPOS(this);this.style.background='#66FFFF'" + strfocus + ";this.select()\" onBlur=\"this.style.background='#ffffff'\" " + this.editkeydown + " onchange=\"" + this.ob + ".Refresh(" + this.rows + "," + i + ",1)\" " + temp + " value=" + DataValue + ">";
												}
											}
										}	
										else{
											if( isGridDisabled == false){
												ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" id=\"" + this.ColEditName[i] + this.rows + "\" value ='"+DataValue+"' class=\"ClientTableflateditbox\" onFocus=\"getFocusPOS(this);this.style.background='#66FFFF'" + strfocus + ";this.select()\" onBlur=\"this.style.background='#ffffff';" + this.ob + ".Refresh(" + this.rows + "," + i + ",1)\"" + this.editkeydown + " onchange=\"" + this.ob + ".Refresh(" + this.rows + "," + i + ",1)\" " + temp + " value=" +DataValue + ">";
											}
											else{
												//手工指定法下审核双击选批次
												if( this.ColEditName[i] == "Qty_Edit" ||this.ColEditName[i] == "OQty_Edit" ){
													ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" id=\"" + this.ColEditName[i] + this.rows + "\" value ='"+DataValue+"'  readonly class=\"ClientTableflateditbox\" onFocus=\"getFocusPOS(this);this.style.background='#66FFFF'" + strfocus + ";this.select()\" onBlur=\"this.style.background='#ffffff';" + this.ob + ".Refresh(" + this.rows + "," + i + ",1)\"" + this.editkeydown + " onchange=\"" + this.ob + ".Refresh(" + this.rows + "," + i + ",1)\" " + temp + " value=" + DataValue + ">";
												}
												else{
													ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" id=\"" + this.ColEditName[i] + this.rows + "\" value ='"+DataValue+"'  disabled class=\"ClientTableflateditbox\" onFocus=\"getFocusPOS(this);this.style.background='#66FFFF'" + strfocus + ";this.select()\" onBlur=\"this.style.background='#ffffff';" + this.ob + ".Refresh(" + this.rows + "," + i + ",1)\"" + this.editkeydown + " onchange=\"" + this.ob + ".Refresh(" + this.rows + "," + i + ",1)\" " + temp + " value=" + DataValue + ">";
												}
											}
										}
									}
								}
							}
						}
						else{							//原始单据
							var ColEditName_temp = this.ColEditName[i];
							if ( this.InDisableCols(i) ) {
								/////3.66 修改过  "序列号中有空格的问题 "  后面拼错了
								if ( this.ColEditName[i] == "Serial_Edit" ){
									if( isGridDisabled == false){
										ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" class=\"ClientTableflateditbox\" readonly value='" + DataValue + "' " + temp + "><input type=\"hidden\" name=\"SerialIn" + this.rows + "\" value=\""+DataValue+"\" >";
									}
									else{
										ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" class=\"ClientTableflateditbox\" disabled value='" +  DataValue + "' " + temp + "><input type=\"hidden\" name=\"SerialIn" + this.rows + "\" value=\""+DataValue+"\" >";
									}
								}
								else if ( this.ColEditName[i] == "SerialSel_Edit" ) {
									if( isGridDisabled == false){
										ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" class=\"ClientTableflateditbox\" readonly value='" +  DataValue + "' " + temp + "><input type=\"hidden\" name=\"SerialOut" + this.rows + "\" value=\""+DataValue+"\" >";
									}
									else{
										ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" class=\"ClientTableflateditbox\" disabled value='" + DataValue + "' " + temp + "><input type=\"hidden\" name=\"SerialOut" + this.rows + "\" value=\""+DataValue+"\" >";
									}
								}
								else if ( this.ColEditName[i] == "ISerialSel_Edit" ) {
									if( isGridDisabled == false){
										ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" class=\"ClientTableflateditbox\" readonly value='" +  DataValue + "' " + temp + "><input type=\"hidden\" name=\"ISerialOut" + this.rows + "\" value=\""+DataValue+"\" >";
									}
									else{
										ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" class=\"ClientTableflateditbox\" disabled value='" + DataValue + "' " + temp + "><input type=\"hidden\" name=\"ISerialOut" + this.rows + "\" value=\""+DataValue+"\" >";
									}
								}
								else if ( this.ColEditName[i] == "OSerialSel_Edit" ) {
									if( isGridDisabled == false){
										ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" class=\"ClientTableflateditbox\" readonly value='" +  DataValue + "' " + temp + "><input type=\"hidden\" name=\"OSerialOut" + this.rows + "\" value=\""+DataValue+"\" >";
									}
									else{
										ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" class=\"ClientTableflateditbox\" disabled value='" + DataValue + "' " + temp + "><input type=\"hidden\" name=\"OSerialOut" + this.rows + "\" value=\""+DataValue+"\" >";
									}
								}
								else{
									if( isGridDisabled == false){
										ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" class=\"ClientTableflateditbox\" readonly onFocus=\"this.style.background='#66FFFF';this.select()\" onBlur=\"this.style.background='#ffffff'\"  value='" + DataValue + "' " + temp + ">";
									}
									else{
										ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + this.ColEditName[i] + this.rows + "\" class=\"ClientTableflateditbox\" disabled value='" + DataValue + "' " + temp + ">";
									}
								}
								if ( this.Disable ) {	
									if ( this.ColEditName[i] == "SerialSel_Edit" || this.ColEditName[i] == "Serial_Edit" ||  this.ColEditName[i] == "ISerialSel_Edit" || this.ColEditName[i] == "OSerialSel_Edit" ) {
										if ( this.ColEditName[i] == "SerialSel_Edit" ) {		
											if ( document.all("SerialOut" + row).value != "" )
												document.all(this.ColEditName[i] + row).value = "√";
										}
										if ( this.ColEditName[i] == "ISerialSel_Edit" ) {		
											if ( document.all("ISerialOut" + row).value != "" )
												document.all(this.ColEditName[i] + row).value = "√";
										}
										if ( this.ColEditName[i] == "OSerialSel_Edit" ) {		
											if ( document.all("OSerialOut" + row).value != "" )
												document.all(this.ColEditName[i] + row).value = "√";
										}
										if ( this.ColEditName[i] == "Serial_Edit" ) {
											if ( document.all("SerialIn" + row).value != "" )
												document.all(this.ColEditName[i] + row).value = "√";
										}
									}
								}	
							}
							else {
								//strfocus = ";SetRowCol('" + this.ob + "'," + this.rows + "," + i + ")";
								if ( !this.InNumericCols(i) ) { // 非数据列
									if ( this.InLocalUpdateCol(i) ){
					
											ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + ColEditName_temp + this.rows + "\" id=\"" + this.ColEditName[i] + this.rows + "\" value ='"+DataValue+"' readonly  onFocus=\"getFocusPOS(this);this.style.background='#66FFFF';this.select()\" onBlur=\"this.style.background='#ffffff'\"   class=\"ClientTableflateditbox\"   >";
										
									}
									else{
										if ( ColEditName_temp == "Base_Edit" || ColEditName_temp == "IBase_Edit" || ColEditName_temp == "OBase_Edit"){ //备注检验非法字符

												ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + ColEditName_temp + this.rows + "\" id=\"" + ColEditName_temp + this.rows + "\" value ='"+DataValue+"' readonly class=\"ClientTableflateditbox\"  maxlength=125>";
										}
										else{
												ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + ColEditName_temp + this.rows + "\" id=\"" + ColEditName_temp + this.rows + "\" value ='"+DataValue+"' readonly class=\"ClientTableflateditbox\"   maxlength=125>";		
										}
									}
								}
								else {	// 数据列
									if ( this.id == 0 ){ //成本调价单全部仓库调价Grid特殊处理，添加行时数量只读
										if (  parent.VCH_HEAD.document.all.chkAllStock != null ){					
											if ( parent.VCH_HEAD.document.all.chkAllStock.checked == true && this.ColEditName[i] == "Qty_Edit" ){
													ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + ColEditName_temp + this.rows + "\" id=\"" + ColEditName_temp + this.rows + "\" value ='"+DataValue+"' readonly class=\"ClientTableflateditbox\"  >";
											}
											else{
													ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + ColEditName_temp + this.rows + "\" id=\"" + ColEditName_temp + this.rows + "\" value ='"+DataValue+"' readonly class=\"ClientTableflateditbox\" >";
											}
										}
										else{
												ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + ColEditName_temp + this.rows + "\" id=\"" + ColEditName_temp + this.rows + "\" value ='"+DataValue+"' readonly class=\"ClientTableflateditbox\" >";
										}
									}
									else{ 
										if ( this.id != 17 ){
												if(this.ColEditName[i] == "Qty_Edit"){
													ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + ColEditName_temp + this.rows + "\" id=\"" + ColEditName_temp + this.rows + "\" value ='"+DataValue+"'  readonly class=\"ClientTableflateditbox\" >";
												}
												else{
													ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + ColEditName_temp + this.rows + "\" id=\"" + ColEditName_temp + this.rows + "\"value ='"+DataValue+"'  readonly class=\"ClientTableflateditbox\" >";
												}
										}	
										else{
												ocell.innerHTML = "<input type=\"text\" style=\"width:100%\" name=\"" + ColEditName_temp + this.rows + "\" id=\"" + ColEditName_temp + this.rows + "\" value ='"+DataValue+"' readonly class=\"ClientTableflateditbox\" >";
										}
									}
								}
							}
						}				
					}	
				}
			}
			
			if ( !this.Disable ) {
				//ocell = orow.insertCell();
				ocell = document.createElement("td");
				orow.appendChild(ocell);
				
				temp = "";	
				for ( j = 0; j < this.HiddenArray.length; ) {
					if ( typeof(this.Data[(row-1)*this.GetDataCols() + i - 1 + j/2]) != 'undefined' ) {		
						if ( this.Data[(row-1)*this.GetDataCols() + i - 1 + j/2] != ''  ) {				
							temp +=  "<input type=\"hidden\" name=\"" + this.HiddenArray[j] + this.rows + "\" value=\"" +  this.Data[(row-1)*this.GetDataCols() + i - 1 + j/2] + "\">";			//尹毅 2006.6.5 提速
							//temp = temp + "<input type=\"hidden\" name=\"" + this.HiddenArray[j] + this.rows + "\" value=\"" +  this.Data[(row-1)*this.GetDataCols() + i - 1 + j/2] + "\">";
						}
						else{
							temp +=  "<input type=\"hidden\" name=\"" + this.HiddenArray[j] + this.rows + "\" value=\"" + this.HiddenArray[j+1] + "\">";
						}
					}
					else{
						temp +=  "<input type=\"hidden\" name=\"" + this.HiddenArray[j] + this.rows + "\" value=\"" + this.HiddenArray[j+1] + "\">";
						//temp = temp + "<input type=\"hidden\" name=\"" + this.HiddenArray[j] + this.rows + "\" value=\"" + this.HiddenArray[j+1] + "\">";
					}
					j = j + 2;
				}
				if ( !(this.specialproperty == "RF" || this.specialproperty == "CF") )	//出入货位不允许删除
					temp +=  "<img src=\"../Common/NDELETE.gif\" width=\"16\" height=\"16\" style=\"cursor:hand\" onmouseover='this.src=ImageB.src' onmouseout='this.src=ImageA.src' onclick=\"" + this.ob + ".DeleteRow(" + this.rows + ")\">";
					//temp = temp + "<img src=\"../Common/NDELETE.gif\" width=\"16\" height=\"16\" style=\"cursor:hand\" onmouseover='this.src=ImageB.src' onmouseout='this.src=ImageA.src' onclick=\"" + this.ob + ".DeleteRow(" + this.rows + ")\">";
				ocell.innerHTML = temp;
				ocell.bgColor = this.TDBGCOLOR;
				ocell.title = "删除本行";
			}

			for(var i=0;i<DisplayCols_num;i++)
			{
				orow.cells[DisplayCols[i]].style.display = "none";		// 尹毅 2006.6.5 不显示列
			}
			if ( typeof(SetBillColsDisplay) == "function" ){//添加行单据列控制
				SetBillColsDisplay();
			}
			if ( typeof(SetBillColsDisplayIn) == "function" ){//添加行单据列控制
				SetBillColsDisplayIn();
			}
			if ( typeof(SetBillColsDisplayOut) == "function" ){//添加行单据列控制
				SetBillColsDisplayOut();
			}

			/*
			if ( ( this.id == 12 || this.id == 14 || this.id == 16  ) && document.all("Qty_Edit" + row).value != "" ){
				//调订单是计算
				if (isLoadOrder == 1){ 
					//this.Refresh(row,8,0);
					if ( this.id == 14 ){ //采购入库单扣率格式
						var r,m,q,t,v;		
						r = document.all("Price_Edit" + row).value;
						q = document.all("Qty_Edit" + row).value;
						// 有预设价
						if ( !isNaN(parseFloat(r)) && parseFloat(r) != 0 ) {
							m = document.all("NoDiscountTotal_Edit" + row);
							// 税前金额
							m.value = this.FormatCol(q * r,12);
							// 检查税后单价
							m = document.all("DiscountPrice_Edit" + row);
							t = document.all("Discount_Edit" + row).value;
							// 税后单价
							v = this.FormatCol(r * t,14);
							m.value = v;
							m = document.all("Total_Edit" + row);
							// 税后金额
							m.value = this.FormatCol(q * v,15);		
						}
					}
					if ( this.id == 12 ){ //采购入库单税率格式
						var r,m,q,t,v;		
						r = document.all("Price_Edit" + row).value;
						q = document.all("Qty_Edit" + row).value;
						// 有预设价
						if ( !isNaN(parseFloat(r)) && parseFloat(r) != 0 ) {
							m = document.all("NoTaxTotal_Edit" + row);
							m.value = q * r
							// 税前金额
							if ( this.id == 2 )
								m.value = this.FormatCol(m.value,13);
							else
								m.value = this.FormatCol(m.value,12);
							// 检查税后单价
							m = document.all("TaxPrice_Edit" + row);
							t = document.all("TaxRate_Edit" + row).value;
							// 税后单价
							v = this.FormatCol(r * (1 + t/100),14);
							m.value = v;
							m = document.all("Total_Edit" + row);
							// 税后金额
							m.value = this.FormatCol(q * v,15);		
						}
					}
				}
			}	
			*/	
	}
	////////////////////////////////////尹毅 2006.5.16 增加函数addrowdata 作为addrow,loadrow的合并函数,提高录入速

	// Create The Grid Table
	function Create() {
		var i, j, rowcount, html, r;
		var keyup;

		var intIfDisplayCols;
		intIfDisplayCols = 1

		// 第二个参数 数据
		// 第一个参数 行数
		if ( arguments[2] != null )	// 第三个参数 禁止
			this.Disable = arguments[2];

		if ( arguments[3] != null )	// 第四个参数 局部更新
			this.bLocalUpdate = arguments[3];

		if ( arguments[4] != null )	// 第五个参数 列的初始值
			this.IniColValues = arguments[4];

		if ( arguments[5] != null )	// 第六个参数 局部更新时模糊查找回调的函数 f(type,Value);
			this.blurSearch = arguments[5];

		if ( arguments[6] != null )	// 第七个参数树型查找的回调函数
			this.TreeSearch = arguments[6];

		if ( arguments[7] != null )	// 第八个参数销售单价格选择回调函数
			this.Condition = arguments[7];
			
		if ( arguments[8] != null )	// 第九个参数鼠标双击回调函数
			this.dbClick = arguments[8];

		if ( arguments[9] != null )
			this.HiddenColsArray = arguments[9];

		if ( arguments[10] != null )
			this.GridSpecial = arguments[10];

		this.Init();

		if ( this.cols - 1 == 0 ) return;

		rowcount = arguments[0];	// 第一个参数为行数
		
		this.intGridLines=rowcount; //尹毅 2006.5.15 增加默认显示行数
		if ( isNaN(parseInt(rowcount)) ) rowcount = 10;
		else rowcount = parseInt(rowcount);

		r = 0;

		if ( arguments[1] != null ) {	// 第二个参数为数据
			r = parseInt(arguments[1].length/(this.cols-1));
			if ( arguments[1].length/(this.cols-1) != parseInt(arguments[1].length/(this.cols-1)))
				r += 1;
		}
		rowcount = rowcount>r?rowcount:r;
		
		this.editChange = "onChange=\"CallLocalUpdate(this,"+this.ob+")\"";
		//this.editkeydown="onkeydown=\"MoveLeftRightCursor(document.all." + this.name + ",'" + this.ob + ".AddRow()'";
		this.editkeydown = "onkeydown=\"MoveLeftRightCursor(document.all." + this.name + ",'" + this.ob + "','" + this.ob + ".AddRow()','" + this.cols + "','" + this.ColEditName + "','" + this.HiddenArray + "'";
		keyup = "onkeydown=\"MoveUpDownCursor(this";
		for ( i = 1; i < this.cols; i++ ) {	// 跳过第一列
			if ( !this.InDisableCols(i) ) {
				// 若为隐含列，则键盘响应列名不加入 MoveUpDownCursor 函数的参数数组
				for ( j = 1; j < this.HiddenColsArray.length; j++ ) {
					if ( this.ColEditName[i] == this.HiddenColsArray[j] ) {
						intIfDisplayCols = 0;
						break;
					}
					else
						intIfDisplayCols = 1;
				}
				if ( intIfDisplayCols == 1 ) {
					keyup = keyup + ",'" + this.ColEditName[i] + "'";
					this.editkeydown = this.editkeydown + ",'" + this.ColEditName[i] + "'";
				}
			}
		}
		this.editkeydown = this.editkeydown + ")\""

		if ( keyup == "onkeyup=\"MoveUpDownCursor(this") {
			html = "<table nowrap id=\"" + this.name + "\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\" BGCOLOR=\"" + this.BGCOLOR + "\">" + this.TitleRow + this.SumRow + "</table>";
		}
		else {
			keyup = keyup + ")\"";
			html = "<table nowrap id=\"" + this.name + "\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\" BGCOLOR=\"" + this.BGCOLOR + "\" " + keyup + ">" + this.TitleRow + this.SumRow + "</table>";
		}

		//document.body.insertAdjacentHTML("afterBegin",html);
		if ( this.GridSpecial == "1" ) {
			document.body.insertAdjacentHTML("BeforeEnd",html);
		}
		else {
			document.body.insertAdjacentHTML("afterBegin",html);
		}
		
		for ( i = 1; i <= rowcount; i++ ) {
			this.AddRow();
		}
		
		// 参数 2 传递是要装入到表格的数据
		if ( arguments[1] != null) this.LoadData(arguments[1]);
		//单据GRID帧中单据生成完毕标识 2004－4－17 徐辉添加
		if ( document.all("hdnIfLoadOver") != null ){
			document.all("hdnIfLoadOver").value = 1;
		}
	}

	// Get The Coordinate In The Explorer's Position
	function getFocusPOS(htmlObj){
		var ArrayCoordinate  = {x:0,y:0};			// 坐标数组
		do {
			ArrayCoordinate.x += htmlObj.offsetLeft;	// 获得对象相对于上级 ( 父 ) 对象的位置坐标
			ArrayCoordinate.y += htmlObj.offsetTop;
			htmlObj = htmlObj.offsetParent;			// 上传到上级（父）对象
		} while(htmlObj)
		if ( screen.width == 800 ) {
			if ( parseInt(ArrayCoordinate.x) >= 550 ) {
				if ( parseInt(ArrayCoordinate.y) >= 200 ) {
					window.scroll(10000,parseInt(ArrayCoordinate.y) + 50);
				}
				else {
					window.scroll(10000,0);
				}
			}
			if ( parseInt(ArrayCoordinate.x) <= 200 ) {
				if ( parseInt(ArrayCoordinate.y) >= 200 ) {
					window.scroll(0,parseInt(ArrayCoordinate.y) + 50);
				}
				else {
					window.scroll(0,0);
				}
			}
		}
		else {
			if ( parseInt(ArrayCoordinate.x) >= 750 ) {
				if ( parseInt(ArrayCoordinate.y) >= 350 ) {
					window.scroll(10000,parseInt(ArrayCoordinate.y) + 50);
				}
				else {
					window.scroll(10000,0);
				}
			}
			if ( parseInt(ArrayCoordinate.x) <= 300 ) {
				if ( parseInt(ArrayCoordinate.y) >= 350 ) {
					window.scroll(0,parseInt(ArrayCoordinate.y) + 50);
				}
				else {
					window.scroll(0,0);
				}
			}
		}
	}
	// 鼠标双击函数处理双单位,序列号，数量上双击选择批次
	function MouseDbClick(obj, row, col) {
		var temp
		if ( event != null ){
			temp = event.srcElement.name;
		}
		else {
			//手工指定法，选择商品弹出批次选择框V4.0
			if ( document.all.hdnBillType != null ){
				//以下单据才弹出批次选择窗体（销售出库单、销售换货单出库、委托代销发货单、受托代销退货、零售单、赠送单、同价调拨单、变价调拨单、报损单、成本调价单、生产拆装单、采购退货单、采购换货出库、维修受理单）
				if ( document.all.hdnBillType.value == "11" ||document.all.hdnBillType.value == "160" ||document.all.hdnBillType.value == "140" || document.all.hdnBillType.value == "146" ||
					document.all.hdnBillType.value == "305" ||document.all.hdnBillType.value == "139" ||document.all.hdnBillType.value == "17" ||document.all.hdnBillType.value == "21" ||
					document.all.hdnBillType.value == "9" ||document.all.hdnBillType.value == "57" ||document.all.hdnBillType.value == "16" ||document.all.hdnBillType.value == "6" ||document.all.hdnBillType.value == "161" ||document.all.hdnBillType.value == "157" ){
					if ( obj == "GridOut" ){
						temp =  "OQty_Edit"+row.toString();
					}
					if ( obj == "Grid" ){
						temp =  "Qty_Edit"+row.toString();
					}
					if ( obj == "GridIn" ){
						temp =  "IQty_Edit"+row.toString();
						return;
					}
				}
				else{
					return;
				}
			}
			else{
				return;
			}
		}
		
		//审核通过标志，处理审核后单据序列号需要
		var isGridDisabled;
		isGridDisabled = 0;
		if( document.all("hdnGridReadOnly") != null ){
			ishdnGridReadOnly =  document.all("hdnGridReadOnly").value;
					
			if ((ishdnGridReadOnly == 1) && (ishdnGridReadOnly !="''")){
				isGridDisabled = 1;
			}
			else{
				isGridDisabled = 0;
			}
		}
		
		if ( temp.substr(0, 11) == "Serial_Edit" ) {
			if ( document.all.hdnBillType != null ) { //(排除货位分配单,货分单另有方式)
				if ( document.all.hdnBillType.value == "152" || document.all.hdnBillType.value == "153" )
					return false;
			}
			if ( document.all("Serial_Edit" + row).readOnly == false ) {
				if ( document.all("SerialIn" + row).value == "" ) {
					alert("【系统提示】\n\n您还没有录入任何序列号，请确认后重试！	\n");
					return false;
				}
				if ( obj == "GridIn" )
					WindowOpenURL( '../VCH/DealSerial.asp?Type=CIn&row=' + row + '&isGridDisabled='+isGridDisabled, '500', '380', 'DealSerialInWin' )
				else
					WindowOpenURL( '../VCH/DealSerial.asp?Type=In&row=' + row + '&isGridDisabled='+isGridDisabled, '500', '380', 'DealSerialInWin' )
				return false;
			}
			else {
				if ( document.all("SerialIn" + row).value != "" ) {
					if ( obj == "GridIn" )
						WindowOpenURL( '../VCH/DealSerial.asp?Type=CIn&row=' + row + '&isGridDisabled='+isGridDisabled, '500', '380', 'DealSerialInWin' )
					else
						WindowOpenURL( '../VCH/DealSerial.asp?Type=In&row=' + row + '&isGridDisabled='+isGridDisabled, '500', '380', 'DealSerialInWin' )
				}
				return false;
			}
		}
		if ( temp.substr(0, 14) == "SerialSel_Edit" ) {
			if ( document.all.hdnBillType != null ) { //(排除货位分配单,货分单另有方式)
				if ( document.all.hdnBillType.value == "152" || document.all.hdnBillType.value == "153" )
					return false;
			}
			if ( document.all("SerialSel_Edit" + row).readOnly == false ) {
				if ( document.all("SerialOut" + row).value == "" ) {
					alert("【系统提示】\n\n您还没有录入任何序列号，请确认后重试！	\n");
					return false;
				}
				if ( obj == "GridOut" )
					WindowOpenURL( '../VCH/DealSerial.asp?Type=COut&row=' + row + '&isGridDisabled='+isGridDisabled, '500', '380', 'DealSerialOutWin' )
				else
					WindowOpenURL( '../VCH/DealSerial.asp?Type=Out&row=' + row + '&isGridDisabled='+isGridDisabled, '500', '380', 'DealSerialOutWin' )
				return false;
			}
			else {
				if ( document.all("SerialOut" + row).value != "" ) {
					if ( obj == "GridOut" )
						WindowOpenURL( '../VCH/DealSerial.asp?Type=COut&row=' + row + '&isGridDisabled='+isGridDisabled, '500', '380', 'DealSerialOutWin' )
					else{
						WindowOpenURL( '../VCH/DealSerial.asp?Type=Out&row=' + row + '&isGridDisabled='+isGridDisabled, '500', '380', 'DealSerialOutWin' )
						}
				}
				return false;
			}
		}
		
		if ( temp.substr(0, 15) == "ISerialSel_Edit" ) { //销售换货单 入库
			if ( document.all("ISerialSel_Edit" + row).readOnly == false ) {
				if ( document.all("ISerialOut" + row).value == "" ) {
					alert("【系统提示】\n\n您还没有录入任何序列号，请确认后重试！	\n");
					return false;
				}
				WindowOpenURL( '../VCH/DealSerial.asp?Type=TIn&row=' + row + '&isGridDisabled='+isGridDisabled, '500', '380', 'DealSerialOutWin' )
				return false;
			}
			else {
				if ( document.all("ISerialOut" + row).value != "" ) {
					WindowOpenURL( '../VCH/DealSerial.asp?Type=TIn&row=' + row + '&isGridDisabled='+isGridDisabled, '500', '380', 'DealSerialOutWin' )
				}
				return false;
			}
		}
		
		if ( temp.substr(0, 15) == "OSerialSel_Edit" ) { //销售换货单 出库
			if ( document.all("OSerialSel_Edit" + row).readOnly == false ) {
				if ( document.all("OSerialOut" + row).value == "" ) {
					alert("【系统提示】\n\n您还没有录入任何序列号，请确认后重试！	\n");
					return false;
				}
				WindowOpenURL( '../VCH/DealSerial.asp?Type=TOut&row=' + row + '&isGridDisabled='+isGridDisabled, '500', '380', 'DealSerialOutWin' )
				return false;
			}
			else {
				if ( document.all("OSerialOut" + row).value != "" ) {
					WindowOpenURL( '../VCH/DealSerial.asp?Type=TOut&row=' + row + '&isGridDisabled='+isGridDisabled, '500', '380', 'DealSerialOutWin' )
				}
				return false;
			}
		}
		
		if ( temp.substr(0, 8) == "Qty_Edit" || temp.substr(0, 9) == "OQty_Edit" ) {
			if ( top.LocalValue != null ){
				if ( top.LocalValue.SystemCosting != null ){
					if ( top.LocalValue.SystemCosting != "3" ){
						return false;//手工指定法才处理
					}
				}
			}
			
			if( temp.substr(0, 9) == "OQty_Edit" ){//原始单据不处理
				if( document.all("OUserCode_Edit" + row).readOnly == true ){
					return false;
				}
			}
			if( temp.substr(0, 8) == "Qty_Edit" ){//原始单据不处理
				if( document.all("UserCode_Edit" + row).readOnly == true ){
					return false;
				}
			}
			 
			var billtype;
			//委托受托代销结算，委托受托代销调价，销售退货，委托代销退货 生产日期，效期至，批号不显示，屏蔽掉！ 2007－4－18 徐辉
			if ( document.all.hdnBillType != null ){
				billtype = document.all.hdnBillType.value;
				if ( document.all.hdnBillType.value == "141" || document.all.hdnBillType.value == "143" || document.all.hdnBillType.value == "145" || document.all.hdnBillType.value == "147" || document.all.hdnBillType.value == "45" || document.all.hdnBillType.value == "142"){
					return;
				}
			}
			else{
				billtype = "";
			}
			
			if ( document.all.hdnBillType != null ){
				if ( document.all.hdnBillType.value == "157" ){ //维修受理单特殊处理
					if ( document.all.stockout_edit != null ){
						if ( document.all("OUserCode_Edit" + row) != null ){
							var SelectGoodsNumber = new Array;
							if ( document.all("OUserCode_Edit"+row).value == "" ){
								return;
							}
							if ( document.all.stockout_edit.value == "" ){
								alert("【系统提示】\n\n 选择出库仓库才能选择批次！");
								return;
							}
							var re = showModalDialog('../VCH/SelectGoodsNumber.asp?TimeCheckPoint=' + GetTimeCheckPoint('','') + '&KFullName=' + document.all.stockout_edit.value + '&PUserCode=' + document.all("OUserCode_Edit"+row).value+ '&billtype=' + billtype,SelectGoodsNumber,'center:1;dialogHeight:380px;dialogWidth:500px;help:0;status:0');
							if( re == 1 ){
								document.all("OProduceDate_Edit" + row).value=SelectGoodsNumber.szProduceDate;
								document.all("OValidDate_Edit" + row).value=SelectGoodsNumber.szValidDate;
								document.all("OGoodsNumber_Edit" + row).value=SelectGoodsNumber.szGoodsNumber;
								document.all("OGoodsNumberPrice" + row).value=SelectGoodsNumber.szPrice;
							}
							document.all(temp).focus();
							return false;
						}
					}
				}
			}
			
			if ( document.all.hdnBillType != null ){
				if ( document.all.hdnBillType.value == "17"  ){ //同价调拨单，手工指定法，单价处写入批次成本价
					if ( document.all.hdnSpecialproperty != null ){
						if ( document.all.hdnSpecialproperty.value == "CBDJ" ){
							if (  parent.VCH_HEAD.document.all.stockout_edit != null ){
								if ( document.all("UserCode_Edit" + row) != null ){
									var SelectGoodsNumber = new Array;
									if ( document.all("UserCode_Edit"+row).value == "" ){
										return;
									}
									if (  parent.VCH_HEAD.document.all.stockout_edit.value == "" ){
										alert("【系统提示】\n\n 选择出库仓库才能选择批次！");
										return;
									}
									var re = showModalDialog('../VCH/SelectGoodsNumber.asp?TimeCheckPoint=' + GetTimeCheckPoint('','') + '&KFullName=' +  parent.VCH_HEAD.document.all.stockout_edit.value + '&PUserCode=' + document.all("UserCode_Edit"+row).value+ '&billtype=' + billtype,SelectGoodsNumber,'center:1;dialogHeight:380px;dialogWidth:500px;help:0;status:0');
									if( re == 1 ){
										if ( document.all("hdnLimitCostPrice") != null ){ //是否有成本查看权限
											if ( document.all("hdnLimitCostPrice").value == "0" ){
												if( document.all("Price_Edit" + row) != null){
													document.all("Price_Edit" + row).value = "****";
													document.all("Total_Edit" + row).value = "****";
												}
											}
											else{
												if( document.all("Price_Edit" + row) != null){
													if( document.all("isUnitTow" + row).value == "1" ){//大单位
														document.all("Price_Edit" + row).value = Math.round(parseFloat(SelectGoodsNumber.szPrice) * parseFloat(document.all("UnitRate" + row).value) * 10000)/10000;
														if( !isNaN(document.all("Qty_Edit" + row).value) ){
															document.all("Total_Edit" + row).value = Math.round(document.all("Price_Edit" + row).value * document.all("Qty_Edit" + row).value *100)/100;
														}
													}
													else{//小单位
														document.all("Price_Edit" + row).value = parseFloat(SelectGoodsNumber.szPrice);
														if( !isNaN(document.all("Qty_Edit" + row).value) ){
															document.all("Total_Edit" + row).value = Math.round(document.all("Price_Edit" + row).value * document.all("Qty_Edit" + row).value *100)/100;
														}
													}
													eval(obj+".Sum()");
												}
											}
										}
										else{
											if( document.all("Price_Edit" + row) != null){
												if( document.all("isUnitTow" + row).value == "1" ){//大单位
													document.all("Price_Edit" + row).value = Math.round(parseFloat(SelectGoodsNumber.szPrice) * parseFloat(document.all("UnitRate" + row).value) * 10000)/10000;
													if( !isNaN(document.all("Qty_Edit" + row).value) ){
														document.all("Total_Edit" + row).value = Math.round(document.all("Price_Edit" + row).value * document.all("Qty_Edit" + row).value *100)/100;
													}
												}
												else{//小单位
													document.all("Price_Edit" + row).value = parseFloat(SelectGoodsNumber.szPrice);
													if( !isNaN(document.all("Qty_Edit" + row).value) ){
														document.all("Total_Edit" + row).value = Math.round(document.all("Price_Edit" + row).value * document.all("Qty_Edit" + row).value *100)/100;
													}
												}
												eval(obj+".Sum()");
											}
										}
										document.all("ProduceDate_Edit" + row).value=SelectGoodsNumber.szProduceDate;
										document.all("ValidDate_Edit" + row).value=SelectGoodsNumber.szValidDate;
										document.all("GoodsNumber_Edit" + row).value=SelectGoodsNumber.szGoodsNumber;
										document.all("GoodsNumberPrice" + row).value=SelectGoodsNumber.szPrice;
									}
									document.all(temp).focus();
									return false;
								}
							}
						}
					}
				}
			}
			
			if ( document.all.hdnBillType != null ){
				if ( document.all.hdnBillType.value == "9"  ){ //报损单，手工指定法，单价处写入批次成本价(开单时已经隐藏单价、金额列，原始单价才显示。可以不对计算处理了xuhui2007-7-5)
						if ( document.all("UserCode_Edit" + row) != null ){
								var SelectGoodsNumber = new Array;
								if ( document.all("UserCode_Edit"+row).value == "" ){
									return;
								}
								if (  parent.VCH_HEAD.document.all.stockout_edit.value == "" ){
									alert("【系统提示】\n\n 选择出库仓库才能选择批次！");
									return;
								}
								var re = showModalDialog('../VCH/SelectGoodsNumber.asp?TimeCheckPoint=' + GetTimeCheckPoint('','') + '&KFullName=' +  parent.VCH_HEAD.document.all.stockout_edit.value + '&PUserCode=' + document.all("UserCode_Edit"+row).value+ '&billtype=' + billtype,SelectGoodsNumber,'center:1;dialogHeight:380px;dialogWidth:500px;help:0;status:0');
								if( re == 1 ){
									if ( document.all("hdnLimitCostPrice") != null ){ //是否有成本查看权限
										if ( document.all("hdnLimitCostPrice").value == "0" ){
											if( document.all("Price_Edit" + row) != null){
												document.all("Price_Edit" + row).value = "****";
												document.all("Total_Edit" + row).value = "****";
											}
										}
										else{
											if( document.all("Price_Edit" + row) != null){
												document.all("Price_Edit" + row).value = parseFloat(SelectGoodsNumber.szPrice);
												if( !isNaN(document.all("Qty_Edit" + row).value) ){
													document.all("Total_Edit" + row).value = Math.round(document.all("Price_Edit" + row).value * document.all("Qty_Edit" + row).value *100)/100;
												}
											}
											eval(obj+".Sum()");
										}
									}
									else{
										if( document.all("Price_Edit" + row) != null){
											document.all("Price_Edit" + row).value = parseFloat(SelectGoodsNumber.szPrice);
											if( !isNaN(document.all("Qty_Edit" + row).value) ){
												document.all("Total_Edit" + row).value = Math.round(document.all("Price_Edit" + row).value * document.all("Qty_Edit" + row).value *100)/100;
											}
											eval(obj+".Sum()");
										}
									}
									document.all("ProduceDate_Edit" + row).value=SelectGoodsNumber.szProduceDate;
									document.all("ValidDate_Edit" + row).value=SelectGoodsNumber.szValidDate;
									document.all("GoodsNumber_Edit" + row).value=SelectGoodsNumber.szGoodsNumber;
									document.all("GoodsNumberPrice" + row).value=SelectGoodsNumber.szPrice;
								}
								document.all(temp).focus();
								return false;
							}
					}
			}
			
			if ( document.all.hdnBillType != null ){
				if ( document.all.hdnBillType.value == "14"  ){ //报溢单，手工指定法，单价处写入批次成本价(开单时已经隐藏单价、金额列，原始单价才显示。可以不对计算处理了xuhui2007-7-5)
						if ( document.all("UserCode_Edit" + row) != null ){
								var SelectGoodsNumber = new Array;
								if ( document.all("UserCode_Edit"+row).value == "" ){
									return;
								}
								if (  parent.VCH_HEAD.document.all.stockin_edit.value == "" ){
									alert("【系统提示】\n\n 选择出库仓库才能选择批次！");
									return;
								}
								var re = showModalDialog('../VCH/SelectGoodsNumber.asp?TimeCheckPoint=' + GetTimeCheckPoint('','') + '&KFullName=' +  parent.VCH_HEAD.document.all.stockin_edit.value + '&PUserCode=' + document.all("UserCode_Edit"+row).value+ '&billtype=' + billtype,SelectGoodsNumber,'center:1;dialogHeight:380px;dialogWidth:500px;help:0;status:0');
								if( re == 1 ){
									if ( document.all("hdnLimitCostPrice") != null ){ //是否有成本查看权限
										if ( document.all("hdnLimitCostPrice").value == "0" ){
											if( document.all("Price_Edit" + row) != null){
												document.all("Price_Edit" + row).value = "****";
												document.all("Total_Edit" + row).value = "****";
											}
										}
										else{
											if( document.all("Price_Edit" + row) != null){
												document.all("Price_Edit" + row).value = parseFloat(SelectGoodsNumber.szPrice);
												if( !isNaN(document.all("Qty_Edit" + row).value) ){
													document.all("Total_Edit" + row).value = Math.round(document.all("Price_Edit" + row).value * document.all("Qty_Edit" + row).value *100)/100;
												}
												eval(obj+".Sum()");
											}
										}
									}
									else{
										if( document.all("Price_Edit" + row) != null){
											document.all("Price_Edit" + row).value = parseFloat(SelectGoodsNumber.szPrice);
											if( !isNaN(document.all("Qty_Edit" + row).value) ){
												document.all("Total_Edit" + row).value = Math.round(document.all("Price_Edit" + row).value * document.all("Qty_Edit" + row).value *100)/100;
											}
											eval(obj+".Sum()");
										}
									}
									document.all("ProduceDate_Edit" + row).value=SelectGoodsNumber.szProduceDate;
									document.all("ValidDate_Edit" + row).value=SelectGoodsNumber.szValidDate;
									document.all("GoodsNumber_Edit" + row).value=SelectGoodsNumber.szGoodsNumber;
									document.all("GoodsNumberPrice" + row).value=SelectGoodsNumber.szPrice;
								}
								document.all(temp).focus();
								return false;
							}
					}
			}
			
			if ( document.all.hdnBillType != null ){
				if ( document.all.hdnBillType.value == "16"  ){ //生产拆装单出库，手工指定法，单价处写入批次成本价
						if ( document.all("OUserCode_Edit" + row) != null ){
								var SelectGoodsNumber = new Array;
								if ( document.all("OUserCode_Edit"+row).value == "" ){
									return;
								}
								if (  parent.VCH_HEAD.document.all.stockout_edit.value == "" ){
									alert("【系统提示】\n\n 选择出库仓库才能选择批次！");
									return;
								}
								var re = showModalDialog('../VCH/SelectGoodsNumber.asp?TimeCheckPoint=' + GetTimeCheckPoint('','') + '&KFullName=' +  parent.VCH_HEAD.document.all.stockout_edit.value + '&PUserCode=' + document.all("OUserCode_Edit"+row).value+ '&billtype=' + billtype,SelectGoodsNumber,'center:1;dialogHeight:380px;dialogWidth:500px;help:0;status:0');
								if( re == 1 ){
									if ( document.all("hdnLimitCostPrice") != null ){ //是否有成本查看权限
										if ( document.all("hdnLimitCostPrice").value == "0"  && document.all("hdnCheckCostDisplay").value == "0" ){
											if( document.all("OPrice_Edit" + row) != null){
												document.all("OPrice_Edit" + row).value = "****";
												document.all("OTotal_Edit" + row).value = "****";
											}
										}
										else{
											if( document.all("OPrice_Edit" + row) != null){
												document.all("OPrice_Edit" + row).value = parseFloat(SelectGoodsNumber.szPrice);
												if( !isNaN(document.all("OQty_Edit" + row).value) ){
													document.all("OTotal_Edit" + row).value = Math.round(document.all("OPrice_Edit" + row).value * document.all("OQty_Edit" + row).value *100)/100;
												}
												eval(obj+".Sum()");
											}
										}
									}
									else{
										if( document.all("OPrice_Edit" + row) != null){
											document.all("OPrice_Edit" + row).value = parseFloat(SelectGoodsNumber.szPrice);
											if( !isNaN(document.all("OQty_Edit" + row).value) ){
												document.all("OTotal_Edit" + row).value = Math.round(document.all("OPrice_Edit" + row).value * document.all("OQty_Edit" + row).value *100)/100;
											}
											eval(obj+".Sum()");
										}
									}
									
									document.all("OProduceDate_Edit" + row).value=SelectGoodsNumber.szProduceDate;
									document.all("OValidDate_Edit" + row).value=SelectGoodsNumber.szValidDate;
									document.all("OGoodsNumber_Edit" + row).value=SelectGoodsNumber.szGoodsNumber;
									document.all("OGoodsNumberPrice" + row).value=SelectGoodsNumber.szPrice;
								}
								document.all(temp).focus();
								return false;
							}
					}
			}
			
			if ( parent.VCH_HEAD.stock_edit != null ){
				var SelectGoodsNumber = new Array;
				if ( document.all("UserCode_Edit"+row).value == "" ){
					return;
				}
				if ( parent.VCH_HEAD.stock_edit.value == "" ){
					alert("【系统提示】\n\n 选择出库仓库才能选择批次！");
					return;
				}
				var re = showModalDialog('../VCH/SelectGoodsNumber.asp?TimeCheckPoint=' + GetTimeCheckPoint('','') + '&KFullName=' + parent.VCH_HEAD.stock_edit.value + '&PUserCode=' + document.all("UserCode_Edit"+row).value+ '&billtype=' + billtype,SelectGoodsNumber,'center:1;dialogHeight:380px;dialogWidth:500px;help:0;status:0');
				if( re == 1 ){
					document.all("ProduceDate_Edit" + row).value=SelectGoodsNumber.szProduceDate;
					document.all("ValidDate_Edit" + row).value=SelectGoodsNumber.szValidDate;
					document.all("GoodsNumber_Edit" + row).value=SelectGoodsNumber.szGoodsNumber;
					document.all("GoodsNumberPrice" + row).value=SelectGoodsNumber.szPrice;
				}
				if ( document.all("hdnBillType") != null ){
					if ( (document.all("hdnBillType").value == "11" || document.all("hdnBillType").value == "305") && GetLocalVal("SaleDefault") == 1) {
						return false;
					}
					else{
						document.all(temp).focus();
						return false;
					}
				}
				else{
					document.all(temp).focus();
					return false;
				}
			}
			
			if ( parent.VCH_HEAD.stockout_edit != null ){
				var SelectGoodsNumber = new Array;
				if ( document.all("UserCode_Edit" + row) != null ){
					if ( document.all("UserCode_Edit"+row).value == "" ){
						return;
					}
					if ( parent.VCH_HEAD.stockout_edit.value == "" ){
						alert("【系统提示】\n\n 选择出库仓库才能选择批次！");
						return;
					}
					var re = showModalDialog('../VCH/SelectGoodsNumber.asp?TimeCheckPoint=' + GetTimeCheckPoint('','') + '&KFullName=' + parent.VCH_HEAD.stockout_edit.value + '&PUserCode=' + document.all("UserCode_Edit"+row).value+ '&billtype=' + billtype,SelectGoodsNumber,'center:1;dialogHeight:380px;dialogWidth:500px;help:0;status:0');
					if( re == 1 ){
						document.all("ProduceDate_Edit" + row).value=SelectGoodsNumber.szProduceDate;
						document.all("ValidDate_Edit" + row).value=SelectGoodsNumber.szValidDate;
						document.all("GoodsNumber_Edit" + row).value=SelectGoodsNumber.szGoodsNumber;
						document.all("GoodsNumberPrice" + row).value=SelectGoodsNumber.szPrice;
					}
					document.all(temp).focus();
					return false;
				}
				if ( document.all("OUserCode_Edit" + row) != null ){
					if ( document.all("OUserCode_Edit"+row).value == "" ){
						return;
					}
					if ( parent.VCH_HEAD.stockout_edit.value == "" ){
						alert("【系统提示】\n\n 选择出库仓库才能选择批次！");
						return;
					}
					var re = showModalDialog('../VCH/SelectGoodsNumber.asp?TimeCheckPoint=' + GetTimeCheckPoint('','') + '&KFullName=' + parent.VCH_HEAD.stockout_edit.value + '&PUserCode=' + document.all("OUserCode_Edit"+row).value+ '&billtype=' + billtype,SelectGoodsNumber,'center:1;dialogHeight:380px;dialogWidth:500px;help:0;status:0');
					if( re == 1 ){
						document.all("OProduceDate_Edit" + row).value=SelectGoodsNumber.szProduceDate;
						document.all("OValidDate_Edit" + row).value=SelectGoodsNumber.szValidDate;
						document.all("OGoodsNumber_Edit" + row).value=SelectGoodsNumber.szGoodsNumber;
						document.all("OGoodsNumberPrice" + row).value=SelectGoodsNumber.szPrice;
					}
					document.all(temp).focus();
					return false;
				}
			}
		}
		//选择批次结束
		
		//双击，单位切换,单grid
		if ( temp.substr(0, 9) == "Unit_Edit" ) {
			if ( document.all("IfSerial1") != null && document.all("Unit_Edit1") != null ) {
				if ( document.all("Unit_Edit" + row).disabled == true ) {
					return false;
				}
				if ( document.all("IfSerial" + row).value == "1" ) {
					if ( document.all("Unit_Edit" + row).value == "" ) {
						alert("【系统提示】\n\n该行商品 [ " + document.all("UserCode_Edit" + row).value + " ] 没有启用双单位！	\n");
						return false;
					}
					alert("【系统提示】\n\n该行商品采用了序列号强制管理，必须使用小计量单位，不能换算为大计量单位！	\n");
					return false;
				}
				if ( document.all("SerialSel_Edit1") != null ) {
					if ( document.all("hdnSysMngSerial").value == "0" && document.all("SerialOut" + row).value != "" ) {
						if ( document.all("Unit_Edit" + row).value == "" ) {
							alert("【系统提示】\n\n该行商品 [ " + document.all("UserCode_Edit" + row).value + " ] 没有启用双单位！	\n");
							return false;
						}
						alert("【系统提示】\n\n该行商品已录入了序列号，必须使用小计量单位，不能换算为大计量单位！	\n");
						return false;
					}
				}
				if ( document.all("Serial_Edit1") != null ) {
					if ( document.all("hdnSysMngSerial").value == "0" && document.all("SerialIn" + row).value != "" ) {
						if ( document.all("Unit_Edit" + row).value == "" ) {
							alert("【系统提示】\n\n该行商品 [ " + document.all("UserCode_Edit" + row).value + " ] 没有启用双单位！	\n");
							return false;
						}
						alert("【系统提示】\n\n该行商品已录入了序列号，必须使用小计量单位，不能换算为大计量单位！	\n");
						return false;
					}
				}
			}
		
			var t = eval(obj + '.dbClick != null');
			if ( t == true) { 
				var  usercode;
				var  isUnit;
				if( obj == "GridOut" ){
					usercode = document.all("OUserCode_Edit" + row).value;
					isUnit2 = document.all("OisUnitTow" + row).value;
				}
				else if( obj == "GridIn" ){
					usercode = document.all("IUserCode_Edit" + row).value;
					isUnit2 = document.all("IisUnitTow" + row).value;
				}
				else{
					usercode = document.all("UserCode_Edit" + row).value;
					isUnit2 = document.all("isUnitTow" + row).value;
				}
				eval(eval(obj + ".dbClick") + "('" + usercode + "'," + isUnit2 + "," + row + "," + col + ")");
				return false;
			}
		}
		//双击，单位切换,双grid入库
		if ( temp.substr(0, 10) == "IUnit_Edit" ) {
			if ( document.all("IIfSerial1") != null && document.all("IUnit_Edit1") != null ) {
				if ( document.all("IUnit_Edit" + row).disabled == true ) {
					return false;
				}
				if ( document.all("IIfSerial" + row).value == "1" ) {
					if ( document.all("IUnit_Edit" + row).value == "" ) {
						alert("【系统提示】\n\n该行商品 [ " + document.all("IUserCode_Edit" + row).value + " ] 没有启用双单位！	\n");
						return false;
					}
					alert("【系统提示】\n\n该行商品采用了序列号强制管理，必须使用小计量单位，不能换算为大计量单位！	\n");
					return false;
				}
				
				if( GetGridType(eval(obj+".id"),1) == 21 && GetGridType(eval(obj+".id"),2) == 1 ){//销售换货单入库
					if ( document.all("hdnSysMngSerial").value == "0" && document.all("ISerialOut" + row).value != "" ) {
						if ( document.all("IUnit_Edit" + row).value == "" ) {
							alert("【系统提示】\n\n该行商品 [ " + document.all("IUserCode_Edit" + row).value + " ] 没有启用双单位！	\n");
							return false;
						}
						alert("【系统提示】\n\n该行商品已录入了序列号，必须使用小计量单位，不能换算为大计量单位！	\n");
						return false;
					}
				}
				if( GetGridType(eval(obj+".id"),1) == 20 && GetGridType(eval(obj+".id"),2) == 1 ){//采购换货单入库
					if ( document.all("hdnSysMngSerial").value == "0" && document.all("SerialIn" + row).value != "" ) {
						if ( document.all("IUnit_Edit" + row).value == "" ) {
							alert("【系统提示】\n\n该行商品 [ " + document.all("IUserCode_Edit" + row).value + " ] 没有启用双单位！	\n");
							return false;
						}
						alert("【系统提示】\n\n该行商品已录入了序列号，必须使用小计量单位，不能换算为大计量单位！	\n");
						return false;
					}
				}
			}
		
			var t = eval(obj + '.dbClick != null');
			if ( t == true) { 
				var  usercode;
				var  isUnit;
				usercode = document.all("IUserCode_Edit" + row).value;
				isUnit2 = document.all("IisUnitTow" + row).value;
				
				eval(eval(obj + ".dbClick") + "('" + usercode + "'," + isUnit2 + "," + row + "," + col + ")");
				return false;
			}
		}
		
		//双击，单位切换,双grid出库
		if ( temp.substr(0, 10) == "OUnit_Edit" ) {
			if ( document.all("OIfSerial1") != null && document.all("OUnit_Edit1") != null ) {
				if ( document.all("OUnit_Edit" + row).disabled == true ) {
					return false;
				}
				if ( document.all("OIfSerial" + row).value == "1" ) {
					if ( document.all("OUnit_Edit" + row).value == "" ) {
						alert("【系统提示】\n\n该行商品 [ " + document.all("OUserCode_Edit" + row).value + " ] 没有启用双单位！	\n");
						return false;
					}
					alert("【系统提示】\n\n该行商品采用了序列号强制管理，必须使用小计量单位，不能换算为大计量单位！	\n");
					return false;
				}
				
				if( GetGridType(eval(obj+".id"),1) == 21 && GetGridType(eval(obj+".id"),2) == 0 ){//销售换货单出库
					if ( document.all("hdnSysMngSerial").value == "0" && document.all("OSerialOut" + row).value != "" ) {
						if ( document.all("OUnit_Edit" + row).value == "" ) {
							alert("【系统提示】\n\n该行商品 [ " + document.all("OUserCode_Edit" + row).value + " ] 没有启用双单位！	\n");
							return false;
						}
						alert("【系统提示】\n\n该行商品已录入了序列号，必须使用小计量单位，不能换算为大计量单位！	\n");
						return false;
					}
				}
				if( GetGridType(eval(obj+".id"),1) == 20 && GetGridType(eval(obj+".id"),2) == 0 ){//采购换货单出库
					if ( document.all("hdnSysMngSerial").value == "0" && document.all("SerialOut" + row).value != "" ) {
						if ( document.all("OUnit_Edit" + row).value == "" ) {
							alert("【系统提示】\n\n该行商品 [ " + document.all("OUserCode_Edit" + row).value + " ] 没有启用双单位！	\n");
							return false;
						}
						alert("【系统提示】\n\n该行商品已录入了序列号，必须使用小计量单位，不能换算为大计量单位！	\n");
						return false;
					}
				}
			}
		
			var t = eval(obj + '.dbClick != null');
			if ( t == true) { 
				var  usercode;
				var  isUnit;
				usercode = document.all("OUserCode_Edit" + row).value;
				isUnit2 = document.all("OisUnitTow" + row).value;
				
				eval(eval(obj + ".dbClick") + "('" + usercode + "'," + isUnit2 + "," + row + "," + col + ")");
				return false;
			}
		}
	}

	function SetRowCol(obj, row, col) {
		eval(obj + '.Row=' + row);
		eval(obj + '.Col=' + col);
	}

	// 左右移动表格光标 第一个参数传递表格对象
	function MoveLeftRightCursor() {				//尹毅 2006.6.13  光标移动提速
		var args = MoveLeftRightCursor.arguments;	// 获取数组
		var arg = new Array(); //徐辉 2004.8.15 单据列控制中，用来保存显示列信息
		var temp, tempName,tempvalue;
		var row;
		var i, j, k, m;
		
		//审核通过标志
		var isGridDisabled;
		isGridDisabled = false;
		if( document.all("hdnGridReadOnly") != null ){
			ishdnGridReadOnly =  document.all("hdnGridReadOnly").value;
					
			if ((ishdnGridReadOnly == 1) && (ishdnGridReadOnly !="''")){
				isGridDisabled = true;
			}
			else{
				isGridDisabled = false;
			}
		}
		
		var ob;
		ob = args[0];			//尹毅 2006.6.13  光标移动提速
		
		var temparg;
		temparg = args[4].split(',');
		temp = event.srcElement.name;
		row = -1;
		for ( i = 1;i<temparg.length;i++ ){
			if ( temp.indexOf(temparg[i]) == 0 ) {  //徐辉2004-4-23 修改前if ( temp.indexOf(arg[i]) != -1) {
				row = temp.substring(temparg[i].length);
				break;
			}
		}
		if (row == -1) return;
		temp = "";
		m = -1;
		for(i=1;i<temparg.length;i++){
			if ( ob.rows[row].all(temparg[i]+row) != null ){
				if ( ob.rows[row].all(temparg[i]+row).disabled == false && ob.rows[row].all(temparg[i]+row).readOnly == false){ //不显示列，不可编辑列，除数量列外（序列号商品时数量列disabled）
					m = m + 1;
					tempvalue = temparg[i];
					arg[m] = tempvalue;
				}
			}
		}
		
		//成本调价单因为没有序列号列，审核通过了的单据arg.length==0提前处理，基础版本也存在这样的情况
		//在数量上ALT + Q 触发批次选择
		if ( event.altKey && event.keyCode == 81 ) {
		temp = event.srcElement.name;
		if ( temp.substr(0, 8) == "Qty_Edit" || temp.substr(0, 9) == "OQty_Edit" ) {
			var outerHTML;
			outerHTML=eval('document.all.'+temp+'.outerHTML');
			
			if( outerHTML.indexOf("ondblclick") < 0 )
				return; //入库类单据，借欠不需要选批次的
		
			var obj; //定义grid串，后面使用
			obj = args[1];
			if ( top.LocalValue != null ){
				if ( top.LocalValue.SystemCosting != null ){
					if ( top.LocalValue.SystemCosting != "3" ){
						return false;//手工指定法才处理
					}
				}
			}
			if( temp.substr(0, 9) == "OQty_Edit" ){//原始单据不处理
				if( document.all("OUserCode_Edit" + row).readOnly == true ){
					return false;
				}
			}
			if( temp.substr(0, 8) == "Qty_Edit" ){//原始单据不处理
				if( document.all("UserCode_Edit" + row).readOnly == true ){
					return false;
				}
			}
			
			var billtype;
			//委托受托代销结算，委托受托代销调价，销售退货，委托代销退货 生产日期，效期至，批号不显示，屏蔽掉！ 2007－4－18 徐辉
			if ( document.all.hdnBillType != null ){
				billtype = document.all.hdnBillType.value;
				if ( document.all.hdnBillType.value == "141" || document.all.hdnBillType.value == "143" || document.all.hdnBillType.value == "145" || document.all.hdnBillType.value == "147" || document.all.hdnBillType.value == "45" || document.all.hdnBillType.value == "142"){
					return;
				}
			}
			else{
				billtype = "";
			}
			
			if ( document.all.hdnBillType != null ){
				if ( document.all.hdnBillType.value == "157" ){ //维修受理单特殊处理
					if ( document.all.stockout_edit != null ){
						if ( document.all("OUserCode_Edit" + row) != null ){
							var SelectGoodsNumber = new Array;
							if ( document.all("OUserCode_Edit"+row).value == "" ){
								return;
							}
							if ( document.all.stockout_edit.value == "" ){
								alert("【系统提示】\n\n 选择出库仓库才能选择批次！");
								return;
							}
							var re = showModalDialog('../VCH/SelectGoodsNumber.asp?TimeCheckPoint=' + GetTimeCheckPoint('','') + '&KFullName=' + document.all.stockout_edit.value + '&PUserCode=' + document.all("OUserCode_Edit"+row).value + '&billtype=' + billtype,SelectGoodsNumber,'center:1;dialogHeight:380px;dialogWidth:500px;help:0;status:0');
							if( re == 1 ){
								document.all("OProduceDate_Edit" + row).value=SelectGoodsNumber.szProduceDate;
								document.all("OValidDate_Edit" + row).value=SelectGoodsNumber.szValidDate;
								document.all("OGoodsNumber_Edit" + row).value=SelectGoodsNumber.szGoodsNumber;
								document.all("OGoodsNumberPrice" + row).value=SelectGoodsNumber.szPrice;
							}
							document.all(temp).focus();
							return false;
						}
					}
				}
			}
			
			if ( document.all.hdnBillType != null ){
				if ( document.all.hdnBillType.value == "17"  ){ //同价调拨单，手工指定法，单价处写入批次成本价
					if ( document.all.hdnSpecialproperty != null ){
						if ( document.all.hdnSpecialproperty.value == "CBDJ" ){
							if (  parent.VCH_HEAD.document.all.stockout_edit != null ){
								if ( document.all("UserCode_Edit" + row) != null ){
									var SelectGoodsNumber = new Array;
									if ( document.all("UserCode_Edit"+row).value == "" ){
										return;
									}
									if (  parent.VCH_HEAD.document.all.stockout_edit.value == "" ){
										alert("【系统提示】\n\n 选择出库仓库才能选择批次！");
										return;
									}
									var re = showModalDialog('../VCH/SelectGoodsNumber.asp?TimeCheckPoint=' + GetTimeCheckPoint('','') + '&KFullName=' +  parent.VCH_HEAD.document.all.stockout_edit.value + '&PUserCode=' + document.all("UserCode_Edit"+row).value + '&billtype=' + billtype,SelectGoodsNumber,'center:1;dialogHeight:380px;dialogWidth:500px;help:0;status:0');
									if( re == 1 ){
										if ( document.all("hdnLimitCostPrice") != null ){ //是否有成本查看权限
											if ( document.all("hdnLimitCostPrice").value == "0" ){
												if( document.all("Price_Edit" + row) != null){
													document.all("Price_Edit" + row).value = "****";
													document.all("Total_Edit" + row).value = "****";
												}
											}
											else{
												if( document.all("Price_Edit" + row) != null){
													document.all("Price_Edit" + row).value = parseFloat(SelectGoodsNumber.szPrice);
													if( !isNaN(document.all("Qty_Edit" + row).value) ){
														document.all("Total_Edit" + row).value = Math.round(document.all("Price_Edit" + row).value * document.all("Qty_Edit" + row).value *100)/100;
													}
													eval(obj+".Sum()");
												}
											}
										}
										else{
											if( document.all("Price_Edit" + row) != null){
												document.all("Price_Edit" + row).value = parseFloat(SelectGoodsNumber.szPrice);
												if( !isNaN(document.all("Qty_Edit" + row).value) ){
													document.all("Total_Edit" + row).value = Math.round(document.all("Price_Edit" + row).value * document.all("Qty_Edit" + row).value *100)/100;
												}
												eval(obj+".Sum()");
											}
										}
										document.all("ProduceDate_Edit" + row).value=SelectGoodsNumber.szProduceDate;
										document.all("ValidDate_Edit" + row).value=SelectGoodsNumber.szValidDate;
										document.all("GoodsNumber_Edit" + row).value=SelectGoodsNumber.szGoodsNumber;
										document.all("GoodsNumberPrice" + row).value=SelectGoodsNumber.szPrice;
									}
									document.all(temp).focus();
									return false;
								}
							}
						}
					}
				}
			}
			
			if ( document.all.hdnBillType != null ){
				if ( document.all.hdnBillType.value == "9"  ){ //报损单，手工指定法，单价处写入批次成本价
						if ( document.all("UserCode_Edit" + row) != null ){
								var SelectGoodsNumber = new Array;
								if ( document.all("UserCode_Edit"+row).value == "" ){
									return;
								}
								if (  parent.VCH_HEAD.document.all.stockout_edit.value == "" ){
									alert("【系统提示】\n\n 选择出库仓库才能选择批次！");
									return;
								}
								var re = showModalDialog('../VCH/SelectGoodsNumber.asp?TimeCheckPoint=' + GetTimeCheckPoint('','') + '&KFullName=' +  parent.VCH_HEAD.document.all.stockout_edit.value + '&PUserCode=' + document.all("UserCode_Edit"+row).value + '&billtype=' + billtype,SelectGoodsNumber,'center:1;dialogHeight:380px;dialogWidth:500px;help:0;status:0');
								if( re == 1 ){
									if ( document.all("hdnLimitCostPrice") != null ){ //是否有成本查看权限
										if ( document.all("hdnLimitCostPrice").value == "0" ){
											if( document.all("Price_Edit" + row) != null){
												document.all("Price_Edit" + row).value = "****";
												document.all("Total_Edit" + row).value = "****";
											}
										}
										else{
											if( document.all("Price_Edit" + row) != null){
												document.all("Price_Edit" + row).value = parseFloat(SelectGoodsNumber.szPrice);
												if( !isNaN(document.all("Qty_Edit" + row).value) ){
													document.all("Total_Edit" + row).value = Math.round(document.all("Price_Edit" + row).value * document.all("Qty_Edit" + row).value *100)/100;
												}
											}
											eval(obj+".Sum()");
										}
									}
									else{
										if( document.all("Price_Edit" + row) != null){
											document.all("Price_Edit" + row).value = parseFloat(SelectGoodsNumber.szPrice);
											if( !isNaN(document.all("Qty_Edit" + row).value) ){
												document.all("Total_Edit" + row).value = Math.round(document.all("Price_Edit" + row).value * document.all("Qty_Edit" + row).value *100)/100;
											}
											eval(obj+".Sum()");
										}
									}
									document.all("ProduceDate_Edit" + row).value=SelectGoodsNumber.szProduceDate;
									document.all("ValidDate_Edit" + row).value=SelectGoodsNumber.szValidDate;
									document.all("GoodsNumber_Edit" + row).value=SelectGoodsNumber.szGoodsNumber;
									document.all("GoodsNumberPrice" + row).value=SelectGoodsNumber.szPrice;
								}
								document.all(temp).focus();
								return false;
							}
					}
			}
			
			if ( document.all.hdnBillType != null ){
				if ( document.all.hdnBillType.value == "14"  ){ //报溢单，手工指定法，单价处写入批次成本价
						if ( document.all("UserCode_Edit" + row) != null ){
								var SelectGoodsNumber = new Array;
								if ( document.all("UserCode_Edit"+row).value == "" ){
									return;
								}
								if (  parent.VCH_HEAD.document.all.stockin_edit.value == "" ){
									alert("【系统提示】\n\n 选择出库仓库才能选择批次！");
									return;
								}
								var re = showModalDialog('../VCH/SelectGoodsNumber.asp?TimeCheckPoint=' + GetTimeCheckPoint('','') + '&KFullName=' +  parent.VCH_HEAD.document.all.stockin_edit.value + '&PUserCode=' + document.all("UserCode_Edit"+row).value + '&billtype=' + billtype,SelectGoodsNumber,'center:1;dialogHeight:380px;dialogWidth:500px;help:0;status:0');
								if( re == 1 ){
									if ( document.all("hdnLimitCostPrice") != null ){ //是否有成本查看权限
										if ( document.all("hdnLimitCostPrice").value == "0" ){
											if( document.all("Price_Edit" + row) != null){
												document.all("Price_Edit" + row).value = "****";
												document.all("Total_Edit" + row).value = "****";
											}
										}
										else{
											if( document.all("Price_Edit" + row) != null){
												document.all("Price_Edit" + row).value = parseFloat(SelectGoodsNumber.szPrice);
												if( !isNaN(document.all("Qty_Edit" + row).value) ){
													document.all("Total_Edit" + row).value = Math.round(document.all("Price_Edit" + row).value * document.all("Qty_Edit" + row).value *100)/100;
												}
												eval(obj+".Sum()");
											}
										}
									}
									else{
										if( document.all("Price_Edit" + row) != null){
											document.all("Price_Edit" + row).value = parseFloat(SelectGoodsNumber.szPrice);
											if( !isNaN(document.all("Qty_Edit" + row).value) ){
												document.all("Total_Edit" + row).value = Math.round(document.all("Price_Edit" + row).value * document.all("Qty_Edit" + row).value *100)/100;
											}
											eval(obj+".Sum()");
										}
									}
									document.all("ProduceDate_Edit" + row).value=SelectGoodsNumber.szProduceDate;
									document.all("ValidDate_Edit" + row).value=SelectGoodsNumber.szValidDate;
									document.all("GoodsNumber_Edit" + row).value=SelectGoodsNumber.szGoodsNumber;
									document.all("GoodsNumberPrice" + row).value=SelectGoodsNumber.szPrice;
								}
								document.all(temp).focus();
								return false;
							}
					}
			}
			
			if ( document.all.hdnBillType != null ){
				if ( document.all.hdnBillType.value == "16"  ){ //生产拆装单出库，手工指定法，单价处写入批次成本价
						if ( document.all("OUserCode_Edit" + row) != null ){
								var SelectGoodsNumber = new Array;
								if ( document.all("OUserCode_Edit"+row).value == "" ){
									return;
								}
								if (  parent.VCH_HEAD.document.all.stockout_edit.value == "" ){
									alert("【系统提示】\n\n 选择出库仓库才能选择批次！");
									return;
								}
								var re = showModalDialog('../VCH/SelectGoodsNumber.asp?TimeCheckPoint=' + GetTimeCheckPoint('','') + '&KFullName=' +  parent.VCH_HEAD.document.all.stockout_edit.value + '&PUserCode=' + document.all("OUserCode_Edit"+row).value + '&billtype=' + billtype,SelectGoodsNumber,'center:1;dialogHeight:380px;dialogWidth:500px;help:0;status:0');
								if( re == 1 ){
									if ( document.all("hdnLimitCostPrice") != null ){ //是否有成本查看权限
										if ( document.all("hdnLimitCostPrice").value == "0" && document.all("hdnCheckCostDisplay").value == "0"  ){
											if( document.all("OPrice_Edit" + row) != null){
												document.all("OPrice_Edit" + row).value = "****";
												document.all("OTotal_Edit" + row).value = "****";
											}
										}
										else{
											if( document.all("OPrice_Edit" + row) != null){
												document.all("OPrice_Edit" + row).value = parseFloat(SelectGoodsNumber.szPrice);
												if( !isNaN(document.all("OQty_Edit" + row).value) ){
													document.all("OTotal_Edit" + row).value = Math.round(document.all("OPrice_Edit" + row).value * document.all("OQty_Edit" + row).value *100)/100;
												}
												eval(obj+".Sum()");
											}
										}
									}
									else{
										if( document.all("OPrice_Edit" + row) != null){
											document.all("OPrice_Edit" + row).value = parseFloat(SelectGoodsNumber.szPrice);
											if( !isNaN(document.all("OQty_Edit" + row).value) ){
												document.all("OTotal_Edit" + row).value = Math.round(document.all("OPrice_Edit" + row).value * document.all("OQty_Edit" + row).value *100)/100;
											}
											eval(obj+".Sum()");
										}
									}
									
									document.all("OProduceDate_Edit" + row).value=SelectGoodsNumber.szProduceDate;
									document.all("OValidDate_Edit" + row).value=SelectGoodsNumber.szValidDate;
									document.all("OGoodsNumber_Edit" + row).value=SelectGoodsNumber.szGoodsNumber;
									document.all("OGoodsNumberPrice" + row).value=SelectGoodsNumber.szPrice;
								}
								document.all(temp).focus();
								return false;
							}
					}
			}
			
			if ( parent.VCH_HEAD.stock_edit != null ){
				var SelectGoodsNumber = new Array;
				if ( document.all("UserCode_Edit"+row).value == "" ){
					return;
				}
				if ( parent.VCH_HEAD.stock_edit.value == "" ){
					alert("【系统提示】\n\n 选择出库仓库才能选择批次！");
					return;
				}
				var re = showModalDialog('../VCH/SelectGoodsNumber.asp?TimeCheckPoint=' + GetTimeCheckPoint('','') + '&KFullName=' + parent.VCH_HEAD.stock_edit.value + '&PUserCode=' + document.all("UserCode_Edit"+row).value + '&billtype=' + billtype,SelectGoodsNumber,'center:1;dialogHeight:380px;dialogWidth:500px;help:0;status:0');
				if( re == 1 ){
					document.all("ProduceDate_Edit" + row).value=SelectGoodsNumber.szProduceDate;
					document.all("ValidDate_Edit" + row).value=SelectGoodsNumber.szValidDate;
					document.all("GoodsNumber_Edit" + row).value=SelectGoodsNumber.szGoodsNumber;
					document.all("GoodsNumberPrice" + row).value=SelectGoodsNumber.szPrice;
				}
				document.all(temp).focus();
				return false;
			}
			
			if ( parent.VCH_HEAD.stockout_edit != null ){
				var SelectGoodsNumber = new Array;
				if ( document.all("UserCode_Edit" + row) != null ){
					if ( document.all("UserCode_Edit"+row).value == "" ){
						return;
					}
					if ( parent.VCH_HEAD.stockout_edit.value == "" ){
						alert("【系统提示】\n\n 选择出库仓库才能选择批次！");
						return;
					}
					var re = showModalDialog('../VCH/SelectGoodsNumber.asp?TimeCheckPoint=' + GetTimeCheckPoint('','') + '&KFullName=' + parent.VCH_HEAD.stockout_edit.value + '&PUserCode=' + document.all("UserCode_Edit"+row).value + '&billtype=' + billtype,SelectGoodsNumber,'center:1;dialogHeight:380px;dialogWidth:500px;help:0;status:0');
					if( re == 1 ){
						document.all("ProduceDate_Edit" + row).value=SelectGoodsNumber.szProduceDate;
						document.all("ValidDate_Edit" + row).value=SelectGoodsNumber.szValidDate;
						document.all("GoodsNumber_Edit" + row).value=SelectGoodsNumber.szGoodsNumber;
						document.all("GoodsNumberPrice" + row).value=SelectGoodsNumber.szPrice;
					}
					document.all(temp).focus();
					return false;
				}
				if ( document.all("OUserCode_Edit" + row) != null ){
					if ( document.all("OUserCode_Edit"+row).value == "" ){
						return;
					}
					if ( parent.VCH_HEAD.stockout_edit.value == "" ){
						alert("【系统提示】\n\n 选择出库仓库才能选择批次！");
						return;
					}
					var re = showModalDialog('../VCH/SelectGoodsNumber.asp?TimeCheckPoint=' + GetTimeCheckPoint('','') + '&KFullName=' + parent.VCH_HEAD.stockout_edit.value + '&PUserCode=' + document.all("OUserCode_Edit"+row).value + '&billtype=' + billtype,SelectGoodsNumber,'center:1;dialogHeight:380px;dialogWidth:500px;help:0;status:0');
					if( re == 1 ){
						document.all("OProduceDate_Edit" + row).value=SelectGoodsNumber.szProduceDate;
						document.all("OValidDate_Edit" + row).value=SelectGoodsNumber.szValidDate;
						document.all("OGoodsNumber_Edit" + row).value=SelectGoodsNumber.szGoodsNumber;
						document.all("OGoodsNumberPrice" + row).value=SelectGoodsNumber.szPrice;
					}
					document.all(temp).focus();
					return false;
				}
			}
		}
		}
		//结束在数量上ALT + Q 触发批次选择
		
		//注意：arg是该单据可置焦点列数组，args是MoveLeftRightCursor传进来的参数
		//arg 显示列数组
		// 没有参数退出
		if (arg.length==0) return;
		tempObj = event.srcElement;
		tempObjName = event.srcElement.name;
		tempObjLength = document.all(tempObjName).value.length;
		var tempCursor = document.selection.createRange();
		tempCursor.setEndPoint("StartToStart",tempObj.createTextRange());
		var tempCursorPos = tempCursor.text.length + 1;
		// Grid 的行数，根据不同的 Grid 对象
		var intGridRows;
		switch (args[1]) {
			case "GridIn":
				intGridRows = GridIn.rows;
				break;
			case "GridOut":
				intGridRows = GridOut.rows;
				break;
			default:
				intGridRows = Grid.rows;
				break;
		}
		
		// 左 ( ← ) 右 ( → ) Home、End 移动
		if ( event.keyCode == 37 || event.keyCode == 39 || event.keyCode == 35 || event.keyCode == 36 || event.ctrlKey ) {
			temp = event.srcElement.name;
			row = -1;
			for ( i = 0; i < arg.length; i++ ) {
				if ( temp.indexOf(arg[i]) == 0 ) {  //徐辉2004-4-23 修改前if ( temp.indexOf(arg[i]) != -1) {
					row = temp.substring(arg[i].length);
					break;
				}
			}
			if ( row == -1 ) return;
			if ( event.keyCode == 35 ) {	// End
				if ( tempObjLength != 0 ) {
					if ( tempCursorPos > tempObjLength )
						ob.rows[row].all(arg[parseInt(arg.length) - 1] + row).focus();
				}
				else
					ob.rows[row].all(arg[parseInt(arg.length) - 1] + row).focus();
			}
			if ( event.keyCode == 36 ) {	// Home
				if ( tempObjLength != 0 ) {
					if ( tempCursorPos < 2 )
						ob.rows[row].all(arg[0] + row).focus();
				}
				else
					ob.rows[row].all(arg[0] + row).focus();
			}
			if ( event.ctrlKey && event.keyCode == 35 ) {	// Ctrl + End 该列最末的域
				ob.rows[intGridRows].all(arg[i] + intGridRows).focus();
			}
			if ( event.ctrlKey && event.keyCode == 36 ) {	// Ctrl + Home 该列最初的域
				ob.rows[1].all(arg[i] + 1).focus();
			}
			if ( event.keyCode == 37 ) {	// 左
				if ( i == 0 && row > 1 ) {
					if ( tempObjLength != 0 ) {
						if ( tempCursorPos < 2 ) {
							if ( ob.rows[row-1].all(arg[parseInt(arg.length) - 1] + (row - 1)).disabled == false ) {
								ob.rows[row-1].all(arg[parseInt(arg.length) - 1] + (row - 1)).focus();
							}
							else {
								ob.rows[row-1].all(arg[parseInt(arg.length) - 2] + (row - 1)).focus();
							}
						}
					}
					else {
						if ( ob.rows[row-1].all(arg[parseInt(arg.length) - 1] + (row - 1)).disabled == false ) {
							ob.rows[row-1].all(arg[parseInt(arg.length) - 1] + (row - 1)).focus();
						}
						else {
							ob.rows[row-1].all(arg[parseInt(arg.length) - 2] + (row - 1)).focus();
						}
					}
				}
				else {
					if ( i != 0 ) {
						if ( tempObjLength != 0 ) {
							if ( tempCursorPos < 2 ) {
								if ( ob.rows[row].all(arg[i-1] + row).disabled == false ) {
									ob.rows[row].all(arg[i-1] + row).focus();
								}
								else {
									ob.rows[row].all(arg[i-2] + row).focus();
								}
							}
						}
						else {
							if ( ob.rows[row].all(arg[i-1] + row).disabled == false ) {
								ob.rows[row].all(arg[i-1] + row).focus();
							}
							else {
								ob.rows[row].all(arg[i-2] + row).focus();
							}
						}
					}
				}
			}
			if ( event.keyCode == 39 ) {	// 右
				if ( i == parseInt(arg.length) - 1 && row < parseInt(intGridRows) ) {
					if ( tempObjLength != 0 ) {
						if ( tempCursorPos > tempObjLength ) {
							if ( !ob.rows[parseInt(row) + 1].all(arg[0] + (parseInt(row) + 1)).disabled ){
								ob.rows[parseInt(row) + 1].all(arg[0] + (parseInt(row) + 1)).focus();
							}
							event.keyCode = 37;
						}
					}
					else {
						if( !ob.rows[parseInt(row) + 1].all(arg[0] + (parseInt(row) + 1)).disabled ){
							ob.rows[parseInt(row) + 1].all(arg[0] + (parseInt(row) + 1)).focus();
						}
						event.keyCode = 37;
					}
				}
				else {
					if ( i != parseInt(arg.length) - 1 ) {
						if ( tempObjLength != 0 ) {
							if ( tempCursorPos > tempObjLength ) {
								if ( ob.rows[row].all(arg[i+1] + row).disabled == false ) {
									ob.rows[row].all(arg[i+1] + row).focus();
								}
								else {
									ob.rows[row].all(arg[i+2] + row).focus();
								}
								event.keyCode = 37;
							}
						}
						else {
							if ( ob.rows[row].all(arg[i+1] + row).disabled == false ) {
								ob.rows[row].all(arg[i+1] + row).focus();
							}
							else {
								ob.rows[row].all(arg[i+2] + row).focus();
							}
						}
					}
				}
			}
		}

		if ( event.keyCode == 13 ) {	// 回车右移
			temp = event.srcElement.name;
			
			//Roamer Wu 2003-12-25 控制货位单栏内回车效果 Merry Christmas!
			if ( args[4].indexOf("Local") > -1 && !( args[4].indexOf("LocalIn") > -1 && args[4].indexOf("LocalOut") > -1 )  ) {
				if ( (temp.indexOf("Qty") < 0 || temp.indexOf("Local") < 0 ) )
					return false;
			}
			row = -1;
			for ( i = 0; i < arg.length; i++ ) {	
				if ( temp.indexOf(arg[i]) == 0 ) {          //2004-4-23 徐辉 修改前 if ( temp.indexOf(arg[i]) != -1 ) {TaxPrice_Edit含有Price_Edit 
					row = temp.substring(arg[i].length);
					break;
				}
			}
			if (row == -1) return;
			
			// 可以改进
			// 编号
			var IfInLocalUpdateCol;
			switch (args[1]) {
				case "GridIn":
					IfInLocalUpdateCol = GridIn.InLocalUpdateCol(i+1);
					break;
				case "GridOut":
					IfInLocalUpdateCol = GridOut.InLocalUpdateCol(i+1);
					break;
				default:
					IfInLocalUpdateCol = Grid.InLocalUpdateCol(i+1);
					break;
			}
			
			//会计凭证计算合计
			if ( temp.substring(0,15) == "DebitTotal_Edit" || temp.substring(0,16) == "CreditTotal_Edit" ){
				Grid.Sum();
			}

			if ( temp.substring(0,8) == "Qty_Edit" || temp.substring(0,9) == "OQty_Edit" ) {

				IfInLocalUpdateCol = false;
				//2003-08-18 数量 回车换行 到 商品编码 (吴德水)
				if (document.all("hdnBillType") != null){
					if (document.all("hdnBillType").value == "305" ) {
						if (event.srcElement.value != "" ) {
							if ( parseInt(row) >= args[0].rows.length - 2 )
								eval(args[2]);	// 新增一行
							row = parseInt(row) + 1;
							ob.rows[row].all("UserCode_Edit" + row).focus();
							if ( Grid.UpdateInTime )
								Grid.Sum();
							return false;
						}
					}
				}
			}

			if (temp.substring(0,13) == "UserCode_Edit" ){
				//2003-08-18 加上零售单空白编号回车直接到“收现”(吴德水)
				if (document.all("hdnBillType") != null){
					if (document.all("hdnBillType").value == "305" ) {
						if (event.srcElement.value == "" ) {							
							parent.VCH_MENU.totalinmoney_edit.focus();
							if ( Grid.UpdateInTime )
								Grid.Sum();
							return false;
						}
						else {
							if ( parseInt(row) >= args[0].rows.length - 2 )
								eval(args[2]);	// 新增一行
							row = parseInt(row) + 1;
							if ( document.all("UserCode_Edit" + row) != null )
								document.all("UserCode_Edit" + row).focus();
							if ( Grid.UpdateInTime )
								Grid.Sum();
							return false;
						}						
					}
				}
				//2007-11-15 加上销售单编号回车跳下一行（徐辉）
				if (document.all("hdnBillType") != null){
					if ( document.all("hdnBillType").value == "11" && GetLocalVal("SaleDefault") == 1) {
						if (event.srcElement.value != "" ) {							
							if ( parseInt(row) >= args[0].rows.length - 2 )
								eval(args[2]);	// 新增一行
							row = parseInt(row) + 1;
							if ( document.all("UserCode_Edit" + row) != null )
								document.all("UserCode_Edit" + row).focus();
							if ( Grid.UpdateInTime )
								Grid.Sum();
							return false;
						}						
					}
				}
			}
			
			if ( ( IfInLocalUpdateCol && ( temp.substring(0,14) == "SerialSel_Edit" || temp.substring(0,15) == "OSerialSel_Edit" 
			|| temp.substring(0,15) == "ISerialSel_Edit" || temp.substring(0,13) == "UserCode_Edit" 
			|| temp.substring(0,14) == "OUserCode_Edit"  || temp.substring(0,14) == "IUserCode_Edit" 
			||  temp.substring(0,13) == "FullName_Edit" ||  temp.substring(0,14) == "IFullName_Edit" 
			||  temp.substring(0,14) == "OFullName_Edit" || temp.substring(0,9) == "Type_Edit") )
			 && document.all(arg[i] + row).value == "" ) {
				var t = eval(args[1] + '.TreeSearch!= null');
				if ( t == true ) {
					eval(eval(args[1] + ".TreeSearch"));
					return false;
				}
			}
			
			//徐辉 V4.1 2009-01-12 添加销售提成单 特殊处理调用事件
			if ( eval(args[1]+'.id') == 35 && ( temp.substring(0,13) == "FullName_Edit" ||  temp.substring(0,13) == "UserCode_Edit" || temp.substring(0,13) == "Employee_Edit" || temp.substring(0,13) == "RuleCode_Edit") ){
				if ( temp.substring(0,13) == "UserCode_Edit" ){//商品编号
					var FullName = "FullName_Edit"+temp.substring(13,temp.length)
					if ( document.all.inputname.value == event.srcElement.value && event.srcElement.value !== "" ) {
						//return;
					}
					else if ( event.srcElement.value == "" ) {
						SearchOneCodeName("../Common/SearchOne.asp","ptype",FullName,event.srcElement.value,"",temp,"TREE","")
						return;
					}
					else {
						SearchOneCodeName("../Common/SearchOne.asp","ptype",FullName,event.srcElement.value,"",temp,"Search","")
						return;
					}
				}
				else if ( temp.substring(0,13) == "FullName_Edit" ){//商品名称
					var UserCode = "UserCode_Edit"+temp.substring(13,temp.length)
					if ( document.all.inputname.value == event.srcElement.value && event.srcElement.value !== "" ) {
						//return;
					}
					else if ( event.srcElement.value == "" ) {
						SearchOneCodeName("../Common/SearchOne.asp","ptype",temp,event.srcElement.value,"",UserCode,"TREE","")
						return;
					}
					else {
						SearchOneCodeName("../Common/SearchOne.asp","ptype",temp,event.srcElement.value,"",UserCode,"Search","")
						return;
					}
				}
				else if ( temp.substring(0,13) == "Employee_Edit" ) {
					if ( document.all.inputname.value == event.srcElement.value && event.srcElement.value !== "" ) {
						//return;
					}
					else if ( event.srcElement.value == "" ) {
						SearchOne("../Common/SearchOne.asp","employee",temp,event.srcElement.value,"","TREE","")
						return;
					}
					else {
						SearchOne("../Common/SearchOne.asp","employee",temp,event.srcElement.value,"","Search","")
						return;
					}
				}
				else if ( temp.substring(0,13) == "RuleCode_Edit" ) {
					var RuleExpression="RuleExpression_Edit"+temp.substring(13,temp.length);
					if ( document.all.inputname.value == event.srcElement.value && event.srcElement.value !== "" ) {
						//return;
					}
					else if ( event.srcElement.value == "" ) {
						var t,l,f,temp;
 						t=(screen.availHeight-480)/2 ;
						l=(screen.availWidth-450)/2;
						f="height=480,top=" + new String(t)+",left="+new String(l)+",width=500,location=no,menubar=no,resizable=no,toolbar=no";        
						window.open("TcRuleSelect.asp?TimeCheckPoint=" + GetTimeCheckPoint('','')+"&reObject1="+temp+"&reObject2="+RuleExpression,"QueWin",f,false);
						return;
					}
					else {
						var t,l,f,temp;
 						t=(screen.availHeight-380)/2 ;
						l=(screen.availWidth-450)/2;
						f="height=380,top=" + new String(t)+",left="+new String(l)+",width=500,location=no,menubar=no,resizable=no,toolbar=no";        
						window.open("TcRuleSelect.asp?TimeCheckPoint=" + GetTimeCheckPoint('','')+"&reObject1="+temp+"&reObject2="+RuleExpression+"&RuleString="+event.srcElement.value,"QueWin",f,false);
						return;
					}
				}
			}
			
			//审核通过的草稿录入序列号
			if ( ( IfInLocalUpdateCol && ( temp.substring(0,14) == "SerialSel_Edit" || temp.substring(0,15) == "OSerialSel_Edit" || temp.substring(0,15) == "ISerialSel_Edit" )) && document.all(arg[i] + row).value != "" && isGridDisabled ) {
				var newrow;
				newrow = parseInt(row) + 1;
				if ( document.all(arg[i] + newrow) != null ){ 
					if ( document.all(arg[i] + newrow).disabled == true ){
						document.all(temp).blur();
						return false;
					}
				}
				else{
					document.all(temp).blur();
					return false;
				}
			}
			if ( i >= arg.length - 1 ) {
				if ( parseInt(row) >= args[0].rows.length - 2 ){
					if( !isGridDisabled){ //审核通过单据不增加行
						eval(args[2]);	// 新增一行
					}
					if ( typeof(SetBillColsDisplay) == "function" ){ //单据列控制
						SetBillColsDisplay();
					}
					if ( typeof(SetBillColsDisplayOut) == "function" ){ //单据列控制
						SetBillColsDisplayOut();
					}
					if ( typeof(SetBillColsDisplayIn) == "function" ){ //单据列控制
						SetBillColsDisplayIn();
					}
				}
				row = parseInt(row) + 1;
				i = 0;
			}
			else
				i = i + 1;
				
			if ( temp.substr(0, 11) == "Serial_Edit" ) {	// 入库序列号列
				var strQtyEditRow1, strPriceEditRow1, strTotalEditRow1, strGridID, strIfSerialRow1, intGridRows,strUserCode1,strisUnitTow1;
				var strUserCode,serialCount;
				
				
				var tempobj ;
				if( args[1] == "Grid" ){
					tempobj = Grid ; 
				}
				else{
					tempobj = GridIn ; 
				}
				
				var IsFirst ; // 销售换货序列号在最前面
				IsFirst = false;
				
				if( GetGridType(tempobj.id,1) == 21 && GetGridType(tempobj.id,2) == 1 )
				{
					IsFirst = true ; 
					row = parseInt(row) + 1;
				}
				
				if ( args[1] == "Grid" ) {
					strUserCode = document.all("UserCode_Edit" + (row - 1));
					strQtyEditRow1 = document.all("Qty_Edit" + (row - 1));
					strPriceEditRow1 = document.all("Price_Edit" + (row - 1));
					strTotalEditRow1 = document.all("Total_Edit" + (row - 1));
					strIfSerialRow1 = document.all("IfSerial" + (row - 1));
					strUserCode1 = document.all("UserCode_Edit" + (row - 1));
					strisUnitTow1=document.all("isUnitTow" + (row - 1));
					strGridID = Grid.id;
					intGridRows = Grid.rows;
				}
				if ( args[1] == "GridIn" ) {
					strUserCode = document.all("IUserCode_Edit" + (row - 1));
					strQtyEditRow1 = document.all("IQty_Edit" + (row - 1));
					strPriceEditRow1 = document.all("IPrice_Edit" + (row - 1));
					strTotalEditRow1 = document.all("ITotal_Edit" + (row - 1));
					strIfSerialRow1 = document.all("IIfSerial" + (row - 1));
					strUserCode1 = document.all("IUserCode_Edit" + (row - 1));
					strisUnitTow1=document.all("IisUnitTow" + (row - 1));
					strGridID = GridIn.id;
					intGridRows = GridIn.rows;
				}
				var strIfSerial	= strIfSerialRow1.value;
				var strSerialIn	= document.all("SerialIn" + (row - 1));
				var strSerialEdit = document.all("Serial_Edit" + (row - 1));
				
				if ( strTotalEditRow1 != null  ) {
					//报溢单单价金额隐藏
					if ( (parseFloat(strTotalEditRow1.value) < 0 || strTotalEditRow1.value == "") && strGridID != 23 ) {
						alert("【系统提示】\n\n该行的商品金额不能为负数或为空！	\n");
						if ( strGridID == 2 || strGridID == 12 )		// 销售单、进货单税率格式
							if ( document.all("TaxPrice_Edit" + (row - 1)).disabled == false ){
								document.all("TaxPrice_Edit" + (row - 1)).focus();
							}
						else if ( strGridID == 13 || strGridID == 14 )	// 销售单、进货单折扣格式
							if ( document.all("DiscountPrice_Edit" + (row - 1)).disabled == false ){
								document.all("DiscountPrice_Edit" + (row - 1)).focus();
							}
						else if ( strGridID == 7 || strGridID == 27 )	// 拆装入库
								if ( document.all("IPrice_Edit" + (row - 1)).disabled == false ){
									document.all("IPrice_Edit" + (row - 1)).focus();
								}
						else
							if ( document.all("Price_Edit" + (row - 1)).disabled == false ){
								document.all("Price_Edit" + (row - 1)).focus();
							}
						return false;
					}
				}
				
					if ( strIfSerial == "1" ) {	
						if ( strQtyEditRow1.value == "" || parseFloat(strQtyEditRow1.value) <= 0 ) {
								alert("【系统提示】\n\n该行的商品数量不能为空、为零或负数！	\n");
								strQtyEditRow1.focus();
								return false;
						}
						if ( strQtyEditRow1.value == "" ) {
							alert("【系统提示】\n\n该行的商品采用了序列号强制管理，商品数量必须大于等于 1 ！	\n");
							strQtyEditRow1.value = "1";	// 将数量设为 1
							if ( args[1] == "Grid" )
								Grid.Refresh((row - 1), 11, 1);	// 自动合计
							if ( args[1] == "GridIn" ){
								if ( GridIn.id == 7)
								{
									GridIn.Refresh((row - 1), 11, 1);	// 自动合计
								}
								else{
									GridIn.Refresh((row - 1), 10, 1);	// 自动合计
								}
							}
							return false;
						}
						if ( strSerialIn.value == "" && TrimSpace(strSerialEdit.value) == "" ) {
							if( !IsFirst){
								alert("【系统提示】\n\n该行的商品采用了序列号强制管理，必须输入序列号！	\n");
								return false;
							}
						}
						if ( TrimSpace(strSerialEdit.value) != "" ) {
							if ( chkSerialNonChar(strSerialEdit) == false ){
								strSerialEdit.select();
								return false;
							}
							var strSerialInTemp;
							for ( var j = 1; j <= intGridRows; j ++ ) {
								if ( j != parseInt(row - 1) && document.all("SerialIn" + j).value != "" ) {
									var strSerialTemp = document.all("SerialIn" + j).value;
									if ( !CheckSerial(TrimSpace(strSerialEdit.value),strSerialTemp ) ) {
										alert("【系统提示】\n\n您录入的序列号 [ " + strSerialEdit.value + " ] 与第 [ " + j + " ] 行商品已录入的序列号有重复，请确认后重试！	\n");
										strSerialEdit.select();
										return false;
									}
								}
							}
							if ( strSerialIn.value != "" ) {
								var s = new Array();
								s = strSerialIn.value.split('я');
								if ( s.length == 1000 ) {
									alert("【系统提示】\n\n一个商品所允许录入的序列号个数最大为 1000 个，请确认后重试！	\n");
									strSerialEdit.select();
									return false;
								}
								if ( !CheckSerial( TrimSpace(strSerialEdit.value), strSerialIn.value ) ) {
									alert("【系统提示】\n\n您录入的序列号 [ " + strSerialEdit.value + " ] 与本行商品已录入的序列号有重复，请确认后重试！	\n");
									strSerialEdit.select();
									return false;
								}
							}
							
							//检查序列号位数
							for ( var i = 0; i < top.LocalValue.SerialCountArray.length; i ++ ){
								var tempArray = top.LocalValue.SerialCountArray[i].split(';');
								if ( tempArray[0] == strUserCode.value ){
									if ( parseInt(tempArray[1]) != strSerialEdit.value.length ){
										alert("【系统提示】\n\n您录入的序列号 [ " +strSerialEdit.value + " ] 不符合本行商品设置序列号长度" + tempArray[1].toString() + "，请确认后重试！	\n");
										return false;
									}
									else{
										break;
									}
								}
							}
							
							if ( strSerialIn.value != "" ) {
								if ( strQtyEditRow1.value <= s.length ) {
									if (! isGridDisabled ){//审核通过的草稿不能变数量
										strQtyEditRow1.value = parseInt(s.length) + 1;
										if ( args[1] == "Grid" ) {
											Grid.Refresh((row - 1), 11, 1);		// 自动合计
											if ( Grid.UpdateInTime == true )
												Grid.Sum();
										}
										if ( args[1] == "GridIn" ) {
											GridIn.Refresh((row - 1), 10, 1);	// 自动合计
											GridIn.Refresh((row - 1), 11, 1);	// 自动合计
											if ( GridIn.UpdateInTime )
												GridIn.Sum();
										}
									}
								}
							}
							if ( strSerialIn.value == "" ) {
								//徐辉 2005-4-9 添加 序列号数量就是
								if (! isGridDisabled ){//审核通过的草稿不能变数量
									strQtyEditRow1.value = 1;
									if ( args[1] == "Grid" ) {
										Grid.Refresh((row - 1), 11, 1);		// 自动合计
										if ( Grid.UpdateInTime == true )
											Grid.Sum();
									}
									if ( args[1] == "GridIn" ) {
										GridIn.Refresh((row - 1), 10, 1);	// 自动合计
										GridIn.Refresh((row - 1), 11, 1);	// 自动合计
										if ( GridIn.UpdateInTime )
											GridIn.Sum();
									}
								}
								strSerialIn.value = TrimSpace(strSerialEdit.value);
							}
							else{
								strSerialIn.value = strSerialIn.value + "я" + TrimSpace(strSerialEdit.value);
							}
							strSerialEdit.select();
						}
						else {
							if ( strQtyEditRow1.value != strSerialIn.value.split('я').length ) {
								alert("【系统提示】\n\n该行商品的数量与序列号数量不一致，请确认后重试！	\n");
								return false;
							}
							else {
								// 回跳到下一行的序列号输入框
								document.all(arg[i] + row).focus();
							}
						}
					}
					else {
						if ( strQtyEditRow1.value == "" || parseFloat(strQtyEditRow1.value) <= 0 ) {
							alert("【系统提示】\n\n该行的商品数量不能为空、为零或负数！	\n");
							strQtyEditRow1.focus();
							return false;
						}
						// “系统是否采用序列号强制管理”标识
						// 0：宽松式管理，即商品虽没有采用序列号强制管理，仍能录入序列号
						// 1：强制式管理，即商品没有采用序列号强制管理，则不能录入序列号
						var strSysMngSerial = document.all("hdnSysMngSerial").value;
						if ( strSysMngSerial == "1" && document.all("Serial_Edit" + (row - 1)).value != "" ) {
							alert("【系统提示】\n\n该行的商品没有采用序列号强制管理，不能录入序列号！	\n");
							document.all("Serial_Edit" + (row - 1)).value = "";
							return false;
						}
						
						if ( strisUnitTow1 != null ){
							if ( strSysMngSerial == "0" && strisUnitTow1.value == "1" && strSerialEdit.value != ""  ) {
								alert("【系统提示】\n\n该行商品已使用大计量单位，不能录入序列号！	\n");
								strSerialEdit.select();
								return false;
							}
						}
						if ( strisUnitTow1 != null ){
							if ( strSysMngSerial == "0" && strisUnitTow1.value == "1" && (document.all("SerialIn" + (row - 1)).value != "" || strSerialEdit.value != "" ) ) {
								alert("【系统提示】\n\n该行商品已录入了序列号，必须使用小计量单位，不能换算为大计量单位！	\n");
								strSerialEdit.select();
								return false;
							}
						}
						if ( TrimSpace(strSerialEdit.value) != "" ) {
							if ( chkSerialNonChar(strSerialEdit) == false ){
								strSerialEdit.select();
								return false;
							}
						}
						if ( strSysMngSerial == "0" && TrimSpace(document.all("Serial_Edit" + (row - 1)).value) != "" ) {
							if ( strQtyEditRow1.value == "" || strQtyEditRow1.value == "0" ) {
								strQtyEditRow1.value = 1;
								strSerialIn.value = TrimSpace(strSerialEdit.value);
							}
							else {
								var strSerialInTemp;
								for ( var j = 1; j <= intGridRows; j ++ ) {
									if ( j != parseInt(row - 1) && document.all("SerialIn" + j).value != "" ) {
										var strSerialTemp = document.all("SerialIn" + j).value;
										if ( !CheckSerial(TrimSpace(strSerialEdit.value),strSerialTemp) ) {
											alert("【系统提示】\n\n您录入的序列号 [ " + strSerialEdit.value + " ] 与第 [ " + j + " ] 行商品已录入的序列号有重复，请确认后重试！	\n");
											strSerialEdit.select();
											return false;
										}
									}
								}
								if ( strSerialIn.value == "" ) {
									strSerialIn.value = TrimSpace(strSerialEdit.value);
								}
								else {
									var s = new Array();
									s = strSerialIn.value.split('я');
									if ( s.length == 1000 ) {
										alert("【系统提示】\n\n一个商品所允许录入的序列号个数最大为 1000 个，请确认后重试！	\n");
										strSerialEdit.select();
										return false;
									}
									if ( !CheckSerial( TrimSpace(strSerialEdit.value), strSerialIn.value ) ) {
										alert("【系统提示】\n\n您录入的序列号 [ " + strSerialEdit.value + " ] 与本行商品已录入的序列号有重复，请确认后重试！	\n");
										strSerialEdit.select();
										return false;
									}
									if ( s.length < parseInt(strQtyEditRow1.value) ) {
										strSerialIn.value = strSerialIn.value + "я" + TrimSpace(strSerialEdit.value);
									}
									else {
										if (! isGridDisabled ){//审核通过的草稿不能变数量
											strQtyEditRow1.value = parseInt(strQtyEditRow1.value) + 1;
										}
										strSerialIn.value = strSerialIn.value + "я" + TrimSpace(strSerialEdit.value);
									}
								}
							}
							if ( args[1] == "Grid" ) {
								Grid.Refresh((row - 1), 11, 1);		// 自动合计
								if ( Grid.UpdateInTime == true )
									Grid.Sum();
							}
							if ( args[1] == "GridIn" ) {
								GridIn.Refresh((row - 1), 10, 1);	// 自动合计
								GridIn.Refresh((row - 1), 11, 1);	// 自动合计
								if ( GridIn.UpdateInTime )
									GridIn.Sum();
							}
							strSerialEdit.value = "";
						}
						else
							if ( document.all(arg[i] + row) != null ){
								if ( document.all(arg[i] + row).disabled == false ){
									document.all(arg[i] + row).focus();
								}
							}
					}
			}
			else {
				if ( document.all(arg[i] + row) != null ){
					if ( document.all(arg[i] + row).disabled == false ){
						
						var GridId;
						if ( args[1] == "Grid" ){
							GridId = Grid.id;
						}
						if ( args[1] == "GridIn"){
							GridId = GridIn.id;
						}
						if ( args[1] == "GridOut"){
							GridId = GridOut.id;
						}		
						//徐辉 2004-10-18 扫描枪输入商品编码，条形码商品数量加1
						if ( temp.indexOf("UserCode_Edit") != -1 ){
							if ( document.all("hdnIfUseScan") != null ){
								if ( document.all("hdnIfUseScan").value == "1" ){
									for (var k=1;k<=intGridRows;k++ ){
										if ( k != row ){
											if ( GetGridType(GridId,1) == 10 ){
												if ( (document.all("UserCode_Edit" + k).value == document.all("UserCode_Edit" + row).value) || (document.all("EntryCode_Edit" + k).value == document.all("UserCode_Edit" + row).value) ){
													document.all("UserCode_Edit" + row).value = "";
													document.all("UserCode_Edit" + row).select();
													if ( document.all("Qty_Edit" + k) != null ){
														if ( !isNaN(parseFloat(document.all("Qty_Edit" + k).value)) ){
															document.all("Qty_Edit" + k).value = parseFloat(document.all("Qty_Edit" + k).value) + 1;
														}
														else{
															document.all("Qty_Edit" + k).value = 1;
														}
														if ( args[1] == "Grid" ) {
															if ( Grid.id == 1 || Grid.id == 2 || Grid.id == 13 ||  Grid.id == 15 || Grid.id == 28 || Grid.id == 4 )//同价调拨，销售、销售退货、采购退货
																Grid.Refresh(k, 12, 1);		// 自动合计
															else
																Grid.Refresh(k, 11, 1);
															if ( Grid.UpdateInTime == true )
																Grid.Sum();
														}
													}
													return false;
												}
											}
											else if( (GetGridType(GridId,1) == 20 ||GetGridType(GridId,1) == 21) && GetGridType(GridId,2) == 0 ){ //双grid出库
												if ( (document.all("OUserCode_Edit" + k).value == document.all("OUserCode_Edit" + row).value) || (document.all("OEntryCode_Edit" + k).value == document.all("OUserCode_Edit" + row).value) ){
													document.all("OUserCode_Edit" + row).value = "";
													document.all("OUserCode_Edit" + row).select();
													if ( document.all("OQty_Edit" + k) != null ){
														if ( !isNaN(parseFloat(document.all("OQty_Edit" + k).value)) ){
															document.all("OQty_Edit" + k).value = parseFloat(document.all("OQty_Edit" + k).value) + 1;
														}
														else{
															document.all("OQty_Edit" + k).value = 1;
														}
														if ( args[1] == "GridOut" ) {
															GridOut.Refresh(k, 12, 1);	// 自动合计
															GridOut.Refresh(k, 11, 1);	// 自动合计
															if ( GridOut.UpdateInTime )
																GridOut.Sum();
														}
													
													}
													return false;
												}
											}
											else if( (GetGridType(GridId,1) == 20 ||GetGridType(GridId,1) == 21) && GetGridType(GridId,2) == 1 ){//双grid入库
												if ( (document.all("IUserCode_Edit" + k).value == document.all("IUserCode_Edit" + row).value) || (document.all("IEntryCode_Edit" + k).value == document.all("IUserCode_Edit" + row).value) ){
													document.all("IUserCode_Edit" + row).value = "";
													document.all("IUserCode_Edit" + row).select();
													if ( document.all("IQty_Edit" + k) != null ){
														if ( !isNaN(parseFloat(document.all("IQty_Edit" + k).value)) ){
															document.all("IQty_Edit" + k).value = parseFloat(document.all("IQty_Edit" + k).value) + 1;
														}
														else{
															document.all("IQty_Edit" + k).value = 1;
														}
														if ( args[1] == "GridIn" ) {
															GridIn.Refresh(k, 12, 1);	// 自动合计
															GridIn.Refresh(k, 11, 1);	// 自动合计
															if ( GridIn.UpdateInTime )
																GridIn.Sum();
														}
													
													}
													return false;
												}
											}
										}
									}
								}
							}
						}
						//结束徐辉 2004-10-18 扫描枪输入商品编码，条形码商品数量加1
						document.all(arg[i] + row).focus();
					}
					else{
						for ( var m = 1; (i+m)<arg.length ; m++ ){
							if ( document.all(arg[i+m] + row) != null ){
								if ( document.all(arg[i+m] + row).disabled == false ){
									document.all(arg[i+m] + row).focus();
									break;
								}	
							}
							if ( (i+m) == (arg.length - 1) ) {
								if ( parseInt(row) >= args[0].rows.length - 2 ){
									eval(args[2]);	// 新增一行
									if ( typeof(SetBillColsDisplay) == "function" ){ //单据列控制
										SetBillColsDisplay();
									}
									if ( typeof(SetBillColsDisplayOut) == "function" ){ //单据列控制
										SetBillColsDisplayOut();
									}
									if ( typeof(SetBillColsDisplayIn) == "function" ){ //单据列控制
										SetBillColsDisplayIn();
									}
								}
								row = parseInt(row) + 1;
								i = 0;
								if ( document.all(arg[i] + row) != null ){
									document.all(arg[i] + row).focus();
									return;
								}
							}
						}
					}
				}
				else
					if ( document.all(arg[i+1] + row) != null ){
						document.all(arg[i+1] + row).focus();
					}	
			}

		}
		// Alt + S 触发序列号查询页 
		if ( event.altKey && event.keyCode == 83 ) {
			if ( document.all.hdnBillType != null ) { //(排除货位分配单,货分单另有方式)
				if ( document.all.hdnBillType.value == "152" || document.all.hdnBillType.value == "153" )
					return false;
			}
			//审核通过标志，处理审核后单据序列号需要
			var isGridDisabled;
			isGridDisabled = 0;
			if( document.all("hdnGridReadOnly") != null ){
				ishdnGridReadOnly =  document.all("hdnGridReadOnly").value;
						
				if ((ishdnGridReadOnly == 1) && (ishdnGridReadOnly !="''")){
					isGridDisabled = 1;
				}
				else{
					isGridDisabled = 0;
				}
			}
			temp = event.srcElement.name;
			if ( temp.substr(0, 11) == "Serial_Edit" ) {
				row = temp.substr(11, temp.length - 11);
				if ( document.all("SerialIn" + row).value == "" ){
					alert("【系统提示】\n\n您还没有录入任何序列号，请确认后重试！	\n");
					return false;
				}
				if ( args[1] == "GridIn" )
					WindowOpenURL( '../VCH/DealSerial.asp?Type=CIn&row=' + row + '&isGridDisabled='+isGridDisabled, '500', '380', 'DealSerialInWin' )
				else
					WindowOpenURL( '../VCH/DealSerial.asp?Type=In&row=' + row + '&isGridDisabled='+isGridDisabled, '500', '380', 'DealSerialInWin' )
				return;
			}
			if ( temp.substr(0, 14) == "SerialSel_Edit" ) {
				row = temp.substr(14, temp.length - 14);
				if ( document.all("SerialOut" + row).value == "" ) {
					alert("【系统提示】\n\n您还没有录入任何序列号，请确认后重试！	\n");
					return false;
				}
				if ( args[1] == "GridOut" )
					WindowOpenURL( '../VCH/DealSerial.asp?Type=COut&row=' + row + '&isGridDisabled='+isGridDisabled, '500', '380', 'DealSerialOutWin' )
				else
					WindowOpenURL( '../VCH/DealSerial.asp?Type=Out&row=' + row + '&isGridDisabled='+isGridDisabled, '500', '380', 'DealSerialOutWin' )
				return;
			}
			if ( temp.substr(0, 15) == "ISerialSel_Edit" ) {//销售换货入库
				row = temp.substr(15, temp.length - 15);
				if ( document.all("ISerialOut" + row).value == "" ) {
					alert("【系统提示】\n\n您还没有录入任何序列号，请确认后重试！	\n");
					return false;
				}
				WindowOpenURL( '../VCH/DealSerial.asp?Type=TIn&row=' + row + '&isGridDisabled='+isGridDisabled, '500', '380', 'DealSerialOutWin' )
				return;
			}
			if ( temp.substr(0, 15) == "OSerialSel_Edit" ) {//销售换货出库
				row = temp.substr(15, temp.length - 15);
				if ( document.all("OSerialOut" + row).value == "" ) {
					alert("【系统提示】\n\n您还没有录入任何序列号，请确认后重试！	\n");
					return false;
				}
				WindowOpenURL( '../VCH/DealSerial.asp?Type=TOut&row=' + row + '&isGridDisabled='+isGridDisabled, '500', '380', 'DealSerialOutWin' )
				return;
			}
		}
		
		// Ctrl + Delete 组合键删除本行
		if ( event.ctrlKey && event.keyCode == 46 ) {
			temp = event.srcElement.name;
			tempName = "";
			row = "";
			for ( i = 0; i < temp.length; i++ ) {
				if ( !isNaN(temp.substring(i, i + 1)) ) {
					row = row + temp.substring(i, i + 1);
				}
				else {
					tempName = tempName + temp.substring(i, i + 1);
				}
			}
			row = parseInt(row);
			eval(args[1] + ".DeleteRow(row)");
			temp = tempName;
			if ( row > 1 ) {	// 非第一行
				if ( document.all(temp + (row - 1)) ){
					document.all(temp + (row - 1)).focus();
				}
			}
			else {	// 第一行
				if (document.all(temp + row) != null ){
					document.all(temp + row).focus();
				}
			}
		}

		//Alt + i 组合键激活 “连续序列号录入”窗口
		//Roamer Wu 2003-09-11
		if (event.altKey && event.keyCode == 73 ) { //徐辉2006-4-11 屏蔽掉借进单据
			var srcName = event.srcElement.name;
			
			if ( args[1] == "Grid" )
			{
				if ( Grid.id == 22 )
				{
					//return false; 徐辉V3.9放开借进Alt + i
				}
			}
			
			row = "";
			for ( i = 0; i < srcName.length; i++ ) {
				if ( !isNaN(srcName.substring(i, i + 1)) ) {
					row = row + srcName.substring(i, i + 1);
				}
			}
			
			if ( srcName != "Serial_Edit" + row && srcName != "SerialSel_Edit" + row && srcName != "ISerialSel_Edit" + row && srcName != "OSerialSel_Edit" + row)
				return false;
			
			if ( document.all("SerialIn" + row) == null && document.all("SerialOut" + row) == null && document.all("ISerialOut" + row) == null && document.all("OSerialOut" + row) == null  )		//非序列号录入单据，退出！
				return false;
			
			if ( args[1] == "Grid" ) {
				if ( document.all("UserCode_Edit" + row) != null ){
					if ( document.all("UserCode_Edit" + row).value == "" ){
						alert("【系统提示】\n\n 请先选择商品！")
						return;
					}
				}
			}
			
			if ( args[1] == "GridIn" ) {
				if ( document.all("IUserCode_Edit" + row) != null ){
					if ( document.all("IUserCode_Edit" + row).value == "" ){
						alert("【系统提示】\n\n 请先选择商品！！")
						return;
					}
				}
			}
			
			if ( args[1] == "GridOut" ) {
				if ( document.all("OUserCode_Edit" + row) != null ){
					if ( document.all("OUserCode_Edit" + row).value == "" ){
						alert("【系统提示】\n\n 请先选择商品！！")
						return;
					}
				}
			}
			
			//V4.0 序列号强制模式，非序列号商品不允许弹出序列号录入
			if ( document.all("hdnSysMngSerial") != null ){
				if ( document.all("hdnSysMngSerial").value == 1 ){
					if ( args[1] == "Grid" ) {
						if ( document.all("IfSerial" + row).value == 0 ){
							alert("【系统提示】\n\n 第" + row +"行商品是非序列号商品，不能录入序列号！！")
							return false;
						}
					}
					if ( args[1] == "GridOut" ) {
						if ( document.all("OIfSerial" + row).value == 0 ){
							alert("【系统提示】\n\n 第" + row +"行商品是非序列号商品，不能录入序列号！！")
							return false;
						}
					}
					if ( args[1] == "GridIn" ) {
						if ( document.all("IIfSerial" + row).value == 0 ){
							alert("【系统提示】\n\n 第" + row +"行商品是非序列号商品，不能录入序列号！！")
							return false;
						}
					}
				}
			}
			
			//徐辉V4.0添加序列号位数限制。
			var strUserCode,strBillType
			if ( args[1] == "Grid" ) {
				strUserCode = document.all("UserCode_Edit" + row).value;
				if( document.all("hdnBillType") != null ){
					strBillType = document.all("hdnBillType").value;
				}
				else{
					strBillType = "";
				}
			}
			if ( args[1] == "GridIn" ) {
				strUserCode = document.all("IUserCode_Edit" + row).value;
				if( document.all("hdnBillType") != null ){
					strBillType = document.all("hdnBillType").value.toString() + '01';
				}
				else{
					strBillType = "";
				}
			}
			if ( args[1] == "GridOut" ) {
				strUserCode = document.all("OUserCode_Edit" + row).value;
				if( document.all("hdnBillType") != null ){
					strBillType = document.all("hdnBillType").value.toString() + '02';
				}
				else{
					strBillType = "";
				}
			}
			
			var strMultiSerial = new Array;
			re = showModalDialog('../vch/j_SerialMultiInput.asp?TimeCheckPoint=' + GetTimeCheckPoint('','') + '&UserCode='+strUserCode+'&BillType=' + strBillType,strMultiSerial,'center:1;dialogHeight:480px;dialogWidth:440px;help:0;status:0');
			if (re == 1){
				if ( srcName == "Serial_Edit" + row ){
					if (document.all("SerialIn" + row).value == "")
						document.all("SerialIn" + row).value = strMultiSerial[0];
					else
						document.all("SerialIn" + row).value = document.all("SerialIn" + row).value + "я" + strMultiSerial[0];
				
					var nSerial = document.all("SerialIn" + row).value.split("я").length;
					
					//审核通过的草稿，只录入序列号
					if ( isGridDisabled ){
						return false;
					}
					if ( args[1] == "Grid" ) {
						document.all("Qty_edit" + row).value = nSerial;
						Grid.Refresh(row, 11, 1);		// 自动合计
						if ( Grid.UpdateInTime == true )
								Grid.Sum();
					}
					if ( args[1] == "GridIn" ) {			//折装入库单,换货单
							document.all("IQty_edit" + row).value = nSerial;
							if ( GridIn.id == 26 ){ //换货单,维修单
								GridIn.Refresh(row,10, 1);	// 自动合计
								if ( GridIn.UpdateInTime )
								GridIn.Sum();
							}
							else{//折装入库单
								GridIn.Refresh(row, 11, 1);	// 自动合计
								if ( GridIn.UpdateInTime )
									GridIn.Sum();
							}
					}
				}
				else if ( srcName == "ISerialSel_Edit" + row ){ //销售采购换货单 入库序列号
					if (document.all("ISerialOut" + row).value == "")
						document.all("ISerialOut" + row).value = strMultiSerial[0];
					else
						document.all("ISerialOut" + row).value = document.all("ISerialOut" + row).value + "я" + strMultiSerial[0];
				
					var nSerial = document.all("ISerialOut" + row).value.split("я").length;
					
					//审核通过的草稿，只录入序列号
					if ( isGridDisabled ){
						return false;
					}
					
					if ( args[1] == "GridIn" ) {			//折装入库单,换货单
						document.all("IQty_edit" + row).value = nSerial;
						GridIn.Refresh(row,12, 1);	// 自动合计
						if ( GridIn.UpdateInTime )
							GridIn.Sum();
							
					}
				}
				else if ( srcName == "OSerialSel_Edit" + row ){ //销售采购换货单 出库序列号
					if (document.all("OSerialOut" + row).value == "")
						document.all("OSerialOut" + row).value = strMultiSerial[0];
					else
						document.all("OSerialOut" + row).value = document.all("OSerialOut" + row).value + "я" + strMultiSerial[0];
				
					var nSerial = document.all("OSerialOut" + row).value.split("я").length;
					
					//审核通过的草稿，只录入序列号
					if ( isGridDisabled ){
						return false;
					}
					
					if ( args[1] == "GridOut" ) {			//折装入库单,换货单
						document.all("OQty_edit" + row).value = nSerial;
						GridOut.Refresh(row,12, 1);	// 自动合计
						if ( GridOut.UpdateInTime )
							GridOut.Sum();
							
					}
				}
				else{
					if (document.all("SerialOut" + row).value == "")
						document.all("SerialOut" + row).value = strMultiSerial[0];
					else
						document.all("SerialOut" + row).value = document.all("SerialOut" + row).value + "я" + strMultiSerial[0];
				
					var nSerial = document.all("SerialOut" + row).value.split("я").length;
					
					//审核通过的草稿，只录入序列号
					if ( isGridDisabled ){
						return false;
					}
					
					if ( args[1] == "Grid" ) {
						document.all("Qty_edit" + row).value = nSerial;
						Grid.Refresh(row, 12, 1);		// 自动合计
						if ( Grid.UpdateInTime == true )
								Grid.Sum();
					}
					if ( args[1] == "GridOut" ) {			//折装入库单
							document.all("OQty_edit" + row).value = nSerial;
							if ( GridOut.id == 27 ){ //换货单,维修单
								GridOut.Refresh(row, 11, 1);	// 自动合计
								if ( GridOut.UpdateInTime )
								GridOut.Sum();
							}
							else{ //折装入库单
								GridOut.Refresh(row, 12, 1);	// 自动合计
								if ( GridOut.UpdateInTime )
									GridOut.Sum();
							}
					}
				}
			}
			return false;
		}
	}

	// 上下移动表格光标 第一个参数传递表格对象
	function MoveUpDownCursor() {
		var args = MoveUpDownCursor.arguments;
		var temp;
		var row;
		var i;
		
		var ob;
		ob = args[0];

		// 没有参数退出
		if ( args.length == 0 ) return;

		// 上移下移
		if ( event.keyCode == 38 || event.keyCode == 40 ) {
			temp = event.srcElement.name;
			if ( typeof(temp) == "undefined" ) return;
			row = -1;
			//跳过第一个参数
			for ( i = 1; i < args.length; i++ ) {
				if ( temp.indexOf(args[i]) == 0 ) { //徐辉 2004-4-23修改前 if ( temp.indexOf(args[i]) != -1 ) {
					row = temp.substring(args[i].length);
					break;
				}
			}

			if ( row == -1 ) return;

			if ( event.keyCode == 38 ) {	// 上
				if ( parseInt(row) > 1 ) {
					//row = parseInt(row) - 1;
					if ( ob.rows[parseInt(row) - 1].all(args[i] + (parseInt(row) - 1)).disabled != true ) {
						row = row - 1;
					}
				}
				else {
					if ( document.all.Grid != null )
						row = parseInt(Grid.rows);
				}
				ob.rows[row].all(args[i] + row).focus();
			}

			if ( event.keyCode == 40 ) {	// 下
				if ( parseInt(row) < MoveUpDownCursor.arguments[0].rows.length - 2 ){
					if ( ob.rows[parseInt(row) + 1].all(args[i] + (parseInt(row) + 1)).disabled != true )
					row = parseInt(row) + 1;
				}
				else
					row = 1;
				if ( typeof(ob.rows[row].all(args[i] + row)) == "object" ){
					if ( ob.rows[row].all(args[i] + row).disabled == false ){
						ob.rows[row].all(args[i] + row).focus();
					}
				}
			}
		}

		if ( event.ctrlKey && event.keyCode == 71 ) {
			//alert("hehe");
		}
	}
	
	function Refresh(row, col, flag, UnitRate1, v ) {
		var dNum;

		var ob = document.all(this.ColEditName[col] + row);
		var off;
		var startoff, endoff;
		var l, r;
		var temp;
		var t;
		var b;
		var d1, d2, d3;
		var obgrid;

		obgrid = document.all(this.name);//grid，table对象
		if ( obgrid == null ) return;

		if ( ob == null ) return;
		if ( ob.value != "" ) {
			for ( var off=0 ; off<this.NumericCols.length ; off++ ){
				if ( col == this.NumericCols[off] ){
					
					dNum = parseFloat(ob.value);
					if ( isNaN(dNum) ){
						ob.value = "0";
					}
					else{
						ob.value = this.FormatCol(dNum,col);
					}
					
					dNum = parseFloat(ob.value);
					
				}
			}
		}
		

		////////////////////////////////////3.66///////////////////
		var FlagIfSerial
		FlagIfSerial = "";
		if ( obgrid.rows[row].all("IIfSerial" + row) != null ){
			FlagIfSerial = "IIfSerial";
		}
		if ( obgrid.rows[row].all("OIfSerial" + row) != null ){
			FlagIfSerial = "OIfSerial";
		}
		if ( obgrid.rows[row].all("IfSerial" + row) != null ){
			FlagIfSerial = "IfSerial";
		}

		/////////////////检查序列号商品带出数量1///////3.66/////////////
		if( FlagIfSerial != "" ){
			if ( obgrid.rows[row].all(FlagIfSerial+row) != null ){
				if( obgrid.rows[row].all(FlagIfSerial+row).value == 1 ){
					if( FlagIfSerial == "IIfSerial"  && obgrid.rows[row].all("IQty_Edit"+row) != null){
						if( obgrid.rows[row].all("IQty_Edit"+row).value == ""){
							obgrid.rows[row].all("IQty_Edit"+row).value = 1 ;
						}
					}
					if( FlagIfSerial == "OIfSerial"  && obgrid.rows[row].all("OQty_Edit"+row) != null){
						if( obgrid.rows[row].all("OQty_Edit"+row).value == ""){
							obgrid.rows[row].all("OQty_Edit"+row).value = 1 ;
						}
					}
					if( FlagIfSerial == "IfSerial"  && obgrid.rows[row].all("Qty_Edit"+row) != null){
						if( obgrid.rows[row].all("Qty_Edit"+row).value == ""){
							obgrid.rows[row].all("Qty_Edit"+row).value = 1 ;
						}
					}
				}
			}
		}

		
		//////////////////////////////////////

		// 换算双单位，并写入新的数量、单价
		if ( UnitRate1 != null ) {
			if ( this.id == 13 || this.id == 14 || this.id == 30 || this.id == 32 ) {	// 折扣
				//tran()函数是避免小数相乘是产生误差而自定义的相乘函数	
				obgrid.rows[row].all("Qty_Edit" + row).value =  tran(obgrid.rows[row].all("Qty_Edit" + row).value , UnitRate1); 
				obgrid.rows[row].all("Price_Edit" + row).value = tran( obgrid.rows[row].all("Price_Edit" + row).value , 1/UnitRate1);
				obgrid.rows[row].all("DiscountPrice_Edit" + row).value = tran(obgrid.rows[row].all("DiscountPrice_Edit" + row).value , 1/UnitRate1);
				obgrid.rows[row].all("Unit_Edit" + row).value = v;
				if ( obgrid.rows[row].all("PlanQty_Edit" + row) != null ){
					obgrid.rows[row].all("PlanQty_Edit" + row).value = tran(obgrid.rows[row].all("PlanQty_Edit" + row).value, UnitRate1);
				}
			}
			else if ( this.id == 2 || this.id == 12 || this.id == 29 || this.id == 31) {	// 税率
				obgrid.rows[row].all("Qty_Edit" + row).value = tran( obgrid.rows[row].all("Qty_Edit" + row).value , UnitRate1);
				obgrid.rows[row].all("Price_Edit" + row).value = tran(obgrid.rows[row].all("Price_Edit" + row).value , 1/UnitRate1);
				obgrid.rows[row].all("TaxPrice_Edit" + row).value = tran( obgrid.rows[row].all("TaxPrice_Edit" + row).value , 1/UnitRate1);
				obgrid.rows[row].all("Unit_Edit" + row).value = v;
				if ( obgrid.rows[row].all("PlanQty_Edit" + row) != null ){
					obgrid.rows[row].all("PlanQty_Edit" + row).value = tran(obgrid.rows[row].all("PlanQty_Edit" + row).value, UnitRate1);
				}
			}
			else if ( this.id == 1 || this.id == 15 || this.id == 16 || this.id == 20 || this.id == 21 ) {
				obgrid.rows[row].all("Qty_Edit" + row).value = tran(obgrid.rows[row].all("Qty_Edit" + row).value , UnitRate1);
				if (this.id == 20 || this.id == 21)
				{
					if (obgrid.rows[row].all("ConsignmentQty_Edit" + row).value != ''){
						obgrid.rows[row].all("ConsignmentQty_Edit" + row).value = tran(obgrid.rows[row].all("ConsignmentQty_Edit" + row).value , UnitRate1);
					}
				}
				obgrid.rows[row].all("Price_Edit" + row).value = tran(document.all("Price_Edit" + row).value , 1/UnitRate1);
				obgrid.rows[row].all("Unit_Edit" + row).value = v;
				if ( obgrid.rows[row].all("PlanQty_Edit" + row) != null ){
					obgrid.rows[row].all("PlanQty_Edit" + row).value = tran(obgrid.rows[row].all("PlanQty_Edit" + row).value, UnitRate1);
				}
				
			}
			else if ( this.id == 28 ) {	//同价调拨
				obgrid.rows[row].all("Qty_Edit" + row).value = tran( obgrid.rows[row].all("Qty_Edit" + row).value , UnitRate1);
				obgrid.rows[row].all("Price_Edit" + row).value = tran(obgrid.rows[row].all("Price_Edit" + row).value , 1/UnitRate1);
				obgrid.rows[row].all("Unit_Edit" + row).value = v;
			}
			else if( this.id == 1513 || this.id == 1512 ){ //销售换货单普通格式入库、采购换货单普通格式 入库
				obgrid.rows[row].all("IQty_Edit" + row).value = tran(obgrid.rows[row].all("IQty_Edit" + row).value , UnitRate1);
				obgrid.rows[row].all("IPrice_Edit" + row).value = tran(document.all("IPrice_Edit" + row).value , 1/UnitRate1);
				obgrid.rows[row].all("IUnit_Edit" + row).value = v;
			}
			else if( this.id == 1511 || this.id == 1514 ){ //销售换货单普通格式出库、采购换货单普通格式 出库
				obgrid.rows[row].all("OQty_Edit" + row).value = tran(obgrid.rows[row].all("OQty_Edit" + row).value , UnitRate1);
				obgrid.rows[row].all("OPrice_Edit" + row).value = tran(document.all("OPrice_Edit" + row).value , 1/UnitRate1);
				obgrid.rows[row].all("OUnit_Edit" + row).value = v;
			}
			else if( this.id == 1522 || this.id == 1523 ){ //销售换货单折扣格式入库、采购换货单折扣格式 入库
				obgrid.rows[row].all("IQty_Edit" + row).value =  tran(obgrid.rows[row].all("IQty_Edit" + row).value , UnitRate1); 
				obgrid.rows[row].all("IPrice_Edit" + row).value = tran( obgrid.rows[row].all("IPrice_Edit" + row).value , 1/UnitRate1);
				obgrid.rows[row].all("IDiscountPrice_Edit" + row).value = tran(obgrid.rows[row].all("IDiscountPrice_Edit" + row).value , 1/UnitRate1);
				obgrid.rows[row].all("IUnit_Edit" + row).value = v;
			}
			else if( this.id == 1521 || this.id == 1524 ){ //销售换货单折扣格式 出库、采购换货单折扣格式 出库
				obgrid.rows[row].all("OQty_Edit" + row).value =  tran(obgrid.rows[row].all("OQty_Edit" + row).value , UnitRate1); 
				obgrid.rows[row].all("OPrice_Edit" + row).value = tran( obgrid.rows[row].all("OPrice_Edit" + row).value , 1/UnitRate1);
				obgrid.rows[row].all("ODiscountPrice_Edit" + row).value = tran(obgrid.rows[row].all("ODiscountPrice_Edit" + row).value , 1/UnitRate1);
				obgrid.rows[row].all("OUnit_Edit" + row).value = v;
			}
			else if (this.id == 1532 || this.id == 1533 ) {	// 销售换货单税率格式 入库、采购换货单税率格式 入库
				obgrid.rows[row].all("IQty_Edit" + row).value = tran( obgrid.rows[row].all("IQty_Edit" + row).value , UnitRate1);
				obgrid.rows[row].all("IPrice_Edit" + row).value = tran(obgrid.rows[row].all("IPrice_Edit" + row).value , 1/UnitRate1);
				obgrid.rows[row].all("ITaxPrice_Edit" + row).value = tran( obgrid.rows[row].all("ITaxPrice_Edit" + row).value , 1/UnitRate1);
				obgrid.rows[row].all("IUnit_Edit" + row).value = v;
			}
			else if ( this.id == 1531 || this.id == 1534  ) {	// 销售换货单税率格式 出库、采购换货单税率格式 出库
				obgrid.rows[row].all("OQty_Edit" + row).value = tran( obgrid.rows[row].all("OQty_Edit" + row).value , UnitRate1);
				obgrid.rows[row].all("OPrice_Edit" + row).value = tran(obgrid.rows[row].all("OPrice_Edit" + row).value , 1/UnitRate1);
				obgrid.rows[row].all("OTaxPrice_Edit" + row).value = tran( obgrid.rows[row].all("OTaxPrice_Edit" + row).value , 1/UnitRate1);
				obgrid.rows[row].all("OUnit_Edit" + row).value = v;
			}
			else{
				obgrid.rows[row].all("Qty_Edit" + row).value = tran(obgrid.rows[row].all("Qty_Edit" + row).value , UnitRate1);
				if ( obgrid.rows[row].all("Price_Edit" + row) != null ){
					obgrid.rows[row].all("Price_Edit" + row).value = tran(obgrid.rows[row].all("Price_Edit" + row).value , 1/UnitRate1);
				}
				obgrid.rows[row].all("Unit_Edit" + row).value = v;
			}
		}
		if ( this.id != 6 && this.id != 7 && this.id != 26 && this.id != 27 && this.id != 22 && this.id != 25 && this.id != 10 && this.id != 9 && this.id != 11) {  //维修借欠单据不加双单位
			//单位换算，单位描述
			
			///////////////////////////创建对象有变化，做多个判断，因为以前的双grid是没有I,O区分的
			var tQty;
			if( GetGridType(this.id,1)==10 ){
				tQty = obgrid.rows[row].all("Qty_Edit" + row)
			}
			else if( GetGridType(this.id,2)==0 ){
				if( obgrid.rows[row].all("OQty_Edit" + row) != null){
					tQty = obgrid.rows[row].all("OQty_Edit" + row);
				}
			}
			else if( GetGridType(this.id,2)==1 ){
				if( obgrid.rows[row].all("IQty_Edit" + row) != null){
					tQty = obgrid.rows[row].all("IQty_Edit" + row);
				}
			}
			if (tQty != null){
				if ( isNaN(parseFloat(tQty.value)) ) { //数量无效
					if ( tQty.value == "" ){
						tQty.value = "";
					}
					else{
						tQty.value = 0;
					}
				}
				else{
					var UnitOne,UnitTwo,UnitRate,assistantUnit,isUnitTow
					/////////////////////////////////创建对象开始//////////////
					if( GetGridType(this.id,1)==10 ){
						UnitOne = obgrid.rows[row].all("UnitOne" + row);
						UnitTwo = obgrid.rows[row].all("UnitTwo" + row);
						UnitRate = obgrid.rows[row].all("UnitRate" + row);
						assistantUnit = obgrid.rows[row].all("AssistantUnit_Edit" + row);
						isUnitTow = obgrid.rows[row].all("isUnitTow" + row);
					}
					else if( GetGridType(this.id,2)==0 ){
						if( obgrid.rows[row].all("UnitOne" + row) != null){
							UnitOne = obgrid.rows[row].all("UnitOne" + row);
						}
						else{
							UnitOne = obgrid.rows[row].all("OUnitOne" + row);
						}
						if( obgrid.rows[row].all("UnitTwo" + row) != null){
							UnitTwo = obgrid.rows[row].all("UnitTwo" + row);
						}
						else{
							UnitTwo = obgrid.rows[row].all("OUnitTwo" + row);
						}
						if( obgrid.rows[row].all("UnitRate" + row) != null){
							UnitRate = obgrid.rows[row].all("UnitRate" + row);
						}
						else{
							UnitRate = obgrid.rows[row].all("OUnitRate" + row);
						}
						if( obgrid.rows[row].all("AssistantUnit_Edit" + row) != null){
							assistantUnit = obgrid.rows[row].all("AssistantUnit_Edit" + row);
						}
						else{
							assistantUnit = obgrid.rows[row].all("OAssistantUnit_Edit" + row);
						}
						if( obgrid.rows[row].all("isUnitTow" + row) != null){
							isUnitTow = obgrid.rows[row].all("isUnitTow" + row);
						}
						else{
							isUnitTow = obgrid.rows[row].all("OisUnitTow" + row);
						}
					}
					else if( GetGridType(this.id,2)==1 ){
						if( obgrid.rows[row].all("UnitOne" + row) != null){
							UnitOne = obgrid.rows[row].all("UnitOne" + row);
						}
						else{
							UnitOne = obgrid.rows[row].all("IUnitOne" + row);
						}
						if( obgrid.rows[row].all("UnitTwo" + row) != null){
							UnitTwo = obgrid.rows[row].all("UnitTwo" + row);
						}
						else{
							UnitTwo = obgrid.rows[row].all("IUnitTwo" + row);
						}
						if( obgrid.rows[row].all("UnitRate" + row) != null){
							UnitRate = obgrid.rows[row].all("UnitRate" + row);
						}
						else{
							UnitRate = obgrid.rows[row].all("IUnitRate" + row);
						}
						if( obgrid.rows[row].all("AssistantUnit_Edit" + row) != null){
							assistantUnit = obgrid.rows[row].all("AssistantUnit_Edit" + row);
						}
						else{
							assistantUnit = obgrid.rows[row].all("IAssistantUnit_Edit" + row);
						}
						if( obgrid.rows[row].all("isUnitTow" + row) != null){
							isUnitTow = obgrid.rows[row].all("isUnitTow" + row);
						}
						else{
							isUnitTow = obgrid.rows[row].all("IisUnitTow" + row);
						}
					}
					///////////////////////test////////////////////////
					//alert(UnitOne.value+'--'+UnitTwo.value+'--'+UnitRate.value+'--'+assistantUnit.value);
					//alert(typeof(UnitOne)+'--'+typeof(UnitTwo)+'--'+typeof(UnitRate)+'--'+typeof(assistantUnit));
					/////////////////////////////////创建对象结束//////////////
					if ( UnitOne != null && UnitTwo != null && UnitRate !=null ){
						if ( UnitRate.value == "" || UnitOne.value == "" || UnitTwo.value == "" ){
							if ( assistantUnit != null ) {
								assistantUnit.value = "";
							}
						}
						else{ 
							if ( isUnitTow.value == 0 ){ //小单位
								if ( assistantUnit != null ) {
									assistantUnit.value = GetAssistantUnit(UnitOne.value,UnitTwo.value,UnitRate.value,tQty.value,1);
								}
							}
							if ( isUnitTow.value == 1 ){ //大单位
								if ( assistantUnit != null ) {
									assistantUnit.value = GetAssistantUnit(UnitOne.value,UnitTwo.value,UnitRate.value,tQty.value,2);
								}
							}
						}
					}
				}
					
			}
			//单位换算，单位描述完
		}
		// 检查该列是否位于需要计算结果列
		for ( off = 0; off < this.ResultCols.length; off++ ) {
			if ( this.ResultCols[off] == col ) {
				// 按单结算
				if ( this.id == 17 ) {
					if ( col == 5 )
						temp = obgrid.rows[row].all(this.ColEditName[4] + row).value;
						temp = parseFloat(temp);
						if ( isNaN(temp) ) return;
						if ( dNum > temp ) {
							alert("结算金额不能大于未结算金额！");
							ob.value = 0;
						}
				}
				else if ( this.id == 6 ) {	// 拆装出库
					if ( col == 11 || col == 12 ) {
						if ( obgrid.rows[row].all("OPrice_Edit" + row).value != "" ){
							obgrid.rows[row].all("OTotal_Edit" + row).value = this.FormatCol(obgrid.rows[row].all("OQty_Edit" + row).value * obgrid.rows[row].all("OPrice_Edit" + row).value,14);	
						}
					}
				}
				else if ( this.id == 7 ) {	// 拆装入库
					if ( col == 11 || col == 12 ) {
						if ( obgrid.rows[row].all("IPrice_Edit" + row).value != "" ){
							obgrid.rows[row].all("ITotal_Edit" + row).value = this.FormatCol(obgrid.rows[row].all("IQty_Edit" + row).value * obgrid.rows[row].all("IPrice_Edit" + row).value,13);
						}					
					}
				}
				else if ( this.id == 24 && this.specialproperty == "DF" ) //货位调拨单
					obgrid.rows[row].all("Total_Edit" + row).value = Math.round(obgrid.rows[row].all("Qty_Edit" + row).value * obgrid.rows[row].all("Price_Edit" + row).value * 100) / 100;
				else if ( this.id == 28 ){ //同价调拨单
					if ( col == 12 || col == 15 ){
						if ( obgrid.rows[row].all("Price_Edit" + row).value != "" ){
							obgrid.rows[row].all("Total_Edit" + row).value = Math.round(obgrid.rows[row].all("Qty_Edit" + row).value * obgrid.rows[row].all("Price_Edit" + row).value * 100) / 100;
						}
					}
					if ( col == 16 ){ //同价调拨单,金额改变反算单价
						if( !isNaN(parseFloat(obgrid.rows[row].all("Qty_Edit" + row).value)) && parseFloat(obgrid.rows[row].all("Qty_Edit" + row).value) != 0){
							if ( !isNaN(parseFloat(obgrid.rows[row].all("Total_Edit" + row).value)) ){
								obgrid.rows[row].all("Price_Edit" + row).value = Math.round(parseFloat(obgrid.rows[row].all("Total_Edit" + row).value) / parseFloat(obgrid.rows[row].all("Qty_Edit" + row).value) * 10000)/10000;
								//alert(obgrid.rows[row].all("Price_Edit" + row).value);
							}
						}
					}
				}
				else if ( this.id == 34 ){ //销售发票，采购发票
					switch (col) {
						case 9: //数量改变
							r = document.all("Price_Edit" + row);
							// 有预设价
							if ( !isNaN(parseFloat(r.value)) && parseFloat(r.value) != 0 ) {
								r = document.all("NoTaxTotal_Edit" + row);
								r.value = document.all("Qty_Edit" + row).value * document.all("Price_Edit" + row).value
								// 税前金额
								r.value = this.FormatCol(r.value,11);

								// 税前单价
								d1 = document.all("Price_Edit" + row).value;
								// 检查税后单价
								r = document.all("TaxPrice_Edit" + row);
								r.value = d1 * (1 + document.all("TaxRate_Edit" + row).value/100);
								// 税后单价
								r.value = this.FormatCol(r.value,13);
								d1 = r.value;
								r = document.all("Total_Edit" + row);
								//r.value=d1*(1+document.all("TaxRate_Edit" + row).value/100);
								r.value = document.all("Qty_Edit" + row).value * document.all("TaxPrice_Edit" + row).value;
								// 税后金额
								r.value = this.FormatCol(r.value,14);		
							}
							else {
								// 税后单价 
								r = document.all("TaxPrice_Edit" + row);
								// 有税后价
								if ( !isNaN(parseFloat(r.value)) && parseFloat(r.value) != 0 ) {
									r = document.all("Total_Edit" + row);
									r.value = document.all("Qty_Edit" + row).value * document.all("TaxPrice_Edit" + row).value;
									// 税后金额
									r.value = this.FormatCol(r.value,14);
									d1 = r.value;
									r = document.all("NoTaxTotal_Edit" + row);
									r.value = d1/(1 + document.all("TaxRate_Edit" + row).value/100);
									// 税前金额
									r.value = this.FormatCol(r.value,11);
									d1 = document.all("TaxPrice_Edit" + row).value;
									// 税前单价
									r = document.all("Price_Edit" + row);
									r.value = d1/(1+document.all("TaxRate_Edit" + row).value/100);
									// 税前单价
									r.value = this.FormatCol(r.value,10);
								}
							}
							//税额
							r = document.all("TaxTotal_Edit" + row);
							r.value=document.all("Total_Edit" + row).value - document.all("NoTaxTotal_Edit" + row).value;
							r.value=this.FormatCol(r.value,15);
							break;
						case 10:	// 税前单价变化
							r = document.all("NoTaxTotal_Edit" + row);
							if ( document.all("Qty_Edit" + row).value != "" ){
								r.value = document.all("Qty_Edit" + row).value * document.all("Price_Edit" + row).value;
									// 税前金额
								r.value = this.FormatCol(r.value,11);
							}

							// 税前单价
							d1 = document.all("Price_Edit" + row).value;
							// 检查税后单价
							r = document.all("TaxPrice_Edit" + row);
							r.value = d1 * (1 + document.all("TaxRate_Edit" + row).value/100);
								// 税后单价
							r.value = this.FormatCol(r.value,13);
							d1 = r.value;
							r = document.all("Total_Edit" + row);
							//r.value=d1*(1+document.all("TaxRate_Edit" + row).value/100);
							if ( document.all("Qty_Edit" + row).value != "" ){
								r.value = document.all("Qty_Edit" + row).value * document.all("TaxPrice_Edit" + row).value;
								// 税后金额
								r.value = this.FormatCol(r.value,14);
							}
							//税额
							r = document.all("TaxTotal_Edit" + row);
							r.value=document.all("Total_Edit" + row).value - document.all("NoTaxTotal_Edit" + row).value;
							r.value=this.FormatCol(r.value,15);
							break;
						case 11: //金额改变
							r = document.all("Qty_Edit" + row);
							// 有数量
							if ( !isNaN(parseFloat(r.value)) && parseFloat(r.value) != 0 ) {
								r = document.all("NoTaxTotal_Edit" + row);
								d2 = document.all("Price_Edit" + row)
								//税前单价
								d2.value = r.value/document.all("Qty_Edit" + row).value;
								d2.value = this.FormatCol(d2.value,10);
								//税后单价
								document.all("TaxPrice_Edit" + row).value = d2.value * (1 + document.all("TaxRate_Edit" + row).value/100);
								//税后金额
								document.all("Total_Edit" + row).value = r.value * (1 + document.all("TaxRate_Edit" + row).value/100);
								r = document.all("TaxPrice_Edit" + row);
								d2 = document.all("Total_Edit" + row);
								r.value = this.FormatCol(r.value,13);
								d2.value = this.FormatCol(d2.value,14);
							}
							//税额
							r = document.all("TaxTotal_Edit" + row);
							r.value=document.all("Total_Edit" + row).value - document.all("NoTaxTotal_Edit" + row).value;
							r.value=this.FormatCol(r.value,15);
							break;
						case 13:	// 税后单价发生变化
							r = document.all("Qty_Edit" + row);
							// 有数量
							if ( !isNaN(parseFloat(r.value)) && parseFloat(r.value) != 0 ) {
								r = document.all("Total_Edit" + row);
								r.value = document.all("Qty_Edit" + row).value * document.all("TaxPrice_Edit" + row).value;
								// 税后金额
								r.value = this.FormatCol(r.value,14);

								d2 = r.value;
								r = document.all("NoTaxTotal_Edit" + row);
								r.value = d2/(1 + document.all("TaxRate_Edit" + row).value/100);
								// 税前金额
								r.value = this.FormatCol(r.value,11);

								d1 = document.all("TaxPrice_Edit" + row).value;
								r = document.all("Price_Edit" + row);
								r.value = d1/(1 + document.all("TaxRate_Edit" + row).value/100);
								// 税前单价
								r.value = this.FormatCol(r.value,10);
							}
							//税额
							r = document.all("TaxTotal_Edit" + row);
							r.value=document.all("Total_Edit" + row).value - document.all("NoTaxTotal_Edit" + row).value;
							r.value=this.FormatCol(r.value,15);
							break;
						case 14:	// 价税合计发生变化
							r = document.all("Qty_Edit" + row);
							// 有数量
							if ( !isNaN(parseFloat(r.value)) && parseFloat(r.value) != 0 ) {
								r = document.all("Total_Edit" + row);
								d2 = document.all("TaxPrice_Edit" + row)
								//含税单价
								d2.value = r.value/document.all("Qty_Edit" + row).value;
								d2.value = this.FormatCol(d2.value,13);
								//税前单价
								document.all("Price_Edit" + row).value = d2.value/(1 + document.all("TaxRate_Edit" + row).value/100);
								//税前金额
								document.all("NoTaxTotal_Edit" + row).value = r.value/(1 + document.all("TaxRate_Edit" + row).value/100);
								r = document.all("Price_Edit" + row);
								d2 = document.all("NoTaxTotal_Edit" + row);
								r.value = this.FormatCol(r.value,10);
								d2.value = this.FormatCol(d2.value,11);
							}
							//税额
							r = document.all("TaxTotal_Edit" + row);
							r.value=document.all("Total_Edit" + row).value - document.all("NoTaxTotal_Edit" + row).value;
							r.value=this.FormatCol(r.value,15);
							break;
					}
				}
				////////////////////////////////////////////////////////////
				// 特殊定义折扣计算方法
				else if ( this.id == 13) {  //销售出库折扣格式，零售单，销售退货折扣格式，采购退货单折扣格式，委托代销发货折扣格式，委托代销退货折扣，受托代销退货折扣
					col = col - 1;
					switch (col) {
						case 11:	// 数量发生变化
							r = document.all("Price_Edit" + row);
							// 有销售价
							if ( !isNaN(parseFloat(r.value)) && parseFloat(r.value) != 0 ) {
								r = document.all("NoDiscountTotal_Edit" + row);
								r.value = document.all("Qty_Edit" + row).value * document.all("Price_Edit" + row).value
								// 折前金额
								if ( this.id == 13 )
									r.value = this.FormatCol(r.value,16);
								else
									r.value = this.FormatCol(r.value,15);
								d1 = r.value;
								// 检查折后单价
								r = document.all("DiscountPrice_Edit" + row);
								// 折后单价无效
								if ( isNaN(parseFloat(r.value)) || parseFloat(r.value) == 0 ) {
									// 折前单价
									d1 = document.all("Price_Edit" + row).value;
									// 检查折后单价
									r = document.all("DiscountPrice_Edit" + row);
									r.value = d1 * document.all("Discount_Edit" + row).value;
									// 折后单价
									if ( this.id == 13 )
										r.value = this.FormatCol(r.value,18);
									else
										r.value = this.FormatCol(r.value,17);
									//折后单价
									d2 = r.value;
									r = document.all("Total_Edit" + row);
									r.value = d2 * document.all("Qty_Edit" + row).value;
									// 折后金额
									if ( this.id == 13 )
										r.value = this.FormatCol(r.value,19);
									else
										r.value = this.FormatCol(r.value,18);
								}
								else {
									r = document.all("Discount_Edit" + row);
									r.value=document.all("DiscountPrice_Edit" + row).value/document.all("Price_Edit" + row).value; //计算扣率
									if ( this.id == 13 ){
										r.value = this.FormatCol(r.value,17);
									}
									else{
										r.value = this.FormatCol(r.value,16);
									}
									r = document.all("Total_Edit" + row);
									r.value = document.all("DiscountPrice_Edit" + row).value * document.all("Qty_Edit" + row).value;
									// 折后金额
									if ( this.id == 13 )
										r.value = this.FormatCol(r.value,19);
									else
										r.value = this.FormatCol(r.value,18);
								}
							}
							else {
								// 折后单价
								r = document.all("DiscountPrice_Edit" + row);
								// 有折后价
								if ( !isNaN(parseFloat(r.value)) && parseFloat(r.value) != 0) {
									d1 = r.value;
									r = document.all("Price_Edit" + row);
									r.value = d1/document.all("Discount_Edit" + row).value; //计算折前单价
									if( this.id == 13 ){
										r.value = this.FormatCol(r.value,15);
									}
									r = document.all("Total_Edit" + row);
									r.value = document.all("Qty_Edit" + row).value * document.all("DiscountPrice_Edit" + row).value;
									// 折后金额
									if ( this.id == 13 )
										r.value = this.FormatCol(r.value,19);
									else
										r.value = this.FormatCol(r.value,18);
									d1 = r.value;
									r = document.all("NoDiscountTotal_Edit" + row);
									r.value = ( document.all("Qty_Edit" + row).value * document.all("DiscountPrice_Edit" + row).value)/document.all("Discount_Edit" + row).value;
									// 折前金额
									if ( this.id == 13 )
										r.value = this.FormatCol(r.value,15);
									else
										r.value = this.FormatCol(r.value,14);
									d1 = r.value;
									// 折前单价
									r = document.all("Price_Edit" + row);
									if ( d1 != "0"){
										r.value = ( document.all("Qty_Edit" + row).value * document.all("DiscountPrice_Edit" + row).value)/( document.all("Qty_Edit" + row).value * document.all("Discount_Edit" + row).value);
									}
									// 折前单价
									if ( this.id == 13 )
										r.value = this.FormatCol(r.value,15);
									else
										r.value = this.FormatCol(r.value,14);
								}
							}
							break;
						case 14:	//扣前单价    徐辉2004-4-23 添加折前单价
							//alert("扣前单价");
							r = document.all("Price_Edit" + row);
							r = document.all("NoDiscountTotal_Edit" + row);
							// 折前金额
							r.value = document.all("Qty_Edit" + row).value * document.all("Price_Edit" + row).value
							r.value = this.FormatCol(r.value,16);
								
							d1 = r.value;
							// 折前单价
							d1 = document.all("Price_Edit" + row).value;
							r = document.all("DiscountPrice_Edit" + row);
							r.value = d1 * document.all("Discount_Edit" + row).value;
							// 折后单价
							r.value = this.FormatCol(r.value,18);
								
							d2 = r.value;
							r = document.all("Total_Edit" + row);
							r.value = d2 * document.all("Qty_Edit" + row).value;
							// 折后金额
							r.value = this.FormatCol(r.value,19);
							break;
						case 16:	// 扣率发生变化
							r = document.all("Discount_Edit" + row);
							// 有销售价
							if ( isNaN(parseFloat(r.value)) ) {
								alert("扣率无效！");
								r.value = 1;
							}
							r = document.all("Price_Edit" + row);
							// 有折前单价
							if ( !isNaN(parseFloat(r.value)) && parseFloat(r.value) != 0 ) {
								// 折前金额
								d1 = document.all("NoDiscountTotal_Edit" + row).value;
								// 折前单价
								d2 = r.value;
								r = document.all("DiscountPrice_Edit" + row);
								// 折后单价
								r.value = d2 * document.all("Discount_Edit" + row).value;
								r.value = this.FormatCol(r.value,18);
								
								// 数量
								d1 = document.all("Qty_Edit" + row).value;
								r = document.all("Total_Edit" + row);
								// 折后金额
								r.value = document.all("Qty_Edit" + row).value * document.all("DiscountPrice_Edit" + row).value;
								r.value = this.FormatCol(r.value,19);
							}
							else {
								// 折前单价
								r.value = document.all("DiscountPrice_Edit" + row).value/document.all("Discount_Edit" + row).value;
								r.value = this.FormatCol(r.value,15);
								
								r = document.all("NoDiscountTotal_Edit" + row);
								r.value = document.all("Qty_Edit" + row).value * document.all("Price_Edit" + row).value;
								// 折前金额
								r.value = this.FormatCol(r.value,16);
							}
							break;
						case 17:	// 折后单价发生变化
							r = document.all("Price_Edit" + row);
							// 有销售价
							if ( !isNaN(parseFloat(r.value)) && parseFloat(r.value) != 0 ) {
								d1 = document.all("Price_Edit" + row).value;
								r = document.all("Total_Edit" + row);
								r.value = document.all("Qty_Edit" + row).value * document.all("DiscountPrice_Edit" + row).value;
								r.value = this.FormatCol(r.value,19);

								d2 = document.all("DiscountPrice_Edit" + row).value;
								r = document.all("Discount_Edit" + row);
								r.value = d2/d1;
								// 扣率
								r.value = this.FormatCol(r.value,17);
							}
							else {
								r.value = document.all("DiscountPrice_Edit" + row).value/document.all("Discount_Edit" + row).value;
								// 折前单价
								r.value = this.FormatCol(r.value,15);

								r = document.all("NoDiscountTotal_Edit" + row);
								r.value = document.all("Qty_Edit" + row).value * document.all("Price_Edit" + row).value
								// 折前金额
								r.value = this.FormatCol(r.value,16);

								r = document.all("Total_Edit" + row);
								r.value = document.all("Qty_Edit" + row).value * document.all("DiscountPrice_Edit" + row).value;
								// 折后金额
								r.value = this.FormatCol(r.value,19);
							}
							break;
						case 18:	// 折后金额发生变化
							//alert('折后金额发生变化');
							r = document.all("Qty_Edit" + row);
							// 有数量
							if ( !isNaN(parseFloat(r.value)) && parseFloat(r.value) != 0 ) {
								// 折前单价
								d1 = document.all("Price_Edit" + row).value;
								r = document.all("DiscountPrice_Edit" + row);
								r.value = document.all("Total_Edit" + row).value/document.all("Qty_Edit" + row).value;
								// 折后单价
								r.value = this.FormatCol(r.value,18);
								d2 = r.value;
								r = document.all("Discount_Edit" + row);
								//反算扣率
								if (  !isNaN(parseFloat(d1)) && parseFloat(d1) != 0 ){
									r.value = d2/d1;
									r.value =  this.FormatCol(r.value,17);
								}
								//反算折前单价，金额
								else{
									d1 = document.all("Price_Edit" + row);
									d1.value = document.all("DiscountPrice_Edit" + row).value/r.value;
									d1.value = this.FormatCol(d1.value,15);
									//折前金额
									d2 = document.all("NoDiscountTotal_Edit" + row);
									d2.value = d1.value * document.all("Qty_Edit" + row).value;
									d2.value = this.FormatCol(d2.value,16);
								}
							}
							break;
					}
					break;
				}
				else if (  this.id == 1521 || this.id == 1524) {  //销售换货单出库，采购换货单出库 折扣格式
					col = col - 1;
					switch (col) {
						case 11:	// 数量发生变化
							r = document.all("OPrice_Edit" + row);
							// 有销售价
							if ( !isNaN(parseFloat(r.value)) && parseFloat(r.value) != 0 ) {
								r = document.all("ONoDiscountTotal_Edit" + row);
								r.value = document.all("OQty_Edit" + row).value * document.all("OPrice_Edit" + row).value
								// 折前金额
								r.value = this.FormatCol(r.value,16);
						
								d1 = r.value;
								// 检查折后单价
								r = document.all("ODiscountPrice_Edit" + row);
								// 折后单价无效
								if ( isNaN(parseFloat(r.value)) || parseFloat(r.value) == 0 ) {
									// 折前单价
									d1 = document.all("OPrice_Edit" + row).value;
									// 检查折后单价
									r = document.all("ODiscountPrice_Edit" + row);
									
									r.value = d1 * document.all("ODiscount_Edit" + row).value;
									// 折后单价
									r.value = this.FormatCol(r.value,18);
									
									//折后单价
									d2 = r.value;
									r = document.all("OTotal_Edit" + row);
									r.value = d2 * document.all("OQty_Edit" + row).value;
									// 折后金额
									r.value = this.FormatCol(r.value,19);
									
								}
								else {
									r = document.all("ODiscount_Edit" + row);
									r.value=document.all("ODiscountPrice_Edit" + row).value/document.all("OPrice_Edit" + row).value; //计算扣率
									r.value = this.FormatCol(r.value,17);
									
									r = document.all("OTotal_Edit" + row);
									r.value = document.all("ODiscountPrice_Edit" + row).value * document.all("OQty_Edit" + row).value;
									// 折后金额
									r.value = this.FormatCol(r.value,19);
								}
							}
							else {
								// 折后单价
								r = document.all("ODiscountPrice_Edit" + row);
								// 有折后价
								if ( !isNaN(parseFloat(r.value)) && parseFloat(r.value) != 0) {
									d1 = r.value;
									r = document.all("OPrice_Edit" + row);
									r.value = d1/document.all("ODiscount_Edit" + row).value; //计算折前单价
									r.value = this.FormatCol(r.value,15);
									
									r = document.all("OTotal_Edit" + row);
									r.value = document.all("OQty_Edit" + row).value * document.all("ODiscountPrice_Edit" + row).value;
									// 折后金额
									r.value = this.FormatCol(r.value,19);
									
									d1 = r.value;
									r = document.all("ONoDiscountTotal_Edit" + row);
									r.value = ( document.all("OQty_Edit" + row).value * document.all("ODiscountPrice_Edit" + row).value)/document.all("ODiscount_Edit" + row).value;
									// 折前金额
									r.value = this.FormatCol(r.value,15);
								
									d1 = r.value;
									// 折前单价
									r = document.all("OPrice_Edit" + row);
									if ( d1 != "0"){
										r.value = ( document.all("OQty_Edit" + row).value * document.all("ODiscountPrice_Edit" + row).value)/( document.all("OQty_Edit" + row).value * document.all("ODiscount_Edit" + row).value);
									}
									// 折前单价
									r.value = this.FormatCol(r.value,15);
								}
							}
							break;
						case 14:	//扣前单价    徐辉2004-4-23 添加折前单价
							//alert("扣前单价");
							r = document.all("OPrice_Edit" + row);
							// 有销售价
							r = document.all("ONoDiscountTotal_Edit" + row);
							r.value = document.all("OQty_Edit" + row).value * document.all("OPrice_Edit" + row).value
							// 折前金额
								
							r.value = this.FormatCol(r.value,16);
							
							d1 = r.value;
							// 折前单价
							d1 = document.all("OPrice_Edit" + row).value;
							r = document.all("ODiscountPrice_Edit" + row);
							r.value = d1 * document.all("ODiscount_Edit" + row).value;
							// 折后单价
								
							r.value = this.FormatCol(r.value,18);
								
							//折后单价
							d2 = r.value;
							r = document.all("OTotal_Edit" + row);
							r.value = d2 * document.all("OQty_Edit" + row).value;
							// 折后金额
							r.value = this.FormatCol(r.value,19);
							break;
						case 16:	// 扣率发生变化
							r = document.all("ODiscount_Edit" + row);
							// 有销售价
							if ( isNaN(parseFloat(r.value)) ) {
								alert("扣率无效！");
								r.value = 1;
							}
							r = document.all("OPrice_Edit" + row);
							// 有销售价
							if ( !isNaN(parseFloat(r.value)) && parseFloat(r.value) != 0 ) {
								// 折前金额
								d1 = document.all("ONoDiscountTotal_Edit" + row).value;
								// 折前单价
								d2 = r.value;
								r = document.all("ODiscountPrice_Edit" + row);
								r.value = d2 * document.all("ODiscount_Edit" + row).value;
								// 折后单价
								
								r.value = this.FormatCol(r.value,18);
								
								// 数量
								d1 = document.all("OQty_Edit" + row).value;
								r = document.all("OTotal_Edit" + row);
								r.value = document.all("OQty_Edit" + row).value * document.all("ODiscountPrice_Edit" + row).value;
								// 折后金额
								
								r.value = this.FormatCol(r.value,19);
								
							}
							else {
								r.value = document.all("ODiscountPrice_Edit" + row).value/document.all("ODiscount_Edit" + row).value;
								// 折前单价
								if ( this.id == 13 )
									r.value = this.FormatCol(r.value,15);
								else
									r.value = this.FormatCol(r.value,14);
								r = document.all("ONoDiscountTotal_Edit" + row);
								r.value = document.all("OQty_Edit" + row).value * document.all("OPrice_Edit" + row).value;
								// 折前金额
								
								r.value = this.FormatCol(r.value,16);
								
							}
							break;
						case 17:	// 折后单价发生变化
							r = document.all("OPrice_Edit" + row);
							// 有销售价
							if ( !isNaN(parseFloat(r.value)) && parseFloat(r.value) != 0 ) {
								d1 = document.all("OPrice_Edit" + row).value;
								r = document.all("OTotal_Edit" + row);
								r.value = document.all("OQty_Edit" + row).value * document.all("ODiscountPrice_Edit" + row).value;
								// 折后金额
								
								r.value = this.FormatCol(r.value,19);
								

								d2 = document.all("ODiscountPrice_Edit" + row).value;
								r = document.all("ODiscount_Edit" + row);
								r.value = d2/d1;
								// 扣率
								
								r.value = this.FormatCol(r.value,17);
								
							}
							else {
								r.value = document.all("ODiscountPrice_Edit" + row).value/document.all("ODiscount_Edit" + row).value;
								// 折前单价
								
								r.value = this.FormatCol(r.value,15);
								

								r = document.all("ONoDiscountTotal_Edit" + row);
								r.value = document.all("OQty_Edit" + row).value * document.all("OPrice_Edit" + row).value
								// 折前金额
								
								r.value = this.FormatCol(r.value,16);
								

								r = document.all("OTotal_Edit" + row);
								r.value = document.all("OQty_Edit" + row).value * document.all("ODiscountPrice_Edit" + row).value;
								// 折后金额
								
								r.value = this.FormatCol(r.value,19);
								
							}
							break;
						case 18:	// 折后金额发生变化
							//alert('折后金额发生变化');
							r = document.all("OQty_Edit" + row);
							// 有数量
							if ( !isNaN(parseFloat(r.value)) && parseFloat(r.value) != 0 ) {
								// 折前单价
								d1 = document.all("OPrice_Edit" + row).value;
								r = document.all("ODiscountPrice_Edit" + row);
								r.value = document.all("OTotal_Edit" + row).value/document.all("OQty_Edit" + row).value;
								// 折后单价
							
								r.value = this.FormatCol(r.value,18);
								
								d2 = r.value;
								r = document.all("ODiscount_Edit" + row);
								if ( !isNaN(parseFloat(r.value)) && parseFloat(r.value) != 0 ) { //有扣率
									if ( !isNaN(parseFloat(d1)) && parseFloat(d1) != 0 ) {//有折前单价
										//反算扣率
										r.value = d2/d1;
										r.value = this.FormatCol(r.value,17);
									}
									else{//反算折前单价、折前金额
										d1 = (document.all("ODiscountPrice_Edit" + row).value)/r.value;
										document.all("OPrice_Edit" + row).value = this.FormatCol(d1,15);
										r = document.all("ONoDiscountTotal_Edit" + row);
										r.value = document.all("OPrice_Edit" + row).value * document.all("OQty_Edit" + row).value;
										r.value = this.FormatCol(r.value,16);
									}
								}
							}
							break;
					}
					break;
				}
				else if ( this.id == 1522 || this.id == 1523) {  //销售换货单入库折扣格式，采购换货单入库折扣格式
					if ( this.id == 1522 ){ //销售换货单入库，序列号号在前 
						col = col - 1;
					}
					switch (col) {
						case 11:	// 数量发生变化
							r = document.all("IPrice_Edit" + row);
							// 有销售价
							if ( !isNaN(parseFloat(r.value)) && parseFloat(r.value) != 0 ) {
								r = document.all("INoDiscountTotal_Edit" + row);
								r.value = document.all("IQty_Edit" + row).value * document.all("IPrice_Edit" + row).value
								// 折前金额
								if ( this.id == 1522 )
									r.value = this.FormatCol(r.value,16);
								else
									r.value = this.FormatCol(r.value,15);
								d1 = r.value;
								// 检查折后单价
								r = document.all("IDiscountPrice_Edit" + row);
								// 折后单价无效
								if ( isNaN(parseFloat(r.value)) || parseFloat(r.value) == 0 ) {
									// 折前单价
									d1 = document.all("IPrice_Edit" + row).value;
									// 检查折后单价
									r = document.all("IDiscountPrice_Edit" + row);
									r.value = d1 * document.all("IDiscount_Edit" + row).value;
									// 折后单价
									if ( this.id == 1522 )
										r.value = this.FormatCol(r.value,18);
									else
										r.value = this.FormatCol(r.value,17);
									//折后单价
									d2 = r.value;
									r = document.all("ITotal_Edit" + row);
									r.value = d2 * document.all("IQty_Edit" + row).value;
									// 折后金额
									if ( this.id == 1522 )
										r.value = this.FormatCol(r.value,19);
									else
										r.value = this.FormatCol(r.value,18);
								}
								else {
									r = document.all("IDiscount_Edit" + row);
									r.value=document.all("IDiscountPrice_Edit" + row).value/document.all("IPrice_Edit" + row).value; //计算扣率
									if ( this.id == 1522 ){
										r.value = this.FormatCol(r.value,17);
									}
									else{
										r.value = this.FormatCol(r.value,16);
									}
									r = docum
