ERP-node/WebContent/WEB-INF/view/purchaseOrder/purchaseOrderFormPopup_newD...

340 lines
16 KiB
Plaintext

<%--
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
--%>
<%@ page contentType="application/vnd.ms-excel;charset=UTF-8" %>
<%@ page isThreadSafe = "true" %>
<%@ page buffer="256kb" %>
<%@ page autoFlush = "true" %>
<%@ page import="com.pms.common.utils.*"%>
<%@ page import="java.util.*" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<% pageContext.setAttribute("replaceChar","\n"); %>
<%
java.text.SimpleDateFormat frm= new java.text.SimpleDateFormat ("yyyy_MM_dd_HH_mm");
Calendar cal = Calendar.getInstance();
String todayKor = frm.format(cal.getTime());
Map masterInfo = (Map)request.getAttribute("info");
ArrayList detailList = (ArrayList)request.getAttribute("detailList");
ArrayList apprList = (ArrayList)request.getAttribute("apprList");
ArrayList multiMasterList = (ArrayList)request.getAttribute("multiMasterList");
if(multiMasterList == null || multiMasterList.isEmpty()){
multiMasterList = new ArrayList();
}
String excelName = CommonUtils.checkNull((String)masterInfo.get("PURCHASE_ORDER_NO"));
/* String encodeName = excelName+todayKor+".xls"; */
String encodeName = "발주서_"+excelName+".xls";
String fileName = java.net.URLEncoder.encode(encodeName,"UTF-8");
String sty_td_h = "style=\"text-align:center; background-color:#D5D5D5;\"";
response.setHeader("Content-Disposition", "attachment;filename="+fileName+"");
response.setHeader("Content-Description", "JSP Generated Data");
String[] arrAppr = {"","","",""}; //결재라인 4
for(int i = 0 ; i < apprList.size() ; i++){
HashMap map = (HashMap)apprList.get(i);
if(i==0){
arrAppr[0] = CommonUtils.checkNull(map.get("WRITER"))+"<br>"+CommonUtils.checkNull(map.get("REGDATE"));
}
if(i<4){
arrAppr[i+1] = CommonUtils.checkNull(map.get("TARGET_USER_NAME"))+"<br>"+CommonUtils.checkNull(map.get("PROC_DATE"));
}
}
%>
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40">
<%--
<!DOCTYPE html>
<html>
--%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<table>
<colgroup>
<col width="5px"></col>
<col width="*" ></col>
<tr>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td>
<table style="width:1310px" border="2" cellpadding="1" cellspacing="1">
<colgroup>
<col style="width: 60px; height:23px"></col>
<col style="width: 60px; height:23px"></col>
<col style="width: 60px; height:23px"></col>
<col style="width: 60px; height:23px"></col>
<col style="width: 60px; height:23px"></col>
<col style="width: 60px; height:23px"></col>
<col style="width: 60px; height:23px"></col>
<col style="width: 60px; height:23px"></col>
<col style="width: 60px; height:23px"></col>
<col style="width: 60px; height:23px"></col>
<col style="width: 60px; height:23px"></col>
<col style="width: 60px; height:23px"></col>
<col style="width: 60px; height:23px"></col>
<col style="width: 60px; height:23px"></col>
<col style="width: 70px; height:23px"></col>
<col style="width: 70px; height:23px"></col>
<col style="width: 70px; height:23px"></col>
<col style="width: 60px; height:23px"></col>
<col style="width: 60px; height:23px"></col>
<col style="width: 60px; height:23px"></col>
<col style="width: 60px; height:23px"></col>
<col style="width: 70px; height:23px"></col>
<col style="width: 60px; height:23px"></col>
<col style="width: 70px; height:23px"></col>
</colgroup>
<tr>
<td colspan="2" <%=sty_td_h%>>발주번호 </td>
<td colspan="3"><%=CommonUtils.checkNull((String)masterInfo.get("PURCHASE_ORDER_NO"))%></td>
<td colspan="3" <%=sty_td_h%>>발주부품 </td>
<td colspan="3"><%=CommonUtils.checkNull((String)masterInfo.get("TYPE_NAME"))%></td>
<td colspan="2" <%=sty_td_h%>>프로젝트번호</td>
<td colspan="3"><%=CommonUtils.checkNull((String)masterInfo.get("PROJECT_NO"))%></td> <!-- CONTRACT_MGNT_NAME -->
<td colspan="2" <%=sty_td_h%>>유닛명 </td>
<td colspan="6"><%=CommonUtils.checkNull((String)masterInfo.get("UNIT_NAME"))%></td>
</tr>
<tr>
<td colspan="11" rowspan="2" style="text-align: center; font-size:15px; font-weight:700;">
발주서
<br style="mso-data-placement: same-cell;">
(Purchase Order)
</td>
<td colspan="2" rowspan="8"></td>
<td rowspan="2" colspan="3" style="vertical-align: middle; text-align:center; background-color:#D5D5D5;">결 재</td>
<td colspan="2" <%=sty_td_h%>>담당</td>
<td colspan="2" <%=sty_td_h%>>검토</td>
<td colspan="2" <%=sty_td_h%>>결재</td>
<td colspan="2" <%=sty_td_h%>>대표</td>
</tr>
<tr>
<td colspan="2" style="text-align:center;"><%=arrAppr[0]%></td>
<td colspan="2" style="text-align:center;"><%=arrAppr[1]%></td>
<td colspan="2" style="text-align:center;"><%=arrAppr[2]%></td>
<td colspan="2" style="text-align:center;"><%=arrAppr[3]%></td>
</tr>
<tr>
<td <%=sty_td_h%> rowspan="6">발주처</td>
<td <%=sty_td_h%> colspan="2">회사명</td>
<td colspan="8"><%=CommonUtils.checkNull((String)masterInfo.get("SALES_NAME"))%></td>
<td <%=sty_td_h%> rowspan="6">공급처</td>
<td <%=sty_td_h%> colspan="2">회사명</td>
<td colspan="8"><%=CommonUtils.checkNull((String)masterInfo.get("PARTNER_NAME"))%></td>
</tr>
<tr>
<td <%=sty_td_h%> colspan="2">사업자번호</td>
<td colspan="8"><%=CommonUtils.checkNull((String)masterInfo.get("SALES_REG_NO"))%></td>
<td <%=sty_td_h%> colspan="2">사업자번호</td>
<td colspan="8"><%=CommonUtils.checkNull((String)masterInfo.get("SUPPLY_BUS_NO"))%></td>
</tr>
<tr>
<td <%=sty_td_h%> colspan="2">담당자</td>
<td colspan="3"><%=CommonUtils.checkNull((String)masterInfo.get("SALES_MNG_USER_NAME"))%></td>
<td <%=sty_td_h%> colspan="2">HP</td>
<td colspan="3"><%=CommonUtils.checkNull((String)masterInfo.get("SALES_MNG_USER_CELL_PHONE"))%></td>
<td <%=sty_td_h%> colspan="2">대표자</td>
<td colspan="3"><%=CommonUtils.checkNull((String)masterInfo.get("SUPPLY_USER_NAME"))%></td>
<td <%=sty_td_h%> colspan="2">HP</td>
<td colspan="3"><%=CommonUtils.checkNull((String)masterInfo.get("SUPPLY_USER_HP"))%></td>
</tr>
<tr>
<td <%=sty_td_h%> colspan="2">전화</td>
<td colspan="3"><%=CommonUtils.checkNull((String)masterInfo.get("SALES_SUPPLY_OFFICE_NO"))%></td>
<td <%=sty_td_h%> colspan="2">FAX</td>
<td colspan="3"><%=CommonUtils.checkNull((String)masterInfo.get("SALES_SUPPLY_FAX_NO"))%></td>
<td <%=sty_td_h%> colspan="2">전화</td>
<td colspan="3"><%=CommonUtils.checkNull((String)masterInfo.get("SUPPLY_USER_TEL"))%></td>
<td <%=sty_td_h%> colspan="2">FAX</td>
<td colspan="3"><%=CommonUtils.checkNull((String)masterInfo.get("SUPPLY_USER_FAX"))%></td>
</tr>
<tr>
<td <%=sty_td_h%> colspan="2">E-MAIL</td>
<td colspan="8"><%=CommonUtils.checkNull((String)masterInfo.get("SALES_EMAIL"))%></td>
<td <%=sty_td_h%> colspan="2">E-MAIL</td>
<td colspan="8"><%=CommonUtils.checkNull((String)masterInfo.get("SUPPLY_USER_EMAIL"))%></td>
</tr>
<tr>
<td <%=sty_td_h%> colspan="2">주소</td>
<td colspan="8"><%=CommonUtils.checkNull((String)masterInfo.get("SALES_SUPPLY_ADDRESS"))%></td>
<td <%=sty_td_h%> colspan="2">주소</td>
<td colspan="8"><%=CommonUtils.checkNull((String)masterInfo.get("SUPPLY_ADDR"))%></td>
</tr>
<tr>
<td colspan="24" style="text-align: center; height: 50px;">
아래의 자재를 발주하오니 기일 내 필히 납품하여 주시기 바랍니다.
</td>
</tr>
<tr>
<td colspan="2" <%=sty_td_h%>>발주구분 </td>
<td colspan="2"><%=CommonUtils.checkNull((String)masterInfo.get("ORDER_TYPE_CD_NAME"))%></td>
<td colspan="2" <%=sty_td_h%>>납품장소 </td>
<td colspan="2"><%=CommonUtils.checkNull((String)masterInfo.get("DELIVERY_PLACE_NAME"))%></td>
<td colspan="2" <%=sty_td_h%>>검수방법 </td>
<td colspan="2"><%=CommonUtils.checkNull((String)masterInfo.get("INSPECT_METHOD_NAME"))%></td>
<td colspan="2" <%=sty_td_h%>>결제조건 </td>
<td colspan="2"><%=CommonUtils.checkNull((String)masterInfo.get("PAYMENT_TERMS_NAME"))%></td>
<td colspan="2" <%=sty_td_h%>>입고요청일 </td>
<td colspan="2" style="text-align:center;"><%=CommonUtils.checkNull((String)masterInfo.get("DELIVERY_DATE"))%></td>
<td colspan="2" <%=sty_td_h%>> </td>
<td colspan="2"></td>
</tr>
<tr>
<td colspan="2" <%=sty_td_h%>>발주서 No.</td>
<td colspan="2"><%=CommonUtils.checkNull((String)masterInfo.get("PURCHASE_ORDER_NO_ORG_NO"))%></td>
<td colspan="2" <%=sty_td_h%>>제 목</td>
<td colspan="6"><%=CommonUtils.checkNull((String)masterInfo.get("TITLE"))%></td>
<td colspan="2" <%=sty_td_h%>>부가세포함 발주금액(원) </td>
<td colspan="10"><%=CommonUtils.checkNull((String)masterInfo.get("TOTAL_PRICE_TXT_ALL"))%></td>
<%-- <td colspan="1" <%=sty_td_h%>>부가세 </td>
<td colspan="4"><%=CommonUtils.checkNull((String)masterInfo.get("VAT_METHOD_NAME"))%></td> --%>
</tr>
<tr></tr>
<%-- ====================================================== --%>
<tr style="height: 26px;">
<td colspan="1" <%=sty_td_h%>>NO.</td>
<td colspan="2" <%=sty_td_h%>>품명</td>
<td colspan="2" <%=sty_td_h%>>품번</td>
<td colspan="2" <%=sty_td_h%>>규격</td>
<td colspan="1" <%=sty_td_h%>>Maker</td>
<td colspan="1" <%=sty_td_h%>>단위</td>
<%--
<td colspan="1" <%=sty_td_h%>>설계수량</td>
--%>
<td colspan="1" <%=sty_td_h%>>수량</td>
<td colspan="2" <%=sty_td_h%>>공급단가</td>
<td colspan="2" <%=sty_td_h%>>레이져단가</td>
<td colspan="1" <%=sty_td_h%>>용접단가</td>
<td colspan="1" <%=sty_td_h%>>가공단가</td>
<td colspan="1" <%=sty_td_h%>>후처리단가</td>
<td colspan="2" <%=sty_td_h%>>공급가</td>
<%--
<td colspan="2" <%=sty_td_h%>>부가세포함공급가</td>
--%>
<td colspan="1" <%=sty_td_h%>>총발주수량</td>
<td colspan="1" <%=sty_td_h%>>재고수량</td>
<td colspan="1" <%=sty_td_h%>>실발주수량</td>
<td colspan="2" <%=sty_td_h%>>실공급가</td>
</tr>
<%
for(int i = 0 ; i < detailList.size() ; i++){
HashMap map = (HashMap)detailList.get(i);
%>
<tr>
<td colspan="1" style="text-align:center;"><%=(i+1)%></td>
<td colspan="2" style="text-align: left;"><%=CommonUtils.checkNull(map.get("PART_NAME" ))%></td>
<td colspan="2" style="text-align: left;"><%=CommonUtils.checkNull(map.get("PART_NO" ))%></td>
<td colspan="2" style="text-align: left;"><%=CommonUtils.checkNull(map.get("SPEC" ))%></td>
<td colspan="1" style="text-align: left;"><%=CommonUtils.checkNull(map.get("MAKER" ))%></td>
<td colspan="1" style="text-align:center;"><%=CommonUtils.checkNull(map.get("UNIT_NAME" ))%></td>
<td colspan="1" style="text-align: right;"><%=CommonUtils.numberFormat(CommonUtils.checkNull(map.get("ORDER_QTY" )))%></td>
<td colspan="2" style="text-align: right;"><%=CommonUtils.numberFormat(CommonUtils.checkNull(map.get("PARTNER_PRICE" )))%></td>
<td colspan="2" style="text-align: right;"><%=CommonUtils.numberFormat(CommonUtils.checkNull(map.get("PRICE1" )))%></td>
<td colspan="1" style="text-align: right;"><%=CommonUtils.numberFormat(CommonUtils.checkNull(map.get("PRICE2" )))%></td>
<td colspan="1" style="text-align: right;"><%=CommonUtils.numberFormat(CommonUtils.checkNull(map.get("PRICE3" )))%></td>
<td colspan="1" style="text-align: right;"><%=CommonUtils.numberFormat(CommonUtils.checkNull(map.get("PRICE4" )))%></td>
<td colspan="2" style="text-align: right;"><%=CommonUtils.numberFormat(CommonUtils.checkNull(map.get("SUPPLY_UNIT_PRICE")))%></td>
<%--
<td colspan="2" style="text-align: right;"><%=CommonUtils.numberFormat(CommonUtils.checkNull(map.get("SUPPLY_UNIT_VAT_SUM_PRICE")))%></td>
--%>
<td colspan="1" style="text-align: right;"><%=CommonUtils.numberFormat(CommonUtils.checkNull(map.get("TOTAL_ORDER_QTY" )))%></td>
<td colspan="1" style="text-align: right;"><%=CommonUtils.numberFormat(CommonUtils.checkNull(map.get("STOCK_QTY" )))%></td>
<td colspan="1" style="text-align: right;"><%=CommonUtils.numberFormat(CommonUtils.checkNull(map.get("REAL_ORDER_QTY" )))%></td>
<td colspan="2" style="text-align: right;"><%=CommonUtils.numberFormat(CommonUtils.checkNull(map.get("REAL_SUPPLY_PRICE" )))%></td>
</tr>
<%
}
%>
<tr>
<td colspan="17" <%=sty_td_h%>>합계(원)</td>
<td colspan="2" style="text-align: right; background-color:#fbead9;">
<%=CommonUtils.numberFormat(CommonUtils.checkNull((String)masterInfo.get("TOTAL_SUPPLY_PRICE")))%>
</td>
<td colspan='3' ></td>
<td colspan="2" style="text-align: right; background-color:#fbead9;">
<%--=CommonUtils.numberFormat(CommonUtils.checkNull((String)masterInfo.get("TOTAL_SUPPLY_UNIT_PRICE")))--%>
<%=CommonUtils.numberFormat(CommonUtils.checkNull((String)masterInfo.get("TOTAL_REAL_SUPPLY_PRICE")))%>
</td>
</tr>
<tr>
<td colspan="12"></td>
<td colspan="2" <%=sty_td_h%>>할인금액(원)</td>
<td colspan="2" style="text-align: right; background-color:#fbead9;">
<%=CommonUtils.numberFormat(CommonUtils.checkNull((String)masterInfo.get("DISCOUNT_PRICE_ALL")))%>
</td>
<td colspan="2" <%=sty_td_h%>>네고율</td>
<td colspan="2" style="text-align: right; background-color:#fbead9;">
<%=CommonUtils.checkNull((String)masterInfo.get("NEGO_RATE"))%>
</td>
<td colspan="2" <%=sty_td_h%>>할인공급가(원)</td>
<td colspan="2" style="text-align: right; background-color:#fbead9;">
<%=CommonUtils.numberFormat(CommonUtils.checkNull((String)masterInfo.get("TOTAL_PRICE_ALL")))%>
</td>
</tr>
<tr></tr>
<tr>
<td rowspan="" colspan="4" <%=sty_td_h%>>동시적용프로젝트번호</td>
<%
HashMap map;
for(int i = 0 ; i < 10 ; i++){
if(multiMasterList.size()-1 >= i){
map = (HashMap)multiMasterList.get(i);
}else{
map = new HashMap();
}
%>
<td colspan="2" style="text-align:center;"><%=CommonUtils.checkNull(map.get("CONTRACT_NO"))%></td>
<%}%>
</tr>
<tr>
<td rowspan="" colspan="4" <%=sty_td_h%>>입고계획일</td>
<%
for(int i = 0 ; i < 10 ; i++){
if(multiMasterList.size()-1 >= i){
map = (HashMap)multiMasterList.get(i);
}else{
map = new HashMap();
}
%>
<td colspan="2" style="text-align:center;"><%=CommonUtils.checkNull(map.get("DELIVERY_PLAN_DATE"))%></td>
<%}%>
</tr>
<tr>
<td rowspan="" colspan="4" <%=sty_td_h%>>입고계획수량</td>
<%
for(int i = 0 ; i < 10 ; i++){
if(multiMasterList.size()-1 >= i){
map = (HashMap)multiMasterList.get(i);
}else{
map = new HashMap();
}
%>
<td colspan="2" style="text-align:center;"><%=CommonUtils.checkNull(map.get("DELIVERY_PLAN_QTY"))%></td>
<%}%>
</tr>
<tr>
<td colspan="4" <%=sty_td_h%>>작업지시사항${fn:length(multiMasterList)}</td>
<td colspan="20">${fn:replace(info.REMARK, replaceChar, "<br style=mso-data-placement:same-cell>")}</td>
</tr>
<tr>
<td colspan="24" style="text-align: right;">★거래명세서 자동생성은 발주서 기준으로 입고수량 대비 정품수량 동일시 구매팀 확인후 발주서 기준으로 자동생성 된다.</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>