package kr.co.udapsoft.common.commonSign.util;

import java.awt.Color;
import java.io.IOException;
import java.io.OutputStream;
import java.sql.Connection;

import javax.servlet.http.HttpServletRequest;

import com.lowagie.text.Document;
import com.lowagie.text.DocumentException;
import com.lowagie.text.Element;
import com.lowagie.text.Font;
import com.lowagie.text.Image;
import com.lowagie.text.PageSize;
import com.lowagie.text.Paragraph;
import com.lowagie.text.Rectangle;
import com.lowagie.text.pdf.BaseFont;
import com.lowagie.text.pdf.PdfPCell;
import com.lowagie.text.pdf.PdfPTable;
import com.lowagie.text.pdf.PdfWriter;

/*
 * 외주기성고 계산서 : http://172.17.217.243/lib/dlgReport.screen?&WINDOW_TITLE=%20&REPORT_NAME=%2Fjsp%2Fko_kr%2Fsub%2Freport%2FSUBAcmpBillList.mrd&REPORT_OPTION=%2Frf&HIDE_STATUS_BAR=false&HIDE_TOOL_BAR=false&ZOOM_RATIO=100&HIDE_STATUS_DLG=false&P_0=6250A10401&P_1=200808&P_2='SUBO06110064'%2C'SUBO06110089'%2C'SUBO07010064'%2C'SUBO07030114'%2C'SUBO07030116'%2C'SUBO07050041'%2C'SUBO07070043'%2C'SUBO08040034'%2C'SUBO08040127'%2C'SUBO08050150'%2C'SUBO08070004'%2C'SUBO08070023'%2C'SUBO08070026'%2C'SUBO06110066'%2C'SUBO07010039'%2C'SUBO06110040'%2C'SUBO07020049'%2C'SUBO07090060'%2C'SUBO07110105'%2C'SUBO07110107'%2C'SUBO07120076'%2C'SUBO07120085'%2C'SUBO07120109'%2C'SUBO07120131'%2C'SUBO07120133'%2C'SUBO08010025'%2C'SUBO08010058'%2C'SUBO08020050'%2C'SUBO08030015'%2C'SUBO08040100'%2C'SUBO08040141'%2C'SUBO08060015'%2C'SUBO08060040'%2C'SUBO08060078'%2C'SUBO08070074'%2C'SUBO07010081'%2C'SUBO07030115'%2C'SUBO07060089'%2C'SUBO07070013'%2C'SUBO07070053'%2C'SUBO07070086'%2C'SUBO07070088'%2C'SUBO07070089'%2C'SUBO07100113'%2C'SUBO07100118'%2C'SUBO07100124'%2C'SUBO07110030'%2C'SUBO08030034'%2C'SUBO08030122'%2C'SUBO06120108'%2C'SUBO07020069'%2C'SUBO07020083'%2C'SUBO07030125'%2C'SUBO07050062'%2C'SUBO07060070'%2C'SUBO07070051'%2C'SUBO07070119'%2C'SUBO07070122'%2C'SUBO07100123'%2C'SUBO07120055'%2C'SUBO07120062'%2C'SUBO07120113'%2C'SUBO08030075'%2C'SUBO08060115'%2C'SUBO08060118'%2C'SUBO08070006'%2C'SUBO08070037'%2C'SUBO08070167'%2C'SUBO08070168'%2C'SUBO08080030'%2C'SUBO06120082'%2C'SUBO07030006'%2C'SUBO07030110'%2C'SUBO07040059'%2C'SUBO07040075'%2C'SUBO07090007'%2C'SUBO07110067'%2C'SUBO07120004'%2C'SUBO07120081'%2C'SUBO08010023'%2C'SUBO08010104'%2C'SUBO08010171'%2C'SUBO08030099'%2C'SUBO08040027'%2C'SUBO08040089'%2C'SUBO08060018'%2C'SUBO08090001'&P_SIZE=3
 * 
 */

import com.udapsoft.waf.system.HandlerStorage;

import kr.co.hsnc.common.base.WAFLogger;
import kr.co.hsnc.common.config.WAFConfig;
import kr.co.hsnc.common.sql.RowSet;
import kr.co.hsnc.common.sql.RowSetImpl;
import kr.co.hsnc.common.sql.persistent.Persistent;
import kr.co.hsnc.common.sql.persistent.PersistentImpl;
import kr.co.hsnc.common.sql.search.Search;
import kr.co.hsnc.common.sql.search.SearchImpl;
import kr.co.hsnc.common.sql.util.RowSetUtility;
import kr.co.hsnc.common.util.ValueObject;
import kr.co.udapsoft.common.util.PCMSUtil;

public class SACDOCreatePDF4 {

	public static BaseFont bfKorean = null;

	/*
	 * private static Font FontKorean = null;
	 */

	public static Font FontBold = null;

	private static String strClassName = (new Throwable()).getStackTrace()[0]
			.getClassName();

	//private static String strFileName = "d:\\temp\\pdf\\" + strClassName +".pdf";
	private static String strFileName = WAFConfig.get("waf.repository.path") + "\\" + strClassName + ".pdf";

	private static Color borderColor = Color.BLACK;

	private static String strGubun = null;

	private static float BorderW = 0.1f;

	private static Rectangle border = new Rectangle(0f, 0f);
	private static boolean isGray = false;
	private static boolean LineisGray = false;  //데이터 로 

