gagamel 4 лет назад
Родитель
Сommit
2211fa8c6e

+ 18 - 1
src/main/webapp/WEB-INF/views/settle/DeliveryFeeSettleForm.html

@@ -174,9 +174,26 @@
 		if (!gagajf.validation($('#searchForm')))
 		if (!gagajf.validation($('#searchForm')))
 			return false;
 			return false;
 		
 		
-		gagaAgGrid.fetch($('#searchForm').prop('action'), gridOptions, '#searchForm');
+		gagaAgGrid.fetch($('#searchForm').prop('action'), gridOptions, '#searchForm', fnCreateTotal);
 	});
 	});
 	
 	
+	// 합계 생성
+	var fnCreateTotal = function() {
+		var delvFee = 0;
+
+		gridOptions.api.forEachNode(function(rowNode, index) {
+			if (!rowNode.group) {
+				if (typeof rowNode.data.delvFee =='number') { delvFee += rowNode.data.delvFee; }
+			}
+		});
+
+		var data = {
+			occurDt: null, supplyVendorNm: null, distributionGbNm: null, delvFeeGbNm: null, ordNo: '합계', delvFee:  delvFee
+		};
+
+		gagaAgGrid.setPinnedRowData(gridOptions, data, 'top');
+	}
+	
 	// 초기화 클릭시
 	// 초기화 클릭시
 	$('#btnInit').on('click', function() {
 	$('#btnInit').on('click', function() {
 		$('#searchForm')[0].reset();
 		$('#searchForm')[0].reset();

+ 34 - 0
src/main/webapp/WEB-INF/views/settle/GiftcardSettleForm.html

@@ -179,9 +179,36 @@
 		
 		
 		gagaAgGrid.fetch($('#searchForm').prop('action'), gridOptions, '#searchForm', function() {
 		gagaAgGrid.fetch($('#searchForm').prop('action'), gridOptions, '#searchForm', function() {
 			fnShowOrHideColumn();
 			fnShowOrHideColumn();
+			fnCreateTotal();
 		});
 		});
 	});
 	});
 	
 	
