<!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/homeLayout}">
	<th:block layout:fragment="layout_css">
		<link rel="stylesheet" href="/css/web/stock_inventory_adjustment.css?v1.1">
		<link rel="stylesheet" href="/css/web/modal_stock_inventory_adjustment.css?v1.1">
		<link rel="stylesheet" href="/css/web/grid.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 stockCloseSearchKeywordParam = "[[${param.stockCloseSearchKeywordParam}]]";
let stockCloseSort               = "[[${param.stockCloseSort}]]";
let stockCloseDir                = "[[${param.stockCloseDir}]]";
let stockCloseStart              = "[[${param.stockCloseStart}]]"==""?0:"[[${param.stockCloseStart}]]";
let stockCloseLimit              = "[[${param.stockCloseLimit}]]"==""?100:"[[${param.stockCloseLimit}]]";

let stockCloseSearchStartDate    = "[[${param.stockCloseSearchStartDate}]]";
let stockCloseSearchEndDate      = "[[${param.stockCloseSearchEndDate}]]";
let stockCloseSearchDateType     = "[[${param.stockCloseSearchDateType}]]"==""?"A":"[[${param.stockCloseSearchDateType}]]";


/* 검색 관련 변수 */
let stockCloseDetailSearchKeywordParam = "[[${param.stockCloseDetailSearchKeywordParam}]]";
let stockCloseDetailSort               = "[[${param.stockCloseDetailSort}]]";
let stockCloseDetailDir                = "[[${param.stockCloseDetailDir}]]";
let stockCloseDetailStart              = "[[${param.stockCloseDetailStart}]]"==""?0:"[[${param.stockCloseDetailStart}]]";
let stockCloseDetailLimit              = "[[${param.stockCloseDetailLimit}]]"==""?100:"[[${param.stockCloseDetailLimit}]]";

let stockCloseDetailTreatmentId    = "[[${param.stockCloseDetailTreatmentId}]]";
let stockCloseDetailCompanyId      = "[[${param.stockCloseDetailCompanyId}]]";

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

</script>
</th:block>
<th:block layout:fragment="layout_content">
<!-- 센터쪽 -->
<div class="center_box">
	<p class="page_title">재고 마감 내역</p>
	
	<ul class="total_list">
		<li>
			<label>재고 품목 수</label>
			<p class="number" id="treatmentCount"></p>
		</li>
		<li>
			<label>품목별 재고 수</label>
			<p class="number" id="groupTreatmentCount"></p>
		</li>
		<li>
			<label>거래처 수</label>
			<p class="number" id="companyCount"></p>
		</li>
		<li>
			<label>재고 총액(원)</label>
			<p class="number" id="stockAmount"></p>
		</li>
	</ul>
	
	<div class="filter_box">
		<div class="form_box">
			<div class="select_box dropdown">
				<button class="label" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">재고구분</button>
				<input type="hidden" id="stockCloseDetailTreatmentId" />
				
				<ul class="select_option_list dropdown-menu" id=""></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="stockCloseDetailCompanyId" />
				
				<ul class="select_option_list dropdown-menu" id=""></ul>
			</div>

			<!-- 검색input -->
			<div class="search_list">
				<div class="search_box">
					<img src="/image/web/search_G.svg" alt="search"/>
					<input type="text" id="stockCloseDetailSearchKeyword" required placeholder="제품명,거래처명">

					<div class="search_list"></div><!-- 검색내역 나오는곳 -->
				</div>
				<button id="btnSearchStockCloseDetail" class="search_btn" style="transition: all 0.2s ease-in-out 0s;">조회</button>
			</div>
			
			<div class="right_btn_box">
				<button id="btnDownloadStockCloseDetail" class="download_btn">
					<img src="/image/web/download.svg" alt="내려받기"/>
					<p>내려받기</p>
				</button>
			</div>
		</div>
	</div>


	<div id="stockCloseDetailGrid" class="table_box ag-theme-balham stockCloseDetailGrid"></div>


	<!-- 페이지게이션 -->
	<div class="page_box">
		<nav ria-label="Page navigation" class="navigation">
			<ul class="pagination" id="stockCloseDetailPagination"></ul>
		</nav>
	</div>
</div>
<form id="stockCloseDetailSelectListForm" 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/stockclosedetail/stockCloseDetailSelectList.js"></script>

</th:block>
</html>
