|
|
@@ -35,8 +35,19 @@
|
|
|
</colgroup>
|
|
|
<tr>
|
|
|
<th>발생일<i class="required" title="필수" aria-hidden="true"></i></th>
|
|
|
- <td>
|
|
|
- <input type="text" class="schDate w80" name="occurDt" maxlength="10" th:value="${#calendars.format(#calendars.createNow(), 'yyyy-MM-dd')}" required="required" data-valid-type="calendar" data-valid-name="발생일"/>
|
|
|
+ <td id="terms">
|
|
|
+ <span class="nowrap">
|
|
|
+ <input name="startDt" id="startDt" type="text" class="w80 schDate" maxlength="8" required="required" data-valid-name="발생시작일"/>
|
|
|
+ ~
|
|
|
+ <input name="endDt" id="endDt" type="text" class="w80 schDate" maxlength="8" required="required" data-valid-name="발생종료일"/>
|
|
|
+ </span>
|
|
|
+ <button type="button" class="btn btn-default btn-sm btnToday" onclick="gagajf.setDate('#terms', 'startDt', 'endDt', 't');">오늘</button>
|
|
|
+ <button type="button" class="btn btn-default btn-sm btnYesterday" onclick="gagajf.setDate('#terms', 'startDt', 'endDt', 'y');">어제</button>
|
|
|
+ <button type="button" class="btn btn-default btn-sm" onclick="gagajf.setDate('#terms', 'startDt', 'endDt', '7d');">최근한주</button>
|
|
|
+ <button type="button" class="btn btn-default btn-sm" onclick="gagajf.setDate('#terms', 'startDt', 'endDt', 'tw');">이번주</button>
|
|
|
+ <button type="button" class="btn btn-default btn-sm" onclick="gagajf.setDate('#terms', 'startDt', 'endDt', 'pw');">지난주</button>
|
|
|
+ <span class="infoTxt cRed marL10"><i class="fa fa-info-circle" aria-hidden="true"></i>(일주일 한도)</span>
|
|
|
+<!-- <input type="text" class="schDate w80" name="occurDt" maxlength="10" th:value="${#calendars.format(#calendars.createNow(), 'yyyy-MM-dd')}" required="required" data-valid-type="calendar" data-valid-name="발생일"/> -->
|
|
|
</td>
|
|
|
</tr>
|
|
|
</table>
|
|
|
@@ -178,7 +189,7 @@
|
|
|
},
|
|
|
{
|
|
|
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',
|
|
|
@@ -196,15 +207,98 @@
|
|
|
if (!gagajf.validation($('#searchForm')))
|
|
|
return false;
|
|
|
|
|
|
- gagaAgGrid.fetch($('#searchForm').prop('action'), gridOptions, '#searchForm');
|
|
|
+ var fromDate = $('#searchForm input[name=startDt]').val().toDate('YYYY-MM-DD');
|
|
|
+ var toDate = $('#searchForm input[name=endDt]').val().toDate('YYYY-MM-DD');
|
|
|
+
|
|
|
+ if (fromDate > toDate) {
|
|
|
+ mcxDialog.alert("시작일자는 종료일자 보다 클 수 없습니다.");
|
|
|
+ $('#searchForm input[name=endDt]').focus();
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ var iDays = Math.ceil((toDate - fromDate) / (60 * 60 * 24 * 1000));
|
|
|
+ if (iDays >= 7) {
|
|
|
+ mcxDialog.alert("최대 7일까지 조회할 수 있습니다.");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ gagaAgGrid.fetch($('#searchForm').prop('action'), gridOptions, '#searchForm', fnCreateTotal);
|
|
|
});
|
|
|
|
|
|
+ // 합계 생성
|
|
|
+ var fnCreateTotal = function() {
|
|
|
+// 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.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, sellGb: null,
|
|
|
+ mallGbNm: null, extmallOrderId: null, extmallNm: null,
|
|
|
+ afChannelNm: null, afLinkNm: null,
|
|
|
+ distributionGbNm: null, supplyCompNm: null, supplyVendorNm: null,
|
|
|
+ ordDt: null, occurDt: null,
|
|
|
+ brandEnm: null, goodsCd: null, goodsNm: null, itemCd: null, optCd1: null, optCd2: null,
|
|
|
+ itemkindNm: null, itemkindNm1: null, itemkindNm2: null, itemkindNm3: null, itemkindNm4: '합계',
|
|
|
+// sellPrice: sellPrice,
|
|
|
+ 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,
|
|
|
+ mdNm: null
|
|
|
+ };
|
|
|
+
|
|
|
+ gagaAgGrid.setPinnedRowData(gridOptions, data, 'top');
|
|
|
+ }
|
|
|
+
|
|
|
// 엑셀다운로드
|
|
|
$('#btnExcel').on('click', function() {
|
|
|
gagaAgGrid.exportToExcel('일일거래내역', gridOptions);
|
|
|
});
|
|
|
|
|
|
$(document).ready(function() {
|
|
|
+ gagajf.setDate('#terms', 'startDt', 'endDt', 't');
|
|
|
+
|
|
|
// Create a agGrid
|
|
|
gagaAgGrid.createGrid('gridList', gridOptions);
|
|
|
});
|