+	// 합계 생성
+	var fnCreateTotal = function() {
+		var chgGfcdAmt = 0;  // 최초등록금액
+		var usGfcdAmt = 0;   // 누적사용금액
+		var useGfcdAmt = 0;  // 정산월사용금액
+		var cnclGfcdAmt = 0; // 정산월취소금액
+		var rmGfcdAmt = 0;   // 잔액
+
+		gridOptions.api.forEachNode(function(rowNode, index) {
+			if (!rowNode.group) {
+				if (typeof rowNode.data.chgGfcdAmt =='number') { chgGfcdAmt += rowNode.data.chgGfcdAmt; }
+				if (typeof rowNode.data.usGfcdAmt =='number') { usGfcdAmt += rowNode.data.usGfcdAmt; }
+				if (typeof rowNode.data.useGfcdAmt =='number') { useGfcdAmt += rowNode.data.useGfcdAmt; }
+				if (typeof rowNode.data.cnclGfcdAmt =='number') { cnclGfcdAmt += rowNode.data.cnclGfcdAmt; }
+				if (typeof rowNode.data.rmGfcdAmt =='number') { rmGfcdAmt += rowNode.data.rmGfcdAmt; }
+			}
+		});
+
+		var data = {
+			gfcdNo: null, regDt: null, useExpDate: null, availYn: null, custId: '합계',
+			chgGfcdAmt:  chgGfcdAmt, usGfcdAmt:  usGfcdAmt, useGfcdAmt:  useGfcdAmt, cnclGfcdAmt:  cnclGfcdAmt, rmGfcdAmt:  rmGfcdAmt
+		};
+
+		gagaAgGrid.setPinnedRowData(gridOptions, data, 'top');
+	}
+	
 	// 초기화 클릭시
 	// 초기화 클릭시
 	$('#btnInit').on('click', function() {
 	$('#btnInit').on('click', function() {
 		$('#searchForm')[0].reset();
 		$('#searchForm')[0].reset();
@@ -209,6 +236,13 @@
 		
 		
 		fnShowOrHideColumn();
 		fnShowOrHideColumn();
 		gridOptions.api.setRowData();
 		gridOptions.api.setRowData();
+		
+		var data = {
+			gfcdNo: null, regDt: null, useExpDate: null, availYn: null, custId: null,
+			chgGfcdAmt: null, usGfcdAmt: null, useGfcdAmt: null, cnclGfcdAmt: null, rmGfcdAmt: null
+		};
+
+		gagaAgGrid.setPinnedRowData(gridOptions, data, 'top');
 	});
 	});
 	
 	
 	var fnShowOrHideColumn = function() {
 	var fnShowOrHideColumn = function() {

+ 66 - 2
src/main/webapp/WEB-INF/views/settle/GoodsSettleForm.html

@@ -266,7 +266,7 @@
 		},
 		},
 		{
 		{
 			headerName: "판매수수료율(%)", field: "sellFeeRate", width: 120, cellClass: 'text-center',
 			headerName: "판매수수료율(%)", field: "sellFeeRate", width: 120, cellClass: 'text-center',
-			cellRenderer: function (params) { return params.value + '%'; }
+			cellRenderer: function (params) { return gagajf.isNull(params.value) ? '' : params.value + '%'; }
 		},
 		},
 		{
 		{
 			headerName: "수수료", field: "sellFeeAmt", width: 100, cellClass: 'text-right',
 			headerName: "수수료", field: "sellFeeAmt", width: 100, cellClass: 'text-right',
@@ -365,9 +365,73 @@
 		if (!gagajf.validation($('#searchForm')))
 		if (!gagajf.validation($('#searchForm')))
 			return false;
 			return false;
 		
 		
-		gagaAgGrid.fetch($('#searchForm').prop('action'), gridOptions, '#searchForm');
+		gagaAgGrid.fetch($('#searchForm').prop('action'), gridOptions, '#searchForm', fnCreateTotal);
 	});
 	});
 	
 	
