jsh77b 5 лет назад
Родитель
Сommit
30b9f97770

+ 19 - 20
src/main/webapp/WEB-INF/views/mob/order/OrderFormMob.html

@@ -1227,7 +1227,7 @@ var dcAmtInfoSet = function() {
 					
 					
 					// 포인트 적용
 					// 포인트 적용
 					$("#orderAmtForm .pntDcSumAmt").text(pntDcAmt);
 					$("#orderAmtForm .pntDcSumAmt").text(pntDcAmt);
-					$("#pntDcAmt").text("-"+pntDcAmt.addComma()+" 원");
+					$("#pntDcAmt").text(getZeroMinusDelAmt(pntDcAmt)+" 원");
 					
 					
 					// 상품권리렛기능
 					// 상품권리렛기능
 					gfcdUseAmtReset();
 					gfcdUseAmtReset();
@@ -1516,11 +1516,7 @@ var custCpnApplyTemp = function(obj, idx, cpnType) {
 	});
 	});
 	
 	
 	// 상품, 장바구니쿠폰 할인 금액만 합계 적용
 	// 상품, 장바구니쿠폰 할인 금액만 합계 적용
-	if (parseInt(goodsCartCpnSumAmt) > 0) {
-		$("#couponModifyPop .modal-footer .goodsCartCpnSumAmt").text("-"+goodsCartCpnSumAmt.addComma());
-	} else {
-		$("#couponModifyPop .modal-footer .goodsCartCpnSumAmt").text(goodsCartCpnSumAmt.addComma());
-	}
+	$("#couponModifyPop .modal-footer .goodsCartCpnSumAmt").text(getZeroMinusDelAmt(goodsCartCpnSumAmt));
 }
 }
 
 
 // 1.11 쿠폰중복체크 후 적용가능
 // 1.11 쿠폰중복체크 후 적용가능
@@ -1816,22 +1812,12 @@ var custCpnSumAmtCal = function() {
 	});
 	});
 
 
 	// 상품, 장바구니쿠폰 할인 금액만 합계 적용
 	// 상품, 장바구니쿠폰 할인 금액만 합계 적용
-	if (goodsCartCpnSumAmt > 0) {
-		$(".maxdisc_amount .goodsCartCpnDcAmt").text("-"+goodsCartCpnSumAmt.addComma()); // 쿠폰할인금액합계
-		$("#couponModifyPop .modal-footer .goodsCartCpnSumAmt").text("-"+goodsCartCpnSumAmt.addComma());
-	} else {
-		$(".maxdisc_amount .goodsCartCpnDcAmt").text(goodsCartCpnSumAmt.addComma()); // 쿠폰할인금액합계
-		$("#couponModifyPop .modal-footer .goodsCartCpnSumAmt").text("-"+goodsCartCpnSumAmt.addComma());
-	}
+	$(".maxdisc_amount .goodsCartCpnDcAmt").text(getZeroMinusDelAmt(goodsCartCpnSumAmt)); // 쿠폰할인금액합계
+	$("#couponModifyPop .modal-footer .goodsCartCpnSumAmt").text(getZeroMinusDelAmt(goodsCartCpnSumAmt));
 	
 	
 	// 전체쿠폰 할인 금액 합계 적용
 	// 전체쿠폰 할인 금액 합계 적용
-	if (cpnDcSumAmt > 0) {
-		$(".maxdisc_amount .cpnDcAmt").text("-"+cpnDcSumAmt.addComma()); // 쿠폰할인금액합계
-		$("#couponDcSumAmt").text("-" + cpnDcSumAmt.addComma()); // 쿠폰할인금액합계
-	} else {
-		$(".maxdisc_amount .cpnDcAmt").text(cpnDcSumAmt.addComma()); // 쿠폰할인금액합계
-		$("#couponDcSumAmt").text(cpnDcSumAmt.addComma()); // 쿠폰할인금액합계
-	}
+	$(".maxdisc_amount .cpnDcAmt").text(getZeroMinusDelAmt(cpnDcSumAmt)); // 쿠폰할인금액합계
+	$("#couponDcSumAmt").text(getZeroMinusDelAmt(cpnDcSumAmt)); // 쿠폰할인금액합계
 
 
 	$("#orderAmtForm .cpnDcSumAmt").text(cpnDcSumAmt);
 	$("#orderAmtForm .cpnDcSumAmt").text(cpnDcSumAmt);
 	
 	
