ソースを参照

yoy 제수 0 오류 방지처리

skyhopes 4 年 前
コミット
7a5bec2896

+ 5 - 1
src/main/webapp/WEB-INF/views/statistics/BrandTradingForm.html

@@ -399,7 +399,11 @@
 			}
 		});
 
-		totInfo.yoyRate = (totInfo.totAmt / totInfo.yoyTotOrdAmt * 100 - 100).toFixed(1);
+		if(totInfo.totAmt > 0 && totInfo.yoyTotOrdAmt > 0){
+			totInfo.yoyRate = (totInfo.totAmt / totInfo.yoyTotOrdAmt * 100 - 100).toFixed(1);
+		}else{
+			totInfo.yoyRate = 0;
+		}
 
 		gagaAgGrid.setPinnedRowData(gridOptions, totInfo, 'top');
 	}

+ 5 - 1
src/main/webapp/WEB-INF/views/statistics/ChannelTradingForm.html

@@ -377,7 +377,11 @@
 			}
 		});
 
-		totInfo.yoyRate = (totInfo.totAmt / totInfo.yoyTotOrdAmt * 100 - 100).toFixed(1);
+		if(totInfo.totAmt > 0 && totInfo.yoyTotOrdAmt > 0 ){
+			totInfo.yoyRate = (totInfo.totAmt / totInfo.yoyTotOrdAmt * 100 - 100).toFixed(1);
+		}else{
+			totInfo.yoyRate = 0;
+		}
 
 		gagaAgGrid.setPinnedRowData(gridOptions, totInfo, 'top');
 	}

+ 5 - 1
src/main/webapp/WEB-INF/views/statistics/ExtmallTradingForm.html

@@ -316,7 +316,11 @@
 			}
 		});
 
-		totInfo.yoyRate = (totInfo.totAmt / totInfo.yoyTotOrdAmt * 100 - 100).toFixed(1);
+		if(totInfo.totAmt > 0 && totInfo.yoyTotOrdAmt > 0 ){
+			totInfo.yoyRate = (totInfo.totAmt / totInfo.yoyTotOrdAmt * 100 - 100).toFixed(1);
+		}else{
+			totInfo.yoyRate = 0;
+		}
 
 		gagaAgGrid.setPinnedRowData(gridOptions, totInfo, 'top');
 	}