SuppStampDuty.jsp 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  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/SuppStampList_sheet.screen";
  63. Modular.view.IBSheet7.doSearch(sheet2, url, jQuery("#form1"), 30, "");
  64. }
  65. function sheet2_OnSaveEnd(code, msg) {
  66. if(code >= 0) {
  67. alert("정상적으로 처리 되었습니다.");
  68. } else {
  69. //alert(msg);
  70. alert("처리에 실패 하였습니다.");
  71. }
  72. doSearchStamp();
  73. }
  74. /**
  75. * IBSheet Event: Search End(IBSheet 데이터 조회 CallBack)
  76. */
  77. function sheet2_OnSearchEnd(code, message) {
  78. var info = {Type: "Image"};
  79. if(code == 0) {
  80. setGridSize2();
  81. sheet2.SetColFontColor("FILE_YN", "#0000ff");
  82. sheet2.SetCellValue(sheet2.LastRow(), "DEL_CHECK", "합 계");
  83. sheet2.SetMergeCell(sheet2.LastRow(), 0, 1, 5);
  84. for(i=1; i <= sheet2.RowCount(); i++){
  85. if(sheet2.GetCellValue(i, "FILE_ID")!=""){
  86. sheet2.InitCellProperty(i, "FILE_YN", info);
  87. }
  88. if(jQuery("#STATUS_CD").val() != '50' && sheet2.GetCellValue(i, "STAMP_DUTY_ISSUE_GB")=="10"){
  89. sheet2.SetRowEditable(i,0);
  90. }
  91. }
  92. } else {
  93. //조회 에러 수행
  94. alert(message);
  95. }
  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. var STAMP_DUTY_ID = sheet2.GetCellValue(Row, "STAMP_DUTY_ID");
  135. var p_move = 'N';
  136. if(jQuery("#STATUS_CD").val() == '20' && jQuery("#p_issue_gb").val() == '20' && sheet2.GetCellValue(Row, "STAMP_DUTY_ISSUE_GB")=="20" ){
  137. p_move ='M';
  138. }
  139. var win_id = "_StampDutyPop";
  140. var link = "/cont/outside/stampDutyPop.screen";
  141. link += "?pop_win_id="+win_id
  142. link += "&p_stamp_duty_id="+ STAMP_DUTY_ID
  143. link += "&p_move="+p_move
  144. link += "&p_cont_mod_id="+"<%=ContInfo.get("SUB_CONT_MOD_ID")%>"
  145. link += "&p_who=P" ;
  146. fLayerPop(win_id, link, 700, 250, '', '', 'NO');
  147. /*2016.12.14 인지세 수정
  148. if(Row == 0)return;
  149. if (sheet2.ColSaveName(Col) == "FILE_YN") {
  150. if(sheet2.GetCellValue(Row, "STAMP_DUTY_ID")=='' || sheet2.GetCellValue(Row, "STATUS")=="I" || sheet2.GetCellValue(Row, "STATUS")=="U"){
  151. alert("입력한 내용을 저장을 한 후 파일을 첨부할 수 있습니다.");
  152. }
  153. else{
  154. var STAMP_DUTY_ID = sheet2.GetCellValue(Row, "STAMP_DUTY_ID")
  155. var modify = 'Y';
  156. if(jQuery("#STATUS_CD").val() == '50' || sheet2.GetCellValue(Row, "STAMP_DUTY_ISSUE_GB")=="10"){
  157. modify ='N'
  158. }
  159. viewFileListNew2('SUB_STAMP_DUTY', STAMP_DUTY_ID, "", modify, "portal/cont/stamp/"+STAMP_DUTY_ID, "", "", "", "N");
  160. doSearchStamp();
  161. }
  162. }*/
  163. }
  164. //2016.12.12
  165. function stampDutyPopClose(){
  166. doSearchStamp();
  167. }
  168. function doAttachStampFilePop(fileGB, obj, fObj, editFile, fileDir){
  169. if(obj != ''){
  170. viewFileListNew(fileGB, obj, fObj, editFile, fileDir, "_StampDutyPop", "", "", "N");
  171. }
  172. }
  173. //2016.12.14 미사용
  174. function viewFileListNew2(fileGB, id, obj, isModify, isDrectory, iframeID, user_filename, file_size, multi_yn) {
  175. var win_id = "_stampFileList";
  176. var link = "/common/file/FileListNew.screen";
  177. link += "?pop_win_id="+win_id;
  178. link += "&file_gb=" + fileGB;
  179. link += "&id=" + id;
  180. if( obj.id != null )
  181. link += "&obj_id=" + obj.id;
  182. if( iframeID != null )
  183. link += "&iframeID=" + iframeID;
  184. if( isModify != null )
  185. link += "&is_modify=" + isModify;
  186. if( isDrectory != null )
  187. link += "&sys_gb=" + isDrectory;
  188. if( file_size != null )
  189. link += "&file_size=" + file_size;
  190. if( multi_yn != null )
  191. link += "&multi_yn=" + multi_yn;
  192. if( user_filename != null )
  193. link += "&user_filename=" + encodeURIComponent(user_filename);
  194. fLayerPop(win_id, link, 750,430, '', '', 'NO', '200');
  195. }
  196. function fLayerPopClose(layerID){
  197. var oNode = document.getElementById(layerID);
  198. if(oNode != null)
  199. {
  200. $('#'+layerID+ '_divcontent').empty();
  201. $('#'+layerID).bPopup().close();
  202. document.body.removeChild(oNode);
  203. }
  204. if(layerID == "_stampFileList"){
  205. doSearchStamp();
  206. }
  207. }
  208. function stampDutyRowCheck() {
  209. for(i=1; i <= sheet2.RowCount(); i++){
  210. if(sheet2.GetCellValue(i, "STATUS")!="R"){
  211. alert("인지세중 저장되지 않은 행이 존재합니다.");
  212. return false;
  213. }
  214. }
  215. return true;
  216. }
  217. function stampDesc()
  218. {
  219. var win_id = "_stampPopup";
  220. var link = "/cont/purchase/stampDescPopup.screen";
  221. link += "?pop_win_id="+win_id;
  222. fLayerPop(win_id, link, 400,210, '', '', 'NO');
  223. }
  224. function downStampFile(){
  225. var url="/common/file/FileDownloadServlet?mode=fpDown";
  226. url += "&filePath=/userMenual";
  227. url += "&fileName=" + encodeURI("전자문서에_대한_인지세_납부방법_등에_관한_고시_(전문).hwp");
  228. url += "&fileRealName=stamp_duty.hwp";
  229. //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")
  230. document.getElementById("fileDown").src=url;
  231. }
  232. /**
  233. * IBSheet size setting
  234. */
  235. function setGridSize2() {sheet2.FitColWidth();}
  236. document.body.onresize = addEvent( document.body.onresize, "setGridSize2()");
  237. </SCRIPT>
  238. <input type="hidden" name="p_issue_gb" id="p_issue_gb" value='<%=ContInfo.get("STAMP_DUTY_GB")%>'>
  239. <div class="application-info magT10" style="height:22px;">
  240. <div class="application-sub-title">
  241. <!--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> -->
  242. <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>
  243. </div>
  244. <div align="right">
  245. <span class="btnSearch center" id="btnAdd" style="display: none;"><a href="javascript:void(0);">추가</a></span>
  246. <span class="btnSearch center" id="btnSaveStamp" style="display: none;"><a href="javascript:void(0);">저장</a></span>
  247. </div>
  248. </div>
  249. <div id="sheet2_div" style="padding-top:5px; height: 157px; min-height: 157px; overflow: auto;">
  250. <!-- <div id="sheet2_div" style="padding-top:5px; height: auto; min-height: 100px; overflow: auto;"> -->
  251. <script>createIBSheet('sheet2','100%', '157px');</script>
  252. </div>
  253. <!-- <iframe id="fileDown" name="fileDown" style="display:none"></iframe> -->