itemList2.jsp 4.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <%
  2. if(!((params.get("TEMPLATE_CD").equals("6")) || (params.get("TEMPLATE_CD").equals("10")))){ //자유서식일경우 상품 목록 없음
  3. if(itemList.size()>0){
  4. %>
  5. <textarea id="testItemList" style="display:none;" >
  6. <table width="100%" border="0" cellpadding="0" cellspacing="0" style="border-top:2px solid black; padding:5px 0px 5px 0px">
  7. <colgroup><col width="30"><col width="*"><col width="*"><col width="50"><col width="100"><%if(!ContInfo.get("DIV_PO_YN").equals("Y")){%><col width="100"><%} %><col width="100"></colgroup>
  8. <tr>
  9. <td align="center" style="border-bottom:1px solid black; padding:2px 0px 5px 0px">NO</td>
  10. <td align="center" style="border-bottom:1px solid black; padding:2px 0px 5px 0px">품명</td>
  11. <td align="center" style="border-bottom:1px solid black; padding:2px 0px 5px 0px">규격</td>
  12. <td align="center" style="border-bottom:1px solid black; padding:2px 0px 5px 0px">단위</td>
  13. <td align="center" style="border-bottom:1px solid black; padding:2px 0px 5px 0px">수량</td>
  14. <td align="center" style="border-bottom:1px solid black; padding:2px 0px 5px 0px">단가(<%=curr_std_nm%>)</td>
  15. <%if(!ContInfo.get("DIV_PO_YN").equals("Y")){%>
  16. <td align="center" style="border-bottom:1px solid black; padding:2px 0px 5px 0px">금액(<%=curr_std_nm%>)</td>
  17. <%} %>
  18. </tr>
  19. <%
  20. double sum_qty=0;
  21. double sum_amt=0;
  22. for(int i=0;i<itemList.size();i++){
  23. sum_qty = sum_qty + itemList.getRow(i).getDouble("ITEM_QTY");
  24. sum_amt = sum_amt + itemList.getRow(i).getDouble("SUM_AMT");
  25. System.out.println("ITEM_QTY : " + itemList.getRow(i).getDouble("ITEM_QTY"));
  26. System.out.println("ITEM_PRICE : " + itemList.getRow(i).getDouble("ITEM_PRICE"));
  27. System.out.println("SUM_AMT : " + itemList.getRow(i).getDouble("SUM_AMT"));
  28. System.out.println("SUM_AMT : " + itemList.getRow(i).get("SUM_AMT"));
  29. System.out.println("SUM_AMT2 : " + Float.parseFloat(itemList.getRow(i).get("SUM_AMT")));
  30. System.out.println("item_price : "+ Float.parseFloat(itemList.getRow(i).get("ITEM_PRICE")));
  31. System.out.println("item_price2 : "+ Formatter2.currency(Float.parseFloat(itemList.getRow(i).get("ITEM_PRICE")), params.getInt("digit")));
  32. System.out.println("item_price3 : "+ Formatter2.currency(itemList.getRow(i).getDouble("ITEM_PRICE"), params.getInt("digit")));
  33. %>
  34. <tr>
  35. <td align="center" style="padding:2px 0px 2px 0px"><%=i+1%>.</td>
  36. <td style="padding:2px 0px 2px 0px">&nbsp;<%=itemList.getRow(i).get("ITEM_NAME")%></td>
  37. <td align="center" style="padding:2px 0px 2px 0px">&nbsp;<%=itemList.getRow(i).get("ITEM_SPEC")%></td>
  38. <td align="center" style="padding:2px 0px 2px 0px">&nbsp;<%=itemList.getRow(i).get("ITEM_UNIT_NM")%></td>
  39. <td align="right" style="padding:2px 0px 2px 0px"><%= ContInfo.get("DIV_PO_YN").equals("Y") ? "1":Formatter2.currency(itemList.getRow(i).getDouble("ITEM_QTY"),2)%>&nbsp;</td>
  40. <td align="right" style="padding:2px 0px 2px 0px"><%=Formatter2.currency(itemList.getRow(i).getDouble("ITEM_PRICE"), params.getInt("digit"))%>&nbsp;</td>
  41. <%if(!ContInfo.get("DIV_PO_YN").equals("Y")){%>
  42. <td align="right" style="padding:2px 0px 2px 0px"><%=Formatter2.currency(itemList.getRow(i).getDouble("SUM_AMT"), params.getInt("digit"))%>&nbsp;</td>
  43. <%} %>
  44. </tr>
  45. <%
  46. }
  47. %>
  48. <%if(!ContInfo.get("DIV_PO_YN").equals("Y")){%>
  49. <tr>
  50. <td colspan="4" align="center" style="border-top:1px solid black;border-bottom:1px solid black; padding:2px 0px 2px 0px"><b>합계</b></td>
  51. <td align="right" style="border-top:1px solid black;border-bottom:1px solid black; padding:2px 0px 2px 0px"><%=Formatter2.currency(sum_qty, 2)%>&nbsp;</td>
  52. <td colspan="2" align="right" style="border-top:1px solid black;border-bottom:1px solid black; padding:2px 0px 2px 0px"><%=Formatter2.currency(sum_amt, params.getInt("digit"))%>&nbsp;</td>
  53. </tr>
  54. <%}else{%>
  55. <tr>
  56. <td colspan="6" align="center" style="border-top:1px solid black;border-bottom:1px solid black; padding:2px 0px 2px 0px"></td>
  57. </tr>
  58. <%} %>
  59. </table>
  60. </textarea>
  61. <script>
  62. <%
  63. //아이템 팝업 창에서 할때는 오프너로 연다.
  64. if(params.get("pop_win_id").equals("ItemPop")){
  65. if(params.get("TEMPLATE_CD").equals("9")){
  66. %>
  67. parent.document.getElementById("ITEM_AMT_SUM").value="<%=sum_amt%>";
  68. <%
  69. }else{
  70. %>
  71. parent.document.getElementById("div_con_item").innerHTML=document.getElementById("testItemList").value;
  72. parent.document.getElementById("ITEM_AMT_SUM").value="<%=sum_amt%>";
  73. <%
  74. }
  75. }else{
  76. %>
  77. document.getElementById("div_con_item").innerHTML=document.getElementById("testItemList").value;
  78. <%
  79. }
  80. %>
  81. </script>
  82. <%
  83. }
  84. }
  85. %>