buyPrepayments.jsp 52 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431
  1. <%--
  2. - FileName : buyPrepayments.jsp
  3. - Author(s) : ok
  4. - Date : 2014.08.20
  5. - Copyright : Copyright (c) 2013 www.udapsoft.co.kr, Inc.
  6. - Description: 협력업체포탈 구매 선급금현황 상세
  7. --%>
  8. <%@ page contentType="text/html; charset=utf-8"%>
  9. <%@ page import="com.udapsoft.waf.system.HandlerStorage"%>
  10. <%@ page import="com.udapsoft.waf.common.ui.*"%>
  11. <%@ page import="kr.co.hsnc.common.util.*"%>
  12. <%@ page import="kr.co.hsnc.common.sql.*"%>
  13. <%@ page import="kr.co.hsnc.common.util.Formatter"%>
  14. <%@ page import="com.udapsoft.waf.common.util.Formatter2"%>
  15. <%@ page import="kr.co.udapsoft.ebid.buyer.common.file.FileManager"%>
  16. <%@ include file="/jsp/work/taglib.jsp"%>
  17. <jsp:useBean id="ctx" class="com.udapsoft.waf.system.context.SessionContext" scope="session" />
  18. <%
  19. ctx.init(request, response);
  20. HandlerStorage storage = ctx.getHandlerStorage();
  21. ValueObject params = storage.getParams();
  22. ValueObject user = storage.getUser();
  23. String event = storage.getEvent();
  24. RowSet perpayReqDivComboList = storage.getRowSet("perpayReqDivComboList"); //신청구분 ComboList Data
  25. ValueObject prePayment = storage.getValueObject("prePayment"); //기본정보, 세금계산서정보, 선급금정보
  26. RowSet warrList = storage.getRowSet("contOutWarr"); //보증정보
  27. ValueObject file_giveup = storage.getValueObject("PREPAYMENTS_GIVEUP");
  28. ValueObject file_taxbill = storage.getValueObject("TAX_BILL");
  29. String check1 = "";
  30. String check2 = "";
  31. String check3 = "";
  32. String checkString = "";
  33. if("3".equals(prePayment.get("TAX_METHOD_CD"))){
  34. check3 = "checked";
  35. checkString = "Invoice";
  36. }else if("2".equals(prePayment.get("TAX_METHOD_CD"))){
  37. check2 = "checked";
  38. checkString = "순발행(업체직접 발행)";
  39. }else{
  40. check1 = "checked";
  41. checkString = "역발행(SGC이앤씨 발행)";
  42. }
  43. String digit = (String)prePayment.get("digit");
  44. int intDigit = Integer.parseInt(digit);
  45. /*보증 발급 완료된 갯수 */
  46. RowSet warrCount = storage.getRowSet("warrCount");
  47. %>
  48. <SCRIPT language="JavaScript">
  49. /*예약함수*/
  50. var sheet1;
  51. var sheet1Row;
  52. var sheet1PageNo = 1;
  53. var pageLastRowIndex = 1;
  54. var validationResult = false;
  55. var filterShow = false;
  56. var g_digit = <%= intDigit %>; // 소숫점 이하 자릿수
  57. function _onReady() {
  58. //리스트 페이지 이동
  59. jQuery("#btnList").click(function() {
  60. jQuery("#fevent").val("");
  61. jQuery("#form1").attr("action", "/portal/payment/BuyPrepaymentsList.screen");
  62. jQuery("#form1").attr("target", "_self");
  63. jQuery("#form1").attr("method", "post");
  64. jQuery("#form1").submit();
  65. });
  66. jQuery("#btnDelete").click(function() {
  67. var f = document.form1;
  68. //필수 입력항목 check
  69. if (jQuery("#prepayId").val() == "") {
  70. alert("삭제되었습니다.");
  71. return;
  72. }
  73. //입력데이터 저장
  74. if (confirm("삭제 하시겠습니까?")) {
  75. jQuery("#fevent").val("DELETE_DATA");
  76. //submitXmlRequest("/payment/purchase/Prepayments_form.screen", "DELETE_DATA", f, "SUCCESS");
  77. }
  78. });
  79. //저장처리
  80. jQuery("#btnSave").click(function() {
  81. var f = document.form1;
  82. jQuery("#fevent").val("SAVE_DATA");
  83. //필수 입력항목 check
  84. if (requiredItemsCheck() == false) {
  85. return;
  86. }
  87. //입력데이터 저장
  88. if (confirm("저장 하시겠습니까?")) {
  89. submitXmlRequest("/portal/payment/BuyPrepayments_form.screen", "SAVE_DATA", f, "SUCCESS");
  90. }
  91. });
  92. //선금신청
  93. jQuery("#btnAppReq").click(function() {
  94. var f = document.form1;
  95. jQuery("#btnAppReqSelect").val("1"); //0:저장처리, 1:선급신청처리
  96. jQuery("#fevent").val("SAVE_DATA");
  97. //필수 입력항목 check
  98. if (requiredItemsCheck() == false) {
  99. jQuery("#btnAppReqSelect").val("0"); //0:저장처리, 1:선급신청처리
  100. return;
  101. }
  102. if (confirm(jQuery("#btnAppReq").text() + " 하시겠습니까?")) {
  103. submitXmlRequest("/portal/payment/BuyPrepayments_form.screen", "SAVE_DATA", f, "SUCCESS");
  104. }else{
  105. jQuery("#btnAppReqSelect").val("0"); //0:저장처리, 1:선급신청처리
  106. }
  107. });
  108. //선급금 사용자 입력 후 처리
  109. jQuery("#reqPrepaySupplyAmt").blur(function() {
  110. var reqPrepaySupplyTamt = jQuery("#reqPrepaySupplyAmt").val();
  111. reqPrepaySupplyTamt = reqPrepaySupplyTamt.replace(/(\,|\:)/g, ""); //신청금액 과세
  112. //reqPrepaySupplyTamt = Number(Math.floor(reqPrepaySupplyTamt))
  113. reqPrepaySupplyTamt = Number(reqPrepaySupplyTamt).toFixed(g_digit);
  114. var subPrepaySupplyTamt = jQuery("#subPrepaySupplyAmt").val();
  115. subPrepaySupplyTamt = subPrepaySupplyTamt.replace(/(\,|\:)/g, ""); //선급금액 과세
  116. if (Number(subPrepaySupplyTamt) < Number(reqPrepaySupplyTamt)) {
  117. if(jQuery("#statusCd").val() != "10"){
  118. alert('선급금보다 신청금액이 큽니다.');
  119. reqPrepaySupplyTamt = subPrepaySupplyTamt;
  120. jQuery("#reqPrepaySupplyAmt").val(subPrepaySupplyTamt);
  121. jQuery("#giveSupplyAmt").val("0");
  122. jQuery('#reqPrepaySupplyAmt').focus();
  123. }
  124. } else {
  125. jQuery("#reqPrepaySupplyAmt").val(Number(reqPrepaySupplyTamt).toFixed(g_digit));
  126. var giveSupplyTamt = subPrepaySupplyTamt - reqPrepaySupplyTamt;
  127. jQuery("#giveSupplyAmt").val(giveSupplyTamt.toFixed(g_digit));
  128. jQuery("#giveSupplyAmt, #reqPrepaySupplyAmt").each(function(index) {
  129. jQuery(this).val(jQuery(this).val().split(/(?=(?:\d{3})+(?:\.|$))/g).join(','));
  130. });
  131. }
  132. //부가세
  133. var reqPrepaySurtaxAmt = (reqPrepaySupplyTamt * 10) / 100;
  134. reqPrepaySurtaxAmt = doFloor(reqPrepaySurtaxAmt, g_digit);
  135. //reqPrepaySurtaxAmt = Number(Math.floor(reqPrepaySurtaxAmt));
  136. var subPrepaySurtaxAmt = jQuery("#subPrepaySurtaxAmt").val();
  137. subPrepaySurtaxAmt = subPrepaySurtaxAmt.replace(/(\,|\:)/g, ""); //선급금액 부과세
  138. if(Number(subPrepaySurtaxAmt) > 0){
  139. var giveSurtaxAmt = subPrepaySurtaxAmt - reqPrepaySurtaxAmt;
  140. jQuery("#reqPrepaySurtaxAmt").val(reqPrepaySurtaxAmt);
  141. jQuery("#reqPrepaySurtaxAmt").each(function(index) {
  142. jQuery(this).val(jQuery(this).val().split(/(?=(?:\d{3})+(?:\.|$))/g).join(','));
  143. });
  144. jQuery("#giveSurtaxAmt").val(giveSurtaxAmt.toFixed(g_digit));
  145. }else{
  146. jQuery("#reqPrepaySurtaxAmt").val(0);
  147. reqPrepaySurtaxAmt = 0;
  148. }
  149. jQuery("#giveSurtaxAmt").each(function(index) {
  150. jQuery(this).val(jQuery(this).val().split(/(?=(?:\d{3})+(?:\.|$))/g).join(','));
  151. });
  152. //신청금액을 구한다.
  153. var reqPrepayAmt = Number(reqPrepaySupplyTamt) + Number(reqPrepaySurtaxAmt);
  154. var perpayAmt = jQuery("#perpayAmt").val();
  155. perpayAmt = perpayAmt.replace(/(\,|\:)/g, ""); //선급금액
  156. var giveAmt = perpayAmt - reqPrepayAmt;
  157. jQuery("#reqPrepayAmt").val(reqPrepayAmt.toFixed(g_digit));
  158. jQuery("#reqPrepayAmt").each(function(index) {
  159. jQuery(this).val(jQuery(this).val().split(/(?=(?:\d{3})+(?:\.|$))/g).join(','));
  160. });
  161. jQuery("#giveAmt").val(giveAmt.toFixed(g_digit));
  162. jQuery("#giveAmt").each(function(index) {
  163. jQuery(this).val(jQuery(this).val().split(/(?=(?:\d{3})+(?:\.|$))/g).join(','));
  164. });
  165. //요율
  166. var conAmt = jQuery("#conAmt").val();
  167. conAmt = conAmt.replace(/(\,|\:)/g, "");
  168. var conSupplyAmt = jQuery("#conSupplyAmt").val();
  169. conSupplyAmt = conSupplyAmt.replace(/(\,|\:)/g, "");
  170. var giveSupplyAmt = jQuery("#giveSupplyAmt").val();
  171. giveSupplyAmt = giveSupplyAmt.replace(/(\,|\:)/g, "");
  172. //var reqPrepayPercent = (reqPrepayAmt / conAmt) * 100; //신청금액 요율
  173. var reqPrepayPercent = (reqPrepaySupplyTamt / conSupplyAmt) * 100; //신청금액 요율
  174. var givePercent = (giveSupplyAmt / conSupplyAmt) * 100; //포기금액 요율
  175. jQuery("#reqPrepayPercent").val(reqPrepayPercent.toFixed(1));
  176. jQuery("#givePercent").val(givePercent.toFixed(1));
  177. setSeletReq();
  178. giveDataSet();
  179. //}//end if
  180. });
  181. pageinit();
  182. }
  183. //페이지 초기처리
  184. function pageinit() {
  185. //신청구분 설정
  186. setSeletReq();
  187. //선급금 포기각서 표시 유무
  188. giveDataSet()
  189. //작성일자(증빙일자)
  190. seTaxDate();
  191. //신청구분 선택불가
  192. appDivSet();
  193. //입력항목 초기처리
  194. //inputDataSet();
  195. //발행방법에 따른 페이지 셋팅
  196. taxDataSet();
  197. //버튼표시 셋팅
  198. btnCtr();
  199. //상태에 따른 입력항목 readOnly
  200. inputReadOnlyset();
  201. giveDataSet();
  202. if(!(jQuery("#statusCd").val() == "11" || jQuery("#statusCd").val() == "10")){
  203. openPopUpPrePay();
  204. }
  205. }
  206. function appDivSet() {
  207. jQuery("#perpayReqDiv").attr("disabled", true);
  208. jQuery("#reqPrepaySupplyTamt, #reqPrepaySupplyNamt").blur();
  209. }
  210. function setSeletReq(){
  211. var reqPrepaySupplyTamt = jQuery("#reqPrepaySupplyAmt").val().replace(/(\,|\:)/g, ""); //신청금액 과세
  212. reqPrepaySupplyTamt = Number(reqPrepaySupplyTamt).toFixed(g_digit);
  213. var subPrepaySupplyTamt = jQuery("#subPrepaySupplyAmt").val().replace(/(\,|\:)/g, ""); //선급금액 과세
  214. subPrepaySupplyTamt = Number(subPrepaySupplyTamt).toFixed(g_digit);
  215. //입력한 선급금 과세가 빈값일 경우 0으로 셋팅
  216. if (reqPrepaySupplyTamt == "" || Number(reqPrepaySupplyTamt) == 0) {
  217. reqPrepaySupplyTamt = "0";
  218. jQuery("#reqPrepaySupplyAmt").val("0");
  219. }
  220. if (Number(reqPrepaySupplyTamt) == 0) { //선급포기
  221. jQuery("#perpayReqDiv").val("3");
  222. //jQuery("#btnText").text("선급포기신청요청");
  223. jQuery("#btnAppReq").text("선급포기");
  224. //포기일때 보증정보는 필요없으므로 숨김처ㅣ
  225. //warrCtr('H'); //S:보이기, H:숨기기
  226. } else if (Number(reqPrepaySupplyTamt) == Number(subPrepaySupplyTamt)) { //신청
  227. jQuery("#perpayReqDiv").val("1");
  228. //jQuery("#btnText").text("선급신청요청");
  229. jQuery("#btnAppReq").text("신청요청");
  230. //포기일때 보증정보는 필요없으므로 숨김처ㅣ
  231. //warrCtr('S'); //S:보이기, H:숨기기
  232. } else {
  233. jQuery("#perpayReqDiv").val("2");
  234. //jQuery("#btnText").text("부분신청요청");
  235. jQuery("#btnAppReq").text("신청요청");
  236. //포기일때 보증정보는 필요없으므로 숨김처ㅣ
  237. //warrCtr('S'); //S:보이기, H:숨기기
  238. }
  239. }
  240. function seTaxDate() {
  241. var newDay = new Date(get_year(), get_month(), "");
  242. var lastDay = newDay.getDate();
  243. var yyyymmdd = get_year() + '-' + get_month() + "-" + lastDay;
  244. if (jQuery('#date1').val() == "") {
  245. jQuery('#date1').val(yyyymmdd);
  246. }
  247. }
  248. function btnCtr() {
  249. //alert(jQuery("#statusCd").val());
  250. if (jQuery("#statusCd").val() == "00" || jQuery("#statusCd").val() == "") { //00:작성상태는 목록 표시
  251. jQuery("#spanBtnSave").hide(); //2023.01.27 저장 버튼 숨김
  252. jQuery("#spanBtnDelete").hide();
  253. jQuery("#spanBtnAppReq").hide();
  254. jQuery("#spanBtnList").show();
  255. jQuery("#spanTaxSave").hide();
  256. }
  257. if (jQuery("#statusCd").val() == "01") { //01:작성상태는 목록 표시
  258. jQuery("#spanBtnSave").hide(); //2023.01.27 저장 버튼 숨김
  259. jQuery("#spanBtnDelete").hide();
  260. jQuery("#spanBtnAppReq").hide(); //2022.11.07 선급신청버튼 숨김
  261. jQuery("#spanBtnList").show();
  262. jQuery("#spanTaxSave").hide();
  263. }
  264. if (jQuery("#statusCd").val() == "02") { //02:선급신청요청상태는 목록, 저장, 선급신청 버튼 표시
  265. jQuery("#spanBtnSave").show();
  266. jQuery("#spanBtnDelete").hide();
  267. jQuery("#spanBtnAppReq").show();
  268. jQuery("#spanBtnList").show();
  269. jQuery("#spanTaxSave").hide();
  270. }
  271. if (jQuery("#statusCd").val() == "21") { //21:선급포기요청상태는 목록, 저장, 선급신청 버튼 표시
  272. jQuery("#spanBtnSave").hide();
  273. jQuery("#spanBtnDelete").hide();
  274. jQuery("#spanBtnAppReq").hide();
  275. jQuery("#spanBtnList").show();
  276. jQuery("#spanTaxSave").hide();
  277. }
  278. if (jQuery("#statusCd").val() == "20") { //21:선급포기요청상태는 목록, 저장, 선급신청 버튼 표시
  279. jQuery("#spanBtnSave").hide();
  280. jQuery("#spanBtnDelete").hide();
  281. jQuery("#spanBtnAppReq").hide();
  282. jQuery("#spanBtnList").show();
  283. jQuery("#spanTaxSave").hide();
  284. }
  285. if (jQuery("#statusCd").val() == "03") { //03:선급신청상태는 목록 버튼 표시
  286. jQuery("#spanBtnSave").hide();
  287. jQuery("#spanBtnDelete").hide();
  288. jQuery("#spanBtnAppReq").hide();
  289. jQuery("#spanBtnList").show();
  290. jQuery("#spanTaxSave").show();
  291. }
  292. if (jQuery("#statusCd").val() == "04") { //04:결재중상태는 목록 버튼 표시
  293. jQuery("#spanBtnSave").hide();
  294. jQuery("#spanBtnDelete").hide();
  295. jQuery("#spanBtnAppReq").hide();
  296. jQuery("#spanBtnList").show();
  297. jQuery("#spanTaxSave").hide();
  298. }
  299. if (jQuery("#statusCd").val() == "10") { //10:선급완료상태는 목록 버튼 표시
  300. jQuery("#spanBtnSave").hide();
  301. jQuery("#spanBtnDelete").hide();
  302. jQuery("#spanBtnAppReq").hide();
  303. jQuery("#spanBtnList").show();
  304. jQuery("#spanTaxSave").hide();
  305. }
  306. if (jQuery("#statusCd").val() == "11") { //11:선급포기완료상태는 목록 버튼 표시
  307. jQuery("#spanBtnSave").hide();
  308. jQuery("#spanBtnDelete").hide();
  309. jQuery("#spanBtnAppReq").hide();
  310. jQuery("#spanBtnList").show();
  311. jQuery("#spanTaxSave").hide();
  312. }
  313. if (jQuery("#statusCd").val() == "91") { //91:반려상태는 목록, 저장, 선급신청 버튼 표시
  314. jQuery("#spanBtnSave").show();
  315. jQuery("#spanBtnDelete").hide();
  316. jQuery("#spanBtnAppReq").hide();
  317. jQuery("#spanBtnList").show();
  318. jQuery("#spanTaxSave").hide();
  319. }
  320. //jQuery("#reqPrepaySupplyAmt").blur();
  321. }
  322. function inputReadOnlyset() {
  323. if (jQuery("#statusCd").val() == "04" || jQuery("#statusCd").val() == "10" || jQuery("#statusCd").val() == "11") { //03:선급신청상태는 목록 버튼 표시
  324. jQuery("#userName").attr("readonly", true);
  325. jQuery("#userName").css({'background-color' : '#F0F0F0'});
  326. jQuery("#userName").css({'border' : '1px solid #bcbcbc'});
  327. jQuery("#hp").attr("readonly", true);
  328. jQuery("#hp").css({'background-color' : '#F0F0F0'});
  329. jQuery("#hp").css({'border' : '1px solid #bcbcbc'});
  330. jQuery("#eMail").attr("readonly", true);
  331. jQuery("#eMail").css({'background-color' : '#F0F0F0'});
  332. jQuery("#eMail").css({'border' : '1px solid #bcbcbc'});
  333. jQuery("#reqPrepaySupplyAmt").attr("readonly", true);
  334. jQuery("#reqPrepaySupplyAmt").css({'background-color' : '#F0F0F0'});
  335. jQuery("#reqPrepaySupplyAmt").css({'border' : '1px solid #bcbcbc'});
  336. }
  337. if(jQuery("#statusCd").val() == "03"){
  338. jQuery("#reqPrepaySupplyAmt").attr("readonly", true);
  339. jQuery("#reqPrepaySupplyAmt").css({'background-color' : '#F0F0F0'});
  340. jQuery("#reqPrepaySupplyAmt").css({'border' : '1px solid #bcbcbc'});
  341. }
  342. }
  343. function taxDataSet() {
  344. var radioCheck = jQuery(':radio[name="chk_info"]:checked').val(); //세금계산서 발행방법
  345. //alert(radioCheck);
  346. if (radioCheck == "1") { //역발행
  347. jQuery("#taxAttachments").hide();
  348. jQuery("#taxTrRow").hide();
  349. } else {
  350. jQuery("#taxAttachments").show();
  351. jQuery("#taxTrRow").show();
  352. }
  353. }
  354. function giveDataSet() {
  355. if (jQuery("#perpayReqDiv option:selected").val() == "1") {
  356. jQuery("#giveAttachments").hide();
  357. jQuery("#p_Attach1").show();
  358. } else {
  359. jQuery("#giveAttachments").show();
  360. jQuery("#p_Attach1").hide();
  361. }
  362. }
  363. function inputDataSet() {
  364. jQuery("#perpayReqDiv").attr("disabled", true);
  365. if (jQuery("#perpayReqDiv option:selected").val() == "1") {
  366. jQuery("#giveAmt").val("0"); //선급_포기금액_합계
  367. jQuery("#reqPrepayAmt").attr("readonly", true);
  368. jQuery("#reqPrepayAmt").css({'background-color' : '#dedede'});
  369. jQuery("#reqPrepayAmt").css({'border' : '1px solid #bcbcbc'});
  370. jQuery("#reqPrepayAmt").val(jQuery("#perpayAmt").val());
  371. jQuery("#giveSupplyTamt").val("0"); //선급_포기금액_과세
  372. jQuery("#reqPrepaySupplyTamt").attr("readonly", true);
  373. jQuery("#reqPrepaySupplyTamt").css({
  374. 'background-color' : '#dedede'
  375. });
  376. jQuery("#reqPrepaySupplyTamt").css({
  377. 'border' : '1px solid #bcbcbc'
  378. });
  379. jQuery("#reqPrepaySupplyTamt").val(
  380. jQuery("#subPrepaySupplyTamt").val());
  381. jQuery("#giveSupplyNamt").val("0"); //선급_포기금액_면세
  382. jQuery("#reqPrepaySupplyNamt").attr("readonly", true);
  383. jQuery("#reqPrepaySupplyNamt").css({
  384. 'background-color' : '#dedede'
  385. });
  386. jQuery("#reqPrepaySupplyNamt").css({
  387. 'border' : '1px solid #bcbcbc'
  388. });
  389. jQuery("#reqPrepaySupplyNamt").val(
  390. jQuery("#subPrepaySupplyNamt").val());
  391. jQuery("#giveSurtaxAmt").val("0"); //선급_포기금액_부가세
  392. jQuery("#reqPrepaySurtaxAmt").attr("readonly", true);
  393. jQuery("#reqPrepaySurtaxAmt").css({
  394. 'background-color' : '#dedede'
  395. });
  396. jQuery("#reqPrepaySurtaxAmt").css({
  397. 'border' : '1px solid #bcbcbc'
  398. });
  399. jQuery("#reqPrepaySurtaxAmt").val(
  400. jQuery("#subPrepaySurtaxAmt").val());
  401. jQuery("#givePercent").val("0.0");
  402. var reqPrepayAmt = jQuery("#reqPrepayAmt").val();
  403. reqPrepayAmt = reqPrepayAmt.replace(/(\,|\:)/g, "");
  404. var conAmt = jQuery("#conAmt").val();
  405. conAmt = conAmt.replace(/(\,|\:)/g, "");
  406. var givePercent = (reqPrepayAmt / conAmt) * 100;
  407. jQuery("#reqPrepayPercent").val(givePercent.toFixed(1));
  408. giveDataSet();
  409. warrCtr('S'); //S:보이기, H:숨기기
  410. } else if (jQuery("#perpayReqDiv option:selected").val() == "2") {
  411. jQuery("#reqPrepayAmt").attr("readonly", true);
  412. jQuery("#reqPrepayAmt").css({
  413. 'background-color' : '#dedede'
  414. });
  415. jQuery("#reqPrepayAmt").css({
  416. 'border' : '1px solid #bcbcbc'
  417. });
  418. jQuery("#reqPrepaySupplyTamt").attr("readonly", false);
  419. jQuery("#reqPrepaySupplyTamt").css({
  420. 'background-color' : '#ffffff'
  421. });
  422. jQuery("#reqPrepaySupplyTamt").css({
  423. 'border' : '1px solid #595a5a'
  424. });
  425. if (jQuery("#conSupplyNamt").val() == "0") {
  426. jQuery("#reqPrepaySupplyNamt").attr("readonly", true);
  427. jQuery("#reqPrepaySupplyNamt").css({
  428. 'background-color' : '#dedede'
  429. });
  430. jQuery("#reqPrepaySupplyNamt").css({
  431. 'border' : '1px solid #bcbcbc'
  432. });
  433. } else {
  434. jQuery("#reqPrepaySupplyNamt").attr("readonly", false);
  435. jQuery("#reqPrepaySupplyNamt").css({
  436. 'background-color' : '#ffffff'
  437. });
  438. jQuery("#reqPrepaySupplyNamt").css({
  439. 'border' : '1px solid #595a5a'
  440. });
  441. }
  442. jQuery("#reqPrepaySurtaxAmt").attr("readonly", true);
  443. jQuery("#reqPrepaySurtaxAmt").css({
  444. 'background-color' : '#dedede'
  445. });
  446. jQuery("#reqPrepaySurtaxAmt").css({
  447. 'border' : '1px solid #bcbcbc'
  448. });
  449. jQuery("#reqPrepaySupplyTamt").val(jQuery("#orgReqPrepaySupplyTamt").val());
  450. jQuery("#reqPrepaySupplyNamt").val(jQuery("#orgReqPrepaySupplyNamt").val());
  451. jQuery("#reqPrepaySupplyTamt").blur();
  452. giveDataSet();
  453. warrCtr('S'); //S:보이기, H:숨기기
  454. } else if (jQuery("#perpayReqDiv option:selected").val() == "3") {
  455. jQuery("#reqPrepayAmt").val("0"); //선급_신청금액_합계
  456. jQuery("#reqPrepayAmt").attr("readonly", true);
  457. jQuery("#reqPrepayAmt").css({
  458. 'background-color' : '#dedede'
  459. });
  460. jQuery("#reqPrepayAmt").css({
  461. 'border' : '1px solid #bcbcbc'
  462. });
  463. jQuery("#giveAmt").val(jQuery("#perpayAmt").val());
  464. jQuery("#reqPrepaySupplyTamt").val("0"); //선급_신청금액_과세
  465. jQuery("#reqPrepaySupplyTamt").attr("readonly", true);
  466. jQuery("#reqPrepaySupplyTamt").css({
  467. 'background-color' : '#dedede'
  468. });
  469. jQuery("#reqPrepaySupplyTamt").css({
  470. 'border' : '1px solid #bcbcbc'
  471. });
  472. jQuery("#giveSupplyTamt").val(jQuery("#subPrepaySupplyTamt").val());
  473. jQuery("#reqPrepaySupplyNamt").val("0"); //선급_신청금액_면세
  474. jQuery("#reqPrepaySupplyNamt").attr("readonly", true);
  475. jQuery("#reqPrepaySupplyNamt").css({
  476. 'background-color' : '#dedede'
  477. });
  478. jQuery("#reqPrepaySupplyNamt").css({
  479. 'border' : '1px solid #bcbcbc'
  480. });
  481. jQuery("#giveSupplyNamt").val(jQuery("#subPrepaySupplyNamt").val());
  482. jQuery("#reqPrepaySurtaxAmt").val("0"); //선급_신청금액_부가세
  483. jQuery("#reqPrepaySurtaxAmt").attr("readonly", true);
  484. jQuery("#reqPrepaySurtaxAmt").css({
  485. 'background-color' : '#dedede'
  486. });
  487. jQuery("#reqPrepaySurtaxAmt").css({
  488. 'border' : '1px solid #bcbcbc'
  489. });
  490. jQuery("#giveSurtaxAmt").val(jQuery("#subPrepaySurtaxAmt").val());
  491. jQuery("#reqPrepayPercent").val("0.0");
  492. var giveAmt = jQuery("#giveAmt").val();
  493. giveAmt = giveAmt.replace(/(\,|\:)/g, "");
  494. var conAmt = jQuery("#conAmt").val();
  495. conAmt = conAmt.replace(/(\,|\:)/g, "");
  496. var givePercent = (giveAmt / conAmt) * 100;
  497. jQuery("#givePercent").val(givePercent.toFixed(1));
  498. giveDataSet();
  499. //포기일때 보증정보는 필요없으므로 숨김처ㅣ
  500. warrCtr('H'); //S:보이기, H:숨기기
  501. }
  502. }
  503. function warrCtr(gubun) {
  504. if (gubun == "H") { //숨김
  505. /* var warrWamt = jQuery("#warrWamt").val().replace(/(\,|\:)/g, "");
  506. if(warrWamt == "0" || warrWamt == ""){
  507. jQuery('#warr1').slideUp();
  508. jQuery('#warr2').slideUp();
  509. }else{
  510. alert("보증정보가 존재합니다.");
  511. //jQuery("#reqPrepaySupplyTamt").val(jQuery("#warrWamt").val());
  512. } */
  513. } else {
  514. /* jQuery('#warr1').show("slow");
  515. jQuery('#warr2').show("slow"); */
  516. }
  517. }
  518. //저장 및 선급금 신청시 필수항목 Check
  519. function requiredItemsCheck() {
  520. var date1 = jQuery('#date1').val(); //작성일자(증빙일자)
  521. var userName = jQuery('#userName').val(); //담당자명
  522. var hp = jQuery('#hp').val(); //담당자 핸드폰번호
  523. var eMail = jQuery('#eMail').val(); //담당자 이메일
  524. if (date1 == "") {
  525. alert("입력필수입니다.");
  526. jQuery('#date1').focus();
  527. return false;
  528. }
  529. if (userName == "") {
  530. alert("담당자명은 입력필수입니다.");
  531. jQuery('#userName').focus();
  532. return false;
  533. }
  534. if (hp == "") {
  535. alert("담당자 핸드폰 번호는 입력필수입니다.");
  536. jQuery('#hp').focus();
  537. return false;
  538. } else {
  539. var rgEx = /(01[016789])[-](\d{4}|\d{3})[-]\d{4}$/g;
  540. var strValue = hp;
  541. var chkFlg = rgEx.test(strValue);
  542. if (!chkFlg) {
  543. alert("올바른 휴대폰번호가 아닙니다.");
  544. jQuery('#hp').focus();
  545. return false;
  546. }
  547. }
  548. if (eMail == "") {
  549. alert("담당자 이메일은 입력필수입니다.");
  550. jQuery('#eMail').focus();
  551. return false;
  552. } else {
  553. var regEmail = /([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
  554. if (!regEmail.test(eMail)) {
  555. alert('올바른 이메일 주소가 아닙니다.');
  556. jQuery('#eMail').focus();
  557. return false;
  558. }
  559. }
  560. if (jQuery("#btnAppReqSelect").val() == "1") { //선급금신청요청시에는 해당하는 첨부파일이 모두 등록되어있어야함.
  561. //세금계산서 첨부파일 Check
  562. /* if(jQuery("#chk_2").is(":checked") == true){
  563. if(jQuery("#p_AttachFile1".val() == "")){
  564. alert("선금금 포기각서 첨부파일 핍수입니다.");
  565. return false;
  566. }
  567. } */
  568. //01:작성중, 02:선급금 신청요청, 21:선금금 포기요청, 03:선급금 신청, 04:결재중, 10:선금완료, 11:포기완료, 91:반려
  569. if (jQuery("#perpayReqDiv").val() == "1") { //선급신청
  570. jQuery("#selectStatusCd").val("03");
  571. //선급금 포기각서 파일첨부 존재를 check한다.
  572. if(jQuery.trim(jQuery("#p_AttachFile1").text()) != "") {
  573. alert("선급금 포기각서 첨부가 존재합니다.");
  574. return false;
  575. }
  576. //2016.09.30 신청일때 대금청구 필수
  577. if(jQuery.trim(jQuery("#p_AttachFile4").text()) == ""){
  578. alert("선금금 대금청구 첨부파일 필수입니다.");
  579. return false;
  580. }
  581. if(<%=warrCount.size() %>!=<%=warrList.size() %>){
  582. alert("해당 보증서의 진행 상태가 모두 발급 완료 상태일때 서명을 진행 하실수 있습니다.");
  583. return false;
  584. }
  585. //선급신청일경우 보증정보의 증권번호가 존재하고, 보증금액이 선급 신청금액의 합계와 같아야함.
  586. if(jQuery("#warrWgno").val() == ""){
  587. alert("보증정보는 필수입니다.");
  588. return false;
  589. }
  590. var warrWamtValue = jQuery("#warrWamt").val().replace(/(\,|\:)/g, "");
  591. var reqPrepayAmtValue = jQuery("#reqPrepayAmt").val().replace(/(\,|\:)/g, "");
  592. if(Number(reqPrepayAmtValue) != Number(warrWamtValue) ){
  593. alert("선급금신청금액과 보증금액이 다릅니다." );
  594. return false;
  595. }
  596. } else if (jQuery("#perpayReqDiv").val() == "2") { //부분신청
  597. jQuery("#selectStatusCd").val("20");
  598. if(<%=warrCount.size() %>!=<%=warrList.size() %>){
  599. alert("해당 보증서의 진행 상태가 모두 발급 완료 상태일때 서명을 진행 하실수 있습니다.");
  600. return false;
  601. }
  602. //선급신청일경우 보증정보의 증권번호가 존재하고, 보증금액이 선급 신청금액의 합계와 같아야함.
  603. if(jQuery("#warrWgno").val() == ""){
  604. alert("보증정보는 필수입니다.");
  605. return false;
  606. }
  607. var warrWamtValue = jQuery("#warrWamt").val().replace(/(\,|\:)/g, "");
  608. var reqPrepayAmtValue = jQuery("#reqPrepayAmt").val().replace(/(\,|\:)/g, "");
  609. if(Number(reqPrepayAmtValue) != Number(warrWamtValue)){
  610. alert("선급금신청금액과 보증금액이 다릅니다.");
  611. return false;
  612. }
  613. if(jQuery.trim(jQuery("#p_AttachFile1").text()) == ""){
  614. alert("선금금 포기각서 첨부파일 필수입니다.");
  615. return false;
  616. }
  617. } else if (jQuery("#perpayReqDiv").val() == "3") { //포기신청
  618. jQuery("#selectStatusCd").val("21");
  619. if(jQuery.trim(jQuery("#p_AttachFile1").text()) == ""){
  620. alert("선금금 포기각서 첨부파일 필수입니다.");
  621. return false;
  622. }
  623. /* if(jQuery("#warrWgno").val() != ""){
  624. alert("보증정보가 존재합니다.");
  625. return false;
  626. } */
  627. } else {
  628. alert("신청구분을 선택하세요");
  629. return false;
  630. }
  631. }
  632. }
  633. function doResult(resultObj) {
  634. try {
  635. if (resultObj.getRequestEvent() == "SAVE_DATA" || resultObj.getRequestEvent() == "SAVE_SEGUM" ) {
  636. if (resultObj.getSuccess()) {
  637. document.form1.isSubmit = false;
  638. if (jQuery("#btnAppReqSelect").val() == "0") {
  639. alert("저장되었습니다.");
  640. //jQuery("#btnList").click();
  641. reSearch();
  642. } else {
  643. jQuery("#btnAppReqSelect").val("0");
  644. btnAppReqProcess();
  645. }
  646. } else {
  647. dlgErrorMsg(resultObj);
  648. }
  649. document.form1.isSubmit = false;
  650. }
  651. if (resultObj.getRequestEvent() == "DELETE_DATA") {
  652. if (resultObj.getSuccess()) {
  653. alert("삭제되었습니다.");
  654. jQuery("#btnList").click();
  655. } else {
  656. dlgErrorMsg(resultObj);
  657. }
  658. document.form1.isSubmit = false;
  659. }
  660. if (resultObj.getRequestEvent() == "REQ_DATA") {
  661. if (resultObj.getSuccess()) {
  662. alert("신청하였습니다.");
  663. jQuery("#btnList").click();
  664. } else {
  665. dlgErrorMsg(resultObj);
  666. }
  667. document.form1.isSubmit = false;
  668. }
  669. } catch (errorObject) {
  670. showErrorDlg("doResult()", errorObject);
  671. }
  672. }
  673. //저장 후 기성시청 처리
  674. function btnAppReqProcess() {
  675. //if (fMakeItemInfo()) { //서명데이터 처리
  676. var f = document.form1;
  677. jQuery("#fevent").val("REQ_DATA");
  678. submitXmlRequest("/portal/payment/BuyPrepayments_form.screen","REQ_DATA", f, "SUCCESS");
  679. //}
  680. }
  681. //상세화면 재조회
  682. function reSearch() {
  683. jQuery("#fevent").val("");
  684. jQuery("#form1").attr("action", "/portal/payment/BuyPrepayments.screen");
  685. jQuery("#form1").attr("target", "_self");
  686. jQuery("#form1").attr("method", "post");
  687. jQuery("#form1").submit();
  688. }
  689. function doKeyPress() {
  690. if (event.keyCode == 13) {
  691. doSearch(document.all.sheet1)
  692. }
  693. }
  694. function calendar(thisDayObj) {
  695. dlgCalendar(thisDayObj);
  696. }
  697. //첨부파일
  698. function doAttachFile(obj, No) {
  699. if (obj.value == '') {
  700. //alert("After you have saved, you can attach a file.");
  701. alert("데이터를 저장 후, 파일을 첨부할 수가 있습니다.");
  702. } else if (obj.value != '') {
  703. var upLoadFlg = "Y";
  704. if (jQuery("#statusCd").val() == "04" || jQuery("#statusCd").val() == "10" || jQuery("#statusCd").val() == "11") { //선급금 상태값이 03:선급금신청, 04:결재중, 10:선급완료, 11:폰기완료면 다운만
  705. upLoadFlg = "N";
  706. }
  707. if (No == 1) {
  708. viewFileListNew('PREPAYMENTS_GIVEUP', obj.value, document.getElementById("p_AttachFile1"), upLoadFlg, "prepay/purchase/"+obj.value);
  709. } else if (No == 2) {
  710. viewFileListNew('TAX_BILL', obj.value, document.getElementById("p_AttachFile2"), upLoadFlg, "prepay/purchase/"+obj.value);
  711. } else {
  712. viewFileListNew('PREPAYMENTS_BILLING', obj.value, document.getElementById("p_AttachFile4"), upLoadFlg, "prepay/purchase/"+obj.value);
  713. }
  714. }
  715. }
  716. function fMakeItemInfo() {
  717. var sColumDelimiter = "┃";
  718. var sRowDelimiter = "↕";
  719. var sSumDelimiter = "╂";
  720. var sEncDelimiter = "⇔";
  721. var sItemInfo = ""; //서명할 문자열 데이터
  722. var infoDeptName = "현장명:" + jQuery("#deptName").val(); //현장명
  723. var infoBuildName = "계약명:" + jQuery("#buildName").val(); //계약명
  724. var infoConCurNm = "계약통화:" + jQuery("#conCurCd").val(); //계약통화
  725. var infoCorpRegNo = "사업자번호:" + jQuery("#vendCd").val(); //사업자번호
  726. var CorpRegNoVal = jQuery("#vendCd").val().replace(/-/gi, "");
  727. //사업자번호
  728. //alert(CorpRegNoVal);
  729. var infoCorpKor = "계약업체명:" + jQuery("#memberName").val(); //계약업체명
  730. var infoBossName = "대표이사:" + jQuery("#bossName").val(); //업체대표이사
  731. var infoStartEndWorkDate = "계약기간:" + jQuery("#startEndWorkDate").val(); //계약기간
  732. var infoConAmt = "계약금액:" + jQuery("#conAmt").val(); //계약금액합계
  733. var infoPerpayAmt = "선급금액:" + jQuery("#perpayAmt").val(); //선급금액합계
  734. var infoTaxMethod = ""; //세금계산서발행방법
  735. if (jQuery('input:checkbox[id="chk_1"]').is(":checked")) { //역발행
  736. infoTaxMethod = "세금계산서발행방법:역발행";
  737. } else {
  738. infoTaxMethod = "세금계산서발행방법:순발행";
  739. }
  740. var infoDate1 = "작성일자:" + jQuery("#date1").val(); //작성일자(증빙일자)
  741. var infoTaxChargNm = "담당자명:" + jQuery("#userName").val(); //담당자명
  742. var infoTaxChargHp = "핸드폰번호:" + jQuery("#hp").val(); //담당자 핸드폰번호
  743. var infoTaxChargEmail = "이메일주소:" + jQuery("#eMail").val(); //담당자 이메일
  744. var infoPerpayReqDiv = "신청구분:"; //신청구분
  745. if (jQuery("#perpayReqDiv").val() == "1") { //신청
  746. infoPerpayReqDiv = infoPerpayReqDiv + "선급신청";
  747. } else if (jQuery("#perpayReqDiv").val() == "2") { //부분신청
  748. infoPerpayReqDiv = infoPerpayReqDiv + "부분신청";
  749. } else if (jQuery("#perpayReqDiv").val() == "3") { //포기
  750. infoPerpayReqDiv = infoPerpayReqDiv + "포기신청";
  751. }
  752. var infoReqPrepayAmt = "선급_신청금액_합계:" + jQuery("#reqPrepayAmt").val();
  753. var infoReqPrepaySupplyTamt = "선급_신청금액_과세:"
  754. + jQuery("#reqPrepaySupplyTamt").val();
  755. var infoReqPrepaySupplyNamt = "선급_신청금액_면세:"
  756. + jQuery("#reqPrepaySupplyNamt").val();
  757. var infoReqPrepaySurtaxAmt = "선급_신청금액_부가세:"
  758. + jQuery("#reqPrepaySurtaxAmt").val();
  759. sItemInfo = sItemInfo + infoDeptName + sColumDelimiter;
  760. sItemInfo = sItemInfo + infoBuildName + sColumDelimiter;
  761. sItemInfo = sItemInfo + infoConCurNm + sColumDelimiter;
  762. sItemInfo = sItemInfo + infoCorpRegNo + sColumDelimiter;
  763. sItemInfo = sItemInfo + infoCorpKor + sColumDelimiter;
  764. sItemInfo = sItemInfo + infoBossName + sColumDelimiter;
  765. sItemInfo = sItemInfo + infoStartEndWorkDate + sColumDelimiter;
  766. sItemInfo = sItemInfo + infoConAmt + sColumDelimiter;
  767. sItemInfo = sItemInfo + infoPerpayAmt + sColumDelimiter;
  768. sItemInfo = sItemInfo + infoTaxMethod + sColumDelimiter;
  769. sItemInfo = sItemInfo + infoDate1 + sColumDelimiter;
  770. sItemInfo = sItemInfo + infoTaxChargNm + sColumDelimiter;
  771. sItemInfo = sItemInfo + infoTaxChargHp + sColumDelimiter;
  772. sItemInfo = sItemInfo + infoTaxChargEmail + sColumDelimiter;
  773. sItemInfo = sItemInfo + infoPerpayReqDiv + sColumDelimiter;
  774. sItemInfo = sItemInfo + infoReqPrepayAmt + sColumDelimiter;
  775. sItemInfo = sItemInfo + infoReqPrepaySupplyTamt + sColumDelimiter;
  776. sItemInfo = sItemInfo + infoReqPrepaySupplyNamt + sColumDelimiter;
  777. sItemInfo = sItemInfo + infoReqPrepaySurtaxAmt;
  778. //alert(sItemInfo);
  779. if (sItemInfo == null || sItemInfo == "") {
  780. alert("서명할 데이타를 넣어주십시요");
  781. return false;
  782. }
  783. unisign.SignDataNVerifyVID( sItemInfo, null, CorpRegNoVal, function( resultObject ) {
  784. if( !resultObject || resultObject.resultCode != 0 ){
  785. if( resultObject.resultCode == '14208'){
  786. alert("주민번호/사업자번호를 확인할 수 없는 인증서입니다.");
  787. } else if( resultObject.resultCode == '999'){
  788. alert("사용자 DN 선택이 취소 되었습니다.");
  789. } else {
  790. alert( resultObject.resultMessage);
  791. }
  792. return false;
  793. }
  794. var signeddata = resultObject.signedData;
  795. // var userdn = resultObject.certAttrs.subjectName;
  796. jQuery("#signeddata").val(signeddata);
  797. return true;
  798. });
  799. }
  800. //보증정보팝업 호출
  801. function popContWarr(wG, wSeq, wCauseCd) {
  802. var win_id = "contPurWarrPopup";
  803. var param = "";
  804. var param = "?purContModId=" + jQuery("#subContModId").val();
  805. var param = param + "&warrGubun=" + wG;
  806. var param = param + "&warrSeq=" + wSeq;
  807. var param = param + "&causeCode=" + wCauseCd;
  808. var param = param + "&viewDiv=PREPAY";
  809. var param = param + "&prepayId=" + jQuery("#prepayId").val();
  810. var param = param + "&pop_win_id=" + win_id;
  811. var url = "/portal/guar/contPurWarrPopup.screen"+param;
  812. fLayerPop(win_id, url, 560,350, '','', 'NO');
  813. }
  814. //보증정보팝업 종료후 액션
  815. function popContWarrClose(returnValue){
  816. if(returnValue == null){
  817. fLayerPopClose('contPurWarrPopup');
  818. }else{
  819. fLayerPopClose('contPurWarrPopup');
  820. //location.reload();
  821. reSearch();
  822. }
  823. }
  824. function doAttachFilePop(obj, No, fObj, fileGB, fileDir) {
  825. var editFile = "";
  826. if(obj==''){
  827. alert("After you have saved, you can attach a file.");
  828. }
  829. else if(obj != ''){
  830. if(fObj.guarStatus.value != "02"){editFile="N";}else{editFile="Y";}
  831. viewFileListNew(fileGB, obj.value, fObj.p_AttachFileGuar1, editFile, fileDir, "contPurWarrPopup");
  832. }
  833. }
  834. /**
  835. * 첨부파일 예약 함수
  836. */
  837. function fileDown(file_id){
  838. var url="/common/file/FileDownloadServlet";
  839. url += "?file_id=" + file_id;
  840. 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")
  841. }
  842. //세금계산서 정보 저장
  843. function gubSave(div){
  844. var pKey = jQuery("#prepayId").val();
  845. var f = document.form1;
  846. jQuery("#fevent").val("SAVE_SEGUM");
  847. jQuery("#pKey").val(pKey);
  848. //세금계산서정보 저장
  849. if (confirm("세금계산서정보을 저장 하시겠습니까?")) {
  850. submitXmlRequest("/payment/purchase/Prepayments_form.screen", "SAVE_SEGUM", f, "SUCCESS");
  851. }
  852. }
  853. function openPopUpPrePay() { //변경계약 팝업
  854. if(jQuery("#firstPop").val() == ""){
  855. var url = "/html/portal_purprepay_note_popup.html";
  856. fLayerPop("popup",url,670,440,'','', 'YES');
  857. }
  858. }
  859. $.check = function(returnValue){//팝업 후 서명처리
  860. if(returnValue==true){
  861. var stampMsg = '확인하셨습니까?';
  862. if (confirm(stampMsg)){
  863. jQuery("#firstPop").val("Y");
  864. fLayerPopClose('popup');
  865. }
  866. //submit
  867. }
  868. }
  869. </SCRIPT>
  870. <modular:search id="form1">
  871. <modular:key id="fevent" />
  872. </modular:search>
  873. <form id="form1" name="form1" method="post" modular:type="search">
  874. <INPUT type="hidden" name="fevent" id="fevent" value="">
  875. <INPUT type="hidden" name="selectSubContModId" id="selectSubContModId" value="<%=params.get("selectSubContModId") %>">
  876. <INPUT type="hidden" name="subContModId" id="subContModId" value="<%=prePayment.get("SUB_CONT_MOD_ID") %>">
  877. <INPUT type="hidden" name="prepayId" id="prepayId" value="<%=prePayment.get("PREPAY_ID") %>">
  878. <INPUT type="hidden" name="corpId" id="corpId" value="<%=prePayment.get("CON_CORP_ID") %>">
  879. <INPUT type="hidden" name="orgReqPrepaySupplyTamt" id="orgReqPrepaySupplyTamt" value="<%=prePayment.get("REQ_PREPAY_SUPPLY_TAMT") %>">
  880. <INPUT type="hidden" name="orgReqPrepaySupplyNamt" id="orgReqPrepaySupplyNamt" value="<%=prePayment.get("REQ_PREPAY_SUPPLY_NAMT") %>">
  881. <INPUT type="hidden" name="statusCd" id="statusCd" value="<%=prePayment.get("STATUS_CD") %>">
  882. <INPUT type="hidden" name="subContId" id="subContId" value="<%=prePayment.get("SUB_CONT_ID") %>">
  883. <%-- <INPUT type="hidden" name="warrGubun" id="warrGubun" value="<%=warrList.get("WARR_GUBUN") %>"> --%>
  884. <%-- <INPUT type="hidden" name="warrSeq" id="warrSeq" value="<%=warrList.get("WARR_SEQ") %>"> --%>
  885. <INPUT type="hidden" name="btnAppReqSelect" id="btnAppReqSelect" value="0">
  886. <INPUT type="hidden" name="firstPop" id="firstPop" value="<%=params.get("firstPop")%>">
  887. <!-- 기성신청상태구분 -->
  888. <INPUT type="hidden" name="selectStatusCd" id="selectStatusCd" value="">
  889. <!-- 기성신청상태 -->
  890. <INPUT type='hidden' id="signeddata" name="signeddata" value="">
  891. <!-- 리스트 페이지 검색 조건 -->
  892. <INPUT type='hidden' id="searchBuildName" name="searchBuildName" value="<%=params.get("searchBuildName") %>"> <!-- 계약명 -->
  893. <INPUT type='hidden' id="searchStatusCd" name="searchStatusCd" value="<%=params.get("searchStatusCd") %>"> <!-- 상태값 -->
  894. <INPUT type='hidden' id="pKey" name="pKey" value="">
  895. <INPUT type='hidden' id="resUserName" name="resUserName" value="<%=prePayment.get("RES_USER_NAME") %>"> <!-- 계약담당자 -->
  896. <INPUT type='hidden' id="resHp" name="resHp" value="<%=prePayment.get("RES_HP") %>"> <!-- 계약담당자 핸드폰번호 -->
  897. <INPUT type='hidden' id="resEmail" name="resEmail" value="<%=prePayment.get("RES_EMAIL") %>"> <!-- 계약담당자 이메일 -->
  898. <INPUT type='hidden' id="conDocNo" name="conDocNo" value="<%=prePayment.get("CON_DOC_NO") %>"> <!-- 발주계약번호 -->
  899. <!-- 제목 및 버튼 -->
  900. <table width="100%">
  901. <colgroup>
  902. <col width="500" />
  903. <col width="*" />
  904. </colgroup>
  905. <tr>
  906. <th>
  907. <div align="left" id="title">
  908. <ul>
  909. <li>선급금현황 상세(<span style="font-size: 11px"><%=prePayment.get("STATUS_NM")%></span>)</li>
  910. </ul>
  911. </div>
  912. </th>
  913. <td align="right">
  914. <span id="spanBtnSave" class="btnSearch center" style="display: none"><a href="javascript:void(0);" id="btnSave">저장</a></span>
  915. <span id="spanBtnDelete" class="btnSearch center" style="display: none"><a href="javascript:void(0);" id="btnDelete">삭제</a></span>
  916. <span id="spanBtnAppReq" class="btnSearch center" style="display: none"><a href="javascript:void(0);" id="btnAppReq">선급신청</a></span>
  917. <span id="spanBtnList" class="btnSearch center" style="display: none"><a href="javascript:void(0);" id="btnList">목록</a></span>
  918. </td>
  919. </tr>
  920. </table>
  921. <%
  922. if(!prePayment.get("RTN_REASON").equals("")){
  923. %>
  924. <div class="application-info magT10">
  925. <div class="application-sub-title">
  926. <span class="title">반려정보</span>
  927. </div>
  928. <div class="application-location"></div>
  929. </div>
  930. <TABLE class="form-table">
  931. <colgroup>
  932. <col width="13%" />
  933. <col width="*" />
  934. </colgroup>
  935. <TR height="25">
  936. <th style="text-align: left;">반려일</th>
  937. <TD><%=prePayment.get("RTN_DATE")%></TD>
  938. </TR>
  939. <TR>
  940. <th style="text-align: left;">반려사유</th>
  941. <TD><%=prePayment.get("RTN_REASON")%></TD>
  942. </TR>
  943. </TABLE>
  944. <%
  945. }
  946. %>
  947. <div class="application-info magT10">
  948. <div class="application-sub-title">
  949. <span class="title">기본정보</span>
  950. </div>
  951. <div class="application-location"></div>
  952. </div>
  953. <TABLE class="form-table">
  954. <colgroup>
  955. <col width="13%" />
  956. <col width="20%" />
  957. <col width="13%" />
  958. <col width="20%" />
  959. <col width="13%" />
  960. <col width="*" />
  961. </colgroup>
  962. <TR height="25">
  963. <th style="text-align: left;">현장명</th>
  964. <TD><%= InputText.get("deptName", prePayment.get("DEPT_NAME"), 100, 30, "class=input_blank, readOnly=white, string, left, perSize, tabIndex=-1", "string") %></TD>
  965. <th style="text-align: left;">계약명</th>
  966. <TD><%= InputText.get("buildName", prePayment.get("BUILD_NAME"), 100, 30, "class=input_blank, readOnly=white, string, left, perSize, tabIndex=-1", "string") %></TD>
  967. <th style="text-align: left;">통화</th>
  968. <TD><%= InputText.get("conCurCd", prePayment.get("CON_CUR_CD"), 100, 30, "class=input_blank, readOnly=white, string, left, perSize, tabIndex=-1", "string") %></TD>
  969. </TR>
  970. <TR>
  971. <th style="text-align: left;">사업자번호</th>
  972. <TD><%= InputText.get("vendCd", prePayment.get("CORP_REG_NO"), 100, 30, "class=input_blank, readOnly=white, string, left, perSize, tabIndex=-1", "string") %></TD>
  973. <th style="text-align: left;">계약업체명</th>
  974. <TD><%= InputText.get("memberName", prePayment.get("CORP_KOR"), 100, 30, "class=input_blank, readOnly=white, string, left, perSize, tabIndex=-1", "string") %></TD>
  975. <th style="text-align: left;">대표이사</th>
  976. <TD><%= InputText.get("bossName", prePayment.get("BOSS_NAME"), 100, 30, "class=input_blank, readOnly=white, string, left, perSize, tabIndex=-1", "string") %></TD>
  977. </TR>
  978. <TR>
  979. <th style="text-align: left;">공사기간</th>
  980. <TD><%= InputText.get("startEndWorkDate", prePayment.get("START_END_WORK_DATE"), 100, 30, "class=input_blank, readOnly=white, string, left, perSize, tabIndex=-1", "string") %></TD>
  981. <th style="text-align: left;">계약금액</th>
  982. <TD><%= InputText.get("conConAmt", Formatter2.currency(prePayment.get("CON_SUPPLY_AMT"), intDigit)+" (부가세 별도)", 100, 30, "class=input_blank, readOnly=white, string, left, perSize, tabIndex=-1", "string") %></TD>
  983. <th style="text-align: left;">선급금액</th>
  984. <TD><%= InputText.get("conPrepayAmt", Formatter2.currency(prePayment.get("PREPAY_SUPPLY_AMT"), intDigit)+" (부가세 별도)", 100, 30, "class=input_blank, readOnly=white, string, left, perSize, tabIndex=-1", "string") %></TD>
  985. </TR>
  986. </TABLE>
  987. <div class="application-info magT15">
  988. <div class="application-sub-title">
  989. <span class="title">세금계산서 정보</span>
  990. </div>
  991. <div class="application-location">
  992. <span id="spanTaxSave" class="btnSearch center" style="display: none"><a href="javascript:void(0);" onclick="gubSave('1');" id="btnGubSave">세금계산서저장</a></span>
  993. </div>
  994. </div>
  995. <TABLE class="form-table">
  996. <colgroup>
  997. <col width="13%" />
  998. <col width="20%" />
  999. <col width="13%" />
  1000. <col width="20%" />
  1001. <col width="13%" />
  1002. <col width="*" />
  1003. </colgroup>
  1004. <TR>
  1005. <th style="text-align: left;">세금계산서 발행방법</th>
  1006. <TD colspan="3">
  1007. <input type="radio" id="chk_1" name="chk_info" value="1" onclick="taxDataSet();" <%= check1 %> disabled='disabled' style="display: none;"/>
  1008. <input type="radio" id="chk_2" name="chk_info" value="2" onclick="taxDataSet();" <%= check2 %> disabled='disabled' style="display: none;"/>
  1009. <input type="radio" id="chk_3" name="chk_info" value="3" onclick="taxDataSet();" <%= check3 %> disabled='disabled' style="display: none;"/>
  1010. <%= checkString %>
  1011. </TD>
  1012. <th style="text-align: left;">작성일자(증빙일자)</th>
  1013. <TD><%= InputText.get("date1", Formatter.formatDate(prePayment.get("TAX_DY"), "-"), 30, 10, "Center, date, PerSize, readonly", "date", "") %>
  1014. <!-- <A href="JavaScript:calendar('date1');"><IMG src="/img/buyer/btn/bt_calender.gif" alt="달력" border="0" align="absmiddle"></A> -->
  1015. </TD>
  1016. </TR>
  1017. <TR>
  1018. <th class="required" style="text-align: left;">담당자명</th>
  1019. <TD><%= InputText.get("userName", prePayment.get("USER_NAME"), 98, 6, "string, left, perSize", "string") %></TD>
  1020. <th class="required" style="text-align: left;">담당자 핸드폰번호</th>
  1021. <TD><input type="text" id="hp" name="hp" value="<%=prePayment.get("HP") %>" style="width: 44%" size="13" maxlength="13" alt="left">&nbsp;ex)010-0000-0000</TD>
  1022. <th class="required" style="text-align: left;">담당자 이메일</th>
  1023. <TD><%= InputText.get("eMail", prePayment.get("EMAIL"), 98, 40, "string, left, perSize", "string") %></TD>
  1024. </TR>
  1025. </TABLE>
  1026. <!-- 세금계산서정보 : 끝 -->
  1027. <div class="application-info magT15">
  1028. <div class="application-sub-title">
  1029. <span class="title">선급금정보</span>
  1030. </div>
  1031. </div>
  1032. <TABLE class="form-table">
  1033. <colgroup>
  1034. <col width="13%" />
  1035. <col width="20%" />
  1036. <col width="13%" />
  1037. <col width="20%" />
  1038. <col width="13%" />
  1039. <col width="*" />
  1040. </colgroup>
  1041. <TR>
  1042. <th style="text-align: left;">신청구분</th>
  1043. <TD colspan="3"><%= HTMLMaker.getSelectTag(perpayReqDivComboList, "DETAILCD", "DETAILNM", "perpayReqDiv", "width:30%;height=18;' onChange='inputDataSet();", "", prePayment.get("REQ_DIV_CD")) %></TD>
  1044. <th style="text-align: left;">신청(서명)일시</th>
  1045. <TD><%= InputText.get("custSignDate", prePayment.get("CUST_SIGN_DATE"), 100, 30, "class=input_blank, readOnly=white, string, left, perSize, tabIndex=-1", "string") %></TD>
  1046. </TR>
  1047. </TABLE>
  1048. <img src="/img/com/blank.gif" height="10px" />
  1049. <TABLE class="form-table" style="table-layout: fixed;">
  1050. <colgroup>
  1051. <col width="10%">
  1052. <col width="10%">
  1053. <col width="20%">
  1054. <col width="10%">
  1055. <col width="10%">
  1056. <col width="10%">
  1057. <col width="10%">
  1058. <col width="10%">
  1059. <col width="*">
  1060. </colgroup>
  1061. <TR>
  1062. <th rowspan="1" colspan="2" align="center">구분</th>
  1063. <th rowspan="1">합계</Th>
  1064. <th colspan="2">공급가액</Th>
  1065. <th colspan="2">부가세</Th>
  1066. <th colspan="2">요율</Th>
  1067. </TR>
  1068. <TR>
  1069. <th rowspan="2">계약</Th>
  1070. <th>계약금액</Th>
  1071. <TD align="right"><%= InputText.get("conAmt", Formatter2.currency(prePayment.get("CON_AMT"), intDigit), 98, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %></TD>
  1072. <TD colspan="2" align="right"><%= InputText.get("conSupplyAmt", Formatter2.currency(prePayment.get("CON_SUPPLY_AMT"), intDigit), 98, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %></TD>
  1073. <TD colspan="2" align="right"><%= InputText.get("conSurtaxAmt", Formatter2.currency(prePayment.get("CON_SURTAX_AMT"), intDigit), 98, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %></TD>
  1074. <TD colspan="2" align="right"><%= InputText.get("conAmtPercent", "100.0", 98, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %></TD>
  1075. </TR>
  1076. <TR>
  1077. <th>선급금액</Th>
  1078. <TD align="right"><%= InputText.get("perpayAmt", Formatter2.currency(prePayment.get("PREPAY_AMT"), intDigit), 98, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %></TD>
  1079. <TD colspan="2" align="right"><%= InputText.get("subPrepaySupplyAmt", Formatter2.currency(prePayment.get("PREPAY_SUPPLY_AMT"), intDigit), 98, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %></TD>
  1080. <TD colspan="2" align="right"><%= InputText.get("subPrepaySurtaxAmt", Formatter2.currency(prePayment.get("PREPAY_SURTAX_AMT"), intDigit), 98, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %></TD>
  1081. <TD colspan="2" align="right"><%= InputText.get("prepayAmtPercent", prePayment.get("PREPAY_AMT_PERCENT"), 98, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %></TD>
  1082. </TR>
  1083. <TR>
  1084. <th rowspan="2">선급</Th>
  1085. <th>신청금액</Th>
  1086. <TD align="right"><%= InputText.get("reqPrepayAmt", Formatter2.currency(prePayment.get("REQ_PREPAY_AMT"), intDigit), 98, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %></TD>
  1087. <TD colspan="2" align="right"><%= InputText.get("reqPrepaySupplyAmt", Formatter2.currency(prePayment.get("REQ_PREPAY_SUPPLY_AMT"), intDigit), 98, 16, "class=input byteChk ,float, right, perSize", "float") %></TD>
  1088. <TD colspan="2" align="right"><%= InputText.get("reqPrepaySurtaxAmt", Formatter2.currency(prePayment.get("REQ_PREPAY_SURTAX_AMT"), intDigit), 98, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %></TD>
  1089. <TD colspan="2" align="right"><%= InputText.get("reqPrepayPercent", prePayment.get("REQ_PREPAY_PERCENT"), 98, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %></TD>
  1090. </TR>
  1091. <TR>
  1092. <th>포기금액</Th>
  1093. <TD align="right"><%= InputText.get("giveAmt", Formatter2.currency(prePayment.get("GIVE_AMT"), intDigit), 98, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %></TD>
  1094. <TD colspan="2" align="right"><%= InputText.get("giveSupplyAmt", Formatter2.currency(prePayment.get("GIVE_SUPPLY_AMT"), intDigit), 98, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %></TD>
  1095. <TD colspan="2" align="right"><%= InputText.get("giveSurtaxAmt", Formatter2.currency(prePayment.get("GIVE_SURTAX_AMT"), intDigit), 98, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %></TD>
  1096. <TD colspan="2" align="right"><%= InputText.get("givePercent", prePayment.get("GIVE_PERCENT"), 98, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %></TD>
  1097. </TR>
  1098. </TABLE>
  1099. <div class="application-info magT15">
  1100. <div class="application-sub-title">
  1101. <span class="title">첨부파일</span>
  1102. </div>
  1103. </div>
  1104. <!-- 첨부파일 : 시작 -->
  1105. <TABLE class="form-table">
  1106. <colgroup>
  1107. <col width="5%">
  1108. <col width="6%">
  1109. <col width="11%">
  1110. <col width="11%">
  1111. <col width="11%">
  1112. <col width="11%">
  1113. <col width="11%">
  1114. <col width="11%">
  1115. <col width="*">
  1116. </colgroup>
  1117. <TR>
  1118. <th colspan="2">구분</Th>
  1119. <th colspan="5">첨부파일명</Th>
  1120. <th colspan="2">다운로드</Th>
  1121. </TR>
  1122. <TR>
  1123. <TD colspan="2">선급금 포기각서<span id="p_Attach1">(해당없음)</span></TD>
  1124. <%-- <TD colspan="5" align="left"><TEXTAREA name="p_AttachFile1" id="p_AttachFile1" style="width: 100%; height: 99%; border: 0;" rows="1" class="input" readOnly><%=file_giveup.get("PREPAYMENTS_GIVEUP") %></TEXTAREA></TD> --%>
  1125. <TD colspan="5" align="left">
  1126. <table width="100%">
  1127. <colgroup>
  1128. <col width="99%" />
  1129. </colgroup>
  1130. <tr>
  1131. <td>
  1132. <div id="p_AttachFile1" class="attach_file_view">
  1133. <%=FileManager.getFileListForDiv("PREPAYMENTS_GIVEUP", prePayment.get("PREPAY_ID")) %>
  1134. </div>
  1135. </td>
  1136. <tr>
  1137. </table>
  1138. </TD>
  1139. <TD colspan="2" style="text-align: center;"><span id="giveAttachments"><IMG id='search_spot_button' onClick="doAttachFile(document.form1.prepayId,1);" src='/img/buyer/button/bt_change.gif' border='0' align="top" align='absmiddle' alt='[Attach File]' style='cursor:pointer;'></TD>
  1140. </TR>
  1141. <TR id="taxTrRow">
  1142. <TD colspan="2" align="center">세금계산서</TD>
  1143. <%-- <TD colspan="5" align="left"><TEXTAREA name="p_AttachFile2" id="p_AttachFile2" style="width: 100%; height: 99%; border: 0;" rows="1" class="input" readOnly><%=file_taxbill.get("TAX_BILL") %></TEXTAREA></TD> --%>
  1144. <TD colspan="5" align="left">
  1145. <table width="100%">
  1146. <colgroup>
  1147. <col width="99%" />
  1148. </colgroup>
  1149. <tr>
  1150. <td>
  1151. <div id="p_AttachFile2" class="attach_file_view">
  1152. <%=FileManager.getFileListForDiv("TAX_BILL", prePayment.get("PREPAY_ID")) %>
  1153. </div>
  1154. </td>
  1155. <tr>
  1156. </table>
  1157. </TD>
  1158. <TD colspan="2" style="text-align: center;"><span id="taxAttachments"><IMG id='search_spot_button' onClick="doAttachFile(document.form1.prepayId,2);" src='/img/buyer/button/bt_change.gif' border='0' align="top" align='absmiddle' alt='[Attach File]' style='cursor:pointer;'></TD>
  1159. </TR>
  1160. <TR>
  1161. <TD colspan="2">대금청구</TD>
  1162. <TD colspan="5" align="left">
  1163. <table width="100%">
  1164. <colgroup>
  1165. <col width="99%" />
  1166. </colgroup>
  1167. <tr>
  1168. <td>
  1169. <div id="p_AttachFile4" class="attach_file_view">
  1170. <%=FileManager.getFileListForDiv("PREPAYMENTS_BILLING", prePayment.get("PREPAY_ID")) %>
  1171. </div>
  1172. </td>
  1173. <tr>
  1174. </table>
  1175. </TD>
  1176. <TD colspan="2" style="text-align: center;"><span id="giveAttachments"><IMG id='search_spot_button' onClick="doAttachFile(document.form1.prepayId,4);" src='/img/buyer/button/bt_change.gif' border='0' align="top" align='absmiddle' alt='[Attach File]' style='cursor:pointer;'></TD>
  1177. </TR>
  1178. </TABLE>
  1179. <!-- 첨부파일 : 끝 -->
  1180. <%
  1181. /*
  1182. 보증 목록을 include 시킴 (2014-10-17) 김명호
  1183. */
  1184. %>
  1185. <%@ include file="/jsp/ko_KR/supplier/portal/common/guar/guarPurList.jsp" %>
  1186. </FORM>
  1187. <script>
  1188. </script>
  1189. <!-- 전자인증 모듈 설정 //-->
  1190. <link rel="stylesheet" type="text/css" href="/CrossCert/CC_WSTD_home/unisignweb/rsrc/css/certcommon.css?v=1" />
  1191. <script type="text/javascript" src="/CrossCert/CC_WSTD_home/unisignweb/js/unisignwebclient.js?v=1"></script>
  1192. <script type="text/javascript" src="/CrossCert/UniSignWeb_Multi_Init_Nim.js?v=1"></script>
  1193. <!-- 전자인증 모듈 설정 //-->