@@ -2194,6 +2180,19 @@ var fnNaverPaymentRequest = function(paymentId) {
 
 
 	return true;
 	return true;
 }
 }
+
+// 0원이하이면 '-' 처리 삭제 함수
+var getZeroMinusDelAmt = function(tempAmt) {
+	var rtnAmtStr = "";
+	
+	if (tempAmt > 0) {
+		rtnAmtStr = "-" + tempAmt.addComma();
+	} else {
+		rtnAmtStr = tempAmt.addComma();
+	}
+	
+	return rtnAmtStr;
+}
 </script>
 </script>
 
 
 </th:block>
 </th:block>

+ 1 - 1
src/main/webapp/WEB-INF/views/web/order/OrderDeliveryAddrInfoWeb.html

@@ -43,7 +43,7 @@
 						<th:block th:if="${deliveryAddrInfo.defaultYn} == 'Y'">
 						<th:block th:if="${deliveryAddrInfo.defaultYn} == 'Y'">
 							<em class="tag gray">기본 배송지</em>
 							<em class="tag gray">기본 배송지</em>
 						</th:block> 
 						</th:block> 
-						<em class="tag primary_line shotDelv">총알배송</em>
+						<em class="tag primary_line shotDelv" style="display:none;">총알배송</em>
 					</span>
 					</span>
 				</dd>
 				</dd>
 			</div>
 			</div>

+ 28 - 24
src/main/webapp/WEB-INF/views/web/order/OrderFormWeb.html

@@ -1267,7 +1267,7 @@ var dcAmtInfoSet = function() {
 					
 					
 					// 포인트 적용
 					// 포인트 적용
 					$("#orderAmtForm .pntDcSumAmt").text(pntDcAmt);
 					$("#orderAmtForm .pntDcSumAmt").text(pntDcAmt);
-					$("#pntDcAmt").text("-"+pntDcAmt.addComma()+" 원");
+					$("#pntDcAmt").text(getZeroMinusDelAmt(pntDcAmt)+" 원");
 					
 					
 					// 상품권리렛기능
 					// 상품권리렛기능
 					gfcdUseAmtReset();
 					gfcdUseAmtReset();
@@ -1548,7 +1548,7 @@ var custCpnApplyTemp = function(obj) {
 	});
 	});
 	
 	
 	// 상품, 장바구니쿠폰 할인 금액만 합계 적용
 	// 상품, 장바구니쿠폰 할인 금액만 합계 적용
-	$(".modal-footer .goodsCartCpnSumAmt").text("-"+goodsCartCpnSumAmt.addComma());
+	$(".modal-footer .goodsCartCpnSumAmt").text(getZeroMinusDelAmt(goodsCartCpnSumAmt));
 }
 }
 
 
 // 1.11 쿠폰중복체크 후 적용가능
 // 1.11 쿠폰중복체크 후 적용가능
@@ -1759,7 +1759,12 @@ var custCpnNotApply = function(obj) {
 
 
 // 1.14 선포인트리셋기능 (사용안함)
 // 1.14 선포인트리셋기능 (사용안함)
 var prePntDcAmtReset = function() {
 var prePntDcAmtReset = function() {
-	var rmPrePntAmt = parseInt($("#orderForm input[name='rmPrePntAmt']").val());
+	var rmPrePntAmt = 0;
+	
+	if ($("#orderForm input[name='rmPrePntAmt']") != null) {
+		parseInt($("#orderForm input[name='rmPrePntAmt']").val());
+	}
+	
 	$("#orderForm input[name='prePntDcAmt']").val(rmPrePntAmt);
 	$("#orderForm input[name='prePntDcAmt']").val(rmPrePntAmt);
 	
 	
 	// 선포인트사용여부 체크 후 적용
 	// 선포인트사용여부 체크 후 적용
@@ -1774,19 +1779,15 @@ var prePntDcAmtReset = function() {
 			var rmPrePntAmt 		= parseInt($("#orderForm input[name='rmPrePntAmt']").val());
 			var rmPrePntAmt 		= parseInt($("#orderForm input[name='rmPrePntAmt']").val());
 			
 			
 			// 선포인트적용
 			// 선포인트적용
-			if ($(this).val() == "Y") {
-				$("#prePntDcAmt").text("-"+rmPrePntAmt.addComma()+"원");
-			} else {
-				$("#prePntDcAmt").text("0원");
-			}
+			$("#prePntDcAmt").text(getZeroMinusDelAmt(rmPrePntAmt)+"원");
 			
 			
 			// 쿠폰할인금액 SUM
 			// 쿠폰할인금액 SUM
 			custCpnSumAmtCal();
 			custCpnSumAmtCal();
 		});
 		});
 	});
 	});
 
 
