SalNewPop.jsp 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531
  1. <%--
  2. - Author(s) : Hyung min Son
  3. - Date : 2014.07.07
  4. - Description: 연기 사유 팝업
  5. --%>
  6. <%@page import="monfox.toolkit.snmp.agent.modules.SnmpV2Mib.SysOREntry"%>
  7. <%@page import="monfox.toolkit.snmp.agent.modules.SnmpV2Mib.SysOREntry"%>
  8. <%@ page contentType="text/html; charset=utf-8" %>
  9. <%@ page import="java.text.SimpleDateFormat" %>
  10. <%@ page import="java.util.Date" %>
  11. <%@ page import="kr.co.udapsoft.common.*" %>
  12. <%@ page import="kr.co.udapsoft.common.code.*" %>
  13. <%@ page import="com.udapsoft.waf.system.*" %>
  14. <%@ page import="com.udapsoft.waf.common.*" %>
  15. <%@ page import="com.udapsoft.waf.common.ui.HTMLMaker" %>
  16. <%@ page import="com.udapsoft.waf.system.HandlerStorage" %>
  17. <%@ page import="kr.co.hsnc.common.util.*"%>
  18. <%@ page import="kr.co.hsnc.common.util.ValueObject" %>
  19. <%@ page import="kr.co.hsnc.common.sql.*" %>
  20. <%@ page import="kr.co.hsnc.common.sql.RowSet" %>
  21. <%@ page import="kr.co.hsnc.common.sql.util.*" %>
  22. <%@ page import="com.udapsoft.waf.common.ui.*" %>
  23. <%@ page import="kr.co.udapsoft.common.code.*" %>
  24. <%@ page import="kr.co.udapsoft.ebid.buyer.common.file.FileManager"%>
  25. <%-- <%@ include file="/jsp/work/taglib.jsp" %> --%>
  26. <jsp:useBean id="ctx" class="com.udapsoft.waf.system.context.SessionContext" scope="session" />
  27. <%
  28. ctx.init(request, response);
  29. HandlerStorage storage = ctx.getHandlerStorage();
  30. ValueObject params = storage.getParams();
  31. ValueObject user = ctx.getUser();
  32. String p_stamp_duty_id = params.get("p_stamp_duty_id");
  33. String p_move = params.get("p_move");
  34. RowSet CODE911 = storage.getRowSet("CODE911");
  35. RowSet dutyIssueRow = CommCodeManager.getCodeRowsetStatic("STAMP_DUTY_ISSUE_GB", "CHG_CODE01", "Y");
  36. RowSet exchangeRow = CommCodeManager.getCodeRowsetStatic("911");
  37. %>
  38. <%@ page contentType="text/html; charset=utf-8" %>
  39. <SCRIPT language="JavaScript">
  40. function doPageInit() {
  41. if("<%=p_move%>" == "d"){
  42. var f = document.form1;
  43. submitXmlRequest("/cont/stamptax/SalNewPop_form.screen", "SELECT_DATA", f, "VALUEOBJECT");
  44. }
  45. //계약금액 포커스 탈출시 통화구분에 맞춰서 소수점 자리를 맞춘다.
  46. jQuery("#p_cont_amt").blur(function () {
  47. var p_cont_amt = jQuery("#p_cont_amt").val().replace(/(\,|\:)/g,"");
  48. //통화구분에 맞춰서 소수점 자리와, 천단위 쉼표를 맞춘다.
  49. if(jQuery("#digit").val() != ""){
  50. p_cont_amt = Number(p_cont_amt).toFixed(jQuery("#digit").val())
  51. jQuery("#p_cont_amt").val(Number(p_cont_amt).toFixed(jQuery("#digit").val()));
  52. jQuery("#p_cont_amt").val(jQuery("#p_cont_amt").val().split(/(?=(?:\d{3})+(?:\.|$))/g).join(','));
  53. }
  54. //정수자리 제한 검사
  55. var strArray = p_cont_amt.split(".");
  56. if(strArray[0].length > 12){
  57. alert("소수점 아랫부분을 제외한 정수는 12자리까지만 입력 가능합니다.");
  58. //jQuery("#p_cont_amt").val("");
  59. }
  60. });
  61. jQuery("#p_corp_name").blur(function () {
  62. if ( stringByteSize4UTF($("#p_corp_name").val()) > 200 ) {
  63. alert("한글은 66자 영문,숫자는 200자 까지만 입력 가능합니다.");
  64. jQuery("#p_corp_name").focus();
  65. return;
  66. }
  67. });
  68. jQuery("#p_stamp_duty_no").blur(function () {
  69. if ( stringByteSize4UTF($("#p_stamp_duty_no").val()) > 50 ) {
  70. alert("한글은 16자 영문,숫자는 50자 까지만 입력 가능합니다.");
  71. jQuery("#p_stamp_duty_no").focus();
  72. return;
  73. }
  74. });
  75. jQuery("#p_cont_no").blur(function () {
  76. if ( stringByteSize4UTF($("#p_cont_no").val()) > 30 ) {
  77. alert("한글은 10자 영문,숫자는 30자 까지만 입력 가능합니다.");
  78. jQuery("#p_cont_no").focus();
  79. return;
  80. }
  81. });
  82. jQuery("#p_cont_name").blur(function () {
  83. if ( stringByteSize4UTF($("#p_cont_name").val()) > 200 ) {
  84. alert("한글은 66자 영문,숫자는 200자 까지만 입력 가능합니다.");
  85. jQuery("#p_cont_name").focus();
  86. return;
  87. }
  88. });
  89. jQuery("#p_remark").blur(function () {
  90. if ( stringByteSize4UTF($("#p_remark").val()) > 500 ) {
  91. alert("한글은 166자 영문,숫자는 500자 까지만 입력 가능합니다.");
  92. jQuery("#p_remark").focus();
  93. return;
  94. }
  95. });
  96. }
  97. function doSave(){
  98. if(jQuery("#p_corp_name").val() == ""){
  99. alert("발주처 입력은 필수 입니다. ");
  100. jQuery("#p_corp_name").focus();
  101. return;
  102. }
  103. if(jQuery("#p_corp_reg_no1").val() == ""){
  104. alert("사업자등록번호 입력은 필수 입니다. ");
  105. jQuery("#p_corp_reg_no1").focus();
  106. return;
  107. }
  108. if(jQuery("#p_corp_reg_no2").val() == ""){
  109. alert("사업자등록번호 입력은 필수 입니다. ");
  110. jQuery("#p_corp_reg_no2").focus();
  111. return;
  112. }
  113. if(jQuery("#p_corp_reg_no3").val() == ""){
  114. alert("사업자등록번호 입력은 필수 입니다. ");
  115. jQuery("#p_corp_reg_no3").focus();
  116. return;
  117. }
  118. if(jQuery("#p_stamp_duty_no").val() == ""){
  119. alert("고유식별번호 입력은 필수 입니다. ");
  120. jQuery("#p_stamp_duty_no").focus();
  121. return;
  122. }
  123. if(jQuery("#p_cont_no").val() == ""){
  124. alert("계약번호 입력은 필수 입니다. ");
  125. jQuery("#p_cont_no").focus();
  126. return;
  127. }
  128. if(jQuery("#p_cont_name").val() == ""){
  129. alert("계약명 입력은 필수 입니다. ");
  130. jQuery("#p_cont_name").focus();
  131. return;
  132. }
  133. if(jQuery("#p_currency_gb").val() == ""){
  134. alert("통화구분 입력은 필수 입니다. ");
  135. jQuery("#p_currency_gb").focus();
  136. return;
  137. }
  138. if(jQuery("#p_cont_amt").val() == "" || jQuery("#p_cont_amt").val() == 0){
  139. alert("계약금액 입력은 필수 입니다. ");
  140. jQuery("#p_cont_amt").focus();
  141. return;
  142. }
  143. if(jQuery("#p_stamp_duty_tax").val() == "" || jQuery("#p_stamp_duty_tax").val() == 0){
  144. alert("인지세액 입력은 필수 입니다. ");
  145. jQuery("#p_stamp_duty_tax").focus();
  146. return;
  147. }
  148. if(jQuery("#p_stamp_duty_date").val() == ""){
  149. alert("발행일자 입력은 필수 입니다. ");
  150. jQuery("#p_stamp_duty_date").focus();
  151. return;
  152. }
  153. if(jQuery("#attach_file_view_stamp li").length == 0){
  154. alert("인지세사본 첨부는 필수 입니다.");
  155. return;
  156. }
  157. if(confirm("저장하시겠습니까?")){
  158. var f = document.form1;
  159. submitXmlRequest("/cont/stamptax/SalNewPop_form.screen", "INSERT_DATA", f);
  160. }
  161. }
  162. function doUpdate(){
  163. if(jQuery("#p_corp_name").val() == ""){
  164. alert("발주처 입력은 필수 입니다. ");
  165. jQuery("#p_corp_name").focus();
  166. return;
  167. }
  168. if(jQuery("#p_corp_reg_no1").val() == ""){
  169. alert("사업자등록번호 입력은 필수 입니다. ");
  170. jQuery("#p_corp_reg_no1").focus();
  171. return;
  172. }
  173. if(jQuery("#p_corp_reg_no2").val() == ""){
  174. alert("사업자등록번호 입력은 필수 입니다. ");
  175. jQuery("#p_corp_reg_no2").focus();
  176. return;
  177. }
  178. if(jQuery("#p_corp_reg_no3").val() == ""){
  179. alert("사업자등록번호 입력은 필수 입니다. ");
  180. jQuery("#p_corp_reg_no3").focus();
  181. return;
  182. }
  183. if(jQuery("#p_stamp_duty_no").val() == ""){
  184. alert("고유식별번호 입력은 필수 입니다. ");
  185. jQuery("#p_stamp_duty_no").focus();
  186. return;
  187. }
  188. if(jQuery("#p_cont_no").val() == ""){
  189. alert("계약번호 입력은 필수 입니다. ");
  190. jQuery("#p_cont_no").focus();
  191. return;
  192. }
  193. if(jQuery("#p_cont_name").val() == ""){
  194. alert("계약명 입력은 필수 입니다. ");
  195. jQuery("#p_cont_name").focus();
  196. return;
  197. }
  198. if(jQuery("#p_currency_gb").val() == ""){
  199. alert("통화구분 입력은 필수 입니다. ");
  200. jQuery("#p_currency_gb").focus();
  201. return;
  202. }
  203. if(jQuery("#p_cont_amt").val() == "" || jQuery("#p_cont_amt").val() == 0){
  204. alert("계약금액 입력은 필수 입니다. ");
  205. jQuery("#p_cont_amt").focus();
  206. return;
  207. }
  208. if(jQuery("#p_stamp_duty_tax").val() == "" || jQuery("#p_stamp_duty_tax").val() == 0){
  209. alert("인지세액 입력은 필수 입니다. ");
  210. jQuery("#p_stamp_duty_tax").focus();
  211. return;
  212. }
  213. if(jQuery("#p_stamp_duty_date").val() == ""){
  214. alert("발행일자 입력은 필수 입니다. ");
  215. jQuery("#p_stamp_duty_date").focus();
  216. return;
  217. }
  218. if(jQuery("#attach_file_view_stamp li").length == 0){
  219. alert("인지세사본 첨부는 필수 입니다.");
  220. return;
  221. }
  222. if(confirm("수정하시겠습니까?")){
  223. var f = document.form1;
  224. submitXmlRequest("/cont/stamptax/SalNewPop_form.screen", "UPDATE_DATA", f);
  225. }
  226. }
  227. function doCancle() {
  228. closeSearch();
  229. }
  230. function doDel() {
  231. if(confirm("삭제하시겠습니까?")){
  232. var f = document.form1;
  233. submitXmlRequest("/cont/stamptax/SalNewPop_form.screen", "DELETE_DATA", f);
  234. }
  235. }
  236. function closeSearch(){
  237. parent.doSearch();
  238. winClose();
  239. }
  240. function doChange(){
  241. <%
  242. for(int i=0;i < CODE911.size();i++){
  243. ValueObject Vo = RowSetUtility.getValueObject(CODE911.getRow(i));
  244. %>
  245. if($("#p_currency_gb").val() == "<%=Vo.get("DETAILCD")%>"){
  246. jQuery("#digit").val("<%=Vo.get("CHG_CODE01")%>");
  247. }
  248. <%}%>
  249. }
  250. function doResult(resultObj) {
  251. try {
  252. if( resultObj.getRequestEvent() == "SELECT_DATA") {
  253. if( resultObj.getSuccess() ) {
  254. var vo = resultObj.getValueObject();
  255. $("#p_stamp_duty_issue").val(vo.get("STAMP_DUTY_ISSUE_GB"));
  256. $("#p_corp_name").val(vo.get("CORP_NAME"));
  257. $("#p_corp_reg_no1").val(vo.get("CORP_REG_NO1"));
  258. $("#p_corp_reg_no2").val(vo.get("CORP_REG_NO2"));
  259. $("#p_corp_reg_no3").val(vo.get("CORP_REG_NO3"));
  260. $("#p_stamp_duty_no").val(vo.get("STAMP_DUTY_NO"));
  261. $("#p_cont_no").val(vo.get("CONT_NO"));
  262. $("#p_mod_no").val(vo.get("MOD_NO"));
  263. $("#p_cont_name").val(vo.get("CONT_NAME"));
  264. $("#p_cont_amt").val(vo.get("CONT_AMT"));
  265. $("#p_currency_gb").val(vo.get("CURRENCY_GB"));
  266. $("#p_stamp_duty_tax").val(vo.get("STAMP_DUTY_TAX"));
  267. $("#p_stamp_duty_date").val(vo.get("STAMP_DUTY_DATE"));
  268. $("#p_remark").val(vo.get("REMARK"));
  269. }
  270. else {
  271. dlgErrorMsg(resultObj);
  272. }
  273. document.form1.isSubmit = false;
  274. }
  275. if( resultObj.getRequestEvent() == "INSERT_DATA") {
  276. if( resultObj.getSuccess() ) {
  277. alert("저장이 완료되었습니다.");
  278. closeSearch();
  279. }
  280. else {
  281. dlgErrorMsg(resultObj);
  282. }
  283. document.form1.isSubmit = false;
  284. }
  285. if( resultObj.getRequestEvent() == "UPDATE_DATA") {
  286. if( resultObj.getSuccess() ) {
  287. alert("수정이 완료되었습니다.");
  288. closeSearch();
  289. }
  290. else {
  291. dlgErrorMsg(resultObj);
  292. }
  293. document.form1.isSubmit = false;
  294. }
  295. if( resultObj.getRequestEvent() == "DELETE_DATA") {
  296. if( resultObj.getSuccess() ) {
  297. alert("삭제이 완료되었습니다.");
  298. closeSearch();
  299. }
  300. else {
  301. dlgErrorMsg(resultObj);
  302. }
  303. document.form1.isSubmit = false;
  304. }
  305. }
  306. catch(errorObject) {
  307. showErrorDlg("doResult()", errorObject);
  308. }
  309. }
  310. function doAttachStampFile(obj){
  311. if(obj != ''){
  312. parent.doAttachStampFilePop('SAL_STAMP_DUTY', obj.value, document.getElementById("attach_file_view_stamp"), "Y", "cont/stamp/<%=p_stamp_duty_id%>");
  313. }
  314. }
  315. /**
  316. * 첨부파일 예약 함수
  317. */
  318. function fileDown(file_id){
  319. var url="/common/file/FileDownloadServlet";
  320. url += "?file_id=" + file_id;
  321. 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")
  322. }
  323. function stampDesc()
  324. {
  325. var win_id = "_stampPopup";
  326. var link = "/cont/purchase/stampDescPopup.screen";
  327. link += "?pop_win_id="+win_id;
  328. fLayerPop(win_id, link, 400,210, '', '', 'NO');
  329. }
  330. document.body.onload = doPageInit;
  331. </SCRIPT>
  332. <modular:search id="form1">
  333. <modular:key id="fevent" />
  334. </modular:search>
  335. <FORM name="form1" method="post">
  336. <INPUT type="hidden" name="digit" id="digit" value="">
  337. <INPUT type="hidden" name="p_move" id="p_move" value="<%=p_move%>">
  338. <INPUT type="hidden" name="p_stamp_duty_id" id="p_stamp_duty_id" value="<%=p_stamp_duty_id%>">
  339. <TABLE class="screen_title_table">
  340. <TR height="2"><TD colspan="2"></TD>
  341. </TR>
  342. <TR height="25"><TD>
  343. <!-- 제목 및 버튼 -->
  344. <table id="t1" width="100%" class="ftit_table">
  345. <colgroup>
  346. <col width="*" />
  347. <col width="150" />
  348. </colgroup>
  349. <tr>
  350. <th>
  351. </th>
  352. <td align="right">
  353. <%if(p_move == ""){%>
  354. <span class="btnSearch center"><a href="javascript:doSave();">저장</a></span>
  355. <%}else{%>
  356. <span class="btnSearch center"><a href="javascript:doUpdate();">수정</a></span>
  357. <%}%>
  358. <span class="btnSearch center"><a href="javascript:doCancle();">취소</a></span>
  359. <%if(p_move != ""){%>
  360. <span class="btnSearch center"><a href="javascript:doDel();">삭제</a></span>
  361. <%}%>
  362. </td>
  363. </tr>
  364. </table>
  365. </TD>
  366. </TR>
  367. <tr>
  368. <td>
  369. <!-- 버튼 영역 : 시작 -->
  370. <!-- 발주의뢰정보 : 시작 -->
  371. <TABLE class="form-table">
  372. <colgroup>
  373. <col width="150" />
  374. <col width="270" />
  375. <col width="100" />
  376. <col width="*" />
  377. </colgroup>
  378. <TR height="25">
  379. <TH class=" required">발행처</TH>
  380. <TD colspan="3">
  381. &nbsp;<%= HTMLMaker.getSelectTag(dutyIssueRow, "DETAILCD", "DETAILNM", "p_stamp_duty_issue", "width:150px;height=18;", "<option value=''>선택</option>", "") %>
  382. </TD>
  383. </TR>
  384. <TR height="25">
  385. <TH class=" required">발주처</TH>
  386. <TD colspan="3">
  387. &nbsp;<%= InputText.get("p_corp_name", "", 35, 200, "required,persize,string") %>
  388. </TD>
  389. </TR>
  390. <TR height="25">
  391. <TH class=" required">사업자등록번호</TH>
  392. <TD colspan="3">
  393. &nbsp;<%= InputText.get("p_corp_reg_no1", "", 4, 3, "Number,required,persize,string") %> -
  394. <%= InputText.get("p_corp_reg_no2", "", 3, 2, "Number,required,persize,string") %> -
  395. <%= InputText.get("p_corp_reg_no3", "", 8, 5, "Number,required,persize,string") %>
  396. </TD>
  397. </TR>
  398. <TR height="25">
  399. <TH class=" required">고유식별번호</TH>
  400. <TD colspan="3">
  401. &nbsp;<%= InputText.get("p_stamp_duty_no", "", 35, 50, "required,persize,string") %>
  402. </TD>
  403. </TR>
  404. <TR height="25">
  405. <TH class=" required">계약번호</TH>
  406. <TD >
  407. &nbsp;<%= InputText.get("p_cont_no", "", 60, 30, "required,persize,string") %>
  408. </TD>
  409. <TH >변경차수</TH>
  410. <TD >
  411. &nbsp;<%= InputText.get("p_mod_no", "", 20, 2, "Number,required,persize,string") %>
  412. </TD>
  413. </TR>
  414. <TR height="25">
  415. <TH class=" required">계약명</TH>
  416. <TD colspan="3">
  417. &nbsp;<%= InputText.get("p_cont_name", "", 35, 200, "required,persize,string") %>
  418. </TD>
  419. </TR>
  420. <TR height="25">
  421. <TH class=" required">통화</TH>
  422. <TD colspan="3">
  423. &nbsp;<%= HTMLMaker.getSelectTag(exchangeRow, "CODE", "NAME", "p_currency_gb", "style='width:150px;' onChange='doChange();'", "<option value=''>선택</option>", "") %>
  424. </TD>
  425. </TR>
  426. <TR height="25">
  427. <TH class=" required">계약금액</TH>
  428. <TD colspan="3">
  429. &nbsp;<%= InputText.get("p_cont_amt", "", 35, 16, "Float,Right,required,persize","float") %> (VAT포함)
  430. </TD>
  431. </TR>
  432. <TR height="25">
  433. <TH class=" required">인지세액</TH>
  434. <TD colspan="3">
  435. &nbsp;<%= InputText.get("p_stamp_duty_tax", "", 35, 12, "Number,Right,required,persize,string","float") %> 원
  436. </TD>
  437. </TR>
  438. <TR height="25">
  439. <TH class=" required">발행일자</TH>
  440. <TD colspan="3">
  441. &nbsp;<%= InputText.get("p_stamp_duty_date","" , 13, 10, "center,desc=발행일자,readOnly") %>
  442. <IMG name="calendar_sitedescdate" id="calendar_sitedescdate" src="/img/buyer/button/bt_calender.gif" border="0" align="absmiddle" style="cursor:pointer;" onClick="JavaScript:dlgCalendar('p_stamp_duty_date');">
  443. </TD>
  444. </TR>
  445. <TR height="25">
  446. <TH >비고</TH>
  447. <TD colspan="3">
  448. &nbsp;<%= InputText.get("p_remark", "", 90, 250, "required,persize,string") %>
  449. <!-- <input type="text" name="p_remark" id="p_remark" value="" style="width: 250px;" /> -->
  450. </TD>
  451. </TR>
  452. <TR height="25">
  453. <TH class=" required">인지세사본<a href="javascript:stampDesc()"><IMG src='/img/buyer/button/q.gif' align="absmiddle"></a></TH>
  454. <TD colspan="3">
  455. <div id="attach_file_view_stamp" class="attach_file_view" style="width:80%; text-overflow:ellipsis; white-space: nowrap; overflow: hidden; float: left;">
  456. <%=FileManager.getFileListForDiv("SAL_STAMP_DUTY", p_stamp_duty_id) %>
  457. </div>
  458. <div style="text-align: right;">
  459. <IMG id='search_spot_button_stamp' onClick="doAttachStampFile(document.form1.p_stamp_duty_id);" src='/img/buyer/button/bt_change.gif' border='0' align="top" align='absmiddle' alt='[Attach File]' style='cursor:pointer;'>
  460. </div>
  461. </TD>
  462. </TR>
  463. </TABLE>
  464. </td>
  465. </tr>
  466. </TABLE>
  467. </FORM>