|  | @@ -13,7 +13,11 @@ const stageIm = (function () {
 | 
	
		
			
				|  |  |      const resetFields = ['peg', 'bw', 'xm', 'drawing_code', 'calc_memo', 'position', 'jldy'];
 | 
	
		
			
				|  |  |      const splitChar = '-';
 | 
	
		
			
				|  |  |      const mergeChar = ';';
 | 
	
		
			
				|  |  | -    let stage, imType, decimal, filter, details, changes, importChanges, detailsAtt, ImData, pre, orgImData;
 | 
	
		
			
				|  |  | +    const SortType = {
 | 
	
		
			
				|  |  | +        GCL: 'gcl',
 | 
	
		
			
				|  |  | +        TZ: 'tz'
 | 
	
		
			
				|  |  | +    };
 | 
	
		
			
				|  |  | +    let tender, stage, imType, decimal, filter, details, changes, importChanges, detailsAtt, ImData, pre, orgImData;
 | 
	
		
			
				|  |  |      let up_field = 'unit_price';
 | 
	
		
			
				|  |  |      const gsTreeSetting = {
 | 
	
		
			
				|  |  |          id: 'ledger_id',
 | 
	
	
		
			
				|  | @@ -55,7 +59,8 @@ const stageIm = (function () {
 | 
	
		
			
				|  |  |      };
 | 
	
		
			
				|  |  |      const gsPos = new StagePosData(gsPosSetting);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -    function init (s, i, d, f) {
 | 
	
		
			
				|  |  | +    function init (t, s, i, d, f) {
 | 
	
		
			
				|  |  | +        tender = t;
 | 
	
		
			
				|  |  |          stage = s;
 | 
	
		
			
				|  |  |          imType = i;
 | 
	
		
			
				|  |  |          decimal = d;
 | 
	
	
		
			
				|  | @@ -951,7 +956,10 @@ const stageIm = (function () {
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      function _sortImData() {
 | 
	
		
			
				|  |  | -        if (stage.im_type !== imType.tz.value && stage.im_type !== imType.bb.value) {
 | 
	
		
			
				|  |  | +        const st = (['fj', 'sz'].indexOf(tender.s_type) > 0 && [imType.zl.value, imType.bw.value].indexOf(stage.im_type) >= 0)
 | 
	
		
			
				|  |  | +            ? SortType.TZ
 | 
	
		
			
				|  |  | +            : (stage.im_type !== imType.tz.value && stage.im_type !== imType.bb.value ? SortType.TZ : SortType.GCL);
 | 
	
		
			
				|  |  | +        if (st === SortType.GCL) {
 | 
	
		
			
				|  |  |              ImData.sort(function (x, y) {
 | 
	
		
			
				|  |  |                  const iCode = compareCode(x.code, y.code);
 | 
	
		
			
				|  |  |                  return iCode === 0 ? x.lIndex - y.lIndex : iCode;
 | 
	
	
		
			
				|  | @@ -1233,5 +1241,6 @@ const stageIm = (function () {
 | 
	
		
			
				|  |  |          getRelaImData: getRelaImData,
 | 
	
		
			
				|  |  |          getRelaImData4Rela: getRelaImData4Rela,
 | 
	
		
			
				|  |  |          resetFields,
 | 
	
		
			
				|  |  | +        SortType,
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  })();
 |