stampDuty.jsp 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  1. <%--
  2. - Author(s) : 김예진
  3. - Date : 2015.02.01
  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. /**
  33. * IBSheet object initialize
  34. */
  35. function gridInit2(sheetName){
  36. var init_sheet = {};
  37. init_sheet.Cfg = {SearchMode:2, Page:10};
  38. init_sheet.Cols = [
  39. {Header:'Del', Type:"DelCheck", SaveName:"DEL_CHECK", Width:30, Align:"Center"},
  40. {Header:'Status', Type:"Status", SaveName:"STATUS", Width:0, Align:"Center", Hidden:"true"},
  41. {Header:'인지세ID', Type:"Text", SaveName:"STAMP_DUTY_ID", Width:0, Align:"Center", Hidden:"true"},
  42. {Header:'발행주체', Type:"Combo", SaveName:"STAMP_DUTY_ISSUE_GB", Width:80, Align:"Center", ComboText:"<%=ISSUE_GB_NM%>", ComboCode:"<%=ISSUE_GB_CD%>"},
  43. {Header:'고유식별번호', Type:"Text", SaveName:"STAMP_DUTY_NO", Width:80, Align:"Center"},
  44. {Header:'인지세액', Type:"AutoSum", SaveName:"STAMP_DUTY_TAX", Width:60, Align:"Right"},
  45. {Header:'발행일자', Type:"Date", SaveName:"STAMP_DUTY_DATE", Width:70, Align:"Center"},
  46. {Header:'비고', Type:"Text", SaveName:"REMARK", Width:120, Align:"Left"},
  47. {Header:'☞사본', Type:"Text", SaveName:"FILE_YN", Width:30, Align:"Center", Edit:"false", Cursor:'pointer'},
  48. {Header:'FILE_ID', Type:"Text", SaveName:"FILE_ID", Width:0, Align:"Center", Hidden:"true"},
  49. ];
  50. init_sheet.HeaderMode = {Sort:1};
  51. IBS_InitSheet(sheetName, init_sheet);
  52. sheetName.SetDataAutoTrim(0);
  53. sheetName.SetImageList(1,"/img/buyer/button/bt_change.gif");
  54. if(jQuery("#STATUS_CD").val() == '50'){
  55. sheet2.SetEditable(0);
  56. }
  57. //sheetName.SetActionMenu("ExcelDown");
  58. setGridSize2();
  59. }
  60. function doSearchStamp() {
  61. jQuery("#fevent").val("FORM_SHEET_SELECT");
  62. var url = Modular.model.PageContext.CONTEXT_ROOT + "/portal/cont/StampList_sheet.screen";
  63. Modular.view.IBSheet7.doSearch(sheet2, url, jQuery("#form1"), 30, "");
  64. }
  65. /**
  66. * IBSheet Event: Search End(IBSheet 데이터 조회 CallBack)
  67. */
  68. function sheet2_OnSearchEnd(code, message) {
  69. var info = {Type: "Image"};
  70. if(code == 0) {
  71. setGridSize2();
  72. sheet2.SetColFontColor("FILE_YN", "#0000ff");
  73. sheet2.SetCellValue(sheet2.LastRow(), "DEL_CHECK", "합 계");
  74. sheet2.SetMergeCell(sheet2.LastRow(), 0, 1, 5);
  75. for(i=1; i <= sheet2.RowCount(); i++){
  76. if(sheet2.GetCellValue(i, "FILE_ID")!=""){
  77. sheet2.InitCellProperty(i, "FILE_YN", info);
  78. }
  79. if(jQuery("#STATUS_CD").val() != '50' && sheet2.GetCellValue(i, "STAMP_DUTY_ISSUE_GB")=="10"){
  80. sheet2.SetRowEditable(i,0);
  81. }
  82. }
  83. } else {
  84. //조회 에러 수행
  85. alert(message);
  86. }
  87. }
  88. function sheet2_OnSaveEnd(code, msg) {
  89. if(code >= 0) {
  90. alert("정상적으로 처리 되었습니다.");
  91. } else {
  92. //alert(msg);
  93. alert("처리에 실패 하였습니다.");
  94. }
  95. doSearchStamp();
  96. }
  97. /*
  98. IBSheet Event : Mouse Right Menu
  99. */
  100. function sheet2_OnSelectMenu(Text, Code) {
  101. // text 또는 code값으로 Action수행
  102. switch(Text) {
  103. case "ExcelDown":
  104. jQuery("#btnExcel").click();
  105. break;
  106. }
  107. }
  108. /**
  109. * IBSheet Event Change
  110. */
  111. function sheet2_OnChange(Row, Col, Value, OldValue, RaiseFlag) {
  112. if (sheet2.ColSaveName(Col) == "STAMP_DUTY_NO") {
  113. if(stringByteSize4UTF(sheet2.GetCellValue(Row, "STAMP_DUTY_NO")) > 50){
  114. alert("고유식별번호는 50자까지 입력하실 수 있습니다.");
  115. return;
  116. }
  117. }
  118. if (sheet2.ColSaveName(Col) == "REMARK") {
  119. if(stringByteSize4UTF(sheet2.GetCellValue(Row, "REMARK")) > 500){
  120. alert("비고는 500자까지 입력하실 수 있습니다.");
  121. return;
  122. }
  123. }
  124. if (sheet2.ColSaveName(Col) == "STAMP_DUTY_ISSUE_GB") {
  125. if(sheet2.GetCellValue(Row, "STAMP_DUTY_ISSUE_GB") != '20'){
  126. alert("협력사만 선택 가능합니다.");
  127. sheet2.SetCellValue(Row, "STAMP_DUTY_ISSUE_GB", "20");
  128. return;
  129. }
  130. }
  131. }
  132. function sheet2_OnDblClick(Row, Col, Value, CellX, CellY, CellW, CellH) {
  133. if(Row == 0)return;
  134. if (sheet2.ColSaveName(Col) == "FILE_YN") {
  135. if(sheet2.GetCellValue(Row, "STAMP_DUTY_ID")=='' || sheet2.GetCellValue(Row, "STATUS")=="I" || sheet2.GetCellValue(Row, "STATUS")=="U"){
  136. alert("입력한 내용을 저장을 한 후 파일을 첨부할 수 있습니다.");
  137. return;
  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' || sheet2.GetCellValue(Row, "STAMP_DUTY_ISSUE_GB")=="10"){
  143. modify ='N'
  144. }
  145. viewFileListNew2('PUR_STAMP_DUTY', STAMP_DUTY_ID, "", modify, "portal/cont/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 stampDesc(){
  193. var win_id = "_stampPopup";
  194. var link = "/cont/purchase/stampDescPopup.screen";
  195. link += "?pop_win_id="+win_id;
  196. fLayerPop(win_id, link, 400,210, '', '', 'NO');
  197. }
  198. function downStampFile(){
  199. var url="/common/file/FileDownloadServlet?mode=fpDown";
  200. url += "&filePath=/userMenual";
  201. url += "&fileName=" + encodeURI("전자문서에_대한_인지세_납부방법_등에_관한_고시_(전문).hwp");
  202. url += "&fileRealName=stamp_duty.hwp";
  203. //window.open(url, "_fileDown", "toolbar=no, width=400, height=100, top=500, left=400, toolbar=no,directories=no,status=no,scrollbars=yes,resize=no,menubar=no,target=new")
  204. document.getElementById("fileDown").src=url;
  205. }
  206. /**
  207. * IBSheet size setting
  208. */
  209. function setGridSize2() {sheet2.FitColWidth();}
  210. document.body.onresize = addEvent( document.body.onresize, "setGridSize2()");
  211. </SCRIPT>
  212. <input type="hidden" name="p_issue_gb" id="p_issue_gb" value='<%=ContInfo.get("STAMP_DUTY_GB")%>'>
  213. <div class="application-info magT10" style="height:22px;">
  214. <div class="application-sub-title" >
  215. <!--2015.3.25 외주요구사항과 동일하게 처리 <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> -->
  216. <span class="title">인지세<a href="javascript:downStampFile()"><IMG src='/img/buyer/button/q.gif' align="absmiddle"></a></span>&nbsp; <a href="http://www.e-revenuestamp.or.kr" target="_blank">전자수입인지사이트 바로가기(www.e-revenuestamp.or.kr)</a><font color="red">&nbsp;※ 전자문서 계약자가 인지세 무(과소)납부시 가산세가 300% 부가됨</font> <span class="btnSearch center" id="btnhelp" ><a href="javascript:stampDesc()">납부금액안내</a></span>
  217. </div>
  218. <div align="right">
  219. <span class="btnSearch center" id="btnAdd" style="display: none;"><a href="javascript:void(0);">추가</a></span>
  220. <span class="btnSearch center" id="btnSaveStamp" style="display: none;"><a href="javascript:void(0);">저장</a></span>
  221. </div>
  222. </div>
  223. <div id="sheet2_div" style="padding-top:5px; height: 157px; min-height: 157px; overflow: auto;">
  224. <!-- <div id="sheet2_div" style="padding-top:5px; height: auto; min-height: 100px; overflow: auto;"> -->
  225. <script>createIBSheet('sheet2','100%', '157px');</script>
  226. </div>
  227. <!-- <iframe id="fileDown" name="fileDown" style="display:none"></iframe> -->