prepaymentsAdd.jsp 69 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883
  1. <%--
  2. - FileName : prepaymentsAdd.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. <%@ page import="kr.co.udapsoft.common.code.*" %>
  17. <%@ include file="/jsp/work/taglib.jsp"%>
  18. <jsp:useBean id="ctx" class="com.udapsoft.waf.system.context.SessionContext" scope="session" />
  19. <%
  20. ctx.init(request, response);
  21. HandlerStorage storage = ctx.getHandlerStorage();
  22. ValueObject params = storage.getParams();
  23. ValueObject user = storage.getUser();
  24. String event = storage.getEvent();
  25. RowSet perpayReqDivComboList = storage.getRowSet("perpayReqDivComboList"); //신청구분 ComboList Data
  26. ValueObject prePayment = storage.getValueObject("prePayment"); //기본정보, 세금계산서정보, 선급금정보
  27. ValueObject ContInfo = storage.getValueObject("ContInfo"); //분계유형
  28. RowSet warrList = storage.getRowSet("contOutWarr"); //보증정보
  29. ValueObject file_giveup = storage.getValueObject("PREPAYMENTS_GIVEUP");
  30. ValueObject file_taxbill = storage.getValueObject("TAX_BILL");
  31. String check1 = "";
  32. String check2 = "";
  33. String check3 = "";
  34. if("3".equals(prePayment.get("TAX_METHOD_CD"))){
  35. check3 = "checked";
  36. }else if("2".equals(prePayment.get("TAX_METHOD_CD"))){
  37. check2 = "checked";
  38. }else{
  39. check1 = "checked";
  40. }
  41. String taxChargNm = "";
  42. String taxChargHp = "";
  43. String taxChargEmail = "";
  44. taxChargNm = prePayment.get("USER_NAME");
  45. taxChargHp = prePayment.get("HP");
  46. taxChargEmail = prePayment.get("EMAIL");
  47. String digit = (String)prePayment.get("digit");
  48. int intDigit = Integer.parseInt(digit);
  49. String creby = user.get("ACCT_ID");
  50. String updby = user.get("ACCT_ID");
  51. if(!"".equals(prePayment.get("CRE_BY")) && !"".equals(prePayment.get("UPD_BY"))){
  52. creby = prePayment.get("CRE_BY");
  53. updby = prePayment.get("UPD_BY");
  54. }
  55. %>
  56. <SCRIPT language="JavaScript">
  57. /*예약함수*/
  58. var sheet1;
  59. var sheet1Row;
  60. var sheet1PageNo = 1;
  61. var pageLastRowIndex = 1;
  62. var validationResult = false;
  63. var filterShow = false;
  64. var btn_flag;;
  65. var g_digit = <%= intDigit %>; // 소숫점 이하 자릿수
  66. function _onReady() {
  67. jQuery(document).delegate('#date1','change', function() {
  68. var f = document.form1;
  69. jQuery("#fevent").val("GET_RATE");
  70. //반려가 가능한 상태인지 확인한다.
  71. submitXmlRequest("/payment/purchase/PrepaymentsAdd_form.screen", "GET_RATE", f, "VALUEOBJECT");
  72. });
  73. //리스트 페이지 이동
  74. jQuery("#btnList").click(function() {
  75. jQuery("#fevent").val("");
  76. if(jQuery("#resultListDiv").val() == "1"){
  77. jQuery("#form1").attr("action", "/payment/purchase/PrepaymentsList.screen");
  78. }else{
  79. jQuery("#form1").attr("action", "/payment/purchase/PrepaymentsResultList.screen");
  80. }
  81. jQuery("#form1").attr("target", "_self");
  82. jQuery("#form1").attr("method", "post");
  83. jQuery("#form1").submit();
  84. });
  85. jQuery("#btnDelete").click(function() {
  86. var f = document.form1;
  87. btn_flag = 'delete';
  88. //필수 입력항목 check
  89. if (jQuery("#prepayId").val() == "") {
  90. alert("삭제되었습니다.");
  91. return;
  92. }
  93. var f = document.form1;
  94. jQuery("#fevent").val("CHK_APPVAR");
  95. //결재가 가능한 상태인지 확인한다.
  96. submitXmlRequest("/payment/purchase/PrepaymentsAdd_form.screen", "CHK_APPVAR", f, "VALUEOBJECT");
  97. //입력데이터 저장
  98. });
  99. jQuery("#btnSave").click(function() {
  100. var f = document.form1;
  101. btn_flag = 'save';
  102. var f = document.form1;
  103. jQuery("#fevent").val("CHK_APPVAR");
  104. //결재가 가능한 상태인지 확인한다.
  105. submitXmlRequest("/payment/purchase/PrepaymentsAdd_form.screen", "CHK_APPVAR", f, "VALUEOBJECT");
  106. });
  107. jQuery("#btnText").click(function() {
  108. var f = document.form1;
  109. jQuery("#btnAppReqSelect").val("1"); //0:저장처리, 1:선급신청처리
  110. jQuery("#fevent").val("SAVE_DATA");
  111. //필수 입력항목 check
  112. if (requiredItemsCheck() == false) {
  113. jQuery("#btnAppReqSelect").val("0"); //0:저장처리, 1:선급신청처리
  114. return;
  115. }
  116. if (confirm(jQuery("#btnText").text() + " 하시겠습니까?")) {
  117. submitXmlRequest("/payment/purchase/PrepaymentsAdd_form.screen", "SAVE_DATA", f, "SUCCESS");
  118. }else{
  119. jQuery("#btnAppReqSelect").val("0"); //0:저장처리, 1:선급신청처리
  120. }
  121. });
  122. //반려
  123. jQuery("#btnRejection").click(function() {
  124. var f = document.form1;
  125. jQuery("#fevent").val("CHK_REJECT");
  126. //반려가 가능한 상태인지 확인한다.
  127. submitXmlRequest("/payment/purchase/PrepaymentsAdd_form.screen", "CHK_REJECT", f, "VALUEOBJECT");
  128. });
  129. //결재
  130. jQuery("#btnApproval").click(function() {
  131. //var radioCheck = jQuery(':radio[name="chk_info"]:checked').val(); //세금계산서 발행방법
  132. //if(radioCheck != "3"){ //Invoice
  133. //대금 청구 필첨
  134. if(jQuery.trim(jQuery("#p_AttachFile4").text()) == "") {
  135. alert('첨부파일 대금청구가 없습니다.');
  136. return;
  137. }
  138. //}
  139. //통화가KRW가 아니고 분계유형에 증빙종류[기타]이면 invlice고정
  140. var conCurCd = jQuery("#conCurCd").val();
  141. var proof_cd = jQuery("#proof_cd option:selected").val();
  142. if(conCurCd != "KRW"){
  143. var rateEx = jQuery("#rateEx").val();
  144. if(rateEx == 0){
  145. alert('환율이 없습니다.');
  146. return;
  147. }
  148. }
  149. var radioCheck = jQuery(':radio[name="chk_info"]:checked').val(); //세금계산서 발행방법
  150. if (radioCheck == "2") { //순발행
  151. if(jQuery.trim(jQuery("#p_AttachFile2").text()) == "") {
  152. alert("세금계산서 첨부파일이 없습니다.");
  153. return;
  154. }
  155. }
  156. btn_flag = 'sign';
  157. var f = document.form1;
  158. jQuery("#fevent").val("CHK_APPVAR");
  159. //결재가 가능한 상태인지 확인한다.
  160. submitXmlRequest("/payment/purchase/PrepaymentsAdd_form.screen", "CHK_APPVAR", f, "VALUEOBJECT");
  161. });
  162. //Invoice결재
  163. jQuery("#btnInvoiceApproval").click(function() {
  164. //var radioCheck = jQuery(':radio[name="chk_info"]:checked').val(); //세금계산서 발행방법
  165. //if(radioCheck != "3"){ //Invoice
  166. //대금 청구 필첨
  167. if(jQuery.trim(jQuery("#p_AttachFile4").text()) == "") {
  168. alert('첨부파일 대금청구가 없습니다.');
  169. return;
  170. }
  171. //}
  172. //세금계산서 첨부파일 유무Cekch
  173. var radioCheck = jQuery(':radio[name="chk_info"]:checked').val(); //세금계산서 발행방법
  174. if (radioCheck == "2") { //순발행
  175. /* if(jQuery.trim(jQuery("#p_AttachFile2").text()) == "") {
  176. alert("세금계산서 첨부파일이 없습니다.");
  177. return;
  178. } */
  179. }
  180. if(radioCheck == "3"){
  181. if(jQuery.trim(jQuery("#p_AttachFile3").text()) == "") {
  182. alert("Invoice 첨부파일이 없습니다.");
  183. return;
  184. }
  185. }
  186. var f = document.form1;
  187. jQuery("#btnAppReqSelect").val("2"); //0:저장처리, 1:선급신청처리, 2:Invoice결재
  188. //필수 입력항목 check
  189. if (requiredItemsCheck() == false) {
  190. return;
  191. }
  192. var f = document.form1;
  193. jQuery("#fevent").val("CHK_APPVAR");
  194. //결재가 가능한 상태인지 확인한다.
  195. submitXmlRequest("/payment/purchase/PrepaymentsAdd_form.screen", "CHK_APPVAR", f, "VALUEOBJECT");
  196. });
  197. jQuery("#btnComRnnc").click(function() {
  198. var f = document.form1;
  199. jQuery("#btnAppReqSelect").val("1"); //0:저장처리, 1:기성신청처리
  200. jQuery("#fevent").val("RNNC_DATA");
  201. //필수 입력항목 check
  202. //입력데이터 저장
  203. if (confirm("포기완료 하시겠습니까?")) {
  204. submitXmlRequest("/payment/purchase/PrepaymentsAdd_form.screen", "RNNC_DATA", f, "SUCCESS");
  205. }else{
  206. jQuery("#btnAppReqSelect").val("0"); //0:저장처리, 1:선급신청처리
  207. }
  208. });
  209. //선급금 사용자 입력 후 처리
  210. jQuery("#reqPrepaySupplyAmt").blur(function() {
  211. var reqPrepaySupplyTamt = jQuery("#reqPrepaySupplyAmt").val();
  212. reqPrepaySupplyTamt = reqPrepaySupplyTamt.replace(/(\,|\:)/g, ""); //신청금액 과세
  213. reqPrepaySupplyTamt = Number(reqPrepaySupplyTamt).toFixed(g_digit);
  214. var befReqPrepaySupplyTamt = jQuery("#befReqPrepaySupplyAmt").val();
  215. befReqPrepaySupplyTamt = befReqPrepaySupplyTamt.replace(/(\,|\:)/g, ""); //신청금액 과세
  216. befReqPrepaySupplyTamt = Number(befReqPrepaySupplyTamt).toFixed(g_digit);
  217. var subPrepaySupplyTamt = jQuery("#subPrepaySupplyAmt").val();
  218. subPrepaySupplyTamt = subPrepaySupplyTamt.replace(/(\,|\:)/g, ""); //선급금액 과세
  219. if (Number(subPrepaySupplyTamt) < Number(reqPrepaySupplyTamt)) {
  220. if(jQuery("#statusCd").val() != "10"){
  221. alert('선급금보다 신청금액이 큽니다.');
  222. reqPrepaySupplyTamt = subPrepaySupplyTamt;
  223. jQuery("#reqPrepaySupplyAmt").val(subPrepaySupplyTamt);
  224. jQuery("#giveSupplyAmt").val("0");
  225. jQuery('#reqPrepaySupplyAmt').focus();
  226. }
  227. } else {
  228. jQuery("#reqPrepaySupplyAmt").val(Number(reqPrepaySupplyTamt).toFixed(g_digit));
  229. var giveSupplyTamt = subPrepaySupplyTamt - reqPrepaySupplyTamt- befReqPrepaySupplyTamt;
  230. jQuery("#giveSupplyAmt").val(giveSupplyTamt.toFixed(g_digit));
  231. jQuery("#giveSupplyAmt, #reqPrepaySupplyAmt").each(function(index) {
  232. jQuery(this).val(jQuery(this).val().split(/(?=(?:\d{3})+(?:\.|$))/g).join(','));
  233. });
  234. }
  235. //부가세
  236. var reqPrepaySurtaxAmt = (reqPrepaySupplyTamt * 10) / 100;
  237. reqPrepaySurtaxAmt = doFloor(reqPrepaySurtaxAmt, g_digit);
  238. var subPrepaySurtaxAmt = jQuery("#subPrepaySurtaxAmt").val();
  239. subPrepaySurtaxAmt = subPrepaySurtaxAmt.replace(/(\,|\:)/g, ""); //선급금액 부과세
  240. var befReqPrepaySurtaxAmt = jQuery("#befReqPrepaySurtaxAmt").val();
  241. befReqPrepaySurtaxAmt = befReqPrepaySurtaxAmt.replace(/(\,|\:)/g, ""); //신청금액 과세
  242. befReqPrepaySurtaxAmt = Number(befReqPrepaySurtaxAmt).toFixed(g_digit);
  243. if(Number(subPrepaySurtaxAmt) > 0){
  244. var giveSurtaxAmt = subPrepaySurtaxAmt - reqPrepaySurtaxAmt - befReqPrepaySurtaxAmt;
  245. jQuery("#reqPrepaySurtaxAmt").val(reqPrepaySurtaxAmt);
  246. jQuery("#reqPrepaySurtaxAmt").each(function(index) {
  247. jQuery(this).val(jQuery(this).val().split(/(?=(?:\d{3})+(?:\.|$))/g).join(','));
  248. });
  249. jQuery("#giveSurtaxAmt").val(giveSurtaxAmt.toFixed(g_digit));
  250. }else{
  251. jQuery("#reqPrepaySurtaxAmt").val(0);
  252. reqPrepaySurtaxAmt = 0;
  253. }
  254. jQuery("#giveSurtaxAmt").each(function(index) {
  255. jQuery(this).val(jQuery(this).val().split(/(?=(?:\d{3})+(?:\.|$))/g).join(','));
  256. });
  257. //신청금액을 구한다.
  258. var reqPrepayAmt = Number(reqPrepaySupplyTamt) + Number(reqPrepaySurtaxAmt);
  259. var befReqPrepayAmt = Number(befReqPrepaySupplyTamt) + Number(befReqPrepaySurtaxAmt);
  260. var perpayAmt = jQuery("#perpayAmt").val();
  261. perpayAmt = perpayAmt.replace(/(\,|\:)/g, ""); //선급금액
  262. var giveAmt = perpayAmt - reqPrepayAmt - befReqPrepayAmt ;
  263. jQuery("#reqPrepayAmt").val(reqPrepayAmt.toFixed(g_digit));
  264. jQuery("#reqPrepayAmt").each(function(index) {
  265. jQuery(this).val(jQuery(this).val().split(/(?=(?:\d{3})+(?:\.|$))/g).join(','));
  266. });
  267. jQuery("#giveAmt").val(giveAmt.toFixed(g_digit));
  268. jQuery("#giveAmt").each(function(index) {
  269. jQuery(this).val(jQuery(this).val().split(/(?=(?:\d{3})+(?:\.|$))/g).join(','));
  270. });
  271. //요율
  272. var conAmt = jQuery("#conAmt").val();
  273. conAmt = conAmt.replace(/(\,|\:)/g, "");
  274. var conSupplyAmt = jQuery("#conSupplyAmt").val();
  275. conSupplyAmt = conSupplyAmt.replace(/(\,|\:)/g, "");
  276. var giveSupplyAmt = jQuery("#giveSupplyAmt").val();
  277. giveSupplyAmt = giveSupplyAmt.replace(/(\,|\:)/g, "");
  278. var reqPrepayPercent = (reqPrepaySupplyTamt / conSupplyAmt) * 100; //신청금액 요율
  279. var givePercent = (giveSupplyAmt / conSupplyAmt) * 100; //포기금액 요율
  280. jQuery("#reqPrepayPercent").val(reqPrepayPercent.toFixed(1));
  281. jQuery("#givePercent").val(givePercent.toFixed(1));
  282. setSeletReq();
  283. giveDataSet();
  284. });
  285. pageinit();
  286. }
  287. //페이지 초기처리
  288. function pageinit() {
  289. //신청구분 설정
  290. setSeletReq();
  291. //선급금 포기각서 표시 유무
  292. giveDataSet()
  293. //작성일자(증빙일자)
  294. seTaxDate();
  295. //신청구분 선택불가
  296. appDivSet();
  297. //발행방법에 따른 페이지 셋팅
  298. taxDataSet();
  299. //버튼표시 셋팅
  300. btnCtr();
  301. //상태에 따른 입력항목 readOnly
  302. inputReadOnlyset();
  303. }
  304. function appDivSet() {
  305. jQuery("#perpayReqDiv").attr("disabled", true);
  306. jQuery("#reqPrepaySupplyTamt, #reqPrepaySupplyNamt").blur();
  307. }
  308. function setSeletReq(){
  309. var reqPrepaySupplyTamt = jQuery("#reqPrepaySupplyAmt").val().replace(/(\,|\:)/g, ""); //신청금액 과세
  310. reqPrepaySupplyTamt = Number(reqPrepaySupplyTamt).toFixed(g_digit);
  311. var subPrepaySupplyTamt = jQuery("#subPrepaySupplyAmt").val().replace(/(\,|\:)/g, ""); //선급금액 과세
  312. subPrepaySupplyTamt = Number(subPrepaySupplyTamt).toFixed(g_digit);
  313. var befReqPrepaySupplyAmt = jQuery("#befReqPrepaySupplyAmt").val().replace(/(\,|\:)/g, ""); //선급금액 과세
  314. befReqPrepaySupplyAmt = Number(befReqPrepaySupplyAmt).toFixed(g_digit);
  315. //입력한 선급금 과세가 빈값일 경우 0으로 셋팅
  316. if (reqPrepaySupplyTamt == "" || Number(reqPrepaySupplyTamt) == 0) {
  317. reqPrepaySupplyTamt = "0";
  318. jQuery("#reqPrepaySupplyAmt").val("0");
  319. }
  320. if (Number(reqPrepaySupplyTamt) == 0) { //선급포기
  321. jQuery("#perpayReqDiv").val("3");
  322. jQuery("#btnText").text("신청요청");
  323. //} else if ((Number(reqPrepaySupplyTamt) + Number(befReqPrepaySupplyAmt)) == Number(subPrepaySupplyTamt)) { //신청
  324. } else if (Number(reqPrepaySupplyTamt) == Number(subPrepaySupplyTamt)) { //신청
  325. jQuery("#perpayReqDiv").val("1");
  326. jQuery("#btnText").text("신청요청");
  327. } else {
  328. jQuery("#perpayReqDiv").val("2");
  329. jQuery("#btnText").text("신청요청");
  330. }
  331. }
  332. function seTaxDate() {
  333. var newDay = new Date(get_year(), get_month(), "");
  334. var lastDay = newDay.getDate();
  335. var yyyymmdd = get_year() + '-' + get_month() + "-" + lastDay;
  336. if (jQuery('#date1').val() == "") {
  337. jQuery('#date1').val(yyyymmdd);
  338. }
  339. jQuery('#lastDate').val(yyyymmdd);
  340. }
  341. function btnCtr(){
  342. var radioCheck = jQuery(':radio[name="chk_info"]:checked').val(); //세금계산서 발행방법
  343. if(radioCheck == "3"){ //Invoice
  344. if(jQuery("#statusCd").val() == "00" || jQuery("#statusCd").val() == "" || jQuery("#statusCd").val() == "01" || jQuery("#statusCd").val() == "02" || jQuery("#statusCd").val() == "03" || jQuery("#statusCd").val() == "91" || jQuery("#statusCd").val() == "20"){
  345. jQuery("#spanBtnSave").show();
  346. jQuery("#spanBtnDelete").show();
  347. jQuery("#spanBtnAppReq").hide();
  348. jQuery("#spanBtnApproval").hide();
  349. jQuery("#spanBtnInvoiceApproval").show();
  350. jQuery("#spanBtnRejection").hide();
  351. jQuery("#spanComRnnc").hide();
  352. jQuery("#spanBtnList").show();
  353. jQuery("#spanTaxSave").hide();
  354. }else {
  355. jQuery("#spanBtnSave").hide();
  356. jQuery("#spanBtnDelete").hide();
  357. jQuery("#spanBtnAppReq").hide();
  358. jQuery("#spanBtnApproval").hide();
  359. jQuery("#spanBtnInvoiceApproval").hide();
  360. jQuery("#spanBtnRejection").hide();
  361. if(jQuery("#statusCd").val() == "21" ){
  362. jQuery("#spanComRnnc").show();
  363. }else{
  364. jQuery("#spanComRnnc").hide();
  365. }
  366. jQuery("#spanBtnList").show();
  367. jQuery("#spanTaxSave").hide();
  368. }
  369. }else{
  370. if(jQuery("#statusCd").val() == "00" || jQuery("#statusCd").val() == ""){ //00:작성상태는 목록, 저장버튼 표시
  371. jQuery("#spanBtnSave").show();
  372. jQuery("#spanBtnDelete").show();
  373. jQuery("#spanBtnAppReq").hide();
  374. jQuery("#spanBtnApproval").hide();
  375. jQuery("#spanBtnInvoiceApproval").hide();
  376. jQuery("#spanBtnRejection").hide();
  377. jQuery("#spanComRnnc").hide();
  378. jQuery("#spanBtnList").show();
  379. jQuery("#spanGubSave").hide();
  380. jQuery("#spanTaxSave").hide();
  381. }
  382. if(jQuery("#statusCd").val() == "01"){ //01:작성상태는 목록, 저장, 선급신청버튼 표시
  383. jQuery("#spanBtnSave").show();
  384. jQuery("#spanBtnDelete").show();
  385. jQuery("#spanBtnAppReq").hide();
  386. if(radioCheck == "2"){
  387. jQuery("#spanBtnApproval").show();
  388. jQuery("#spanBtnInvoiceApproval").hide(); //추후 숨김으로
  389. }else{
  390. jQuery("#spanBtnApproval").hide();
  391. jQuery("#spanBtnInvoiceApproval").show(); //추후 숨김으로
  392. }
  393. jQuery("#spanBtnRejection").hide();
  394. jQuery("#spanComRnnc").hide();
  395. jQuery("#spanBtnList").show();
  396. jQuery("#spanGubSave").hide();
  397. jQuery("#spanTaxSave").hide();
  398. }
  399. if(jQuery("#statusCd").val() == "02"){ //02:선급신청요청상태는 목록, 저장, 선급신청 버튼 표시
  400. jQuery("#spanBtnSave").show();
  401. jQuery("#spanBtnDelete").hide();
  402. jQuery("#spanBtnAppReq").show();
  403. jQuery("#spanBtnApproval").hide();
  404. if(radioCheck == "1"){
  405. jQuery("#spanBtnInvoiceApproval").hide(); //추후 숨김으로
  406. }else{
  407. jQuery("#spanBtnInvoiceApproval").show(); //추후 숨김으로
  408. }
  409. jQuery("#spanBtnRejection").hide();
  410. jQuery("#spanComRnnc").hide();
  411. jQuery("#spanBtnList").show();
  412. jQuery("#spanGubSave").hide();
  413. jQuery("#spanTaxSave").hide();
  414. }
  415. if(jQuery("#statusCd").val() == "21"){ //21:선급포기요청상태는 목록, 저장, 선급신청 버튼 표시
  416. jQuery("#spanBtnSave").hide();
  417. jQuery("#spanBtnDelete").hide();
  418. jQuery("#spanBtnAppReq").hide();
  419. jQuery("#spanBtnApproval").hide();
  420. jQuery("#spanBtnInvoiceApproval").hide();
  421. jQuery("#spanBtnRejection").show();
  422. jQuery("#spanComRnnc").show();
  423. jQuery("#spanBtnList").show();
  424. jQuery("#spanGubSave").hide();
  425. jQuery("#spanTaxSave").hide();
  426. }
  427. if(jQuery("#statusCd").val() == "03" || jQuery("#statusCd").val() == "20"){ //03:선급신청상태는 목록 버튼 표시
  428. jQuery("#spanBtnSave").hide();
  429. jQuery("#spanBtnDelete").hide();
  430. jQuery("#spanBtnAppReq").hide();
  431. jQuery("#spanBtnApproval").show();
  432. jQuery("#spanBtnInvoiceApproval").hide();
  433. jQuery("#spanBtnRejection").show();
  434. jQuery("#spanComRnnc").hide();
  435. jQuery("#spanBtnList").show();
  436. jQuery("#spanGubSave").show();
  437. jQuery("#spanTaxSave").show();
  438. }
  439. if(jQuery("#statusCd").val() == "04"){ //04:결재중상태는 목록 버튼 표시
  440. jQuery("#spanBtnSave").hide();
  441. jQuery("#spanBtnDelete").hide();
  442. jQuery("#spanBtnAppReq").hide();
  443. jQuery("#spanBtnApproval").hide();
  444. jQuery("#spanBtnRejection").hide();
  445. jQuery("#spanComRnnc").hide();
  446. jQuery("#spanBtnList").show();
  447. jQuery("#spanGubSave").hide();
  448. jQuery("#spanTaxSave").hide();
  449. }
  450. if(jQuery("#statusCd").val() == "10"){ //10:선급완료상태는 목록 버튼 표시
  451. jQuery("#spanBtnSave").hide();
  452. jQuery("#spanBtnDelete").hide();
  453. jQuery("#spanBtnAppReq").hide();
  454. jQuery("#spanBtnApproval").hide();
  455. jQuery("#spanBtnInvoiceApproval").hide();
  456. jQuery("#spanBtnRejection").hide();
  457. jQuery("#spanComRnnc").hide();
  458. jQuery("#spanBtnList").show();
  459. jQuery("#spanGubSave").hide();
  460. jQuery("#spanTaxSave").hide();
  461. }
  462. if(jQuery("#statusCd").val() == "11"){ //51:선급포기상태는 목록 버튼 표시
  463. jQuery("#spanBtnSave").hide();
  464. jQuery("#spanBtnDelete").hide();
  465. jQuery("#spanBtnAppReq").hide();
  466. jQuery("#spanBtnApproval").hide();
  467. jQuery("#spanBtnInvoiceApproval").hide();
  468. jQuery("#spanBtnRejection").hide();
  469. jQuery("#spanComRnnc").hide();
  470. jQuery("#spanBtnList").show();
  471. jQuery("#spanGubSave").hide();
  472. jQuery("#spanTaxSave").hide();
  473. }
  474. if(jQuery("#statusCd").val() == "91"){ //91:반려상태는 목록, 저장 버튼 표시
  475. jQuery("#spanBtnSave").show();
  476. jQuery("#spanBtnDelete").show();
  477. jQuery("#spanBtnAppReq").show();
  478. jQuery("#spanBtnApproval").hide();
  479. jQuery("#spanBtnInvoiceApproval").hide();
  480. jQuery("#spanComRnnc").hide();
  481. jQuery("#spanBtnRejection").hide();
  482. jQuery("#spanBtnList").show();
  483. jQuery("#spanGubSave").hide();
  484. jQuery("#spanTaxSave").hide();
  485. }
  486. }
  487. }
  488. function inputReadOnlyset() {
  489. //분개유형 비활성화
  490. jQuery('#acct_gb').attr('disabled', 'true');
  491. jQuery('#proof_cd').attr('disabled', 'true');
  492. jQuery('#pay_group').attr('disabled', 'true');
  493. if(jQuery("#conCurCd").val() == "KRW"){
  494. jQuery("#chk_3").attr("disabled",true);
  495. }
  496. //03:선급신청, 04:결재중, 10:선급완료, 11:선급포기완료
  497. if (jQuery("#statusCd").val() == "04" || jQuery("#statusCd").val() == "10" || jQuery("#statusCd").val() == "11") { //03:선급신청상태는 목록 버튼 표시
  498. jQuery("#userName").attr("readonly", true);
  499. jQuery("#userName").css({'background-color' : '#F0F0F0'});
  500. jQuery("#userName").css({'border' : '1px solid #bcbcbc'});
  501. jQuery("#hp").attr("readonly", true);
  502. jQuery("#hp").css({'background-color' : '#F0F0F0'});
  503. jQuery("#hp").css({'border' : '1px solid #bcbcbc'});
  504. jQuery("#eMail").attr("readonly", true);
  505. jQuery("#eMail").css({'background-color' : '#F0F0F0'});
  506. jQuery("#eMail").css({'border' : '1px solid #bcbcbc'});
  507. jQuery("#reqPrepaySupplyAmt").attr("readonly", true);
  508. jQuery("#reqPrepaySupplyAmt").css({'background-color' : '#F0F0F0'});
  509. jQuery("#reqPrepaySupplyAmt").css({'border' : '1px solid #bcbcbc'});
  510. }
  511. if(jQuery("#statusCd").val() == "03"){
  512. jQuery("#reqPrepaySupplyAmt").attr("readonly", true);
  513. jQuery("#reqPrepaySupplyAmt").css({'background-color' : '#F0F0F0'});
  514. jQuery("#reqPrepaySupplyAmt").css({'border' : '1px solid #bcbcbc'});
  515. }
  516. }
  517. function taxDataSet() {
  518. //통화가KRW가 아니고 분계유형에 증빙종류[기타]이면 invlice고정
  519. var conCurCd = jQuery("#conCurCd").val();
  520. var proof_cd = jQuery("#proof_cd option:selected").val();
  521. if(conCurCd != "KRW" && proof_cd == "Z99"){
  522. jQuery("#chk_2").attr("disabled",true);
  523. }else if(conCurCd != "KRW" && proof_cd != "Z99"){
  524. jQuery("#chk_3").attr("disabled",true);
  525. }
  526. var radioCheck = jQuery(':radio[name="chk_info"]:checked').val(); //세금계산서 발행방법
  527. if (radioCheck == "2"){ //순발행
  528. jQuery("#taxAttachments").show();
  529. jQuery("#taxTrRow").show();
  530. jQuery("#invoiceAttachments").hide();
  531. jQuery("#invoiceTrRow").hide();
  532. }else{
  533. jQuery("#taxAttachments").hide();
  534. jQuery("#taxTrRow").hide();
  535. jQuery("#invoiceAttachments").show();
  536. jQuery("#invoiceTrRow").show();
  537. }
  538. btnCtr();
  539. }
  540. function giveDataSet() {
  541. if (jQuery("#perpayReqDiv option:selected").val() == "1") {
  542. jQuery("#giveAttachments").hide();
  543. jQuery("#p_Attach1").show();
  544. } else {
  545. jQuery("#giveAttachments").show();
  546. jQuery("#p_Attach1").hide();
  547. }
  548. }
  549. function inputDataSet() {
  550. jQuery("#perpayReqDiv").attr("disabled", true);
  551. if (jQuery("#perpayReqDiv option:selected").val() == "1") {
  552. jQuery("#giveAmt").val("0"); //선급_포기금액_합계
  553. jQuery("#reqPrepayAmt").attr("readonly", true);
  554. jQuery("#reqPrepayAmt").css({'background-color' : '#dedede'});
  555. jQuery("#reqPrepayAmt").css({'border' : '1px solid #bcbcbc'});
  556. jQuery("#reqPrepayAmt").val(jQuery("#perpayAmt").val());
  557. jQuery("#giveSupplyTamt").val("0"); //선급_포기금액_과세
  558. jQuery("#reqPrepaySupplyTamt").attr("readonly", true);
  559. jQuery("#reqPrepaySupplyTamt").css({'background-color' : '#dedede'});
  560. jQuery("#reqPrepaySupplyTamt").css({'border' : '1px solid #bcbcbc'});
  561. jQuery("#reqPrepaySupplyTamt").val(jQuery("#subPrepaySupplyTamt").val());
  562. jQuery("#giveSupplyNamt").val("0"); //선급_포기금액_면세
  563. jQuery("#reqPrepaySupplyNamt").attr("readonly", true);
  564. jQuery("#reqPrepaySupplyNamt").css({'background-color' : '#dedede'});
  565. jQuery("#reqPrepaySupplyNamt").css({'border' : '1px solid #bcbcbc'});
  566. jQuery("#reqPrepaySupplyNamt").val(jQuery("#subPrepaySupplyNamt").val());
  567. jQuery("#giveSurtaxAmt").val("0"); //선급_포기금액_부가세
  568. //jQuery("#reqPrepaySurtaxAmt").attr("readonly", true);
  569. //jQuery("#reqPrepaySurtaxAmt").css({'background-color' : '#dedede'});
  570. //jQuery("#reqPrepaySurtaxAmt").css({'border' : '1px solid #bcbcbc'});
  571. //jQuery("#reqPrepaySurtaxAmt").val(jQuery("#subPrepaySurtaxAmt").val());
  572. jQuery("#givePercent").val("0.0");
  573. var reqPrepayAmt = jQuery("#reqPrepayAmt").val();
  574. reqPrepayAmt = reqPrepayAmt.replace(/(\,|\:)/g, "");
  575. var conAmt = jQuery("#conAmt").val();
  576. conAmt = conAmt.replace(/(\,|\:)/g, "");
  577. var givePercent = (reqPrepayAmt / conAmt) * 100;
  578. jQuery("#reqPrepayPercent").val(givePercent.toFixed(1));
  579. giveDataSet();
  580. warrCtr('S'); //S:보이기, H:숨기기
  581. } else if (jQuery("#perpayReqDiv option:selected").val() == "2") {
  582. jQuery("#reqPrepayAmt").attr("readonly", true);
  583. jQuery("#reqPrepayAmt").css({'background-color' : '#dedede'});
  584. jQuery("#reqPrepayAmt").css({'border' : '1px solid #bcbcbc'});
  585. jQuery("#reqPrepaySupplyTamt").attr("readonly", false);
  586. jQuery("#reqPrepaySupplyTamt").css({'background-color' : '#ffffff'});
  587. jQuery("#reqPrepaySupplyTamt").css({'border' : '1px solid #595a5a'});
  588. if (jQuery("#conSupplyNamt").val() == "0") {
  589. jQuery("#reqPrepaySupplyNamt").attr("readonly", true);
  590. jQuery("#reqPrepaySupplyNamt").css({'background-color' : '#dedede'});
  591. jQuery("#reqPrepaySupplyNamt").css({'border' : '1px solid #bcbcbc'});
  592. } else {
  593. jQuery("#reqPrepaySupplyNamt").attr("readonly", false);
  594. jQuery("#reqPrepaySupplyNamt").css({'background-color' : '#ffffff'});
  595. jQuery("#reqPrepaySupplyNamt").css({'border' : '1px solid #595a5a'});
  596. }
  597. //jQuery("#reqPrepaySurtaxAmt").attr("readonly", true);
  598. //jQuery("#reqPrepaySurtaxAmt").css({'background-color' : '#dedede'});
  599. //jQuery("#reqPrepaySurtaxAmt").css({'border' : '1px solid #bcbcbc'});
  600. jQuery("#reqPrepaySupplyTamt").val(jQuery("#orgReqPrepaySupplyTamt").val());
  601. jQuery("#reqPrepaySupplyNamt").val(jQuery("#orgReqPrepaySupplyNamt").val());
  602. jQuery("#reqPrepaySupplyTamt").blur();
  603. giveDataSet();
  604. warrCtr('S'); //S:보이기, H:숨기기
  605. } else if (jQuery("#perpayReqDiv option:selected").val() == "3") {
  606. jQuery("#reqPrepayAmt").val("0"); //선급_신청금액_합계
  607. jQuery("#reqPrepayAmt").attr("readonly", true);
  608. jQuery("#reqPrepayAmt").css({'background-color' : '#dedede'});
  609. jQuery("#reqPrepayAmt").css({'border' : '1px solid #bcbcbc'});
  610. jQuery("#giveAmt").val(jQuery("#perpayAmt").val());
  611. jQuery("#reqPrepaySupplyTamt").val("0"); //선급_신청금액_과세
  612. jQuery("#reqPrepaySupplyTamt").attr("readonly", true);
  613. jQuery("#reqPrepaySupplyTamt").css({'background-color' : '#dedede'});
  614. jQuery("#reqPrepaySupplyTamt").css({'border' : '1px solid #bcbcbc'});
  615. jQuery("#giveSupplyTamt").val(jQuery("#subPrepaySupplyTamt").val());
  616. jQuery("#reqPrepaySupplyNamt").val("0"); //선급_신청금액_면세
  617. jQuery("#reqPrepaySupplyNamt").attr("readonly", true);
  618. jQuery("#reqPrepaySupplyNamt").css({'background-color' : '#dedede'});
  619. jQuery("#reqPrepaySupplyNamt").css({'border' : '1px solid #bcbcbc'});
  620. jQuery("#giveSupplyNamt").val(jQuery("#subPrepaySupplyNamt").val());
  621. jQuery("#reqPrepaySurtaxAmt").val("0"); //선급_신청금액_부가세
  622. //jQuery("#reqPrepaySurtaxAmt").attr("readonly", true);
  623. //jQuery("#reqPrepaySurtaxAmt").css({'background-color' : '#dedede'});
  624. //jQuery("#reqPrepaySurtaxAmt").css({'border' : '1px solid #bcbcbc'});
  625. jQuery("#giveSurtaxAmt").val(jQuery("#subPrepaySurtaxAmt").val());
  626. jQuery("#reqPrepayPercent").val("0.0");
  627. var giveAmt = jQuery("#giveAmt").val();
  628. giveAmt = giveAmt.replace(/(\,|\:)/g, "");
  629. var conAmt = jQuery("#conAmt").val();
  630. conAmt = conAmt.replace(/(\,|\:)/g, "");
  631. var givePercent = (giveAmt / conAmt) * 100;
  632. jQuery("#givePercent").val(givePercent.toFixed(1));
  633. giveDataSet();
  634. //포기일때 보증정보는 필요없으므로 숨김처ㅣ
  635. warrCtr('H'); //S:보이기, H:숨기기
  636. }
  637. }
  638. function warrCtr(gubun) {
  639. if(jQuery("#statusCd").val() == "10" && jQuery("#warrWgno").val() == ""){
  640. jQuery('#warr1').hide();
  641. jQuery('#warr2').hide();
  642. }else{
  643. if (gubun == "H") { //숨김
  644. var warrWamt = jQuery("#warrWamt").val().replace(/(\,|\:)/g, "");
  645. if(warrWamt == "0" || warrWamt == ""){
  646. jQuery('#warr1').slideUp();
  647. jQuery('#warr2').slideUp();
  648. }else{
  649. alert("보증정보가 존재합니다.");
  650. }
  651. } else {
  652. jQuery('#warr1').show("slow");
  653. jQuery('#warr2').show("slow");
  654. }
  655. }
  656. }
  657. function reDisplay() {
  658. jQuery("#fevent").val("");
  659. jQuery("#form1").attr("action", "/payment/purchase/PrepaymentsAdd.screen");
  660. jQuery("#form1").attr("target", "_self");
  661. jQuery("#form1").attr("method", "post");
  662. jQuery("#form1").submit();
  663. }
  664. //저장 및 선급금 신청시 필수항목 Check
  665. function requiredItemsCheck() {
  666. var date1 = jQuery('#date1').val(); //작성일자(증빙일자)
  667. var userName = jQuery('#userName').val(); //담당자명
  668. var hp = jQuery('#hp').val(); //담당자 핸드폰번호
  669. var eMail = jQuery('#eMail').val(); //담당자 이메일
  670. if (date1 == "") {
  671. alert("입력필수입니다.");
  672. jQuery('#date1').focus();
  673. return false;
  674. }
  675. if (userName == "") {
  676. alert("담당자명은 입력필수입니다.");
  677. jQuery('#userName').focus();
  678. return false;
  679. }
  680. if (hp == "") {
  681. alert("담당자 핸드폰 번호는 입력필수입니다.");
  682. jQuery('#hp').focus();
  683. return false;
  684. } else {
  685. var rgEx = /(01[016789])[-](\d{4}|\d{3})[-]\d{4}$/g;
  686. var strValue = hp;
  687. var chkFlg = rgEx.test(strValue);
  688. if (!chkFlg) {
  689. alert("올바른 휴대폰번호가 아닙니다.");
  690. jQuery('#hp').focus();
  691. return false;
  692. }
  693. }
  694. if (eMail == "") {
  695. alert("담당자 이메일은 입력필수입니다.");
  696. jQuery('#eMail').focus();
  697. return false;
  698. } else {
  699. 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})(\]?)$/;
  700. if (!regEmail.test(eMail)) {
  701. alert('올바른 이메일 주소가 아닙니다.');
  702. jQuery('#eMail').focus();
  703. return false;
  704. }
  705. }
  706. if (jQuery("#btnAppReqSelect").val() == "1") { //선급금신청요청시에는 해당하는 첨부파일이 모두 등록되어있어야함.
  707. //01:작성중, 02:선급금 신청요청, 21:선금금 포기요청, 03:선급금 신청, 04:결재중, 10:선금완료, 11:포기완료, 91:반려
  708. if (jQuery("#perpayReqDiv").val() == "1") { //선급신청
  709. jQuery("#selectStatusCd").val("02");
  710. //선급금 포기각서 파일첨부 존재를 check한다.
  711. if(jQuery.trim(jQuery("#p_AttachFile1").text()) != "") {
  712. alert("선급금 포기각서 첨부가 존재합니다.");
  713. return false;
  714. }
  715. } else if (jQuery("#perpayReqDiv").val() == "2") { //부분신청
  716. jQuery("#selectStatusCd").val("02");
  717. /* if(jQuery("#warrWgno").val() != ""){
  718. var warrWamtValue = jQuery("#warrWamt").val().replace(/(\,|\:)/g, "");
  719. var reqPrepayAmtValue = jQuery("#reqPrepayAmt").val().replace(/(\,|\:)/g, "");
  720. if(reqPrepayAmtValue != warrWamtValue){
  721. alert("선급금신청금액과 보증금액이 다릅니다.");
  722. return false;
  723. }
  724. } */
  725. } else if (jQuery("#perpayReqDiv").val() == "3") { //포기신청
  726. jQuery("#selectStatusCd").val("02");
  727. /* if(jQuery("#warrWgno").val() != ""){
  728. alert("보증정보가 존재합니다.");
  729. return false;
  730. } */
  731. } else {
  732. alert("신청구분을 선택하세요");
  733. return;
  734. }
  735. }
  736. }
  737. function doResult(resultObj) {
  738. try {
  739. if (resultObj.getRequestEvent() == "SAVE_DATA" || resultObj.getRequestEvent() == "SAVE_SEGUM" || resultObj.getRequestEvent() == "SAVE_GUA" ) {
  740. if (resultObj.getSuccess()) {
  741. document.form1.isSubmit = false;
  742. if (jQuery("#btnAppReqSelect").val() == "0") {
  743. alert("저장되었습니다.");
  744. reSearch();
  745. } else if (jQuery("#btnAppReqSelect").val() == "1"){
  746. jQuery("#btnAppReqSelect").val("0");
  747. btnAppReqProcess();
  748. } else {
  749. jQuery("#btnAppReqSelect").val("0");
  750. runApproval();
  751. }
  752. } else {
  753. dlgErrorMsg(resultObj);
  754. }
  755. document.form1.isSubmit = false;
  756. }
  757. if (resultObj.getRequestEvent() == "DELETE_DATA") {
  758. if (resultObj.getSuccess()) {
  759. alert("삭제되었습니다.");
  760. jQuery("#btnList").click();
  761. } else {
  762. dlgErrorMsg(resultObj);
  763. }
  764. document.form1.isSubmit = false;
  765. }
  766. if (resultObj.getRequestEvent() == "REQ_DATA") {
  767. if (resultObj.getSuccess()) {
  768. alert("신청요청하였습니다.");
  769. jQuery("#btnList").click();
  770. } else {
  771. dlgErrorMsg(resultObj);
  772. }
  773. document.form1.isSubmit = false;
  774. }
  775. if( resultObj.getRequestEvent() == "CHK_REJECT" ) {
  776. var vo = resultObj.getValueObject();
  777. var check = vo.get('checkFlag');
  778. if(check == 0){ //가능
  779. document.form1.isSubmit = false;
  780. runRejection();
  781. }else{
  782. document.form1.isSubmit = false;
  783. alert("이미 결제중입니다.");
  784. }
  785. }
  786. if( resultObj.getRequestEvent() == "CHK_APPVAR" ) {
  787. var vo = resultObj.getValueObject();
  788. var check = vo.get('checkFlag');
  789. if(check == 0){ //가능
  790. if(btn_flag == 'delete'){
  791. if (confirm("삭제 하시겠습니까?")) {
  792. jQuery("#fevent").val("DELETE_DATA");
  793. submitXmlRequest("/payment/purchase/PrepaymentsAdd_form.screen", "DELETE_DATA", f, "SUCCESS");
  794. }
  795. }else if(btn_flag == 'save'){
  796. //필수 입력항목 check
  797. if (requiredItemsCheck() == false) {
  798. return;
  799. }
  800. //입력데이터 저장
  801. if (confirm("저장 하시겠습니까?")) {
  802. submitXmlRequest("/payment/purchase/PrepaymentsAdd_form.screen", "SAVE_DATA", f, "SUCCESS");
  803. }
  804. }else{
  805. document.form1.isSubmit = false;
  806. if (jQuery("#btnAppReqSelect").val() == "2") { //Invoice결재
  807. runInvoice();
  808. } else {
  809. jQuery("#btnAppReqSelect").val("0");
  810. runApproval();
  811. }
  812. }
  813. }else{
  814. document.form1.isSubmit = false;
  815. alert("이미 결제중입니다.");
  816. }
  817. }
  818. if( resultObj.getRequestEvent() == "GET_RATE" ) {
  819. var vo = resultObj.getValueObject();
  820. document.form1.isSubmit = false;
  821. var rate = vo.get('rate');
  822. var rateAmt = vo.get('rateAmt');
  823. var rateVamt = vo.get('rateVamt');
  824. jQuery("#rateEx").val(rate);
  825. jQuery("#rateAmt").val(rateAmt);
  826. jQuery("#rateVamt").val(rateVamt);
  827. jQuery("#rateEx, #rateAmt, #rateVamt").each(function(index) {
  828. jQuery(this).val(jQuery(this).val().split(/(?=(?:\d{3})+(?:\.|$))/g).join(','));
  829. });
  830. }
  831. if (resultObj.getRequestEvent() == "GET_DATA") {
  832. if (resultObj.getSuccess()) {
  833. var subContId = resultObj.getValueObject().get("SUB_CONT_ID");
  834. if (subContId != "") {
  835. jQuery("#subContId").val(subContId);
  836. var causeCode = resultObj.getValueObject().get("CAUSECODE");
  837. jQuery("#causeCode").val("당초");
  838. var guarOnoffYn = resultObj.getValueObject().get("GUAR_ONOFF_YN");
  839. jQuery("#guarOnoffYn").val(guarOnoffYn);
  840. var warrGoffice = resultObj.getValueObject().get("WARR_GOFFICE");
  841. jQuery("#warrGoffice").val(warrGoffice);
  842. var guarStatus = resultObj.getValueObject().get("GUAR_STATUS");
  843. jQuery("#guarStatus").val(guarStatus);
  844. var paperDate = resultObj.getValueObject().get("PAPERDATE");
  845. jQuery("#paperDate").val(paperDate);
  846. var warrWgno = resultObj.getValueObject().get("WARR_WGNO");
  847. jQuery("#warrWgno").val(warrWgno);
  848. var warrWamt = resultObj.getValueObject().get("WARR_WAMT");
  849. jQuery("#warrWamt").val(warrWamt);
  850. jQuery("#warrWamt").each(function(index) {
  851. jQuery(this).val(jQuery(this).val().split(/(?=(?:\d{3})+(?:\.|$))/g).join(','));
  852. });
  853. var warrSdateEdate = resultObj.getValueObject().get("WARR_SDATE_EDATE");
  854. jQuery("#warrSdateEdate").val(warrSdateEdate);
  855. }
  856. } else {
  857. dlgErrorMsg(resultObj);
  858. }
  859. document.form1.isSubmit = false;
  860. }
  861. if( resultObj.getRequestEvent() == "RNNC_DATA" ) {
  862. if( resultObj.getSuccess() ) {
  863. alert("포기완료 되었습니다.");
  864. jQuery("#btnList").click();
  865. }else{
  866. dlgErrorMsg(resultObj);
  867. }
  868. document.form1.isSubmit = false;
  869. }
  870. } catch (errorObject) {
  871. showErrorDlg("doResult()", errorObject);
  872. }
  873. }
  874. //저장 후 선급신청 처리
  875. function btnAppReqProcess() {
  876. var f = document.form1;
  877. jQuery("#fevent").val("REQ_DATA");
  878. submitXmlRequest("/payment/purchase/PrepaymentsAdd_form.screen","REQ_DATA", f, "SUCCESS");
  879. }
  880. //상세화면 재조회
  881. function reSearch() {
  882. jQuery("#fevent").val("");
  883. jQuery("#form1").attr("action", "/payment/purchase/PrepaymentsAdd.screen");
  884. jQuery("#form1").attr("target", "_self");
  885. jQuery("#form1").attr("method", "post");
  886. jQuery("#form1").submit();
  887. }
  888. function doKeyPress() {
  889. if (event.keyCode == 13) {
  890. doSearch(document.all.sheet1)
  891. }
  892. }
  893. function calendar(thisDayObj) {
  894. dlgCalendar(thisDayObj);
  895. }
  896. //첨부파일
  897. function doAttachFile(obj, No) {
  898. if (obj.value == '') {
  899. //alert("After you have saved, you can attach a file.");
  900. alert("데이터를 저장 후, 파일을 첨부할 수가 있습니다.");
  901. } else if (obj.value != '') {
  902. var upLoadFlg = "Y";
  903. if (jQuery("#statusCd").val() == "04" || jQuery("#statusCd").val() == "10" || jQuery("#statusCd").val() == "11") { //선급금 상태값이 03:선급금신청, 04:결재중, 10:선급완료, 11:폰기완료면 다운만
  904. upLoadFlg = "N";
  905. }
  906. if('<%= user.get("ACCT_TYPE_CODE")%>' == "ADMIN"){
  907. upLoadFlg = "Y";
  908. }
  909. if (No == 1) {
  910. viewFileListNew('PREPAYMENTS_GIVEUP', obj.value, document.getElementById("p_AttachFile1"), upLoadFlg, "prepay/purchase/"+obj.value);
  911. } else if (No == 2) {
  912. viewFileListNew('TAX_BILL', obj.value, document.getElementById("p_AttachFile2"), upLoadFlg, "prepay/purchase/"+obj.value);
  913. } else if (No == 3) {
  914. viewFileListNew('PREPAYMENTS_INVOICE', obj.value, document.getElementById("p_AttachFile3"), upLoadFlg, "prepay/purchase/"+obj.value);
  915. } else {
  916. viewFileListNew('PREPAYMENTS_BILLING', obj.value, document.getElementById("p_AttachFile4"), upLoadFlg, "prepay/purchase/"+obj.value);
  917. }
  918. }
  919. }
  920. //보증정보 조회
  921. function callback_getContWarr() {
  922. var f = document.form1;
  923. jQuery("#fevent").val("GET_DATA");
  924. submitXmlRequest("/portal/payment/AdvencePayRequest_form.screen","GET_DATA", f, "VALUEOBJECT");
  925. }
  926. //보증정보팝업 호출
  927. function popContWarr(wG, wSeq, wCauseCd) {
  928. if (jQuery("#prepayId").val() == "") {
  929. alert("데이터를 저장 후, 보증정보를 입력할 수가 있습니다.");
  930. return;
  931. }
  932. var win_id = "contPurWarrPopup";
  933. var param = "";
  934. var param = "?purContModId=" + jQuery("#subContModId").val();
  935. var param = param + "&warrGubun=" + wG;
  936. var param = param + "&warrSeq=" + wSeq;
  937. var param = param + "&causeCode=" + wCauseCd;
  938. var param = param + "&viewDiv=PREPAY";
  939. var param = param + "&prepayId=" + jQuery("#prepayId").val();
  940. var param = param + "&pop_win_id=" + win_id;
  941. var param = param + "&sModule=EB";
  942. var url = "/portal/guar/contPurWarrPopup.screen"+param;
  943. fLayerPop(win_id, url, 560,350, '','', 'NO');
  944. }
  945. //보증정보팝업 종료후 액션
  946. function popContWarrClose(returnValue){
  947. if(returnValue == null){
  948. fLayerPopClose('contPurWarrPopup');
  949. }else{
  950. fLayerPopClose('contPurWarrPopup');
  951. reDisplay();
  952. }
  953. }
  954. function doAttachFilePop(obj, No, fObj, fileGB, fileDir) {
  955. var editFile = "";
  956. if(obj==''){
  957. alert("After you have saved, you can attach a file.");
  958. }
  959. else if(obj != ''){
  960. if(fObj.guarStatus.value != "02"){editFile="N";}else{editFile="Y";}
  961. if('<%= user.get("ACCT_TYPE_CODE")%>' == "ADMIN"){
  962. editFile = "Y";
  963. }
  964. viewFileListNew(fileGB, obj.value, fObj.p_AttachFileGuar1, editFile, fileDir, "contPurWarrPopup");
  965. }
  966. }
  967. //결재
  968. function dlgSignForm( sign_class_cd, uri ) {
  969. var f = document.form1;
  970. var sheet1 = document.all.sheet1;
  971. var tmpslip_prepayId = f.prepayId.value;
  972. var tmpslip_subContModId = f.subContModId.value;
  973. var url = "/slipSign/preSign_form.screen";
  974. url += "?sign_class_cd=" + sign_class_cd;
  975. url += "&uri=" + uri;
  976. url += "&tmpslip_prepayId=" + tmpslip_prepayId;
  977. url += "&tmpslip_subContModId=" + tmpslip_subContModId;
  978. url += "&slip_dept=" + f.dept_cd.value;
  979. url += "&slip_dt=" + f.date1.value;
  980. url += "&acct_type=1";
  981. if(confirm("결재 하시겠습니까?") ){
  982. //f.slip_dt.value = '';
  983. //f.sign_chk.value = "Y";
  984. //openWindowCenter(url, "sign_form", 200, 100, "");
  985. window.open(url, "_blank","width=200,height=100,SCROLLBARS=no");
  986. }else{
  987. return;
  988. }
  989. }
  990. function runApproval(){
  991. document.form1.isSubmit = false;
  992. var f = document.form1;
  993. var tmpslip_prepayId = f.prepayId.value;
  994. var tmpslip_subContModId = f.subContModId.value;
  995. dlgSignForm('ebid_pprpyD', '/payment/purchase/PreRequestSign.screen?tmpslip_prepayId='+tmpslip_prepayId+'^tmpslip_subContModId='+tmpslip_subContModId+'^acct_type=1^sign_type=1' );
  996. }
  997. function runRejection(){
  998. var win_id = "Rejection";
  999. var link = "/payment/outside/RejectionPopup.screen";
  1000. link += "?pop_win_id="+win_id;
  1001. link += "&prepayId=" + jQuery("#prepayId").val();
  1002. link += "&pageDiv=3"
  1003. fLayerPop(win_id, link, 620, 220, '', '', 'NO');
  1004. }
  1005. //
  1006. function runInvoice(){
  1007. var f = document.form1;
  1008. jQuery("#btnAppReqSelect").val("2"); //0:저장처리, 1:선급신청처리
  1009. jQuery("#fevent").val("SAVE_DATA");
  1010. submitXmlRequest("/payment/purchase/PrepaymentsAdd_form.screen", "SAVE_DATA", f, "SUCCESS");
  1011. }
  1012. function RejectionPopupClose(){
  1013. //alert();
  1014. setTimeout(function(){fLayerPopClose('Rejection');},100);
  1015. reDisplay();
  1016. }
  1017. /**
  1018. * 첨부파일 예약 함수
  1019. */
  1020. function fileDown(file_id){
  1021. var url="/common/file/FileDownloadServlet";
  1022. url += "?file_id=" + file_id;
  1023. 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")
  1024. }
  1025. function gubSave(div){
  1026. if(div == '0'){ //분계유형저장
  1027. var pKey = jQuery("#subContModId").val();
  1028. var f = document.form1;
  1029. jQuery("#pKey").val(pKey);
  1030. //분계유형 저장
  1031. if (confirm("분계유형을 저장 하시겠습니까?")) {
  1032. jQuery("#fevent").val("SAVE_GUA");
  1033. submitXmlRequest("/payment/purchase/PrepaymentsAdd_form.screen", "SAVE_GUA", f, "SUCCESS");
  1034. }
  1035. }else{
  1036. var pKey = jQuery("#prepayId").val();
  1037. var f = document.form1;
  1038. jQuery("#pKey").val(pKey);
  1039. //세금계산서정보 저장
  1040. if (confirm("세금계산서정보을 저장 하시겠습니까?")) {
  1041. jQuery("#fevent").val("SAVE_SEGUM");
  1042. submitXmlRequest("/payment/purchase/PrepaymentsAdd_form.screen", "SAVE_SEGUM", f, "SUCCESS");
  1043. }
  1044. }
  1045. }
  1046. </SCRIPT>
  1047. <modular:search id="form1">
  1048. <modular:key id="fevent" />
  1049. </modular:search>
  1050. <form id="form1" name="form1" method="post" modular:type="search">
  1051. <INPUT type="hidden" name="fevent" id="fevent" value="">
  1052. <INPUT type="hidden" name="selectSubContModId" id="selectSubContModId" value="<%=params.get("selectSubContModId") %>">
  1053. <INPUT type="hidden" name="subContModId" id="subContModId" value="<%=prePayment.get("SUB_CONT_MOD_ID") %>">
  1054. <INPUT type="hidden" name="prepayId" id="prepayId" value="<%=prePayment.get("PREPAY_ID") %>">
  1055. <INPUT type="hidden" name="corpId" id="corpId" value="<%=prePayment.get("CON_CORP_ID") %>">
  1056. <INPUT type="hidden" name="orgReqPrepaySupplyTamt" id="orgReqPrepaySupplyTamt" value="<%=prePayment.get("REQ_PREPAY_SUPPLY_TAMT") %>">
  1057. <INPUT type="hidden" name="orgReqPrepaySupplyNamt" id="orgReqPrepaySupplyNamt" value="<%=prePayment.get("REQ_PREPAY_SUPPLY_NAMT") %>">
  1058. <INPUT type="hidden" name="statusCd" id="statusCd" value="<%=prePayment.get("STATUS_CD") %>">
  1059. <INPUT type="hidden" name="subContId" id="subContId" value="<%=prePayment.get("SUB_CONT_ID") %>">
  1060. <INPUT type="hidden" name="btnAppReqSelect" id="btnAppReqSelect" value="0">
  1061. <INPUT type="hidden" name="lastDate" id="lastDate" value="">
  1062. <!-- 기성신청상태구분 -->
  1063. <INPUT type="hidden" name="selectStatusCd" id="selectStatusCd" value="">
  1064. <!-- 기성신청상태 -->
  1065. <INPUT type='hidden' id="signeddata" name="signeddata" value="">
  1066. <INPUT type="hidden" name="creBy" id="creBy" value="<%=creby %>">
  1067. <INPUT type="hidden" name="updBy" id="updBy" value="<%=updby %>">
  1068. <!-- 리스트 페이지 검색 조건 -->
  1069. <INPUT type='hidden' id="searchBuildName" name="searchBuildName" value="<%=params.get("searchBuildName") %>"> <!-- 계약명 -->
  1070. <INPUT type='hidden' id="searchStatusCd" name="searchStatusCd" value="<%=params.get("searchStatusCd") %>"> <!-- 상태값 -->
  1071. <INPUT type='hidden' id="searchDeptCd" name="searchDeptCd" value="<%=params.get("searchDeptCd") %>">
  1072. <INPUT type='hidden' id="searchDeptNm" name="searchDeptNm" value="<%=params.get("searchDeptNm") %>">
  1073. <INPUT type='hidden' id="searchSignDt_from" name="searchSignDt_from" value="<%=params.get("searchSignDt_from") %>">
  1074. <INPUT type='hidden' id="searchSignDt_to" name="searchSignDt_to" value="<%=params.get("searchSignDt_to") %>">
  1075. <INPUT type='hidden' id="pKey" name="pKey" value="">
  1076. <INPUT type='hidden' id="dept_cd" name="dept_cd" value="<%=prePayment.get("dept_cd") %>"> <!-- 현장코드 -->
  1077. <INPUT type='hidden' id="resUserName" name="resUserName" value="<%=prePayment.get("RES_USER_NAME") %>"> <!-- 계약담당자 -->
  1078. <INPUT type='hidden' id="resHp" name="resHp" value="<%=prePayment.get("RES_HP") %>"> <!-- 계약담당자 핸드폰번호 -->
  1079. <INPUT type='hidden' id="resEmail" name="resEmail" value="<%=prePayment.get("RES_EMAIL") %>"> <!-- 계약담당자 이메일 -->
  1080. <INPUT type='hidden' id="resDivision" name="resDivision" value="<%=prePayment.get("RES_DIVISION") %>">
  1081. <INPUT type='hidden' id="conDocNo" name="conDocNo" value="<%=prePayment.get("CON_DOC_NO") %>"> <!-- 발주계약번호 -->
  1082. <INPUT type="hidden" name="bugase" id="bugase" value="<%=prePayment.get("CHG_CODE10") %>">
  1083. <!-- 제목 및 버튼 -->
  1084. <table width="100%">
  1085. <colgroup>
  1086. <col width="500" />
  1087. <col width="*" />
  1088. </colgroup>
  1089. <tr>
  1090. <th>
  1091. <div align="left" id="title">
  1092. <ul>
  1093. <li>구매_선급금현황 상세(<span style="font-size: 11px"><%=prePayment.get("STATUS_NM")%></span>)</li>
  1094. </ul>
  1095. </div>
  1096. </th>
  1097. <td align="right">
  1098. <span id="spanBtnSave" class="btnSearch center" style="display: none"><a href="javascript:void(0);" id="btnSave">저장</a></span>
  1099. <span id="spanBtnDelete" class="btnSearch center" style="display: none"><a href="javascript:void(0);" id="btnDelete">삭제</a></span>
  1100. <span id="spanBtnAppReq" class="btnSearch center" style="display: none"><a href="javascript:void(0);" id="btnText">신청요청</a></span>
  1101. <span id="spanComRnnc" class="btnSearch center" style="display: none"><a href="javascript:void(0);" id="btnComRnnc">선급금 포기완료</a></span>
  1102. <span id="spanBtnApproval" class="btnSearch center" style="display: none"><a href="javascript:void(0);" id="btnApproval">결재</a></span>
  1103. <span id="spanBtnInvoiceApproval" class="btnSearch center" style="display: none"><a href="javascript:void(0);" id="btnInvoiceApproval">결재</a></span>
  1104. <span id="spanBtnRejection" class="btnSearch center" style="display: none"><a href="javascript:void(0);" id="btnRejection">반려</a></span>
  1105. <span id="spanBtnList" class="btnSearch center" style="display: none"><a href="javascript:void(0);" id="btnList">목록</a></span>
  1106. </td>
  1107. </tr>
  1108. </table>
  1109. <%
  1110. if(!prePayment.get("RTN_REASON").equals("")){
  1111. %>
  1112. <div class="application-info magT10">
  1113. <div class="application-sub-title">
  1114. <span class="title">반려정보</span>
  1115. </div>
  1116. <div class="application-location"></div>
  1117. </div>
  1118. <TABLE class="form-table">
  1119. <colgroup>
  1120. <col width="13%" />
  1121. <col width="*" />
  1122. </colgroup>
  1123. <TR height="25">
  1124. <th style="text-align: left;">반려일</th>
  1125. <TD><%=prePayment.get("RTN_DATE")%></TD>
  1126. </TR>
  1127. <TR>
  1128. <th style="text-align: left;">반려사유</th>
  1129. <TD><%=prePayment.get("RTN_REASON")%></TD>
  1130. </TR>
  1131. </TABLE>
  1132. <%
  1133. }else if(!prePayment.get("TAX_RTN_REASON").equals("")){
  1134. %>
  1135. <div class="application-info magT10">
  1136. <div class="application-sub-title">
  1137. <span class="title">반려정보</span>
  1138. </div>
  1139. <div class="application-location"></div>
  1140. </div>
  1141. <TABLE class="form-table">
  1142. <colgroup>
  1143. <col width="13%" />
  1144. <col width="*" />
  1145. </colgroup>
  1146. <TR height="25">
  1147. <th style="text-align: left;">반려일</th>
  1148. <TD><%=prePayment.get("TAX_RTN_DATE")%></TD>
  1149. </TR>
  1150. <TR>
  1151. <th style="text-align: left;">반려사유</th>
  1152. <TD><%=prePayment.get("TAX_RTN_REASON")%></TD>
  1153. </TR>
  1154. </TABLE>
  1155. <%
  1156. }
  1157. %>
  1158. <div class="application-info magT10">
  1159. <div class="application-sub-title">
  1160. <span class="title">기본정보</span>
  1161. </div>
  1162. <div class="application-location"></div>
  1163. </div>
  1164. <TABLE class="form-table">
  1165. <colgroup>
  1166. <col width="13%" />
  1167. <col width="20%" />
  1168. <col width="13%" />
  1169. <col width="20%" />
  1170. <col width="13%" />
  1171. <col width="*" />
  1172. </colgroup>
  1173. <TR height="25">
  1174. <th style="text-align: left;">현장명</th>
  1175. <TD><%= InputText.get("deptName", prePayment.get("DEPT_NAME"), 100, 30, "class=input_blank, readOnly=white, string, left, perSize, tabIndex=-1", "string") %></TD>
  1176. <th style="text-align: left;">계약명</th>
  1177. <TD><%= InputText.get("buildName", prePayment.get("BUILD_NAME"), 100, 30, "class=input_blank, readOnly=white, string, left, perSize, tabIndex=-1", "string") %></TD>
  1178. <th style="text-align: left;">통화</th>
  1179. <TD><%= InputText.get("conCurCd", prePayment.get("CON_CUR_CD"), 100, 30, "class=input_blank, readOnly=white, string, left, perSize, tabIndex=-1", "string") %></TD>
  1180. </TR>
  1181. <TR>
  1182. <th style="text-align: left;">사업자번호</th>
  1183. <TD><%= InputText.get("vendCd", prePayment.get("CORP_REG_NO"), 100, 30, "class=input_blank, readOnly=white, string, left, perSize, tabIndex=-1", "string") %></TD>
  1184. <th style="text-align: left;">계약업체명</th>
  1185. <TD><%= InputText.get("memberName", prePayment.get("CORP_KOR"), 100, 30, "class=input_blank, readOnly=white, string, left, perSize, tabIndex=-1", "string") %></TD>
  1186. <th style="text-align: left;">대표이사</th>
  1187. <TD><%= InputText.get("bossName", prePayment.get("BOSS_NAME"), 100, 30, "class=input_blank, readOnly=white, string, left, perSize, tabIndex=-1", "string") %></TD>
  1188. </TR>
  1189. <TR>
  1190. <th style="text-align: left;">공사기간</th>
  1191. <TD><%= InputText.get("startEndWorkDate", prePayment.get("START_END_WORK_DATE"), 100, 30, "class=input_blank, readOnly=white, string, left, perSize, tabIndex=-1", "string") %></TD>
  1192. <th style="text-align: left;">계약금액</th>
  1193. <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>
  1194. <th style="text-align: left;">선급금액</th>
  1195. <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>
  1196. </TR>
  1197. </TABLE>
  1198. <%
  1199. // PayGroup_PaymentTerms Mapping Object 구하기
  1200. ContCodeManager payGroupMappingUtil = new ContCodeManager();
  1201. storage.addObject("category", payGroupMappingUtil.getJSONNotation());
  1202. String category = (String)storage.getObject("category");
  1203. //System.out.println(category);
  1204. %>
  1205. <script>
  1206. var gCategoryJSON = null;
  1207. var rawData = <%= category%>; // 서버로부터 JSON 표현식 받기
  1208. gCategoryJSON = eval( rawData ); // JSON객체를 만들어 global 변수에 저장
  1209. function changePaymentTerms(selObj) {
  1210. var ct = getCategory(selObj.value); // JSON 객체에서 해당하는 PAYMENT TERMS 데이타 꺼내기
  1211. if (!ct) {
  1212. dlgAlert('오류가 발생하였습니다.<br>전산실로 연락주세요.');
  1213. return false;
  1214. }
  1215. injectSelect(document.getElementById("payment_terms_id"), ct); // PAYMENT TERMS Select Box 채우기
  1216. jQuery('#payment_terms_id').attr('disabled', 'true');
  1217. }
  1218. // JSON 객체에서 해당하는 PAYMENT TERMS 데이타 꺼내기
  1219. function getCategory(payGroup) {
  1220. return gCategoryJSON.paymentTerms[payGroup];
  1221. }
  1222. //직군 데이타를 Select Box에 주입
  1223. function injectSelect(elSel, rows) {
  1224. elSel.length = 0; // clear
  1225. for (var i=0; i<rows.length; i++) {
  1226. var row = rows[i];
  1227. var elOptNew = document.createElement('option');
  1228. elOptNew.value = row.CODE; // 코드
  1229. elOptNew.text = row.NAME; // 명칭
  1230. try {
  1231. elSel.add(elOptNew, null); // standards compliant; doesn't work in IE
  1232. } catch(ex) {
  1233. elSel.add(elOptNew); // IE only
  1234. }
  1235. if(jQuery("#payTerms").val() == row.CODE){
  1236. elSel.options[i].selected = true;
  1237. }
  1238. }
  1239. }
  1240. /**
  1241. * 집행내역코드 검색(공무)
  1242. */
  1243. function popSearchPayItem()
  1244. {
  1245. var win_id = "_searchPayItemPopup";
  1246. var link = "/cont/outside/payItemCodePopup.screen";
  1247. link += "?pop_win_id="+win_id;
  1248. link += "&gb=SUB";
  1249. link += "&req=0";
  1250. link += "&site=" + document.form1.dept_cd.value;
  1251. fLayerPop(win_id, link, 600,400, '', '', 'NO');
  1252. }
  1253. //f.dept_cd, f.pay_item, f.cost_code, f.cost_type, f.estdesc, '', f.estamt
  1254. function SearchPayItemClose(result){
  1255. if(result != null){
  1256. $("#pay_item").val(result[0]);
  1257. $("#cost_code").val(result[1]);
  1258. $("#cost_type").val(result[2]);
  1259. $("#estdesc").val(result[3]);
  1260. //obj_estamt.value = result[4];
  1261. }
  1262. fLayerPopClose('_searchPayItemPopup');
  1263. }
  1264. function chProofCd(obj){
  1265. //통화가KRW가 아니고 분계유형에 증빙종류[기타]이면 invlice고정
  1266. var conCurCd = jQuery("#conCurCd").val();
  1267. var proof_cd = obj.value
  1268. if(conCurCd != "KRW"){
  1269. if(proof_cd == "Z99"){
  1270. jQuery("#chk_2").prop("checked", false);
  1271. jQuery("#chk_3").prop("checked", true);
  1272. jQuery("#chk_2").attr("disabled",true);
  1273. jQuery("#chk_3").attr("disabled",false);
  1274. btnCtr();
  1275. }else if(proof_cd != "Z99"){
  1276. jQuery("#chk_2").prop("checked", true);
  1277. jQuery("#chk_3").prop("checked", false);
  1278. jQuery("#chk_2").attr("disabled",false);
  1279. jQuery("#chk_3").attr("disabled",true);
  1280. btnCtr();
  1281. }
  1282. var radioCheck = jQuery(':radio[name="chk_info"]:checked').val(); //세금계산서 발행방법
  1283. if (radioCheck == "2"){ //순발행
  1284. jQuery("#taxAttachments").show();
  1285. jQuery("#taxTrRow").show();
  1286. jQuery("#invoiceAttachments").hide();
  1287. jQuery("#invoiceTrRow").hide();
  1288. }else{
  1289. jQuery("#taxAttachments").hide();
  1290. jQuery("#taxTrRow").hide();
  1291. jQuery("#invoiceAttachments").show();
  1292. jQuery("#invoiceTrRow").show();
  1293. }
  1294. }
  1295. }
  1296. </script>
  1297. <!-- 분개유형 -->
  1298. <div class="application-info magT10">
  1299. <div class="application-sub-title">
  1300. <span class="title">분개유형</span>
  1301. </div>
  1302. <div class="application-location">
  1303. <span id="spanGubSave" class="btnSearch center" style="display: none"><!-- <a href="javascript:void(0);" onclick="gubSave('0');" id="btnGubSave">분계유형저장</a> --></span>
  1304. </div>
  1305. </div>
  1306. <TABLE class="form-table">
  1307. <colgroup>
  1308. <col width="13%" />
  1309. <col width="20%"/>
  1310. <col width="13%" />
  1311. <col width="20%"/>
  1312. <col width="13%" />
  1313. <col width="*" />
  1314. </colgroup>
  1315. <TR height="25">
  1316. <TH>분개유형</TH>
  1317. <%-- <TD><%= ContCodeManager.getCcsifSelectCodeList("SUB_ACCT_GB", "acct_gb", "width:100%;", "", ContInfo.get("acct_gb")) %></TD> --%> <!-- 외주 분계유형 -->
  1318. <TD><%= ContCodeManager.getCcsifSelectCodeList("PUR-ACCT_GB", "acct_gb", "width:100%;", "", ContInfo.get("acct_gb"), ContInfo.get("dept_cd"), ContInfo.get("pay_div")) %></TD>
  1319. <TH>증빙종류</TH>
  1320. <TD><%= ContCodeManager.getProofCdSelectTag("proof_cd", "width:100%;", "onchange=chProofCd(this);", "", ContInfo.get("GUA_GB"), "Y") %></TD>
  1321. <TH>PAY GROUP</TH>
  1322. <input type="hidden" id="payTerms" name="payTerms" value="<%=ContInfo.get("PAYMENT_TERMS")%>">
  1323. <TD><%= ContCodeManager.getPayGroupSelectTag("pay_group", "width:100%;", "onchange=changePaymentTerms(this);", "", ContInfo.get("pay_group"), ContInfo.get("ac_unit_cd")) %></TD>
  1324. </TR>
  1325. <TR height="25">
  1326. <TH>PAYMENT TERMS</TH>
  1327. <TD>
  1328. <SELECT class='input_select' id='payment_terms_id' name='payment_terms_id' style='width:100%;'>
  1329. </SELECT>
  1330. </TD>
  1331. <TH>집행유형</TH>
  1332. <TD colspan="3">
  1333. <%= InputText.get("payItemNm", ContInfo.get("PAY_ITEM_NM"), 98, 30, "class=input_blank, readOnly=white, string, left, perSize, tabIndex=-1", "string") %>
  1334. </TD>
  1335. </TR>
  1336. </TABLE>
  1337. <script>
  1338. changePaymentTerms(document.form1.pay_group);
  1339. setSelect(document.form1.payment_terms_id, '<%= ContInfo.get("payment_terms") %>');
  1340. </script>
  1341. <div class="application-info magT10">
  1342. <div class="application-sub-title">
  1343. <span class="title">세금계산서 정보</span>
  1344. </div>
  1345. <div class="application-location">
  1346. <span id="spanTaxSave" class="btnSearch center" style="display: none"><a href="javascript:void(0);" onclick="gubSave('1');" id="btnGubSave">세금계산서저장</a></span>
  1347. </div>
  1348. </div>
  1349. <TABLE class="form-table">
  1350. <colgroup>
  1351. <col width="13%" />
  1352. <col width="20%" />
  1353. <col width="13%" />
  1354. <col width="20%" />
  1355. <col width="13%" />
  1356. <col width="*" />
  1357. </colgroup>
  1358. <TR>
  1359. <th style="text-align: left;">세금계산서 발행방법</th>
  1360. <TD colspan="3">
  1361. <input type="radio" id="chk_2" name="chk_info" value="2" onclick="taxDataSet();" <%= check2 %>>&nbsp;순발행(업체직접 발행)
  1362. &nbsp;<input type="radio" id="chk_3" name="chk_info" value="3" onclick="taxDataSet();" <%= check3 %>>&nbsp;Invoice
  1363. </TD>
  1364. <th style="text-align: left;">작성일자(증빙일자)</th>
  1365. <TD><%= InputText.get("date1", Formatter.formatDate(prePayment.get("TAX_DY"), "-"), 30, 10, "Center, date, PerSize, readonly", "date", "") %>
  1366. <A href="JavaScript:calendar('date1');"><IMG src="/img/supplier/template/bt_calender.gif" alt="달력" border="0" align="absmiddle"></A>
  1367. </TD>
  1368. </TR>
  1369. <TR>
  1370. <th class="required" style="text-align: left;">담당자명</th>
  1371. <TD><%= InputText.get("userName", taxChargNm, 98, 6, "string, left, perSize", "string") %></TD>
  1372. <th class="required" style="text-align: left;">담당자 핸드폰번호</th>
  1373. <TD><input type="text" class="input" id="hp" name="hp" value="<%=taxChargHp %>" style="width: 44%" size="13" maxlength="13" alt="left">&nbsp;ex)010-0000-0000</TD>
  1374. <th class="required" style="text-align: left;">담당자 이메일</th>
  1375. <TD><%= InputText.get("eMail", taxChargEmail, 98, 40, "string, left, perSize", "string") %></TD>
  1376. </TR>
  1377. <TR>
  1378. <TH>환율</th>
  1379. <TD>
  1380. <%= InputText.get("rateEx", Formatter2.currency(prePayment.get("rateEx"), intDigit), 98, 30, "class=input_blank, readOnly=white, string, left, perSize, tabIndex=-1", "string") %>
  1381. </TD>
  1382. <TH>환율연산금액</th>
  1383. <TD colspan="3">공급가:<%= InputText.get("rateAmt", Formatter2.currency(prePayment.get("rateAmt"), intDigit), 20, 30, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %>, 부가세:<%= InputText.get("rateVamt", Formatter2.currency(prePayment.get("rateVamt"), intDigit), 20, 30, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %>
  1384. </TD>
  1385. </TR>
  1386. </TABLE>
  1387. <!-- 세금계산서정보 : 끝 -->
  1388. <div class="application-info magT15">
  1389. <div class="application-sub-title">
  1390. <span class="title">선급금정보</span>
  1391. </div>
  1392. </div>
  1393. <TABLE class="form-table">
  1394. <colgroup>
  1395. <col width="5%" />
  1396. <col width="20%" />
  1397. <col width="13%" />
  1398. <col width="20%" />
  1399. <col width="13%" />
  1400. <col width="*" />
  1401. </colgroup>
  1402. <TR>
  1403. <th style="text-align: left;">신청구분</th>
  1404. <TD colspan="5"><%= HTMLMaker.getSelectTag(perpayReqDivComboList, "DETAILCD", "DETAILNM", "perpayReqDiv", "width:30%;height=18;' onChange='inputDataSet();", "", prePayment.get("REQ_DIV_CD")) %></TD>
  1405. </TR>
  1406. </TABLE>
  1407. <img src="/img/com/blank.gif" height="10px" />
  1408. <TABLE class="form-table" style="table-layout: fixed;">
  1409. <colgroup>
  1410. <col width="10%">
  1411. <col width="10%">
  1412. <col width="20%">
  1413. <col width="10%">
  1414. <col width="10%">
  1415. <col width="10%">
  1416. <col width="10%">
  1417. <col width="10%">
  1418. <col width="*">
  1419. </colgroup>
  1420. <TR>
  1421. <th rowspan="1" colspan="2" style="text-align: center;">구분</th>
  1422. <th rowspan="1" style="text-align: center;">합계</Th>
  1423. <th colspan="2" style="text-align: center;">공급가액</Th>
  1424. <th colspan="2" style="text-align: center;">부가세</Th>
  1425. <th colspan="2" style="text-align: center;">요율</Th>
  1426. </TR>
  1427. <TR>
  1428. <th rowspan="2" style="text-align: center;">계약</Th>
  1429. <th style="text-align: center;">계약금액</Th>
  1430. <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>
  1431. <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>
  1432. <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>
  1433. <TD colspan="2" align="right"><%= InputText.get("conAmtPercent", "100.0", 98, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %></TD>
  1434. </TR>
  1435. <TR>
  1436. <th style="text-align: center;">선급금액</Th>
  1437. <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>
  1438. <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>
  1439. <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>
  1440. <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>
  1441. </TR>
  1442. <TR>
  1443. <th rowspan="3" style="text-align: center;">선급</Th>
  1444. <th style="text-align: center;">기선급금액</Th>
  1445. <TD align="right"><%= InputText.get("befRreqPrepayAmt", Formatter2.currency(prePayment.get("BEF_REQ_PREPAY_AMT"), intDigit), 98, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %></TD>
  1446. <TD colspan="2" align="right"><%= InputText.get("befReqPrepaySupplyAmt", Formatter2.currency(prePayment.get("BEF_REQ_PREPAY_SUPPLY_AMT"), intDigit), 98, 16, "class=input_blank,readOnly=white, string, right, perSize", "string") %></TD>
  1447. <TD colspan="2" align="right"><%= InputText.get("befReqPrepaySurtaxAmt", Formatter2.currency(prePayment.get("BEF_REQ_PREPAY_SURTAX_AMT"), intDigit), 98, 16, "class=input_blank,readOnly=white, string, right, perSize", "float") %></TD>
  1448. <TD colspan="2" align="right"><%= InputText.get("befReqPrepayPercent", prePayment.get("BEF_REQ_PREPAY_PERCENT"), 98, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %></TD>
  1449. </TR>
  1450. <TR>
  1451. <th style="text-align: center;">신청금액</Th>
  1452. <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>
  1453. <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>
  1454. <TD colspan="2" align="right"><%= InputText.get("reqPrepaySurtaxAmt", Formatter2.currency(prePayment.get("REQ_PREPAY_SURTAX_AMT"), intDigit), 98, 16, "class=input byteChk ,float, right, perSize", "float") %></TD>
  1455. <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>
  1456. </TR>
  1457. <TR>
  1458. <th style="text-align: center;">포기금액</Th>
  1459. <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>
  1460. <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>
  1461. <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>
  1462. <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>
  1463. </TR>
  1464. </TABLE>
  1465. <div class="application-info magT15">
  1466. <div class="application-sub-title">
  1467. <span class="title">첨부파일</span>
  1468. </div>
  1469. </div>
  1470. <!-- 첨부파일 : 시작 -->
  1471. <TABLE class="form-table">
  1472. <colgroup>
  1473. <col width="5%">
  1474. <col width="6%">
  1475. <col width="11%">
  1476. <col width="11%">
  1477. <col width="11%">
  1478. <col width="11%">
  1479. <col width="11%">
  1480. <col width="11%">
  1481. <col width="*">
  1482. </colgroup>
  1483. <TR>
  1484. <th colspan="2" style="text-align: center;">구분</Th>
  1485. <th colspan="5" style="text-align: center;">첨부파일명</Th>
  1486. <th colspan="2" style="text-align: center;">다운로드</Th>
  1487. </TR>
  1488. <TR>
  1489. <TD colspan="2">선급금 포기각서<span id="p_Attach1">(해당없음)</span></TD>
  1490. <%-- <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> --%>
  1491. <TD colspan="5" align="left">
  1492. <table width="100%">
  1493. <colgroup>
  1494. <col width="99%" />
  1495. </colgroup>
  1496. <tr>
  1497. <td>
  1498. <div id="p_AttachFile1" class="attach_file_view">
  1499. <%=FileManager.getFileListForDiv("PREPAYMENTS_GIVEUP", prePayment.get("PREPAY_ID")) %>
  1500. </div>
  1501. </td>
  1502. <tr>
  1503. </table>
  1504. </TD>
  1505. <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>
  1506. </TR>
  1507. <TR id="taxTrRow">
  1508. <TD colspan="2" align="center">세금계산서</TD>
  1509. <%-- <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> --%>
  1510. <TD colspan="5" align="left">
  1511. <table width="100%">
  1512. <colgroup>
  1513. <col width="99%" />
  1514. </colgroup>
  1515. <tr>
  1516. <td>
  1517. <div id="p_AttachFile2" class="attach_file_view">
  1518. <%=FileManager.getFileListForDiv("TAX_BILL", prePayment.get("PREPAY_ID")) %>
  1519. </div>
  1520. </td>
  1521. <tr>
  1522. </table>
  1523. </TD>
  1524. <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>
  1525. </TR>
  1526. <TR id="invoiceTrRow">
  1527. <TD colspan="2" align="center">Invoice</TD>
  1528. <TD colspan="5" align="left">
  1529. <table width="100%">
  1530. <colgroup>
  1531. <col width="99%" />
  1532. </colgroup>
  1533. <tr>
  1534. <td>
  1535. <div id="p_AttachFile3" class="attach_file_view">
  1536. <%=FileManager.getFileListForDiv("PREPAYMENTS_INVOICE", prePayment.get("PREPAY_ID")) %>
  1537. </div>
  1538. </td>
  1539. <tr>
  1540. </table>
  1541. </TD>
  1542. <TD colspan="2" style="text-align: center;"><span id="invoiceAttachments"><IMG id='search_spot_button' onClick="doAttachFile(document.form1.prepayId,3);" src='/img/buyer/button/bt_change.gif' border='0' align="top" align='absmiddle' alt='[Attach File]' style='cursor:pointer;'></TD>
  1543. </TR>
  1544. <TR>
  1545. <TD colspan="2">대금청구</TD>
  1546. <TD colspan="5" align="left">
  1547. <table width="100%">
  1548. <colgroup>
  1549. <col width="99%" />
  1550. </colgroup>
  1551. <tr>
  1552. <td>
  1553. <div id="p_AttachFile4" class="attach_file_view">
  1554. <%=FileManager.getFileListForDiv("PREPAYMENTS_BILLING", prePayment.get("PREPAY_ID")) %>
  1555. </div>
  1556. </td>
  1557. <tr>
  1558. </table>
  1559. </TD>
  1560. <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>
  1561. </TR>
  1562. </TABLE>
  1563. <!-- 첨부파일 : 끝 -->
  1564. <%if(warrList.size()>0){%>
  1565. <%
  1566. /*
  1567. 보증 목록을 include 시킴 (2014-10-16) 김명호
  1568. */
  1569. %>
  1570. <%@ include file="/jsp/ko_KR/buyer/cont/purchase/guarList.jsp" %>
  1571. <%
  1572. }
  1573. %>
  1574. </FORM>