payItem.jsp 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. <%@ page contentType="text/html; charset=utf-8" %>
  2. <%@ page import="kr.co.udapsoft.common.code.*" %>
  3. <%
  4. // PayGroup_PaymentTerms Mapping Object 구하기
  5. ContCodeManager payGroupMappingUtil = new ContCodeManager();
  6. storage.addObject("category", payGroupMappingUtil.getJSONNotation());
  7. String category = (String)storage.getObject("category");
  8. //System.out.println(category);
  9. String pay_div = null;
  10. %>
  11. <script>
  12. var right_name = "<%=user.get("RIGHT_NAME")%>";
  13. var gCategoryJSON = null;
  14. var rawData = <%= category%>; // 서버로부터 JSON 표현식 받기
  15. gCategoryJSON = eval( rawData ); // JSON객체를 만들어 global 변수에 저장
  16. function checkAuthority(){
  17. if((right_name=="ADMIN NEW"||right_name=="TREASURY")){
  18. $("#btnSavePayItem").show();
  19. }
  20. }
  21. function changePaymentTerms(selObj) {
  22. var ct = getCategory(selObj.value); // JSON 객체에서 해당하는 PAYMENT TERMS 데이타 꺼내기
  23. if (!ct) {
  24. dlgAlert('오류가 발생하였습니다.<br>전산실로 연락주세요.');
  25. return false;
  26. }
  27. injectSelect(document.getElementById("payment_terms_id"), ct); // PAYMENT TERMS Select Box 채우기
  28. }
  29. // JSON 객체에서 해당하는 PAYMENT TERMS 데이타 꺼내기
  30. function getCategory(payGroup) {
  31. return gCategoryJSON.paymentTerms[payGroup];
  32. }
  33. //직군 데이타를 Select Box에 주입
  34. function injectSelect(elSel, rows) {
  35. elSel.length = 0; // clear
  36. for (var i=0; i<rows.length; i++) {
  37. var row = rows[i];
  38. var elOptNew = document.createElement('option');
  39. elOptNew.value = row.CODE; // 코드
  40. elOptNew.text = row.NAME; // 명칭
  41. try {
  42. elSel.add(elOptNew, null); // standards compliant; doesn't work in IE
  43. } catch(ex) {
  44. elSel.add(elOptNew); // IE only
  45. }
  46. }
  47. //2015.8.13 계약서 작성시 PaymentTerms 공백. 반드시 확인하고 저장하도록 유도.
  48. var elOptNew = document.createElement('option');
  49. elOptNew.value = ''; // 코드
  50. elOptNew.text = ''; // 명칭
  51. try {
  52. elSel.add(elOptNew, null); // standards compliant; doesn't work in IE
  53. } catch(ex) {
  54. elSel.add(elOptNew); // IE only
  55. }
  56. }
  57. /**
  58. * 집행내역코드 검색(공무)
  59. */
  60. function popSearchPayItem()
  61. {
  62. var win_id = "_searchPayItemPopup";
  63. var link = "/cont/outside/payItemCodePopup.screen";
  64. link += "?pop_win_id="+win_id;
  65. link += "&gb=PUR";
  66. link += "&req=0";
  67. <%if (finalYn=="Y"){ %>
  68. link += "&site=" + document.form1.r_dept_cd.value;
  69. <%}else{ %>
  70. link += "&site=" + document.form1.dept_cd.value;
  71. <%} %>
  72. fLayerPop(win_id, link, 600,400, '', '', 'NO');
  73. }
  74. </script>
  75. <!-- 분개유형 -->
  76. <div class="application-info magT10">
  77. <div class="application-sub-title">
  78. <span class="title">분개유형</span>
  79. </div>
  80. <div class="application-location" style="padding-bottom:5px;">
  81. <%if (isViewWrite=="V"){ %>
  82. <span class="btnSearch center" id="btnSavePayItem" style="display:none;"><a href="javascript:void(0);">분개유형저장</a></span>
  83. <%} %>
  84. </div>
  85. </div>
  86. <TABLE class="form-table">
  87. <colgroup>
  88. <col width="120px" />
  89. <col width="24%"/>
  90. <col width="120px" />
  91. <col width="24%"/>
  92. <col width="120px" />
  93. <col/>
  94. </colgroup>
  95. <TR height="25">
  96. <TH>분개유형</TH>
  97. <TD><%= ContCodeManager.getCcsifSelectCodeList("PUR-ACCT_GB", "acct_gb", "width:100%;", "", ContInfo.get("acct_gb"), ContInfo.get("dept_cd"), ContInfo.get("pay_div")) %></TD>
  98. <TH>증빙종류</TH>
  99. <TD><%= ContCodeManager.getProofCdSelectTag("gua_gb", "width:100%;", "", "", ContInfo.get("gua_gb"), "Y") %></TD>
  100. <TH>PAY GROUP</TH>
  101. <TD><%= ContCodeManager.getPayGroupSelectTag("pay_group", "width:100%;", "onchange=changePaymentTerms(this);", "", ContInfo.get("pay_group"), ContInfo.get("ac_unit_cd")) %></TD>
  102. </TR>
  103. <TR height="25">
  104. <TH>PAYMENT TERMS</TH>
  105. <TD colspan="5">
  106. <INPUT type="hidden" name="dept_cd" value="<%=ContInfo.get("dept_cd") %>">
  107. <INPUT type="hidden" name="r_dept_cd" value="<%=ContInfo.get("r_dept_cd") %>">
  108. <SELECT id='payment_terms_id' name='payment_terms' style='width:20%;' class='input_select'></SELECT>
  109. </TD>
  110. </TR>
  111. </TABLE>
  112. <script>
  113. changePaymentTerms(document.form1.pay_group);
  114. setSelect(document.form1.payment_terms, '<%= ContInfo.get("payment_terms") %>');
  115. </script>