+	// 합계 생성
+	var fnCreateTotal = function() {
+// 		var mallPrice = 0;           // 판매가
+// 		var sellPrice = 0;           // 정산판매가
+		var sellQty = 0;             // 판매수량
+		var sellAmt = 0;             // 판매총액
+		var cpnDcAmt = 0;            // 쿠폰할인금액
+		var cpn1DcAmt = 0;           // 즉시사용쿠폰금액
+		var goodsCpnDcAmt = 0;       // 상품쿠폰사용금액
+		var cartCpnDcAmt = 0;        // 주문서쿠폰사용금액
+		var pntDcAmt = 0;            // 포인트사용금액
+		var tmtbDcAmt = 0;           // 다다익선할인금액
+		var selfTmtbDcAmt = 0;       // 자사다다익선분담액
+		var supplyCompTmtbDcAmt = 0; // 입점다다익선분담액
+		var gfcdUseAmt = 0;          // 상품권사용금액
+		var selfCpnDcAmt = 0;        // 자사쿠폰분담액
+		var supplyCompCpnDcAmt = 0;  // 입점쿠폰분담액
+		var realSellPrice = 0;       // 실판매가
+ 		var realSellAmt = 0;         // 상품총액
+		var sellFeeAmt = 0;          // 수수료
+		var settleAmt = 0;           // 정산대상액
+
+		gridOptions.api.forEachNode(function(rowNode, index) {
+			if (!rowNode.group) {
+// 				if (typeof rowNode.data.mallPrice == 'number') { mallPrice += rowNode.data.mallPrice; }
+// 				if (typeof rowNode.data.sellPrice =='number') { sellPrice += rowNode.data.sellPrice; }
+				if (typeof rowNode.data.sellQty =='number') { sellQty += rowNode.data.sellQty; }
+				if (typeof rowNode.data.sellAmt =='number') { sellAmt += rowNode.data.sellAmt; }
+				if (typeof rowNode.data.cpnDcAmt =='number') { cpnDcAmt += rowNode.data.cpnDcAmt; }
+				if (typeof rowNode.data.cpn1DcAmt =='number') { cpn1DcAmt += rowNode.data.cpn1DcAmt; }
+				if (typeof rowNode.data.goodsCpnDcAmt =='number') { goodsCpnDcAmt += rowNode.data.goodsCpnDcAmt; }
+				if (typeof rowNode.data.cartCpnDcAmt =='number') { cartCpnDcAmt += rowNode.data.cartCpnDcAmt; }
+				if (typeof rowNode.data.pntDcAmt =='number') { pntDcAmt += rowNode.data.pntDcAmt; }
+				if (typeof rowNode.data.tmtbDcAmt =='number') { tmtbDcAmt += rowNode.data.tmtbDcAmt; }
+				if (typeof rowNode.data.selfTmtbDcAmt =='number') { selfTmtbDcAmt += rowNode.data.selfTmtbDcAmt; }
+				if (typeof rowNode.data.supplyCompTmtbDcAmt =='number') { supplyCompTmtbDcAmt += rowNode.data.supplyCompTmtbDcAmt; }
+				if (typeof rowNode.data.gfcdUseAmt =='number') { gfcdUseAmt += rowNode.data.gfcdUseAmt; }
+				if (typeof rowNode.data.selfCpnDcAmt =='number') { selfCpnDcAmt += rowNode.data.selfCpnDcAmt; }
+				if (typeof rowNode.data.supplyCompCpnDcAmt =='number') { supplyCompCpnDcAmt += rowNode.data.supplyCompCpnDcAmt; }
+				if (typeof rowNode.data.realSellPrice =='number') { realSellPrice += rowNode.data.realSellPrice; }
+				if (typeof rowNode.data.realSellAmt =='number') { realSellAmt += rowNode.data.realSellAmt; }
+				if (typeof rowNode.data.sellFeeAmt =='number') { sellFeeAmt += rowNode.data.sellFeeAmt; }
+				if (typeof rowNode.data.settleAmt =='number') { settleAmt += rowNode.data.settleAmt; }
+			}
+		});
+
+		var data = {
+			ordNo: null, ordDtlNo: null, mallGbNm: null, extmallOrderId: null, extmallNm: null,
+			supplyVendorNm: null, distributionGbNm: null, settleDayNm: null,
+			ordDt: null, settleGbNm: null, occurDt: null,
+			goodsCd: null, goodsNm: null, brandEnm: null, mdNm: null, itemCd: null, optCd1: null, optCd2: '합계',
+// 			mallPrice:  mallPrice, sellPrice:  sellPrice,
+			mallPrice:  null, sellPrice:  null,
+			sellQty:  sellQty, sellAmt:  sellAmt,
+			cpnDcAmt:  cpnDcAmt, cpn1DcAmt: cpn1DcAmt, goodsCpnDcAmt:  goodsCpnDcAmt, cartCpnDcAmt:  cartCpnDcAmt,
+			pntDcAmt:  pntDcAmt, tmtbDcAmt: tmtbDcAmt, selfTmtbDcAmt:  selfTmtbDcAmt, supplyCompTmtbDcAmt:  supplyCompTmtbDcAmt,
+			gfcdUseAmt:  gfcdUseAmt, selfCpnDcAmt:  selfCpnDcAmt, supplyCompCpnDcAmt:  supplyCompCpnDcAmt,
+			realSellPrice:  realSellPrice, realSellAmt:  realSellAmt,
+			sellFeeRate: null, sellFeeAmt:  sellFeeAmt, settleAmt:  settleAmt
+		};
+
+		gagaAgGrid.setPinnedRowData(gridOptions, data, 'top');
+	}
+	
 	// 초기화 클릭시
 	// 초기화 클릭시
 	$('#btnInit').on('click', function() {
 	$('#btnInit').on('click', function() {
 		$('#searchForm')[0].reset();
 		$('#searchForm')[0].reset();