ContWrite.jsp 47 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184
  1. <%--
  2. - Author(s) : Kim Myung HO
  3. - Date : 2014.07.07
  4. - Description: 계약 작성
  5. --%>
  6. <%@page import="java.sql.Clob"%>
  7. <%@ page contentType="text/html; charset=utf-8" %>
  8. <%@ page import="com.udapsoft.waf.system.HandlerStorage" %>
  9. <%@ page import="com.udapsoft.waf.common.ui.*" %>
  10. <%@ page import="com.udapsoft.waf.common.util.*" %>
  11. <%@ page import="kr.co.hsnc.common.util.*"%>
  12. <%@ page import="kr.co.hsnc.common.sql.*" %>
  13. <%@ include file="/jsp/work/taglib.jsp" %>
  14. <%@ page import="kr.co.udapsoft.ebid.buyer.common.file.FileManager"%>
  15. <jsp:useBean id="ctx" class="com.udapsoft.waf.system.context.SessionContext" scope="session" />
  16. <%
  17. ctx.init(request, response);
  18. HandlerStorage storage = ctx.getHandlerStorage();
  19. ValueObject params = storage.getParams();
  20. ValueObject user = storage.getUser();
  21. // RowSet CorpRowSet = storage.getRowSet("CorpRowSet");
  22. ValueObject ContInfo = storage.getValueObject("ContInfo");
  23. /*계약서식 정보 START*/
  24. RowSet template = storage.getRowSet("template");
  25. /*계약 구매 내역 목록*/
  26. RowSet itemList = storage.getRowSet("itemList");
  27. /*인지세 구분*/
  28. RowSet stampList = storage.getRowSet("stampRowSet");
  29. //변경계약일경우 이전 차수에서 데이터를 가져온다.
  30. ValueObject OldContInfo = null;
  31. if(params.get("ChgCont").equals("Y")){
  32. OldContInfo = storage.getValueObject("OldContInfo");
  33. }
  34. //변경계약내역서 추가 2019.08.06
  35. RowSet chgItemList = storage.getRowSet("chgItemList");
  36. %>
  37. <LINK href="/css/cont/cont_style.css" rel="stylesheet" type="text/css">
  38. <script language="javascript" src="/js/cont/cont_util.js"></script>
  39. <script language="javascript" src="/js/cont/lib.validate.js"></script>
  40. <SCRIPT language="JavaScript">
  41. /*예약함수*/
  42. var sheet1;
  43. var sheet1Row;
  44. var sheet1PageNo = 1;
  45. var pageLastRowIndex = 1;
  46. var validationResult = false;
  47. var filterShow = false;
  48. var payCallNum = 1; //대금계획에서 화면 이동 정의
  49. function _onReady(){
  50. /* STAMP_DUTY, PROMISE_DOC 인클루드 페이지 기능 */
  51. gridInit2(sheet2);
  52. gridInit3(sheet3);
  53. doSearchStamp();
  54. doSearchPromise();
  55. if(!(jQuery("#STATUS_CD").val() == '20' || jQuery("#STATUS_CD").val() == '30' || jQuery("#STATUS_CD").val() == '50')){
  56. jQuery("#p_issue_gb").attr("disabled",false);
  57. jQuery("#p_promise_gb").attr("disabled",false);
  58. if(jQuery("#p_issue_gb").val()=="00"||jQuery("#p_issue_gb").val()==""){
  59. jQuery("#btnAdd").hide();
  60. jQuery("#btnSaveStamp").hide();
  61. }else{
  62. jQuery("#btnAdd").show();
  63. jQuery("#btnSaveStamp").show();
  64. }
  65. if(jQuery("#p_promise_gb").val()=="00"||jQuery("#p_promise_gb").val()==""){
  66. jQuery("#btnPromiseAdd").hide();
  67. jQuery("#btnSavePromise").hide();
  68. }else{
  69. jQuery("#btnPromiseAdd").show();
  70. jQuery("#btnSavePromise").show();
  71. }
  72. }else{
  73. jQuery("#p_issue_gb").attr("disabled",true);
  74. jQuery("#p_promise_gb").attr("disabled",true);
  75. if(jQuery("#p_issue_gb").val()=="00"||jQuery("#p_issue_gb").val()==""||jQuery("#STATUS_CD").val() == '50'){
  76. jQuery("#btnAdd").hide();
  77. jQuery("#btnSaveStamp").hide();
  78. }else{
  79. jQuery("#btnAdd").show();
  80. jQuery("#btnSaveStamp").show();
  81. }
  82. if(jQuery("#p_promise_gb").val()=="00"||jQuery("#p_promise_gb").val()==""||jQuery("#STATUS_CD").val() == '50'){
  83. jQuery("#btnPromiseAdd").hide();
  84. jQuery("#btnSavePromise").hide();
  85. }else{
  86. jQuery("#btnPromiseAdd").show();
  87. jQuery("#btnSavePromise").show();
  88. }
  89. }
  90. jQuery("#btnAdd").click(function() {
  91. var rowIdx = sheet2.DataInsert(-1);
  92. if(jQuery("#p_issue_gb").val()=="10"){
  93. sheet2.SetCellValue(rowIdx, "STAMP_DUTY_ISSUE_GB", "10");
  94. }else{
  95. sheet2.SetCellValue(rowIdx, "STAMP_DUTY_ISSUE_GB", "20");
  96. }
  97. });
  98. jQuery("#btnPromiseAdd").click(function() {
  99. var rowIdx = sheet3.DataInsert(-1);
  100. if(jQuery("#p_promise_gb").val()=="10"){
  101. sheet3.SetCellValue(rowIdx, "PROMISE_DOC_TYPE_GB", "10");
  102. }else{
  103. sheet3.SetCellValue(rowIdx, "PROMISE_DOC_TYPE_GB", "20");
  104. }
  105. });
  106. /**
  107. * Application Initialize
  108. */
  109. jQuery("#btn_list").click(function() {
  110. jQuery("#fevent").val("");
  111. jQuery("#form1").attr("action", "/bid/purchase/OrderReqeustList.screen");
  112. jQuery("#form1").attr("target", "_self");
  113. jQuery("#form1").attr("method", "post");
  114. jQuery("#form1").submit();
  115. });
  116. jQuery("#ELEC_CON_YN1").click(function() {
  117. jQuery("#ELEC_CON_YN1").attr("checked",true);
  118. jQuery("#ELEC_CON_YN2").attr("checked",false);
  119. });
  120. jQuery("#ELEC_CON_YN2").click(function() {
  121. jQuery("#ELEC_CON_YN1").attr("checked",false);
  122. jQuery("#ELEC_CON_YN2").attr("checked",true);
  123. });
  124. jQuery("#btnSave").click(function() {
  125. if(jQuery('#p_issue_gb').val() == '00' && sheet2.GetTotalRows() != 0 ){
  126. for(i=1; i <= sheet2.RowCount(); i++){
  127. if(sheet2.GetCellValue(i, "STATUS")!="D"){
  128. alert("인지세 발급 구분을 미발행으로 등록하려면\n인지세가 등록되어있거나 등록해서는 안됩니다.\n인지세를 삭제하여 주십시오.");
  129. return;
  130. }
  131. }
  132. }
  133. if(jQuery('#p_promise_gb').val() == '00' && sheet3.GetTotalRows() != 0 ){
  134. for(i=1; i <= sheet3.RowCount(); i++){
  135. if(sheet3.GetCellValue(i, "STATUS")!="D"){
  136. alert("서약서를 미발행으로 등록하려면\n서약서가 등록되어있거나 등록해서는 안됩니다.\n서약서를 삭제하여 주십시오.");
  137. return;
  138. }
  139. }
  140. }
  141. if(ck()){
  142. alert("[전자 계약 여부]는 필수 입니다.");
  143. return;
  144. }
  145. if(jQuery("#mod_gb").val() == ""){
  146. alert("변경내역을 선택해 주세요");
  147. return;
  148. }
  149. //변경계약일경우 체크 프로세스 태운다. 2014-11-14 김명호 추가
  150. if(jQuery("#mod_gb").val() != "00"){
  151. if(!changeValCheck()){
  152. return;
  153. }
  154. }
  155. /* for(i=1; i <= sheet2.RowCount(); i++){
  156. if(sheet2.GetCellValue(i, "STATUS")!="D"){
  157. if(sheet2.GetCellValue(i, "STAMP_DUTY_NO")==""){
  158. alert(i+"행의 고유식별번호가 없습니다.");
  159. return false;
  160. }
  161. if(sheet2.GetCellValue(i, "STAMP_DUTY_TAX")=="" || sheet2.GetCellValue(i, "STAMP_DUTY_TAX")<=0){
  162. alert(i+"행의 인지세가 없거나 인지세가 0보다 작거나 같습니다.\n인지세는 0보다 커야합니다.");
  163. return false;
  164. }
  165. if(sheet2.GetCellValue(i, "STAMP_DUTY_DATE")==""){
  166. alert(i+"행의 발행일자가 없습니다.");
  167. return false;
  168. }
  169. }
  170. } */
  171. if(!checkTelno(jQuery("#O_TEL_NUM").val())) {
  172. alert("전화번호가 올바르지 않은 형식입니다");
  173. jQuery("#O_TEL_NUM").focus();
  174. return;
  175. }
  176. if(!checkTelno(jQuery("#O_HP").val())) {
  177. alert("휴대폰번호가 올바르지 않은 형식입니다");
  178. jQuery("#O_HP").focus();
  179. return;
  180. }
  181. if(!checkTelno(jQuery("#C_TEL_NUM").val())) {
  182. alert("전화번호가 올바르지 않은 형식입니다");
  183. jQuery("#C_TEL_NUM").focus();
  184. return;
  185. }
  186. if(!checkTelno(jQuery("#C_HP").val())) {
  187. alert("휴대폰번호가 올바르지 않은 형식입니다");
  188. jQuery("#C_HP").focus();
  189. return;
  190. }
  191. if(!checkEmail(jQuery("#O_EMAIL").val())){
  192. alert("이메일 형식이 올바르지 않습니다.");
  193. jQuery("#O_EMAIL").focus();
  194. return;
  195. }
  196. if(!checkEmail(jQuery("#C_EMAIL").val())){
  197. alert("이메일 형식이 올바르지 않습니다.");
  198. jQuery("#C_EMAIL").focus();
  199. return;
  200. }
  201. <%if(params.get("TEMPLATE_CD").equals("3")){%>
  202. if(form1.con_guar_amt_rate.value== "" && form1.amtRate1.checked==true){ //2021.07.29
  203. alert("계약이행 보증율을 입력해 주세요.");
  204. form1.con_guar_amt_rate.focus;
  205. return;
  206. }
  207. if(form1.def_guar_amt_rate.value== "" && form1.amtRate2.checked==true ){
  208. alert("하자이행 보증율을 입력해 주세요.");
  209. form1.def_guar_amt_rate.focus;
  210. return;
  211. }
  212. if(form1.con_guar_terms1.value== "" && form1.amtRate3.checked==true ){
  213. alert("지급이행 보증기한을 입력해 주세요.");
  214. form1.def_guar_amt_rate.focus;
  215. return;
  216. }
  217. <%}%>
  218. <%if(!ContInfo.get("DIV_PO_YN").equals("Y")){%>
  219. if(form1.ord_supply_amt.value== ""){
  220. alert("공급가액을 입력해 주세요.");
  221. form1.ord_supply_amt.focus;
  222. return;
  223. }
  224. <%if((!params.get("TEMPLATE_CD").equals("6"))&& (!params.get("TEMPLATE_CD").equals("10"))){%>
  225. <%if(params.get("TEMPLATE_CD").equals("3")){%>
  226. if(form1.con_guar_amt_rate.value== "" && form1.amtRate1.checked==true){
  227. alert("계약이행 보증율을 입력해 주세요.");
  228. form1.con_guar_amt_rate.focus;
  229. return;
  230. }
  231. if(form1.def_guar_amt_rate.value== "" && form1.amtRate2.checked==true ){
  232. alert("하자이행 보증율을 입력해 주세요.");
  233. form1.def_guar_amt_rate.focus;
  234. return;
  235. }
  236. if(form1.con_guar_terms1.value== "" && form1.amtRate3.checked==true ){
  237. alert("지급이행 보증기한을 입력해 주세요.");
  238. form1.def_guar_amt_rate.focus;
  239. return;
  240. }
  241. <%}else{%>
  242. if(form1.con_guar_amt_rate.value== "" ){
  243. alert("계약이행 보증율을 입력해 주세요.");
  244. form1.con_guar_amt_rate.focus;
  245. return;
  246. }
  247. if(form1.def_guar_amt_rate.value== "" ){
  248. alert("하자이행 보증율을 입력해 주세요.");
  249. form1.def_guar_amt_rate.focus;
  250. return;
  251. }
  252. <%}%>
  253. //공급가 기준(KRW : 10,000,000이상, USD : 10,000이상일 경우 계약이행,하자보수 보증증권 시행) 2021.02.02 최훈석
  254. if(form1.con_guar_amt_rate.value == "0" || form1.def_guar_amt_rate.value == "0"){
  255. var guar_nm = "";
  256. if(form1.con_guar_amt_rate.value == "0" && form1.def_guar_amt_rate.value == "0"){
  257. guar_nm = "(계약, 하자)";
  258. }else if(form1.con_guar_amt_rate.value == "0"){
  259. guar_nm = "(계약)";
  260. }else if(form1.def_guar_amt_rate.value == "0"){
  261. guar_nm = "(하자)";
  262. }
  263. if(jQuery("#CURRENCY_GB").val() == "KRW"){
  264. if(form1.ord_supply_amt.value.replaceAll(",","") >= 10000000){
  265. if(!confirm("계약금 1,000만원 이상이나 보증율"+guar_nm+"이\n등록되지 않았습니다.\n\n그래도 진행하시겠습니까? ")){
  266. return;
  267. }
  268. }
  269. }else if(jQuery("#CURRENCY_GB").val() == "USD"){
  270. if(form1.ord_supply_amt.value.replaceAll(",","") >= 10000){
  271. if(!confirm("계약금 10,000달러 이상이나 보증율"+guar_nm+"이\n등록되지 않았습니다.\n\n그래도 진행하시겠습니까?")){
  272. return;
  273. }
  274. }
  275. }
  276. }
  277. <% }
  278. }
  279. %>
  280. <%if(!(params.get("TEMPLATE_CD").equals("4"))&&!(params.get("TEMPLATE_CD").equals("15"))){%>
  281. if(parseFloat_isNaN(form1.prepay_amt_rate.value)+parseFloat_isNaN(form1.mid_amt_rate.value)+parseFloat_isNaN(form1.rmdr_amt_rate.value) != 100){ //2018.08.13
  282. if(!confirm("대금 지불 방법의 총 합은 100%아닙니다.\n\n그래도 진행하시겠습니까?")){
  283. form1.prepay_amt_rate.focus;
  284. return;
  285. }
  286. }
  287. <%}%>
  288. <%if((params.get("TEMPLATE_CD").equals("9")) || (params.get("TEMPLATE_CD").equals("10"))){%>
  289. //자유서식일경우 첨부 파일은 필수
  290. if(jQuery("#p_AttachFile1").val() == ""){
  291. alert('자유서식 계약일 경우 첨부파일은 필수 사항입니다.');
  292. return;
  293. }
  294. <%}%>
  295. //변경계약일경우 체크 - 처음은 변경 내역만 비교 했지만 나중(2014-11-24 상품 내역도 수정이 추가 되어 합계 비료를 하게 되었음.)
  296. //if(!jQuery("#pDemID").val()==""){
  297. //var chg_ord_spply_amt = form1.ord_supply_amt.value.replace(/,/gi,"");
  298. var chg_ord_spply_amt = Number(form1.ord_supply_amt.value.replace(/,/gi,"")*1);
  299. var item_amt_sum = Number(form1.ITEM_AMT_SUM.value.replace(/,/gi,"")*1);
  300. item_amt_sum = item_amt_sum.toFixed(Number(form1.sosuNum.value)); //2018.10.31 내역과 계약갑지 소수점 처리
  301. if(item_amt_sum != chg_ord_spply_amt){
  302. alert("상품 내역의 총 합과 계약 금액과 다릅니다.\n\n내역 팝업을 띄워서 총 합을 확인해 주시기 바랍니다.");
  303. form1.ord_supply_amt.focus;
  304. return;
  305. }
  306. // }
  307. if(!chkContHtml()){
  308. return;
  309. }
  310. //대금 계획 체크 2016.4.26 원계약일때만 계획체크
  311. <%if(ContInfo.get("PAY_DIV").equals("2") && ContInfo.getInt("MOD_NO") <= 0 ){%> //PAY_DIV 가 2인 설치일때만 대금계획을 저장한다.
  312. if(!paySaveChk()){
  313. return;
  314. }
  315. <%}%>
  316. //분개유형 DEFAULT(-선택-)일 경우 팝업 출력(2020.12.28)
  317. if(jQuery("#acct_gb").val() == "0"){
  318. alert("분개유형을 선택해 주시기 바랍니다.");
  319. return;
  320. }
  321. <%if((params.get("TEMPLATE_CD").equals("4")) || (params.get("TEMPLATE_CD").equals("9")) || (params.get("TEMPLATE_CD").equals("13"))){%>
  322. //영세 세금계산서일 경우 부가세에 금액이 있다면 팝업 출력(변경예정)
  323. if(jQuery("#gua_gb").val() == "23"){
  324. if(form1.ord_surtax_amt.value != "0"){
  325. if(!confirm("영세(세금계산서)이나 부가세가 등록되어 있습니다.\n\n그래도 진행하시겠습니까?")){
  326. form1.ord_surtax_amt.focus;
  327. return;
  328. }
  329. }
  330. }
  331. <%}%>
  332. if (confirm("저장 하시겠습니까?")){
  333. var f = document.form1;
  334. submitXmlRequest("/cont/purchase/ContWrite_form.screen", "PARTNER_EMP_CHK", f, "VALUEOBJECT");
  335. document.form1.isSubmit = false;
  336. /* var f = document.form1;
  337. jQuery("#fevent").val("FORM_SAVE");
  338. submitXmlRequest("/cont/purchase/ContWrite_form.screen", "FORM_SAVE", f); */
  339. }
  340. });
  341. //변경계약 삭제
  342. jQuery("#btnDel").click(function() {
  343. if (confirm("변경계약을 삭제 하시겠습니까?")){
  344. var f = document.form1;
  345. jQuery("#fevent").val("FORM_DEL_CHG"); //2017.04.12 변경계약대상에서 삭제
  346. submitXmlRequest("/cont/purchase/ContWrite_form.screen", "FORM_DEL_CHG", f);
  347. }
  348. });
  349. //변경계약대상 변경시행결의 진행 2016.03.09
  350. jQuery("#btnDeciSave").click(function() {
  351. stampMsg = '계약정보 저장 후 결재화면이 활성화 됩니다.\n\n결재요청 요청하시겠습니까?';
  352. if (confirm(stampMsg)){
  353. var f = document.form1;
  354. jQuery("#fevent").val("FORM_DEC_SAVE"); //예산금액만 저장. 상태값 확인
  355. submitXmlRequest("/cont/purchase/ContWrite_form.screen", "FORM_DEC_SAVE", f);
  356. }
  357. });
  358. //계약서 삭제
  359. jQuery("#btnDelete").click(function() {
  360. if (confirm("계약서를 삭제 하시겠습니까?")){
  361. var f = document.form1;
  362. jQuery("#fevent").val("FORM_DELETE");
  363. submitXmlRequest("/cont/purchase/ContWrite_form.screen", "FORM_DELETE", f, "SUCCESS");
  364. }
  365. });
  366. //변경계약일경우 내역 팝업
  367. jQuery("#btnChgItem").click(function() {
  368. var win_id = "chgItemPop";
  369. var editYN = "Y";
  370. var link = "/cont/purchase/chgItemPopup.screen";
  371. link += "?pop_win_id="+win_id+"&PUR_CONT_MOD_ID="+$("#PUR_CONT_MOD_ID").val()+"&PUR_CONT_ID="+$("#PUR_CONT_ID").val()+"&pDemID="+$("#pDemID").val()+"&digit="+$("#sosuNum").val()+"&editYN="+ editYN;
  372. fLayerPop(win_id, link, 950,500, '','', 'NO');
  373. });
  374. //계약 내역 팝업
  375. jQuery("#btnItem").click(function() {
  376. var win_id = "ItemPop";
  377. var editYN = "Y";
  378. var link = "/cont/purchase/ItemPopup.screen";
  379. link += "?pop_win_id="+win_id+"&PUR_CONT_MOD_ID="+$("#PUR_CONT_MOD_ID").val()+"&PUR_CONT_ID="+$("#PUR_CONT_ID").val()+"&pDemID="+$("#pDemID").val()+"&TEMPLATE_CD="+$("#TEMPLATE_CD").val()+"&DIV_PO_YN="+$("#DIV_PO_YN").val()+"&digit="+$("#sosuNum").val()+"&curr_std_nm="+encodeURI(encodeURIComponent($("#CURR_STD_NM").val()),"UTF-8")+"&editYN="+ editYN;
  380. fLayerPop(win_id, link, 950,500, '','', 'NO');
  381. });
  382. chgModGb(jQuery("#mod_gb").val());
  383. //2019.11.22 변경계약일경우 계약상품내역 확인 문구 추가 요청 - 송영주 과장
  384. <%if(params.get("ChgCont").equals("Y")){%>
  385. alert("계약상품내역을 먼저 확인후 작성해주세요.");
  386. <%}%>
  387. }
  388. function ck(){
  389. if($("#ELEC_CON_YN1").attr("checked") == "checked"){
  390. return false;
  391. }
  392. if($("#ELEC_CON_YN2").attr("checked") == "checked"){
  393. return false;
  394. }
  395. return true;
  396. }
  397. //자동로그인 기능
  398. function f_gologin(login_id,login_pw){
  399. var f = document.form1;
  400. if('<%= user.get("ACCT_TYPE_CODE")%>' != "ADMIN"){
  401. dlgAlert("User who logged in as administrator only can do automatic log-in.");
  402. return;
  403. }
  404. f.login_id.value = login_id;
  405. f.login_pw.value = login_pw;
  406. if( !submitXmlRequest("/sign_on_check", "", document.form1) ) {
  407. alert("Log-in is being processed.");
  408. };
  409. }
  410. function goListProc(){
  411. var f = document.form1;
  412. f.fevent.value ="";
  413. f.action = "/cont/purchase/ContTargetList.screen";
  414. f.target = "_self";
  415. f.submit();
  416. }
  417. function doResult(resultObj) {
  418. try {
  419. if( resultObj.getRequestEvent() == "PARTNER_EMP_CHK") {
  420. if( resultObj.getSuccess() ) {
  421. var vo = resultObj.getValueObject();
  422. var cnt = vo.get("EMP_CHK_CNT");
  423. if(cnt > 0){
  424. var f = document.form1;
  425. jQuery("#fevent").val("FORM_SAVE");
  426. submitXmlRequest("/cont/purchase/ContWrite_form.screen", "FORM_SAVE", f);
  427. }else{
  428. if(confirm("등록된 업체담당자 정보와 일치하지 않습니다. 계속진행하시겠습니까?")){
  429. var f = document.form1;
  430. jQuery("#fevent").val("FORM_SAVE");
  431. submitXmlRequest("/cont/purchase/ContWrite_form.screen", "FORM_SAVE", f);
  432. }else{
  433. return;
  434. }
  435. }
  436. }else {
  437. dlgErrorMsg(resultObj);
  438. }
  439. document.form1.isSubmit = false;
  440. }
  441. if( resultObj.getRequestEvent() == "FORM_SAVE") {
  442. if( resultObj.getSuccess() ) {
  443. jQuery("#save_gb").val("Y");
  444. doSaveStamp();
  445. doSavePromise();
  446. //2016.4.27 변경일때 제외
  447. <%if(ContInfo.get("PAY_DIV").equals("2") && ContInfo.getInt("MOD_NO") <= 0){%> //PAY_DIV 가 2인 설치일때만 대금계획을 저장한다.
  448. payPlanSave(); //대금 계획 저장
  449. <%}else{%>
  450. alert("계약서저장에 성공하였습니다.\n\n저장된 계약서는 구매_계약현황페이지에서 확인하실수 있습니다.");
  451. location.href="/cont/purchase/ContIngList.screen";
  452. // goListProc();
  453. <%}%>
  454. }
  455. else {
  456. dlgErrorMsg(resultObj);
  457. }
  458. }
  459. //2016.03.09
  460. if( resultObj.getRequestEvent() == "FORM_DEC_SAVE") {
  461. if( resultObj.getSuccess() ) {
  462. jQuery("#save_gb").val("Y");
  463. document.form1.isSubmit = false;
  464. var f = document.form1;
  465. var sign_cont_mod_id = $("#PUR_CONT_MOD_ID").val();
  466. dlgSignForm('ebid_pcpoD', '/cont/purchase/contSign.screen?sign_cont_mod_id='+sign_cont_mod_id+'^acct_id='+"<%=user.get("ACCT_ID")%>");
  467. }
  468. else {
  469. dlgErrorMsg(resultObj);
  470. }
  471. }
  472. //계약서 삭제
  473. if( resultObj.getRequestEvent() == "FORM_DEL") {
  474. if( resultObj.getSuccess() ) {
  475. alert("정상적으로 삭제 처리 되었습니다.")
  476. goListProc();
  477. } else {
  478. dlgErrorMsg(resultObj);
  479. }
  480. }
  481. //2017.04.12 변경계약 대상->접수로 이동
  482. if( resultObj.getRequestEvent() == "FORM_DEL_CHG") {
  483. if( resultObj.getSuccess() ) {
  484. alert("정상적으로 삭제 처리 되었습니다.")
  485. goListProc();
  486. } else {
  487. dlgErrorMsg(resultObj);
  488. }
  489. }
  490. //계약서 삭제
  491. if( resultObj.getRequestEvent() == "FORM_DELETE") {
  492. if( resultObj.getSuccess() ) {
  493. alert("정상적으로 삭제 처리 되었습니다.");
  494. goListProc();
  495. } else {
  496. dlgErrorMsg(resultObj);
  497. }
  498. }
  499. document.form1.isSubmit = false;
  500. }
  501. catch(errorObject) {
  502. showErrorDlg("doResult()", errorObject);
  503. }
  504. }
  505. //결재2016.03.09
  506. function dlgSignForm( sign_class_cd, uri ) {
  507. var f = document.form1;
  508. var sheet1 = document.all.sheet1;
  509. var url = "/contPurchaseSign/contSign_form.screen";
  510. url += "?sign_class_cd=" + sign_class_cd;
  511. url += "&uri=" + uri;
  512. url += "&sign_cont_mod_id=" + $("#PUR_CONT_MOD_ID").val();
  513. url += "&acct_type=1";
  514. window.open(url, "_blank","width=200,height=100,SCROLLBARS=no");
  515. }
  516. /*담당자 호출*/
  517. var pCallPop = "";
  518. function SearchUser(pGuBun,NAME,CODE){
  519. pCallPop = pGuBun;
  520. var win_id = "_searchUserPopup";
  521. var link = "/lib/dlgSearchUserPop.screen";
  522. link += "?pop_win_id="+win_id;
  523. if(pCallPop != "Sheet"){
  524. link += "&deptNameYn=purchase";
  525. }
  526. link += "&NAME=" + NAME;
  527. link += "&CODE=" + CODE;
  528. fLayerPop(win_id, link, 700,400, '', '', 'NO');
  529. }
  530. /*담당자 호출 Return Value 처리*/
  531. function SearchUserClose(result){
  532. if(result.length > 0){
  533. if(pCallPop == "Sheet"){
  534. sheet1.SetCellValue(clickRow, "VP_CHK_EMPNO", result[9]); //밴더프린트 담당자 아이디
  535. sheet1.SetCellValue(clickRow, "VP_CHK_EMPNM", result[1]); //밴더프린트 담당자명
  536. }else{
  537. $("#O_USER_NAME").val(result[1]);
  538. $("#O_DIVISION").val(result[3]);
  539. $("#O_POSITION").val(result[5]);
  540. $("#O_TEL_NUM").val(result[6]);
  541. $("#O_HP").val(result[7]);
  542. $("#O_EMAIL").val(result[8]);
  543. $("#O_ACCT_ID").val(result[9]);
  544. replaceInput(result[3],"req_dept_nm" ,__html);
  545. }
  546. }
  547. fLayerPopClose('_searchUserPopup');
  548. }
  549. /*계약서 pdf script start*/
  550. function chkContHtml(){
  551. var f = document.form1;
  552. var c = $("#PDF_FILE_CNT").val();
  553. if(validate(f)){
  554. splitHtml(f, 'cont_html', false, c);
  555. splitHtml(f, 'cont_html_rm', true, c);
  556. return true;
  557. }
  558. return false;
  559. }
  560. /*계약서 pdf script end*/
  561. //첨부파일
  562. function doAttachFile(obj) {
  563. if(obj==''){
  564. alert("저장을 한 후 파일을 첨부할 수 있습니다.");
  565. }
  566. else if(obj != ''){
  567. viewFileListNew('PUR_CONT_MOD_ID', obj.value, document.getElementById("p_AttachFile1"), "Y", "cont/purchase/<%=ContInfo.get("PUR_CONT_MOD_ID")%>");
  568. }
  569. }
  570. /**
  571. * 첨부파일 예약 함수
  572. */
  573. function fileDown(file_id){
  574. var url="/common/file/FileDownloadServlet";
  575. url += "?file_id=" + file_id;
  576. 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")
  577. }
  578. </SCRIPT>
  579. <modular:search id="form1">
  580. <modular:key id="fevent" />
  581. </modular:search>
  582. <form id="form1" name="form1" method="post" modular:type="search">
  583. <INPUT type="hidden" name="fevent" id="fevent" value="<%= params.get("fevent") %>">
  584. <INPUT type="hidden" name="save_gb" id="save_gb" value="">
  585. <INPUT type="hidden" name="acct_id" value="<%= params.get("acct_id") %>">
  586. <!-- 검색 조건 시작-->
  587. <INPUT type="hidden" name="p_dept_cd" value="<%= params.get("p_dept_cd") %>">
  588. <INPUT type="hidden" name="p_dept_nm" value="<%= params.get("p_dept_nm") %>">
  589. <INPUT type="hidden" name="p_dealer_nm" value="<%= params.get("p_dealer_nm") %>">
  590. <INPUT type="hidden" name="p_cont_status" value="<%= params.get("p_cont_status") %>">
  591. <INPUT type="hidden" name="ContFromDt" value="<%= params.get("ContFromDt") %>">
  592. <INPUT type="hidden" name="ContToDt" value="<%= params.get("ContToDt") %>">
  593. <INPUT type="hidden" name="p_build_nm" value="<%= params.get("p_build_nm") %>">
  594. <!-- 검색 조건 끝-->
  595. <INPUT type="hidden" name="CONT_STATUS" value="<%=ContInfo.get("CONT_STATUS")%>">
  596. <INPUT type="hidden" name="STATUS_CD" value="<%=ContInfo.get("STATUS_CD")%>">
  597. <INPUT type="hidden" name="PUR_CONT_MOD_ID" value="<%=ContInfo.get("PUR_CONT_MOD_ID")%>">
  598. <INPUT type="hidden" name="PUR_CONT_ID" value="<%=ContInfo.get("PUR_CONT_ID")%>">
  599. <INPUT type="hidden" name="O_CORP_ID" value="<%=ContInfo.get("O_CORP_ID")%>">
  600. <INPUT type="hidden" name="C_CORP_ID" value="<%=ContInfo.get("C_CORP_ID")%>">
  601. <INPUT type='hidden' name="ChgCont" value="<%= params.get("ChgCont") %>">
  602. <INPUT type='hidden' name="CURR_STD_NM" value="<%= ContInfo.get("CURR_STD_NM") %>">
  603. <!-- 계약서PDF정보 START-->
  604. <INPUT type="hidden" name="TEMPLATE_CD" value="<%=params.get("TEMPLATE_CD") %>">
  605. <INPUT type="hidden" name="ORD_DOC_NO" value="<%=ContInfo.get("ORD_DOC_NO") %>">
  606. <INPUT type="hidden" name="MOD_NO" value="<%=ContInfo.get("MOD_NO") %>">
  607. <INPUT type="hidden" name="PDF_FILE_CNT" value="<%=template.size()%>">
  608. <!-- 계약서PDF정보 END-->
  609. <!-- 아이템 총 합계금액 및 발주 의뢰 번호 -->
  610. <INPUT type="hidden" name="ITEM_AMT_SUM" value="<%=ContInfo.get("ITEM_AMT_SUM") %>">
  611. <INPUT type="hidden" name="pDemID" value="<%=ContInfo.get("DEM_ID") %>">
  612. <INPUT type="hidden" name="DIV_PO_YN" value="<%=ContInfo.get("DIV_PO_YN") %>">
  613. <INPUT type="hidden" name="O_REG_NO" value="<%=ContInfo.get("O_REG_NO") %>">
  614. <INPUT type="hidden" name="T_CON_GUAR_AMT_RATE" value="<%=ContInfo.get("CON_GUAR_AMT_RATE") %>">
  615. <INPUT type="hidden" name="T_CON_GUAR_TERMS" value="납품기한에 30일을 더한 날까지">
  616. <INPUT type="hidden" name="T_CON_GUAR_AMT" value="<%=ContInfo.get("CON_GUAR_AMT") %>">
  617. <INPUT type="hidden" name="T_DEF_GUAR_AMT_RATE" value="<%=ContInfo.get("DEF_GUAR_AMT_RATE") %>">
  618. <INPUT type="hidden" name="T_DEF_GUAR_AMT" value="<%=ContInfo.get("DEF_GUAR_AMT") %>">
  619. <INPUT type="hidden" name="O_ACCT_ID" id="O_ACCT_ID" value="<%=ContInfo.get("CON_CHARGE_ID")%>">
  620. <INPUT type="hidden" name="input_vat" value="<%=ContInfo.get("INPUT_VAT") %>">
  621. <!-- 제목 및 버튼 -->
  622. <table width="100%">
  623. <colgroup>
  624. <col width="500" />
  625. <col width="*" />
  626. </colgroup>
  627. <tr>
  628. <th>
  629. <div align="left" id="title">
  630. <ul>
  631. <li>구매_<%if(params.get("ChgCont").equals("Y")){%>변경<%} %>계약대상 상세</li>
  632. </ul>
  633. </div>
  634. </th>
  635. <td align="right">
  636. <span class="btnSearch center" id="btnSave"><a href="javascript:void(0);">저장</a></span>
  637. <%if(ContInfo.get("MOD_NO").equals("0") && (ContInfo.get("STATUS_CD").equals("") || ContInfo.get("STATUS_CD").equals("00"))){%>
  638. <span class="btnSearch center" id="btnDelete"><a href="javascript:void(0);">삭제</a></span>
  639. <%}%>
  640. <span class="btnSearch center" id="btnList"><a href="javascript:goListProc();">목록</a></span>
  641. <%
  642. if((params.get("TEMPLATE_CD").equals("6")) || (params.get("TEMPLATE_CD").equals("10"))){ //변경계약일경우 변경내역 팝업
  643. //변경 계약일경우 계약서 삭제 가능
  644. if(!ContInfo.get("DEM_ID").isEmpty()){
  645. %>
  646. <span class="btnSearch center" id="btnChgItem"><a href="javascript:void(0);">변경계약내역</a></span>
  647. <%
  648. }else{
  649. %>
  650. <span class="btnSearch center" id="btnItem"><a href="javascript:void(0);">계약상품내역</a></span>
  651. <%
  652. }
  653. %>
  654. <span class="btnSearch center" id="btnDel"><a href="javascript:void(0);">변경계약서삭제</a></span>
  655. <!-- <span class="btnSearch center" id="btnDeciSave"><a href="javascript:void(0);">결재</a></span> 2016.03.09 -->
  656. <%
  657. }else{
  658. %>
  659. <span class="btnSearch center" id="btnItem"><a href="javascript:void(0);">계약상품내역</a></span>
  660. <%
  661. }
  662. %>
  663. </td>
  664. </tr>
  665. </table>
  666. <%
  667. /*
  668. 계약 정보를 한페이지로 만들어서 include 시킴 (2014-08-14) 김명호
  669. */
  670. String isViewWrite = "W";
  671. String finalYn = "";
  672. %>
  673. <%@ include file="/jsp/ko_KR/buyer/cont/purchase/ContInfo.jsp" %>
  674. <div class="application-info magT10">
  675. <div class="application-sub-title">
  676. <span class="title">계약정보</span>
  677. </div>
  678. <div style="text-align:center;">
  679. <%if (params.get("ChgCont").equals("Y")) { //변경 계약서 일경우 추가 내역%>
  680. 변경구분
  681. <select name="mod_gb" onchange="chgModGb(this.value)">
  682. <option value="">-선택-</option>
  683. <option value="01" <%=ContInfo.get("MOD_GB").equals("01") ? "selected=selected":""%>>증액</option>
  684. <option value="02" <%=ContInfo.get("MOD_GB").equals("02") ? "selected=selected":""%>>감액</option>
  685. <option value="10" <%=ContInfo.get("MOD_GB").equals("10") ? "selected=selected":""%>>연장</option>
  686. <option value="11" <%=ContInfo.get("MOD_GB").equals("11") ? "selected=selected":""%>>연장증액</option>
  687. <option value="12" <%=ContInfo.get("MOD_GB").equals("12") ? "selected=selected":""%>>연장감액</option>
  688. <option value="20" <%=ContInfo.get("MOD_GB").equals("20") ? "selected=selected":""%>>단축</option>
  689. <option value="21" <%=ContInfo.get("MOD_GB").equals("21") ? "selected=selected":""%>>단축증액</option>
  690. <option value="22" <%=ContInfo.get("MOD_GB").equals("22") ? "selected=selected":""%>>단축감액</option>
  691. <option value="98" <%=ContInfo.get("MOD_GB").equals("98") ? "selected=selected":""%>>계약이관</option>
  692. <option value="99" <%=ContInfo.get("MOD_GB").equals("99") ? "selected=selected":""%>>기타</option>
  693. </select>
  694. <% } else { //당초 일경우 기본 값%>
  695. <input type="hidden" name="mod_gb" id ="mod_gb" value="<%=ContInfo.get("MOD_GB")%>" />
  696. <% }%>
  697. <font color="ffffff">......</font>
  698. ※<span style="background-color:yellow;text-align:center">노랑색</span>은 필수입력사항, <span style="text-align:center;background-color:#CCFF99;">연두색</span>은 계약서에 인쇄되지 않는 항목입니다.
  699. </div>
  700. </div>
  701. <table width="100%" border="0" cellspacing="0" cellpadding="0" style="border:1px solid black;padding-top:5px">
  702. <tr>
  703. <td align="center" bgcolor="#efefef">
  704. <table width="770px" border="0" cellspacing="0" cellpadding="0">
  705. <tr>
  706. <td align="center">
  707. <%
  708. for(int i = 0 ; i < template.size(); i ++){
  709. %>
  710. <input type="hidden" name="template_seq" value="<%=template.getRow(i).get("SEQ")%>">
  711. <input type="hidden" name="template_name" value="<%=template.getRow(i).get("TEMPLATE_NAME")%>">
  712. <input type="hidden" name="template_style" value="<%=template.getRow(i).get("TEMPLATE_STYLE")%>">
  713. <input type="hidden" name="option_yn" value="<%=template.getRow(i).get("OPTION_YN")%>">
  714. <% if(i==0){ %>
  715. <span class="tab_on" id="tab_<%=template.getRow(i).get("SEQ")%>" onClick="tabView(<%=template.getRow(i).get("SEQ")%>)">
  716. <input type="hidden" name="check_yn_<%=template.getRow(i).get("SEQ")%>" value="A">
  717. <%=template.getRow(i).get("TEMPLATE_NAME")%>
  718. </span>
  719. <% }else{ %>
  720. <span class="tab_off" id="tab_<%=template.getRow(i).get("SEQ")%>" onClick="tabView(<%=template.getRow(i).get("SEQ")%>)">
  721. <%if(template.getRow(i).get("OPTION_YN").equals("A")){%>
  722. <input type="hidden" name="check_yn_<%=template.getRow(i).get("SEQ")%>" value="A">
  723. <%}else if(template.getRow(i).get("OPTION_YN").equals("Y")){ %>
  724. <input type="checkbox" name="check_yn_<%=template.getRow(i).get("SEQ")%>" value="Y" <%if(template.getRow(i).get("DEFAULT_YN").equals("Y")){%>checked="checked"<%}%>>
  725. <%} %>
  726. <%=template.getRow(i).get("TEMPLATE_NAME")%>
  727. </span>
  728. <% } %>
  729. <%} %>
  730. </td>
  731. </tr>
  732. </table>
  733. <div id="__html" style="width:770px;border:1px solid black;padding:10px 10px 10px 10px;background-color:#FFFFFF;text-align:left;" >
  734. <%
  735. for(int i = 0 ; i < template.size(); i ++){
  736. String template_html = ClobUtils.getClob((Clob)template.getRow(i).getObject("TEMPLATE_HTML"));
  737. String divHidden = template.getRow(i).get("SEQ").equals("0")?"":"none";
  738. %>
  739. <div style="display:<%=divHidden%>; padding-top: 10px;overflow:hidden;overflow-y:auto;<%=template.getRow(i).get("TEMPLATE_STYLE") %>" id="__html_<%=template.getRow(i).get("SEQ")%>">
  740. <%= template_html%>
  741. </div>
  742. <%} %>
  743. </div>
  744. <br>
  745. </td>
  746. </tr>
  747. </table>
  748. <div class="application-info magT15">
  749. <div class="application-sub-title">
  750. <span class="title">계약서류</span>
  751. </div>
  752. </div>
  753. <TABLE class="form-table">
  754. <colgroup>
  755. <col width="120" />
  756. <col width="*" />
  757. </colgroup>
  758. <TR height="25">
  759. <TH>직접첨부</TH>
  760. <TD>
  761. <table width="100%">
  762. <colgroup>
  763. <col/>
  764. <col WIDTH="30PX"/>
  765. </colgroup>
  766. <tr>
  767. <td>
  768. <TEXTAREA name="p_AttachFile1" id="p_AttachFile1" style="width:100%;height:50px;border:0;" rows="1" class="input" readOnly><%=FileManager.getFileListForTextarea("PUR_CONT_MOD_ID", ContInfo.get("PUR_CONT_MOD_ID")) %></TEXTAREA>
  769. </td>
  770. <td VALIGN="TOP">
  771. <IMG id='search_spot_button' onClick="doAttachFile(document.form1.PUR_CONT_MOD_ID,1);" src='/img/buyer/button/bt_change.gif' border='0' align="top" align='absmiddle' alt='[Attach File]' style='cursor:pointer;'>
  772. </td>
  773. </tr>
  774. </table>
  775. </TD>
  776. </TR>
  777. </TABLE>
  778. </form>
  779. <!-- -인도 조건 셋팅 -->
  780. <!-- 인도 조건 코드 겁색 팝업 -->
  781. <script type="text/javascript">
  782. <!--
  783. /**
  784. * 상세 코드 검색
  785. */
  786. function popSearchCodeDetail(bcd)
  787. {
  788. var win_id = "_searchCodePopup";
  789. var link = "/sycs/code/dlgCodePopup.screen";
  790. link += "?pop_win_id="+win_id;
  791. link += "&p_basecd="+bcd;
  792. fLayerPop(win_id, link, 600,400, '', '', 'NO');
  793. }
  794. function SearchCodeDetailClose(result){
  795. if(result != null){
  796. if(result[2]=="PUR_CON_GB"){
  797. replaceInput(result[0],"con_gb" ,__html);
  798. replaceInput(result[1],"spn_con_gb" ,__html);
  799. }else{
  800. replaceInput(result[0],"lead_cond_gb" ,__html);
  801. replaceInput(result[1],"spn_lead_cond_gb" ,__html);
  802. }
  803. }
  804. fLayerPopClose('_searchCodePopup');
  805. }
  806. //2017.07.14 구매 영세율일때 부가세별도 문구 삭제
  807. function VatTextChange()
  808. {
  809. var f = document.form1;
  810. if ("<%= params.get("TEMPLATE_CD")%>" == "3"){ //template_cd 기자재공급계약서
  811. if (f.input_vat.value == "INPUT_VAT") { //부가세
  812. replaceInput("-부가세별도","vat_gb" ,__html);
  813. }else{
  814. replaceInput(" ","vat_gb" ,__html);
  815. }
  816. }
  817. }
  818. //-->
  819. </script>
  820. <script>
  821. //계약일자
  822. <%
  823. String ord_con_date_year = "";
  824. String ord_con_date_month = "";
  825. String ord_con_date_day = "";
  826. if(!ContInfo.get("ORD_CON_DATE").equals("")){
  827. ord_con_date_year = ContInfo.get("ORD_CON_DATE").replaceAll("-","").substring(0,4);
  828. ord_con_date_month = ContInfo.get("ORD_CON_DATE").replaceAll("-","").substring(4,6);
  829. ord_con_date_day = ContInfo.get("ORD_CON_DATE").replaceAll("-","").substring(6,8);
  830. }
  831. %>
  832. replaceInput("<%=ord_con_date_year%>","ord_con_date_year",__html);
  833. replaceInput("<%=ord_con_date_month%>","ord_con_date_month",__html);
  834. replaceInput("<%=ord_con_date_day%>","ord_con_date_day",__html);
  835. replaceInput("<%=ord_con_date_year%>","o_ord_cont_date_year",__html);
  836. replaceInput("<%=ord_con_date_month%>","o_ord_cont_date_month",__html);
  837. replaceInput("<%=ord_con_date_day%>","o_ord_cont_date_day",__html);
  838. //공사기간
  839. <%
  840. String ord_start_date_year = "";
  841. String ord_start_date_month = "";
  842. String ord_start_date_day = "";
  843. if(!ContInfo.get("ORD_START_DATE").equals("")){
  844. ord_start_date_year = ContInfo.get("ORD_START_DATE").replaceAll("-","").substring(0,4);
  845. ord_start_date_month = ContInfo.get("ORD_START_DATE").replaceAll("-","").substring(4,6);
  846. ord_start_date_day = ContInfo.get("ORD_START_DATE").replaceAll("-","").substring(6,8);
  847. }
  848. String ord_end_date_year = "";
  849. String ord_end_date_month = "";
  850. String ord_end_date_day = "";
  851. if(!ContInfo.get("ORD_END_DATE").equals("")){
  852. ord_end_date_year = ContInfo.get("ORD_END_DATE").replaceAll("-","").substring(0,4);
  853. ord_end_date_month = ContInfo.get("ORD_END_DATE").replaceAll("-","").substring(4,6);
  854. ord_end_date_day = ContInfo.get("ORD_END_DATE").replaceAll("-","").substring(6,8);
  855. }
  856. %>
  857. replaceInput("<%=ord_start_date_year%>","ord_start_date_year",__html);
  858. replaceInput("<%=ord_start_date_month%>","ord_start_date_month",__html);
  859. replaceInput("<%=ord_start_date_day%>","ord_start_date_day",__html);
  860. replaceInput("<%=ord_end_date_year%>","ord_end_date_year",__html);
  861. replaceInput("<%=ord_end_date_month%>","ord_end_date_month",__html);
  862. replaceInput("<%=ord_end_date_day%>","ord_end_date_day",__html);
  863. //2018.08.13 보험료 납부인수계약서
  864. replaceInput("<%=ord_start_date_year%>","start_work_date_year",__html);
  865. replaceInput("<%=ord_start_date_month%>","start_work_date_month",__html);
  866. replaceInput("<%=ord_start_date_day%>","start_work_date_day",__html);
  867. replaceInput("<%=ord_end_date_year%>","end_work_date_year",__html);
  868. replaceInput("<%=ord_end_date_month%>","end_work_date_month",__html);
  869. replaceInput("<%=ord_end_date_day%>","end_work_date_day",__html);
  870. replaceInput("<%=ContInfo.get("dept_name")%>","und_con_name",__html);//원도급공사명
  871. replaceInput("<%=ContInfo.get("CST_DOC_NAME")%>","sub_und_con_name",__html);//하도급공사
  872. replaceInput("<%=ord_con_date_year%>","con_date_year",__html);
  873. replaceInput("<%=ord_con_date_month%>","con_date_month",__html);
  874. replaceInput("<%=ord_con_date_day%>","con_date_day",__html);
  875. //나머지 계약정보
  876. replaceInput("<%=ContInfo.get("DEPT_NAME")%>","dept_name",__html);//현장명
  877. replaceInput("<%=ContInfo.get("DEALER_NM")%>","dealer_nm",__html);//발주처 2018.08.13 추가
  878. replaceInput("<%=ContInfo.get("CST_DOC_NAME")%>","cst_doc_name",__html);//계약명
  879. replaceInput("<%=ContInfo.get("ORD_DOC_NO")%>","ord_doc_no",__html);// 계약번호
  880. replaceInput("<%=ContInfo.get("CURR_STD")%>","curr_std",__html);// 통화단위
  881. replaceInput("<%=ContInfo.get("CURR_STD_NM")%>","curr_std_nm",__html);// 통화단위
  882. replaceInput("<%=ContInfo.get("LEAD_PLACE")%>","lead_place",__html);//공사장소
  883. replaceInput("<%=ContInfo.get("ORD_AMT")%>","ord_amt",__html);// 계약금액
  884. replaceInput("<%=ContInfo.get("LEAD_COND_GB")%>","lead_cond_gb" ,__html);
  885. replaceInput("<%=ContInfo.get("LEAD_COND_GB_NM")%>","spn_lead_cond_gb" ,__html);
  886. replaceInput("<%=ContInfo.get("ORD_SUPPLY_AMT")%>","ord_supply_amt" ,__html);
  887. replaceInput("<%=ContInfo.get("ORD_SUPPLY_AMT")%>","ord_supply_amt2" ,__html);//2018.08.13 추가
  888. replaceInput("<%=ContInfo.get("ORD_SURTAX_AMT")%>","ord_surtax_amt" ,__html);
  889. replaceInput("<%=ContInfo.get("PREPAY_AMT_RATE")%>","prepay_amt_rate" ,__html);
  890. replaceInput("<%=ContInfo.get("PREPAY_AMT")%>","prepay_amt" ,__html);
  891. replaceInput("<%=ContInfo.get("MID_AMT_RATE")%>","mid_amt_rate" ,__html);
  892. replaceInput("<%=ContInfo.get("MID_AMT")%>","mid_amt" ,__html);
  893. replaceInput("<%=ContInfo.get("RMDR_AMT_RATE")%>","rmdr_amt_rate" ,__html);
  894. replaceInput("<%=ContInfo.get("RMDR_AMT")%>","rmdr_amt" ,__html);
  895. replaceInput("<%=ContInfo.get("CON_GUAR_AMT_RATE")%>","con_guar_amt_rate" ,__html);
  896. replaceInput("<%=ContInfo.get("CON_GUAR_TERM")%>","con_guar_term" ,__html);
  897. replaceInput("<%=ContInfo.get("CON_GUAR_AMT")%>","con_guar_amt" ,__html);
  898. replaceInput("<%=ContInfo.get("DEF_GUAR_AMT_RATE")%>","def_guar_amt_rate" ,__html);
  899. replaceInput("<%=ContInfo.get("DEF_GUAR_AMT")%>","def_guar_amt" ,__html);
  900. replaceInput("<%=ContInfo.get("DEF_GUAR_TERMS")%>","def_guar_terms" ,__html);
  901. replaceInput("<%=ContInfo.get("DEF_GUAR_TERMS_TXT")%>","def_guar_terms_txt" ,__html);
  902. replaceInput("<%=ContInfo.get("DEL_RATE_GB")%>","del_rate_gb" ,__html);
  903. replaceInput("<%=ContInfo.get("PREPAY_GUAR_AMT_RATE")%>","prepay_guar_amt_rate" ,__html);
  904. replaceInput("<%=ContInfo.get("PREPAY_GUAR_AMT")%>","prepay_guar_amt" ,__html);
  905. replaceInput("<%=ContInfo.get("O_DIVISION")%>","req_dept_nm" ,__html);
  906. replaceInput("<%=ContInfo.get("PREPAY_PAYMENT_NM")%>","prepay_payment_nm" ,__html);
  907. replaceInput("<%=StringUtils.cvtHTML4(ContInfo.get("MID_PAYMENT_NM"))%>","mid_payment_nm" ,__html);
  908. replaceInput("<%=StringUtils.cvtHTML4(ContInfo.get("RMDR_PAYMENT_NM"))%>","rmdr_payment_nm" ,__html);
  909. replaceInput("<%=StringUtils.cvtHTML4(ContInfo.get("MID_PAYMENT_TXT"))%>","mid_payment_txt" ,__html);
  910. replaceInput("<%=StringUtils.cvtHTML4(ContInfo.get("RMDR_PAYMENT_TXT"))%>","rmdr_payment_txt" ,__html);
  911. replaceInput("<%=ContInfo.get("DEF_GUAR_TERMS2")%>","def_guar_terms2" ,__html);
  912. replaceInput("<%=ContInfo.get("DEF_GUAR_TERMS_TXT2")%>","def_guar_terms_txt2" ,__html);
  913. <%
  914. if(params.get("TEMPLATE_CD").equals("3")){ //기자재공급계약서 선급금이 0ㅇ일경우 계약서에 3번내용을 안보이게 처리한다.
  915. %>
  916. if("<%=ContInfo.get("PREPAY_AMT_RATE")%>" == "0"){
  917. chgPrepay("0");
  918. }
  919. if("<%=ContInfo.get("DEF_GUAR_TERMS2")%>"!=""||"<%=ContInfo.get("DEF_GUAR_TERMS_TXT2")%>"!=""){
  920. document.forms['form1']['check_guar'].checked = true;
  921. addGuar1(document.forms['form1']['check_guar']);
  922. }
  923. <%
  924. }
  925. %>
  926. /*발주서이면서 단가계약일 경우 공급가액, 부가세 , 총금액이 보이지 않고 수량과 단가만 나오도록 수정요청 2015-05-06*/
  927. <%
  928. if(params.get("TEMPLATE_CD").equals("4")){
  929. %>
  930. if("<%=ContInfo.get("DIV_PO_YN")%>" == "Y"){
  931. divPoYn("Y");
  932. }else{
  933. divPoYn("N");
  934. }
  935. <%
  936. }
  937. %>
  938. // 본사정보
  939. replaceInput("<%=ContInfo.get("O_MEMBER_NAME")%>", "o_member_name", __html);
  940. replaceInput("<%=ContInfo.get("O_ADDRESS")%>", "o_address", __html);
  941. replaceInput("<%=ContInfo.get("O_TEL_NO")%>", "o_tel_no", __html);
  942. replaceInput("<%=ContInfo.get("O_FAX_NO")%>", "o_fax_no", __html);
  943. replaceInput("<%=ContInfo.get("O_BOSS_NAME")%>", "o_boss_name", __html);
  944. replaceInput("<%=ContInfo.get("O_DIVISION")%>", "o_division", __html);
  945. replaceInput("<%=ContInfo.get("O_USER_NAME")%>", "o_user_name", __html);
  946. replaceInput("<%=ContInfo.get("O_POSITION")%>", "o_position", __html);
  947. replaceInput("<%=ContInfo.get("O_TEL_NUM")%>", "o_tel_num", __html);
  948. replaceInput("<%=ContInfo.get("O_HP")%>", "o_hp", __html);
  949. replaceInput("<%=ContInfo.get("O_EMAIL")%>", "o_email", __html);
  950. // 업체정보
  951. replaceInput("<%=ContInfo.get("C_MEMBER_NAME")%>", "c_member_name", __html);
  952. replaceInput("<%=ContInfo.get("C_ADDRESS")%>", "c_address", __html);
  953. replaceInput("<%=ContInfo.get("C_BOSS_NAME")%>", "c_boss_name", __html);
  954. replaceInput("<%=ContInfo.get("C_DIVISION")%>", "c_division", __html);
  955. replaceInput("<%=ContInfo.get("C_USER_NAME")%>", "c_user_name", __html);
  956. replaceInput("<%=ContInfo.get("C_POSITION")%>", "c_position", __html);
  957. replaceInput("<%=ContInfo.get("C_TEL_NUM")%>", "c_tel_num", __html);
  958. replaceInput("<%=ContInfo.get("C_HP")%>", "c_hp", __html);
  959. replaceInput("<%=ContInfo.get("C_EMAIL")%>", "c_email", __html);
  960. //한글로 변환할 금액, 금액 콤마처리
  961. var f = document.forms["form1"];
  962. if(f['kMoney']){
  963. var keyList = f['kMoney'].value.split(",");
  964. for(var keySeq = 0 ; keySeq < keyList.length ; keySeq ++){
  965. var key = keyList[keySeq];
  966. fSetKoreanMoney2(f[key].value, 'spn_'+key);
  967. replaceInput(fnMakeComma2(f[key].value),key,__html)
  968. }
  969. }
  970. <%if (params.get("ChgCont").equals("Y")) { //변경 계약서 일경우 추가 내역%>
  971. // 원 계약서 정보
  972. replaceInput("<%=ord_con_date_year%>","o_ord_con_date_year",__html);
  973. replaceInput("<%=ord_con_date_month%>","o_ord_con_date_month",__html);
  974. replaceInput("<%=ord_con_date_day%>","o_ord_con_date_day",__html);
  975. replaceInput("<%=ord_start_date_year%>","o_ord_start_date_year",__html);
  976. replaceInput("<%=ord_start_date_month%>","o_ord_start_date_month",__html);
  977. replaceInput("<%=ord_start_date_day%>","o_ord_start_date_day",__html);
  978. <%if (ContInfo.get("MOD_NO").equals("1")){%>
  979. replaceInput("원","o_title_text",__html);
  980. <%}else{%>
  981. replaceInput("이 전","o_title_text",__html);
  982. <%}%>
  983. <%
  984. String o_ord_end_date_year = "";
  985. String o_ord_end_date_month = "";
  986. String o_ord_end_date_day = "";
  987. if(!OldContInfo.get("ORD_END_DATE").equals("")){
  988. o_ord_end_date_year = OldContInfo.get("ORD_END_DATE").replaceAll("-","").substring(0,4);
  989. o_ord_end_date_month = OldContInfo.get("ORD_END_DATE").replaceAll("-","").substring(4,6);
  990. o_ord_end_date_day = OldContInfo.get("ORD_END_DATE").replaceAll("-","").substring(6,8);
  991. }
  992. %>
  993. replaceInput("<%=o_ord_end_date_year%>","o_ord_end_date_year",__html);
  994. replaceInput("<%=o_ord_end_date_month%>","o_ord_end_date_month",__html);
  995. replaceInput("<%=o_ord_end_date_day%>","o_ord_end_date_day",__html);
  996. //나머지 계약정보
  997. replaceInput("<%=ContInfo.get("MOD_NO")%>","spn_mod_no",__html);//변경차수
  998. replaceInput("<%=OldContInfo.get("DEPT_NAME")%>","o_dept_name",__html);//현장명
  999. replaceInput("<%=OldContInfo.get("CST_DOC_NAME")%>","o_cst_doc_name",__html);//계약명
  1000. replaceInput("<%=OldContInfo.get("ORD_DOC_NO")%>","o_ord_doc_no",__html);// 계약번호
  1001. replaceInput("<%=OldContInfo.get("LEAD_PLACE")%>","o_lead_place",__html);//공사장소
  1002. replaceInput("<%=OldContInfo.get("ORD_AMT")%>","o_ord_amt",__html);// 계약금액
  1003. replaceInput("<%=OldContInfo.get("LEAD_COND_GB")%>","o_lead_cond_gb" ,__html);
  1004. /*발주서변수 예외처리*/
  1005. if(document.forms['form1']['lead_cond_gb_01']){
  1006. if("<%=OldContInfo.get("LEAD_COND_GB")%>"=="01"||"<%=OldContInfo.get("LEAD_COND_GB")%>"=="02"||"<%=OldContInfo.get("LEAD_COND_GB")%>"=="03"){
  1007. document.forms['form1']['lead_cond_gb_<%=OldContInfo.get("LEAD_COND_GB")%>'].checked = true;
  1008. }
  1009. }
  1010. replaceInput("<%=OldContInfo.get("ORD_SUPPLY_AMT")%>","o_ord_supply_amt" ,__html);
  1011. replaceInput("<%=OldContInfo.get("ORD_SURTAX_AMT")%>","o_ord_surtax_amt" ,__html);
  1012. replaceInput("<%=OldContInfo.get("PREPAY_AMT_RATE")%>","o_prepay_amt_rate" ,__html);
  1013. replaceInput("<%=OldContInfo.get("PREPAY_AMT")%>","o_prepay_amt" ,__html);
  1014. replaceInput("<%=OldContInfo.get("MID_AMT_RATE")%>","o_mid_amt_rate" ,__html);
  1015. replaceInput("<%=OldContInfo.get("MID_AMT")%>","o_mid_amt" ,__html);
  1016. replaceInput("<%=OldContInfo.get("RMDR_AMT_RATE")%>","o_rmdr_amt_rate" ,__html);
  1017. replaceInput("<%=OldContInfo.get("RMDR_AMT")%>","o_rmdr_amt" ,__html);
  1018. replaceInput("<%=OldContInfo.get("CON_GUAR_AMT_RATE")%>","o_con_guar_amt_rate" ,__html);
  1019. replaceInput("<%=OldContInfo.get("CON_GUAR_TERM")%>","o_con_guar_term" ,__html);
  1020. replaceInput("<%=OldContInfo.get("CON_GUAR_AMT")%>","o_con_guar_amt" ,__html);
  1021. replaceInput("<%=OldContInfo.get("DEF_GUAR_AMT_RATE")%>","o_def_guar_amt_rate" ,__html);
  1022. replaceInput("<%=OldContInfo.get("DEF_GUAR_AMT")%>","o_def_guar_amt" ,__html);
  1023. replaceInput("<%=OldContInfo.get("DEF_GUAR_TERMS")%>","o_def_guar_terms" ,__html);
  1024. replaceInput("<%=OldContInfo.get("DEL_RATE_GB")%>","o_del_rate_gb" ,__html);
  1025. replaceInput("<%=OldContInfo.get("CON_GB")%>","con_gb" ,__html);
  1026. replaceInput("<%=OldContInfo.get("PREPAY_PAYMENT_NM")%>","o_prepay_payment_nm" ,__html);
  1027. replaceInput("<%=StringUtils.cvtHTML4(OldContInfo.get("MID_PAYMENT_NM"))%>","o_mid_payment_nm" ,__html);
  1028. replaceInput("<%=StringUtils.cvtHTML4(OldContInfo.get("RMDR_PAYMENT_NM"))%>","o_rmdr_payment_nm" ,__html);
  1029. replaceInput("<%=OldContInfo.get("MID_PAYMENT_TXT")%>","o_mid_payment_txt" ,__html);
  1030. replaceInput("<%=OldContInfo.get("RMDR_PAYMENT_TXT")%>","o_rmdr_payment_txt" ,__html);
  1031. replaceInput("<%=ContInfo.get("MID_PAYMENT_TXT")%>","mid_amt_txt" ,__html);
  1032. replaceInput("<%=OldContInfo.get("RMDR_PAYMENT_TXT")%>","rmdr_payment_txt" ,__html);
  1033. <% } %>
  1034. if(f['comma']){
  1035. var keyList = f['comma'].value.split(",");
  1036. for(var keySeq = 0 ; keySeq < keyList.length ; keySeq ++){
  1037. var key = keyList[keySeq];
  1038. replaceInput(fnMakeComma2(f[key].value),key,__html)
  1039. }
  1040. }
  1041. </script>
  1042. <script>
  1043. //window.addEventListener("onload",convertHtml)
  1044. //window.onload=convertHtml();
  1045. function convertHtml(){
  1046. if(!document.getElementById("__html"))return;
  1047. var elements = document.getElementById("__html").getElementsByTagName("input");
  1048. for(var i = 0; i < elements.length; i++){
  1049. var element = elements[i];
  1050. setDisabled(element);
  1051. }
  1052. var elements = document.getElementById("__html").getElementsByTagName("textarea");
  1053. for(var i = 0; i < elements.length; i++){
  1054. var element = elements[i];
  1055. element.className = "input_readonly";
  1056. element.readOnly = true;
  1057. }
  1058. var elements = document.getElementById("__html").getElementsByTagName("img");
  1059. for(var i = 0; i < elements.length; i++){
  1060. var element = elements[i];
  1061. element.style.display="none";
  1062. }
  1063. /*협력사에서 안보이는 부분숨기는 처리*/
  1064. var elements = getElementsByClass("cl_no_view");
  1065. for(var i = 0; i < elements.length; i++){
  1066. var element = elements[i];
  1067. element.style.display="none";
  1068. }
  1069. }
  1070. </script>
  1071. <%//상품 목록 %>
  1072. <%if (params.get("ChgCont").equals("Y")) { //변경 계약서 일경우 추가 내역%>
  1073. <%@ include file="/jsp/ko_KR/buyer/cont/purchase/chgItemList.jsp" %>
  1074. <%}%>
  1075. <%@ include file="/jsp/ko_KR/buyer/cont/purchase/itemList.jsp" %>