Files
wace_plm/WebContent/WEB-INF/view/contractMgmt/itemPriceComparePopup.jsp
2025-12-03 17:19:22 +09:00

374 lines
9.9 KiB
Plaintext

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="com.pms.common.utils.*"%>
<%@ page import="java.util.*"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@include file="/init_new.jsp"%>
<%
PersonBean person = (PersonBean) session.getAttribute(Constants.PERSON_BEAN);
String userId = CommonUtils.checkNull(person.getUserId());
%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title><%=Constants.SYSTEM_NAME%> - 품목별 가격 비교</title>
<style>
body {
font-family: 'Malgun Gothic', sans-serif;
font-size: 12px;
margin: 0;
padding: 20px;
background-color: #f5f5f5;
}
.popup-container {
background-color: white;
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
padding: 20px;
}
.popup-title {
font-size: 18px;
font-weight: bold;
color: #333;
margin-bottom: 20px;
padding-bottom: 10px;
border-bottom: 2px solid #007bff;
}
.section-title {
font-size: 14px;
font-weight: bold;
color: #333;
padding: 10px;
background-color: #f8f9fa;
border-left: 4px solid #007bff;
margin-bottom: 15px;
margin-top: 15px;
}
.info-table {
width: 100%;
border-collapse: collapse;
margin-bottom: 20px;
}
.info-table th {
background-color: #f8f9fa;
padding: 8px;
text-align: center;
border: 1px solid #dee2e6;
font-weight: bold;
width: 12%;
}
.info-table td {
padding: 8px;
border: 1px solid #dee2e6;
background-color: white;
}
.price-table {
width: 100%;
border-collapse: collapse;
margin-bottom: 20px;
}
.price-table thead th {
background-color: #e9ecef;
padding: 10px 6px;
text-align: center;
border: 1px solid #dee2e6;
font-weight: bold;
font-size: 12px;
}
.price-table thead th.estimate-header {
background-color: #d4edda;
color: #155724;
}
.price-table thead th.order-header {
background-color: #cce5ff;
color: #004085;
}
.price-table thead th.sales-header {
background-color: #fff3cd;
color: #856404;
}
.price-table tbody td {
padding: 8px 6px;
border: 1px solid #dee2e6;
text-align: center;
font-size: 11px;
}
.price-table tbody tr:nth-child(even) {
background-color: #f8f9fa;
}
.price-table tbody tr:hover {
background-color: #e2e6ea;
}
.price-estimate {
background-color: #f0fff0;
}
.price-order {
background-color: #f0f8ff;
}
.price-sales {
background-color: #fffef0;
}
.price-diff-positive {
color: #28a745;
font-weight: bold;
}
.price-diff-negative {
color: #dc3545;
font-weight: bold;
}
.total-row {
font-weight: bold;
background-color: #e9ecef !important;
}
.btn-area {
text-align: center;
margin-top: 20px;
}
.btn-close {
padding: 10px 30px;
background-color: #6c757d;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 14px;
}
.btn-close:hover {
background-color: #5a6268;
}
.text-right {
text-align: right !important;
}
.no-data {
text-align: center;
padding: 30px;
color: #6c757d;
font-size: 14px;
}
</style>
<script type="text/javascript">
$(function() {
// 닫기 버튼
$("#btnClose").click(function() {
window.close();
});
});
// 숫자 포맷 (천단위 콤마)
function formatNumber(num) {
if(num == null || num == '' || isNaN(num)) return '-';
return parseFloat(num).toLocaleString('ko-KR');
}
// 통화 포맷
function formatCurrency(num, currency) {
if(num == null || num == '' || isNaN(num)) return '-';
var formatted = parseFloat(num).toLocaleString('ko-KR');
if(currency == 'KRW' || currency == '원') {
return '₩' + formatted;
} else if(currency == 'USD' || currency == '달러') {
return '$' + formatted;
} else if(currency == 'EUR' || currency == '유로') {
return '€' + formatted;
} else if(currency == 'JPY' || currency == '엔') {
return '¥' + formatted;
}
return formatted;
}
</script>
</head>
<body>
<div class="popup-container">
<div class="popup-title">📊 품목별 가격 비교</div>
<!-- 기본 정보 -->
<div class="section-title">📋 계약 정보</div>
<table class="info-table">
<tr>
<th>영업번호</th>
<td>${info.CONTRACT_NO}</td>
<th>고객사</th>
<td>${info.CUSTOMER_NAME}</td>
<th>주문유형</th>
<td>${info.CATEGORY_NAME}</td>
<th>제품구분</th>
<td>${info.PRODUCT_NAME}</td>
</tr>
<tr>
<th>접수일</th>
<td>${info.RECEIPT_DATE}</td>
<th>수주일</th>
<td>${info.ORDER_DATE}</td>
<th>결재상태</th>
<td>${info.APPR_STATUS}</td>
<th>환종</th>
<td>${info.CONTRACT_CURRENCY_NAME}</td>
</tr>
</table>
<!-- 품목별 가격 비교 테이블 -->
<div class="section-title">💰 품목별 가격 비교</div>
<c:choose>
<c:when test="${not empty itemList}">
<table class="price-table">
<thead>
<tr>
<th rowspan="2" style="width:30px;">No</th>
<th rowspan="2" style="width:100px;">품번</th>
<th rowspan="2" style="width:120px;">품명</th>
<th colspan="4" class="estimate-header">견적</th>
<th colspan="4" class="order-header">수주</th>
<th colspan="4" class="sales-header">판매</th>
<th rowspan="2" style="width:60px;">비고</th>
</tr>
<tr>
<!-- 견적 -->
<th class="estimate-header" style="width:50px;">수량</th>
<th class="estimate-header" style="width:70px;">단가</th>
<th class="estimate-header" style="width:80px;">공급가</th>
<th class="estimate-header" style="width:80px;">합계</th>
<!-- 수주 -->
<th class="order-header" style="width:50px;">수량</th>
<th class="order-header" style="width:70px;">단가</th>
<th class="order-header" style="width:80px;">공급가</th>
<th class="order-header" style="width:80px;">합계</th>
<!-- 판매 -->
<th class="sales-header" style="width:50px;">수량</th>
<th class="sales-header" style="width:70px;">단가</th>
<th class="sales-header" style="width:80px;">공급가</th>
<th class="sales-header" style="width:80px;">합계</th>
</tr>
</thead>
<tbody>
<c:forEach var="item" items="${itemList}" varStatus="status">
<tr>
<td>${status.index + 1}</td>
<td>${item.PART_NO}</td>
<td style="text-align:left;">${item.PART_NAME}</td>
<!-- 견적 -->
<td class="price-estimate text-right">${item.EST_QUANTITY}</td>
<td class="price-estimate text-right">
<fmt:formatNumber value="${item.EST_UNIT_PRICE}" pattern="#,##0.##"/>
</td>
<td class="price-estimate text-right">
<fmt:formatNumber value="${item.EST_SUPPLY_PRICE}" pattern="#,##0"/>
</td>
<td class="price-estimate text-right">
<fmt:formatNumber value="${item.EST_TOTAL_AMOUNT}" pattern="#,##0"/>
</td>
<!-- 수주 -->
<td class="price-order text-right">${item.ORDER_QUANTITY}</td>
<td class="price-order text-right">
<fmt:formatNumber value="${item.ORDER_UNIT_PRICE}" pattern="#,##0.##"/>
</td>
<td class="price-order text-right">
<fmt:formatNumber value="${item.ORDER_SUPPLY_PRICE}" pattern="#,##0"/>
</td>
<td class="price-order text-right">
<fmt:formatNumber value="${item.ORDER_TOTAL_AMOUNT}" pattern="#,##0"/>
</td>
<!-- 판매 -->
<td class="price-sales text-right">${item.SALES_QUANTITY}</td>
<td class="price-sales text-right">
<fmt:formatNumber value="${item.SALES_UNIT_PRICE}" pattern="#,##0.##"/>
</td>
<td class="price-sales text-right">
<fmt:formatNumber value="${item.SALES_SUPPLY_PRICE}" pattern="#,##0"/>
</td>
<td class="price-sales text-right">
<fmt:formatNumber value="${item.SALES_TOTAL_AMOUNT}" pattern="#,##0"/>
</td>
<!-- 비고 (가격 차이) -->
<td>
<c:choose>
<c:when test="${item.ORDER_TOTAL_AMOUNT > item.EST_TOTAL_AMOUNT}">
<span class="price-diff-positive">↑</span>
</c:when>
<c:when test="${item.ORDER_TOTAL_AMOUNT < item.EST_TOTAL_AMOUNT}">
<span class="price-diff-negative">↓</span>
</c:when>
<c:otherwise>
<span>=</span>
</c:otherwise>
</c:choose>
</td>
</tr>
</c:forEach>
<!-- 합계 행 -->
<tr class="total-row">
<td colspan="3" style="text-align:center;">합계</td>
<!-- 견적 합계 -->
<td class="price-estimate text-right">${totalEstQuantity}</td>
<td class="price-estimate text-right">-</td>
<td class="price-estimate text-right">
<fmt:formatNumber value="${totalEstSupply}" pattern="#,##0"/>
</td>
<td class="price-estimate text-right">
<fmt:formatNumber value="${totalEstAmount}" pattern="#,##0"/>
</td>
<!-- 수주 합계 -->
<td class="price-order text-right">${totalOrderQuantity}</td>
<td class="price-order text-right">-</td>
<td class="price-order text-right">
<fmt:formatNumber value="${totalOrderSupply}" pattern="#,##0"/>
</td>
<td class="price-order text-right">
<fmt:formatNumber value="${totalOrderAmount}" pattern="#,##0"/>
</td>
<!-- 판매 합계 -->
<td class="price-sales text-right">${totalSalesQuantity}</td>
<td class="price-sales text-right">-</td>
<td class="price-sales text-right">
<fmt:formatNumber value="${totalSalesSupply}" pattern="#,##0"/>
</td>
<td class="price-sales text-right">
<fmt:formatNumber value="${totalSalesAmount}" pattern="#,##0"/>
</td>
<td>-</td>
</tr>
</tbody>
</table>
</c:when>
<c:otherwise>
<div class="no-data">
등록된 품목 정보가 없습니다.
</div>
</c:otherwise>
</c:choose>
<!-- 버튼 영역 -->
<div class="btn-area">
<button type="button" id="btnClose" class="btn-close">닫기</button>
</div>
</div>
</body>
</html>