stampDuty.jsp 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  1. <%--
  2. - Author(s) : 김예진
  3. - Date : 2015.01.08
  4. - Description: 구매_인지세 현황 리스트
  5. --%>
  6. <%@ page contentType="text/html; charset=utf-8" %>
  7. <%@ page import="com.udapsoft.waf.system.HandlerStorage" %>
  8. <%@ page import="com.udapsoft.waf.common.ui.*" %>
  9. <%@ page import="com.udapsoft.waf.common.ui.InitCombo" %>
  10. <%@ page import="kr.co.hsnc.common.util.*"%>
  11. <%@ page import="kr.co.hsnc.common.sql.*" %>
  12. <%@ page import="kr.co.udapsoft.common.code.CommCodeManager" %>
  13. <%-- <%@ include file="/jsp/work/taglib.jsp" %>
  14. <jsp:useBean id="ctx" class="com.udapsoft.waf.system.context.SessionContext" scope="session" /> --%>
  15. <%
  16. CommCodeManager commCodeManager = new CommCodeManager();
  17. RowSet issueGbRow = CommCodeManager.getCodeRowsetStatic("STAMP_DUTY_ISSUE_GB");
  18. InitCombo initCombo = new InitCombo();
  19. initCombo.makeComboData(CommCodeManager.getCodeRowsetStatic("STAMP_DUTY_ISSUE_GB", "CHG_CODE01", "Y"), "DETAILNM", "DETAILCD");
  20. /* initCombo.makeComboData(commCodeManager.getCodeRowSet("STAMP_DUTY_ISSUE_GB"), "NAME", "CODE"); */
  21. String ISSUE_GB_CD = initCombo.getCode();
  22. String ISSUE_GB_NM = initCombo.getCodeName();
  23. %>
  24. <SCRIPT language="JavaScript">
  25. /*예약함수*/
  26. var sheet2;
  27. var sheet2Row;
  28. var sheet2PageNo = 1;
  29. var pageLastRowIndex = 1;
  30. var validationResult = false;
  31. var filterShow = false;
  32. /* function _onReady(){
  33. } */
  34. /**
  35. * IBSheet object initialize
  36. */
  37. function gridInit2(sheetName){
  38. var init_sheet = {};
  39. init_sheet.Cfg = {SearchMode:2, Page:10};
  40. init_sheet.Cols = [
  41. {Header:'Del', Type:"DelCheck", SaveName:"DEL_CHECK", Width:30, Align:"Center"},
  42. {Header:'Status', Type:"Status", SaveName:"STATUS", Width:0, Align:"Center", Hidden:"true"},
  43. {Header:'인지세ID', Type:"Text", SaveName:"STAMP_DUTY_ID", Width:0, Align:"Center", Hidden:"true"},
  44. {Header:'발행주체', Type:"Combo", SaveName:"STAMP_DUTY_ISSUE_GB", Width:80, Align:"Center", ComboText:"<%=ISSUE_GB_NM%>", ComboCode:"<%=ISSUE_GB_CD%>"},
  45. {Header:'고유식별번호', Type:"Text", SaveName:"STAMP_DUTY_NO", Width:80, Align:"Center", EditLen:"50"},
  46. {Header:'인지세액', Type:"AutoSum", SaveName:"STAMP_DUTY_TAX", Width:80, Align:"right", EditLen:"12"},
  47. {Header:'발행일자', Type:"Date", SaveName:"STAMP_DUTY_DATE", Width:70, Align:"Center", Format:"Ymd"},
  48. {Header:'비고', Type:"Text", SaveName:"REMARK", Width:150, Align:"Left", EditLen:"500"},
  49. {Header:'☞사본', Type:"Text", SaveName:"FILE_YN", Width:30, Align:"center", Edit:"false", Cursor:'pointer'},
  50. {Header:'FILE_ID', Type:"Text", SaveName:"FILE_ID", Width:0, Align:"center", Hidden:"true"},
  51. ];
  52. init_sheet.HeaderMode = {Sort:1};
  53. IBS_InitSheet(sheetName, init_sheet);
  54. sheetName.SetDataAutoTrim(0);
  55. sheetName.SetImageList(1,"/img/buyer/button/bt_change.gif");
  56. if(jQuery("#STATUS_CD").val() == '50'){
  57. sheet2.SetEditable(0);
  58. }
  59. //sheetName.SetActionMenu("ExcelDown");
  60. setGridSize2();
  61. }
  62. function doSearchStamp() {
  63. jQuery("#fevent").val("FORM_SHEET_SELECT");
  64. var url = Modular.model.PageContext.CONTEXT_ROOT + "/cont/purchase/StampList_sheet.screen";
  65. Modular.view.IBSheet7.doSearch(sheet2, url, jQuery("#form1"), 30, "");
  66. }
  67. function doSaveStamp() {
  68. jQuery("#fevent").val("SAVE_STAMP_LIST");
  69. var url = Modular.model.PageContext.CONTEXT_ROOT + "/cont/purchase/StampList_sheet.screen";
  70. Modular.view.IBSheet7.doSave(sheet2, url, jQuery("#form1"), false);
  71. }
  72. /**
  73. * IBSheet Event: Search End(IBSheet 데이터 조회 CallBack)
  74. */
  75. function sheet2_OnSearchEnd(code, message) {
  76. var info = {Type: "Image"};
  77. if(code == 0) {
  78. setGridSize2();
  79. sheet2.SetColFontColor("FILE_YN", "#0000ff");
  80. sheet2.SetCellValue(sheet2.LastRow(), "DEL_CHECK", "합 계");
  81. sheet2.SetMergeCell(sheet2.LastRow(), 0, 1, 5);
  82. for(i=1; i <= sheet2.RowCount(); i++){
  83. if(sheet2.GetCellValue(i, "FILE_ID")!=""){
  84. sheet2.InitCellProperty(i, "FILE_YN", info);
  85. }
  86. }
  87. } else {
  88. //조회 에러 수행
  89. alert(message);
  90. }
  91. }
  92. function sheet2_OnSaveEnd(code, msg) {
  93. if(code >= 0) {
  94. if(jQuery("#save_gb").val() != 'Y'){
  95. alert("인지세가 정상적으로 처리 되었습니다.");
  96. }
  97. } else {
  98. //alert(msg);
  99. alert("인지세 처리에 실패 하였습니다.");
  100. }
  101. doSearchStamp();
  102. }
  103. /**
  104. * IBSheet Event Change
  105. */
  106. function sheet2_OnChange(Row, Col, Value, OldValue, RaiseFlag) {
  107. if (sheet2.ColSaveName(Col) == "STAMP_DUTY_NO") {
  108. if(stringByteSize4UTF(sheet2.GetCellValue(Row, "STAMP_DUTY_NO")) > 50){
  109. alert("고유식별번호는 50자까지 입력하실 수 있습니다.");
  110. sheet2.SetCellValue(Row, "STAMP_DUTY_NO", "");
  111. return;
  112. }
  113. }
  114. if (sheet2.ColSaveName(Col) == "REMARK") {
  115. if(stringByteSize4UTF(sheet2.GetCellValue(Row, "REMARK")) > 500){
  116. alert("비고는 500자까지 입력하실 수 있습니다.");
  117. sheet2.SetCellValue(Row, "REMARK", "");
  118. return;
  119. }
  120. }
  121. }
  122. /*
  123. IBSheet Event : Mouse Right Menu
  124. */
  125. function sheet2_OnSelectMenu(Text, Code) {
  126. // text 또는 code값으로 Action수행
  127. switch(Text) {
  128. case "ExcelDown":
  129. jQuery("#btnExcel").click();
  130. break;
  131. }
  132. }
  133. function sheet2_OnDblClick(Row, Col, Value, CellX, CellY, CellW, CellH) {
  134. if(Row == 0)return;
  135. if (sheet2.ColSaveName(Col) == "FILE_YN") {
  136. if(sheet2.GetCellValue(Row, "STAMP_DUTY_ID")=='' || sheet2.GetCellValue(Row, "STATUS")=="I" || sheet2.GetCellValue(Row, "STATUS")=="U"){
  137. alert("입력한 내용을 저장을 한 후 파일을 첨부할 수 있습니다.");
  138. }
  139. else{
  140. var STAMP_DUTY_ID = sheet2.GetCellValue(Row, "STAMP_DUTY_ID")
  141. var modify = 'Y';
  142. if(jQuery("#STATUS_CD").val() =='50' || jQuery("#p_issue_gb").val() == '00'){
  143. modify ='N'
  144. }
  145. viewFileListNew2('PUR_STAMP_DUTY', STAMP_DUTY_ID, "", modify, "cont/purchase/stamp/"+STAMP_DUTY_ID, "", "", "", "N");
  146. }
  147. }
  148. }
  149. function viewFileListNew2(fileGB, id, obj, isModify, isDrectory, iframeID, user_filename, file_size, multi_yn) {
  150. var win_id = "_stampFileList";
  151. var link = "/common/file/FileListNew.screen";
  152. link += "?pop_win_id="+win_id;
  153. link += "&file_gb=" + fileGB;
  154. link += "&id=" + id;
  155. if( obj.id != null )
  156. link += "&obj_id=" + obj.id;
  157. if( iframeID != null )
  158. link += "&iframeID=" + iframeID;
  159. if( isModify != null )
  160. link += "&is_modify=" + isModify;
  161. if( isDrectory != null )
  162. link += "&sys_gb=" + isDrectory;
  163. if( file_size != null )
  164. link += "&file_size=" + file_size;
  165. if( multi_yn != null )
  166. link += "&multi_yn=" + multi_yn;
  167. if( user_filename != null )
  168. link += "&user_filename=" + encodeURIComponent(user_filename);
  169. fLayerPop(win_id, link, 750,430, '', '', 'NO', '200');
  170. }
  171. function fLayerPopClose(layerID){
  172. var oNode = document.getElementById(layerID);
  173. if(oNode != null)
  174. {
  175. $('#'+layerID+ '_divcontent').empty();
  176. $('#'+layerID).bPopup().close();
  177. document.body.removeChild(oNode);
  178. }
  179. if(layerID == "_stampFileList"){
  180. doSearchStamp();
  181. }
  182. }
  183. function stampDutyRowCheck() {
  184. for(i=1; i <= sheet2.RowCount(); i++){
  185. if(sheet2.GetCellValue(i, "STATUS")!="R"){
  186. alert("인지세중 저장되지 않은 행이 존재합니다.");
  187. return false;
  188. }
  189. }
  190. return true;
  191. }
  192. function issue_gb_chg() {
  193. if(jQuery("#p_issue_gb").val()=="00"||jQuery("#p_issue_gb").val()==""){
  194. jQuery("#btnAdd").hide();
  195. }else{
  196. jQuery("#btnAdd").show();
  197. //jQuery("#btnSaveStamp").show();
  198. }
  199. }
  200. function stampDesc()
  201. {
  202. var win_id = "_stampPopup";
  203. var link = "/cont/purchase/stampDescPopup.screen";
  204. link += "?pop_win_id="+win_id;
  205. fLayerPop(win_id, link, 400,210, '', '', 'NO');
  206. }
  207. function downStampFile(){
  208. var url="/common/file/FileDownloadServlet?mode=fpDown";
  209. url += "&mode=fpDown";
  210. url += "&filePath=/userMenual";
  211. url += "&fileName=" + encodeURI("전자문서에_대한_인지세_납부방법_등에_관한_고시_(전문).hwp");
  212. url += "&fileRealName=stamp_duty.hwp";
  213. document.getElementById("fileDown").src=url;
  214. }
  215. /**
  216. * IBSheet size setting
  217. */
  218. function setGridSize2() {sheet2.FitColWidth();}
  219. document.body.onresize = addEvent( document.body.onresize, "setGridSize2()");
  220. </SCRIPT>
  221. <div class="application-info magT10">
  222. <div class="application-sub-title">
  223. <span class="title">인지세</span><a href="javascript:stampDesc()"><IMG src='/img/buyer/button/q.gif' align="absmiddle"></a> <font color="red">※ 전자문서 계약자가 인지세무(과소) 납부시 가산세가 300% 부가됨</font> <a href="javascript:downStampFile()"><IMG src='/img/buyer/button/bt_change.gif' align="absmiddle"></a>
  224. </div>
  225. </div>
  226. <!-- 검색조건 시작 -->
  227. <table id="search-table" class="search-form-table">
  228. <tr height="25">
  229. <td>인지세 발급 구분:&nbsp;&nbsp;<%= HTMLMaker.getSelectTag(issueGbRow, "CODE", "NAME", "p_issue_gb", "style='width:100px;' onChange='issue_gb_chg();'", "", ContInfo.get("STAMP_DUTY_GB")) %></td>
  230. <td class="button" align="right" style="text-align: center;width: 95px">
  231. <span class="btnSearch center" id="btnAdd" style="display: none;"><a href="javascript:void(0);">추가</a></span>
  232. <%-- <%if(isViewWrite != "W"){ %> --%>
  233. <span class="btnSearch center" id="btnSaveStamp" ><a href="javascript:void(0);">저장</a></span>
  234. <%-- <%} %> --%>
  235. </td>
  236. </tr>
  237. </table>
  238. <div id="sheet2_div" style="padding-top:5px; height: 157px; min-height: 157px; overflow: auto;">
  239. <!-- <div id="sheet2_div" style="padding-top:5px; height: auto; min-height: 100px; overflow: auto;"> -->
  240. <script>createIBSheet('sheet2','100%', '157px');</script>
  241. </div>
  242. <iframe id="fileDown" name="fileDown" style="display:none"></iframe>