	/**
	 * @param args
	 */
	public void doBiz(OutputStream outputStream, String tmpslipID,  HttpServletRequest request) {
 
        WAFLogger.debug("\n\t #################### 구매 대금지급생성 시작");
        
		// step 1
		Document document = new Document(PageSize.A4, 25f, 25f, 35f, 10f);
  
		try {
	 
    		// step 2
  			PdfWriter writer = PdfWriter.getInstance(document, outputStream);

			// step 3
			document.open();

			BaseFont bfKorean = BaseFont.createFont("HYGoThic-Medium", "UniKS-UCS2-H", BaseFont.NOT_EMBEDDED);

			Font FontTitle = new Font(bfKorean, 8, Font.NORMAL);
			FontTitle.setColor(borderColor);

			Font FontData = new Font(bfKorean, 4.8f, Font.NORMAL);
			Font FontTitle2 = new Font(bfKorean, 20, Font.BOLD);

			PdfPTable table = null;
			PdfPCell cell = null;

			/*
			 * 정보 검색 시작 ---------------------------------------------
			 */
			
			ValueObject params = new ValueObject();
			HandlerStorage storage = new HandlerStorage();
			storage.setParams(params);
			
			ValueObject listRowSet = null;
			/*
			 * 정보 검색 시작 ---------------------------------------------
			 */
			listRowSet = getPayReqList(tmpslipID);
			
			// 정보 검색 끝 ---------------------------------------------
			
			/*
			 * ===========================================================================================
			 * 제목 생성
			 * ===========================================================================================
			 */
			if(listRowSet.get("DEPOSIT_CD").equals("1")){
				makeTitle_1(document, FontTitle, FontTitle2,  request);
			}else{
				makeTitle(document, FontTitle, FontTitle2,  request);
				
			}

			//본문생성
			setBorder(border, true, true, true, true);
			
            //1행
		    PdfPTable table11 = new PdfPTable(6);
		    table11.setWidthPercentage(100);
		    table11.setSpacingBefore(7f);
		    table11.setSpacingAfter(7f);
            float[] table11Width = {15f,3f,27f,3f,27f,30f};
            table11.setWidths(table11Width);
            
          
            
            // 1행
            PT_addCell(table11, new String [] { "계약번호" }, FontTitle, border,
    				Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,true);
            PT_addCell(table11, listRowSet.get("ORD_DOC_NO"), FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 2, 20f ,false);
            PT_addCell(table11, new String [] { "작성일자" }, FontTitle, border,
    				Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 2, 20f ,true);          
            PT_addCell(table11, listRowSet.get("REQ_DATE"), FontTitle, border,
    				Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 20f,false);
            
            
            PT_addCell(table11, new String [] { "작성자" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,true);
            PT_addCell(table11, listRowSet.get("REQ_CHARGE_NAME"), FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 2, 20f ,false);
            PT_addCell(table11, new String [] { "협조부서" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 2, 20f ,true);          
            PT_addCell(table11, listRowSet.get("COOP_DEPT_NM"), FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 20f,false);
            
            
            PT_addCell(table11, new String [] { "현장코드" }, FontTitle, border,
		    		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,true);          
		    PT_addCell(table11, listRowSet.get("DEPT_CD"), FontTitle, border,
		    		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 2, 20f,false);
		    PT_addCell(table11, new String [] { "통화" }, FontTitle, border,
		    		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 2, 20f ,true);          
		    PT_addCell(table11, listRowSet.get("CURRENCY_GB"), FontTitle, border,
		    		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f,false);
            
            PT_addCell(table11, new String [] { "현장명" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,true);
		    PT_addCell(table11, listRowSet.get("DEPT_NM"), FontTitle, border,
		    		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 5, 20f ,false);
		    
            
            /*PT_addCell(table11, new String [] { "현장명" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,true);
            PT_addCell(table11, listRowSet.get("DEPT_NM"), FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 2, 20f ,false);
            PT_addCell(table11, new String [] { "현장코드" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 2, 20f ,true);          
            PT_addCell(table11, listRowSet.get("DEPT_CD"), FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f,false);*/
            
            
            PT_addCell(table11, new String [] { "계약명" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,true);
            PT_addCell(table11, listRowSet.get("CST_DOC_NAME"), FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 5, 20f ,false);
            
            
            PT_addCell(table11, new String [] { "계약업체명" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,true);
            PT_addCell(table11, listRowSet.get("CORP_NM"), FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 2, 20f ,false);
            PT_addCell(table11, new String [] { "대표이사" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 2, 20f ,true);          
            PT_addCell(table11, listRowSet.get("REP_NAME"), FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f,false);
           
            
            PT_addCell(table11, new String [] { "총계약금액" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,true);
            PT_addCell(table11, listRowSet.get("ORD_AMT"), FontTitle, border,
            		Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 2, 20f ,false);
            PT_addCell(table11, new String [] { "선급금액" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 2, 20f ,true);          
            PT_addCell(table11, listRowSet.get("PREPAY_AMT"), FontTitle, border,
            		Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 20f,false);

            
            PT_addCell(table11, new String [] { "지급구분" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,true);
            PT_addCell(table11, listRowSet.get("DEPOSIT_GB"), FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 2, 20f ,false);
            PT_addCell(table11, new String [] { "기선급공제액" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 2, 20f ,true);          
            PT_addCell(table11, listRowSet.get("PREPAY_ACMP_AMT"), FontTitle, border,
            		Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 20f,false);
            
            
            PT_addCell(table11, new String [] { "지급사유" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,true);
            PT_addCell(table11, listRowSet.get("DEPOSIT_RESN"), FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 2, 20f ,false);
            PT_addCell(table11, new String [] { "선급잔액" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 2, 20f ,true);          
            PT_addCell(table11, listRowSet.get("PREPAY_RMDR"), FontTitle, border,
            		Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 20f,false);
            
            
            PT_addCell(table11, new String [] { "기지불액" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,true);
            PT_addCell(table11, listRowSet.get("PAYED_AMT")+" ("+listRowSet.get("PAYED_PERCENT")+")%", FontTitle, border,
            		Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 2, 20f ,false);
            PT_addCell(table11, new String [] { "전기성고" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 2, 20f ,true);          
            PT_addCell(table11, listRowSet.get("BEF_ACMP_AMT")+" ("+listRowSet.get("BEF_ACMP_PERCENT")+")%", FontTitle, border,
            		Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 20f,false);
            
            
            PT_addCell(table11, new String [] { "금회청구액" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,true);
            PT_addCell(table11, listRowSet.get("CUR_REQ_AMT")+" ("+listRowSet.get("CUR_REQ_PERCENT")+")%", FontTitle, border,
            		Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 2, 20f ,false);
            PT_addCell(table11, new String [] { "금회기성고" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 2, 20f ,true);          
            PT_addCell(table11, listRowSet.get("CUR_ACMP_AMT")+" ("+listRowSet.get("CUR_ACMP_PERCENT")+")%", FontTitle, border,
            		Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 20f,false);
            
            
            PT_addCell(table11, new String [] { "금회포함지불액" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,true);
            PT_addCell(table11, listRowSet.get("CUR_PAYED_AMT")+" ("+listRowSet.get("CUR_PAYED_PERCENT")+")%", FontTitle, border,
            		Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 2, 20f ,false);
            PT_addCell(table11, new String [] { "금회포함기성고" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 2, 20f ,true);          
            PT_addCell(table11, listRowSet.get("CUR_BEF_ACMP_AMT")+" ("+listRowSet.get("CUR_BEF_ACMP_PERCENT")+")%", FontTitle, border,
            		Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 20f,false);
            
            
            PT_addCell(table11, new String [] { "잔액" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,true);
            PT_addCell(table11, listRowSet.get("REMAINDER_AMT")+" ("+listRowSet.get("REMAINDER_PERCENT")+")%", FontTitle, border,
            		Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 2, 20f ,false);
            PT_addCell(table11, new String [] { "미기성고" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 2, 20f ,true);          
            PT_addCell(table11, listRowSet.get("REMAINDER_ACMP_AMT")+" ("+listRowSet.get("REMAINDER_ACMP_PERCENT")+")%", FontTitle, border,
            		Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 20f,false);
            
            
            PT_addCell(table11, new String [] { "특기사항" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 200f ,true);
            PT_addCell(table11, listRowSet.get("RE_MARKS"), FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_TOP, 5, 200f ,false);
            
            
    		
            PT_addCell(table11, new String [] { "첨부서류" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 120f ,true);
            
            
            PdfPTable table21 = new PdfPTable(4);
            float[] table21Width = {3f,27,3,27f};
            table21.setWidths(table21Width);
            PdfPCell permission = new PdfPCell(table21);
            
           
            
            PT_addCell(table21, listRowSet.get("DOC_PAYREQ"), FontTitle, border,       		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,false);
            PT_addCell(table21, new String [] { "대금청구서" }, FontTitle, border,    		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 20f ,false);
            PT_addCell(table21, listRowSet.get("DOC_COMPLETE"), FontTitle, border,     		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f,false);
            PT_addCell(table21, new String [] { "설치완료확인서" }, FontTitle, border,   		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 20f ,false);
            
            
            PT_addCell(table21, listRowSet.get("DOC_GUAR_CONST"), FontTitle, border,            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f,false);
            PT_addCell(table21, new String [] { "계약이행 보증보험 증권" }, FontTitle, border,         		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 20f ,false);          
            PT_addCell(table21, listRowSet.get("DOC_TESTRUN"), FontTitle, border,            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f,false);
            PT_addCell(table21, new String [] { "시운전완료확인서" }, FontTitle, border,           		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 20f ,false);
            
            PT_addCell(table21, listRowSet.get("DOC_MRR"), FontTitle, border,        		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,false);
            PT_addCell(table21, new String [] { "지급이행 보증보험 증권" }, FontTitle, border,	Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 20f ,false);
            PT_addCell(table21, listRowSet.get("DOC_INSPECTION_REPORT"), FontTitle, border,            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,false);
            PT_addCell(table21, new String [] { "Inspection Report" }, FontTitle, border,            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 20f ,false);
                      

            PT_addCell(table21, listRowSet.get("DOC_GUAR_AS"), FontTitle, border,            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f,false);
            PT_addCell(table21, new String [] { "하자이행 보증보험 증권" }, FontTitle, border,     		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 20f ,false);
            PT_addCell(table21, listRowSet.get("DOC_SHIP"), FontTitle, border,            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f,false);
            PT_addCell(table21, new String [] { "선적서류(B/L, Packing List)" }, FontTitle, border,            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 20f ,false);          
            
            
            PT_addCell(table21, listRowSet.get("DOC_ITEMINPUTCONFIRM"), FontTitle, border,            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,false);
            PT_addCell(table21, new String [] { "원자재입고확인서" }, FontTitle, border,            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 20f ,false);
            PT_addCell(table21, listRowSet.get("DOC_FINAL_DOCUMENTS"), FontTitle, border,            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,false);
            PT_addCell(table21, new String [] { "Final Documents 제출 확인서" }, FontTitle, border,      		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 20f ,false);
            
            
            PT_addCell(table21, listRowSet.get("DOC_CONFIRM"), FontTitle, border,            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,false);
            PT_addCell(table21, new String [] { "MRR" }, FontTitle, border,		            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 20f ,false);          
            PT_addCell(table21, listRowSet.get("DOC_CONST_COPY"), FontTitle, border,           		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f,false);
            PT_addCell(table21, new String [] { "계약서 사본" }, FontTitle, border,            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 20f ,false);
            
            
            PT_addCell(table21, listRowSet.get("DOC_WORKQA"), FontTitle, border,            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f,false);
            PT_addCell(table21, new String [] { "거래명세서" }, FontTitle, border,            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 20f ,false);                    
            PT_addCell(table21, listRowSet.get("DOC_ETC"), FontTitle, border,            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,false);
            PT_addCell(table21, new String [] { "기타" }, FontTitle, border,            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 20f ,false);
            PT_addCell(table21, listRowSet.get("DOC_MC"), FontTitle, border,            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,false);
           
            permission.setColspan(4);
            table11.addCell(permission);
            
            PT_addCell(table11, "", FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 120f,false);
            
            document.add(table11);
            


            
		} catch (DocumentException de) {
			WAFLogger.debug("de.getMessage() = " + de.getMessage());
		} catch (IOException ioe) {
			WAFLogger.debug("ioe.getMessage() = " + ioe.getMessage());
		} catch (Exception e) {
			WAFLogger.debug("[Exception] ... " + e);
		}

		// step 5
		document.close();
		WAFLogger.debug("\n\t #################### "+ strFileName +" 생성완료");
	}

	/*
	 * ===========================================================================================
	 * A. 타이틀
	 * ===========================================================================================
	 */
	
	public void doBiz1(Connection con, OutputStream outputStream, String tmpslipID,  HttpServletRequest request) {
		 
        WAFLogger.debug("\n\t #################### 구매 대금지급생성 시작");
        
		// step 1
		Document document = new Document(PageSize.A4, 25f, 25f, 35f, 10f);
  
		try {
	 
    		// step 2
  			PdfWriter writer = PdfWriter.getInstance(document, outputStream);

			// step 3
			document.open();

			BaseFont bfKorean = BaseFont.createFont("HYGoThic-Medium", "UniKS-UCS2-H", BaseFont.NOT_EMBEDDED);

			Font FontTitle = new Font(bfKorean, 8, Font.NORMAL);
			FontTitle.setColor(borderColor);

			Font FontData = new Font(bfKorean, 4.8f, Font.NORMAL);
			Font FontTitle2 = new Font(bfKorean, 20, Font.BOLD);

			PdfPTable table = null;
			PdfPCell cell = null;

			/*
			 * 정보 검색 시작 ---------------------------------------------
			 */
			
			ValueObject params = new ValueObject();
			HandlerStorage storage = new HandlerStorage();
			storage.setParams(params);
			
			ValueObject listRowSet = null;
			/*
			 * 정보 검색 시작 ---------------------------------------------
			 */
			
			listRowSet = getPayReqList1(con, tmpslipID);
			
			// 정보 검색 끝 ---------------------------------------------
			
			/*
			 * ===========================================================================================
			 * 제목 생성
			 * ===========================================================================================
			 */
			makeTitle_2(document, FontTitle, FontTitle2,  request);

			//본문생성
			setBorder(border, true, true, true, true);
			
			
            //1행
		    PdfPTable table11 = new PdfPTable(6);
		    table11.setWidthPercentage(100);
		    table11.setSpacingBefore(7f);
		    table11.setSpacingAfter(7f);
            float[] table11Width = {15f,3f,27f,3f,27f,30f};
            table11.setWidths(table11Width);
            
            // 1행
            PT_addCell(table11, new String [] { "계약번호" }, FontTitle, border,
    				Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,true);
            PT_addCell(table11, listRowSet.get("ORD_DOC_NO"), FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 2, 20f ,false);
            PT_addCell(table11, new String [] { "작성일자" }, FontTitle, border,
    				Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 2, 20f ,true);          
            PT_addCell(table11, listRowSet.get("REQ_DATE"), FontTitle, border,
    				Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 20f,false);
            
            //2015.10.22 양식변경    
            PT_addCell(table11, new String [] { "작성자" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,true);
            PT_addCell(table11, listRowSet.get("REQ_CHARGE_NAME"), FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 2, 20f ,false);
            PT_addCell(table11, new String [] { "협조부서" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 2, 20f ,true);          
            PT_addCell(table11, listRowSet.get("COOP_DEPT_NM"), FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 20f,false);
            
            
            PT_addCell(table11, new String [] { "현장코드" }, FontTitle, border,
		    		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,true);          
		    PT_addCell(table11, listRowSet.get("DEPT_CD"), FontTitle, border,
		    		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 2, 20f,false);
		    PT_addCell(table11, new String [] { "통화" }, FontTitle, border,
		    		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 2, 20f ,true);          
		    PT_addCell(table11, listRowSet.get("CURRENCY_GB"), FontTitle, border,
		    		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f,false);
            
            PT_addCell(table11, new String [] { "현장명" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,true);
		    PT_addCell(table11, listRowSet.get("DEPT_NM"), FontTitle, border,
		    		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 5, 20f ,false);
		    
            
            /*PT_addCell(table11, new String [] { "현장명" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,true);
            PT_addCell(table11, listRowSet.get("DEPT_NM"), FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 2, 20f ,false);
            PT_addCell(table11, new String [] { "현장코드" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 2, 20f ,true);          
            PT_addCell(table11, listRowSet.get("DEPT_CD"), FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f,false);*/
            
            
            PT_addCell(table11, new String [] { "계약명" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,true);
            PT_addCell(table11, listRowSet.get("CST_DOC_NAME"), FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 5, 20f ,false);
            
            
            PT_addCell(table11, new String [] { "계약업체명" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,true);
            PT_addCell(table11, listRowSet.get("CORP_NM"), FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 2, 20f ,false);
            PT_addCell(table11, new String [] { "사업자번호" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 2, 20f ,true);          
            PT_addCell(table11, listRowSet.get("CORP_REG_NO"), FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f,false);
            
            PT_addCell(table11, new String [] { "지급조건" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,true);
            PT_addCell(table11, listRowSet.get("PAYMENT_TERMS"), FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 2, 20f ,false);
            PT_addCell(table11, new String [] { "대표이사" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 2, 20f ,true);          
            PT_addCell(table11, listRowSet.get("REP_NAME"), FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f,false);
           
            
            PT_addCell(table11, new String [] { "총계약금액" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,true);
            PT_addCell(table11, listRowSet.get("ORD_AMT"), FontTitle, border,
            		Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 2, 20f ,false);
            PT_addCell(table11, new String [] { "선급금액" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 2, 20f ,true);          
            PT_addCell(table11, listRowSet.get("PREPAY_AMT"), FontTitle, border,
            		Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 20f,false);

            
            PT_addCell(table11, new String [] { "지급구분" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,true);
            PT_addCell(table11, listRowSet.get("DEPOSIT_GB"), FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 2, 20f ,false);
            PT_addCell(table11, new String [] { "지급사유" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 2, 20f ,true);
            PT_addCell(table11, listRowSet.get("DEPOSIT_RESN"), FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 20f ,false);
            
            PT_addCell(table11, new String [] { "기지불액" }, FontTitle, border, Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,true);
            PT_addCell(table11, listRowSet.get("PAYED_AMT"), FontTitle, border, Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 2, 20f ,false);
            PT_addCell(table11, new String [] { "기선급공제액" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 2, 20f ,true);          
            PT_addCell(table11, listRowSet.get("PREPAY_ACMP_AMT"), FontTitle, border,
            		Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 20f,false);
            
            PT_addCell(table11, new String [] { "금회청구액" }, FontTitle, border,            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,true);
            PT_addCell(table11, listRowSet.get("CUR_REQ_AMT"), FontTitle, border,            		Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 2, 20f ,false);
            PT_addCell(table11, new String [] { "금회선급공제액" }, FontTitle, border,            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 2, 20f ,true);
            PT_addCell(table11, listRowSet.get("CUR_PREPAY_APPLYAMT"), FontTitle, border,            		Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 20f ,false);
            
            PT_addCell(table11, new String [] { "금회포함지불액" }, FontTitle, border,            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,true);
            PT_addCell(table11, listRowSet.get("CUR_PAYED_AMT"), FontTitle, border,            		Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 2, 20f ,false);
            PT_addCell(table11, new String [] { "선급잔액" }, FontTitle, border,          		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 2, 20f ,true);          
            PT_addCell(table11, listRowSet.get("PREPAY_RMDR"), FontTitle, border,        		Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 20f,false);
            
          
            PT_addCell(table11, new String [] { "잔액" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,true);
            PT_addCell(table11, listRowSet.get("REMAINDER_AMT")+" ("+listRowSet.get("REMAINDER_PERCENT")+")%", FontTitle, border,
            		Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 2, 20f ,false);
            PT_addCell(table11, new String [] { "금회선급공제누계" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 2, 20f ,true);
            PT_addCell(table11, listRowSet.get("CUR_PREPAY_APPLYAMT1"), FontTitle, border,
            		Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 20f ,false);
            
            PT_addCell(table11, new String [] { "전기성고" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,true);          
            PT_addCell(table11, listRowSet.get("BEF_ACMP_AMT")+" ("+listRowSet.get("BEF_ACMP_PERCENT")+")%", FontTitle, border,
            		Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 2, 20f,false);
            PT_addCell(table11, new String [] { "" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 2, 20f ,true);          
            PT_addCell(table11, "", FontTitle, border,
            		Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 20f,false);
            
            
            PT_addCell(table11, new String [] { "금회기성고" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,true);          
            PT_addCell(table11, listRowSet.get("CUR_ACMP_AMT")+" ("+listRowSet.get("CUR_ACMP_PERCENT")+")%", FontTitle, border,
            		Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 2, 20f,false);
            PT_addCell(table11, new String [] { "" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 2, 20f ,true);          
            PT_addCell(table11, "", FontTitle, border,
            		Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 20f,false);
            
            
            /*PT_addCell(table11, new String [] { "금회포함기성고" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 2, 20f ,true);          
            PT_addCell(table11, listRowSet.get("CUR_BEF_ACMP_AMT")+" ("+listRowSet.get("CUR_BEF_ACMP_PERCENT")+")%", FontTitle, border,
            		Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 20f,false);
            
            
            PT_addCell(table11, new String [] { "미기성고" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 2, 20f ,true);          
            PT_addCell(table11, listRowSet.get("REMAINDER_ACMP_AMT")+" ("+listRowSet.get("REMAINDER_ACMP_PERCENT")+")%", FontTitle, border,
            		Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 20f,false);*/
            
            
            PT_addCell(table11, new String [] { "특기사항" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 200f ,true);
            PT_addCell(table11, listRowSet.get("RE_MARKS"), FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_TOP, 5, 200f ,false);
            
            
    		
            PT_addCell(table11, new String [] { "첨부서류" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 120f ,true);
            
            
            PdfPTable table21 = new PdfPTable(4);
            float[] table21Width = {3f,27,3,27f};
            table21.setWidths(table21Width);
            PdfPCell permission = new PdfPCell(table21);
            
           
            
            PT_addCell(table21, listRowSet.get("DOC_PAYREQ"), FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,false);
            PT_addCell(table21, new String [] { "대금청구서" }, FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 20f ,false);
            PT_addCell(table21, listRowSet.get("DOC_COMPLETE"), FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f,false);
            PT_addCell(table21, new String [] { "설치완료확인서" }, FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 20f ,false);
            
            
            PT_addCell(table21, listRowSet.get("DOC_GUAR_CONST"), FontTitle, border,       		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f,false);
            PT_addCell(table21, new String [] { "계약이행 보증보험 증권" }, FontTitle, border, 		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 20f ,false);          
            PT_addCell(table21, listRowSet.get("DOC_TESTRUN"), FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f,false);
            PT_addCell(table21, new String [] { "시운전완료확인서" }, FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 20f ,false);
            
            PT_addCell(table21, listRowSet.get("DOC_MRR"), FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,false);
            PT_addCell(table21, new String [] { "지급이행 보증보험 증권" }, FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 20f ,false);
            PT_addCell(table21, listRowSet.get("DOC_INSPECTION_REPORT"), FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,false);
            PT_addCell(table21, new String [] { "Inspection Report" }, FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 20f ,false);
                      

            PT_addCell(table21, listRowSet.get("DOC_GUAR_AS"), FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f,false);
            PT_addCell(table21, new String [] { "하자이행 보증보험 증권" }, FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 20f ,false);
            PT_addCell(table21, listRowSet.get("DOC_SHIP"), FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f,false);
            PT_addCell(table21, new String [] { "선적서류(B/L, Packing List)" }, FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 20f ,false);          
            
            
            PT_addCell(table21, listRowSet.get("DOC_ITEMINPUTCONFIRM"), FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,false);
            PT_addCell(table21, new String [] { "원자재입고확인서" }, FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 20f ,false);
            PT_addCell(table21, listRowSet.get("DOC_FINAL_DOCUMENTS"), FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,false);
            PT_addCell(table21, new String [] { "Final Documents 제출 확인서" }, FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 20f ,false);
            
            
            PT_addCell(table21, listRowSet.get("DOC_CONFIRM"), FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,false);
            PT_addCell(table21, new String [] { "MRR" }, FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 20f ,false);          
            PT_addCell(table21, listRowSet.get("DOC_CONST_COPY"), FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f,false);
            PT_addCell(table21, new String [] { "계약서 사본" }, FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 20f ,false);
            
            
            PT_addCell(table21, listRowSet.get("DOC_WORKQA"), FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f,false);
            PT_addCell(table21, new String [] { "거래명세서" }, FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 20f ,false);                    
            PT_addCell(table21, listRowSet.get("DOC_ETC"), FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,false);
            PT_addCell(table21, new String [] { "기타" }, FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 20f ,false);
            PT_addCell(table21, listRowSet.get("DOC_MC"), FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,false);
           
            permission.setColspan(4);
            table11.addCell(permission);
            
            PT_addCell(table11, "", FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 120f,false);
            
            document.add(table11);          
            

            
		} catch (DocumentException de) {
			WAFLogger.debug("de.getMessage() = " + de.getMessage());
		} catch (IOException ioe) {
			WAFLogger.debug("ioe.getMessage() = " + ioe.getMessage());
		} catch (Exception e) {
			WAFLogger.debug("[Exception] ... " + e);
		}

		// step 5
		document.close();
		WAFLogger.debug("\n\t #################### "+ strFileName +" 생성완료");
	}

	private static void makeTitle1(Document document, Font FontTitle,
			Font FontTitle2,  HttpServletRequest request) throws Exception {
		

		PdfPTable tbl_Title = new PdfPTable(2);
		tbl_Title.setWidthPercentage(40f);
		float[] tbl_TitleWidths = {10f,10f};
		tbl_Title.setWidths(tbl_TitleWidths); 
        
		PdfPCell title= new PdfPCell(new Paragraph("대 금 지 급", FontTitle2));
		title.setColspan(2);
		title.setHorizontalAlignment(Element.ALIGN_CENTER);
		title.setVerticalAlignment(Element.ALIGN_MIDDLE);
		title.setFixedHeight(40f);
		title.setBorder(0);
		title.setBorderWidthBottom(1);
		
		tbl_Title.addCell(title);
		
		PdfPCell titleB = new PdfPCell(new Paragraph("", FontTitle2));
		titleB.setColspan(2);
		titleB.setFixedHeight(30f);
		titleB.setBorder(0);
		tbl_Title.addCell(titleB);
		
		//PT_addCell(tbl_Title, "대 금 지 급", FontTitle2, borderTemp,
		//		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 2, 28f, false);
		
		document.add(tbl_Title);
		
		Image img = null;
		if(request == null)
		{
			//img = Image.getInstance(new URL("http://edreams21.co.kr/img/invoice/Title_bg1.gif"));
		}
		else
		{
			//img = Image.getInstance(new URL(request.getScheme(), request.getServerName(), request.getServerPort(), "/img/invoice/Title_bg1.gif"));
		}
		
		
//		img.scaleToFit(300f, 40f);
//		img.setAbsolutePosition(310, 554);
//		img.setAbsolutePosition(203, 246);
//		img.setAbsolutePosition(180, 310);
		
//		document.add(img);
	}

	private static void makeTitle_1(Document document, Font FontTitle,
			Font FontTitle2,  HttpServletRequest request) throws Exception {
		

		PdfPTable tbl_Title = new PdfPTable(2);
		tbl_Title.setWidthPercentage(40f);
		float[] tbl_TitleWidths = {10f,10f};
		tbl_Title.setWidths(tbl_TitleWidths); 
        
		PdfPCell title= new PdfPCell(new Paragraph("선 급 금 지 급", FontTitle2));
		title.setColspan(2);
		title.setHorizontalAlignment(Element.ALIGN_CENTER);
		title.setVerticalAlignment(Element.ALIGN_MIDDLE);
		title.setFixedHeight(40f);
		title.setBorder(0);
		title.setBorderWidthBottom(1);
		
		tbl_Title.addCell(title);
		
		PdfPCell titleB = new PdfPCell(new Paragraph("", FontTitle2));
		titleB.setColspan(2);
		titleB.setFixedHeight(30f);
		titleB.setBorder(0);
		tbl_Title.addCell(titleB);
		
		document.add(tbl_Title);
		
		Image img = null;
		if(request == null)
		{
			//img = Image.getInstance(new URL("http://edreams21.co.kr/img/invoice/Title_bg1.gif"));
		}
		else
		{
			//img = Image.getInstance(new URL(request.getScheme(), request.getServerName(), request.getServerPort(), "/img/invoice/Title_bg1.gif"));
		}
		
		
//		img.scaleToFit(300f, 40f);
//		img.setAbsolutePosition(310, 554);
//		img.setAbsolutePosition(203, 246);
//		img.setAbsolutePosition(180, 310);
		
//		document.add(img);
	}

	private static void makeTitle_2(Document document, Font FontTitle,
			Font FontTitle2,  HttpServletRequest request) throws Exception {
		

		PdfPTable tbl_Title = new PdfPTable(2);
		tbl_Title.setWidthPercentage(40f);
		float[] tbl_TitleWidths = {10f,10f};
		tbl_Title.setWidths(tbl_TitleWidths); 
        
		PdfPCell title= new PdfPCell(new Paragraph("대 금 지 급", FontTitle2));
		title.setColspan(2);
		title.setHorizontalAlignment(Element.ALIGN_CENTER);
		title.setVerticalAlignment(Element.ALIGN_MIDDLE);
		title.setFixedHeight(40f);
		title.setBorder(0);
		title.setBorderWidthBottom(1);
		
		tbl_Title.addCell(title);
		
		PdfPCell titleB = new PdfPCell(new Paragraph("", FontTitle2));
		titleB.setColspan(2);
		titleB.setFixedHeight(30f);
		titleB.setBorder(0);
		tbl_Title.addCell(titleB);
		
		//PT_addCell(tbl_Title, "대 금 지 급", FontTitle2, borderTemp,
		//		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 2, 28f, false);
		
		document.add(tbl_Title);
		
		Image img = null;
		if(request == null)
		{
			//img = Image.getInstance(new URL("http://edreams21.co.kr/img/invoice/Title_bg1.gif"));
		}
		else
		{
			//img = Image.getInstance(new URL(request.getScheme(), request.getServerName(), request.getServerPort(), "/img/invoice/Title_bg1.gif"));
		}
		
		
//		img.scaleToFit(300f, 40f);
//		img.setAbsolutePosition(310, 554);
//		img.setAbsolutePosition(203, 246);
//		img.setAbsolutePosition(180, 310);
		
//		document.add(img);
	}
	private static void makeTitle(Document document, Font FontTitle,
			Font FontTitle2,  HttpServletRequest request) throws Exception {
		

		PdfPTable tbl_Title = new PdfPTable(2);
		tbl_Title.setWidthPercentage(40f);
		float[] tbl_TitleWidths = {10f,10f};
		tbl_Title.setWidths(tbl_TitleWidths); 
        
		PdfPCell title= new PdfPCell(new Paragraph("대 금 지 급", FontTitle2));
		title.setColspan(2);
		title.setHorizontalAlignment(Element.ALIGN_CENTER);
		title.setVerticalAlignment(Element.ALIGN_MIDDLE);
		title.setFixedHeight(40f);
		title.setBorder(0);
		title.setBorderWidthBottom(1);
		
		tbl_Title.addCell(title);
		
		PdfPCell titleB = new PdfPCell(new Paragraph("", FontTitle2));
		titleB.setColspan(2);
		titleB.setFixedHeight(30f);
		titleB.setBorder(0);
		tbl_Title.addCell(titleB);
		
		//PT_addCell(tbl_Title, "대 금 지 급", FontTitle2, borderTemp,
		//		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 2, 28f, false);
		
		document.add(tbl_Title);
		
		Image img = null;
		if(request == null)
		{
			//img = Image.getInstance(new URL("http://edreams21.co.kr/img/invoice/Title_bg1.gif"));
		}
		else
		{
			//img = Image.getInstance(new URL(request.getScheme(), request.getServerName(), request.getServerPort(), "/img/invoice/Title_bg1.gif"));
		}
		
		
//		img.scaleToFit(300f, 40f);
//		img.setAbsolutePosition(310, 554);
//		img.setAbsolutePosition(203, 246);
//		img.setAbsolutePosition(180, 310);
		
//		document.add(img);
	}

	/*
	 * ===========================================================================================
	 * B. 데이터 입력
	 * ===========================================================================================
	 */
	

	/*
	 * ===========================================================================================
	 * 기타
	 * ===========================================================================================
	 */
	// PdfPCell을 리턴하자
	private static PdfPCell PC_addCell(String strText, Font FontTitle,
			Rectangle border, int HA, int VA, int CS) {

		// 추가할 Cell 생성
		PdfPCell cell = new PdfPCell(new Paragraph(strText, FontTitle));

		// PdfPCell cell = new PdfPCell(new Paragraph(strText));

		// Cell Border 설정
		// setBorder(cell, blnLEFT, blnRIGHT, blnTOP, blnBOTTOM);

		cell.cloneNonPositionParameters(border);

		// 가로/세로 정렬
		cell.setHorizontalAlignment(HA);
		cell.setVerticalAlignment(VA);

		// setColspan
		if (CS > 1)
			cell.setColspan(CS);

		// cell.setPadding(0);
		
		if( isGray )
			cell.setGrayFill(0.8f);
		//if( LineisGray )
		//	cell.setGrayFill(0.9f);
		//cell.setBackgroundColor(arg0)
		
		
		return cell;
	}

	// Cell Border 설정
	private static void setBorder(Rectangle border, boolean blnLEFT,
			boolean blnRIGHT, boolean blnTOP, boolean blnBOTTOM) {
		border.setBorderColor(borderColor);

		if (blnLEFT) {
			border.setBorderWidthLeft(BorderW);
		} else {
			border.setBorderWidthLeft(0);
		}

		if (blnRIGHT) {
			border.setBorderWidthRight(BorderW);
		} else {
			border.setBorderWidthRight(0);
		}

		if (blnTOP) {
			border.setBorderWidthTop(BorderW);
		} else {
			border.setBorderWidthTop(0);
		}

		if (blnBOTTOM) {
			border.setBorderWidthBottom(BorderW);
		} else {
			border.setBorderWidthBottom(0);
		}
		
		
	}

	// PdfPTable에 Cell 을 추가하자
	private static void PT_addCell(PdfPTable table, String[] arrText,
			Font FontTitle, Rectangle border, int HA, int VA, int CS) {

		for (int i = 0; i < arrText.length; i++) {
			PT_addCell(table, arrText[i], FontTitle, border, HA, VA, CS);
		}
	}
	
	private static void PT_addCell(PdfPTable table, String[] arrText,
			Font FontTitle, Rectangle border, int HA, int VA, int CS, float RH, boolean CL) {		
		
		for (int i = 0; i < arrText.length; i++) {
			PT_addCell(table, arrText[i], FontTitle, border, HA, VA, CS, RH, CL);
		}
	}

	private static void PT_addCell(PdfPTable table, String strText,
			Font FontTitle, Rectangle border, int HA, int VA, int CS) {

		// 추가할 Cell 생성
		PdfPCell cell = PC_addCell(strText, FontTitle, border, HA, VA, CS);

		table.addCell(cell);
	}

	// PdfPTable에 Cell 을 추가하자(행높이 추가)
	private static void PT_addCell(PdfPTable table, String strText,
			Font FontTitle, Rectangle border, int HA, int VA, int CS, float RH, boolean CL) {
		
		// 추가할 Cell 생성
		PdfPCell cell = PC_addCell(strText, FontTitle, border, HA, VA, CS);
		// 셀 높이
		if (RH > 0)
			cell.setFixedHeight(RH);
		
		if (CL) {
			cell.setBackgroundColor(Color.lightGray);
		} else {
			cell.setBackgroundColor(Color.white);
		}
		table.addCell(cell);
	}
	
	public ValueObject getPayReqList(String tmpslipID ){
		Search search = new SearchImpl();
		ValueObject vo = null;
		RowSet rowSet = new RowSetImpl();
		StringBuffer  sql = new StringBuffer();
		
		try{
			
			sql.append("		   SELECT                                                                                                                                                                   \n");
			sql.append("		         DECODE(A.DOC_INSPECTION_REPORT , 'Y', 'V', '') DOC_INSPECTION_REPORT    --    첨부_INSPECTION REPORT                                                                                                            \n");
			sql.append("		        ,DECODE(A.DOC_CONFIRM , 'Y', 'V', '') DOC_CONFIRM   -- 첨부_납품확인서                                                                                                                                																					\n");
			sql.append("		        ,DECODE(A.DOC_FINAL_DOCUMENTS , 'Y', 'V', '') DOC_FINAL_DOCUMENTS   -- 첨부_FINAL DOCUMENTS 제출확인서                                                                                                        																	\n");
			sql.append("		        ,DECODE(A.DOC_GUAR_CONST , 'Y', 'V', '') DOC_GUAR_CONST    -- 첨부_계약이행보증보험증권                                                                                                                  																			\n");
			sql.append("		        ,DECODE(A.DOC_GUAR_AS, 'Y', 'V', '') DOC_GUAR_AS   -- 첨부_하자이행보증보험증권                                                                                                                     	 																		\n");
			sql.append("		        ,DECODE(A.DOC_WORKQA, 'Y', 'V', '') DOC_WORKQA    -- 첨부_기성검사보고서                                                                                                                             																				\n");
			sql.append("		        ,DECODE(A.DOC_SHIP, 'Y', 'V', '') DOC_SHIP    -- 첨부_선적서류(B/L,PACKING LIST)                                                                                                                   \n");
			sql.append("		        ,DECODE(A.DOC_COMPLETE, 'Y', 'V', '') DOC_COMPLETE    -- 첨부_준공검사보고서                                                                                                                           																				\n");
			sql.append("		        ,DECODE(A.DOC_CONST_COPY, 'Y', 'V', '') DOC_CONST_COPY    -- 첨부_계약서사본                                                                                                                             																				\n");
			sql.append("		        ,DECODE(A.DOC_ETC, 'Y', 'V', '') DOC_ETC    -- 첨부_기타                                                                                                                             																				\n");
			sql.append("		        ,DECODE(A.DOC_MC, 'Y', 'V', '') DOC_MC    -- M/C 완료확인서                                                                                                                             																				\n");
			sql.append("		        ,DECODE(A.DOC_TESTRUN, 'Y', 'V', '') DOC_TESTRUN    -- 첨부_시운행                                                                                                                             																				\n");
			sql.append("		        ,A.REQ_STATUS    -- 대금신청상태                                                                                                                                    																					\n");
			sql.append("		        ,A.TRANS_CD    -- 전표집계여부                                                                                                                                      																						\n");
			sql.append("		        ,A.PUR_CONT_ID    -- 발주계약ID                                                                                                                                     \n");
			sql.append("		        ,A.PAYREQ_ID    -- 지급신청ID                                                                                                                                       \n");
			sql.append("		        ,TO_CHAR(A.REQ_DATE, 'YYYY-MM-DD') REQ_DATE    -- 신청서작성일자                                                                                                    																\n");
			sql.append("		        ,A.REQ_CHARGE_ID    -- 신청서작성자ID                                                                                                                               	\n");
			sql.append("		        ,A.COOP_DEPT_CD    -- 협조부서코드                                                                                                                                  																					\n");
			sql.append("		        ,F_GET_D_CURRENCY( NVL( A.ORD_AMT, 0 ) , F_GET_CURRENCY_DIGIT( NVL( B.CURRENCY_GB, 'KRW' ) ) ) ORD_AMT    -- 총계약금액                                             								\n");
			sql.append("		        ,F_GET_PUR_STATUS(A.DEPOSIT_CD, 'PUR_PAY_ACMP_GB') || '(' || TO_NUMBER(A.DEPOSIT_SEQ) || '차)' DEPOSIT_GB   -- 지급구분이름											\n");
			sql.append("		        ,A.DEPOSIT_CD    -- 지급구분                                                                                                                                       																						\n");
			sql.append("		        ,A.DEPOSIT_SEQ    -- 지급차수                                                                                                                                       																						\n");
			sql.append("		        ,A.DEPOSIT_RESN    -- 지급사유                                                                                                                                      																						\n");
			sql.append("		        ,F_GET_D_CURRENCY( NVL( A.PAYED_AMT, 0 ) , F_GET_CURRENCY_DIGIT( NVL( B.CURRENCY_GB, 'KRW' ) ) ) PAYED_AMT     -- 기지불액                                          							\n");
			sql.append("		        ,F_GET_D_CURRENCY(A.PAYED_PERCENT, 1) PAYED_PERCENT     -- 기지불액비율                                                                                                                                 																					\n");
			sql.append("		        ,F_GET_D_CURRENCY( NVL( A.CUR_REQ_AMT, 0 ) , F_GET_CURRENCY_DIGIT( NVL( B.CURRENCY_GB, 'KRW' ) ) ) CUR_REQ_AMT    -- 금회청구액                                     						\n");
			sql.append("		        ,F_GET_D_CURRENCY(A.CUR_REQ_PERCENT, 1) CUR_REQ_PERCENT    -- 금회청구액비율                                                                                                                             																				\n");
			sql.append("		        ,F_GET_D_CURRENCY( NVL( A.CUR_PAYED_AMT, 0 ) , F_GET_CURRENCY_DIGIT( NVL( B.CURRENCY_GB, 'KRW' ) ) ) CUR_PAYED_AMT    -- 금회포함지불액                             					\n");
			sql.append("		        ,F_GET_D_CURRENCY(A.CUR_PAYED_PERCENT, 1) CUR_PAYED_PERCENT    -- 금회포함지불액비율                                                                                                                       																			\n");
			sql.append("		        ,F_GET_D_CURRENCY( NVL( A.REMAINDER_AMT, 0 ) , F_GET_CURRENCY_DIGIT( NVL( B.CURRENCY_GB, 'KRW' ) ) ) REMAINDER_AMT    -- 잔액                                       							\n");
			sql.append("		        ,F_GET_D_CURRENCY(A.REMAINDER_PERCENT , 1) REMAINDER_PERCENT    -- 잔액비율                                                                                                                                 																					\n");
			sql.append("		        ,F_GET_D_CURRENCY( NVL( A.BEF_ACMP_AMT, 0 ) , F_GET_CURRENCY_DIGIT( NVL( B.CURRENCY_GB, 'KRW' ) ) ) BEF_ACMP_AMT    -- 전기성고                                     						\n");
			sql.append("		        ,F_GET_D_CURRENCY(A.BEF_ACMP_PERCENT , 1) BEF_ACMP_PERCENT   -- 전기성고비율                                                                                                                              																				\n");
			sql.append("		        ,F_GET_D_CURRENCY( NVL( A.CUR_ACMP_AMT, 0 ) , F_GET_CURRENCY_DIGIT( NVL( B.CURRENCY_GB, 'KRW' ) ) ) CUR_ACMP_AMT    -- 금회기성고                                   						\n");
			sql.append("		        ,F_GET_D_CURRENCY(A.CUR_ACMP_PERCENT , 1) CUR_ACMP_PERCENT   -- 금회기성고비율                                                                                                                            																				\n");
			sql.append("		        ,F_GET_D_CURRENCY( NVL( A.CUR_BEF_ACMP_AMT, 0 ) , F_GET_CURRENCY_DIGIT( NVL( B.CURRENCY_GB, 'KRW' ) ) ) CUR_BEF_ACMP_AMT    -- 금회포함기성고                       				\n");
			sql.append("		        ,F_GET_D_CURRENCY(A.CUR_BEF_ACMP_PERCENT ,1) CUR_BEF_ACMP_PERCENT   -- 금회포함기성고비율                                                                                                                    																			\n");
			sql.append("		        ,F_GET_D_CURRENCY( NVL( A.REMAINDER_ACMP_AMT, 0 ) , F_GET_CURRENCY_DIGIT( NVL( B.CURRENCY_GB, 'KRW' ) ) ) REMAINDER_ACMP_AMT    -- 미기성고                         					\n");
			sql.append("		        ,F_GET_D_CURRENCY(A.REMAINDER_ACMP_PERCENT, 1) REMAINDER_ACMP_PERCENT    -- 미기성고비율                                                                                                                        																			\n");
			sql.append("		        ,F_GET_D_CURRENCY( NVL( A.CUR_PREPAY_DEDUCTAMT, 0 ) , F_GET_CURRENCY_DIGIT( NVL( B.CURRENCY_GB, 'KRW' ) ) ) CUR_PREPAY_DEDUCTAMT    -- 금회선급금 공제              			\n");
			sql.append("		        ,F_GET_D_CURRENCY(A.ACMP_APPLYRATE ,1) ACMP_APPLYRATE    -- 기성고적용 비율                                                                                                                             																				\n");
			sql.append("		        ,A.RE_MARKS    -- 특기사항                                                                                                                                          																						\n");
			sql.append("		        ,DECODE(A.DOC_PAYREQ, 'Y', 'V', '') DOC_PAYREQ   -- 첨부_대금청구서                                                                                                                                 																					\n");
			sql.append("		        ,DECODE(A.DOC_MRR, 'Y', 'V', '') DOC_MRR    -- 첨부_MRR                                                                                                                                           	\n");
			sql.append("		        ,DECODE(A.DOC_ITEMINPUTCONFIRM, 'Y', 'V', '') DOC_ITEMINPUTCONFIRM    -- 첨부_원자재입고확인서                                                                                                                 																		\n");
			sql.append("		        ,B.ORD_DOC_NO AS ORD_DOC_NO    -- 계약번호                                                                                                                          																				\n");
			sql.append("		        ,F_GET_USER_NM(A.REQ_CHARGE_ID) AS REQ_CHARGE_NAME    -- 작성자                                                                                                     																\n");
			sql.append("		        ,GET_ACC_DEPT_NM(A.COOP_DEPT_CD) AS COOP_DEPT_NM -- 협조부서명                                                                                                      																	\n");
			sql.append("		        ,B.CST_DOC_NAME AS CST_DOC_NAME    -- 계약명                                                                                                                       	 																		\n");
			sql.append("		        ,GET_CORP_NM(B.CORP_ID) AS CORP_NM     --계약업체명                                                                                                                 																		\n");
			sql.append("		        ,(SELECT REP_NAME FROM PUR9000T_V D WHERE D.CORP_ID = B.CORP_ID )    REP_NAME    -- 업체대표이사                                                                      												\n");
			sql.append("		        ,(SELECT CORP_REG_NO FROM PUR9000T_V D WHERE D.CORP_ID = B.CORP_ID )    CORP_REG_NO    -- 사업자번호                                                                  											\n");
			sql.append("		        ,B.DEPT_NAME AS DEPT_NM -- 현장명                                                                                                                                   																					\n");
			sql.append("		        ,C.DEPT_CD AS DEPT_CD -- 현장코드                                                                                                                                   																					\n");//2018.06.25 b
			sql.append("		        ,B.CURRENCY_GB -- 통화구분                                                                                                                                          																						\n");
			sql.append("		        ,F_GET_D_CURRENCY( F_PUR_AMT_SUM(A.PUR_CONT_ID, '1')                                                    												\n");
			sql.append("		               					 , F_GET_CURRENCY_DIGIT( NVL( B.CURRENCY_GB, 'KRW' ) ) )   AS PREPAY_ACMP_AMT    --기선급공제액     											\n");
			sql.append("		        ,F_GET_D_CURRENCY( NVL(B.PREPAY_AMT , 0) , F_GET_CURRENCY_DIGIT( NVL( B.CURRENCY_GB, 'KRW' ) ) ) PREPAY_AMT --선급금액                                                                                                                      \n");
			sql.append("				,F_GET_D_CURRENCY(  PREPAY_AMT - F_PUR_AMT_SUM(A.PUR_CONT_ID, '1')																						\n"); 
			sql.append("       									, F_GET_CURRENCY_DIGIT( NVL( B.CURRENCY_GB, 'KRW' ) ) ) PREPAY_RMDR		--선급잔액															\n"); 
			sql.append("		        ,F_GET_D_CURRENCY( NVL( A.CUR_REQ_VATAMT, 0 ) , F_GET_CURRENCY_DIGIT( NVL( B.CURRENCY_GB, 'KRW' ) ) ) CUR_REQ_VATAMT                                                \n");
			sql.append("		        ,F_GET_D_CURRENCY( NVL( A.CUR_PAYING_AMT, 0 ) , F_GET_CURRENCY_DIGIT( NVL( B.CURRENCY_GB, 'KRW' ) ) ) CUR_PAYING_AMT                                                \n");
			sql.append("		        ,(SELECT CHG_CODE10 FROM COM911T WHERE DETAILCD = B.GUA_GB AND BASECD = 'PROOF_CD') VAT_STATUS                                                                           \n");
			sql.append("		        FROM    PUR1100T A    , PUR1000T B , PUR1040T C                                                                                                                     \n");
			sql.append("		        WHERE    A.PUR_CONT_ID = B.PUR_CONT_ID                                                                                                                              \n");
			sql.append("		        AND     C.PAYREQ_ID = A.PAYREQ_ID                                                                                                                                   \n");
			sql.append("		        AND     C.TMPSLIP_ID = "+tmpslipID+"																																\n");										
			search.setStatement(sql.toString());
			
			rowSet = search.execute();
			
			if(rowSet.size()>0){
				vo = RowSetUtility.getValueObject(rowSet.getRow(0));
			}
			
		}catch(Exception e){
			WAFLogger.error("SQL : " + search.getStatement());
            WAFLogger.error(e);
		}finally{
			if( vo == null) vo = new ValueObject();
		}
		return vo;
		
		
	}

	public ValueObject getPayReqList1(Connection con, String tmpslipID ){

		Search search = new SearchImpl();
		ValueObject vo = null;
		RowSet rowSet = new RowSetImpl();
		StringBuffer  sql = new StringBuffer();
		Persistent persistent_c = null;
		
		try{
			
			persistent_c = new PersistentImpl(con);
			
			sql.append("		   SELECT                                                                                                                                                                   \n");
			sql.append("		         DECODE(B.DOC_INSPECTION_REPORT , 'Y', 'V', '') DOC_INSPECTION_REPORT    --    첨부_INSPECTION REPORT                                                                                                            \n");
			sql.append("		         ,DECODE(B.DOC_PAYREQ , 'Y', 'V', '') DOC_PAYREQ   -- 첨부_대금청구서                                                                                                            \n");
			sql.append("		         ,DECODE(B.DOC_MRR , 'Y', 'V', '') DOC_MRR   -- 첨부_MRR	                                                                                                            \n");
			sql.append("		         ,DECODE(B.DOC_CONFIRM , 'Y', 'V', '') DOC_CONFIRM   -- 첨부_납품확인서                                                                                                            \n");
			sql.append("		         ,DECODE(B.DOC_FINAL_DOCUMENTS , 'Y', 'V', '') DOC_FINAL_DOCUMENTS   -- 첨부_FINAL DOCUMENTS 제출확인서                                                                                                            \n");
			sql.append("		         ,DECODE(B.DOC_GUAR_CONST , 'Y', 'V', '') DOC_GUAR_CONST    -- 첨부_계약이행보증보험증권                                                                                                            \n");
			sql.append("		         ,DECODE(B.DOC_GUAR_AS, 'Y', 'V', '') DOC_GUAR_AS   -- 첨부_하자이행보증보험증권                                                                                                           \n");
			sql.append("		         ,DECODE(B.DOC_WORKQA, 'Y', 'V', '') DOC_WORKQA    -- 첨부_기성검사보고서                                                                                                            \n");
			sql.append("		         ,DECODE(B.DOC_SHIP, 'Y', 'V', '') DOC_SHIP    -- 첨부_선적서류(B/L,PACKING LIST)                                                                                                            \n");
			sql.append("		         ,DECODE(B.DOC_COMPLETE, 'Y', 'V', '') DOC_COMPLETE    -- 첨부_준공검사보고서                                                                                                            \n");
			sql.append("		         ,DECODE(B.DOC_CONST_COPY, 'Y', 'V', '') DOC_CONST_COPY    -- 첨부_계약서사본                                                                                                            \n");
			sql.append("		         ,DECODE(B.DOC_ETC, 'Y', 'V', '') DOC_ETC    -- 첨부_기타                                                                                                            \n");
			sql.append("		         ,DECODE(B.DOC_MC, 'Y', 'V', '') DOC_MC    -- M/C 완료확인서                                                                                                            \n");
			sql.append("		         ,DECODE(B.DOC_TESTRUN, 'Y', 'V', '') DOC_TESTRUN    -- 첨부_시운행                                                                                                            \n");
			sql.append("		         ,B.REQ_STATUS    -- 대금신청상태                                                                                                            \n");
			sql.append("		         ,B.TRANS_CD    -- 전표집계여부                                                                                                            \n");
			sql.append("		         ,B.PUR_CONT_ID    -- 발주계약ID                                                                                                            \n");
			sql.append("		         ,B.PAYREQ_ID    -- 지급신청ID                                                                                                            \n");
			sql.append("		         ,TO_CHAR(TO_DATE(B.TAX_DY), 'YYYY-MM-DD') REQ_DATE    -- 신청서작성일자                                                                                                            \n");
			sql.append("		         ,B.REQ_CHARGE_ID    -- 신청서작성자ID                                                                                                           \n");
			sql.append("		         ,(SELECT USER_NAME FROM PUB0120T WHERE ACCT_ID = B.CRE_BY) AS REQ_CHARGE_NAME    -- 작성자    \n");
			sql.append("		         ,B.COOP_DEPT_CD    -- 협조부서코드                                                                                                            \n");
			sql.append("		         ,F_GET_D_CURRENCY( NVL( B.ORD_AMT, 0 ) , F_GET_CURRENCY_DIGIT( NVL( A.CURRENCY_GB, 'KRW' ))) AS ORD_AMT    -- 발주계약금액                                                                                                            \n");
			sql.append("		         ,F_GET_PUR_STATUS(B.DEPOSIT_CD, 'PUR_PAY_ACMP_GB') || '(' || TO_NUMBER(B.DEPOSIT_SEQ) || '차)' DEPOSIT_GB   -- 지급구분이름                                                                                                           \n");
			sql.append("		         ,B.DEPOSIT_CD    -- 지급구분                                                                                                            \n");
			sql.append("		         ,B.DEPOSIT_SEQ    -- 지급차수                                                                                                            \n");
			sql.append("		         ,B.DEPOSIT_RESN    -- 지급사유                                                                                                            \n");
			sql.append("		         ,F_GET_D_CURRENCY( NVL( B.PAYED_APPLYAMT, 0 ) , F_GET_CURRENCY_DIGIT( NVL( A.CURRENCY_GB, 'KRW' ))) as PAYED_AMT       --기지불액                                                                                                            \n");
			sql.append("		         ,F_GET_D_CURRENCY(B.PAYED_PERCENT, 1) PAYED_PERCENT     -- 기지불액비율                                                                                                            \n");
			sql.append("		         ,F_GET_D_CURRENCY( NVL( B.CUR_REQ_AMT, 0 ) , F_GET_CURRENCY_DIGIT( NVL( A.CURRENCY_GB, 'KRW' ))) as CUR_REQ_AMT       --금회청구액                                                                                                            \n");
			sql.append("		         ,F_GET_D_CURRENCY(B.CUR_REQ_PERCENT, 1) CUR_REQ_PERCENT    -- 금회청구액비율                                                                                                            \n");
			sql.append("		         ,F_GET_D_CURRENCY( NVL( B.CUR_PAYED_SUPPLYAMT, 0 ) , F_GET_CURRENCY_DIGIT( NVL( A.CURRENCY_GB, 'KRW' ))) as CUR_PAYED_AMT   --금회포함지불액                                                                                                            \n");
			sql.append("		         ,F_GET_D_CURRENCY(B.CUR_PAYED_PERCENT, 1) CUR_PAYED_PERCENT    -- 금회포함지불액비율                                                                                                            \n");
			sql.append("		         ,F_GET_D_CURRENCY( NVL( B.REMAINDER_ACMP_SUPPLYAMT, 0 ) , F_GET_CURRENCY_DIGIT( NVL( A.CURRENCY_GB, 'KRW' ))) as  REMAINDER_AMT  -- 잔액                                                                                                            \n");
			sql.append("		         ,F_GET_D_CURRENCY(B.REMAINDER_ACMP_PERCENT , 1) REMAINDER_PERCENT    -- 잔액비율                                                                                                            \n");
			sql.append("		         ,F_GET_D_CURRENCY( NVL( B.BEF_ACMP_APPLYAMT, 0 ) , F_GET_CURRENCY_DIGIT( NVL( A.CURRENCY_GB, 'KRW' ))) as  BEF_ACMP_AMT --전기성고                                                                                                            \n");
			sql.append("		         ,F_GET_D_CURRENCY(B.BEF_ACMP_PERCENT , 1) BEF_ACMP_PERCENT   -- 전기성고비율                                                                                                            \n");
			sql.append("		         ,F_GET_D_CURRENCY( NVL( B.CUR_ACMP_APPLYAMT, 0 ) , F_GET_CURRENCY_DIGIT( NVL( A.CURRENCY_GB, 'KRW' ))) as CUR_ACMP_AMT -- 금회기성고                                                                                                            \n");
			sql.append("		         ,F_GET_D_CURRENCY(B.CUR_ACMP_PERCENT , 1) CUR_ACMP_PERCENT   -- 금회기성고비율                                                                                                            \n");
			sql.append("		         ,F_GET_D_CURRENCY( NVL( B.CUR_BEF_ACMP_SUPPLYAMT, 0 ) , F_GET_CURRENCY_DIGIT( NVL( A.CURRENCY_GB, 'KRW' ))) as CUR_BEF_ACMP_AMT  -- 금회포함기성고                                                                                                            \n");
			sql.append("		         ,F_GET_D_CURRENCY(B.CUR_BEF_ACMP_PERCENT ,1) CUR_BEF_ACMP_PERCENT   -- 금회포함기성고비율                                                                                                            \n");
			sql.append("		         ,F_GET_D_CURRENCY( NVL( B.REMAINDER_ACMP_SUPPLYAMT, 0 ) , F_GET_CURRENCY_DIGIT( NVL( A.CURRENCY_GB, 'KRW' ))) as REMAINDER_ACMP_AMT -- 미기성고                                                                                                            \n");
			sql.append("		         ,F_GET_D_CURRENCY(B.REMAINDER_ACMP_PERCENT, 1) REMAINDER_ACMP_PERCENT    -- 미기성고비율                                                                                                            \n");
			sql.append("		         ,F_GET_D_CURRENCY( NVL( B.CUR_PREPAY_DEDUCTAMT, 0 ) , F_GET_CURRENCY_DIGIT( NVL( A.CURRENCY_GB, 'KRW' ) ) ) AS CUR_PREPAY_DEDUCTAMT    -- 금회선급금 공제                                                                                                            \n");
			sql.append("		         ,F_GET_D_CURRENCY(B.ACMP_APPLYRATE ,1) ACMP_APPLYRATE    -- 기성고적용 비율                                                                                                            \n");
			sql.append("		         ,B.RE_MARKS    -- 특기사항                                                                                                           \n");
			sql.append("		         ,A.ORD_DOC_NO AS ORD_DOC_NO    -- 계약번호                                                                                                            \n");
			sql.append("		         ,GET_ACC_DEPT_NM(B.COOP_DEPT_CD) AS COOP_DEPT_NM -- 협조부서명                                                                                                            \n");
			sql.append("		         ,A.CST_DOC_NAME AS CST_DOC_NAME    -- 계약명                                                                                                            \n");
			sql.append("		         ,GET_CORP_NM(C.DEALR_CD) AS CORP_NM     --계약업체명                                                                                                            \n");
			sql.append("		         ,(SELECT REP_NAME FROM PUR9000T_V D WHERE D.CORP_ID = C.DEALR_CD )    REP_NAME    -- 업체대표이사                                                                                                           \n");
			sql.append("		         ,(SELECT CORP_REG_NO FROM PUR9000T_V D WHERE D.CORP_ID = C.DEALR_CD )    CORP_REG_NO    -- 사업자번호                                                                                                           \n");
			sql.append("		         ,A.DEPT_NAME AS DEPT_NM -- 현장명                                                                                                            \n");
			sql.append("		         ,A.DEPT_CD AS DEPT_CD -- 현장코드                                                                                                            \n");
			sql.append("		         ,A.CURRENCY_GB -- 통화구분                                                                                                            \n");
			sql.append("		         ,F_GET_D_CURRENCY( NVL( B.BEF_PREPAY_APPLYAMT , 0 ) , F_GET_CURRENCY_DIGIT( NVL( A.CURRENCY_GB, 'KRW' ))) AS PREPAY_ACMP_AMT    --기선급공제액                                                                                                            \n");
			sql.append("		         ,F_GET_D_CURRENCY( NVL( (SELECT SUM(REQ_PREPAY_SUPPLY_AMT) FROM PUR1030T WHERE PUR_CONT_ID = B.PUR_CONT_ID GROUP BY PUR_CONT_ID), 0 ) , F_GET_CURRENCY_DIGIT( NVL( A.CURRENCY_GB, 'KRW' ))) AS PREPAY_AMT --선급금액                                                                                                            \n");
			sql.append("		         ,F_GET_D_CURRENCY( NVL( B.REMAINDER_PREPAY_SUPPLYAMT , 0 ) , F_GET_CURRENCY_DIGIT( NVL( A.CURRENCY_GB, 'KRW' ))) AS  PREPAY_RMDR        --선급잔액                                                                                                            \n");
			sql.append("		         ,F_GET_D_CURRENCY( NVL( B.CUR_REQ_VATAMT, 0 ) , F_GET_CURRENCY_DIGIT( NVL( A.CURRENCY_GB, 'KRW' ) ) ) CUR_REQ_VATAMT                                                                                                            \n");
			sql.append("		         ,F_GET_D_CURRENCY( NVL( B.CUR_PAYING_AMT, 0 ) , F_GET_CURRENCY_DIGIT( NVL( A.CURRENCY_GB, 'KRW' ) ) ) CUR_PAYING_AMT                                                                                                            \n");
			sql.append("		         ,(SELECT CHG_CODE10 FROM EBID_COM911T WHERE DETAILCD = A.GUA_GB AND BASECD = 'PROOF_CD') VAT_STATUS                                                                                                            \n");
			sql.append("		         ,F_GET_D_CURRENCY( NVL( B.CUR_PREPAY_APPLYAMT , 0 ) , F_GET_CURRENCY_DIGIT( NVL( A.CURRENCY_GB, 'KRW' )))  CUR_PREPAY_APPLYAMT --금회선급공제액                                                                                                           \n");
			sql.append("		         ,F_GET_D_CURRENCY( NVL( B.BEF_PREPAY_APPLYAMT , 0 ) + NVL(B.CUR_PREPAY_APPLYAMT ,0), F_GET_CURRENCY_DIGIT( NVL( A.CURRENCY_GB, 'KRW' )))  CUR_PREPAY_APPLYAMT1 --금회선급공제액                                                                                                           \n");
			sql.append("		         ,(SELECT DETAILSORTNM FROM EBID_COM911T WHERE BASECD = '004' AND DETAILCD = B.PAYMENT_TERMS) PAYMENT_TERMS --지급조건                                                                                                           \n");
			sql.append("		  FROM PUR2000T A,                                                                                                            \n");
			sql.append("		       PUR1100T B,                                                                                                           \n");
			sql.append("		       PUR1040T C                                                                                                             \n");
			sql.append("		  WHERE 1=1                                                                                                                  \n");
			sql.append("		  AND A.PUR_CONT_MOD_ID = B.PUR_CONT_MOD_ID                                                                                                   \n");
			sql.append("		  AND C.PAYREQ_ID = B.PAYREQ_ID                                                                                                            \n");
			sql.append("		  AND C.TMPSLIP_ID = "+tmpslipID+"                                                                                                             \n");
			
			persistent_c.setStatement(sql.toString()); 
			System.out.println(sql.toString());
			rowSet = persistent_c.query();
			
			if(rowSet.size()>0){
				vo = RowSetUtility.getValueObject(rowSet.getRow(0));
			}
			
		}catch(Exception e){
			WAFLogger.error("SQL : " + search.getStatement());
            WAFLogger.error(e);
		}finally{
			if( vo == null) vo = new ValueObject();
		}
		return vo;
		
		
	}

	/*
	 * ===========================================================================================
	 * A. 구매 선급금 증빙 작성
	 * ===========================================================================================
	 */
	
	public void doBizBuyPre(Connection con, OutputStream outputStream, String tmpslipID,  HttpServletRequest request) {
		 
        WAFLogger.debug("\n\t #################### 구매 선급금 시작");
        
		// step 1
		Document document = new Document(PageSize.A4, 25f, 25f, 35f, 10f);
  
		try {
	 
    		// step 2
  			PdfWriter writer = PdfWriter.getInstance(document, outputStream);

			// step 3
			document.open();

			BaseFont bfKorean = BaseFont.createFont("HYGoThic-Medium", "UniKS-UCS2-H", BaseFont.NOT_EMBEDDED);

			Font FontTitle = new Font(bfKorean, 8, Font.NORMAL);
			FontTitle.setColor(borderColor);

			Font FontData = new Font(bfKorean, 4.8f, Font.NORMAL);
			Font FontTitle2 = new Font(bfKorean, 20, Font.BOLD);

			PdfPTable table = null;
			PdfPCell cell = null;

			/*
			 * 정보 검색 시작 ---------------------------------------------
			 */
			
			ValueObject params = new ValueObject();
			HandlerStorage storage = new HandlerStorage();
			storage.setParams(params);
			
			ValueObject listRowSet = null;
			/*
			 * 정보 검색 시작 ---------------------------------------------
			 */
			
			listRowSet = getBuyPreList(con, tmpslipID);
			
			// 정보 검색 끝 ---------------------------------------------
			
			/*
			 * ===========================================================================================
			 * 제목 생성
			 * ===========================================================================================
			 */
			makeTitle_1(document, FontTitle, FontTitle2,  request);

			//본문생성
			setBorder(border, true, true, true, true);
			
			
            //1행
		    PdfPTable table11 = new PdfPTable(6);
		    table11.setWidthPercentage(100);
		    table11.setSpacingBefore(7f);
		    table11.setSpacingAfter(7f);
            float[] table11Width = {15f,3f,27f,3f,27f,30f};
            table11.setWidths(table11Width);
            
          
            // 1행
            PT_addCell(table11, new String [] { "계약번호" }, FontTitle, border,	Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,true);
            PT_addCell(table11, listRowSet.get("ORD_DOC_NO"), FontTitle, border,Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 2, 20f ,false);
            PT_addCell(table11, new String [] { "작성일자" }, FontTitle, border,	Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 2, 20f ,true);          
            PT_addCell(table11, listRowSet.get("REQ_DATE"), FontTitle, border,	Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 20f,false);
                       
            PT_addCell(table11, new String [] { "현장코드" }, FontTitle, border,   		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,true);          
		    PT_addCell(table11, listRowSet.get("DEPT_CD"), FontTitle, border,   		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 2, 20f,false);
		    PT_addCell(table11, new String [] { "통화" }, FontTitle, border,	    		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 2, 20f ,true);          
		    PT_addCell(table11, listRowSet.get("CURRENCY_GB"), FontTitle, border,  		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f,false);
            
            PT_addCell(table11, new String [] { "현장명" }, FontTitle, border,      		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,true);
		    PT_addCell(table11, listRowSet.get("DEPT_NM"), FontTitle, border,   		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 5, 20f ,false);
		    
            PT_addCell(table11, new String [] { "계약명" }, FontTitle, border,      		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,true);
            PT_addCell(table11, listRowSet.get("CST_DOC_NAME"), FontTitle, border, 		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 5, 20f ,false);
            
            PT_addCell(table11, new String [] { "계약업체명" }, FontTitle, border,   		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,true);
            PT_addCell(table11, listRowSet.get("CORP_NM"), FontTitle, border,      		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 2, 20f ,false);
            PT_addCell(table11, new String [] { "대표이사" }, FontTitle, border,     		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 2, 20f ,true);          
            PT_addCell(table11, listRowSet.get("REP_NAME"), FontTitle, border,     		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f,false);
                       
            PT_addCell(table11, new String [] { "총계약금액" }, FontTitle, border,   		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,true);
            PT_addCell(table11, listRowSet.get("ORD_AMT"), FontTitle, border,      		Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 2, 20f ,false);
            PT_addCell(table11, new String [] { "선급금액" }, FontTitle, border,     		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 2, 20f ,true);          
            PT_addCell(table11, listRowSet.get("PAYED_AMT"), FontTitle, border,   		Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 20f,false);
            
            PT_addCell(table11, new String [] { "선급공급가" }, FontTitle, border,   		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,true);
            PT_addCell(table11, listRowSet.get("CUR_REQ_AMT"), FontTitle, border,      	Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 2, 20f ,false);
            PT_addCell(table11, new String [] { "선급부가세" }, FontTitle, border,   		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 2, 20f ,true);          
            PT_addCell(table11, listRowSet.get("CUR_PAYED_AMT"), FontTitle, border,   	Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 20f,false);

            PT_addCell(table11, new String [] { "지급구분" }, FontTitle, border,     		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,true);
            PT_addCell(table11, listRowSet.get("DEPOSIT_GB"), FontTitle, border,   		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 2, 20f ,false);
            PT_addCell(table11, new String [] { "신청선급금" }, FontTitle, border,   		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 2, 20f ,true);          
            PT_addCell(table11, listRowSet.get("REMAINDER_AMT"), FontTitle, border,   	Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 20f,false);

            PT_addCell(table11, new String [] { "신청선급공급가" }, FontTitle, border,    Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,true);
            PT_addCell(table11, listRowSet.get("BEF_ACMP_AMT"), FontTitle, border,   	Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 2, 20f ,false);
            PT_addCell(table11, new String [] { "신청선급부가세" }, FontTitle, border,   	Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 2, 20f ,true);          
            PT_addCell(table11, listRowSet.get("CUR_ACMP_AMT"), FontTitle, border,   	Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 20f,false);
            
            document.add(table11);
            
		} catch (DocumentException de) {
			WAFLogger.debug("de.getMessage() = " + de.getMessage());
		} catch (IOException ioe) {
			WAFLogger.debug("ioe.getMessage() = " + ioe.getMessage());
		} catch (Exception e) {
			WAFLogger.debug("[Exception] ... " + e);
		}

		// step 5
		document.close();
		WAFLogger.debug("\n\t #################### "+ strFileName +" 생성완료");
	}

	public void doBizBuyPre1(Connection con, OutputStream outputStream, String tmpslipID,  HttpServletRequest request) {
		 
        WAFLogger.debug("\n\t #################### 구매 대금지급생성 시작");
        
		// step 1
		Document document = new Document(PageSize.A4, 25f, 25f, 35f, 10f);
  
		try {
	 
    		// step 2
  			PdfWriter writer = PdfWriter.getInstance(document, outputStream);

			// step 3
			document.open();

			BaseFont bfKorean = BaseFont.createFont("HYGoThic-Medium", "UniKS-UCS2-H", BaseFont.NOT_EMBEDDED);

			Font FontTitle = new Font(bfKorean, 8, Font.NORMAL);
			FontTitle.setColor(borderColor);

			Font FontData = new Font(bfKorean, 4.8f, Font.NORMAL);
			Font FontTitle2 = new Font(bfKorean, 20, Font.BOLD);

			PdfPTable table = null;
			PdfPCell cell = null;

			/*
			 * 정보 검색 시작 ---------------------------------------------
			 */
			
			ValueObject params = new ValueObject();
			HandlerStorage storage = new HandlerStorage();
			storage.setParams(params);
			
			ValueObject listRowSet = null;
			/*
			 * 정보 검색 시작 ---------------------------------------------
			 */
			
			listRowSet = getPayReqList11(con, tmpslipID);
			
			// 정보 검색 끝 ---------------------------------------------
			
			/*
			 * ===========================================================================================
			 * 제목 생성
			 * ===========================================================================================
			 */
			makeTitle(document, FontTitle, FontTitle2,  request);

			//본문생성
			setBorder(border, true, true, true, true);
			
			
            //1행
		    PdfPTable table11 = new PdfPTable(4);
		    table11.setWidthPercentage(100);
		    table11.setSpacingBefore(7f);
		    table11.setSpacingAfter(7f);
            float[] table11Width = {15f,40f,15f,15f};
            table11.setWidths(table11Width);
            
          
            
            // 1행
            PT_addCell(table11, new String [] { "현장" }, FontTitle, border,
    				Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 30f ,false);
            PT_addCell(table11, "  " + "(" + listRowSet.get("DEPT_CD") + ")" + listRowSet.get("DEPT_NM") , FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 3, 30f ,false);
 
            PT_addCell(table11, new String [] { "발주처" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 30f ,false);
            PT_addCell(table11, "  " +listRowSet.get("DEALRER_NM"), FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 3, 30f ,false);
            
            PT_addCell(table11, new String [] { "계약번호" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 30f ,false);          
            PT_addCell(table11, "  " +listRowSet.get("CON_DOC_NO"), FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 30f,false);
            PT_addCell(table11, new String [] { "계약일자" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 30f ,false);          
            PT_addCell(table11, "  " +listRowSet.get("CON_DATE"), FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 30f,false);
            
            PT_addCell(table11, new String [] { "계약명" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 30f ,false);
            PT_addCell(table11, "  " +listRowSet.get("BUILD_NAME"), FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 3, 30f ,false);

            PT_addCell(table11, new String [] { "원도급공사명" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 30f ,false);          
            PT_addCell(table11, "  " +listRowSet.get("UND_CON_NAME"), FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 3, 30f,false);
            
            PT_addCell(table11, new String [] { "하도급공사명" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 30f ,false);          
            PT_addCell(table11, "  " +listRowSet.get("SUB_UND_CON_NAME"), FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 3, 30f,false);
            
            PT_addCell(table11, new String [] { "공사장소" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 30f ,false);
            PT_addCell(table11, "  " +listRowSet.get("WORK_PLACE"), FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 3, 30f ,false);
            
            PT_addCell(table11, new String [] { "공사기간" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 30f ,false);
            PT_addCell(table11, "  " +listRowSet.get("WORK_DATE"), FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 3, 30f ,false);

            PT_addCell(table11, new String [] { "계약금액" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 90f ,false);
            
            
            PdfPTable table21 = new PdfPTable(4);
            float[] table21Width = {13f,25f,5f,25f};
            table21.setWidths(table21Width);
            PdfPCell permission = new PdfPCell(table21);
            setBorder(border, false, false, false, false);
            
            
            
            
            PT_addCell(table21, new String [] { "합   계 :" }, FontTitle, border,
            		Element.ALIGN_MIDDLE, Element.ALIGN_MIDDLE, 1, 30f ,false);          
            if(listRowSet.get("con_amt").equals("0")){ 
            	PT_addCell(table21,  "일금" + PCMSUtil.toHangule_decimal("0"), FontTitle, border,
            			Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);          
            	PT_addCell(table21, new String [] { "원정" }, FontTitle, border,
            			Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 30f ,false);          
            	PT_addCell(table21, "(" + "￦" + PCMSUtil.convertFloor(listRowSet.getDouble("con_amt"), 0) +  "원정"  +  ")", FontTitle, border,
            			Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);          
            }else{ 
            	PT_addCell(table21,  "일금"  + PCMSUtil.toHangule_decimal(PCMSUtil.convertFloor(listRowSet.getDouble("con_amt"), 0).toString()), FontTitle, border,
            			Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);          
            	PT_addCell(table21, new String [] { "원정" }, FontTitle, border,
            			Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 30f ,false);          
            	PT_addCell(table21,"(" + "￦" + PCMSUtil.convertFloor(listRowSet.getDouble("con_amt"), 0) +  "원정"  +  ")", FontTitle, border,
            			Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);          
			} 

            PT_addCell(table21, new String [] { "공급가 :" }, FontTitle, border,
            		Element.ALIGN_MIDDLE, Element.ALIGN_MIDDLE, 1, 30f ,false);          
            if(listRowSet.get("con_supply_amt").equals("0")){ 
            	PT_addCell(table21,  "일금"  +  PCMSUtil.toHangule_decimal("0"), FontTitle, border,
            			Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);          
            	PT_addCell(table21, new String [] { "원정" }, FontTitle, border,
            			Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 30f ,false);          
            	PT_addCell(table21, "(" + "￦" + PCMSUtil.convertFloor(listRowSet.getDouble("con_supply_amt"), 0) +  "원정"  +  ")", FontTitle, border,
            			Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);          
            }else{ 
            	PT_addCell(table21, "일금"  +  PCMSUtil.toHangule_decimal(PCMSUtil.convertFloor(listRowSet.getDouble("con_supply_amt"), 0).toString()), FontTitle, border,
            			Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);          
            	PT_addCell(table21, new String [] { "원정" }, FontTitle, border,
            			Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 30f ,false);          
            	PT_addCell(table21, "(" +  "￦" + PCMSUtil.convertFloor(listRowSet.getDouble("con_supply_amt"), 0) + "원정" +  ")", FontTitle, border,
            			Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);          
            } 
            
            PT_addCell(table21, new String [] { "- 과세 :" }, FontTitle, border,
            		Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);          
            if(listRowSet.get("con_supply_tamt").equals("0")){ 
            	PT_addCell(table21,  "일금"  +  PCMSUtil.toHangule_decimal("0"), FontTitle, border,
            			Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);          
            	PT_addCell(table21, new String [] { "원정" }, FontTitle, border,
            			Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 30f ,false);          
            	PT_addCell(table21, "(" + "￦" + PCMSUtil.convertFloor(listRowSet.getDouble("con_supply_tamt"), 0) +  "원정"  +  ")", FontTitle, border,
            			Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);          
            }else{ 
            	PT_addCell(table21, "일금"  +  PCMSUtil.toHangule_decimal(PCMSUtil.convertFloor(listRowSet.getDouble("con_supply_tamt"), 0).toString()), FontTitle, border,
            			Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);          
            	PT_addCell(table21, new String [] { "원정" }, FontTitle, border,
            			Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 30f ,false);          
            	PT_addCell(table21, "(" +  "￦" + PCMSUtil.convertFloor(listRowSet.getDouble("con_supply_tamt"), 0) + "원정" +  ")", FontTitle, border,
            			Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);          
            } 
            
            PT_addCell(table21, new String [] { "- 면세 :" }, FontTitle, border,
            		Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);          
            if(listRowSet.get("con_supply_namt").equals("0")){ 
            	PT_addCell(table21,  "일금"  +  PCMSUtil.toHangule_decimal("0"), FontTitle, border,
            			Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);          
            	PT_addCell(table21, new String [] { "원정" }, FontTitle, border,
            			Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 30f ,false);          
            	PT_addCell(table21, "(" + "￦" + PCMSUtil.convertFloor(listRowSet.getDouble("con_supply_namt"), 0) +  "원정"  +  ")", FontTitle, border,
            			Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);          
            }else{ 
            	PT_addCell(table21, "일금"  +  PCMSUtil.toHangule_decimal(PCMSUtil.convertFloor(listRowSet.getDouble("con_supply_namt"), 0).toString()), FontTitle, border,
            			Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);          
            	PT_addCell(table21, new String [] { "원정" }, FontTitle, border,
            			Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 30f ,false);          
            	PT_addCell(table21, "(" +  "￦" + PCMSUtil.convertFloor(listRowSet.getDouble("con_supply_namt"), 0) + "원정" +  ")", FontTitle, border,
            			Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);          
            } 
            
            PT_addCell(table21, new String [] { "부가세 :" }, FontTitle, border,
            		Element.ALIGN_MIDDLE, Element.ALIGN_MIDDLE, 1, 30f ,false);          
            if(listRowSet.get("con_surtax_amt").equals("0")){ 
            	PT_addCell(table21, "일금"  + PCMSUtil.toHangule_decimal("0") +  listRowSet.get("con_cur_won"), FontTitle, border,
            			Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);          
            	PT_addCell(table21, new String [] { "원정" }, FontTitle, border,
            			Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 30f ,false);          
            	PT_addCell(table21,  "(" + "￦" + PCMSUtil.convertFloor(listRowSet.getDouble("con_surtax_amt"), 0) +  "원정"  +  ")", FontTitle, border,
            			Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);          
            }else{ 
            	PT_addCell(table21, "일금"  + PCMSUtil.toHangule_decimal(PCMSUtil.convertFloor(listRowSet.getDouble("con_surtax_amt"), 0).toString()) , FontTitle, border,
            			Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);          
            	PT_addCell(table21, new String [] { "원정" }, FontTitle, border,
            			Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 30f ,false);          
            	PT_addCell(table21,   "(" + "￦"+ PCMSUtil.convertFloor(listRowSet.getDouble("con_surtax_amt"), 0) +  "원정"  +  ")", FontTitle, border,
            			Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);          
            } 

            permission.setColspan(3);
            table11.addCell(permission);
            setBorder(border, true, true, true, true);
            
            PT_addCell(table11, new String [] { "선급금" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 90f ,false);
            
            
            PdfPTable table31 = new PdfPTable(4);
            float[] table31Width = {13f,25f,5f,25f};
            table31.setWidths(table31Width);
            PdfPCell permission2 = new PdfPCell(table31);
            setBorder(border, false, false, false, false);
            
            PT_addCell(table31, new String [] { "합   계 :" }, FontTitle, border,
            		Element.ALIGN_MIDDLE, Element.ALIGN_MIDDLE, 1, 30f ,false);          
            if(listRowSet.get("req_amt").equals("0")){ 
            	PT_addCell(table31,  "일금"  + PCMSUtil.toHangule_decimal("0"), FontTitle, border,
            			Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false); 
            	PT_addCell(table31, new String [] { "원정" }, FontTitle, border,
            			Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 30f ,false); 
            	PT_addCell(table31, "(" + "￦" + PCMSUtil.convertFloor(listRowSet.getDouble("req_amt"), 0) + "원정"  +  ")", FontTitle, border,
            			Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);          
            }else{ 
            	PT_addCell(table31,  "일금"  + PCMSUtil.toHangule_decimal(PCMSUtil.convertFloor(listRowSet.getDouble("req_amt"), 0).toString()) , FontTitle, border,
            			Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);          
            	PT_addCell(table31, new String [] { "원정" }, FontTitle, border,
            			Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 30f ,false); 
            	PT_addCell(table31, "(" + "￦" + PCMSUtil.convertFloor(listRowSet.getDouble("req_amt"), 0) +  "원정"  +  ")", FontTitle, border,
            			Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);          
            } 
            
            PT_addCell(table31, new String [] { "공급가 :" }, FontTitle, border,
            		Element.ALIGN_MIDDLE, Element.ALIGN_MIDDLE, 1, 30f ,false);          
            if(listRowSet.get("supply_amt").equals("0")){ 
            	PT_addCell(table31, "일금"  + PCMSUtil.toHangule_decimal("0"), FontTitle, border,
            			Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);          
            	PT_addCell(table31, new String [] { "원정" }, FontTitle, border,
            			Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 30f ,false); 
            	PT_addCell(table31, "(" + "￦" + PCMSUtil.convertFloor(listRowSet.getDouble("supply_amt"), 0)+  "원정" +  ")", FontTitle, border,
            			Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);          
            }else{ 
            	PT_addCell(table31,  "일금"  + PCMSUtil.toHangule_decimal(PCMSUtil.convertFloor(listRowSet.getDouble("supply_amt"), 0).toString()) , FontTitle, border,
            			Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);          
            	PT_addCell(table31, new String [] { "원정" }, FontTitle, border,
            			Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 30f ,false); 
            	PT_addCell(table31, "(" + "￦" +PCMSUtil.convertFloor(listRowSet.getDouble("supply_amt"), 0) +  "원정"  +  ")", FontTitle, border,
            			Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);          
            } 
            
            PT_addCell(table31, new String [] { "부가세 :" }, FontTitle, border,
            		Element.ALIGN_MIDDLE, Element.ALIGN_MIDDLE, 1, 30f,false);
            if(listRowSet.get("surtax_amt").equals("0")){ 
            	PT_addCell(table31,  "일금"  + PCMSUtil.toHangule_decimal("0"), FontTitle, border,
            			Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);          
            	PT_addCell(table31, new String [] { "원정" }, FontTitle, border,
            			Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 30f ,false); 
            	PT_addCell(table31, "(" + "￦" + PCMSUtil.convertFloor(listRowSet.getDouble("surtax_amt"), 0) +  "원정" +  ")", FontTitle, border,
            			Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);          
            }else{ 
            	PT_addCell(table31,  "일금" + PCMSUtil.toHangule_decimal(PCMSUtil.convertFloor(listRowSet.getDouble("surtax_amt"), 0).toString()), FontTitle, border,
            			Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);          
            	PT_addCell(table31, new String [] { "원정" }, FontTitle, border,
            			Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 30f ,false); 
            	PT_addCell(table31, "(" + "￦" + PCMSUtil.convertFloor(listRowSet.getDouble("surtax_amt"), 0) +  "원정"  +  ")", FontTitle, border,
            			Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);          
            } 
            
            permission2.setColspan(3);
            table11.addCell(permission2);
            setBorder(border, true, true, true, true);
    
            
            PT_addCell(table11, new String [] { "지급조건" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 30f ,false);
            PT_addCell(table11,  "  " + listRowSet.get("PAY_COND_GB_NM"), FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 3, 30f ,false);
            
            PT_addCell(table11, new String [] { "지급조건기술" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 30f ,false);
            PT_addCell(table11, "  " + listRowSet.get("PAY_CONTENT"), FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 3, 30f ,false);
            
            PT_addCell(table11, new String [] { "지체상금" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 30f ,false);
            PT_addCell(table11, "  " + listRowSet.get("DELAY_RATE"), FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 3, 30f ,false);
            
            PT_addCell(table11, new String [] { "업체명" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 30f ,false);
            PT_addCell(table11, "  " + listRowSet.get("CORP_KOR"), FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 3, 30f ,false);
            
            PT_addCell(table11, new String [] { "특이사항" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_TOP, 1, 100f ,false);
            PT_addCell(table11, "  " + listRowSet.get("CON_SPE_TXT"), FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 3, 100f ,false);
            
            /*
            */
            document.add(table11);
            
		} catch (DocumentException de) {
			WAFLogger.debug("de.getMessage() = " + de.getMessage());
		} catch (IOException ioe) {
			WAFLogger.debug("ioe.getMessage() = " + ioe.getMessage());
		} catch (Exception e) {
			WAFLogger.debug("[Exception] ... " + e);
		}

		// step 5
		document.close();
		WAFLogger.debug("\n\t #################### "+ strFileName +" 생성완료");
	}
	
	/*
	 * 구매 선급금 데이터 조회
	 */
	public ValueObject getBuyPreList(Connection con, String tmpslipID ){

		Search search = new SearchImpl();
		ValueObject vo = null;
		RowSet rowSet = new RowSetImpl();
		StringBuffer  sql = new StringBuffer();
		Persistent persistent_c = null;
		
		try{
			
			persistent_c = new PersistentImpl(con);
			
			sql.append("SELECT	B.PREPAY_PROC_GB    -- 대금신청상태																													\n");
			sql.append("		,B.PUR_CONT_ID    -- 발주계약ID																													\n");
			sql.append("		,B.PREPAY_ID   as PAYREQ_ID    -- 지급신청ID																										\n");
			sql.append("		,TO_CHAR(B.PREPAY_DATE, 'YYYY-MM-DD') REQ_DATE    -- 신청서작성일자																					\n");
			sql.append("		,F_GET_D_CURRENCY( NVL( A.ORD_AMT, 0 ) , F_GET_CURRENCY_DIGIT( NVL( A.CURRENCY_GB, 'KRW' ))) AS ORD_AMT    -- 발주계약금액							\n");
			sql.append("		,F_GET_PUR_STATUS('1', 'PUR_PAY_ACMP_GB') || '(' || TO_NUMBER(B.PREPAY_NO) || '차)' DEPOSIT_GB   -- 지급구분이름									\n");
			sql.append("		,'1' as DEPOSIT_CD    -- 지급구분																													\n");
			sql.append("		,B.PREPAY_NO as DEPOSIT_SEQ    -- 지급차수																											\n");
			sql.append("		,F_GET_D_CURRENCY( NVL( B.PREPAY_AMT, 0 ) , F_GET_CURRENCY_DIGIT( NVL( A.CURRENCY_GB, 'KRW' ))) as PAYED_AMT       --선급금액						\n");
			sql.append("		,F_GET_D_CURRENCY( NVL( B.PREPAY_SUPPLY_AMT, 0 ) , F_GET_CURRENCY_DIGIT( NVL( A.CURRENCY_GB, 'KRW' ))) as CUR_REQ_AMT       --선급공급가			\n");
			sql.append("		,F_GET_D_CURRENCY( NVL( B.PREPAY_SURTAX_AMT, 0 ) , F_GET_CURRENCY_DIGIT( NVL( A.CURRENCY_GB, 'KRW' ))) as CUR_PAYED_AMT   --선급부가세				\n");
			sql.append("		,F_GET_D_CURRENCY( NVL( B.REQ_PREPAY_AMT, 0 ) , F_GET_CURRENCY_DIGIT( NVL( A.CURRENCY_GB, 'KRW' ))) as  REMAINDER_AMT  -- 신청선급금합계			\n");
			sql.append("		,F_GET_D_CURRENCY( NVL( B.REQ_PREPAY_SUPPLY_AMT, 0 ) , F_GET_CURRENCY_DIGIT( NVL( A.CURRENCY_GB, 'KRW' ))) as  BEF_ACMP_AMT --신청 선급금 공급가액	\n");
			sql.append("		,F_GET_D_CURRENCY( NVL( B.REQ_PREPAY_SURTAX_AMT, 0 ) , F_GET_CURRENCY_DIGIT( NVL( A.CURRENCY_GB, 'KRW' ))) as CUR_ACMP_AMT -- 신청 선급금 부가세		\n");
			sql.append("		,A.ORD_DOC_NO AS ORD_DOC_NO    -- 발주계약번호																										\n");
			sql.append("		,A.CST_DOC_NAME AS CST_DOC_NAME    -- 계약명																										\n");
			sql.append("		,GET_CORP_NM(C.DEALR_CD) AS CORP_NM     --계약업체명																								\n");
			sql.append("		,(SELECT REP_NAME FROM PUR9000T_V D WHERE D.CORP_ID = C.DEALR_CD )    REP_NAME    -- 업체대표이사													\n");
			sql.append("		,(SELECT CORP_REG_NO FROM PUR9000T_V D WHERE D.CORP_ID = C.DEALR_CD )    CORP_REG_NO    -- 사업자번호												\n");
			sql.append("		,A.DEPT_NAME AS DEPT_NM -- 현장명																													\n");
			sql.append("		,C.DEPT_CD AS DEPT_CD -- 현장코드																													\n");
			sql.append("		,A.CURRENCY_GB -- 통화구분																															\n");
			sql.append("		,(SELECT CHG_CODE10 FROM EBID_COM911T WHERE DETAILCD = A.GUA_GB AND BASECD = 'PROOF_CD') VAT_STATUS													\n");
			sql.append("FROM	PUR1000T A																																		\n");
			sql.append("		,PUR1030T B																																		\n");
			sql.append("		,PUR1040T C																																		\n");
			sql.append("WHERE	1 = 1																																			\n");
			sql.append("AND		A.PUR_CONT_ID = B.PUR_CONT_ID																													\n");
			sql.append("AND		B.PREPAY_ID = C.PREPAY_ID																														\n");
			sql.append("AND		C.TMPSLIP_ID  = "+tmpslipID+"																													\n");
			
			persistent_c.setStatement(sql.toString()); 
			System.out.println(sql.toString());
			rowSet = persistent_c.query();
			
			if(rowSet.size()>0){
				vo = RowSetUtility.getValueObject(rowSet.getRow(0));
			}
			
		}catch(Exception e){
			WAFLogger.error("SQL : " + search.getStatement());
            WAFLogger.error(e);
		}finally{
			if( vo == null) vo = new ValueObject();
		}
		return vo;
		
		
	}
	
	public ValueObject getPayReqList11(Connection con, String tmpslipID ){
		
		ValueObject vo = null;
		RowSet rowSet = new RowSetImpl();
		StringBuffer  sql = new StringBuffer();
		
		Persistent pSelect  = null;
		
		try{
			
			pSelect = new PersistentImpl(con);
			
			sql.append("		   		    SELECT MAIN.TMPSLIP_ID                                                                                                                              \n");
			sql.append("		                 , TO_CHAR(MAIN.ENTER_DT, 'YYYY-MM-DD')    PROOFDATE                                                                                        \n");
			sql.append("		                 , MAIN.DEPT_CD                                                                                                                                 \n");
			sql.append("		                 , CONTRACT.DEALER_NM                      AS DEALRER_NM                                                                                        \n");
			sql.append("		                 , CONTRACT.DEPT_NAME                      AS DEPT_NM                                                                                           \n");
			sql.append("		                 , CONTRACT.ORD_DOC_NO                     AS CON_DOC_NO                                                                                        \n");
			sql.append("		                 , TO_CHAR(CONTRACT.CON_IN_DATE,'YYYY-MM-DD') AS CON_DATE                                                                                        	\n");
			sql.append("		                 , CONTRACT.CST_DOC_NAME                     AS BUILD_NAME                                                                                        \n");
			sql.append("		                 , CONTRACT.DEALER_NM                   AS UND_CON_NAME                                                                                      \n");
			sql.append("		                 , ''               AS SUB_UND_CON_NAME                                                                                  \n");
			sql.append("		                 , CONTRACT.LEAD_PLACE                     AS WORK_PLACE                                                                                        \n");
			sql.append("		                 , CONTRACT.ORD_SUPPLY_AMT                 AS con_supply_amt                                                                                    \n");
			sql.append("		                 , CONTRACT.ORD_SUPPLY_AMT                AS con_supply_tamt                                                                                    \n");
			sql.append("		                 , 0                 AS con_supply_namt                                                                                    \n");
			sql.append("		                 , CONTRACT.ORD_SURTAX_AMT        AS CON_SURTAX_AMT                                                                                                                      \n");
			sql.append("		                 , CONTRACT.ORD_AMT                     AS CON_AMT                                                                                                                             \n");
			sql.append("		                 , 0                 AS LABOR_AMT                                                                                                                           \n");
			sql.append("		                 , PREPAY.REQ_PREPAY_AMT             AS PREPAY_SUPPLY_AMT                                                                                  \n");
			sql.append("		                 , PREPAY.REQ_PREPAY_SUPPLY_AMT            AS PREPAY_SUPPLY_TAMT                                                                                  \n");
			sql.append("		                 , 0            AS PREPAY_SUPPLY_NAMT                                                                                  \n");
			sql.append("		                 , PREPAY.REQ_PREPAY_SURTAX_AMT             AS PREPAY_SURTAX_AMT                                                                                 \n");
			sql.append("		                 , CONTRACT.PREPAY_AMT                    AS PREPAY_AMT                                                                                        \n");
			sql.append("		                 , PAY_TYPE.CHG_CODE01                    AS PAY_COND_GB_NM                                                                        			\n");
			sql.append("		                 , CONTRACT.PAY_CONTENT                   AS PAY_CONTENT                                                                           				\n");
			sql.append("		                 , (TO_CHAR(CONTRACT.ORD_START_DATE,'YYYY-MM-DD') || ' ~ ' || TO_CHAR(CONTRACT.ORD_END_DATE,'YYYY-MM-DD') ) WORK_DATE                    \n");
			sql.append("		                 , CONTRACT.CON_GUAR_AMT_RATE             AS CON_EST_GUAR_RATE                                                                                 \n");
			sql.append("		                 , CONTRACT.CON_GUAR_AMT				AS CON_EST_GUAR_AMT                                                                                                                    \n");
			sql.append("		                 , CONTRACT.CON_GUAR_TERM                AS CON_GUAR_TERM                                                                                        \n");
			sql.append("		                 , CONTRACT.DEF_GUAR_AMT_RATE            AS DEF_EST_GUAR_RATE                                                                                  \n");
			sql.append("		                 , CONTRACT.DEF_GUAR_AMT                                                                                                                        \n");
			sql.append("		                 , CONTRACT.DEF_GUAR_TERMS                 AS DEF_EST_TERM                                                                                        \n");
			sql.append("		                 , ''       AS LABOR_GUAR_JOIN_AMT_GB                                                                              \n");
			sql.append("		                 , CONTRACT.CON_DISPLAY_TXT                  AS CON_SPE_TXT                                                                                        \n");
			sql.append("		                 , CONTRACT.DEL_RATE_GB        AS DELAY_RATE                                                                                                      \n");
			sql.append("		                 , CUR_CD.CHG_CODE02          as CON_CUR_NAME                                                                                                     \n");
			sql.append("		                 , CUR_CD.CHG_CODE06          as CON_CUR_WON                                                                                                    \n");
			sql.append("		                 , CUR_CD.CHG_CODE01          as CON_CUR_DIGIT                                                                                                   \n");
			sql.append("		                 , MAIN.DCERTI_NO                                                                                                                                    \n");
			sql.append("		                 , SUBVENDOR.MEMBER_NAME        AS CORP_KOR                                                                                                       \n");
			sql.append("		                 , SUBVENDOR.CORP_ID                                                                                                                            \n");
			sql.append("		                 , 'PREPAY' AS PREREQTFLG                                                                                                                              \n");
			sql.append("		                 , 0          AS   ACMP_NO                                                                                                                                    \n");
			sql.append("		                 , MAIN.PROOF_CD      AS  PROOF_CLASS                                                                                                                       \n");
			sql.append("		                 , MAIN.ORD_DESC         AS ORDACCDESC                                                                                                             \n");
			sql.append("		                 , MAIN.CURRENCY_GB        AS CON_CUR_CD                                                                                                            \n");
			sql.append("		                 , MAIN.MAT_SUPPLY_AMT                          SUPPLY_AMT                                                                                                  \n");
			sql.append("		                 , MAIN.MAT_SURTAX_AMT                          SURTAX_AMT                                                                                                  \n");
			sql.append("		                 , MAIN.MAT_SUPPLY_AMT + MAIN.MAT_SURTAX_AMT        REQ_AMT                                                                                       \n");
			sql.append("		                 , CONTRACT.CON_CHARGE_ID                                                                                                                       \n");
			sql.append("		                 , CONTRACT.CON_CHARGE_NAME                                                                                                                     \n");
			sql.append("		                 , MAIN.DEALR_CD                                                                                                                                \n");
			sql.append("		                 , MAIN.PAYITEM                                                                                                                                 \n");
			sql.append("		                 , MAIN.COSTCODE                                                                                                                                \n");
			sql.append("		                 , MAIN.COSTTYPE                                                                                                                                \n");
			sql.append("		                 , MAIN.TMPNATFLG AS ACC_CLASS                                                                                                                      \n");
			sql.append("		                 , MAIN.PAY_GROUP                                                                                                                               \n");
			sql.append("		                 , MAIN.PAYMENT_TERMS                                                                                                                           \n");
			sql.append("		                 , MAIN.TMPSLIP_DEPT                                                                                                                            \n");
			sql.append("		                 , MAIN.TMPSLIP_DT                                                                                                                              \n");
			sql.append("		                 , MAIN.TMPSLIP_NO                                                                                                                              \n");
			sql.append("		                 , MAIN.TMPSLIP_YN                                                                                                                              \n");
			sql.append("		                 , MAIN.SLIP_YN                                                                                                                                 \n");
			sql.append("		                 , NULL AS ACMP_ID                                                                                                                                 \n");
			sql.append("		                 , MAIN.PREPAY_ID                                                                                                                               \n");
			sql.append("		                 , PREPAY.CORP_ID AS CON_CORP_ID                                                                                                                           \n");
			sql.append("		                 , CONTRACT.PUR_CONT_ID  AS SUB_CONT_ID                                                                                                                         \n");
			sql.append("		               FROM PUR1040T            MAIN                                                                                                                     \n");
			sql.append("		   LEFT OUTER JOIN PUR1030T            PREPAY                                                                                                                   \n");
			sql.append("		                ON MAIN.PAYREQ_ID = PREPAY.PREPAY_ID                                                                                                            \n");
			sql.append("		   LEFT OUTER JOIN CONT_PUR_SUPP         SUBVENDOR                                                                                                                  	\n");
			sql.append("		                --ON SUBVENDOR.MAIN_CORP = 'Y'                                                                                                     					\n");
			sql.append("		               ON PREPAY.CORP_ID = SUBVENDOR.CORP_ID                                                                                                   \n");
			sql.append("		               AND PREPAY.PUR_CONT_MOD_ID = SUBVENDOR.PUR_CONT_MOD_ID                                                                                                          \n");
			sql.append("		   LEFT OUTER JOIN PUR2000T             CONTRACT                                                                                                                \n");
			sql.append("		                ON PREPAY.PUR_CONT_MOD_ID = CONTRACT.PUR_CONT_MOD_ID                                                                                                    \n");
			sql.append("		   LEFT OUTER JOIN EBID_COM911T    CON_KIND                                                                                                                          \n");
			sql.append("		                  ON CON_KIND.BASECD = 'SUB_CON_KIND'                                                                                                           \n");
			sql.append("		                AND  CONTRACT.CON_GB = CON_KIND.DETAILCD                                                                                                        \n");
			sql.append("		   LEFT OUTER JOIN EBID_COM911T    PAY_TYPE                                                                                                                          \n");
			sql.append("		                  ON PAY_TYPE.BASECD = 'SUB_ACMP_PAY_TYPE'                                                                                                      \n");
			sql.append("		                AND  CONTRACT.PAY_COND_GB = PAY_TYPE.DETAILCD                                                                                                   \n");
			sql.append("		   LEFT OUTER JOIN EBID_COM911T    CUR_CD                                                                                                                            \n");
			sql.append("		                  ON CUR_CD.BASECD = '911'                                                                                                                    	\n");
			sql.append("		                AND  CONTRACT.CURRENCY_GB = CUR_CD.DETAILCD                                                                                                       \n");
			sql.append("		             WHERE PREPAY_GB     = '1'	                                                                                                                   \n");
			sql.append("		               AND TMPSLIP_ID 	  = "+tmpslipID+"                                                                                                               \n");
			sql.append("		             ORDER BY PROOFDATE desc, DEPT_NAME, CON_DOC_NO, CORP_KOR  																							\n");
			          
			System.out.println(sql.toString());
			pSelect.setStatement(sql.toString());
			rowSet = pSelect.query();
			if(rowSet.size()>0){
				vo = RowSetUtility.getValueObject(rowSet.getRow(0));
			}
			
		}catch(Exception e){
			WAFLogger.error("SQL : " + sql.toString());
            WAFLogger.error(e);
		}finally{
			if( vo == null) vo = new ValueObject();
		}
		return vo;
		
		
	}	
	
	//구매 대금 반려처리 
	public void doBizPayReqRtn(Connection con, OutputStream outputStream, String tmpslipID,  HttpServletRequest request) {
		 
        WAFLogger.debug("\n\t #################### 구매 대금지급 반려 처리 시작");
        
		// step 1
		Document document = new Document(PageSize.A4, 25f, 25f, 35f, 10f);
  
		try {
	 
    		// step 2
  			PdfWriter writer = PdfWriter.getInstance(document, outputStream);

			// step 3
			document.open();

			BaseFont bfKorean = BaseFont.createFont("HYGoThic-Medium", "UniKS-UCS2-H", BaseFont.NOT_EMBEDDED);

			Font FontTitle = new Font(bfKorean, 8, Font.NORMAL);
			FontTitle.setColor(borderColor);

			Font FontData = new Font(bfKorean, 4.8f, Font.NORMAL);
			Font FontTitle2 = new Font(bfKorean, 20, Font.BOLD);

			PdfPTable table = null;
			PdfPCell cell = null;

			/*
			 * 정보 검색 시작 ---------------------------------------------
			 */
			
			ValueObject params = new ValueObject();
			HandlerStorage storage = new HandlerStorage();
			storage.setParams(params);
			
			ValueObject listRowSet = null;
			/*
			 * 정보 검색 시작 ---------------------------------------------
			 */
			
			listRowSet = getPayReqList1(con, tmpslipID);
			
			// 정보 검색 끝 ---------------------------------------------
			
			/*
			 * ===========================================================================================
			 * 제목 생성
			 * ===========================================================================================
			 */
			makeTitle_2(document, FontTitle, FontTitle2,  request);

			//본문생성
			setBorder(border, true, true, true, true);
			
			
            //1행
		    PdfPTable table11 = new PdfPTable(6);
		    table11.setWidthPercentage(100);
		    table11.setSpacingBefore(7f);
		    table11.setSpacingAfter(7f);
            float[] table11Width = {15f,3f,27f,3f,27f,30f};
            table11.setWidths(table11Width);
            
            // 1행
            PT_addCell(table11, new String [] { "계약번호" }, FontTitle, border,
    				Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,true);
            PT_addCell(table11, listRowSet.get("ORD_DOC_NO"), FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 2, 20f ,false);
            PT_addCell(table11, new String [] { "작성일자" }, FontTitle, border,
    				Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 2, 20f ,true);          
            PT_addCell(table11, listRowSet.get("REQ_DATE"), FontTitle, border,
    				Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 20f,false);
            
            
/*            PT_addCell(table11, new String [] { "작성자" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,true);
            PT_addCell(table11, listRowSet.get("REQ_CHARGE_NAME"), FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 2, 20f ,false);
            PT_addCell(table11, new String [] { "협조부서" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 2, 20f ,true);          
            PT_addCell(table11, listRowSet.get("COOP_DEPT_NM"), FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 20f,false);*/
            
            
            PT_addCell(table11, new String [] { "현장코드" }, FontTitle, border,
		    		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,true);          
		    PT_addCell(table11, listRowSet.get("DEPT_CD"), FontTitle, border,
		    		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 2, 20f,false);
		    PT_addCell(table11, new String [] { "통화" }, FontTitle, border,
		    		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 2, 20f ,true);          
		    PT_addCell(table11, listRowSet.get("CURRENCY_GB"), FontTitle, border,
		    		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f,false);
            
            PT_addCell(table11, new String [] { "현장명" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,true);
		    PT_addCell(table11, listRowSet.get("DEPT_NM"), FontTitle, border,
		    		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 5, 20f ,false);
		    
            
            /*PT_addCell(table11, new String [] { "현장명" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,true);
            PT_addCell(table11, listRowSet.get("DEPT_NM"), FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 2, 20f ,false);
            PT_addCell(table11, new String [] { "현장코드" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 2, 20f ,true);          
            PT_addCell(table11, listRowSet.get("DEPT_CD"), FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f,false);*/
            
            
            PT_addCell(table11, new String [] { "계약명" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,true);
            PT_addCell(table11, listRowSet.get("CST_DOC_NAME"), FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 5, 20f ,false);
            
            
            PT_addCell(table11, new String [] { "계약업체명" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,true);
            PT_addCell(table11, listRowSet.get("CORP_NM"), FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 2, 20f ,false);
            PT_addCell(table11, new String [] { "대표이사" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 2, 20f ,true);          
            PT_addCell(table11, listRowSet.get("REP_NAME"), FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f,false);
           
            
            PT_addCell(table11, new String [] { "총계약금액" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,true);
            PT_addCell(table11, listRowSet.get("ORD_AMT"), FontTitle, border,
            		Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 2, 20f ,false);
            PT_addCell(table11, new String [] { "선급금액" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 2, 20f ,true);          
            PT_addCell(table11, listRowSet.get("PREPAY_AMT"), FontTitle, border,
            		Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 20f,false);

            
            PT_addCell(table11, new String [] { "지급구분" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,true);
            PT_addCell(table11, listRowSet.get("DEPOSIT_GB"), FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 2, 20f ,false);
            PT_addCell(table11, new String [] { "기선급공제액" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 2, 20f ,true);          
            PT_addCell(table11, listRowSet.get("PREPAY_ACMP_AMT"), FontTitle, border,
            		Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 20f,false);
            
            
            PT_addCell(table11, new String [] { "지급사유" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,true);
            PT_addCell(table11, listRowSet.get("DEPOSIT_RESN"), FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 2, 20f ,false);
            PT_addCell(table11, new String [] { "선급잔액" }, FontTitle, border,          		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 2, 20f ,true);          
            PT_addCell(table11, listRowSet.get("PREPAY_RMDR"), FontTitle, border,        		Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 20f,false);
            
            
            PT_addCell(table11, new String [] { "기지불액" }, FontTitle, border, Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,true);
            //PT_addCell(table11, listRowSet.get("PAYED_AMT")+" ("+listRowSet.get("PAYED_PERCENT")+")%", FontTitle, border, Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 2, 20f ,false);
            PT_addCell(table11, listRowSet.get("PAYED_AMT"), FontTitle, border, Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 2, 20f ,false);
            PT_addCell(table11, new String [] { "전기성고" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 2, 20f ,true);          
            PT_addCell(table11, listRowSet.get("BEF_ACMP_AMT")+" ("+listRowSet.get("BEF_ACMP_PERCENT")+")%", FontTitle, border,
            		Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 20f,false);
            
            
            PT_addCell(table11, new String [] { "금회청구액" }, FontTitle, border,            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,true);
            //PT_addCell(table11, listRowSet.get("CUR_REQ_AMT")+" ("+listRowSet.get("CUR_REQ_PERCENT")+")%", FontTitle, border,            		Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 2, 20f ,false);
            PT_addCell(table11, listRowSet.get("CUR_REQ_AMT"), FontTitle, border,            		Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 2, 20f ,false);
            PT_addCell(table11, new String [] { "금회기성고" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 2, 20f ,true);          
            PT_addCell(table11, listRowSet.get("CUR_ACMP_AMT")+" ("+listRowSet.get("CUR_ACMP_PERCENT")+")%", FontTitle, border,
            		Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 20f,false);
            
            
            PT_addCell(table11, new String [] { "금회포함지불액" }, FontTitle, border,            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,true);
            //PT_addCell(table11, listRowSet.get("CUR_PAYED_AMT")+" ("+listRowSet.get("CUR_PAYED_PERCENT")+")%", FontTitle, border,            		Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 2, 20f ,false);
            PT_addCell(table11, listRowSet.get("CUR_PAYED_AMT"), FontTitle, border,            		Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 2, 20f ,false);
            PT_addCell(table11, new String [] { "금회포함기성고" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 2, 20f ,true);          
            PT_addCell(table11, listRowSet.get("CUR_BEF_ACMP_AMT")+" ("+listRowSet.get("CUR_BEF_ACMP_PERCENT")+")%", FontTitle, border,
            		Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 20f,false);
            
            
            PT_addCell(table11, new String [] { "잔액" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,true);
            PT_addCell(table11, listRowSet.get("REMAINDER_AMT")+" ("+listRowSet.get("REMAINDER_PERCENT")+")%", FontTitle, border,
            		Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 2, 20f ,false);
            PT_addCell(table11, new String [] { "미기성고" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 2, 20f ,true);          
            PT_addCell(table11, listRowSet.get("REMAINDER_ACMP_AMT")+" ("+listRowSet.get("REMAINDER_ACMP_PERCENT")+")%", FontTitle, border,
            		Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 20f,false);
            
            
            PT_addCell(table11, new String [] { "특기사항" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 200f ,true);
            PT_addCell(table11, listRowSet.get("RE_MARKS"), FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_TOP, 5, 200f ,false);
            
            
    		
            PT_addCell(table11, new String [] { "첨부서류" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 120f ,true);
            
            
            PdfPTable table21 = new PdfPTable(4);
            float[] table21Width = {3f,27,3,27f};
            table21.setWidths(table21Width);
            PdfPCell permission = new PdfPCell(table21);
            
           
            
            PT_addCell(table21, listRowSet.get("DOC_PAYREQ"), FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,false);
            PT_addCell(table21, new String [] { "대금청구서" }, FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 20f ,false);
            PT_addCell(table21, listRowSet.get("DOC_COMPLETE"), FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f,false);
            PT_addCell(table21, new String [] { "설치완료확인서" }, FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 20f ,false);
            
            
            PT_addCell(table21, listRowSet.get("DOC_GUAR_CONST"), FontTitle, border,       		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f,false);
            PT_addCell(table21, new String [] { "계약이행 보증보험 증권" }, FontTitle, border, 		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 20f ,false);          
            PT_addCell(table21, listRowSet.get("DOC_TESTRUN"), FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f,false);
            PT_addCell(table21, new String [] { "시운전완료확인서" }, FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 20f ,false);
            
            PT_addCell(table21, listRowSet.get("DOC_MRR"), FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,false);
            PT_addCell(table21, new String [] { "지급이행 보증보험 증권" }, FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 20f ,false);
            PT_addCell(table21, listRowSet.get("DOC_INSPECTION_REPORT"), FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,false);
            PT_addCell(table21, new String [] { "Inspection Report" }, FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 20f ,false);
                      

            PT_addCell(table21, listRowSet.get("DOC_GUAR_AS"), FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f,false);
            PT_addCell(table21, new String [] { "하자이행 보증보험 증권" }, FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 20f ,false);
            PT_addCell(table21, listRowSet.get("DOC_SHIP"), FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f,false);
            PT_addCell(table21, new String [] { "선적서류(B/L, Packing List)" }, FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 20f ,false);          
            
            
            PT_addCell(table21, listRowSet.get("DOC_ITEMINPUTCONFIRM"), FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,false);
            PT_addCell(table21, new String [] { "원자재입고확인서" }, FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 20f ,false);
            PT_addCell(table21, listRowSet.get("DOC_FINAL_DOCUMENTS"), FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,false);
            PT_addCell(table21, new String [] { "Final Documents 제출 확인서" }, FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 20f ,false);
            
            
            PT_addCell(table21, listRowSet.get("DOC_CONFIRM"), FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,false);
            PT_addCell(table21, new String [] { "MRR" }, FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 20f ,false);          
            PT_addCell(table21, listRowSet.get("DOC_CONST_COPY"), FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f,false);
            PT_addCell(table21, new String [] { "계약서 사본" }, FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 20f ,false);
            
            
            PT_addCell(table21, listRowSet.get("DOC_WORKQA"), FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f,false);
            PT_addCell(table21, new String [] { "거래명세서" }, FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 20f ,false);                    
            PT_addCell(table21, listRowSet.get("DOC_ETC"), FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,false);
            PT_addCell(table21, new String [] { "기타" }, FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 20f ,false);
            PT_addCell(table21, listRowSet.get("DOC_MC"), FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,false);
           
            permission.setColspan(4);
            table11.addCell(permission);
            
            PT_addCell(table11, "", FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 120f,false);
            
            document.add(table11);          
            

            
		} catch (DocumentException de) {
			WAFLogger.debug("de.getMessage() = " + de.getMessage());
		} catch (IOException ioe) {
			WAFLogger.debug("ioe.getMessage() = " + ioe.getMessage());
		} catch (Exception e) {
			WAFLogger.debug("[Exception] ... " + e);
		}

		// step 5
		document.close();
		WAFLogger.debug("\n\t #################### "+ strFileName +" 생성완료");
	}
	
	public void doBizBuyPreRtn(Connection con, OutputStream outputStream, String tmpslipID,  HttpServletRequest request) {
		 
        WAFLogger.debug("\n\t #################### 구매 선급금 시작");
        
		// step 1
		Document document = new Document(PageSize.A4, 25f, 25f, 35f, 10f);
  
		try {
	 
    		// step 2
  			PdfWriter writer = PdfWriter.getInstance(document, outputStream);

			// step 3
			document.open();

			BaseFont bfKorean = BaseFont.createFont("HYGoThic-Medium", "UniKS-UCS2-H", BaseFont.NOT_EMBEDDED);

			Font FontTitle = new Font(bfKorean, 8, Font.NORMAL);
			FontTitle.setColor(borderColor);

			Font FontData = new Font(bfKorean, 4.8f, Font.NORMAL);
			Font FontTitle2 = new Font(bfKorean, 20, Font.BOLD);

			PdfPTable table = null;
			PdfPCell cell = null;

			/*
			 * 정보 검색 시작 ---------------------------------------------
			 */
			
			ValueObject params = new ValueObject();
			HandlerStorage storage = new HandlerStorage();
			storage.setParams(params);
			
			ValueObject listRowSet = null;
			/*
			 * 정보 검색 시작 ---------------------------------------------
			 */
			
			listRowSet = getBuyPreList(con, tmpslipID);
			
			// 정보 검색 끝 ---------------------------------------------
			
			/*
			 * ===========================================================================================
			 * 제목 생성
			 * ===========================================================================================
			 */
			makeTitle_1(document, FontTitle, FontTitle2,  request);

			//본문생성
			setBorder(border, true, true, true, true);
			
			
            //1행
		    PdfPTable table11 = new PdfPTable(6);
		    table11.setWidthPercentage(100);
		    table11.setSpacingBefore(7f);
		    table11.setSpacingAfter(7f);
            float[] table11Width = {15f,3f,27f,3f,27f,30f};
            table11.setWidths(table11Width);
            
          
            // 1행
            PT_addCell(table11, new String [] { "계약번호" }, FontTitle, border,	Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,true);
            PT_addCell(table11, listRowSet.get("ORD_DOC_NO"), FontTitle, border,Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 2, 20f ,false);
            PT_addCell(table11, new String [] { "작성일자" }, FontTitle, border,	Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 2, 20f ,true);          
            PT_addCell(table11, listRowSet.get("REQ_DATE"), FontTitle, border,	Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 20f,false);
                       
//            PT_addCell(table11, new String [] { "작성자" }, FontTitle, border,	Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,true);
//            PT_addCell(table11, listRowSet.get("REQ_CHARGE_NAME"), FontTitle, border,	Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 2, 20f ,false);
//            PT_addCell(table11, new String [] { "협조부서" }, FontTitle, border,     		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 2, 20f ,true);          
//            PT_addCell(table11, listRowSet.get("COOP_DEPT_NM"), FontTitle, border, 		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 20f,false);
            
            PT_addCell(table11, new String [] { "현장코드" }, FontTitle, border,   		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,true);          
		    PT_addCell(table11, listRowSet.get("DEPT_CD"), FontTitle, border,   		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 2, 20f,false);
		    PT_addCell(table11, new String [] { "통화" }, FontTitle, border,	    		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 2, 20f ,true);          
		    PT_addCell(table11, listRowSet.get("CURRENCY_GB"), FontTitle, border,  		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f,false);
            
            PT_addCell(table11, new String [] { "현장명" }, FontTitle, border,      		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,true);
		    PT_addCell(table11, listRowSet.get("DEPT_NM"), FontTitle, border,   		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 5, 20f ,false);
		    
            /*PT_addCell(table11, new String [] { "현장명" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,true);
            PT_addCell(table11, listRowSet.get("DEPT_NM"), FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 2, 20f ,false);
            PT_addCell(table11, new String [] { "현장코드" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 2, 20f ,true);          
            PT_addCell(table11, listRowSet.get("DEPT_CD"), FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f,false);*/
            
            
            PT_addCell(table11, new String [] { "계약명" }, FontTitle, border,      		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,true);
            PT_addCell(table11, listRowSet.get("CST_DOC_NAME"), FontTitle, border, 		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 5, 20f ,false);
            
            
            PT_addCell(table11, new String [] { "계약업체명" }, FontTitle, border,   		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,true);
            PT_addCell(table11, listRowSet.get("CORP_NM"), FontTitle, border,      		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 2, 20f ,false);
            PT_addCell(table11, new String [] { "대표이사" }, FontTitle, border,     		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 2, 20f ,true);          
            PT_addCell(table11, listRowSet.get("REP_NAME"), FontTitle, border,     		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f,false);
                       
            PT_addCell(table11, new String [] { "총계약금액" }, FontTitle, border,   		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,true);
            PT_addCell(table11, listRowSet.get("ORD_AMT"), FontTitle, border,      		Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 2, 20f ,false);
            PT_addCell(table11, new String [] { "선급금액" }, FontTitle, border,     		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 2, 20f ,true);          
            PT_addCell(table11, listRowSet.get("PAYED_AMT"), FontTitle, border,   		Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 20f,false);
            
            PT_addCell(table11, new String [] { "선급공급가" }, FontTitle, border,   		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,true);
            PT_addCell(table11, listRowSet.get("CUR_REQ_AMT"), FontTitle, border,      	Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 2, 20f ,false);
            PT_addCell(table11, new String [] { "선급부가세" }, FontTitle, border,   		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 2, 20f ,true);          
            PT_addCell(table11, listRowSet.get("CUR_PAYED_AMT"), FontTitle, border,   	Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 20f,false);

            PT_addCell(table11, new String [] { "지급구분" }, FontTitle, border,     		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,true);
            PT_addCell(table11, listRowSet.get("DEPOSIT_GB"), FontTitle, border,   		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 2, 20f ,false);
            PT_addCell(table11, new String [] { "신청선급금" }, FontTitle, border,   		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 2, 20f ,true);          
            PT_addCell(table11, listRowSet.get("REMAINDER_AMT"), FontTitle, border,   	Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 20f,false);

            PT_addCell(table11, new String [] { "신청선급공급가" }, FontTitle, border,    Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,true);
            PT_addCell(table11, listRowSet.get("BEF_ACMP_AMT"), FontTitle, border,   	Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 2, 20f ,false);
            PT_addCell(table11, new String [] { "신청선급부가세" }, FontTitle, border,   	Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 2, 20f ,true);          
            PT_addCell(table11, listRowSet.get("CUR_ACMP_AMT"), FontTitle, border,   	Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 20f,false);
            
//            PT_addCell(table11, new String [] { "기선급공제액" }, FontTitle, border,		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 2, 20f ,true);          
//            PT_addCell(table11, listRowSet.get("PREPAY_ACMP_AMT"), FontTitle, border,	Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 20f,false);
            
            
//            PT_addCell(table11, new String [] { "지급사유" }, FontTitle, border,     		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,true);
//            PT_addCell(table11, listRowSet.get("DEPOSIT_RESN"), FontTitle, border,		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 2, 20f ,false);
//            PT_addCell(table11, new String [] { "선급잔액" }, FontTitle, border,      		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 2, 20f ,true);          
//            PT_addCell(table11, listRowSet.get("PREPAY_RMDR"), FontTitle, border,      		Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 20f,false);
            
            
//            PT_addCell(table11, new String [] { "기지불액" }, FontTitle, border,
//            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,true);
//            PT_addCell(table11, listRowSet.get("PAYED_AMT")+" ("+listRowSet.get("PAYED_PERCENT")+")%", FontTitle, border,
//            		Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 2, 20f ,false);
//            PT_addCell(table11, new String [] { "전기성고" }, FontTitle, border,
//            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 2, 20f ,true);          
//            PT_addCell(table11, listRowSet.get("BEF_ACMP_AMT")+" ("+listRowSet.get("BEF_ACMP_PERCENT")+")%", FontTitle, border,
//            		Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 20f,false);
            
 /*           
            PT_addCell(table11, new String [] { "금회청구액" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,true);
            PT_addCell(table11, listRowSet.get("CUR_REQ_AMT")+" ("+listRowSet.get("CUR_REQ_PERCENT")+")%", FontTitle, border,
            		Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 2, 20f ,false);
            PT_addCell(table11, new String [] { "금회기성고" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 2, 20f ,true);          
            PT_addCell(table11, listRowSet.get("CUR_ACMP_AMT")+" ("+listRowSet.get("CUR_ACMP_PERCENT")+")%", FontTitle, border,
            		Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 20f,false);
            
            
            PT_addCell(table11, new String [] { "금회포함지불액" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,true);
            PT_addCell(table11, listRowSet.get("CUR_PAYED_AMT")+" ("+listRowSet.get("CUR_PAYED_PERCENT")+")%", FontTitle, border,
            		Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 2, 20f ,false);
            PT_addCell(table11, new String [] { "금회포함기성고" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 2, 20f ,true);          
            PT_addCell(table11, listRowSet.get("CUR_BEF_ACMP_AMT")+" ("+listRowSet.get("CUR_BEF_ACMP_PERCENT")+")%", FontTitle, border,
            		Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 20f,false);
            
            
            PT_addCell(table11, new String [] { "잔액" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,true);
            PT_addCell(table11, listRowSet.get("REMAINDER_AMT")+" ("+listRowSet.get("REMAINDER_PERCENT")+")%", FontTitle, border,
            		Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 2, 20f ,false);
            PT_addCell(table11, new String [] { "미기성고" }, FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 2, 20f ,true);          
            PT_addCell(table11, listRowSet.get("REMAINDER_ACMP_AMT")+" ("+listRowSet.get("REMAINDER_ACMP_PERCENT")+")%", FontTitle, border,
            		Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 20f,false);
            
            
            PT_addCell(table11, new String [] { "특기사항" }, FontTitle, border,           		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 200f ,true);
            PT_addCell(table11, listRowSet.get("RE_MARKS"), FontTitle, border,            		Element.ALIGN_LEFT, Element.ALIGN_TOP, 5, 200f ,false);
    		
            PT_addCell(table11, new String [] { "첨부서류" }, FontTitle, border,            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 120f ,true);
            
            
            PdfPTable table21 = new PdfPTable(4);
            float[] table21Width = {3f,27,3,27f};
            table21.setWidths(table21Width);
            PdfPCell permission = new PdfPCell(table21);
            
           
            
            PT_addCell(table21, listRowSet.get("DOC_PAYREQ"), FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,false);
            PT_addCell(table21, new String [] { "대금청구서" }, FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 20f ,false);
            PT_addCell(table21, listRowSet.get("DOC_COMPLETE"), FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f,false);
            PT_addCell(table21, new String [] { "설치완료확인서" }, FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 20f ,false);
            
            
            PT_addCell(table21, listRowSet.get("DOC_GUAR_CONST"), FontTitle, border,       		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f,false);
            PT_addCell(table21, new String [] { "계약이행 보증보험 증권" }, FontTitle, border, 		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 20f ,false);          
            PT_addCell(table21, listRowSet.get("DOC_TESTRUN"), FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f,false);
            PT_addCell(table21, new String [] { "시운전완료확인서" }, FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 20f ,false);
            
            PT_addCell(table21, listRowSet.get("DOC_MRR"), FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,false);
            PT_addCell(table21, new String [] { "지급이행 보증보험 증권" }, FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 20f ,false);
            PT_addCell(table21, listRowSet.get("DOC_INSPECTION_REPORT"), FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,false);
            PT_addCell(table21, new String [] { "Inspection Report" }, FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 20f ,false);
                      

            PT_addCell(table21, listRowSet.get("DOC_GUAR_AS"), FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f,false);
            PT_addCell(table21, new String [] { "하자이행 보증보험 증권" }, FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 20f ,false);
            PT_addCell(table21, listRowSet.get("DOC_SHIP"), FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f,false);
            PT_addCell(table21, new String [] { "선적서류(B/L, Packing List)" }, FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 20f ,false);          
            
            
            PT_addCell(table21, listRowSet.get("DOC_ITEMINPUTCONFIRM"), FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,false);
            PT_addCell(table21, new String [] { "원자재입고확인서" }, FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 20f ,false);
            PT_addCell(table21, listRowSet.get("DOC_FINAL_DOCUMENTS"), FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,false);
            PT_addCell(table21, new String [] { "Final Documents 제출 확인서" }, FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 20f ,false);
            
            
            PT_addCell(table21, listRowSet.get("DOC_CONFIRM"), FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,false);
            PT_addCell(table21, new String [] { "MRR" }, FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 20f ,false);          
            PT_addCell(table21, listRowSet.get("DOC_CONST_COPY"), FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f,false);
            PT_addCell(table21, new String [] { "계약서 사본" }, FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 20f ,false);
            
            
            PT_addCell(table21, listRowSet.get("DOC_WORKQA"), FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f,false);
            PT_addCell(table21, new String [] { "거래명세서" }, FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 20f ,false);                    
            PT_addCell(table21, listRowSet.get("DOC_ETC"), FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,false);
            PT_addCell(table21, new String [] { "기타" }, FontTitle, border,
            		Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 20f ,false);
            PT_addCell(table21, listRowSet.get("DOC_MC"), FontTitle, border,
            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 20f ,false);
            
            permission.setColspan(4);
            table11.addCell(permission);
            
            PT_addCell(table11, "", FontTitle, border,            		Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 120f,false);
*/
            
            document.add(table11);
            
		} catch (DocumentException de) {
			WAFLogger.debug("de.getMessage() = " + de.getMessage());
		} catch (IOException ioe) {
			WAFLogger.debug("ioe.getMessage() = " + ioe.getMessage());
		} catch (Exception e) {
			WAFLogger.debug("[Exception] ... " + e);
		}

		// step 5
		document.close();
		WAFLogger.debug("\n\t #################### "+ strFileName +" 생성완료");
	}
}
