<!DOCTYPE html> 
<html xmlns="http://www.w3.org/1999/xhtml"
	  xmlns:th="http://www.thymeleaf.org"
	  xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
	  layout:decorate="~{/web/layout/userSubMenuLayout}">
	<th:block layout:fragment="layout_css">
		<link rel="stylesheet" href="/css/web/customer_sub_payment.css?v1.1">
		<link rel="stylesheet" href="/css/web/modal_customer_sub_payment.css?v1.1">
        <link rel="stylesheet" href="/css/web/modal_home.css?v1.1">
	</th:block>

<th:block layout:fragment="layout_top_script">
<script src="/js/web/common_option.js"></script>
<script src="/js/web/jquery.twbsPagination.js" type="text/javascript"></script>
<script>
let menuClass     = "[[${param.menuClass}]]"==""?"":"[[${param.menuClass}]]";

let selectUseYn   = "[[${selectUseYn}]]"==""?"N":"[[${selectUseYn}]]";
let insertUseYn   = "[[${insertUseYn}]]"==""?"N":"[[${insertUseYn}]]";
let updateUseYn   = "[[${updateUseYn}]]"==""?"N":"[[${updateUseYn}]]";
let deleteUseYn   = "[[${deleteUseYn}]]"==""?"N":"[[${deleteUseYn}]]";
let downloadUseYn = "[[${downloadUseYn}]]"==""?"N":"[[${downloadUseYn}]]";

let muUserId = "[[${param.muUserId}]]";

/* 검색 관련 변수 */
let paymentSearchKeywordParam     = "[[${param.paymentSearchKeywordParam}]]";
let paymentSort                   = "[[${param.paymentSort}]]";
let paymentDir                    = "[[${param.paymentDir}]]";
let paymentStart                  = "[[${param.paymentStart}]]"==""?0:"[[${param.paymentStart}]]";
let paymentLimit                  = "[[${param.paymentLimit}]]"==""?100:"[[${param.paymentLimit}]]";

let paymentSearchStartDate        = "[[${param.paymentSearchStartDate}]]";
let paymentSearchEndDate          = "[[${param.paymentSearchEndDate}]]";
let paymentSearchDateType         = "[[${param.paymentSearchDateType}]]"==""?"F":"[[${param.paymentSearchDateType}]]";
let muTreatmentId             = "[[${param.muTreatmentId}]]"
let treatmentName             = "[[${param.treatmentName}]]"
let paymentStatus             = "[[${param.paymentStatus}]]"
let paymentStatusKeyword             = "[[${param.paymentStatusKeyword}]]"
let paymentCategoryItemNm         = "[[${param.paymentCategoryItemNm}]]";

