SACDOCreatePDF6.java 106 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489
  1. package kr.co.udapsoft.common.commonSign.util;
  2. /*
  3. * 외주기성고 계산서 : 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
  4. *
  5. */
  6. import java.awt.Color;
  7. import java.io.IOException;
  8. import java.io.OutputStream;
  9. import java.sql.Connection;
  10. import javax.servlet.http.HttpServletRequest;
  11. import com.lowagie.text.Document;
  12. import com.lowagie.text.DocumentException;
  13. import com.lowagie.text.Element;
  14. import com.lowagie.text.Font;
  15. import com.lowagie.text.PageSize;
  16. import com.lowagie.text.Paragraph;
  17. import com.lowagie.text.Rectangle;
  18. import com.lowagie.text.pdf.BaseFont;
  19. import com.lowagie.text.pdf.PdfPCell;
  20. import com.lowagie.text.pdf.PdfPTable;
  21. import com.lowagie.text.pdf.PdfWriter;
  22. import kr.co.udapsoft.common.util.PCMSUtil;
  23. import com.udapsoft.waf.system.HandlerStorage;
  24. import kr.co.hsnc.common.base.WAFLogger;
  25. import kr.co.hsnc.common.config.WAFConfig;
  26. import kr.co.hsnc.common.sql.RowSet;
  27. import kr.co.hsnc.common.sql.RowSetImpl;
  28. import kr.co.hsnc.common.sql.persistent.Persistent;
  29. import kr.co.hsnc.common.sql.persistent.PersistentImpl;
  30. import kr.co.hsnc.common.sql.search.Search;
  31. import kr.co.hsnc.common.sql.search.SearchImpl;
  32. import kr.co.hsnc.common.sql.util.RowSetUtility;
  33. import kr.co.hsnc.common.util.ValueObject;
  34. public class SACDOCreatePDF6 {
  35. public static BaseFont bfKorean = null;
  36. /*
  37. * private static Font FontKorean = null;
  38. */
  39. public static Font FontBold = null;
  40. private static String strClassName = (new Throwable()).getStackTrace()[0]
  41. .getClassName();
  42. // private static String strFileName = "d:\\temp\\pdf\\" + strClassName +
  43. // ".pdf";
  44. private static String strFileName = WAFConfig.get("waf.repository.path")
  45. + "\\" + strClassName + ".pdf";
  46. private static Color borderColor = Color.BLACK;
  47. private static String strGubun = null;
  48. private static float BorderW = 0.1f;
  49. private static Rectangle border = new Rectangle(0f, 0f);
  50. private static boolean isGray = false;
  51. private static boolean LineisGray = false; //데이터 로
  52. /**
  53. * @param args
  54. */
  55. public void doBiz(OutputStream outputStream, String tmpslipID, HttpServletRequest request) {
  56. WAFLogger.debug("\n\t #################### 외주선급금계산서생성 시작");
  57. // step 1
  58. Document document = new Document(PageSize.A4, 25f, 25f, 35f, 10f);
  59. try {
  60. // step 2
  61. PdfWriter writer = PdfWriter.getInstance(document, outputStream);
  62. // step 3
  63. document.open();
  64. BaseFont bfKorean = BaseFont.createFont("HYGoThic-Medium", "UniKS-UCS2-H", BaseFont.NOT_EMBEDDED);
  65. Font FontTitle = new Font(bfKorean, 12, Font.NORMAL);
  66. FontTitle.setColor(borderColor);
  67. Font FontData = new Font(bfKorean, 4.8f, Font.NORMAL);
  68. Font FontTitle2 = new Font(bfKorean, 20, Font.BOLD);
  69. PdfPTable table = null;
  70. PdfPCell cell = null;
  71. /*
  72. * 정보 검색 시작 ---------------------------------------------
  73. */
  74. ValueObject params = new ValueObject();
  75. HandlerStorage storage = new HandlerStorage();
  76. storage.setParams(params);
  77. ValueObject listRowSet = null;
  78. /*
  79. * 정보 검색 시작 ---------------------------------------------
  80. */
  81. listRowSet = getPayReqList(tmpslipID);
  82. // 정보 검색 끝 ---------------------------------------------
  83. /*
  84. * ===========================================================================================
  85. * 제목 생성
  86. * ===========================================================================================
  87. */
  88. makeTitle(document, FontTitle, FontTitle2, request);
  89. //본문생성
  90. setBorder(border, true, true, true, true);
  91. //1행
  92. PdfPTable table11 = new PdfPTable(4);
  93. table11.setWidthPercentage(100);
  94. table11.setSpacingBefore(7f);
  95. table11.setSpacingAfter(7f);
  96. float[] table11Width = {15f,40f,15f,15f};
  97. table11.setWidths(table11Width);
  98. // 1행
  99. PT_addCell(table11, new String [] { "현장" }, FontTitle, border,
  100. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 30f ,false);
  101. PT_addCell(table11, " " + "(" + listRowSet.get("DEPT_CD") + ")" + listRowSet.get("DEPT_NM") , FontTitle, border,
  102. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 3, 30f ,false);
  103. PT_addCell(table11, new String [] { "발주처" }, FontTitle, border,
  104. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 30f ,false);
  105. PT_addCell(table11, " " +listRowSet.get("DEALRER_NM"), FontTitle, border,
  106. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 3, 30f ,false);
  107. PT_addCell(table11, new String [] { "계약번호" }, FontTitle, border,
  108. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 30f ,false);
  109. PT_addCell(table11, " " +listRowSet.get("CON_DOC_NO"), FontTitle, border,
  110. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 30f,false);
  111. PT_addCell(table11, new String [] { "계약일자" }, FontTitle, border,
  112. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 30f ,false);
  113. PT_addCell(table11, " " +listRowSet.get("CON_DATE"), FontTitle, border,
  114. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 30f,false);
  115. PT_addCell(table11, new String [] { "계약명" }, FontTitle, border,
  116. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 30f ,false);
  117. PT_addCell(table11, " " +listRowSet.get("BUILD_NAME"), FontTitle, border,
  118. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 3, 30f ,false);
  119. PT_addCell(table11, new String [] { "원도급공사명" }, FontTitle, border,
  120. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 30f ,false);
  121. PT_addCell(table11, " " +listRowSet.get("UND_CON_NAME"), FontTitle, border,
  122. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 3, 30f,false);
  123. PT_addCell(table11, new String [] { "하도급공사명" }, FontTitle, border,
  124. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 30f ,false);
  125. PT_addCell(table11, " " +listRowSet.get("SUB_UND_CON_NAME"), FontTitle, border,
  126. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 3, 30f,false);
  127. PT_addCell(table11, new String [] { "공사장소" }, FontTitle, border,
  128. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 30f ,false);
  129. PT_addCell(table11, " " +listRowSet.get("WORK_PLACE"), FontTitle, border,
  130. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 3, 30f ,false);
  131. PT_addCell(table11, new String [] { "공사기간" }, FontTitle, border,
  132. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 30f ,false);
  133. PT_addCell(table11, " " +listRowSet.get("WORK_DATE"), FontTitle, border,
  134. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 3, 30f ,false);
  135. PT_addCell(table11, new String [] { "계약금액" }, FontTitle, border,
  136. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 90f ,false);
  137. PdfPTable table21 = new PdfPTable(4);
  138. float[] table21Width = {13f,25f,5f,25f};
  139. table21.setWidths(table21Width);
  140. PdfPCell permission = new PdfPCell(table21);
  141. setBorder(border, false, false, false, false);
  142. PT_addCell(table21, new String [] { "합 계 :" }, FontTitle, border,
  143. Element.ALIGN_MIDDLE, Element.ALIGN_MIDDLE, 1, 30f ,false);
  144. if(listRowSet.get("con_amt").equals("0")){
  145. PT_addCell(table21, "일금" + PCMSUtil.toHangule_decimal("0"), FontTitle, border,
  146. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  147. PT_addCell(table21, new String [] { "원정" }, FontTitle, border,
  148. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  149. PT_addCell(table21, "(" + "₩" + PCMSUtil.convertFloor(listRowSet.getDouble("con_amt"), 0) + "원정" + ")", FontTitle, border,
  150. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  151. }else{
  152. PT_addCell(table21, "일금" + PCMSUtil.toHangule_decimal(PCMSUtil.convertFloor(listRowSet.getDouble("con_amt"), 0).toString()), FontTitle, border,
  153. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  154. PT_addCell(table21, new String [] { "원정" }, FontTitle, border,
  155. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  156. PT_addCell(table21,"(" + "₩" + PCMSUtil.convertFloor(listRowSet.getDouble("con_amt"), 0) + "원정" + ")", FontTitle, border,
  157. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  158. }
  159. PT_addCell(table21, new String [] { "공급가 :" }, FontTitle, border,
  160. Element.ALIGN_MIDDLE, Element.ALIGN_MIDDLE, 1, 30f ,false);
  161. if(listRowSet.get("con_supply_amt").equals("0")){
  162. PT_addCell(table21, "일금" + PCMSUtil.toHangule_decimal("0"), FontTitle, border,
  163. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  164. PT_addCell(table21, new String [] { "원정" }, FontTitle, border,
  165. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  166. PT_addCell(table21, "(" + "₩" + PCMSUtil.convertFloor(listRowSet.getDouble("con_supply_amt"), 0) + "원정" + ")", FontTitle, border,
  167. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  168. }else{
  169. PT_addCell(table21, "일금" + PCMSUtil.toHangule_decimal(PCMSUtil.convertFloor(listRowSet.getDouble("con_supply_amt"), 0).toString()), FontTitle, border,
  170. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  171. PT_addCell(table21, new String [] { "원정" }, FontTitle, border,
  172. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  173. PT_addCell(table21, "(" + "₩" + PCMSUtil.convertFloor(listRowSet.getDouble("con_supply_amt"), 0) + "원정" + ")", FontTitle, border,
  174. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  175. }
  176. PT_addCell(table21, new String [] { "- 과세 :" }, FontTitle, border,
  177. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  178. if(listRowSet.get("con_supply_tamt").equals("0")){
  179. PT_addCell(table21, "일금" + PCMSUtil.toHangule_decimal("0"), FontTitle, border,
  180. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  181. PT_addCell(table21, new String [] { "원정" }, FontTitle, border,
  182. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  183. PT_addCell(table21, "(" + "₩" + PCMSUtil.convertFloor(listRowSet.getDouble("con_supply_tamt"), 0) + "원정" + ")", FontTitle, border,
  184. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  185. }else{
  186. PT_addCell(table21, "일금" + PCMSUtil.toHangule_decimal(PCMSUtil.convertFloor(listRowSet.getDouble("con_supply_tamt"), 0).toString()), FontTitle, border,
  187. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  188. PT_addCell(table21, new String [] { "원정" }, FontTitle, border,
  189. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  190. PT_addCell(table21, "(" + "₩" + PCMSUtil.convertFloor(listRowSet.getDouble("con_supply_tamt"), 0) + "원정" + ")", FontTitle, border,
  191. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  192. }
  193. PT_addCell(table21, new String [] { "- 면세 :" }, FontTitle, border,
  194. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  195. if(listRowSet.get("con_supply_namt").equals("0")){
  196. PT_addCell(table21, "일금" + PCMSUtil.toHangule_decimal("0"), FontTitle, border,
  197. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  198. PT_addCell(table21, new String [] { "원정" }, FontTitle, border,
  199. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  200. PT_addCell(table21, "(" + "₩" + PCMSUtil.convertFloor(listRowSet.getDouble("con_supply_namt"), 0) + "원정" + ")", FontTitle, border,
  201. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  202. }else{
  203. PT_addCell(table21, "일금" + PCMSUtil.toHangule_decimal(PCMSUtil.convertFloor(listRowSet.getDouble("con_supply_namt"), 0).toString()), FontTitle, border,
  204. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  205. PT_addCell(table21, new String [] { "원정" }, FontTitle, border,
  206. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  207. PT_addCell(table21, "(" + "₩" + PCMSUtil.convertFloor(listRowSet.getDouble("con_supply_namt"), 0) + "원정" + ")", FontTitle, border,
  208. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  209. }
  210. PT_addCell(table21, new String [] { "부가세 :" }, FontTitle, border,
  211. Element.ALIGN_MIDDLE, Element.ALIGN_MIDDLE, 1, 30f ,false);
  212. if(listRowSet.get("con_surtax_amt").equals("0")){
  213. PT_addCell(table21, "일금" + PCMSUtil.toHangule_decimal("0") , FontTitle, border,
  214. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  215. PT_addCell(table21, new String [] { "원정" }, FontTitle, border,
  216. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  217. PT_addCell(table21, "(" + "₩" + PCMSUtil.convertFloor(listRowSet.getDouble("con_surtax_amt"), 0) + "원정" + ")", FontTitle, border,
  218. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  219. }else{
  220. PT_addCell(table21, "일금" + PCMSUtil.toHangule_decimal(PCMSUtil.convertFloor(listRowSet.getDouble("con_surtax_amt"), 0).toString()) , FontTitle, border,
  221. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  222. PT_addCell(table21, new String [] { "원정" }, FontTitle, border,
  223. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  224. PT_addCell(table21, "(" + "₩"+ PCMSUtil.convertFloor(listRowSet.getDouble("con_surtax_amt"), 0) + "원정" + ")", FontTitle, border,
  225. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  226. }
  227. permission.setColspan(3);
  228. table11.addCell(permission);
  229. setBorder(border, true, true, true, true);
  230. PT_addCell(table11, new String [] { "선급금" }, FontTitle, border,
  231. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 90f ,false);
  232. PdfPTable table31 = new PdfPTable(4);
  233. float[] table31Width = {13f,25f,5f,25f};
  234. table31.setWidths(table31Width);
  235. PdfPCell permission2 = new PdfPCell(table31);
  236. setBorder(border, false, false, false, false);
  237. PT_addCell(table31, new String [] { "합 계 :" }, FontTitle, border,
  238. Element.ALIGN_MIDDLE, Element.ALIGN_MIDDLE, 1, 30f ,false);
  239. if(listRowSet.get("req_amt").equals("0")){
  240. PT_addCell(table31, "일금" + PCMSUtil.toHangule_decimal("0"), FontTitle, border,
  241. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  242. PT_addCell(table31, new String [] { "원정" }, FontTitle, border,
  243. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  244. PT_addCell(table31, "(" + "₩" + PCMSUtil.convertFloor(listRowSet.getDouble("req_amt"), 0) + "원정" + ")", FontTitle, border,
  245. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  246. }else{
  247. PT_addCell(table31, "일금" + PCMSUtil.toHangule_decimal(PCMSUtil.convertFloor(listRowSet.getDouble("req_amt"), 0).toString()) , FontTitle, border,
  248. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  249. PT_addCell(table31, new String [] { "원정" }, FontTitle, border,
  250. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  251. PT_addCell(table31, "(" + "₩" + PCMSUtil.convertFloor(listRowSet.getDouble("req_amt"), 0) + "원정" + ")", FontTitle, border,
  252. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  253. }
  254. PT_addCell(table31, new String [] { "공급가 :" }, FontTitle, border,
  255. Element.ALIGN_MIDDLE, Element.ALIGN_MIDDLE, 1, 30f ,false);
  256. if(listRowSet.get("supply_amt").equals("0")){
  257. PT_addCell(table31, "일금" + PCMSUtil.toHangule_decimal("0"), FontTitle, border,
  258. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  259. PT_addCell(table31, new String [] { "원정" }, FontTitle, border,
  260. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  261. PT_addCell(table31, "(" + "₩" + PCMSUtil.convertFloor(listRowSet.getDouble("supply_amt"), 0)+ "원정" + ")", FontTitle, border,
  262. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  263. }else{
  264. PT_addCell(table31, "일금" + PCMSUtil.toHangule_decimal(PCMSUtil.convertFloor(listRowSet.getDouble("supply_amt"), 0).toString()) , FontTitle, border,
  265. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  266. PT_addCell(table31, new String [] { "원정" }, FontTitle, border,
  267. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  268. PT_addCell(table31, "(" + "₩" +PCMSUtil.convertFloor(listRowSet.getDouble("supply_amt"), 0) + "원정" + ")", FontTitle, border,
  269. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  270. }
  271. PT_addCell(table31, new String [] { "부가세 :" }, FontTitle, border,
  272. Element.ALIGN_MIDDLE, Element.ALIGN_MIDDLE, 1, 30f,false);
  273. if(listRowSet.get("surtax_amt").equals("0")){
  274. PT_addCell(table31, "일금" + PCMSUtil.toHangule_decimal("0"), FontTitle, border,
  275. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  276. PT_addCell(table31, new String [] { "원정" }, FontTitle, border,
  277. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  278. PT_addCell(table31, "(" + "₩" + PCMSUtil.convertFloor(listRowSet.getDouble("surtax_amt"), 0) + "원정" + ")", FontTitle, border,
  279. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  280. }else{
  281. PT_addCell(table31, "일금" + PCMSUtil.toHangule_decimal(PCMSUtil.convertFloor(listRowSet.getDouble("surtax_amt"), 0).toString()), FontTitle, border,
  282. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  283. PT_addCell(table31, new String [] { "원정" }, FontTitle, border,
  284. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  285. PT_addCell(table31, "(" + "₩" + PCMSUtil.convertFloor(listRowSet.getDouble("surtax_amt"), 0) + "원정" + ")", FontTitle, border,
  286. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  287. }
  288. permission2.setColspan(3);
  289. table11.addCell(permission2);
  290. setBorder(border, true, true, true, true);
  291. PT_addCell(table11, new String [] { "지급조건" }, FontTitle, border,
  292. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 30f ,false);
  293. PT_addCell(table11, " " + listRowSet.get("PAY_COND_GB_NM"), FontTitle, border,
  294. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 3, 30f ,false);
  295. PT_addCell(table11, new String [] { "지급조건기술" }, FontTitle, border,
  296. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 30f ,false);
  297. PT_addCell(table11, " " + listRowSet.get("PAY_CONTENT"), FontTitle, border,
  298. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 3, 30f ,false);
  299. PT_addCell(table11, new String [] { "지체상금" }, FontTitle, border,
  300. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 30f ,false);
  301. PT_addCell(table11, " " + listRowSet.get("DELAY_RATE"), FontTitle, border,
  302. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 3, 30f ,false);
  303. PT_addCell(table11, new String [] { "업체명" }, FontTitle, border,
  304. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 30f ,false);
  305. PT_addCell(table11, " " + listRowSet.get("CORP_KOR"), FontTitle, border,
  306. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 3, 30f ,false);
  307. PT_addCell(table11, new String [] { "특이사항" }, FontTitle, border,
  308. Element.ALIGN_CENTER, Element.ALIGN_TOP, 1, 100f ,false);
  309. PT_addCell(table11, " " + listRowSet.get("CON_SPE_TXT"), FontTitle, border,
  310. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 3, 100f ,false);
  311. /*
  312. */
  313. document.add(table11);
  314. } catch (DocumentException de) {
  315. WAFLogger.debug("de.getMessage() = " + de.getMessage());
  316. } catch (IOException ioe) {
  317. WAFLogger.debug("ioe.getMessage() = " + ioe.getMessage());
  318. } catch (Exception e) {
  319. WAFLogger.debug("[Exception] ... " + e);
  320. }
  321. // step 5
  322. document.close();
  323. WAFLogger.debug("\n\t #################### "+ strFileName +" 생성완료");
  324. }
  325. /*
  326. * ===========================================================================================
  327. * A. 타이틀
  328. * ===========================================================================================
  329. */
  330. /**
  331. * @param args
  332. */
  333. public void doBiz1(Connection con, OutputStream outputStream, String tmpslipID, HttpServletRequest request) {
  334. WAFLogger.debug("\n\t #################### 외주선급금계산서생성 시작");
  335. // step 1
  336. Document document = new Document(PageSize.A4, 25f, 25f, 35f, 10f);
  337. try {
  338. // step 2
  339. PdfWriter writer = PdfWriter.getInstance(document, outputStream);
  340. // step 3
  341. document.open();
  342. BaseFont bfKorean = BaseFont.createFont("HYGoThic-Medium", "UniKS-UCS2-H", BaseFont.NOT_EMBEDDED);
  343. Font FontTitle = new Font(bfKorean, 9, Font.NORMAL);
  344. FontTitle.setColor(borderColor);
  345. Font FontData = new Font(bfKorean, 4.8f, Font.NORMAL);
  346. Font FontTitle2 = new Font(bfKorean, 20, Font.BOLD);
  347. PdfPTable table = null;
  348. PdfPCell cell = null;
  349. /*
  350. * 정보 검색 시작 ---------------------------------------------
  351. */
  352. ValueObject params = new ValueObject();
  353. HandlerStorage storage = new HandlerStorage();
  354. storage.setParams(params);
  355. ValueObject listRowSet = null;
  356. /*
  357. * 정보 검색 시작 ---------------------------------------------
  358. */
  359. listRowSet = getPayReqList1(con, tmpslipID);
  360. // 정보 검색 끝 ---------------------------------------------
  361. /*
  362. * ===========================================================================================
  363. * 제목 생성
  364. * ===========================================================================================
  365. */
  366. makeTitle(document, FontTitle, FontTitle2, request);
  367. //본문생성
  368. setBorder(border, true, true, true, true);
  369. //1행
  370. PdfPTable table11 = new PdfPTable(4);
  371. table11.setWidthPercentage(100);
  372. table11.setSpacingBefore(7f);
  373. table11.setSpacingAfter(7f);
  374. float[] table11Width = {15f,40f,15f,15f};
  375. table11.setWidths(table11Width);
  376. // 1행
  377. PT_addCell(table11, new String [] { "현장" }, FontTitle, border,
  378. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 30f ,false);
  379. PT_addCell(table11, " " + "(" + listRowSet.get("DEPT_CD") + ")" + listRowSet.get("DEPT_NM") , FontTitle, border,
  380. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 3, 30f ,false);
  381. PT_addCell(table11, new String [] { "발주처" }, FontTitle, border,
  382. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 30f ,false);
  383. PT_addCell(table11, " " +listRowSet.get("DEALRER_NM"), FontTitle, border,
  384. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 3, 30f ,false);
  385. PT_addCell(table11, new String [] { "계약번호" }, FontTitle, border,
  386. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 30f ,false);
  387. PT_addCell(table11, " " +listRowSet.get("CON_DOC_NO"), FontTitle, border,
  388. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 30f,false);
  389. PT_addCell(table11, new String [] { "계약일자" }, FontTitle, border,
  390. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 30f ,false);
  391. PT_addCell(table11, " " +listRowSet.get("CON_DATE"), FontTitle, border,
  392. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 30f,false);
  393. PT_addCell(table11, new String [] { "계약명" }, FontTitle, border,
  394. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 30f ,false);
  395. PT_addCell(table11, " " +listRowSet.get("BUILD_NAME"), FontTitle, border,
  396. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 3, 30f ,false);
  397. PT_addCell(table11, new String [] { "원도급공사명" }, FontTitle, border,
  398. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 30f ,false);
  399. PT_addCell(table11, " " +listRowSet.get("UND_CON_NAME"), FontTitle, border,
  400. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 3, 30f,false);
  401. PT_addCell(table11, new String [] { "하도급공사명" }, FontTitle, border,
  402. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 30f ,false);
  403. PT_addCell(table11, " " +listRowSet.get("SUB_UND_CON_NAME"), FontTitle, border,
  404. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 3, 30f,false);
  405. PT_addCell(table11, new String [] { "공사장소" }, FontTitle, border,
  406. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 30f ,false);
  407. PT_addCell(table11, " " +listRowSet.get("WORK_PLACE"), FontTitle, border,
  408. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 3, 30f ,false);
  409. PT_addCell(table11, new String [] { "공사기간" }, FontTitle, border,
  410. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 30f ,false);
  411. PT_addCell(table11, " " +listRowSet.get("WORK_DATE"), FontTitle, border,
  412. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 3, 30f ,false);
  413. PT_addCell(table11, new String [] { "계약금액" }, FontTitle, border,
  414. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 90f ,false);
  415. PdfPTable table21 = new PdfPTable(4);
  416. float[] table21Width = {13f,25f,5f,25f};
  417. table21.setWidths(table21Width);
  418. PdfPCell permission = new PdfPCell(table21);
  419. setBorder(border, false, false, false, false);
  420. //2016.7.19 원정 listRowSet.get("CON_CUR_WON"), ₩ listRowSet.get("CON_CUR_NAME")
  421. PT_addCell(table21, new String [] { "합 계 :" }, FontTitle, border,
  422. Element.ALIGN_MIDDLE, Element.ALIGN_MIDDLE, 1, 30f ,false);
  423. if(listRowSet.get("con_amt").equals("0")){
  424. PT_addCell(table21, "일금" + PCMSUtil.toHangule_decimal("0"), FontTitle, border,
  425. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  426. PT_addCell(table21, new String [] { listRowSet.get("CON_CUR_WON") }, FontTitle, border,
  427. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  428. PT_addCell(table21, "(" + listRowSet.get("CON_CUR_NAME") + PCMSUtil.convertFloor(listRowSet.getDouble("con_amt"), 0) + ")", FontTitle, border,
  429. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  430. }else{
  431. PT_addCell(table21, "일금" + PCMSUtil.toHangule_decimal(PCMSUtil.convertFloor(listRowSet.getDouble("con_amt"), 0).toString()), FontTitle, border,
  432. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  433. PT_addCell(table21, new String [] { listRowSet.get("CON_CUR_WON")}, FontTitle, border,
  434. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  435. PT_addCell(table21,"(" + listRowSet.get("CON_CUR_NAME") + PCMSUtil.convertFloor(listRowSet.getDouble("con_amt"), 0) + ")", FontTitle, border,
  436. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  437. }
  438. PT_addCell(table21, new String [] { "공급가 :" }, FontTitle, border,
  439. Element.ALIGN_MIDDLE, Element.ALIGN_MIDDLE, 1, 30f ,false);
  440. if(listRowSet.get("con_supply_amt").equals("0")){
  441. PT_addCell(table21, "일금" + PCMSUtil.toHangule_decimal("0"), FontTitle, border,
  442. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  443. PT_addCell(table21, new String [] { listRowSet.get("CON_CUR_WON") }, FontTitle, border,
  444. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  445. PT_addCell(table21, "(" + listRowSet.get("CON_CUR_NAME") + PCMSUtil.convertFloor(listRowSet.getDouble("con_supply_amt"), 0) + ")", FontTitle, border,
  446. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  447. }else{
  448. PT_addCell(table21, "일금" + PCMSUtil.toHangule_decimal(PCMSUtil.convertFloor(listRowSet.getDouble("con_supply_amt"), 0).toString()), FontTitle, border,
  449. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  450. PT_addCell(table21, new String [] { listRowSet.get("CON_CUR_WON") }, FontTitle, border,
  451. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  452. PT_addCell(table21, "(" + listRowSet.get("CON_CUR_NAME") + PCMSUtil.convertFloor(listRowSet.getDouble("con_supply_amt"), 0) + ")", FontTitle, border,
  453. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  454. }
  455. PT_addCell(table21, new String [] { "- 과세 :" }, FontTitle, border,
  456. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  457. if(listRowSet.get("con_supply_tamt").equals("0")){
  458. PT_addCell(table21, "일금" + PCMSUtil.toHangule_decimal("0"), FontTitle, border,
  459. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  460. PT_addCell(table21, new String [] { listRowSet.get("CON_CUR_WON") }, FontTitle, border,
  461. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  462. PT_addCell(table21, "(" + listRowSet.get("CON_CUR_NAME")+ PCMSUtil.convertFloor(listRowSet.getDouble("con_supply_tamt"), 0) + ")", FontTitle, border,
  463. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  464. }else{
  465. PT_addCell(table21, "일금" + PCMSUtil.toHangule_decimal(PCMSUtil.convertFloor(listRowSet.getDouble("con_supply_tamt"), 0).toString()), FontTitle, border,
  466. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  467. PT_addCell(table21, new String [] { listRowSet.get("CON_CUR_WON") }, FontTitle, border,
  468. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  469. PT_addCell(table21, "(" + listRowSet.get("CON_CUR_NAME") + PCMSUtil.convertFloor(listRowSet.getDouble("con_supply_tamt"), 0) + ")", FontTitle, border,
  470. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  471. }
  472. PT_addCell(table21, new String [] { "- 면세 :" }, FontTitle, border,
  473. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  474. if(listRowSet.get("con_supply_namt").equals("0")){
  475. PT_addCell(table21, "일금" + PCMSUtil.toHangule_decimal("0"), FontTitle, border,
  476. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  477. PT_addCell(table21, new String [] { listRowSet.get("CON_CUR_WON") }, FontTitle, border,
  478. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  479. PT_addCell(table21, "(" + listRowSet.get("CON_CUR_NAME") + PCMSUtil.convertFloor(listRowSet.getDouble("con_supply_namt"), 0) + ")", FontTitle, border,
  480. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  481. }else{
  482. PT_addCell(table21, "일금" + PCMSUtil.toHangule_decimal(PCMSUtil.convertFloor(listRowSet.getDouble("con_supply_namt"), 0).toString()), FontTitle, border,
  483. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  484. PT_addCell(table21, new String [] { listRowSet.get("CON_CUR_WON") }, FontTitle, border,
  485. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  486. PT_addCell(table21, "(" + listRowSet.get("CON_CUR_NAME") + PCMSUtil.convertFloor(listRowSet.getDouble("con_supply_namt"), 0) + ")", FontTitle, border,
  487. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  488. }
  489. PT_addCell(table21, new String [] { "부가세 :" }, FontTitle, border,
  490. Element.ALIGN_MIDDLE, Element.ALIGN_MIDDLE, 1, 30f ,false);
  491. if(listRowSet.get("con_surtax_amt").equals("0")){
  492. PT_addCell(table21, "일금" + PCMSUtil.toHangule_decimal("0"), FontTitle, border,
  493. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  494. PT_addCell(table21, new String [] { listRowSet.get("CON_CUR_WON") }, FontTitle, border,
  495. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  496. PT_addCell(table21, "(" + listRowSet.get("CON_CUR_NAME") + PCMSUtil.convertFloor(listRowSet.getDouble("con_surtax_amt"), 0) + ")", FontTitle, border,
  497. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  498. }else{
  499. PT_addCell(table21, "일금" + PCMSUtil.toHangule_decimal(PCMSUtil.convertFloor(listRowSet.getDouble("con_surtax_amt"), 0).toString()) , FontTitle, border,
  500. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  501. PT_addCell(table21, new String [] { listRowSet.get("CON_CUR_WON") }, FontTitle, border,
  502. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  503. PT_addCell(table21, "(" + listRowSet.get("CON_CUR_NAME") + PCMSUtil.convertFloor(listRowSet.getDouble("con_surtax_amt"), 0) + ")", FontTitle, border,
  504. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  505. }
  506. permission.setColspan(3);
  507. table11.addCell(permission);
  508. setBorder(border, true, true, true, true);
  509. PT_addCell(table11, new String [] { "선급금" }, FontTitle, border,
  510. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 90f ,false);
  511. PdfPTable table31 = new PdfPTable(4);
  512. float[] table31Width = {13f,25f,5f,25f};
  513. table31.setWidths(table31Width);
  514. PdfPCell permission2 = new PdfPCell(table31);
  515. setBorder(border, false, false, false, false);
  516. PT_addCell(table31, new String [] { "합 계 :" }, FontTitle, border,
  517. Element.ALIGN_MIDDLE, Element.ALIGN_MIDDLE, 1, 30f ,false);
  518. if(listRowSet.get("req_amt").equals("0")){
  519. PT_addCell(table31, "일금" + PCMSUtil.toHangule_decimal("0"), FontTitle, border,
  520. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  521. PT_addCell(table31, new String [] { listRowSet.get("CON_CUR_WON")}, FontTitle, border,
  522. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  523. PT_addCell(table31, "(" + listRowSet.get("CON_CUR_NAME") + PCMSUtil.convertFloor(listRowSet.getDouble("req_amt"), 0) + ")", FontTitle, border,
  524. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  525. }else{
  526. PT_addCell(table31, "일금" + PCMSUtil.toHangule_decimal(PCMSUtil.convertFloor(listRowSet.getDouble("req_amt"), 0).toString()) , FontTitle, border,
  527. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  528. PT_addCell(table31, new String [] { listRowSet.get("CON_CUR_WON")}, FontTitle, border,
  529. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  530. PT_addCell(table31, "(" + listRowSet.get("CON_CUR_NAME") + PCMSUtil.convertFloor(listRowSet.getDouble("req_amt"), 0) + ")", FontTitle, border,
  531. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  532. }
  533. PT_addCell(table31, new String [] { "공급가 :" }, FontTitle, border,
  534. Element.ALIGN_MIDDLE, Element.ALIGN_MIDDLE, 1, 30f ,false);
  535. if(listRowSet.get("supply_amt").equals("0")){
  536. PT_addCell(table31, "일금" + PCMSUtil.toHangule_decimal("0"), FontTitle, border,
  537. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  538. PT_addCell(table31, new String [] { listRowSet.get("CON_CUR_WON") }, FontTitle, border,
  539. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  540. PT_addCell(table31, "(" + listRowSet.get("CON_CUR_NAME") + PCMSUtil.convertFloor(listRowSet.getDouble("supply_amt"), 0) + ")", FontTitle, border,
  541. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  542. }else{
  543. PT_addCell(table31, "일금" + PCMSUtil.toHangule_decimal(PCMSUtil.convertFloor(listRowSet.getDouble("supply_amt"), 0).toString()) , FontTitle, border,
  544. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  545. PT_addCell(table31, new String [] { listRowSet.get("CON_CUR_WON") }, FontTitle, border,
  546. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  547. PT_addCell(table31, "(" + listRowSet.get("CON_CUR_NAME") +PCMSUtil.convertFloor(listRowSet.getDouble("supply_amt"), 0) + ")", FontTitle, border,
  548. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  549. }
  550. PT_addCell(table31, new String [] { "부가세 :" }, FontTitle, border,
  551. Element.ALIGN_MIDDLE, Element.ALIGN_MIDDLE, 1, 30f,false);
  552. if(listRowSet.get("surtax_amt").equals("0")){
  553. PT_addCell(table31, "일금" + PCMSUtil.toHangule_decimal("0"), FontTitle, border,
  554. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  555. PT_addCell(table31, new String [] {listRowSet.get("CON_CUR_WON") }, FontTitle, border,
  556. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  557. PT_addCell(table31, "(" + listRowSet.get("CON_CUR_NAME") + PCMSUtil.convertFloor(listRowSet.getDouble("surtax_amt"), 0) + ")", FontTitle, border,
  558. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  559. }else{
  560. PT_addCell(table31, "일금" + PCMSUtil.toHangule_decimal(PCMSUtil.convertFloor(listRowSet.getDouble("surtax_amt"), 0).toString()), FontTitle, border,
  561. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  562. PT_addCell(table31, new String [] {listRowSet.get("CON_CUR_WON") }, FontTitle, border,
  563. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  564. PT_addCell(table31, "(" + listRowSet.get("CON_CUR_NAME") + PCMSUtil.convertFloor(listRowSet.getDouble("surtax_amt"), 0) + ")", FontTitle, border,
  565. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  566. }
  567. permission2.setColspan(3);
  568. table11.addCell(permission2);
  569. setBorder(border, true, true, true, true);
  570. PT_addCell(table11, new String [] { "지급조건" }, FontTitle, border,
  571. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 30f ,false);
  572. PT_addCell(table11, " " + listRowSet.get("PAY_COND_GB_NM"), FontTitle, border,
  573. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 3, 30f ,false);
  574. PT_addCell(table11, new String [] { "지급조건기술" }, FontTitle, border,
  575. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 30f ,false);
  576. PT_addCell(table11, " " + listRowSet.get("PAY_CONTENT"), FontTitle, border,
  577. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 3, 30f ,false);
  578. PT_addCell(table11, new String [] { "지체상금" }, FontTitle, border,
  579. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 30f ,false);
  580. PT_addCell(table11, " " + listRowSet.get("DELAY_RATE"), FontTitle, border,
  581. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 3, 30f ,false);
  582. PT_addCell(table11, new String [] { "업체명" }, FontTitle, border,
  583. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 30f ,false);
  584. PT_addCell(table11, " " + listRowSet.get("CORP_KOR"), FontTitle, border,
  585. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 3, 30f ,false);
  586. PT_addCell(table11, new String [] { "특이사항" }, FontTitle, border,
  587. Element.ALIGN_CENTER, Element.ALIGN_TOP, 1, 100f ,false);
  588. PT_addCell(table11, " " + listRowSet.get("CON_SPE_TXT"), FontTitle, border,
  589. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 3, 100f ,false);
  590. /*
  591. */
  592. document.add(table11);
  593. } catch (DocumentException de) {
  594. WAFLogger.debug("de.getMessage() = " + de.getMessage());
  595. } catch (IOException ioe) {
  596. WAFLogger.debug("ioe.getMessage() = " + ioe.getMessage());
  597. } catch (Exception e) {
  598. WAFLogger.debug("[Exception] ... " + e);
  599. }
  600. // step 5
  601. document.close();
  602. WAFLogger.debug("\n\t #################### "+ strFileName +" 생성완료");
  603. }
  604. private static void makeTitle(Document document, Font FontTitle,
  605. Font FontTitle2, HttpServletRequest request) throws Exception {
  606. PdfPTable tbl_Title = new PdfPTable(2);
  607. tbl_Title.setWidthPercentage(40f);
  608. float[] tbl_TitleWidths = {10f,10f};
  609. tbl_Title.setWidths(tbl_TitleWidths);
  610. PdfPCell title= new PdfPCell(new Paragraph("외주선급금계산서", FontTitle2));
  611. title.setColspan(2);
  612. title.setHorizontalAlignment(Element.ALIGN_CENTER);
  613. title.setVerticalAlignment(Element.ALIGN_MIDDLE);
  614. title.setFixedHeight(40f);
  615. title.setBorder(0);
  616. //title.setBorderWidthBottom(1);
  617. tbl_Title.addCell(title);
  618. document.add(tbl_Title);
  619. }
  620. /*
  621. * ===========================================================================================
  622. * B. 데이터 입력
  623. * ===========================================================================================
  624. */
  625. /*
  626. * ===========================================================================================
  627. * 기타
  628. * ===========================================================================================
  629. */
  630. // PdfPCell을 리턴하자
  631. private static PdfPCell PC_addCell(String strText, Font FontTitle,
  632. Rectangle border, int HA, int VA, int CS) {
  633. // 추가할 Cell 생성
  634. PdfPCell cell = new PdfPCell(new Paragraph(strText, FontTitle));
  635. // PdfPCell cell = new PdfPCell(new Paragraph(strText));
  636. // Cell Border 설정
  637. // setBorder(cell, blnLEFT, blnRIGHT, blnTOP, blnBOTTOM);
  638. cell.cloneNonPositionParameters(border);
  639. // 가로/세로 정렬
  640. cell.setHorizontalAlignment(HA);
  641. cell.setVerticalAlignment(VA);
  642. // setColspan
  643. if (CS > 1)
  644. cell.setColspan(CS);
  645. // cell.setPadding(0);
  646. if( isGray )
  647. cell.setGrayFill(0.8f);
  648. //if( LineisGray )
  649. // cell.setGrayFill(0.9f);
  650. //cell.setBackgroundColor(arg0)
  651. return cell;
  652. }
  653. // Cell Border 설정
  654. private static void setBorder(Rectangle border, boolean blnLEFT,
  655. boolean blnRIGHT, boolean blnTOP, boolean blnBOTTOM) {
  656. border.setBorderColor(borderColor);
  657. if (blnLEFT) {
  658. border.setBorderWidthLeft(BorderW);
  659. } else {
  660. border.setBorderWidthLeft(0);
  661. }
  662. if (blnRIGHT) {
  663. border.setBorderWidthRight(BorderW);
  664. } else {
  665. border.setBorderWidthRight(0);
  666. }
  667. if (blnTOP) {
  668. border.setBorderWidthTop(BorderW);
  669. } else {
  670. border.setBorderWidthTop(0);
  671. }
  672. if (blnBOTTOM) {
  673. border.setBorderWidthBottom(BorderW);
  674. } else {
  675. border.setBorderWidthBottom(0);
  676. }
  677. }
  678. // PdfPTable에 Cell 을 추가하자
  679. private static void PT_addCell(PdfPTable table, String[] arrText,
  680. Font FontTitle, Rectangle border, int HA, int VA, int CS) {
  681. for (int i = 0; i < arrText.length; i++) {
  682. PT_addCell(table, arrText[i], FontTitle, border, HA, VA, CS);
  683. }
  684. }
  685. private static void PT_addCell(PdfPTable table, String[] arrText,
  686. Font FontTitle, Rectangle border, int HA, int VA, int CS, float RH, boolean CL) {
  687. for (int i = 0; i < arrText.length; i++) {
  688. PT_addCell(table, arrText[i], FontTitle, border, HA, VA, CS, RH, CL);
  689. }
  690. }
  691. private static void PT_addCell(PdfPTable table, String strText,
  692. Font FontTitle, Rectangle border, int HA, int VA, int CS) {
  693. // 추가할 Cell 생성
  694. PdfPCell cell = PC_addCell(strText, FontTitle, border, HA, VA, CS);
  695. table.addCell(cell);
  696. }
  697. // PdfPTable에 Cell 을 추가하자(행높이 추가)
  698. private static void PT_addCell(PdfPTable table, String strText,
  699. Font FontTitle, Rectangle border, int HA, int VA, int CS, float RH, boolean CL) {
  700. // 추가할 Cell 생성
  701. PdfPCell cell = PC_addCell(strText, FontTitle, border, HA, VA, CS);
  702. // 셀 높이
  703. if (RH > 0)
  704. cell.setFixedHeight(RH);
  705. if (CL) {
  706. cell.setBackgroundColor(Color.lightGray);
  707. } else {
  708. cell.setBackgroundColor(Color.white);
  709. }
  710. table.addCell(cell);
  711. }
  712. public ValueObject getPayReqList(String tmpslipID ){
  713. Search search = new SearchImpl();
  714. ValueObject vo = null;
  715. RowSet rowSet = new RowSetImpl();
  716. StringBuffer sql = new StringBuffer();
  717. try{
  718. sql.append(" SELECT MAIN.TMPSLIP_ID \n");
  719. sql.append(" , TO_CHAR(MAIN.PROOFDATE, 'YYYY-MM-DD') PROOFDATE \n");
  720. sql.append(" , MAIN.DEPT_CD \n");
  721. sql.append(" , CONTRACT.DEALER_NM AS DEALRER_NM \n");
  722. sql.append(" , CONTRACT.DEPT_NAME AS DEPT_NM \n");
  723. sql.append(" , CONTRACT.CON_DOC_NO AS CON_DOC_NO \n");
  724. sql.append(" , TO_CHAR(CONTRACT.CON_DATE,'YYYY-MM-DD') AS CON_DATE \n");
  725. sql.append(" , CONTRACT.BUILD_NAME AS BUILD_NAME \n");
  726. sql.append(" , CONTRACT.UND_CON_NAME AS UND_CON_NAME \n");
  727. sql.append(" , CONTRACT.SUB_UND_CON_NAME AS SUB_UND_CON_NAME \n");
  728. sql.append(" , CONTRACT.WORK_PLACE AS WORK_PLACE \n");
  729. sql.append(" , CONTRACT.CON_SUPPLY_AMT AS con_supply_amt \n");
  730. sql.append(" , CONTRACT.CON_SUPPLY_TAMT AS con_supply_tamt \n");
  731. sql.append(" , CONTRACT.CON_SUPPLY_NAMT AS con_supply_namt \n");
  732. sql.append(" , CONTRACT.CON_SURTAX_AMT \n");
  733. sql.append(" , CONTRACT.CON_AMT \n");
  734. sql.append(" , CONTRACT.LABOR_AMT \n");
  735. sql.append(" , CONTRACT.PREPAY_SUPPLY_AMT AS PREPAY_SUPPLY_AMT \n");
  736. sql.append(" , CONTRACT.PREPAY_SUPPLY_TAMT AS PREPAY_SUPPLY_TAMT \n");
  737. sql.append(" , CONTRACT.PREPAY_SUPPLY_NAMT AS PREPAY_SUPPLY_NAMT \n");
  738. sql.append(" , CONTRACT.PREPAY_SURTAX_AMT AS PREPAY_SURTAX_AMT \n");
  739. sql.append(" , CONTRACT.PREPAY_AMT AS PREPAY_AMT \n");
  740. sql.append(" , PAY_TYPE.CHG_CODE01 AS PAY_COND_GB_NM \n");
  741. sql.append(" , CONTRACT.PAY_CONTENT AS PAY_CONTENT \n");
  742. sql.append(" , (TO_CHAR(CONTRACT.START_WORK_DATE,'YYYY-MM-DD') || ' ~ ' || TO_CHAR(CONTRACT.END_WORK_DATE,'YYYY-MM-DD') ) WORK_DATE \n");
  743. sql.append(" , CONTRACT.CON_EST_GUAR_RATE AS CON_EST_GUAR_RATE \n");
  744. sql.append(" , CONTRACT.CON_EST_GUAR_AMT \n");
  745. sql.append(" , CONTRACT.CON_GUAR_TERM AS CON_GUAR_TERM \n");
  746. sql.append(" , CONTRACT.DEF_EST_GUAR_RATE AS DEF_EST_GUAR_RATE \n");
  747. sql.append(" , CONTRACT.DEF_GUAR_AMT \n");
  748. sql.append(" , CONTRACT.DEF_EST_TERM AS DEF_EST_TERM \n");
  749. sql.append(" , CONTRACT.LABOR_GUAR_JOIN_AMT_GB AS LABOR_GUAR_JOIN_AMT_GB \n");
  750. sql.append(" , CONTRACT.CON_SPE_TXT AS CON_SPE_TXT \n");
  751. sql.append(" , CONTRACT.DELAY_RATE AS DELAY_RATE \n");
  752. sql.append(" , CUR_CD.CHG_CODE02 as CON_CUR_NAME \n");
  753. sql.append(" , CUR_CD.CHG_CODE06 as CON_CUR_WON \n");
  754. sql.append(" , CUR_CD.CHG_CODE01 as CON_CUR_DIGIT \n");
  755. sql.append(" , MAIN.DCERTI_NO \n");
  756. sql.append(" , SUBVENDOR.CORP_KOR AS CORP_KOR \n");
  757. sql.append(" , SUBVENDOR.CORP_ID \n");
  758. sql.append(" , MAIN.PREREQTFLG \n");
  759. sql.append(" , MAIN.ACMP_NO \n");
  760. sql.append(" , MAIN.PROOF_CLASS \n");
  761. sql.append(" , MAIN.ORDACCDESC \n");
  762. sql.append(" , MAIN.CON_CUR_CD \n");
  763. sql.append(" , MAIN.SUPPLY_AMT SUPPLY_AMT \n");
  764. sql.append(" , MAIN.SURTAX_AMT SURTAX_AMT \n");
  765. sql.append(" , MAIN.SUPPLY_AMT + MAIN.SURTAX_AMT REQ_AMT \n");
  766. sql.append(" , CONTRACT.CON_CHARGE_ID \n");
  767. sql.append(" , CONTRACT.CON_CHARGE_NAME \n");
  768. sql.append(" , MAIN.DEALR_CD \n");
  769. sql.append(" , MAIN.PAYITEM \n");
  770. sql.append(" , MAIN.COSTCODE \n");
  771. sql.append(" , MAIN.COSTTYPE \n");
  772. sql.append(" , MAIN.ACC_CLASS \n");
  773. sql.append(" , MAIN.PAY_GROUP \n");
  774. sql.append(" , MAIN.PAYMENT_TERMS \n");
  775. sql.append(" , MAIN.TMPSLIP_DEPT \n");
  776. sql.append(" , MAIN.TMPSLIP_DT \n");
  777. sql.append(" , MAIN.TMPSLIP_NO \n");
  778. sql.append(" , MAIN.TMPSLIP_YN \n");
  779. sql.append(" , MAIN.SLIP_YN \n");
  780. sql.append(" , MAIN.ACMP_ID \n");
  781. sql.append(" , MAIN.PREPAY_ID \n");
  782. sql.append(" , PREPAY.CON_CORP_ID \n");
  783. sql.append(" , CONTRACT.SUB_CONT_ID \n");
  784. sql.append(" , CASE \n");
  785. sql.append(" WHEN (SLIP.STATUS_CD = '1') AND (SLIP.RETURN_CD = 'Y') THEN '-1' \n");
  786. sql.append(" ELSE SLIP.STATUS_CD \n");
  787. sql.append(" END STATUS_CD \n");
  788. sql.append(" \n");
  789. sql.append(" FROM SUB1050T MAIN \n");
  790. sql.append(" \n");
  791. sql.append(" LEFT OUTER JOIN SUB1030T PREPAY \n");
  792. sql.append(" ON MAIN.PREPAY_ID = PREPAY.PREPAY_ID \n");
  793. sql.append(" \n");
  794. sql.append(" LEFT OUTER JOIN SUB1020T SUBVENDOR \n");
  795. sql.append(" ON SUBVENDOR.MAIN_CORP = 'Y' \n");
  796. sql.append(" AND PREPAY.CON_CORP_ID = SUBVENDOR.CON_CORP_ID \n");
  797. sql.append(" \n");
  798. sql.append(" LEFT OUTER JOIN SUB1000T CONTRACT \n");
  799. sql.append(" ON PREPAY.SUB_CONT_ID = CONTRACT.SUB_CONT_ID \n");
  800. sql.append(" \n");
  801. sql.append(" LEFT OUTER JOIN SAC01001 SLIP \n");
  802. sql.append(" ON MAIN.TMPSLIP_DEPT = SLIP.TMPSLIP_DEPT \n");
  803. sql.append(" AND MAIN.TMPSLIP_DT = SLIP.TMPSLIP_DT \n");
  804. sql.append(" AND MAIN.TMPSLIP_NO = SLIP.TMPSLIP_NO \n");
  805. sql.append(" \n");
  806. sql.append(" LEFT OUTER JOIN COM911T CON_KIND \n");
  807. sql.append(" ON CON_KIND.BASECD = 'SUB_CON_KIND' \n");
  808. sql.append(" AND CONTRACT.CON_GB = CON_KIND.DETAILCD \n");
  809. sql.append(" \n");
  810. sql.append(" LEFT OUTER JOIN COM911T PAY_TYPE \n");
  811. sql.append(" ON PAY_TYPE.BASECD = 'SUB_ACMP_PAY_TYPE' \n");
  812. sql.append(" AND CONTRACT.PAY_COND_GB = PAY_TYPE.DETAILCD \n");
  813. sql.append(" \n");
  814. sql.append(" LEFT OUTER JOIN COM911T CUR_CD \n");
  815. sql.append(" ON CUR_CD.BASECD = '911' \n");
  816. sql.append(" AND CONTRACT.CON_CUR_CD = CUR_CD.DETAILCD \n");
  817. sql.append(" \n");
  818. sql.append(" WHERE PREREQTFLG = 'PREPAY' \n");
  819. sql.append(" AND TMPSLIP_ID = "+tmpslipID+" \n");
  820. sql.append(" ORDER BY PROOFDATE desc, DEPT_NAME, CON_DOC_NO, CORP_KOR \n");
  821. search.setStatement(sql.toString());
  822. rowSet = search.execute();
  823. if(rowSet.size()>0){
  824. vo = RowSetUtility.getValueObject(rowSet.getRow(0));
  825. }
  826. }catch(Exception e){
  827. WAFLogger.error("SQL : " + search.getStatement());
  828. WAFLogger.error(e);
  829. }finally{
  830. if( vo == null) vo = new ValueObject();
  831. }
  832. return vo;
  833. }
  834. public ValueObject getPayReqList1(Connection con, String tmpslipID ){
  835. ValueObject vo = null;
  836. RowSet rowSet = new RowSetImpl();
  837. StringBuffer sql = new StringBuffer();
  838. Persistent pSelect = null;
  839. try{
  840. pSelect = new PersistentImpl(con);
  841. sql.append(" SELECT MAIN.TMPSLIP_ID \n");
  842. sql.append(" , TO_CHAR(MAIN.PROOFDATE, 'YYYY-MM-DD') PROOFDATE \n");
  843. sql.append(" , MAIN.DEPT_CD \n");
  844. sql.append(" , CONTRACT.DEALER_NM AS DEALRER_NM \n");
  845. sql.append(" , CONTRACT.DEPT_NAME AS DEPT_NM \n");
  846. sql.append(" , CONTRACT.CON_DOC_NO AS CON_DOC_NO \n");
  847. sql.append(" , TO_CHAR(CONTRACT.CON_DATE,'YYYY-MM-DD') AS CON_DATE \n");
  848. sql.append(" , CONTRACT.BUILD_NAME AS BUILD_NAME \n");
  849. sql.append(" , CONTRACT.UND_CON_NAME AS UND_CON_NAME \n");
  850. sql.append(" , CONTRACT.SUB_UND_CON_NAME AS SUB_UND_CON_NAME \n");
  851. sql.append(" , CONTRACT.WORK_PLACE AS WORK_PLACE \n");
  852. sql.append(" , CONTRACT.CON_SUPPLY_AMT AS con_supply_amt \n");
  853. sql.append(" , CONTRACT.CON_SUPPLY_TAMT AS con_supply_tamt \n");
  854. sql.append(" , CONTRACT.CON_SUPPLY_NAMT AS con_supply_namt \n");
  855. sql.append(" , CONTRACT.CON_SURTAX_AMT \n");
  856. sql.append(" , CONTRACT.CON_AMT \n");
  857. sql.append(" , CONTRACT.LABOR_AMT \n");
  858. sql.append(" , CONTRACT.PREPAY_SUPPLY_AMT AS PREPAY_SUPPLY_AMT \n");
  859. sql.append(" , CONTRACT.PREPAY_SUPPLY_TAMT AS PREPAY_SUPPLY_TAMT \n");
  860. sql.append(" , CONTRACT.PREPAY_SUPPLY_NAMT AS PREPAY_SUPPLY_NAMT \n");
  861. sql.append(" , CONTRACT.PREPAY_SURTAX_AMT AS PREPAY_SURTAX_AMT \n");
  862. sql.append(" , CONTRACT.PREPAY_AMT AS PREPAY_AMT \n");
  863. sql.append(" , PAY_TYPE.CHG_CODE01 AS PAY_COND_GB_NM \n");
  864. sql.append(" , CONTRACT.PAY_CONTENT AS PAY_CONTENT \n");
  865. sql.append(" , (TO_CHAR(CONTRACT.START_WORK_DATE,'YYYY-MM-DD') || ' ~ ' || TO_CHAR(CONTRACT.END_WORK_DATE,'YYYY-MM-DD') ) WORK_DATE \n");
  866. sql.append(" , CONTRACT.CON_EST_GUAR_RATE AS CON_EST_GUAR_RATE \n");
  867. sql.append(" , CONTRACT.CON_EST_GUAR_AMT \n");
  868. sql.append(" , CONTRACT.CON_GUAR_TERM AS CON_GUAR_TERM \n");
  869. sql.append(" , CONTRACT.DEF_EST_GUAR_RATE AS DEF_EST_GUAR_RATE \n");
  870. sql.append(" , CONTRACT.DEF_GUAR_AMT \n");
  871. sql.append(" , CONTRACT.DEF_EST_TERM AS DEF_EST_TERM \n");
  872. sql.append(" , CONTRACT.LABOR_GUAR_JOIN_AMT_GB AS LABOR_GUAR_JOIN_AMT_GB \n");
  873. sql.append(" , CONTRACT.CON_SPE_TXT AS CON_SPE_TXT \n");
  874. sql.append(" , CONTRACT.DELAY_RATE AS DELAY_RATE \n");
  875. sql.append(" , CUR_CD.CHG_CODE02 as CON_CUR_NAME \n");
  876. sql.append(" , CUR_CD.CHG_CODE06 as CON_CUR_WON \n");
  877. sql.append(" , CUR_CD.CHG_CODE01 as CON_CUR_DIGIT \n");
  878. sql.append(" , MAIN.DCERTI_NO \n");
  879. sql.append(" , SUBVENDOR.CORP_KOR AS CORP_KOR \n");
  880. sql.append(" , SUBVENDOR.CORP_ID \n");
  881. sql.append(" , MAIN.PREREQTFLG \n");
  882. sql.append(" , MAIN.ACMP_NO \n");
  883. sql.append(" , MAIN.PROOF_CLASS \n");
  884. sql.append(" , MAIN.ORDACCDESC \n");
  885. sql.append(" , MAIN.CON_CUR_CD \n");
  886. sql.append(" , MAIN.SUPPLY_AMT SUPPLY_AMT \n");
  887. sql.append(" , MAIN.SURTAX_AMT SURTAX_AMT \n");
  888. sql.append(" , MAIN.SUPPLY_AMT + MAIN.SURTAX_AMT REQ_AMT \n");
  889. sql.append(" , CONTRACT.CON_CHARGE_ID \n");
  890. sql.append(" , CONTRACT.CON_CHARGE_NAME \n");
  891. sql.append(" , MAIN.DEALR_CD \n");
  892. sql.append(" , MAIN.PAYITEM \n");
  893. sql.append(" , MAIN.COSTCODE \n");
  894. sql.append(" , MAIN.COSTTYPE \n");
  895. sql.append(" , MAIN.ACC_CLASS \n");
  896. sql.append(" , MAIN.PAY_GROUP \n");
  897. sql.append(" , MAIN.PAYMENT_TERMS \n");
  898. sql.append(" , MAIN.TMPSLIP_DEPT \n");
  899. sql.append(" , MAIN.TMPSLIP_DT \n");
  900. sql.append(" , MAIN.TMPSLIP_NO \n");
  901. sql.append(" , MAIN.TMPSLIP_YN \n");
  902. sql.append(" , MAIN.SLIP_YN \n");
  903. sql.append(" , MAIN.ACMP_ID \n");
  904. sql.append(" , MAIN.PREPAY_ID \n");
  905. sql.append(" , PREPAY.CON_CORP_ID \n");
  906. sql.append(" , CONTRACT.SUB_CONT_ID \n");
  907. /*
  908. sql.append(" , CASE \n");
  909. sql.append(" WHEN (SLIP.STATUS_CD = '1') AND (SLIP.RETURN_CD = 'Y') THEN '-1' \n");
  910. sql.append(" ELSE SLIP.STATUS_CD \n");
  911. sql.append(" END STATUS_CD \n");
  912. sql.append(" \n");
  913. */
  914. sql.append(" FROM SUB1050T MAIN \n");
  915. sql.append(" \n");
  916. sql.append(" LEFT OUTER JOIN SUB1030T PREPAY \n");
  917. sql.append(" ON MAIN.PREPAY_ID = PREPAY.PREPAY_ID \n");
  918. sql.append(" \n");
  919. sql.append(" LEFT OUTER JOIN SUB1020T SUBVENDOR \n");
  920. sql.append(" ON SUBVENDOR.MAIN_CORP = 'Y' \n");
  921. sql.append(" AND PREPAY.CON_CORP_ID = SUBVENDOR.CON_CORP_ID \n");
  922. sql.append(" \n");
  923. sql.append(" LEFT OUTER JOIN SUB1000T CONTRACT \n");
  924. sql.append(" ON PREPAY.SUB_CONT_ID = CONTRACT.SUB_CONT_ID \n");
  925. sql.append(" \n");
  926. /*
  927. sql.append(" LEFT OUTER JOIN SAC01001 SLIP \n");
  928. sql.append(" ON MAIN.TMPSLIP_DEPT = SLIP.TMPSLIP_DEPT \n");
  929. sql.append(" AND MAIN.TMPSLIP_DT = SLIP.TMPSLIP_DT \n");
  930. sql.append(" AND MAIN.TMPSLIP_NO = SLIP.TMPSLIP_NO \n");
  931. sql.append(" \n");
  932. */
  933. sql.append(" LEFT OUTER JOIN EBID_COM911T CON_KIND \n");
  934. sql.append(" ON CON_KIND.BASECD = 'SUB_CON_KIND' \n");
  935. sql.append(" AND CONTRACT.CON_GB = CON_KIND.DETAILCD \n");
  936. sql.append(" \n");
  937. sql.append(" LEFT OUTER JOIN EBID_COM911T PAY_TYPE \n");
  938. sql.append(" ON PAY_TYPE.BASECD = 'SUB_ACMP_PAY_TYPE' \n");
  939. sql.append(" AND CONTRACT.PAY_COND_GB = PAY_TYPE.DETAILCD \n");
  940. sql.append(" \n");
  941. sql.append(" LEFT OUTER JOIN EBID_COM911T CUR_CD \n");
  942. sql.append(" ON CUR_CD.BASECD = '911' \n");
  943. sql.append(" AND CONTRACT.CON_CUR_CD = CUR_CD.DETAILCD \n");
  944. sql.append(" \n");
  945. sql.append(" WHERE PREREQTFLG = 'PREPAY' \n");
  946. sql.append(" AND TMPSLIP_ID = "+tmpslipID+" \n");
  947. sql.append(" ORDER BY PROOFDATE desc, DEPT_NAME, CON_DOC_NO, CORP_KOR \n");
  948. System.out.println(sql.toString());
  949. pSelect.setStatement(sql.toString());
  950. rowSet = pSelect.query();
  951. if(rowSet.size()>0){
  952. vo = RowSetUtility.getValueObject(rowSet.getRow(0));
  953. }
  954. }catch(Exception e){
  955. WAFLogger.error("SQL : " + sql.toString());
  956. WAFLogger.error(e);
  957. }finally{
  958. if( vo == null) vo = new ValueObject();
  959. }
  960. return vo;
  961. }
  962. /**
  963. * @param args
  964. */
  965. public void doBiz1Rtn(Connection con, OutputStream outputStream, String tmpslipID, HttpServletRequest request) {
  966. WAFLogger.debug("\n\t #################### 외주선급금계산서반려 시작");
  967. // step 1
  968. Document document = new Document(PageSize.A4, 25f, 25f, 35f, 10f);
  969. try {
  970. // step 2
  971. PdfWriter writer = PdfWriter.getInstance(document, outputStream);
  972. // step 3
  973. document.open();
  974. BaseFont bfKorean = BaseFont.createFont("HYGoThic-Medium", "UniKS-UCS2-H", BaseFont.NOT_EMBEDDED);
  975. Font FontTitle = new Font(bfKorean, 9, Font.NORMAL);
  976. FontTitle.setColor(borderColor);
  977. Font FontData = new Font(bfKorean, 4.8f, Font.NORMAL);
  978. Font FontTitle2 = new Font(bfKorean, 20, Font.BOLD);
  979. PdfPTable table = null;
  980. PdfPCell cell = null;
  981. /*
  982. * 정보 검색 시작 ---------------------------------------------
  983. */
  984. ValueObject params = new ValueObject();
  985. HandlerStorage storage = new HandlerStorage();
  986. storage.setParams(params);
  987. ValueObject listRowSet = null;
  988. /*
  989. * 정보 검색 시작 ---------------------------------------------
  990. */
  991. listRowSet = getPayReqList1(con, tmpslipID);
  992. // 정보 검색 끝 ---------------------------------------------
  993. /*
  994. * ===========================================================================================
  995. * 제목 생성
  996. * ===========================================================================================
  997. */
  998. makeTitle(document, FontTitle, FontTitle2, request);
  999. //본문생성
  1000. setBorder(border, true, true, true, true);
  1001. //1행
  1002. PdfPTable table11 = new PdfPTable(4);
  1003. table11.setWidthPercentage(100);
  1004. table11.setSpacingBefore(7f);
  1005. table11.setSpacingAfter(7f);
  1006. float[] table11Width = {15f,40f,15f,15f};
  1007. table11.setWidths(table11Width);
  1008. // 1행
  1009. PT_addCell(table11, new String [] { "현장" }, FontTitle, border,
  1010. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 30f ,false);
  1011. PT_addCell(table11, " " + "(" + listRowSet.get("DEPT_CD") + ")" + listRowSet.get("DEPT_NM") , FontTitle, border,
  1012. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 3, 30f ,false);
  1013. PT_addCell(table11, new String [] { "발주처" }, FontTitle, border,
  1014. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 30f ,false);
  1015. PT_addCell(table11, " " +listRowSet.get("DEALRER_NM"), FontTitle, border,
  1016. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 3, 30f ,false);
  1017. PT_addCell(table11, new String [] { "계약번호" }, FontTitle, border,
  1018. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 30f ,false);
  1019. PT_addCell(table11, " " +listRowSet.get("CON_DOC_NO"), FontTitle, border,
  1020. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 30f,false);
  1021. PT_addCell(table11, new String [] { "계약일자" }, FontTitle, border,
  1022. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 30f ,false);
  1023. PT_addCell(table11, " " +listRowSet.get("CON_DATE"), FontTitle, border,
  1024. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 30f,false);
  1025. PT_addCell(table11, new String [] { "계약명" }, FontTitle, border,
  1026. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 30f ,false);
  1027. PT_addCell(table11, " " +listRowSet.get("BUILD_NAME"), FontTitle, border,
  1028. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 3, 30f ,false);
  1029. PT_addCell(table11, new String [] { "원도급공사명" }, FontTitle, border,
  1030. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 30f ,false);
  1031. PT_addCell(table11, " " +listRowSet.get("UND_CON_NAME"), FontTitle, border,
  1032. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 3, 30f,false);
  1033. PT_addCell(table11, new String [] { "하도급공사명" }, FontTitle, border,
  1034. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 30f ,false);
  1035. PT_addCell(table11, " " +listRowSet.get("SUB_UND_CON_NAME"), FontTitle, border,
  1036. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 3, 30f,false);
  1037. PT_addCell(table11, new String [] { "공사장소" }, FontTitle, border,
  1038. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 30f ,false);
  1039. PT_addCell(table11, " " +listRowSet.get("WORK_PLACE"), FontTitle, border,
  1040. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 3, 30f ,false);
  1041. PT_addCell(table11, new String [] { "공사기간" }, FontTitle, border,
  1042. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 30f ,false);
  1043. PT_addCell(table11, " " +listRowSet.get("WORK_DATE"), FontTitle, border,
  1044. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 3, 30f ,false);
  1045. PT_addCell(table11, new String [] { "계약금액" }, FontTitle, border,
  1046. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 90f ,false);
  1047. PdfPTable table21 = new PdfPTable(4);
  1048. float[] table21Width = {13f,25f,5f,25f};
  1049. table21.setWidths(table21Width);
  1050. PdfPCell permission = new PdfPCell(table21);
  1051. setBorder(border, false, false, false, false);
  1052. //2016.7.19 원정 listRowSet.get("CON_CUR_WON"), ₩listRowSet.get("CON_CUR_NAME")
  1053. PT_addCell(table21, new String [] { "합 계 :" }, FontTitle, border,
  1054. Element.ALIGN_MIDDLE, Element.ALIGN_MIDDLE, 1, 30f ,false);
  1055. if(listRowSet.get("con_amt").equals("0")){
  1056. PT_addCell(table21, "일금" + PCMSUtil.toHangule_decimal("0"), FontTitle, border,
  1057. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  1058. PT_addCell(table21, new String [] { listRowSet.get("CON_CUR_WON") }, FontTitle, border,
  1059. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  1060. PT_addCell(table21, "(" + listRowSet.get("CON_CUR_NAME") + PCMSUtil.convertFloor(listRowSet.getDouble("con_amt"), 0) + ")", FontTitle, border,
  1061. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  1062. }else{
  1063. PT_addCell(table21, "일금" + PCMSUtil.toHangule_decimal(PCMSUtil.convertFloor(listRowSet.getDouble("con_amt"), 0).toString()), FontTitle, border,
  1064. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  1065. PT_addCell(table21, new String [] { listRowSet.get("CON_CUR_WON") }, FontTitle, border,
  1066. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  1067. PT_addCell(table21,"(" + listRowSet.get("CON_CUR_NAME") + PCMSUtil.convertFloor(listRowSet.getDouble("con_amt"), 0) + ")", FontTitle, border,
  1068. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  1069. }
  1070. PT_addCell(table21, new String [] { "공급가 :" }, FontTitle, border,
  1071. Element.ALIGN_MIDDLE, Element.ALIGN_MIDDLE, 1, 30f ,false);
  1072. if(listRowSet.get("con_supply_amt").equals("0")){
  1073. PT_addCell(table21, "일금" + PCMSUtil.toHangule_decimal("0"), FontTitle, border,
  1074. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  1075. PT_addCell(table21, new String [] { listRowSet.get("CON_CUR_WON") }, FontTitle, border,
  1076. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  1077. PT_addCell(table21, "(" + listRowSet.get("CON_CUR_NAME") + PCMSUtil.convertFloor(listRowSet.getDouble("con_supply_amt"), 0) + ")", FontTitle, border,
  1078. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  1079. }else{
  1080. PT_addCell(table21, "일금" + PCMSUtil.toHangule_decimal(PCMSUtil.convertFloor(listRowSet.getDouble("con_supply_amt"), 0).toString()), FontTitle, border,
  1081. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  1082. PT_addCell(table21, new String [] { listRowSet.get("CON_CUR_WON") }, FontTitle, border,
  1083. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  1084. PT_addCell(table21, "(" + listRowSet.get("CON_CUR_NAME") + PCMSUtil.convertFloor(listRowSet.getDouble("con_supply_amt"), 0) + ")", FontTitle, border,
  1085. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  1086. }
  1087. PT_addCell(table21, new String [] { "- 과세 :" }, FontTitle, border,
  1088. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  1089. if(listRowSet.get("con_supply_tamt").equals("0")){
  1090. PT_addCell(table21, "일금" + PCMSUtil.toHangule_decimal("0"), FontTitle, border,
  1091. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  1092. PT_addCell(table21, new String [] { listRowSet.get("CON_CUR_WON") }, FontTitle, border,
  1093. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  1094. PT_addCell(table21, "(" + listRowSet.get("CON_CUR_NAME") + PCMSUtil.convertFloor(listRowSet.getDouble("con_supply_tamt"), 0) + ")", FontTitle, border,
  1095. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  1096. }else{
  1097. PT_addCell(table21, "일금" + PCMSUtil.toHangule_decimal(PCMSUtil.convertFloor(listRowSet.getDouble("con_supply_tamt"), 0).toString()), FontTitle, border,
  1098. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  1099. PT_addCell(table21, new String [] { listRowSet.get("CON_CUR_WON") }, FontTitle, border,
  1100. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  1101. PT_addCell(table21, "(" + listRowSet.get("CON_CUR_NAME") + PCMSUtil.convertFloor(listRowSet.getDouble("con_supply_tamt"), 0) + ")", FontTitle, border,
  1102. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  1103. }
  1104. PT_addCell(table21, new String [] { "- 면세 :" }, FontTitle, border,
  1105. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  1106. if(listRowSet.get("con_supply_namt").equals("0")){
  1107. PT_addCell(table21, "일금" + PCMSUtil.toHangule_decimal("0"), FontTitle, border,
  1108. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  1109. PT_addCell(table21, new String [] { listRowSet.get("CON_CUR_WON") }, FontTitle, border,
  1110. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  1111. PT_addCell(table21, "(" + listRowSet.get("CON_CUR_NAME") + PCMSUtil.convertFloor(listRowSet.getDouble("con_supply_namt"), 0) + ")", FontTitle, border,
  1112. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  1113. }else{
  1114. PT_addCell(table21, "일금" + PCMSUtil.toHangule_decimal(PCMSUtil.convertFloor(listRowSet.getDouble("con_supply_namt"), 0).toString()), FontTitle, border,
  1115. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  1116. PT_addCell(table21, new String [] { listRowSet.get("CON_CUR_WON") }, FontTitle, border,
  1117. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  1118. PT_addCell(table21, "(" + listRowSet.get("CON_CUR_NAME") + PCMSUtil.convertFloor(listRowSet.getDouble("con_supply_namt"), 0) + ")", FontTitle, border,
  1119. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  1120. }
  1121. PT_addCell(table21, new String [] { "부가세 :" }, FontTitle, border,
  1122. Element.ALIGN_MIDDLE, Element.ALIGN_MIDDLE, 1, 30f ,false);
  1123. if(listRowSet.get("con_surtax_amt").equals("0")){
  1124. PT_addCell(table21, "일금" + PCMSUtil.toHangule_decimal("0") , FontTitle, border,
  1125. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  1126. PT_addCell(table21, new String [] {listRowSet.get("CON_CUR_WON") }, FontTitle, border,
  1127. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  1128. PT_addCell(table21, "(" + listRowSet.get("CON_CUR_NAME") + PCMSUtil.convertFloor(listRowSet.getDouble("con_surtax_amt"), 0) + ")", FontTitle, border,
  1129. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  1130. }else{
  1131. PT_addCell(table21, "일금" + PCMSUtil.toHangule_decimal(PCMSUtil.convertFloor(listRowSet.getDouble("con_surtax_amt"), 0).toString()) , FontTitle, border,
  1132. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  1133. PT_addCell(table21, new String [] { listRowSet.get("CON_CUR_WON") }, FontTitle, border,
  1134. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  1135. PT_addCell(table21, "(" + listRowSet.get("CON_CUR_NAME")+ PCMSUtil.convertFloor(listRowSet.getDouble("con_surtax_amt"), 0) + ")", FontTitle, border,
  1136. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  1137. }
  1138. permission.setColspan(3);
  1139. table11.addCell(permission);
  1140. setBorder(border, true, true, true, true);
  1141. PT_addCell(table11, new String [] { "선급금" }, FontTitle, border,
  1142. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 90f ,false);
  1143. PdfPTable table31 = new PdfPTable(4);
  1144. float[] table31Width = {13f,25f,5f,25f};
  1145. table31.setWidths(table31Width);
  1146. PdfPCell permission2 = new PdfPCell(table31);
  1147. setBorder(border, false, false, false, false);
  1148. PT_addCell(table31, new String [] { "합 계 :" }, FontTitle, border,
  1149. Element.ALIGN_MIDDLE, Element.ALIGN_MIDDLE, 1, 30f ,false);
  1150. if(listRowSet.get("req_amt").equals("0")){
  1151. PT_addCell(table31, "일금" + PCMSUtil.toHangule_decimal("0"), FontTitle, border,
  1152. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  1153. PT_addCell(table31, new String [] { listRowSet.get("CON_CUR_WON") }, FontTitle, border,
  1154. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  1155. PT_addCell(table31, "(" + listRowSet.get("CON_CUR_NAME") + PCMSUtil.convertFloor(listRowSet.getDouble("req_amt"), 0) + ")", FontTitle, border,
  1156. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  1157. }else{
  1158. PT_addCell(table31, "일금" + PCMSUtil.toHangule_decimal(PCMSUtil.convertFloor(listRowSet.getDouble("req_amt"), 0).toString()) , FontTitle, border,
  1159. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  1160. PT_addCell(table31, new String [] { listRowSet.get("CON_CUR_WON") }, FontTitle, border,
  1161. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  1162. PT_addCell(table31, "(" + listRowSet.get("CON_CUR_NAME") + PCMSUtil.convertFloor(listRowSet.getDouble("req_amt"), 0) + ")", FontTitle, border,
  1163. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  1164. }
  1165. PT_addCell(table31, new String [] { "공급가 :" }, FontTitle, border,
  1166. Element.ALIGN_MIDDLE, Element.ALIGN_MIDDLE, 1, 30f ,false);
  1167. if(listRowSet.get("supply_amt").equals("0")){
  1168. PT_addCell(table31, "일금" + PCMSUtil.toHangule_decimal("0"), FontTitle, border,
  1169. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  1170. PT_addCell(table31, new String [] { listRowSet.get("CON_CUR_WON") }, FontTitle, border,
  1171. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  1172. PT_addCell(table31, "(" + listRowSet.get("CON_CUR_NAME") + PCMSUtil.convertFloor(listRowSet.getDouble("supply_amt"), 0)+ ")", FontTitle, border,
  1173. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  1174. }else{
  1175. PT_addCell(table31, "일금" + PCMSUtil.toHangule_decimal(PCMSUtil.convertFloor(listRowSet.getDouble("supply_amt"), 0).toString()) , FontTitle, border,
  1176. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  1177. PT_addCell(table31, new String [] { listRowSet.get("CON_CUR_WON") }, FontTitle, border,
  1178. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  1179. PT_addCell(table31, "(" + listRowSet.get("CON_CUR_NAME") +PCMSUtil.convertFloor(listRowSet.getDouble("supply_amt"), 0) + ")", FontTitle, border,
  1180. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  1181. }
  1182. PT_addCell(table31, new String [] { "부가세 :" }, FontTitle, border,
  1183. Element.ALIGN_MIDDLE, Element.ALIGN_MIDDLE, 1, 30f,false);
  1184. if(listRowSet.get("surtax_amt").equals("0")){
  1185. PT_addCell(table31, "일금" + PCMSUtil.toHangule_decimal("0"), FontTitle, border,
  1186. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  1187. PT_addCell(table31, new String [] { listRowSet.get("CON_CUR_WON") }, FontTitle, border,
  1188. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  1189. PT_addCell(table31, "(" + listRowSet.get("CON_CUR_NAME") + PCMSUtil.convertFloor(listRowSet.getDouble("surtax_amt"), 0) + ")", FontTitle, border,
  1190. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  1191. }else{
  1192. PT_addCell(table31, "일금" + PCMSUtil.toHangule_decimal(PCMSUtil.convertFloor(listRowSet.getDouble("surtax_amt"), 0).toString()), FontTitle, border,
  1193. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  1194. PT_addCell(table31, new String [] { listRowSet.get("CON_CUR_WON") }, FontTitle, border,
  1195. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  1196. PT_addCell(table31, "(" + listRowSet.get("CON_CUR_NAME") + PCMSUtil.convertFloor(listRowSet.getDouble("surtax_amt"), 0) + ")", FontTitle, border,
  1197. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 30f ,false);
  1198. }
  1199. permission2.setColspan(3);
  1200. table11.addCell(permission2);
  1201. setBorder(border, true, true, true, true);
  1202. PT_addCell(table11, new String [] { "지급조건" }, FontTitle, border,
  1203. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 30f ,false);
  1204. PT_addCell(table11, " " + listRowSet.get("PAY_COND_GB_NM"), FontTitle, border,
  1205. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 3, 30f ,false);
  1206. PT_addCell(table11, new String [] { "지급조건기술" }, FontTitle, border,
  1207. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 30f ,false);
  1208. PT_addCell(table11, " " + listRowSet.get("PAY_CONTENT"), FontTitle, border,
  1209. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 3, 30f ,false);
  1210. PT_addCell(table11, new String [] { "지체상금" }, FontTitle, border,
  1211. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 30f ,false);
  1212. PT_addCell(table11, " " + listRowSet.get("DELAY_RATE"), FontTitle, border,
  1213. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 3, 30f ,false);
  1214. PT_addCell(table11, new String [] { "업체명" }, FontTitle, border,
  1215. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 30f ,false);
  1216. PT_addCell(table11, " " + listRowSet.get("CORP_KOR"), FontTitle, border,
  1217. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 3, 30f ,false);
  1218. PT_addCell(table11, new String [] { "특이사항" }, FontTitle, border,
  1219. Element.ALIGN_CENTER, Element.ALIGN_TOP, 1, 100f ,false);
  1220. PT_addCell(table11, " " + listRowSet.get("CON_SPE_TXT"), FontTitle, border,
  1221. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 3, 100f ,false);
  1222. /*
  1223. */
  1224. document.add(table11);
  1225. } catch (DocumentException de) {
  1226. WAFLogger.debug("de.getMessage() = " + de.getMessage());
  1227. } catch (IOException ioe) {
  1228. WAFLogger.debug("ioe.getMessage() = " + ioe.getMessage());
  1229. } catch (Exception e) {
  1230. WAFLogger.debug("[Exception] ... " + e);
  1231. }
  1232. // step 5
  1233. document.close();
  1234. WAFLogger.debug("\n\t #################### "+ strFileName +" 생성완료");
  1235. }
  1236. }