-	$("#prePntDcAmt").text("-"+rmPrePntAmt.addComma()+"원");
-	
+	$("#prePntDcAmt").text(getZeroMinusDelAmt(rmPrePntAmt)+"원");
+
 	// 포인트기능 리렛
 	// 포인트기능 리렛
 	pntDcAmtReset();
 	pntDcAmtReset();
 }
 }
@@ -1834,22 +1835,12 @@ var custCpnSumAmtCal = function() {
 	});
 	});
 
 
 	// 상품, 장바구니쿠폰 할인 금액만 합계 적용
 	// 상품, 장바구니쿠폰 할인 금액만 합계 적용
-	if (goodsCartCpnSumAmt > 0) {
-		$(".maxdisc_amount .goodsCartCpnDcAmt").text("-"+goodsCartCpnSumAmt.addComma()); // 쿠폰할인금액합계
-		$(".goodsCartCpnSumAmt").text("-"+goodsCartCpnSumAmt.addComma()); // 쿠폰할인금액합계
-	} else {
-		$(".maxdisc_amount .goodsCartCpnDcAmt").text(goodsCartCpnSumAmt.addComma()); // 쿠폰할인금액합계
-		$(".goodsCartCpnSumAmt").text(goodsCartCpnSumAmt.addComma()); // 쿠폰할인금액합계
-	}
+	$(".maxdisc_amount .goodsCartCpnDcAmt").text(getZeroMinusDelAmt(goodsCartCpnSumAmt)); // 쿠폰할인금액합계
+	$(".goodsCartCpnSumAmt").text(getZeroMinusDelAmt(goodsCartCpnSumAmt)); // 쿠폰할인금액합계
 	
 	
 	// 전체쿠폰 할인 금액 합계 적용
 	// 전체쿠폰 할인 금액 합계 적용
-	if (cpnDcSumAmt > 0) {
-		$(".maxdisc_amount .cpnDcAmt").text("-"+cpnDcSumAmt.addComma()); // 쿠폰할인금액합계
-		$("#couponDcSumAmt").text("-" + cpnDcSumAmt.addComma() + " 원"); // 쿠폰할인금액합계
-	} else {
-		$(".maxdisc_amount .cpnDcAmt").text(cpnDcSumAmt.addComma()); // 쿠폰할인금액합계
-		$("#couponDcSumAmt").text(cpnDcSumAmt.addComma() + " 원"); // 쿠폰할인금액합계
-	}
+	$(".maxdisc_amount .cpnDcAmt").text(getZeroMinusDelAmt(cpnDcSumAmt)); // 쿠폰할인금액합계
+	$("#couponDcSumAmt").text(getZeroMinusDelAmt(cpnDcSumAmt)+ " 원"); // 쿠폰할인금액합계
 
 
 	$("#orderAmtForm .cpnDcSumAmt").text(cpnDcSumAmt);
 	$("#orderAmtForm .cpnDcSumAmt").text(cpnDcSumAmt);
 	
 	
@@ -2213,6 +2204,19 @@ var fnNaverPaymentRequest = function(paymentId) {
 
 
 	return true;
 	return true;
 }
 }
+
+// 0원이하이면 '-' 처리 삭제 함수
+var getZeroMinusDelAmt = function(tempAmt) {
+	var rtnAmtStr = "";
+	
+	if (tempAmt > 0) {
+		rtnAmtStr = "-" + tempAmt.addComma();
+	} else {
+		rtnAmtStr = tempAmt.addComma();
+	}
+	
+	return rtnAmtStr;
+}
 </script>
 </script>
 
 
 </th:block>
 </th:block>