</script>
</th:block>
<th:block layout:fragment="layout_content">
<!-- 센터쪽 -->
<div class="center_box">
	<p class="page_title">수납 내역</p>
	
	<div class="filter_box payment">
		<div class="form_box">
            <!-- 캘린더input -->
            <div class="select_box first dropdown">
                <button type="button" class="label dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">기간</button>
                <input type="hidden" id="paymentSearchDateType">
                <ul class="select_option_list dropdown-menu">
                    <li id="li_A" class="option_list_item first" >오늘</li>
                    <li id="li_B" class="option_list_item">최근30일</li>
                    <li id="li_C" class="option_list_item">최근90일</li>
                    <li id="li_D" class="option_list_item">이번주</li>
                    <li id="li_E" class="option_list_item">이번달</li>
                    <li id="li_F" class="option_list_item">올해</li>
                    <li id="li_G" class="option_list_item">지난주</li>
                    <li id="li_H" class="option_list_item">지난달</li>
                </ul>
            </div>
            <div class="calendar_box">
                <div class="date_box" id="divpaymentSearchStartDate">
                    <img src="/image/web/calendar.svg" alt="calendar"/>
                    <input type="date" class="date_picker" id="paymentSearchStartDate">
                </div>

                <span class="slash">-</span>

                <div class="date_box last" id="divpaymentSearchEndDate">
                    <img src="/image/web/calendar.svg" alt="calendar"/>
                    <input type="date" class="date_picker" id="paymentSearchEndDate">
                </div>
            </div>

            <div class="select_box dropdown">
                <button class="label" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">결제구분</button>
                <input type="hidden" id="paymentCategoryItemNm">
                <ul class="select_option_list dropdown-menu">
                    <li class="option_list_item first" id="">전체</li>
                    <li class="option_list_item">카드</li>
                    <li class="option_list_item">현금</li>
                    <li class="option_list_item">멤버십</li>
                    <li class="option_list_item">계좌이체</li>
                    <li class="option_list_item">간편결제</li>
                    <li class="option_list_item">선결제</li>
                </ul>
            </div>

            <div class="select_box last dropdown">
                <button class="label" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">진료구분</button>
                <input type="hidden" id="muTreatmentId">
                <ul class="select_option_list dropdown-menu">
                    <li class="option_list_item first" id="">전체</li>
                </ul>
            </div>
            <div class="select_box last dropdown">
                <button class="label" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">결제상태</button>
                <input type="hidden" id="paymentStatus">
                <ul class="select_option_list dropdown-menu" id="paymentStatusList">
                    <li class="option_list_item first" id="">전체</li>
                    <li class="option_list_item" id="Y">결제완료</li>
                    <li class="option_list_item" id="NY">미수결제</li>
                    <li class="option_list_item" id="PY">부분결제(완납)</li>
                    <li class="option_list_item" id="P">부분결제</li>
                    <li class="option_list_item" id="C">결제취소</li>
                    <li class="option_list_item" id="R">환불</li>
                    <li class="option_list_item" id="NP">미수</li>
                </ul>
            </div>

            <!-- 이름input -->
            <div class="search_list">
                <div class="search_box">
                    <img src="/image/web/search_G.svg" alt="search"/>
                    <input type="text" id="paymentSearchKeywordParam" placeholder="고객명, 시술(상품)명">

                    <div class="search_list"></div><!-- 검색내역 나오는곳 -->
                </div>
                <button class="search_btn" id="btnSearchUserPayment">조회</button>
            </div>
        </div>
		
		<div class="right_btn_box">
			<button id="btnUserPayment" class="receive_btn">수납</button>
<!--			<button id="btnDownloadUserPaymentCancel" class="cancel_btn">수납 취소</button>-->
			<button id="btnDownloadUserPaymentExcel" class="download_btn">
				<img src="/image/web/download.svg" alt="내려받기"/>
				<p>내려받기</p>
			</button>
		</div>
	</div>
	
	<div id="userPaymentGrid" class="table_box ag-theme-balham"></div>

	<!-- 페이지게이션 -->
	<div class="page_box">
		<nav ria-label="Page navigation" class="navigation">
			<ul class="pagination" id="userPaymentPagination"></ul>
		</nav>
	</div>
</div>
<form id="userPaymentSelectListForm" method="POST" target="_blank"></form>
</th:block>
<th:block layout:fragment="layout_popup">
</th:block>
<th:block layout:fragment="layout_script">
<script src="/js/web/ag-grid-community-29.3.5.min.js"></script>
<script src="/js/web/user/userPaymentSelectList.js"></script>

<script src="/js/web/payment/popup/paymentInsertPop.js"></script>
<script src="/js/web/reserve/popup/reservePaymentInsertPop.js"></script>
<script src="/js/web/reserve/popup/discountInsertPop.js"></script>
<script src="/js/web/reserve/popup/discountPayCheckPop.js"></script>
<script src="/js/web/reserve/popup/paymentMembershipInsertPop.js"></script>
<script src="/js/web/reserve/popup/membershipPayCheckPop.js"></script>
<script src="/js/web/reserve/popup/paymentMembershipPartialPop.js"></script>
<script src="/js/web/reserve/popup/paymentMonetizationPop.js"></script>
<script src="/js/web/reserve/popup/paymentAccountPop.js"></script>
<script src="/js/web/reserve/popup/paymentCancellationPop.js"></script>
<script src="/js/web/reserve/popup/paymentRefundPop.js"></script>
<script src="/js/web/kicc/kiccPosDll2.js"></script>
</th:block>
</html>
