Explorar o código

Merge remote-tracking branch 'origin/develop' into jsh77b

tsit14 %!s(int64=5) %!d(string=hai) anos
pai
achega
c1f20c3c11

+ 1 - 0
src/main/java/com/style24/persistence/domain/Coupon.java

@@ -53,6 +53,7 @@ public class Coupon extends TscBaseDomain {
     private String afChannel;               // 제휴링크
     private String afChannel;               // 제휴링크
     private String dcCdGb;                  // 할인코드유형 (공통코드G233)
     private String dcCdGb;                  // 할인코드유형 (공통코드G233)
     private String rdCpnNm;                 // 랜덤쿠폰 사용키 (시리얼명 or 난수)
     private String rdCpnNm;                 // 랜덤쿠폰 사용키 (시리얼명 or 난수)
+    private String chkExcep;                // 종료제외여부
 
 
     private String supplyCompCd;
     private String supplyCompCd;
     private String mdNo;
     private String mdNo;

+ 24 - 11
src/main/java/com/style24/scm/biz/web/TssGoodsController.java

@@ -681,6 +681,7 @@ public class TssGoodsController extends TssBaseController {
 
 
 		// 오류 파일 목록
 		// 오류 파일 목록
 		Collection<File> errorFileList = new ArrayList<File>();
 		Collection<File> errorFileList = new ArrayList<File>();
+		Collection<File> errorFileDextList = new ArrayList<File>();
 
 
 		// 1.업로드된 파일 rename 및 순서 재정렬
 		// 1.업로드된 파일 rename 및 순서 재정렬
 		for (GoodsImg goodsImg : goodsImgList) {
 		for (GoodsImg goodsImg : goodsImgList) {
@@ -699,6 +700,8 @@ public class TssGoodsController extends TssBaseController {
 				goods.setGoodsCd(goodsImg.getGoodsCd());
 				goods.setGoodsCd(goodsImg.getGoodsCd());
 				Goods goodsInfo = goodsService.getGoodsInfo(goods);
 				Goods goodsInfo = goodsService.getGoodsInfo(goods);
 				if (goodsInfo == null || goodsInfo.getGoodsCd().isEmpty()) {
 				if (goodsInfo == null || goodsInfo.getGoodsCd().isEmpty()) {
+					deleteErrorFileList(errorFileList);
+					deleteErrorFileList(errorFileDextList);
 					throw new IllegalStateException(message.getMessage("FAIL_1001"));
 					throw new IllegalStateException(message.getMessage("FAIL_1001"));
 				}
 				}
 
 
@@ -727,6 +730,7 @@ public class TssGoodsController extends TssBaseController {
 				errorFileList.add(newFile);
 				errorFileList.add(newFile);
 
 
 				File oldFile = new File(GagaFileUtil.getConcatenationPath(dextUploadPath, goodsImg.getSysImgNm()));
 				File oldFile = new File(GagaFileUtil.getConcatenationPath(dextUploadPath, goodsImg.getSysImgNm()));
+				errorFileDextList.add(oldFile);
 				//log.info("oldFile.getPath(): {}", oldFile.getPath());
 				//log.info("oldFile.getPath(): {}", oldFile.getPath());
 
 
 				File path = new File(goodsUploadPath);
 				File path = new File(goodsUploadPath);
@@ -734,6 +738,22 @@ public class TssGoodsController extends TssBaseController {
 					//log.info("mkdir ={}", goodsUploadPath);
 					//log.info("mkdir ={}", goodsUploadPath);
 					path.mkdir();
 					path.mkdir();
 				}
 				}
+				
+
+				Image srcImg = getImageObject(oldFile);
+				int width = srcImg.getWidth(null);
+				int height = srcImg.getHeight(null);
+
+				if (newFile.getName().contains("_X1")) {
+//					if (width != height) {
+					if (width != 1000 || height != 1000) {
+						deleteErrorFileList(errorFileList);
+						deleteErrorFileList(errorFileDextList);
+						throw new IllegalStateException("외부몰용 상품이미지가 정사각형(1000x1000)이 아닙니다.");
+					}
+					// 외부몰연동용 이미지로 설정
+					goodsImg.setExtmallImgYn("Y");
+				}
 
 
 				boolean copyFlag = GagaFileUtil.copyFile(oldFile, newFile);
 				boolean copyFlag = GagaFileUtil.copyFile(oldFile, newFile);
 				if (copyFlag) {
 				if (copyFlag) {
@@ -745,14 +765,6 @@ public class TssGoodsController extends TssBaseController {
 				goodsImg.setOrgImgNm(GagaFileUtil.getConcatenationPath(brandYmdDir, newFile.getName()));
 				goodsImg.setOrgImgNm(GagaFileUtil.getConcatenationPath(brandYmdDir, newFile.getName()));
 				goodsImg.setSysImgNm(GagaFileUtil.getConcatenationPath(brandYmdDir, newFile.getName()));
 				goodsImg.setSysImgNm(GagaFileUtil.getConcatenationPath(brandYmdDir, newFile.getName()));
 
 
-				Image srcImg = getImageObject(newFile);
-				int width = srcImg.getWidth(null);
-				int height = srcImg.getHeight(null);
-
-				if (width == height) {
-					// 외부몰연동용 이미지로 설정
-					goodsImg.setExtmallImgYn("Y");
-				}
 			} else {
 			} else {
 				goodsImg.setOrgImgNm(GagaFileUtil.getConcatenationPath(goodsImg.getSysImgUrl(), goodsImg.getSysImgNm()));
 				goodsImg.setOrgImgNm(GagaFileUtil.getConcatenationPath(goodsImg.getSysImgUrl(), goodsImg.getSysImgNm()));
 				goodsImg.setSysImgNm(GagaFileUtil.getConcatenationPath(goodsImg.getSysImgUrl(), goodsImg.getSysImgNm()));
 				goodsImg.setSysImgNm(GagaFileUtil.getConcatenationPath(goodsImg.getSysImgUrl(), goodsImg.getSysImgNm()));
@@ -781,7 +793,7 @@ public class TssGoodsController extends TssBaseController {
 
 
 		return super.ok(message.getMessage("SUCC_0007"));
 		return super.ok(message.getMessage("SUCC_0007"));
 	}
 	}
-
+	
 	/**
 	/**
 	 * 상품 이미지 대량관리 화면
 	 * 상품 이미지 대량관리 화면
 	 *
 	 *
@@ -1036,10 +1048,11 @@ public class TssGoodsController extends TssBaseController {
 
 
 //			
 //			
 			if (newFile.getName().contains("_X1")) {
 			if (newFile.getName().contains("_X1")) {
-				if (width != height) {
+//				if (width != height) {
+				if (width == 1000 && height == 1000) {
 					deleteErrorFileList(errorFileList);
 					deleteErrorFileList(errorFileList);
 					deleteErrorFileList(errorFileDextList);
 					deleteErrorFileList(errorFileDextList);
-					throw new IllegalStateException(comGoodsCd + " 상품코드의 외부몰용 상품이미지는 정사각형이 아닙니다.");
+					throw new IllegalStateException(comGoodsCd + " 상품코드의 외부몰용 상품이미지는 정사각형(1000x1000)이 아닙니다.");
 				}
 				}
 				// 외부몰연동용 이미지로 설정
 				// 외부몰연동용 이미지로 설정
 				goodsImg.setExtmallImgYn("Y");
 				goodsImg.setExtmallImgYn("Y");

+ 139 - 7
src/main/java/com/style24/scm/biz/web/TssMarketingController.java

@@ -3,10 +3,12 @@ package com.style24.scm.biz.web;
 
 
 
 
 import java.io.IOException;
 import java.io.IOException;
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collection;
 import java.util.Iterator;
 import java.util.Iterator;
 
 
 import com.style24.core.biz.service.TscCouponService;
 import com.style24.core.biz.service.TscCouponService;
+import com.style24.persistence.domain.CommonCode;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.beans.factory.annotation.Value;
@@ -82,6 +84,7 @@ public class TssMarketingController extends TssBaseController {
 		ModelAndView mav = new ModelAndView();
 		ModelAndView mav = new ModelAndView();
 		// 사이트 목록
 		// 사이트 목록
 		String supplyCompCd = TssSession.getInfo().getSupplyCompCd();
 		String supplyCompCd = TssSession.getInfo().getSupplyCompCd();
+		log.info("planListForm supplyCompCd>>",supplyCompCd);
 		String selfYn = "N";
 		String selfYn = "N";
 		mav.addObject("supplyCompList", rendererService.getSupplyCompanyList(supplyCompCd, selfYn));
 		mav.addObject("supplyCompList", rendererService.getSupplyCompanyList(supplyCompCd, selfYn));
 		
 		
@@ -108,6 +111,7 @@ public class TssMarketingController extends TssBaseController {
 		GagaMap result = new GagaMap();
 		GagaMap result = new GagaMap();
 
 
 		// 입점업체담당자는 업체코드 설정
 		// 입점업체담당자는 업체코드 설정
+		log.info("getPlanList .getRoleCd()>>"+TssSession.getInfo().getRoleCd());
 		if ("G001_B000".equals(TssSession.getInfo().getRoleCd())) {
 		if ("G001_B000".equals(TssSession.getInfo().getRoleCd())) {
 			param.setRegNo(TssSession.getInfo().getUserNo());
 			param.setRegNo(TssSession.getInfo().getUserNo());
 		}
 		}
@@ -583,7 +587,8 @@ public class TssMarketingController extends TssBaseController {
         ModelAndView mav = new ModelAndView();
         ModelAndView mav = new ModelAndView();
         log.info("form getSupplyCompCd ::::",TssSession.getInfo().getSupplyCompCd());
         log.info("form getSupplyCompCd ::::",TssSession.getInfo().getSupplyCompCd());
         // 쿠폰상태 목록
         // 쿠폰상태 목록
-        mav.addObject("cpnStatList", rendererService.getAvailCommonCodeList("G232"));
+        String[] exceptCds = {"G232_14"};
+        mav.addObject("cpnStatList", rendererService.getCommonCodeList("G232", "Y", exceptCds));
         // 쿠폰 유형 조회
         // 쿠폰 유형 조회
         mav.addObject("cpnTypeList", rendererService.getCommonCodeList("G230", "Y"));
         mav.addObject("cpnTypeList", rendererService.getCommonCodeList("G230", "Y"));
         // 할인 유형 조회
         // 할인 유형 조회
@@ -606,11 +611,9 @@ public class TssMarketingController extends TssBaseController {
         GagaMap result = new GagaMap();
         GagaMap result = new GagaMap();
 
 
         // 입점업체담당자는 업체코드 설정
         // 입점업체담당자는 업체코드 설정
-        if ("G001_B000".equals(TssSession.getInfo().getRoleCd())) {
-            log.info("getSupplyCompCd ::::",TssSession.getInfo().getSupplyCompCd());
-            param.setSupplyCompCd(TssSession.getInfo().getSupplyCompCd());
-            param.setMdNo(TssSession.getInfo().getUserNo().toString());
-        }
+		if ("G001_B000".equals(TssSession.getInfo().getRoleCd())) {
+			param.setRegNo(TssSession.getInfo().getUserNo());
+		}
 
 
         param.setPageable(new TscPageRequest(param.getPageNo() - 1, param.getPageSize()));
         param.setPageable(new TscPageRequest(param.getPageNo() - 1, param.getPageSize()));
         param.getPageable().setTotalCount(coreCouponService.getCouponListCnt(param));
         param.getPageable().setTotalCount(coreCouponService.getCouponListCnt(param));
@@ -620,6 +623,135 @@ public class TssMarketingController extends TssBaseController {
 
 
         return result;
         return result;
     }
     }
-    
+
+	/**
+	 * 쿠폰목록 리스트 조회
+	 * @return
+	 * @author bin2107
+	 * @since 2021. 5. 17
+	 */
+	@GetMapping("/coupon/popup/form")
+	@ResponseBody
+	public ModelAndView couponCreatePopup(@RequestParam(value = "mode") String mode, @RequestParam(value = "cpnId", required = false) Integer cpnId) {
+		ModelAndView mav = new ModelAndView();
+		log.info("[couponCreatePopup]",cpnId);
+		String num = "";
+		int issueCnt = 0;
+
+		// 일시 시 리스트 세팅
+		Collection<CommonCode> hhList = new ArrayList<CommonCode>();
+		for (int i = 0; i < 24; i++) {
+			num = "";
+			CommonCode temp = new CommonCode();
+			if (i < 10) {
+				num = "0" + i;
+			} else {
+				num = String.valueOf(i);
+			}
+
+			temp.setCd(num);
+			temp.setCdNm(num + "시");
+
+			hhList.add(temp);
+		}
+		// 일시 분 리스트 세팅
+		Collection<CommonCode> mmList = new ArrayList<CommonCode>();
+		for (int i = 0; i < 60; i++) {
+			num = "";
+			CommonCode temp = new CommonCode();
+			if (i < 10) {
+				num = "0" + i;
+			} else {
+				num = String.valueOf(i);
+			}
+			temp.setCd(num);
+			temp.setCdNm(num + "분");
+
+			mmList.add(temp);
+		}
+		// 시간 분 리스트 세팅
+		mav.addObject("mmList", mmList);
+		// 시간 시 리스트 세팅
+		mav.addObject("hhList", hhList);
+		// 상품상태
+		String[] exceptCds = {"G008_00"};
+		mav.addObject("goodsStatList", rendererService.getCommonCodeList("G008", "Y", exceptCds));
+		// 입점업체 조회
+//		mav.addObject("ibSupplyCompList", rendererService.getSupplyCompanyList("", "N"));
+		// 할인 쿠폰 코드 조회
+//		mav.addObject("dcCdList", rendererService.getCommonCodeList("G233", "Y"));
+		// 정상/이월 조회
+//		mav.addObject("formalGbList", rendererService.getCommonCodeList("G009"));
+		// 카테고리 구분 조회
+		mav.addObject("cateGbList", rendererService.getCommonCodeList("G032"));
+		// 자사 브랜드 조회
+		mav.addObject("selfBrandList", null); //rendererService.getSelfBrandList()
+		// 사이트코드 조회
+		mav.addObject("siteCdList", rendererService.getCommonCodeList("G000"));
+		// 쿠폰상태 조회
+		String[] exceptStat = {"G232_14"};
+		mav.addObject("cpnStatList", rendererService.getCommonCodeList("G232", "Y", exceptStat));
+		// 쿠폰 유형 조회
+		String[] exceptCpnType = {"G230_20","G230_30"};
+		mav.addObject("cpnTypeList", rendererService.getCommonCodeList("G230", "Y", exceptCpnType));
+		// 사용가능 고객구분 조회
+//		String[] exceptCds1 = {"G100_00"};
+//		mav.addObject("usableCustGbList", rendererService.getCommonCodeList("G100", "Y", exceptCds1));
+//		 사용가능 고객등급 조회
+//		mav.addObject("usableCustGradeList", rendererService.getCommonCodeList("G110"));
+		// 재발급 여부 조회
+//		mav.addObject("reissuanceList", rendererService.getCommonCodeList("G231"));
+		// 할인방식 조회
+		mav.addObject("dcWayList", rendererService.getCommonCodeList("G240"));
+		// 쿠폰다운로드 방식 조회
+//		mav.addObject("dnGbList", rendererService.getCommonCodeList("G058"));
+		// 결제수단 조회
+//		String[] exceptCds2 = {"INICIS","ISTYLE","NAVER_ORDER","NICE"};
+//		mav.addObject("payTypeList", rendererService.getCommonCodeList("G015", "Y", exceptCds2));
+		// 상위제휴채널 조회
+//		mav.addObject("upperAfLinkCdList", rendererService.getCommonCodeList("G053"));
+		// 선착순쿠폰 조회
+//		mav.addObject("limitedTimeCpnList", new Coupon());
+		// 제휴채널 조회
+//		mav.addObject("channelList", rendererService.getCommonCodeList("G053", "Y"));
+		// 이미 쿠폰 아이디가 있으면 적용대상 조회
+		if (mode.equals("U")) {
+			issueCnt = coreCouponService.getCouponIssueCnt(cpnId);
+			// 쿠폰상세조회
+			mav.addObject("cpnDetail", coreCouponService.getCouponDetail(cpnId));
+			// 쿠폰적용대상 - 공급업체 조회
+//			mav.addObject("cpnDtlRefvalSupplyCompList", coreCouponService.getCouponRefvalSupplyCompList(cpnId));
+			// 쿠폰적용대상 - 적용상품 조회
+			mav.addObject("cpnDtlRefvalApplyGoodsList", coreCouponService.getCouponRefvalGoodsList(cpnId, "G260_10"));
+			// 쿠폰적용대상 - 카테고리 조회
+			mav.addObject("cpnDtlRefvalCateList", coreCouponService.getCouponRefvalCategoryList(cpnId));
+			// 쿠폰적용대상 - 브랜드 조회
+			mav.addObject("cpnDtlRefvalBrandList", coreCouponService.getCouponRefvalBrandList(cpnId));
+			// 쿠폰적용대상 - 제외상품 조회
+			mav.addObject("cpnDtlRefvalExceptGoodsList", coreCouponService.getCouponRefvalGoodsList(cpnId, "G260_14"));
+			// 쿠폰 입점업체분담율 조회
+//			mav.addObject("cpnDtlBurdenList", coreCouponService.getCouponBurdenList(cpnId));
+			// 시리얼 및 난수 쿠폰 조회
+//			mav.addObject("randomCpnList", coreCouponService.getRandomCouponInfo(cpnId));
+			// 쿠폰사용가능고객구분 조회
+//			mav.addObject("cpnCustGbList", coreCouponService.getCouponCustGbList(cpnId));
+			// 쿠폰사용가능고객등급 조회
+//			mav.addObject("cpnCustGradeList", coreCouponService.getCouponCustGradeList(cpnId));
+			// 쿠폰사용가능결제수단 조회
+//			mav.addObject("cpnPayTypeList", coreCouponService.getCouponPayTypeList(cpnId));
+			// 선착순쿠폰 조회
+//			mav.addObject("limitedTimeCpnList", coreCouponService.getLimitedTimeCouponList(cpnId));
+			// 등록했던 제휴채널
+//			mav.addObject("afChannelList", coreCouponService.getCouponAfChannelList(cpnId));
+		}
+
+		//issueCnt = 3;
+
+		mav.addObject("mode", mode);
+		mav.addObject("issueCnt", issueCnt);
+
+		mav.setViewName("marketing/CouponPopupForm");
+		return mav;
+	}
    
    
 }
 }

+ 1 - 1
src/main/java/com/style24/scm/biz/web/TssOrderController.java

@@ -214,7 +214,7 @@ public class TssOrderController extends TssBaseController {
 	}
 	}
 	
 	
 	/**
 	/**
-	 * 입점업체미발주목록 - 송장번호 입력(출고완료)
+	 * 입점업체미발주목록 - 송장번호 입력(자사 : 배송준비중, 입점 : 배송중)
 	 *
 	 *
 	 * @param orderList - 송방번호 입력된 주문리스트
 	 * @param orderList - 송방번호 입력된 주문리스트
 	 * @return GagaMap
 	 * @return GagaMap

+ 3 - 0
src/main/webapp/WEB-INF/views/goods/GoodsImageForm.html

@@ -32,6 +32,9 @@
 					<ul class="notice">
 					<ul class="notice">
 						<li>[업로드/수정] 버튼 클릭 하면 프론트에 바로 적용되므로 최종 확인 후 전송을 권장합니다.</li>
 						<li>[업로드/수정] 버튼 클릭 하면 프론트에 바로 적용되므로 최종 확인 후 전송을 권장합니다.</li>
 						<li>이미지 미리보기 리스트는 <em>업로드 후</em> 확인 할 수 있습니다.</li>
 						<li>이미지 미리보기 리스트는 <em>업로드 후</em> 확인 할 수 있습니다.</li>
+						<li>상품이미지 업로드시 오류가 발생하면 화면 종료 후 다시 창의 띄어 파일 추가작업을 다시 해주세요.</li>
+						<li>자사 상품의 <em>셋트/딜 상품</em> 이미지 등록시 파일명의 색상코드는 <em>'XX'</em>로 생성하여 진행해 주세요.</li>
+						<li>자사 상품의 <em>외부몰용</em> 상품이미지(상품코드_색상코드_<em>X1</em>.jpg)의 사이즈는 <em>1000 x 1000</em> 입니다.</li>
 					</ul>
 					</ul>
 					<table class="frmStyle">
 					<table class="frmStyle">
 						<colgroup>
 						<colgroup>

+ 1 - 0
src/main/webapp/WEB-INF/views/goods/GoodsImageMassForm.html

@@ -31,6 +31,7 @@
 					<li><em>상품 파일명 기준</em>의 첫번째 이미지파일이 <em>디폴트 이미지</em> , 두번째 이미지파일이 <em>마우스오버 이미지</em> 입니다. 확인해주세요!</li>
 					<li><em>상품 파일명 기준</em>의 첫번째 이미지파일이 <em>디폴트 이미지</em> , 두번째 이미지파일이 <em>마우스오버 이미지</em> 입니다. 확인해주세요!</li>
 					<li>상품이미지 업로드시 오류가 발생하면 <em>전체 삭제 처리</em> 후 파일 추가작업을 다시 해주세요.</li>
 					<li>상품이미지 업로드시 오류가 발생하면 <em>전체 삭제 처리</em> 후 파일 추가작업을 다시 해주세요.</li>
 					<li>자사 상품의 <em>셋트/딜 상품</em> 이미지 등록시 파일명의 색상코드는 <em>'XX'</em>로 생성하여 진행해 주세요.</li>
 					<li>자사 상품의 <em>셋트/딜 상품</em> 이미지 등록시 파일명의 색상코드는 <em>'XX'</em>로 생성하여 진행해 주세요.</li>
+					<li>자사 상품의 <em>외부몰용</em> 상품이미지의 사이는 1000 x 1000 입니다.</li>
 				</ul>
 				</ul>
 				<table class="frmStyle">
 				<table class="frmStyle">
 					<colgroup>
 					<colgroup>

+ 2 - 2
src/main/webapp/WEB-INF/views/marketing/CouponListForm.html

@@ -146,7 +146,7 @@
 		columnDefs = [
 		columnDefs = [
 			{headerName: "쿠폰ID", field: "cpnId", width: 130, cellClass: 'text-center'},
 			{headerName: "쿠폰ID", field: "cpnId", width: 130, cellClass: 'text-center'},
 			{headerName: "쿠폰명", field: "cpnNm", width: 140, cellClass: 'text-center' , cellRenderer: function (params) {
 			{headerName: "쿠폰명", field: "cpnNm", width: 140, cellClass: 'text-center' , cellRenderer: function (params) {
-				return "<a href=\"javascript:void(0);\" onclick=\"cfnCouponCreatePopup('" + params.data.cpnId + "');\">" + params.value + "</a>";
+				return "<a href=\"javascript:void(0);\" onclick=\"cfnCouponCreatePopup('U','" + params.data.cpnId + "');\">" + params.value + "</a>";
 			}},
 			}},
 			{headerName: "쿠폰상태", field: "cpnStat", width: 140, cellClass: 'text-center' ,
 			{headerName: "쿠폰상태", field: "cpnStat", width: 140, cellClass: 'text-center' ,
 				cellEditor: 'agRichSelectCellEditor',
 				cellEditor: 'agRichSelectCellEditor',
@@ -216,7 +216,7 @@
 
 
 		// 쿠폰등록 팝업창
 		// 쿠폰등록 팝업창
 		function fnCouponCreateForm(){
 		function fnCouponCreateForm(){
-			cfnCouponCreatePopup('0');
+			cfnCouponCreatePopup('N');
 		}
 		}
 
 
 		// 초기화 클릭시
 		// 초기화 클릭시

+ 1431 - 0
src/main/webapp/WEB-INF/views/marketing/CouponPopupForm.html

@@ -0,0 +1,1431 @@
+<!DOCTYPE html>
+<html lang="ko"
+	  xmlns:th="http://www.thymeleaf.org">
+<!--
+ *******************************************************************************
+ * @source  :CouponPopupForm.html
+ * @desc    : 쿠폰 등록 팝업 화면
+ *============================================================================
+ * STYLE24
+ * Copyright(C) 2020 TSIT, All rights reserved.
+ *============================================================================
+ * VER  DATE         AUTHOR      DESCRIPTION
+ * ===  ===========  ==========  =============================================
+ * 1.0  2021.05.17   bin2107     최초 작성
+ *******************************************************************************
+ -->
+<div class="modalPopup" data-width="1500">
+	<div class="panelStyle" style="height: 750px;">
+		<div class="panelTitle">
+			<h2 th:text="${'쿠폰 ' + (mode == 'N' ? '등록' : '수정')}">쿠폰등록</h2>
+			<button type="button" class="close" onclick="uifnPopupClose('CouponCreatePopup')"><i class="fa fa-times"></i></button>
+		</div>
+		<div class="panelContent">
+			<form id="CouponForm" name="CouponForm" action="#" th:action="@{'/marketing/coupon/save'}" >
+				<input type="hidden" name="supplyCompList" id="supplyCompList"/>
+				<input type="hidden" name="cpnId" id="cpnId" th:if="${cpnDetail}" th:value="${cpnDetail.cpnId}">
+				<input type="hidden" name="mode" th:value="${mode}"/>
+				<div class="tabs">
+					<div class="tabsNav">
+						<li class="on"><a href="#coupontab1">기본정보</a></li>
+						<li><a href="#coupontab2">적용대상</a></li>
+					</div>
+					<ul class="tabsCont">
+						<li class="tab on" id="coupontab1">
+							<div class="panelStyle">
+								<table class="frmStyle">
+									<colgroup>
+										<col style="width:10%">
+										<col style="width:45%;">
+										<col style="width:10%">
+										<col style="width:35%;">
+									</colgroup>
+									<tbody>
+										<tr th:if="${cpnDetail}">
+											<th>쿠폰번호</th>
+											<td colspan="5">
+												<span th:if="${cpnDetail}" th:text="${cpnDetail.cpnId}"></span>
+											</td>
+										</tr>
+										<tr>
+											<th>쿠폰명<em class="required" title="필수"></em></th>
+											<td>
+												<input type="text" name="cpnNm" id="cpnNm" required="required" data-valid-name="쿠폰명">
+											</td>
+											<th>쿠폰설명</th>
+											<td>
+												<input type="text" name="cpnDesc" id="cpnDesc" data-valid-name="쿠폰설명">
+											</td>
+										</tr>
+										<tr>
+											<th>쿠폰유형<em class="required" title="필수"></em></th>
+											<td>
+												<input type="hidden" id="cpnType" name="cpnType" required="required"  data-valid-name="쿠폰유형">
+												<label class="rdoBtn" th:if="${cpnTypeList}" th:each="oneData, status : ${cpnTypeList}"> <input type="radio" name="rdoCpnType"  th:text="${oneData.cdNm}" th:value="${oneData.cd}"/></label>
+											</td>
+											<th>사이트<em class="required" title="필수"></em></th>
+											<td>
+												<select name="siteCd" id="siteCd" required="required" data-valid-name="사이트">
+													<option th:if="${siteCdList}" th:each="oneData , status : ${siteCdList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
+												</select>
+											</td>
+										</tr>
+										<tr>
+											<th>할인방식<em class="required" title="필수"></em></th>
+											<td>
+												<input type="hidden" name="dcWay" id="dcWay" required="required" data-valid-name="할인방식">
+												<label class="rdoBtn" th:if="${dcWayList}" th:each="oneData, status : ${dcWayList}"> <input type="radio" name="rdoDcWay"  th:text="${oneData.cdNm}" th:value="${oneData.cd}"/></label>
+											</td>
+											<th>할인값(PC)<em class="required" title="필수"></em></th>
+											<td>
+												<input type="text" class="w200" id="dcPval" name="dcPval" value="0" required="required" data-valid-name="할인값(PC)" data-valid-type="numeric" style="text-align: right" onkeyup="fnDcValOnkeyUp(this);"><span id="dcPvalSpan">원</span>
+												<button type="button" class="btn btn-default btn-lg" id="applySameValueBtn">동일적용</button>
+											</td>
+										</tr>
+										<tr>
+											<th>할인값(모바일웹)<em class="required" title="필수"></em></th>
+											<td>
+												<input type="text" class="w200" id="dcMval" name="dcMval" value="0" required="required" data-valid-name="할인값(모바일웹)" data-valid-type="numeric" style="text-align: right" onkeyup="fnDcValOnkeyUp(this);"><span id="dcMvalSpan">원</span>
+											</td>
+											<th>할인값(모바일앱)<em class="required" title="필수"></em></th>
+											<td>
+												<input type="text" class="w200" id="dcAval" name="dcAval" value="0" required="required" data-valid-name="할인값(모바일앱)" data-valid-type="numeric" style="text-align: right" onkeyup="fnDcValOnkeyUp(this);"><span id="dcAvalSpan">원</span>
+											</td>
+										</tr>
+										<tr>
+											<th class="buyLimitAmtArea">구매제한금액<em class="required" title="필수"></em></th>
+											<td class="buyLimitAmtArea">
+												<input type="text" id="buyLimitAmt" name="buyLimitAmt" class="w200" required="required" value="0" style="text-align: right;" data-valid-name="구매제한금액" data-valid-type="numeric">원
+											</td>
+											<th class="maxDcAmtArea">최대할인금액<em class="required" title="필수"></em></th>
+											<td class="maxDcAmtArea">
+												<input type="text" class="w200" id="maxDcAmt" name="maxDcAmt" value="0" required="required" data-valid-name="최대할인금액" data-valid-type="numeric" style="text-align: right;"><span id="maxDcAmtSpan">원</span>
+											</td>
+										</tr>
+										<tr>
+											<th class="downStdtArea">다운로드시작일시<em class="required" title="필수"></em></th>
+											<td class="downStdtArea">
+												<input type="hidden" name="downStdt" id="downStdt" required="required" data-valid-name="다운로드시작일시">
+												<input type="text" class="schDate w100" name="downStDay" id="downStDay" maxlength="10" th:value="${#calendars.format(#calendars.createNow(), 'yyyy-MM-dd')}"/>
+												<select name="downStHH" id="downStHH">
+													<option th:if="${hhList}" th:each="oneData , status : ${hhList}" th:text="${oneData.cdNm}" th:value="${oneData.cd}"></option>
+												</select>
+												<select name="downStMM" id="downStMM">
+													<option th:if="${mmList}" th:each="oneData , status : ${mmList}" th:text="${oneData.cdNm}" th:value="${oneData.cd}"></option>
+												</select>
+											<th class="downEddtArea">다운로드종료일시<em class="required" title="필수"></em></th>
+											<td class="downEddtArea">
+												<input type="hidden" id="downEddt" name="downEddt" required="required" data-valid-name="다운로드종료일시">
+												<input type="text" class="schDate w100" name="downEdDay" id="downEdDay" maxlength="10" th:value="${#calendars.format(#calendars.createNow(), 'yyyy-MM-dd')}"/>
+												<select name="downEdHH" id="downEdHH" onclick="fnChangeEdHH(this);">
+													<option th:if="${hhList}" th:each="oneData , status : ${hhList}" th:text="${oneData.cdNm}" th:value="${oneData.cd}"></option>
+													<option th:text="24시" th:value="24"></option>
+												</select>
+												<select name="downEdMM" id="downEdMM">
+													<option th:if="${mmList}" th:each="oneData , status : ${mmList}" th:text="${oneData.cdNm}" th:value="${oneData.cd}"></option>
+												</select>
+											</td>
+										</tr>
+										<tr>
+											<th class="pdGbArea">기간/일수구분<em class="required" title="필수"></em></th>
+											<td class="pdGbArea">
+												<select name="pdGb" id="pdGb" onchange="pdGbChange(this)" required="required" data-valid-name="기간/일수구분">
+													<option value="P">기간</option>
+													<option value="D">일수</option>
+												</select>
+											</td>
+											<th class="availDaysArea">유효기간일수<em class="required" title="필수"></em></th>
+											<td class="availDaysArea">
+												<input type="text" name="availDays" id="availDays" class="w200" data-valid-name="유효기간일수">
+											</td>
+										</tr>
+										<tr>
+											<th class="availDateTr">유효기간시작일시<em class="required" title="필수"></em></th>
+											<td class="availDateTr">
+												<input type="hidden" name="availStdt" id="availStdt" data-valid-name="유효기간시작일시">
+												<input type="text" class="schDate w100" name="availStDay" id="availStDay" maxlength="10" th:value="${#calendars.format(#calendars.createNow(), 'yyyy-MM-dd')}"/>
+												<select name="availStHH" id="availStHH">
+													<option th:if="${hhList}" th:each="oneData , status : ${hhList}" th:text="${oneData.cdNm}" th:value="${oneData.cd}"></option>
+												</select>
+												<select name="availStMM" id="availStMM">
+													<option th:if="${mmList}" th:each="oneData , status : ${mmList}" th:text="${oneData.cdNm}" th:value="${oneData.cd}"></option>
+												</select>
+											<th class="availDateTr">유효기간종료일시<em class="required" title="필수"></em></th>
+											<td class="availDateTr">
+												<input type="hidden" id="availEddt" name="availEddt" data-valid-name="유효기간종료일시">
+												<input type="text" class="schDate w100" name="availEdDay" id="availEdDay" maxlength="10" th:value="${#calendars.format(#calendars.createNow(), 'yyyy-MM-dd')}"/>
+												<select name="availEdHH" id="availEdHH" onclick="fnChangeEdHH(this);">
+													<option th:if="${hhList}" th:each="oneData , status : ${hhList}" th:text="${oneData.cdNm}" th:value="${oneData.cd}"></option>
+													<option th:text="24시" th:value="24"></option>
+												</select>
+												<select name="availEdMM" id="availEdMM">
+													<option th:if="${mmList}" th:each="oneData , status : ${mmList}" th:text="${oneData.cdNm}" th:value="${oneData.cd}"></option>
+												</select>
+											</td>
+										</tr>
+										<tr class="dcCdCheck1">
+											<th>총발행제한수량<em class="required" title="필수"></em></th>
+											<td>
+												<input type="text" class="w200" name="totPubLimitQty" id="totPubLimitQty" value="0" required="required" data-valid-name="총발행제한수량" data-valid-type="numeric" style="text-align: right;">개
+												<label class="chkBox" id="chkBoxTotPubQty"><input type="checkbox" id="chkNoLimitTotPubLimitQty"/>제한없음</label>
+											</td>
+											<th>1인당발행제한수량<em class="required" title="필수"></em></th>
+											<td>
+												<input type="text" class="w200" name="custPubLimitQty" id="custPubLimitQty" value="0" required="required" data-valid-name="1인당발행제한수량" data-valid-type="numeric" style="text-align: right;">개
+												<label class="chkBox" id="chkBoxCustPubQty"><input type="checkbox" id="chkNoLimitCustPubLimitQty"/>제한없음</label>
+											</td>
+										</tr>
+										<tr>
+											<th class="dcCdCheck2">1회발행수량<em class="required" title="필수"></em></th>
+											<td class="dcCdCheck2">
+												<input type="text" class="w200" name="onePubQty" id="onePubQty" value="1" required="required" data-valid-name="1회발행수량" data-valid-type="numeric" style="text-align: right;">개
+											</td>
+											<th class="downAblArea">다운로드가능여부<em class="required" title="필수"></em></th>
+											<td class="downAblArea">
+												<select name="downAblYn" id="downAblYn" required="required" data-valid-name="다운로드가능여부">
+													<option value="Y">Y</option>
+													<option value="N" selected="selected">N</option>
+												</select>
+											</td>
+										</tr>
+										<tr>
+											<th>쿠폰상태<em class="required" title="필수"></em></th>
+											<td>
+												<label class="rdoBtn" th:if="${cpnStatList}" th:each="oneData, status : ${cpnStatList}" >
+													<input type="radio" id="disCpnStat" name="disCpnStat" th:value="${oneData.cd}" th:text="${oneData.cdNm}" data-valid-name="상태" disabled="disabled"/>
+												</label>
+												<input type="hidden" id="cpnStat" name="cpnStat"/>
+											</td>
+										</tr>
+									</tbody>
+								</table>
+							</div>
+						</li>
+						<li class="tab" id="coupontab2">
+							<div class="panelStyle">
+								<div class="inner-panelContent">
+									<div class="panelContent">
+										<div class="panelBar">
+											<h4>적용 대상 상품 등록</h4>
+										</div>
+										<table class="frmStyle">
+											<colgroup>
+												<col style="width:15%;">
+												<col style="width:85%;">
+											</colgroup>
+											<tbody>
+											<tr>
+												<th>적용범위<em class="required" title="필수"></em></th>
+												<td>
+													<input type="hidden" name="applyScope" id="applyScope" required="required" data-valid-name="적용범위">
+													<label class="rdoBtn"> <input type="radio" name="rdoApplyScope" value="A"/>전체</label>
+													<label class="rdoBtn"> <input type="radio" name="rdoApplyScope" value="I"/>개별</label>
+												</td>
+											</tr>
+											<tr class="supplyTrArea">
+												<th>공급처</th>
+												<td>
+													<div class="padding10 inner-tb-solid">
+														<button type="button" class="btn btnRight btn-success btn-lg" id="btnSupplyAdd">공급처 추가</button>
+														<button type="button" class="btn btnRight btn-success btn-lg" id="btnSupplyDel">선택삭제</button>
+														<br/>
+														<div id="supplyGridList" style="width:100%; height:200px;" class="ag-theme-balham"></div>
+													</div>
+												</td>
+											</tr>
+											<tr class="brandTrArea">
+												<th>브랜드</th>
+												<td>
+													<div class="padding10 inner-tb-solid">
+														<button type="button" class="btn btnRight btn-success btn-lg" id="btnBrandAdd">브랜드 추가</button>
+														<button type="button" class="btn btnRight btn-success btn-lg" id="btnBrandDel">선택삭제</button>
+														<br/>
+														<div id="brandGridList" style="width:100%; height:200px;" class="ag-theme-balham"></div>
+													</div>
+												</td>
+											</tr>
+											<tr class="categoryTrArea">
+												<th>카테고리</th>
+												<td>
+													<div class="padding10 inner-tb-solid">
+														<button type="button" class="btn btnRight btn-success btn-lg" id="btnCateAdd">카테고리 추가</button>
+														<button type="button" class="btn btnRight btn-success btn-lg" id="btnCateDel">선택삭제</button>
+														<br/>
+														<div id="cateGridList" style="width:100%; height:200px;" class="ag-theme-balham"></div>
+													</div>
+												</td>
+											</tr>
+											<tr class="goodsTrArea">
+												<th>적용상품</th>
+												<td>
+													<div class="padding10 inner-tb-solid">
+														<button type="button" class="btn btnRight btn-success btn-lg" id="btnGoodsAdd">상품 추가</button>
+														<button type="button" class="btn btnRight btn-success btn-lg" id="btnGoodsDel">선택삭제</button>
+														<br/>
+														<div id="goodsGridList" style="width:100%; height:200px;" class="ag-theme-balham"></div>
+													</div>
+												</td>
+											</tr>
+											</tbody>
+										</table>
+									</div>
+								</div>
+								<div class="inner-panelContent exceptArea">
+									<div class="panelContent">
+										<div class="panelBar">
+											<h4>적용 대상 상품 등록</h4>
+										</div>
+										<table class="frmStyle">
+											<colgroup>
+												<col style="width:15%;">
+												<col style="width:85%;">
+											</colgroup>
+											<tbody>
+											<tr>
+												<th>제외상품</th>
+												<td>
+													<div class="padding10 inner-tb-solid">
+														<button type="button" class="btn btnRight btn-success btn-lg" id="btnExcepGoodsAdd">제외상품 추가</button>
+														<button type="button" class="btn btnRight btn-success btn-lg" id="btnExcepGoodsDel">선택삭제</button>
+														<br/>
+														<div id="excepGoodsGridList" style="width:100%; height:200px;" class="ag-theme-balham"></div>
+													</div>
+												</td>
+											</tr>
+											</tbody>
+										</table>
+									</div>
+								</div>
+							</div>
+						</li>
+					</ul>
+				</div>
+				<div class="mdPopBtnB aR">
+					<button type="button" class="btn btn-info btn-lg" onclick="fnPubCustListPopUp();" th:if="${mode == 'U'}">발급받은회원</button>
+					<button type="button" class="btn btnRight btn-success btn-lg couponButton" id="btnCouponSave" onclick="fnCouponCreate();" th:text="${mode == 'N' ? '등록' : '수정'}"></button>
+					<button type="button" class="btn btnRight btn-success btn-lg couponButton" id="btnChangeStatIng" style="display: none;">진행</button>
+					<button type="button" class="btn btnRight btn-success btn-lg couponButton" id="btnCouponStop" style="display: none;">중지</button>
+					<button type="button" class="btn btnRight btn-success btn-lg couponButton" id="btnCouponEnd" style="display: none;">종료</button>
+				</div>
+			</form>
+		</div>
+	</div>
+</div>
+<script th:inline="javascript">
+	/*<![CDATA[*/
+	var mode = [[${mode}]];
+	var cpnDetail = [[${cpnDetail}]];
+	var cpnDtlRefvalSupplyCompList = [[${cpnDtlRefvalSupplyCompList}]];
+	var cpnDtlRefvalApplyGoodsList = [[${cpnDtlRefvalApplyGoodsList}]];
+	var cpnDtlRefvalCateList = [[${cpnDtlRefvalCateList}]];
+	var cpnDtlRefvalBrandList = [[${cpnDtlRefvalBrandList}]];
+	var cpnDtlRefvalExceptGoodsList = [[${cpnDtlRefvalExceptGoodsList}]];
+
+	var issueCnt = [[${issueCnt}]];
+
+	// 공통코드 리스트
+	//var cateGbList = gagajf.convertToArray([[${cateGbList}]]);
+	var delYnList = { "Y":"Yes", "N":"No" };
+	//var selfBrandList = gagajf.convertToArray([[${selfBrandList}]]);
+
+	// 종료시간 클릭시
+	var fnChangeEdHH = function (obj){
+		var selectId = obj.id;
+		var changeId = "";
+		if(selectId == "downEdHH"){
+			changeId = "downEdMM";
+		}else if(selectId == "availEdHH"){
+			changeId = "availEdMM";
+		}else if(selectId == "buyEdHH"){
+			changeId = "buyEdMM";
+		}else{
+			changeId = "custJoinEdMM";
+		}
+		if(obj.value == 24) {
+			$("#CouponForm #"+changeId+" option").hide();
+			$('#CouponForm #'+changeId+' option:first').show().prop("selected", true);
+		} else {
+			$("#CouponForm #"+changeId+" option").show();
+		}
+	};
+
+	// 총발행 제한수량 -> 제한없음 처리
+	$("#CouponForm #chkBoxTotPubQty").bind('click', function (){
+		var chkBox= document.getElementById('chkNoLimitTotPubLimitQty').checked;
+
+		var cpnStat = $('#CouponForm input:radio[name="disCpnStat"]:checked').val();
+		if(cpnStat=='G232_10'){
+			if(chkBox){ //true 체크가 되어있었는데 해제됐어 -> 값0 inputbox disabled 해제
+				$("#CouponForm #totPubLimitQty").val(0);
+				$("#CouponForm input[id=totPubLimitQty]").prop("disabled", true);
+				$("#CouponForm input[id=totPubLimitQty]").prop("readonly", true);
+			}else{	//false 체크가 안되어있었는데 체크됐어 -> 값0 inputbox disabled
+				$("#CouponForm #totPubLimitQty").val(0);
+				$("#CouponForm input[id=totPubLimitQty]").prop("disabled", false);
+				$("#CouponForm input[id=totPubLimitQty]").prop("readonly", false);
+			}
+		}
+	});
+
+	// 1인당발행 제한수량 -> 제한없음 처리
+	$("#CouponForm #chkBoxCustPubQty").bind('click', function (){
+		var chkBox= document.getElementById('chkNoLimitCustPubLimitQty').checked;
+		var cpnStat = $('#CouponForm input:radio[name="disCpnStat"]:checked').val();
+		if(cpnStat=='G232_10'){
+			if(chkBox){ //true 체크가 되어있었는데 해제됐어 -> 값0 inputbox disabled 해제
+				$("#CouponForm #custPubLimitQty").val(0);
+				$("#CouponForm input[id=custPubLimitQty]").prop("disabled", true);
+				$("#CouponForm input[id=custPubLimitQty]").prop("readonly", true);
+			}else{	//false 체크가 안되어있었는데 체크됐어 -> 값0 inputbox disabled
+				$("#CouponForm #custPubLimitQty").val(0);
+				$("#CouponForm input[id=custPubLimitQty]").prop("disabled", false);
+				$("#CouponForm input[id=custPubLimitQty]").prop("readonly", false);
+			}
+		}
+	});
+
+	// 할인방식 할인율 일때, 할인값 체크
+	var fnDcValOnkeyUp = function (obj){
+		var inputName = $(obj).attr("name");
+		var rdoDcWay = $('#CouponForm input:radio[name="rdoDcWay"]:checked').val();
+		var dcVal = $("#CouponForm input[name="+inputName+"]").val();
+		if(rdoDcWay == "G240_11"){
+			if(dcVal > 100){
+				mcxDialog.alert('할인율은 100을 넘을수 없습니다.');
+				$("#CouponForm input[name="+inputName+"]").val('');
+				$("#CouponForm input[name="+inputName+"]").focus();
+				return;
+			}
+		}
+	}
+
+	// 할인값 동일적용
+	$("#applySameValueBtn").bind('click change', function () {
+		var cdPval = $("#CouponForm input[name=dcPval]").val();
+		$("#CouponForm input[name=dcMval]").val(cdPval);
+		$("#CouponForm input[name=dcAval]").val(cdPval);
+	});
+
+	function checkValidation2(){
+		// 쿠폰명 체크
+		var chkCpnNm = $('#CouponForm input[name=cpnNm]').val();
+		if(gagajf.isNull(chkCpnNm)){
+			mcxDialog.alert("쿠폰명을 입력해주세요.");
+			$('#CouponForm input[name=cpnNm]').focus();
+			return false;
+		}
+
+		// 할인금액, 할인율 체크
+		var chkDcPval = $('#CouponForm input[name=dcPval]').val();
+		var chkDcMval = $('#CouponForm input[name=dcMval]').val();
+		var chkDcAval = $('#CouponForm input[name=dcAval]').val();
+		if(gagajf.isNull(chkDcPval)){
+			mcxDialog.alert("할인값(PC)을 입력해주세요.");
+			$('#CouponForm input[name=dcPval]').focus();
+			return false;
+		}
+		if(gagajf.isNull(chkDcMval)){
+			mcxDialog.alert("할인값(모바일웹)을 입력해주세요.");
+			$('#CouponForm input[name=dcMval]').focus();
+			return false;
+		}
+		if(gagajf.isNull(chkDcAval)){
+			mcxDialog.alert("할인값(모바일앱)을 입력해주세요.");
+			$('#CouponForm input[name=dcAval]').focus();
+			return false;
+		}
+
+		return true;
+	}
+
+	// 즉시할인쿠폰일때 데이터 validation 체크
+	var checkValidation10 = function (){
+		var stdt = $('#CouponForm #availStdt').val();
+		var eddt = $('#CouponForm #availEddt').val();
+		if(gagajf.isNull(stdt)){
+			mcxDialog.alert("유효기간 시작일시를 입력해주세요.");
+			return false;
+		}
+		if(gagajf.isNull(eddt)){
+			mcxDialog.alert("유효기간 종료일시를 입력해주세요.");
+			return false;
+		}
+		if(stdt>eddt){
+			mcxDialog.alert("시작일시가 종료일시보다 클 수 없습니다.");
+			return false;
+		}
+
+		return true;
+	}
+
+	var checkValidation20 = function (cpnType){
+		// 할인율 validation 체크 (100을 넘길수없음)
+		if($('#dcWay').val() == 'G240_11') {
+			if($('#dcPval').val() > 100) {
+				mcxDialog.alert('PC할인율은 100을 초과할수없습니다.');
+				$('#dcPval').focus();
+				return false;
+			} else if( $('#dcMval').val() > 100) {
+				mcxDialog.alert('모바일(웹)할인율은 100을 초과할수없습니다.');
+				$('#dcMval').focus();
+				return false;
+			}  else if( $('#dcAval').val() > 100) {
+				mcxDialog.alert('모바일(앱)할인율은 100을 초과할수없습니다.');
+				$('#dcAval').focus();
+				return false;
+			}
+		}
+
+		var chkLimitCpnCnt = document.getElementById('chkNoLimitTotPubLimitQty').checked;
+		if(!chkLimitCpnCnt){
+			let cnt = $("#CouponForm").find("[name=totPubLimitQty]").val();
+			if(cnt < 1){
+				mcxDialog.alert("총발행 제한수량은 0보다 커야합니다.");
+				return false;
+			}
+		}
+
+		var chkCustLimitCpnCnt = document.getElementById('chkNoLimitCustPubLimitQty').checked;
+		if(!chkCustLimitCpnCnt){
+			let cnt = $("#CouponForm").find("[name=custPubLimitQty]").val();
+			if(cnt < 1){
+				mcxDialog.alert("1인당 발행 제한수량은 0보다 커야합니다.");
+				return false;
+			}
+		}
+
+		var chkIssueCnt = $("#CouponForm").find("[name=onePubQty]").val();
+		if(chkIssueCnt < 1){
+			mcxDialog.alert("1회발행 제한수량은 0보다 커야합니다.");
+			return false;
+		}
+
+		return true;
+	}
+
+	// 쿠폰 등록
+	function fnCouponCreate(){
+		// 필수값들 셋팅
+		setReqValue();
+
+		// 데이터 validation 체크
+		if(!checkValidation2()) {
+			return false;
+		}
+
+		var chkCpnType = $("#CouponForm input[name=rdoCpnType]:checked").val();
+		if(chkCpnType == 'G230_10'){	// 즉시할인쿠폰일때
+			if(!checkValidation10()){
+				return false;
+			}
+		}else{
+			if(!checkValidation20(chkCpnType)){
+				return false;
+			}
+		}
+
+		mcxDialog.confirm('저장하시겠습니까?' , {
+			cancelBtnText: "취소",
+			sureBtnText: "확인",
+			sureBtnClick: function () {
+				var usableCustGbArr = [];
+				var chkCustGb  = $('#CouponForm input:checkbox[name=usableCustGbArr]:checked');
+				for(let i=0; i< chkCustGb.length; i++){
+					usableCustGbArr.push(chkCustGb.eq(i).val());
+				}
+
+				var usableCustGradeArr = [];
+				var chkCustGrade = $('#CouponForm input:checkbox[name=usableCustGradeArr]:checked');
+				for(let i=0; i< chkCustGrade.length; i++){
+					usableCustGradeArr.push(chkCustGrade.eq(i).val());
+				}
+
+				var payTypeArr = [];
+				var chkPayType = $('#CouponForm input:checkbox[name=payTypeArr]:checked');
+				for(let i=0; i< chkPayType.length; i++){
+					payTypeArr.push(chkPayType.eq(i).val());
+				}
+
+				var data = {
+					cpnId : $('#CouponForm input[name=cpnId]').val()
+					,cpnNm : $('#CouponForm input[name=cpnNm]').val()
+					,cpnDesc : $('#CouponForm input[name=cpnDesc]').val()
+					,siteCd : $('#CouponForm select[name=siteCd]').val()
+					// ,afLinkCd : $('#CouponForm select[name=afLinkCd]').val()
+					,cpnType : $('input:radio[name="rdoCpnType"]:checked').val()
+					,applyScope : $('input:radio[name="rdoApplyScope"]:checked').val()
+					,dcWay : $('input:radio[name="rdoDcWay"]:checked').val()
+					,dcPval : $('#CouponForm input[name=dcPval]').val().replaceAll(',','')
+					,dcMval : $('#CouponForm input[name=dcMval]').val().replaceAll(',','')
+					,dcAval : $('#CouponForm input[name=dcAval]').val().replaceAll(',','')
+					,maxDcAmt : $('#CouponForm input[name=maxDcAmt]').val().replaceAll(',','')
+					,pdGb : $('#CouponForm select[name=pdGb]').val()
+					,availStdt : $('#CouponForm input[name=availStdt]').val()
+					,availEddt : $('#CouponForm input[name=availEddt]').val()
+					,availDays : $('#CouponForm input[name=availDays]').val()
+					,custPubLimitQty : $('#CouponForm input[name=custPubLimitQty]').val().replaceAll(',','')
+					,totPubLimitQty : $('#CouponForm input[name=totPubLimitQty]').val().replaceAll(',','')
+					,onePubQty : $('#CouponForm input[name=onePubQty]').val().replaceAll(',','')
+					,downStdt : $('#CouponForm input[name=downStdt]').val()
+					,downEddt : $('#CouponForm input[name=downEddt]').val()
+					,buyLimitAmt : $('#CouponForm input[name=buyLimitAmt]').val().replaceAll(',','')
+					,cpnStat : $('input:radio[name="disCpnStat"]:checked').val()
+					,endAlimYn : $('#CouponForm select[name=endAlimYn]').val()
+					,firstOrdYn : $('#CouponForm select[name=firstOrdYn]').val()
+					,downAblYn : $('#CouponForm select[name=downAblYn]').val()
+					,custJoinStdt : $('#CouponForm input[name=custJoinStdt]').val()
+					,custJoinEddt : $('#CouponForm input[name=custJoinEddt]').val()
+					,buyStdt : $('#CouponForm input[name=buyStdt]').val()
+					,buyEddt : $('#CouponForm input[name=buyEddt]').val()
+					,newCustYn : $('#CouponForm select[name=newCustYn]').val()
+					// ,afChannel : $('#CouponForm select[name=afChannel]').val()
+					,dcCdGb : $('input:radio[name="dcCdGb"]:checked').val()
+					,rdCpnNm : $('input[name="serialCpnNm"]').val()
+					,supplyCompList : gagaAgGrid.getAllRowData(supplyGridOptions)
+					,brandList : gagaAgGrid.getAllRowData(brandGridOptions)
+					,applyGoodsList : gagaAgGrid.getAllRowData(goodsGridOptions)
+					,exceptGoodsList : gagaAgGrid.getAllRowData(excepGoodsGridOptions)
+					,cateList : gagaAgGrid.getAllRowData(cateGridOptions)
+					,burdenList : gagaAgGrid.getAllRowData(inComGridOptions)
+					,usableCustGbArr : usableCustGbArr
+					,usableCustGradeArr : usableCustGradeArr
+					,payTypeArr : payTypeArr
+					,limitedTimeCpnList : gagaAgGrid.getAllRowData(limitedTimeCpnGridOptions)
+					,afChannelList : gagaAgGrid.getAllRowData(afLinkOptions)
+					,mode : $('#CouponForm input[name=mode]').val()
+				};
+				var jsonData = JSON.stringify(data);
+				gagajf.ajaxJsonSubmit($('#CouponForm').prop('action'), jsonData, fnCouponSaveCollback);
+			}
+		});
+	}
+
+	var fnCouponSaveCollback = function (result){
+		uifnPopupClose('CouponRegForm');
+		$('#btnSearch').trigger('click');
+	}
+
+	// 쿠폰 수정 시
+	function fnCouponUpdate(){
+		mcxDialog.confirm('수정하시겠습니까?' , {
+			cancelBtnText:"취소",
+			sureBtnText:"확인",
+			sureBtnClick: function () {
+				gagajf.removeCommaAtNumberFormattedInput('#CouponForm');
+				// disabled 해제
+				$("#CouponForm * ").attr("readonly" , false);
+				$("#CouponForm * ").prop("disabled" , false);
+				// 필수값들 셋팅
+				setReqValue();
+				// 필수값 validation 체크
+				if (!gagajf.validation('#CouponForm')) {
+					return false;
+				}
+				if(!checkValidation()) {
+					return false;
+				}
+
+				gagajf.ajaxFormSubmit($('#CouponForm').prop('action'), '#CouponForm', function() {
+					uifnPopupClose('CouponRegForm');
+					$('#btnSearch').trigger('click');
+				});
+			}
+		});
+	}
+	// disabled 해제
+	function setDisabledFalse(){ //debugger;
+
+
+	}
+
+	function checkValidation(){
+		// 할인율 validation 체크 (100을 넘길수없음)
+		if($('#dcWay').val() == 'G240_11') {
+			if($('#dcPval').val() > 100) {
+				mcxDialog.alert('PC할인율은 100을 초과할수없습니다.');
+				$('#dcPval').focus();
+				return false;
+			} else if( $('#dcMval').val() > 100) {
+				mcxDialog.alert('모바일(웹)할인율은 100을 초과할수없습니다.');
+				$('#dcMval').focus();
+				return false;
+			}  else if( $('#dcAval').val() > 100) {
+				mcxDialog.alert('모바일(앱)할인율은 100을 초과할수없습니다.');
+				$('#dcAval').focus();
+				return false;
+			}
+		}
+
+		return true;
+	}
+
+	// 할인방식 변경
+	$("#CouponForm input[name=rdoDcWay]").bind('click change', function () {
+		var radioValue = $(this).val();
+		//발급이력이있으면 수정안됨
+		if(issueCnt > 0 ) {
+			return false;
+		}
+
+		if(radioValue == 'G240_10') {		//할인금액
+			$('#dcPvalSpan').text("원");
+			$('#dcMvalSpan').text("원");
+			$('#dcAvalSpan').text("원");
+			$('#dcPval').val(0);
+			$('#dcMval').val(0);
+			$('#dcAval').val(0);
+			$('#maxDcAmt').val(0);
+			$("#CouponForm .maxDcAmtArea").hide();
+		} else {		//할인율
+			$('#dcPvalSpan').text("%");
+			$('#dcMvalSpan').text("%");
+			$('#dcAvalSpan').text("%");
+			$('#dcPval').val(0);
+			$('#dcMval').val(0);
+			$('#dcAval').val(0);
+			$('#maxDcAmt').val(0);
+
+			if($("#CouponForm input[name=rdoCpnType]:checked").val() == 'G230_10'){
+				$("#CouponForm .maxDcAmtArea").hide();
+			}else{
+				$("#CouponForm .maxDcAmtArea").show();
+			}
+		}
+	});
+
+	// 쿠폰 상태 변경
+	$("#CouponForm input[name=rdoCpnType]").bind('click change', function () {
+		var radioValue = $(this).val();
+
+		if(mode == "U") {
+			radioValue = cpnDetail.cpnType;
+		}
+
+		// 즉시할인아닌 쿠폰들 할인금액체크시 최대할인금액 숨김
+		var rdoDcWayVal = $("#CouponForm input[name=rdoDcWay]:checked").val();
+
+		// 즉시할인쿠폰일때 유효기간 노출, 그외 유효기간/일수 선택
+		var pgGbVal = $('#CouponForm select[name="pdGb"] option:selected').val();
+		if(pgGbVal == 'P') {	//기간
+			$('#CouponForm .availDaysArea').hide();
+			$('#CouponForm .availDateTr').show();
+		}else{	//일수
+			$('#CouponForm .availDateTr').hide();
+			$('#CouponForm .availDaysArea').show();
+		}
+
+		// 즉시할인 쿠폰일때
+		if(radioValue == 'G230_10'){
+			$('#CouponForm .custJoinTr').hide();
+			$('#CouponForm .custJoinDateTr').hide();
+			$('#CouponForm .firstBuyTr').hide();
+			$('#CouponForm .buyDateTr').hide();
+			$('#CouponForm .dcCdCheck1').hide();
+			$('#CouponForm .limitedTimeCpnArea').hide();
+			$('#CouponForm .pdGbArea').hide();
+			$('#CouponForm .availDaysArea').hide();
+			// 다운로드 시작,종료 , 기간/일수 , 제휴채널, 고객 등급, 구매제한 , 할인율일때 구매제한한도, 1회발행수량, 다운로드 가능여부 숨기기
+			$('#CouponForm .downStdtArea').hide();
+			$('#CouponForm .downEddtArea').hide();
+			$('#CouponForm .pdGbArea').hide();
+			$('#CouponForm .buyLimitAmtArea').hide();
+			$('#CouponForm .usableCustGbArea').hide();
+			$('#CouponForm .usableCustGradeArea').hide();
+			$('#CouponForm .downAblArea').hide();
+			$('#CouponForm .linkAfArea').hide();
+			$('#CouponForm .dcCdCheck2').hide();
+			$('#CouponForm .maxDcAmtArea').hide();
+			$('#CouponForm .availDateTr').show();
+			$("#CouponForm input:radio[name='rdoApplyScope']:radio[value=I]").prop('checked', true);
+			$("#CouponForm").find("input:radio[name='rdoApplyScope']").attr('disabled', true);
+			$("#CouponForm").find("input:radio[name='rdoApplyScope']").attr('readonly', true);
+		}else{
+			$("#CouponForm input:radio[name='rdoApplyScope']:radio[value=A]").prop('checked', true);
+			$("#CouponForm").find("input:radio[name='rdoApplyScope']").attr('disabled', false);
+			$("#CouponForm").find("input:radio[name='rdoApplyScope']").attr('readonly', false);
+
+			if(radioValue == 'G230_11'){ // 상품쿠폰일때 선착순쿠폰 등록 가능
+				$('#CouponForm .limitedTimeCpnArea').show();
+			}else{
+				$('#CouponForm .limitedTimeCpnArea').hide();
+			}
+
+			if(radioValue == 'G230_30'){	// 배송비쿠폰일때 할인금액만 적용
+				$("#CouponForm input:radio[name='rdoDcWay']:radio[value=G240_10]").prop('checked', true);
+				$("#CouponForm").find("input:radio[name='rdoDcWay']").attr('disabled', true);
+				$("#CouponForm").find("input:radio[name='rdoDcWay']").attr('readonly', true);
+				$('#CouponForm .maxDcAmtArea').hide();
+				// 적용대상 탭
+				$("#CouponForm .supplyTrArea").show();
+				$("#CouponForm .brandTrArea").hide();
+				$("#CouponForm .categoryTrArea").hide();
+				$("#CouponForm .goodsTrArea").hide();
+				$("#CouponForm .exceptArea").hide();
+			}else{
+				$("#CouponForm").find("input:radio[name='rdoDcWay']").attr('disabled', false);
+				$("#CouponForm").find("input:radio[name='rdoDcWay']").attr('readonly', false);
+				$('#CouponForm .maxDcAmtArea').show();
+				// 적용대상 탭
+				$("#CouponForm .supplyTrArea").show();
+				$("#CouponForm .brandTrArea").show();
+				$("#CouponForm .categoryTrArea").show();
+				$("#CouponForm .goodsTrArea").show();
+				$("#CouponForm .exceptArea").show();
+			}
+
+			$('#CouponForm .custJoinTr').show();
+			$('#CouponForm .firstBuyTr').show();
+			$('#CouponForm .dcCdCheck1').show();
+			$('#CouponForm .pdGbArea').show();
+			// 다운로드 시작,종료 , 기간/일수 , 제휴채널, 고객 등급, 구매제한 , 할인율일때 구매제한한도, 1회발행수량, 다운로드 가능여부 숨기기
+			$('#CouponForm .downStdtArea').show();
+			$('#CouponForm .downEddtArea').show();
+			$('#CouponForm .buyLimitAmtArea').show();
+			$('#CouponForm .usableCustGbArea').show();
+			$('#CouponForm .usableCustGradeArea').show();
+			$('#CouponForm .downAblArea').show();
+			$('#CouponForm .linkAfArea').show();
+			$('#CouponForm .dcCdCheck2').show();
+
+			// 즉시할인아닌 쿠폰들 할인금액체크시 최대할인금액 숨김
+			if(rdoDcWayVal == 'G240_10'){
+				$('#CouponForm .maxDcAmtArea').hide();
+			}else{
+				$('#CouponForm .maxDcAmtArea').show();
+			}
+		}
+
+		// 즉시할인쿠폰만 개별, 나머진 전체/개별
+		if(radioValue == 'G230_10') {
+			$("input:radio[name='rdoApplyScope']:radio[value='I']").prop('checked', true);
+		} else {
+			$("input:radio[name='rdoApplyScope']:radio[value='A']").prop('checked', true);
+		}
+
+		// 주문서 쿠폰 선택시 결제수단 노출
+		if(radioValue == 'G230_20') {
+			$('#CouponForm .payTypeTr').show();
+			$('#CouponForm #payType').attr('required' , true);
+			$("#CouponForm .dcCdGb").show();		// 할인쿠폰유형 노출
+		} else {
+			$('#CouponForm .payTypeTr').hide();
+			$('#CouponForm #payType').attr('required' , false );
+			$("#CouponForm .dcCdGb").hide();		// 할인쿠폰유형 숨김
+			$("#CouponForm input:radio[name='dcCdGb']:radio[value='G233_00']").prop('checked', true);		// 주문서 쿠폰이 아닐 경우 일반 쿠폰으로 설정
+		}
+
+		// 선착순 쿠폰 비노출
+		$("#CouponForm .limitedTimeCpnTab").hide();
+		$('#CouponForm input:checkbox[name=limitedTimeCpnYn]').prop('checked', false);
+		$("#limitedTimeCpnYn").val("N");
+		$("#CouponForm #totPubLimitQty").val(0);
+		$("#CouponForm input[id=chkBoxTotPubQty]").prop("disabled", false);
+		$("#CouponForm input[id=totPubLimitQty]").prop("disabled", false);
+		$("#CouponForm input[id=chkNoLimitTotPubLimitQty]").parent("label").removeClass("checked");
+		$("#CouponForm input[id=chkNoLimitTotPubLimitQty]").attr('readonly', false);
+		$("#CouponForm input[id=chkNoLimitTotPubLimitQty]").prop('disabled', false);
+		$("#CouponForm input[id=chkNoLimitTotPubLimitQty]").parent().prop('disabled', false);
+
+		$('#CouponForm #cpnType').val(radioValue);
+	});
+
+	// 할인 쿠폰 유형 변경
+	$("#CouponForm input[name=dcCdGb]").bind('click change', function () {
+		if(this.value == "G233_00") {			// 일반 유형
+			$("#CouponForm .dcCdCheck1").show();
+			$("#CouponForm .dcCdCheck2").show();
+			$("#CouponForm .serialCpnArea").hide();
+			$("#CouponForm .randomCpnArea").hide();
+			$("#CouponForm #newCustYn").parent().attr("colspan", "");
+			$("#CouponForm .normalCol").attr("colspan", "5");
+			$('#CouponForm input[name="serialCpnNm"]').attr('required' , false);
+			$('#CouponForm input[name="serialCpnQty"]').attr('required' , false);
+			$('#CouponForm input[name="randomCpnQty"]').attr('required' , false);
+		} else {
+			if(this.value == "G233_10") {		// 시리얼 유형
+				$("#CouponForm .serialCpnArea").show();
+				$("#CouponForm .randomCpnArea").hide();
+				$("#CouponForm .normalCol").attr("colspan", "5");
+				$('#CouponForm input[name="serialCpnNm"]').attr('required' , true);
+				$('#CouponForm input[name="serialCpnQty"]').attr('required' , true);
+				$('#CouponForm input[name="randomCpnQty"]').attr('required' , false);
+			} else {							// 난수 유형
+				$("#CouponForm .serialCpnArea").hide();
+				$("#CouponForm .randomCpnArea").show();
+				$("#CouponForm .normalCol").attr("colspan", "");
+				$('#CouponForm input[name="serialCpnNm"]').attr('required' , false);
+				$('#CouponForm input[name="serialCpnQty"]').attr('required' , false);
+				$('#CouponForm input[name="randomCpnQty"]').attr('required' , true);
+			}
+			$("#CouponForm .dcCdCheck1").hide();								// 총발행제한수량, 1회발행수량, 1인당발행제한수량 숨김
+			$("#CouponForm .dcCdCheck2").hide();								// 총발행제한수량, 1회발행수량, 1인당발행제한수량 숨김
+			$("#CouponForm #newCustYn").parent().attr("colspan", "5");		// 총발행제한 수량을 없애면서 신규회원여부 colspan 수정
+		}
+	});
+
+	// 적용대상 - 브랜드 추가 버튼시
+	$('#btnBrandAdd').on('click' , function(){
+		cfnOpenBrandListPopup("fnSetPopupBrandInfo", "M");
+	});
+
+	// 브랜드 설정 / 브랜드 추가 콜백함수 (단수로 가져오므로 복수일 경우에 수정 확인 필요)
+	var fnSetPopupBrandInfo = function(result) {
+		for(let i = 0 ; i < result.length ; i++) {
+			let addChk = true, gridListValue = gagaAgGrid.getAllRowData(brandGridOptions);		// 받아온 모든 데이터
+
+			// 받아온 data for
+			for(let j = 0 ; j < gridListValue.length ; j++) {
+				if(gridListValue[j].brandCd == result[i].brandCd) {	addChk = false;	}					// 중복체크
+			}
+
+			// 중복되지 않은 데이터 리스트에 추가
+			if(addChk) {
+				gagaAgGrid.addRowData(brandGridOptions, {"brandCd" : result[i].brandCd, "brandEnm" : result[i].brandEnm, "supplyCompNm" : result[i].supplyCompNm});
+			}
+		}
+	};
+
+
+	// 적용대상 - 공급처 추가 버튼시
+	$('#btnSupplyAdd').on('click' , function (){
+		cfnOpenCompanyListPopup("fnSetPopupComapnyInfo" , "M");
+	});
+
+	// 공급업체 설정 / 업체 추가 콜백함수
+	var fnSetPopupComapnyInfo = function(result) {
+		// 기존 리스트 데이터 for
+		for(let i = 0 ; i < result.length ; i++) {
+			let addChk = true, gridListValue = gagaAgGrid.getAllRowData(supplyGridOptions);		// 받아온 모든 데이터
+
+			// 받아온 data for
+			for(let j = 0 ; j < gridListValue.length ; j++) {
+				// 동일한 data는 추가하지 않음
+				if(gridListValue[j].supplyCompCd == result[i].supplyCompCd) {	addChk = false;	}		// 중복체크
+			}
+
+			// 중복되지 않은 데이터 리스트에 추가
+			if(addChk) {
+				gagaAgGrid.addRowData(supplyGridOptions, {"supplyCompCd" : result[i].supplyCompCd, "supplyCompNm" : result[i].supplyCompNm});
+			}
+		}
+	};
+
+	// 적용대상 - 카테고리 추가시
+	$('#btnCateAdd').on('click' , function () {
+		cfnOpenCategoryPopup("fnSetPopupCategoryInfo");
+	});
+
+	// 카테고리 추가 콜백 함수
+	var fnSetPopupCategoryInfo = function (result) {
+		// 기존 리스트 데이터 for
+		for(let i = 0 ; i < result.length ; i++) {
+			let addChk = true, gridListValue = gagaAgGrid.getAllRowData(cateGridOptions);		// 받아온 모든 데이터
+
+			// 받아온 data for
+			for(let j = 0 ; j < gridListValue.length ; j++) {
+				// 동일한 data는 추가하지 않음
+				if(gridListValue[j].cateNo == result[i].cateNo) {	addChk = false;	}		// 중복체크
+			}
+
+			// 중복되지 않은 데이터 리스트에 추가
+			if(addChk) {
+				gagaAgGrid.addRowData(cateGridOptions, {"siteCd":result[i].siteCd , "cateGb":result[i].cateGb , "cateNo":result[i].cateNo, "cateNm":result[i].cateNm , "formalGb":result[i].formalGb , "brandEnm":null});
+			}
+		}
+	}
+	// 적용대상 - 상품 추가시
+	$('#btnGoodsAdd').on('click' , function () {
+		cfnOpenGoodsPopup("fnSetPopupApplyGoodsInfo");
+	});
+
+	// 적용 상품 리스트 콜백함수
+	var fnSetPopupApplyGoodsInfo = function(result) {
+		gridAddGoodsList(goodsGridOptions, result , "apply");
+	};
+
+	// 적용대상 - 제외상품 추가시
+	$('#btnExcepGoodsAdd').on('click' , function(){
+		cfnOpenGoodsPopup("fnSetPopupExceptGoodsInfo");
+	});
+	// 적용 상품 리스트 콜백함수
+	var fnSetPopupExceptGoodsInfo = function(result) {
+		gridAddGoodsList(excepGoodsGridOptions, result , "except");
+	};
+
+	// ag-grid 상품관련 list 콜백함수
+	function gridAddGoodsList(OriginGridListOption, result, gubun) {
+		var goodsGbVal = "G800_10";
+		if(gubun == 'except'){
+			goodsGbVal = "G800_30";
+		}
+
+		let addCnt = 0;
+		let failCnt = 0;
+		let dupliCnt = 0;
+
+		for(let i = 0 ; i < result.length ; i++) {
+			let addChk = true, gridListValue = gagaAgGrid.getAllRowData(OriginGridListOption);		// 받아온 모든 데이터
+
+			// 받아온 data for
+			for(let j = 0 ; j < gridListValue.length ; j++) {
+				if(gridListValue[j].goodsCd == result[i].goodsCd) {	addChk = false;	dupliCnt++;}				// 중복체크
+			}
+
+			// 중복되지 않은 데이터 리스트에 추가
+			if(addChk) {
+				gagaAgGrid.addRowData(OriginGridListOption, {"goodsGb": goodsGbVal, "goodsCd" : result[i].goodsCd, "goodsNm" : result[i].goodsNm});
+				addCnt++;
+			}
+		}
+		uifnPopupClose('popupGoods');
+		failCnt = result.length - addCnt - dupliCnt;
+		mcxDialog.alert("데이터가 적용되었습니다.<br/>" + addCnt + "건 성공, "+ dupliCnt + "건 중복, " + failCnt + "건 실패");
+	}
+
+	// 기간 일수 변경시
+	function pdGbChange(pThis){
+		var selectVal = $(pThis).val();
+
+		if(typeof selectVal == "undefined") {
+			if(mode == "U") {
+				selectVal = cpnDetail.pdGb;
+			} else {
+				selectVal = "P";
+			}
+		}
+
+		if(selectVal == "P") {
+			$('.availDateTr').css('display' , '');
+			$("#CouponForm .availDaysArea").hide();
+			// $('.availDayTr').css('display' , 'none');
+			$('#CouponForm #availDays').attr('required' , false);
+			$('#CouponForm #availStDay').attr('required' , true);
+			$('#CouponForm #availEdDay').attr('required' , true);
+			$('#CouponForm #availStdt').attr('required' , true);
+			$('#CouponForm #availEddt').attr('required' , true);
+		} else {
+			$('.availDateTr').css('display' , 'none');
+			// $('.availDayTr').css('display' , '');
+			$("#CouponForm .availDaysArea").show();
+			$('#CouponForm #availDays').attr('required' , true);
+			$('#CouponForm #availStDay').attr('required' , false);
+			$('#CouponForm #availEdDay').attr('required' , false);
+			$('#CouponForm #availStdt').attr('required' , false);
+			$('#CouponForm #availEddt').attr('required' , false);
+		}
+	}
+
+	// 발급받은회원 팝업
+	var fnPubCustListPopUp = function (){
+		let cpnId = $("#CouponForm #cpnId").val();
+		var actionUrl = "/marketing/coupon/pubCust/popup/form?cpnId=" + cpnId;
+		cfnOpenModalPopup(actionUrl, 'CpnPubCustListPopup');
+	};
+
+	// 쿠폰발행팝업
+	function fnCustomerIssuePopUp(){
+		cfnCpnPubForCustPopup();
+	};
+
+	// 전송시 값 세팅
+	function setReqValue(){
+		// 쿠폰유형값 세팅
+		$('#CouponForm #cpnType').val($('#CouponForm input:radio[name="rdoCpnType"]:checked').val());
+		// 할인방식값 세팅
+		$('#CouponForm #dcWay').val($('#CouponForm input:radio[name="rdoDcWay"]:checked').val());
+		// 적용범위값 세팅
+		$('#CouponForm #applyScope').val($('#CouponForm input:radio[name="rdoApplyScope"]:checked').val());
+		// 쿠폰상태
+		$('#CouponForm input[name=cpnStat]').val($('input:radio[name="disCpnStat"]:checked').val());
+		// 다운로드기간 세팅
+		let downStdt = "";
+		let downEddt = "";
+		downStdt = $('#CouponForm input[name=downStDay]').val()+$('#CouponForm select[name=downStHH]').val()+$('#CouponForm select[name=downStMM]').val()+'00';
+		if($('#CouponForm select[name=downEdHH]').val() == "24"){
+			downEddt = $('#CouponForm input[name=downEdDay]').val()+'235959';
+		}else{
+			downEddt = $('#CouponForm input[name=downEdDay]').val()+$('#CouponForm select[name=downEdHH]').val()+$('#CouponForm select[name=downEdMM]').val()+'00';
+		}
+		downStdt = downStdt.replace(/[^0-9]/g, '');
+		downEddt = downEddt.replace(/[^0-9]/g, '');
+		$('#CouponForm #downStdt').val(downStdt);
+		$('#CouponForm #downEddt').val(downEddt);
+
+		// 유효기간 세팅
+		let availStdt = "";
+		let availEddt = "";
+		if($("#CouponForm #pdGb").val() == 'P') {
+			availStdt = $('#CouponForm input[name=availStDay]').val()+$('#CouponForm select[name=availStHH]').val()+$('#CouponForm select[name=availStMM]').val()+'00';
+			if($('#CouponForm select[name=availEdHH]').val() == "24"){
+				availEddt = $('#CouponForm input[name=availEdDay]').val()+'235959';
+			}else{
+				availEddt = $('#CouponForm input[name=availEdDay]').val()+$('#CouponForm select[name=availEdHH]').val()+$('#CouponForm select[name=availEdMM]').val()+'00';
+			}
+			availStdt = availStdt.replace(/[^0-9]/g, '');
+			availEddt = availEddt.replace(/[^0-9]/g, '');
+			$('#CouponForm #availStdt').val(availStdt);
+			$('#CouponForm #availEddt').val(availEddt);
+			$('#CouponForm #availDays').val('');
+		} else {
+			$('#CouponForm #availStdt').val('');
+			$('#CouponForm #availEddt').val('');
+		}
+	}
+
+	$(document).ready(function() {
+		// 일단 버튼 숨김
+		$(".couponButton").hide();
+
+		// 초기화시 데이터 세팅
+		if (mode == "N") {
+			$('input[name=rdoCpnType]').eq(0).attr("checked", true);
+			$('input[name=rdoDcWay]').eq(0).attr("checked", true);
+			$('input[name=rdoApplyScope]').eq(0).attr("checked", true)
+			$('#CouponForm #availEdHH option:last').attr("selected", "selected");
+			$('#CouponForm #availEdMM option').hide();
+			$('#CouponForm #availEdMM option:first').show().prop("selected", true);
+			$('#downEdHH option:last').attr("selected", "selected");
+			$('#downEdMM option').hide();
+			$('#downEdMM option:first').show().prop("selected", true);
+			$("#CouponForm .maxDcAmtArea").hide();
+			$("input:radio[name='disCpnStat']:radio[value='G232_10']").prop('checked', true); // 선택하기
+			if($('input:radio[name="rdoCpnType"]:checked').val() == 'G230_10'){
+				$('#CouponForm .dcCdCheck1').hide();
+				// 다운로드 시작,종료 , 기간/일수 , 제휴채널, 고객 등급, 구매제한 , 할인율일때 구매제한한도, 1회발행수량, 다운로드 가능여부 숨기기
+				$('#CouponForm .downStdtArea').hide();
+				$('#CouponForm .downEddtArea').hide();
+				$('#CouponForm .pdGbArea').hide();
+				$('#CouponForm .buyLimitAmtArea').hide();
+				$('#CouponForm .downAblArea').hide();
+				$('#CouponForm .dcCdCheck2').hide();
+				$('#CouponForm .maxDcAmtArea').hide();
+				$("#CouponForm input:radio[name='rdoApplyScope']:radio[value=I]").prop('checked', true);
+				$("#CouponForm").find("input:radio[name='rdoApplyScope']").attr('disabled', true);
+				$("#CouponForm").find("input:radio[name='rdoApplyScope']").attr('readonly', true);
+			}
+			$("#btnCouponSave").show();	// 저장버튼
+			$("#CouponForm .buttonSpan").show();
+
+		} else {
+			if(cpnDetail.cpnStat == "G232_10"){
+				$("#btnCouponSave").show();		// 저장버튼
+				$("#btnChangeStatIng").show();	// 진행버튼
+				$("#btnCouponEnd").show();		// 종료버튼
+				$("#CouponForm .buttonSpan").show();	//행추가,삭제버튼
+			}else if(cpnDetail.cpnStat == "G232_11"){
+				$("#btnCouponSave").hide();		// 저장버튼
+				$("#btnCouponStop").show();		// 중지버튼
+				$("#btnCouponEnd").show();		// 종료버튼
+				$("#CouponForm .buttonSpan").hide();	//행추가,삭제버튼
+			}else{
+				$("#CouponForm .buttonSpan").hide();	//행추가,삭제버튼
+			}
+
+			// 수정모드시 그리드 세팅
+			if(cpnDetail.cpnType == "G230_30"){
+				$("#CouponForm .supplyTrArea").show();
+				$("#CouponForm .brandTrArea").hide();
+				$("#CouponForm .categoryTrArea").hide();
+				$("#CouponForm .goodsTrArea").hide();
+				$("#CouponForm .exceptArea").hide();
+			}
+
+			// 기본정보 세팅
+			$("#CouponForm input:radio[name='rdoDcWay']:radio[value=" + cpnDetail.dcWay + "]").prop('checked', true);
+			$("#CouponForm input:radio[name='rdoCpnType']:radio[value=" + cpnDetail.cpnType + "]").prop('checked', true);
+			$("#CouponForm input:radio[name='rdoApplyScope']:radio[value=" + cpnDetail.applyScope + "]").prop('checked', true);
+			$("#CouponForm #dcPval").val(cpnDetail.dcPval);
+			$("#CouponForm #dcMval").val(cpnDetail.dcMval);
+			$("#CouponForm #dcAval").val(cpnDetail.dcAval);
+			$("#CouponForm #maxDcAmt").val(cpnDetail.maxDcAmt);
+			$("#CouponForm #totPubLimitQty").val(cpnDetail.totPubLimitQty);
+			$("#CouponForm #custPubLimitQty").val(cpnDetail.custPubLimitQty);
+
+			if(cpnDetail.cpnStat!='G232_10'){
+				$("#CouponForm input[id=chkNoLimitTotPubLimitQty]").attr('readonly', true);
+				$("#CouponForm input[id=chkNoLimitTotPubLimitQty]").prop('disabled', true);
+				$("#CouponForm input[id=chkNoLimitTotPubLimitQty]").parent().prop('disabled', true);
+				$("#CouponForm #totPubLimitQty").attr('readonly', true);
+				$("#CouponForm #totPubLimitQty").attr('disabled', true);
+
+				$("#CouponForm input[id=chkNoLimitCustPubLimitQty]").attr('readonly', true);
+				$("#CouponForm input[id=chkNoLimitCustPubLimitQty]").prop('disabled', true);
+				$("#CouponForm input[id=chkNoLimitCustPubLimitQty]").parent().prop('disabled', true);
+				$("#CouponForm #custPubLimitQty").attr('readonly', true);
+				$("#CouponForm #custPubLimitQty").attr('disabled', true);
+				if(cpnDetail.totPubLimitQty<1){
+					$("#CouponForm input[id=chkNoLimitTotPubLimitQty]").parent("label").addClass("checked");
+					$("#CouponForm input[id=chkNoLimitTotPubLimitQty]").prop('checked', true);
+				}else{
+					$("#CouponForm input[id=chkNoLimitTotPubLimitQty]").prop('checked', false);
+				}
+
+				if(cpnDetail.custPubLimitQty<1){
+					$("#CouponForm input[id=chkNoLimitCustPubLimitQty]").parent("label").addClass("checked");
+					$("#CouponForm input[id=chkNoLimitCustPubLimitQty]").prop('checked', true);
+				}else{
+					$("#CouponForm input[id=chkNoLimitCustPubLimitQty]").prop('checked', false);
+				}
+			}else{
+				if(cpnDetail.totPubLimitQty<1){
+					$("#CouponForm input[id=chkNoLimitTotPubLimitQty]").parent("label").addClass("checked");
+					$("#CouponForm input[id=chkNoLimitTotPubLimitQty]").prop('checked', true);
+					$("#CouponForm #totPubLimitQty").attr('readonly', true);
+					$("#CouponForm #totPubLimitQty").attr('disabled', true);
+				}else{
+					$("#CouponForm input[id=chkNoLimitTotPubLimitQty]").prop('checked', false);
+					$("#CouponForm #totPubLimitQty").attr('readonly', false);
+					$("#CouponForm #totPubLimitQty").attr('disabled', false);
+				}
+
+				if(cpnDetail.custPubLimitQty<1){
+					$("#CouponForm input[id=chkNoLimitCustPubLimitQty]").parent("label").addClass("checked");
+					$("#CouponForm input[id=chkNoLimitCustPubLimitQty]").prop('checked', true);
+					$("#CouponForm #custPubLimitQty").attr('readonly', true);
+					$("#CouponForm #custPubLimitQty").attr('disabled', true);
+				}else{
+					$("#CouponForm input[id=chkNoLimitCustPubLimitQty]").prop('checked', false);
+					$("#CouponForm #custPubLimitQty").attr('readonly', false);
+					$("#CouponForm #custPubLimitQty").attr('disabled', false);
+				}
+			}
+
+			$("#CouponForm #onePubQty").val(cpnDetail.onePubQty);
+			$("input:radio[name='disCpnStat']:radio[value="+cpnDetail.cpnStat+"]").prop('checked', true); // 선택하기
+			$("#CouponForm #pdGb").val(cpnDetail.pdGb).prop("selected", true);
+			$("#CouponForm #siteCd").val(cpnDetail.siteCd).prop("selected", true);
+			$("#CouponForm #cpnNm").val(cpnDetail.cpnNm);
+			$("#CouponForm #downAblYn").val(cpnDetail.downAblYn);
+			$("#CouponForm #buyLimitAmt").val(cpnDetail.buyLimitAmt);
+			$("#CouponForm #cpnId").val(cpnDetail.cpnId);
+			$("#CouponForm #cpnDesc").val(cpnDetail.cpnDesc);
+
+			if(cpnDetail.cpnType == "G230_10"){
+				$('#CouponForm .dcCdCheck1').hide();
+				$('#CouponForm .availDaysArea').hide();
+				// 다운로드 시작,종료 , 기간/일수 , 제휴채널, 고객 등급, 구매제한 , 할인율일때 구매제한한도, 1회발행수량, 다운로드 가능여부 숨기기
+				$('#CouponForm .downStdtArea').hide();
+				$('#CouponForm .downEddtArea').hide();
+				$('#CouponForm .pdGbArea').hide();
+				$('#CouponForm .buyLimitAmtArea').hide();
+				$('#CouponForm .downAblArea').hide();
+				$('#CouponForm .dcCdCheck2').hide();
+				$('#CouponForm .maxDcAmtArea').hide();
+				$('#CouponForm .availDateTr').show();
+			}else{
+				$('#CouponForm .dcCdCheck1').show();
+			}
+
+			// 한번 저장되면 쿠폰유형, 할인쿠폰유형, 난수 생성수량, 시리얼명, 시리얼쿠폰발급수량 수정 불가 처리
+			$("#CouponForm input:radio[name='rdoCpnType']").attr('readonly', true);
+			$("#CouponForm input:radio[name='rdoCpnType']").prop('disabled', true);
+			$("#CouponForm input:radio[name='rdoCpnType']").parent().prop('disabled', true);
+
+			// 할인방식이 할인율이면 최대할인금액 노출
+			if(cpnDetail.dcWay == "G240_11"){
+				$("#CouponForm .maxDcAmtArea").show();
+			}
+
+			if($("#CouponForm input[name=rdoDcWay]:checked").val() == 'G240_10') {
+				$("#CouponForm .maxDcAmtArea").hide();
+			}else{
+				$('#dcPvalSpan').text("%");
+				$('#dcMvalSpan').text("%");
+				$('#dcAvalSpan').text("%");
+			}
+
+			// 쿠폰다운 날짜
+			let edDtArr;
+			if(!gagajf.isNull(cpnDetail.downEddt)){
+				edDtArr = cpnDetail.downEddt.split(" ");
+				if(edDtArr[1] == "23:59:59") {
+					edHour = "24";
+					edMinute = "00";
+					$("#CouponForm #downEdMM option").hide();
+					$('#CouponForm #downEdMM option:first').show().prop("selected", true);
+				}
+			}
+
+			// 유효 날짜
+			let availEdDtArr;
+			if(!gagajf.isNull(cpnDetail.availEddt)){
+				availEdDtArr = cpnDetail.availEddt.split(" ");
+				if(availEdDtArr[1] == "23:59:59") {
+					edHour = "24";
+					edMinute = "00";
+					$("#CouponForm #availEdMM option").hide();
+					$('#CouponForm #availEdMM option:first').show().prop("selected", true);
+				}
+			}
+
+			// 만약 쿠폰 발급한 내역이 있으면 쿠폰수정못하게 readonly , disabled 속성 추가
+			if (issueCnt > 0) {
+				$("#CouponForm #pdGb").attr('readonly', true);
+				$("#CouponForm #pdGb").attr('disabled', true);
+				$("#CouponForm #downAblYn").attr('readonly', true);
+				$("#CouponForm #downAblYn").attr('disabled', true);
+				$("#CouponForm #siteCd").attr('readonly', true);
+				$("#CouponForm #siteCd").attr('disabled', true);
+				$("#CouponForm #cpnNm").attr('readonly', true);
+				$("#CouponForm #cpnNm").attr('disabled', true);
+				$("#CouponForm #dcPval").attr('readonly', true);
+				$("#CouponForm #dcPval").attr('disabled', true);
+				$("#CouponForm #dcMval").attr('readonly', true);
+				$("#CouponForm #dcMval").attr('disabled', true);
+				$("#CouponForm #dcAval").attr('readonly', true);
+				$("#CouponForm #dcAval").attr('disabled', true);
+				$("#CouponForm #maxDcAmt").attr('readonly', true);
+				$("#CouponForm #maxDcAmt").attr('disabled', true);
+				$("#CouponForm #totPubLimitQty").attr('readonly', true);
+				$("#CouponForm #totPubLimitQty").attr('disabled', true);
+				$("#CouponForm #custPubLimitQty").attr('readonly', true);
+				$("#CouponForm #custPubLimitQty").attr('disabled', true);
+				$("#CouponForm #onePubQty").attr('readonly', true);
+				$("#CouponForm #onePubQty").attr('disabled', true);
+				$("#CouponForm #downStDay").attr('readonly', true);
+				$("#CouponForm #downStDay").attr('disabled', true);
+				$("#CouponForm #downStHH").attr('readonly', true);
+				$("#CouponForm #downStHH").attr('disabled', true);
+				$("#CouponForm #downStMM").attr('readonly', true);
+				$("#CouponForm #downStMM").attr('disabled', true);
+				$("#CouponForm #buyLimitAmt").attr('readonly', true);
+				$("#CouponForm input:radio[name='rdoDcWay']").attr('readonly', true);
+				$("#CouponForm input:radio[name='rdoApplyScope']").attr('readonly', true);
+				$("#CouponForm .rdoBtn").css('cursor', 'auto');
+				$("#CouponForm #cpnId").attr('readonly', true);
+				$("#CouponForm #cpnId").attr('disabled', true);
+			}
+			// 다운로드기간 세팅
+			splitDate("start", cpnDetail.downStdt, "down");
+			splitDate("end", cpnDetail.downEddt, "down");
+			// 유효기간이 날짜인경우 날짜 세팅
+			if (cpnDetail.pdGb == "P") {
+				splitDate("start", cpnDetail.availStdt, "avail");
+				splitDate("end", cpnDetail.availEddt, "avail");
+				if(issueCnt > 0) {
+					$("#CouponForm #availStDay").attr('readonly', true);
+					$("#CouponForm #availStDay").attr('disabled', true);
+					$("#CouponForm #availStHH").attr('readonly', true);
+					$("#CouponForm #availStHH").attr('disabled', true);
+					$("#CouponForm #availStMM").attr('readonly', true);
+					$("#CouponForm #availStMM").attr('disabled', true);
+				}
+			} else {
+				$("#CouponForm #availDays").val(cpnDetail.availDays);
+				$('#CouponForm #availEdHH option:last').attr("selected", "selected");
+				$('#CouponForm #availEdMM option:last').attr("selected", "selected");
+
+			}
+
+		}
+		// 기본세팅
+		pdGbChange();
+
+	});
+
+	// 날짜분리 ( 시작/종료날짜구분(start , end) , 날짜String , 적용타겟대상 )
+	function splitDate(stedGb , date , targetGb ){
+		var str = date;
+		var dateStr = str.split(' ');
+		var timeArr = dateStr[1].split(':');
+
+		if(stedGb == "start") {
+			$("#CouponForm #"+targetGb+"StDay").val(dateStr[0]);
+			$("#CouponForm #"+targetGb+"StHH").val(timeArr[0]);
+			$("#CouponForm #"+targetGb+"StMM").val(timeArr[1]);
+		} else {
+			$("#CouponForm #"+targetGb+"EdDay").val(dateStr[0]);
+			$("#CouponForm #"+targetGb+"EdHH").val(timeArr[0]);
+			$("#CouponForm #"+targetGb+"EdMM").val(timeArr[1]);
+		}
+	}
+	// 제한없음 문구 변경
+	$("input[name=totPubLimitQty],input[name=custPubLimitQty],input[name=buyLimitAmt],input[name=onePubQty]").change(function(){
+		if($(this).val() == "0"){
+			$("#"+$(this).attr("name")+"Span").html("*제한없음");
+		}else{
+			$("#"+$(this).attr("name")+"Span").html("");
+		}
+		$("#"+$(this).attr("name")+"Span").css("color", "red");
+	});
+	setTimeout(function(){
+		$("input[name=totPubLimitQty],input[name=custPubLimitQty],input[name=buyLimitAmt],input[name=onePubQty]").change();
+	}, 1);
+
+	// 콤마 찍어주기
+	$(function(){
+		setComma("CouponForm" , true);
+	});
+
+	function setComma(formId, pBoolean){
+		setTimeout(function(){
+			//숫자타입 콤마 찍어주기
+			$("#"+formId+" [data-valid-type=numeric]").each(function(){
+				$(this).change(function(){
+					if(pBoolean){
+						$(this).val($(this).val().addComma());
+					}else{
+						$(this).val($(this).val().removeComma());
+					}
+				});
+				if(pBoolean){
+					$(this).val($(this).val().addComma());
+				}else{
+					$(this).val($(this).val().removeComma());
+				}
+			});
+		}, 300);
+	}
+
+	// 진행 버튼 클릭
+	$("#btnChangeStatIng").on("click", function() {
+		mcxDialog.confirmC("쿠폰을 진행하시겠습니까?<br/>진행 후에는 수정이 제한될 수 있습니다.", {
+			btn: ["아니오","예"],
+			btnClick: function(index) {
+				if(index == 2) {
+					let data = { cpnStat : "G232_11"				// 진행
+						, cpnId : $('#CouponForm input[name=cpnId]').val()
+					}
+					var jsonData = JSON.stringify(data);
+					gagajf.ajaxJsonSubmit('/marketing/coupon/changeStat', jsonData, fnCouponSaveCollback);
+				}
+			}
+		});
+	});
+
+	// 중지 버튼 클릭
+	$("#btnCouponStop").on("click", function() {
+		mcxDialog.confirmC("쿠폰 진행을 중지하시겠습니까?<br/>중지 후에는 진행으로 복원하실 수 없습니다.", {
+			btn: ["아니오","예"],
+			btnClick: function(index) {
+				if(index == 2) {
+					let data = { cpnStat : "G232_12"			// 중지
+						, cpnId : $('#CouponForm input[name=cpnId]').val()
+					}
+					var jsonData = JSON.stringify(data);
+					gagajf.ajaxJsonSubmit('/marketing/coupon/changeStat', jsonData, fnCouponSaveCollback);
+				}
+			}
+		});
+	});
+
+	// 종료 버튼 클릭
+	$("#btnCouponEnd").on("click", function() {
+		mcxDialog.confirmC("쿠폰을 종료하시겠습니까?<br/>종료한 프로모션은 복원하실 수 없습니다.", {
+			btn: ["아니오","예"],
+			btnClick: function(index) {
+				if(index == 2) {
+					let data = { cpnStat: "G232_13"			// 종료
+						, cpnId : $('#CouponForm input[name=cpnId]').val()
+					}
+					var jsonData = JSON.stringify(data);
+					gagajf.ajaxJsonSubmit('/marketing/coupon/changeStat', jsonData, fnCouponSaveCollback);
+				}
+			}
+		});
+	});
+
+
+	/*]]>*/
+</script>
+</html>

+ 7 - 7
src/main/webapp/WEB-INF/views/order/OrderSellerDelvListForm.html

@@ -48,14 +48,14 @@ var columnDefs = [
 	{headerName: 'No', width: 60, cellClass: 'text-center', valueGetter: function(params) { return params.node.rowIndex + 1 }},
 	{headerName: 'No', width: 60, cellClass: 'text-center', valueGetter: function(params) { return params.node.rowIndex + 1 }},
 	{headerName: "입점업체",			field:"supplyCompNm",		width:70, cellClass: 'text-center'},
 	{headerName: "입점업체",			field:"supplyCompNm",		width:70, cellClass: 'text-center'},
 	{headerName: "입점업체코드",		field:"supplyCompCd",		width:80, cellClass: 'text-center', hide: true},
 	{headerName: "입점업체코드",		field:"supplyCompCd",		width:80, cellClass: 'text-center', hide: true},
-	{headerName: "브랜드",				field:"brandKnm",			width:80, cellClass: 'text-center'},
+	{headerName: "브랜드",			field:"brandKnm",			width:80, cellClass: 'text-center'},
 	{headerName: "주문번호",			field:"ordNo",				width:70, cellClass: 'text-center'},
 	{headerName: "주문번호",			field:"ordNo",				width:70, cellClass: 'text-center'},
 	{headerName: "주문상세번호",		field:"ordDtlNo",			width:100, cellClass: 'text-center'},
 	{headerName: "주문상세번호",		field:"ordDtlNo",			width:100, cellClass: 'text-center'},
 	{headerName: "업체상품코드",		field:"supplyGoodsCd",		width:100, cellClass: 'text-center'},
 	{headerName: "업체상품코드",		field:"supplyGoodsCd",		width:100, cellClass: 'text-center'},
 	{headerName: "상품코드",			field:"goodsCd",			width:100, cellClass: 'text-center'},
 	{headerName: "상품코드",			field:"goodsCd",			width:100, cellClass: 'text-center'},
-	{headerName: "상품명",				field:"goodsNm",			width:100, cellClass: 'text-center'},
-	{headerName: "옵션1",				field:"optCd1",				width:100, cellClass: 'text-center'},
-	{headerName: "옵션2",				field:"optCd2",				width:100, cellClass: 'text-center'},
+	{headerName: "상품명",			field:"goodsNm",			width:100, cellClass: 'text-center'},
+	{headerName: "옵션1",			field:"optCd1",				width:100, cellClass: 'text-center'},
+	{headerName: "옵션2",			field:"optCd2",				width:100, cellClass: 'text-center'},
 	{headerName: "배송업체",			field:"shipCompCd",			width:120, cellClass: 'text-center'
 	{headerName: "배송업체",			field:"shipCompCd",			width:120, cellClass: 'text-center'
 		, valueFormatter: function (params) {
 		, valueFormatter: function (params) {
 			return gagaAgGrid.lookupValue(shipCompanyList, params.value);
 			return gagaAgGrid.lookupValue(shipCompanyList, params.value);
@@ -67,7 +67,7 @@ var columnDefs = [
 	{headerName: "송장",				field:"invoiceNo",			width:120, cellClass: 'text-center'},
 	{headerName: "송장",				field:"invoiceNo",			width:120, cellClass: 'text-center'},
 	{headerName: "주문수량",			field:"ordQty",				width:100, cellClass: 'text-center'},
 	{headerName: "주문수량",			field:"ordQty",				width:100, cellClass: 'text-center'},
 	{headerName: "출고수량",			field:"delvQty",			width:100, cellClass: 'text-center'},
 	{headerName: "출고수량",			field:"delvQty",			width:100, cellClass: 'text-center'},
-	{headerName: "미출고수량",			field:"cancelQty",			width:100, cellClass: 'text-center'
+	{headerName: "미출고수량",		field:"cancelQty",			width:100, cellClass: 'text-center'
 		, editable 			: true
 		, editable 			: true
 		, cellEditor		: 'agRichSelectCellEditor'
 		, cellEditor		: 'agRichSelectCellEditor'
 		, cellEditorParams	: function(params){
 		, cellEditorParams	: function(params){
@@ -84,10 +84,10 @@ var columnDefs = [
 		}
 		}
 	},
 	},
 	{headerName: "결품수량",			field: "cnclRtnQty",		width: 100, cellClass: 'text-center', hide: true},
 	{headerName: "결품수량",			field: "cnclRtnQty",		width: 100, cellClass: 'text-center', hide: true},
-	{headerName: "결제PG",				field: "pgGb",				width: 100, cellClass: 'text-center', hide: true},
+	{headerName: "결제PG",			field: "pgGb",				width: 100, cellClass: 'text-center', hide: true},
 	{headerName: "결제수단",			field: "payMeans",			width: 100, cellClass: 'text-center', hide: true},
 	{headerName: "결제수단",			field: "payMeans",			width: 100, cellClass: 'text-center', hide: true},
 	{headerName: "고객번호",			field: "custNo",			width: 100, cellClass: 'text-center', hide: true},
 	{headerName: "고객번호",			field: "custNo",			width: 100, cellClass: 'text-center', hide: true},
-	{headerName: "주문고객명",			field: "ordNm",				width: 100, cellClass: 'text-center', hide: true},
+	{headerName: "주문고객명",		field: "ordNm",				width: 100, cellClass: 'text-center', hide: true},
 	{headerName: "환불계좌은행코드",	field: "bankCd",			width: 100, cellClass: 'text-center', hide: true},
 	{headerName: "환불계좌은행코드",	field: "bankCd",			width: 100, cellClass: 'text-center', hide: true},
 	{headerName: "환불계좌예금주명",	field: "accountNm",			width: 100, cellClass: 'text-center', hide: true},
 	{headerName: "환불계좌예금주명",	field: "accountNm",			width: 100, cellClass: 'text-center', hide: true},
 	{headerName: "환불계좌번호",		field: "accountNo",			width: 100, cellClass: 'text-center', hide: true}
 	{headerName: "환불계좌번호",		field: "accountNo",			width: 100, cellClass: 'text-center', hide: true}

+ 3 - 2
src/main/webapp/ux/js/admin.popup.js

@@ -358,8 +358,9 @@ var cfnOpenPointDetailPopup = function(callbackfun, siteCd, custNo) {
  * @since  : 2020/02/10
  * @since  : 2020/02/10
  * @author : LMC
  * @author : LMC
  */
  */
-function cfnCouponCreatePopup(cpnId, callbackfun){
-	var actionUrl = "/marketing/coupon/popup/form";
+function cfnCouponCreatePopup(mode, cpnId, callbackfun){
+	var actionUrl = "/marketing/coupon/popup/form?mode=" + mode;
+	if (typeof(cpnId) != 'undefined') actionUrl += "&cpnId=" + cpnId;
 	if (typeof(callbackfun) != 'undefined') actionUrl += "?callBackFun=" + callbackfun;
 	if (typeof(callbackfun) != 'undefined') actionUrl += "?callBackFun=" + callbackfun;
 	cfnOpenModalPopup(actionUrl,'CouponCreatePopup');
 	cfnOpenModalPopup(actionUrl,'CouponCreatePopup');
 }
 }