123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019 |
- <%--
- - FileName : prepayments.jsp
- - Author(s) : ok
- - Date : 2014.08.20
- - Copyright : Copyright (c) 2013 www.udapsoft.co.kr, Inc.
- - Description: 전자조달 선급금현황 상세(구매)
- --%>
- <%@ page contentType="text/html; charset=utf-8"%>
- <%@ page import="com.udapsoft.waf.system.HandlerStorage"%>
- <%@ page import="com.udapsoft.waf.common.ui.*"%>
- <%@ page import="kr.co.hsnc.common.util.*"%>
- <%@ page import="kr.co.hsnc.common.sql.*"%>
- <%@ page import="kr.co.hsnc.common.util.Formatter"%>
- <%@ page import="com.udapsoft.waf.common.util.Formatter2"%>
- <%@ page import="kr.co.udapsoft.ebid.buyer.common.file.FileManager"%>
- <%@ page import="kr.co.udapsoft.common.code.*" %>
- <%@ include file="/jsp/work/taglib.jsp"%>
- <jsp:useBean id="ctx" class="com.udapsoft.waf.system.context.SessionContext" scope="session" />
- <%
- ctx.init(request, response);
- HandlerStorage storage = ctx.getHandlerStorage();
- ValueObject params = storage.getParams();
- ValueObject user = storage.getUser();
- String event = storage.getEvent();
-
- RowSet perpayReqDivComboList = storage.getRowSet("perpayReqDivComboList"); //신청구분 ComboList Data
- ValueObject prePayment = storage.getValueObject("prePayment"); //기본정보, 세금계산서정보, 선급금정보
- ValueObject ContInfo = storage.getValueObject("ContInfo"); //분계유형
- RowSet warrList = storage.getRowSet("contOutWarr"); //보증정보
- ValueObject file_giveup = storage.getValueObject("PREPAYMENTS_GIVEUP");
- ValueObject file_taxbill = storage.getValueObject("TAX_BILL");
-
- String check1 = "";
- String check2 = "";
- String check3 = "";
- if("3".equals(prePayment.get("TAX_METHOD_CD"))){
- check3 = "checked";
- }else if("2".equals(prePayment.get("TAX_METHOD_CD"))){
- check2 = "checked";
- }else{
- check1 = "checked";
- }
-
- String taxChargNm = "";
- String taxChargHp = "";
- String taxChargEmail = "";
- taxChargNm = prePayment.get("USER_NAME");
- taxChargHp = prePayment.get("HP");
- taxChargEmail = prePayment.get("EMAIL");
-
- String digit = (String)prePayment.get("digit");
- int intDigit = Integer.parseInt(digit);
-
- String creby = user.get("ACCT_ID");
- String updby = user.get("ACCT_ID");
- if(!"".equals(prePayment.get("CRE_BY")) && !"".equals(prePayment.get("UPD_BY"))){
- creby = prePayment.get("CRE_BY");
- updby = prePayment.get("UPD_BY");
- }
-
- //베트남 환율정보 0원으로 표기되는 부분 수정(23.07.10)
- String CON_CUR_CD = (String)prePayment.get("CON_CUR_CD");
- int currency_digit = intDigit;
- if(CON_CUR_CD.equals("VND")) currency_digit = 4; //통화가 vnd인 경우 소숫점 4자리까지 표기
- %>
- <SCRIPT language="JavaScript">
- /*예약함수*/
- var sheet1;
- var sheet1Row;
- var sheet1PageNo = 1;
- var pageLastRowIndex = 1;
- var validationResult = false;
- var filterShow = false;
- var g_digit = <%= intDigit %>; // 소숫점 이하 자릿수
- function _onReady() {
- jQuery(document).delegate('#date1','change', function() {
- var f = document.form1;
- jQuery("#fevent").val("GET_RATE");
- //반려가 가능한 상태인지 확인한다.
- submitXmlRequest("/payment/purchase/Prepayments_form.screen", "GET_RATE", f, "VALUEOBJECT");
- });
-
- //리스트 페이지 이동
- jQuery("#btnList").click(function() {
- jQuery("#fevent").val("");
- if(jQuery("#resultListDiv").val() == "1"){
- jQuery("#form1").attr("action", "/payment/purchase/PrepaymentsList.screen");
- }else{
- jQuery("#form1").attr("action", "/payment/purchase/PrepaymentsResultList.screen");
- }
- jQuery("#form1").attr("target", "_self");
- jQuery("#form1").attr("method", "post");
- jQuery("#form1").submit();
- });
- jQuery("#btnDelete").click(function() {
- var f = document.form1;
- //필수 입력항목 check
- if (jQuery("#prepayId").val() == "") {
- alert("삭제되었습니다.");
- return;
- }
- //입력데이터 저장
- if (confirm("삭제 하시겠습니까?")) {
- jQuery("#fevent").val("DELETE_DATA");
- submitXmlRequest("/payment/purchase/Prepayments_form.screen", "DELETE_DATA", f, "SUCCESS");
- }
- });
- jQuery("#btnSave").click(function() {
- var f = document.form1;
- jQuery("#fevent").val("SAVE_DATA");
- //필수 입력항목 check
- if (requiredItemsCheck() == false) {
- return;
- }
- //입력데이터 저장
- if (confirm("저장 하시겠습니까?")) {
- submitXmlRequest("/payment/purchase/Prepayments_form.screen", "SAVE_DATA", f, "SUCCESS");
- }
- });
- jQuery("#btnText").click(function() {
- var f = document.form1;
- jQuery("#btnAppReqSelect").val("1"); //0:저장처리, 1:선급신청처리
- jQuery("#fevent").val("SAVE_DATA");
- //필수 입력항목 check
- if (requiredItemsCheck() == false) {
- jQuery("#btnAppReqSelect").val("0"); //0:저장처리, 1:선급신청처리
- return;
- }
- if (confirm(jQuery("#btnText").text() + " 하시겠습니까?")) {
- submitXmlRequest("/payment/purchase/Prepayments_form.screen", "SAVE_DATA", f, "SUCCESS");
- }else{
- jQuery("#btnAppReqSelect").val("0"); //0:저장처리, 1:선급신청처리
- }
- });
- //반려
- jQuery("#btnRejection").click(function() {
-
-
- var f = document.form1;
- jQuery("#fevent").val("CHK_REJECT");
- //반려가 가능한 상태인지 확인한다.
- submitXmlRequest("/payment/purchase/Prepayments_form.screen", "CHK_REJECT", f, "VALUEOBJECT");
-
- });
-
- //결재
- jQuery("#btnApproval").click(function() {
- //var radioCheck = jQuery(':radio[name="chk_info"]:checked').val(); //세금계산서 발행방법
- //if(radioCheck != "3"){ //Invoice
- //대금 청구 필첨
- if(jQuery.trim(jQuery("#p_AttachFile4").text()) == "") {
- alert('첨부파일 대금청구가 없습니다.');
- return;
- }
- //}
-
- //통화가KRW가 아니고 분계유형에 증빙종류[기타]이면 invlice고정
- var conCurCd = jQuery("#conCurCd").val();
- var proof_cd = jQuery("#proof_cd option:selected").val();
- if(conCurCd != "KRW"){
-
- var rateEx = jQuery("#rateEx").val();
- if(rateEx == 0){
- alert('환율이 없습니다.');
- return;
- }
- }
-
- var radioCheck = jQuery(':radio[name="chk_info"]:checked').val(); //세금계산서 발행방법
- if (radioCheck == "2") { //순발행
- if(jQuery.trim(jQuery("#p_AttachFile2").text()) == "") {
- alert("세금계산서 첨부파일이 없습니다.");
- return;
- }
- }
-
- //2017.2.27 외국환거래 확인
- if("<%=prePayment.get("CON_CUR_CD")%>" != "KRW" && jQuery("#FOREIGN_CHK").val()=="A" ){
- alert("외국환거래 신고대상여부를 확인해 주세요");
- return;
- }
-
- var f = document.form1;
- //jQuery("#btnAppReqSelect").val("2"); //2018.07.09
- jQuery("#fevent").val("CHK_APPVAR");
- //결재가 가능한 상태인지 확인한다.
- submitXmlRequest("/payment/purchase/Prepayments_form.screen", "CHK_APPVAR", f, "VALUEOBJECT");
- });
-
- //Invoice결재
- jQuery("#btnInvoiceApproval").click(function() {
-
- //var radioCheck = jQuery(':radio[name="chk_info"]:checked').val(); //세금계산서 발행방법
- //if(radioCheck != "3"){ //Invoice
- //대금 청구 필첨
- if(jQuery.trim(jQuery("#p_AttachFile4").text()) == "") {
- alert('첨부파일 대금청구가 없습니다.');
- return;
- }
- //}
- //세금계산서 첨부파일 유무Cekch
- var radioCheck = jQuery(':radio[name="chk_info"]:checked').val(); //세금계산서 발행방법
- if (radioCheck == "2") { //순발행
- /* if(jQuery.trim(jQuery("#p_AttachFile2").text()) == "") {
- alert("세금계산서 첨부파일이 없습니다.");
- return;
- } */
-
- }
- if(radioCheck == "3"){
- if(jQuery.trim(jQuery("#p_AttachFile3").text()) == "") {
- alert("Invoice 첨부파일이 없습니다.");
- return;
- }
- }
- //2017.2.27 외국환거래 확인
- if("<%=prePayment.get("CON_CUR_CD")%>" != "KRW" && jQuery("#FOREIGN_CHK").val()=="A" ){
- alert("외국환거래 신고대상여부를 확인해 주세요");
- return;
- }
-
- var f = document.form1;
- jQuery("#btnAppReqSelect").val("2"); //0:저장처리, 1:선급신청처리, 2:Invoice결재
- //필수 입력항목 check
- if (requiredItemsCheck() == false) {
- return;
- }
-
- var f = document.form1;
- jQuery("#fevent").val("CHK_APPVAR");
- //결재가 가능한 상태인지 확인한다.
- submitXmlRequest("/payment/purchase/Prepayments_form.screen", "CHK_APPVAR", f, "VALUEOBJECT");
- });
-
- jQuery("#btnComRnnc").click(function() {
-
- var f = document.form1;
- jQuery("#btnAppReqSelect").val("1"); //0:저장처리, 1:기성신청처리
-
- jQuery("#fevent").val("RNNC_DATA");
- //필수 입력항목 check
-
- //입력데이터 저장
- if (confirm("포기완료 하시겠습니까?")) {
- submitXmlRequest("/payment/purchase/Prepayments_form.screen", "RNNC_DATA", f, "SUCCESS");
- }else{
- jQuery("#btnAppReqSelect").val("0"); //0:저장처리, 1:선급신청처리
- }
-
- });
-
- //2017.02.24 외국환거래신고
- $("#btn_foreign").click(function() {//저장
- var corpId = "<%=prePayment.get("CON_CORP_ID")%>";
- var win_id = "ForeignCheckPop";
- var editYN = "N";
-
- //04 결재중, 10선금완료 11포기완료 제외하고 등록가능.
- if (jQuery("#statusCd").val() != "04" && jQuery("#statusCd").val() != "10" && jQuery("#statusCd").val() != "11" ){
- editYN="Y";
- }
- var link = "/bid/purchase/ForeignCheckPop.screen";
- link += "?pop_win_id="+win_id+"&BID_NO="+$("#subContId").val()+"&BID_DEG="+$("#prepayId").val()+"&VENDOR_CD=" + corpId + "&editYN="+ editYN + "&WHO5=R"
- link += "&P_USER=" + "<%=user.get("USER_SABUN")%>";
- fLayerPop(win_id, link, 950,600, '','', 'NO');
- });
-
- //선급금 사용자 입력 후 처리
- jQuery("#reqPrepaySupplyAmt").blur(function() {
- var reqPrepaySupplyTamt = jQuery("#reqPrepaySupplyAmt").val();
- reqPrepaySupplyTamt = reqPrepaySupplyTamt.replace(/(\,|\:)/g, ""); //신청금액 과세
- reqPrepaySupplyTamt = Number(reqPrepaySupplyTamt).toFixed(g_digit);
- var subPrepaySupplyTamt = jQuery("#subPrepaySupplyAmt").val();
- subPrepaySupplyTamt = subPrepaySupplyTamt.replace(/(\,|\:)/g, ""); //선급금액 과세
- if (Number(subPrepaySupplyTamt) < Number(reqPrepaySupplyTamt)) {
- if(jQuery("#statusCd").val() != "10"){
- alert('선급금보다 신청금액이 큽니다.');
- reqPrepaySupplyTamt = subPrepaySupplyTamt;
- jQuery("#reqPrepaySupplyAmt").val(subPrepaySupplyTamt);
- jQuery("#giveSupplyAmt").val("0");
- jQuery('#reqPrepaySupplyAmt').focus();
- }
- } else {
- jQuery("#reqPrepaySupplyAmt").val(Number(reqPrepaySupplyTamt).toFixed(g_digit));
- var giveSupplyTamt = subPrepaySupplyTamt - reqPrepaySupplyTamt;
- jQuery("#giveSupplyAmt").val(giveSupplyTamt.toFixed(g_digit));
- jQuery("#giveSupplyAmt, #reqPrepaySupplyAmt").each(function(index) {
- jQuery(this).val(jQuery(this).val().split(/(?=(?:\d{3})+(?:\.|$))/g).join(','));
- });
- }
-
- //부가세
- var reqPrepaySurtaxAmt = (reqPrepaySupplyTamt * 10) / 100;
- reqPrepaySurtaxAmt = doFloor(reqPrepaySurtaxAmt, g_digit);
- var subPrepaySurtaxAmt = jQuery("#subPrepaySurtaxAmt").val();
- subPrepaySurtaxAmt = subPrepaySurtaxAmt.replace(/(\,|\:)/g, ""); //선급금액 부과세
-
- if(Number(subPrepaySurtaxAmt) > 0){
- var giveSurtaxAmt = subPrepaySurtaxAmt - reqPrepaySurtaxAmt;
- jQuery("#reqPrepaySurtaxAmt").val(reqPrepaySurtaxAmt);
- jQuery("#reqPrepaySurtaxAmt").each(function(index) {
- jQuery(this).val(jQuery(this).val().split(/(?=(?:\d{3})+(?:\.|$))/g).join(','));
- });
- jQuery("#giveSurtaxAmt").val(giveSurtaxAmt.toFixed(g_digit));
- }else{
- jQuery("#reqPrepaySurtaxAmt").val(0);
- reqPrepaySurtaxAmt = 0;
- }
-
- jQuery("#giveSurtaxAmt").each(function(index) {
- jQuery(this).val(jQuery(this).val().split(/(?=(?:\d{3})+(?:\.|$))/g).join(','));
- });
-
- //신청금액을 구한다.
- var reqPrepayAmt = Number(reqPrepaySupplyTamt) + Number(reqPrepaySurtaxAmt);
- var perpayAmt = jQuery("#perpayAmt").val();
- perpayAmt = perpayAmt.replace(/(\,|\:)/g, ""); //선급금액
- var giveAmt = perpayAmt - reqPrepayAmt;
- jQuery("#reqPrepayAmt").val(reqPrepayAmt.toFixed(g_digit));
- jQuery("#reqPrepayAmt").each(function(index) {
- jQuery(this).val(jQuery(this).val().split(/(?=(?:\d{3})+(?:\.|$))/g).join(','));
- });
- jQuery("#giveAmt").val(giveAmt.toFixed(g_digit));
- jQuery("#giveAmt").each(function(index) {
- jQuery(this).val(jQuery(this).val().split(/(?=(?:\d{3})+(?:\.|$))/g).join(','));
- });
-
- //요율
- var conAmt = jQuery("#conAmt").val();
- conAmt = conAmt.replace(/(\,|\:)/g, "");
- var conSupplyAmt = jQuery("#conSupplyAmt").val();
- conSupplyAmt = conSupplyAmt.replace(/(\,|\:)/g, "");
- var giveSupplyAmt = jQuery("#giveSupplyAmt").val();
- giveSupplyAmt = giveSupplyAmt.replace(/(\,|\:)/g, "");
-
- var reqPrepayPercent = (reqPrepaySupplyTamt / conSupplyAmt) * 100; //신청금액 요율
- var givePercent = (giveSupplyAmt / conSupplyAmt) * 100; //포기금액 요율
- jQuery("#reqPrepayPercent").val(reqPrepayPercent.toFixed(1));
- jQuery("#givePercent").val(givePercent.toFixed(1));
-
- setSeletReq();
- giveDataSet();
- });
-
-
- //2018.07.11 선급금 수정
- //perpayAmt = subPrepaySupplyAmt + subPrepaySurtaxAmt
- //subPrepaySupplyAmt 수정허용
- //subPrepaySurtaxAmt 수정허용
- //prepayAmtPercent 계약금액 대비
- jQuery("#subPrepaySupplyAmt").blur(function() {
- var subPrepaySupplyAmt = jQuery("#subPrepaySupplyAmt").val(); //선급공급액
- subPrepaySupplyAmt = subPrepaySupplyAmt.replace(/(\,|\:)/g, "");
- var subPrepaySurtaxAmt = (Number(subPrepaySupplyAmt) * 10) / 100; //선급부가세
- subPrepaySurtaxAmt = doFloor(subPrepaySurtaxAmt, g_digit);
-
- //2020.04.14 계약금액 부가세 없는 경우 선급금액 부가세 자동계산되지 않도록 수정
- var conSurtaxAmt = jQuery("#conSurtaxAmt").val();
- conSurtaxAmt = conSurtaxAmt.replace(/(\,|\:)/g, ""); //계약금액 부과세
-
- if(Number(conSurtaxAmt) > 0){
- jQuery("#subPrepaySurtaxAmt").val(subPrepaySurtaxAmt);
- jQuery("#subPrepaySurtaxAmt").each(function(index) {
- jQuery(this).val(jQuery(this).val().split(/(?=(?:\d{3})+(?:\.|$))/g).join(','));
- });
- }else{
- jQuery("#subPrepaySurtaxAmt").val(0);
- subPrepaySurtaxAmt = 0;
- }
-
- //jQuery("#subPrepaySurtaxAmt").val(subPrepaySurtaxAmt);
- //jQuery("#subPrepaySurtaxAmt").each(function(index) {
- // jQuery(this).val(jQuery(this).val().split(/(?=(?:\d{3})+(?:\.|$))/g).join(','));
- //});
-
- var perpayAmt = Number(subPrepaySupplyAmt) + Number(subPrepaySurtaxAmt) ;
- jQuery("#perpayAmt").val(perpayAmt);
- jQuery("#perpayAmt").each(function(index) {
- jQuery(this).val(jQuery(this).val().split(/(?=(?:\d{3})+(?:\.|$))/g).join(','));
- });
-
- //요율
- var conSupplyAmt = jQuery("#conSupplyAmt").val();
- conSupplyAmt = conSupplyAmt.replace(/(\,|\:)/g, "");
-
- var prepayAmtPercent = (Number(subPrepaySupplyAmt) / Number(conSupplyAmt)) * 100; //신청금액 요율
- jQuery("#prepayAmtPercent").val(prepayAmtPercent.toFixed(1));
- });
- //2018.07.11 선급부가세 수정
- //perpayAmt = subPrepaySupplyAmt + subPrepaySurtaxAmt
- //subPrepaySupplyAmt 수정허용
- //subPrepaySurtaxAmt 수정허용
- //prepayAmtPercent 계약금액 대비
- jQuery("#subPrepaySurtaxAmt").blur(function() {
- var subPrepaySupplyAmt = jQuery("#subPrepaySupplyAmt").val(); //선급공급액
- subPrepaySupplyAmt = subPrepaySupplyAmt.replace(/(\,|\:)/g, "");
- var subPrepaySurtaxAmt = jQuery("#subPrepaySurtaxAmt").val(); //선급부가세
- subPrepaySurtaxAmt = subPrepaySurtaxAmt.replace(/(\,|\:)/g, "");
- var perpayAmt = Number(subPrepaySupplyAmt) + Number(subPrepaySurtaxAmt) ;
- jQuery("#perpayAmt").val(perpayAmt);
- jQuery("#perpayAmt").each(function(index) {
- jQuery(this).val(jQuery(this).val().split(/(?=(?:\d{3})+(?:\.|$))/g).join(','));
- });
-
- //요율
- var conSupplyAmt = jQuery("#conSupplyAmt").val();
- conSupplyAmt = conSupplyAmt.replace(/(\,|\:)/g, "");
-
- var prepayAmtPercent = (Number(subPrepaySupplyAmt) / Number(conSupplyAmt)) * 100; //신청금액 요율
- jQuery("#prepayAmtPercent").val(prepayAmtPercent.toFixed(1));
- });
- pageinit();
- }
- //페이지 초기처리
- function pageinit() {
- //신청구분 설정
- setSeletReq();
-
- //선급금 포기각서 표시 유무
- giveDataSet()
-
- //작성일자(증빙일자)
- seTaxDate();
- //신청구분 선택불가
- appDivSet();
-
- //발행방법에 따른 페이지 셋팅
- taxDataSet();
- //버튼표시 셋팅
- btnCtr();
-
- //상태에 따른 입력항목 readOnly
- inputReadOnlyset();
- }
- function appDivSet() {
- jQuery("#perpayReqDiv").attr("disabled", true);
-
- jQuery("#reqPrepaySupplyTamt, #reqPrepaySupplyNamt").blur();
- }
-
- function setSeletReq(){
-
- var reqPrepaySupplyTamt = jQuery("#reqPrepaySupplyAmt").val().replace(/(\,|\:)/g, ""); //신청금액 과세
- reqPrepaySupplyTamt = Number(reqPrepaySupplyTamt).toFixed(g_digit);
-
- var subPrepaySupplyTamt = jQuery("#subPrepaySupplyAmt").val().replace(/(\,|\:)/g, ""); //선급금액 과세
- subPrepaySupplyTamt = Number(subPrepaySupplyTamt).toFixed(g_digit);
-
- //입력한 선급금 과세가 빈값일 경우 0으로 셋팅
- if (reqPrepaySupplyTamt == "" || Number(reqPrepaySupplyTamt) == 0) {
- reqPrepaySupplyTamt = "0";
- jQuery("#reqPrepaySupplyAmt").val("0");
- }
- if (Number(reqPrepaySupplyTamt) == 0) { //선급포기
- jQuery("#perpayReqDiv").val("3");
- jQuery("#btnText").text("신청요청");
- } else if (Number(reqPrepaySupplyTamt) == Number(subPrepaySupplyTamt)) { //신청
- jQuery("#perpayReqDiv").val("1");
- jQuery("#btnText").text("신청요청");
- } else {
- jQuery("#perpayReqDiv").val("2");
- jQuery("#btnText").text("신청요청");
- }
- }
-
- function seTaxDate() {
- var newDay = new Date(get_year(), get_month(), "");
- var lastDay = newDay.getDate();
- var yyyymmdd = get_year() + '-' + get_month() + "-" + lastDay;
- if (jQuery('#date1').val() == "") {
- jQuery('#date1').val(yyyymmdd);
- }
- jQuery('#lastDate').val(yyyymmdd);
- }
- function btnCtr(){
-
- var radioCheck = jQuery(':radio[name="chk_info"]:checked').val(); //세금계산서 발행방법
- if(radioCheck == "3"){ //Invoice
- if(jQuery("#statusCd").val() == "00" || jQuery("#statusCd").val() == "99" || jQuery("#statusCd").val() == "01" || jQuery("#statusCd").val() == "02" || jQuery("#statusCd").val() == "03" || jQuery("#statusCd").val() == "91" || jQuery("#statusCd").val() == "20"){
- jQuery("#spanBtnSave").show();
- if(jQuery("#CNT").val() != "1") {
- jQuery("#spanBtnDelete").show();
- }
- jQuery("#spanBtnAppReq").hide();
- jQuery("#spanBtnApproval").hide();
- jQuery("#spanBtnInvoiceApproval").show();
- jQuery("#spanBtnRejection").hide();
- jQuery("#spanComRnnc").hide();
- jQuery("#spanBtnList").show();
- jQuery("#spanTaxSave").hide();
- }else {
- jQuery("#spanBtnSave").hide();
- jQuery("#spanBtnDelete").hide();
- jQuery("#spanBtnAppReq").hide();
- jQuery("#spanBtnApproval").hide();
- jQuery("#spanBtnInvoiceApproval").hide();
- jQuery("#spanBtnRejection").hide();
- if(jQuery("#statusCd").val() == "21" ){
- jQuery("#spanComRnnc").show();
- }else{
- jQuery("#spanComRnnc").hide();
- }
- jQuery("#spanBtnList").show();
- jQuery("#spanTaxSave").hide();
- }
-
- }else{
- if(jQuery("#statusCd").val() == "00" || jQuery("#statusCd").val() == ""){ //00:작성상태는 목록, 저장버튼 표시
-
- jQuery("#spanBtnSave").show();
- if(jQuery("#CNT").val() != "1") {
- jQuery("#spanBtnDelete").show();
- }
- jQuery("#spanBtnAppReq").hide();
- jQuery("#spanBtnApproval").hide();
- jQuery("#spanBtnInvoiceApproval").hide();
- jQuery("#spanBtnRejection").hide();
- jQuery("#spanComRnnc").hide();
- jQuery("#spanBtnList").show();
-
- jQuery("#spanGubSave").hide();
- jQuery("#spanTaxSave").hide();
-
- }
-
- if(jQuery("#statusCd").val() == "01"){ //01:작성상태는 목록, 저장, 선급신청버튼 표시
- jQuery("#spanBtnSave").show();
- if(jQuery("#CNT").val() != "1") {
- jQuery("#spanBtnDelete").show();
- }
- jQuery("#spanBtnAppReq").show();
- jQuery("#spanBtnApproval").hide();
-
- if(radioCheck == "1"){
- jQuery("#spanBtnInvoiceApproval").hide(); //추후 숨김으로
- }else{
- jQuery("#spanBtnInvoiceApproval").show(); //추후 숨김으로
- }
-
- jQuery("#spanBtnRejection").hide();
- jQuery("#spanComRnnc").hide();
- jQuery("#spanBtnList").show();
-
- jQuery("#spanGubSave").hide();
- jQuery("#spanTaxSave").hide();
-
- }
-
- if(jQuery("#statusCd").val() == "02"){ //02:선급신청요청상태는 목록, 저장, 선급신청 버튼 표시
- jQuery("#spanBtnSave").show();
- if(jQuery("#CNT").val() != "1") {
- jQuery("#spanBtnDelete").show();
- }
- jQuery("#spanBtnAppReq").show();
- jQuery("#spanBtnApproval").hide();
- if(radioCheck == "1"){
- jQuery("#spanBtnInvoiceApproval").hide(); //추후 숨김으로
- }else{
- jQuery("#spanBtnInvoiceApproval").show(); //추후 숨김으로
- }
- jQuery("#spanBtnRejection").hide();
- jQuery("#spanComRnnc").hide();
- jQuery("#spanBtnList").show();
-
- jQuery("#spanGubSave").hide();
- jQuery("#spanTaxSave").hide();
- }
- if(jQuery("#statusCd").val() == "21"){ //21:선급포기요청상태는 목록, 저장, 선급신청 버튼 표시
-
- jQuery("#spanBtnSave").hide();
- jQuery("#spanBtnDelete").hide();
- jQuery("#spanBtnAppReq").hide();
- jQuery("#spanBtnApproval").hide();
- jQuery("#spanBtnInvoiceApproval").hide();
- jQuery("#spanBtnRejection").show();
- jQuery("#spanComRnnc").show();
- jQuery("#spanBtnList").show();
-
- jQuery("#spanGubSave").hide();
- jQuery("#spanTaxSave").hide();
-
- }
-
- if(jQuery("#statusCd").val() == "03" || jQuery("#statusCd").val() == "20"){ //03:선급신청상태는 목록 버튼 표시
-
- jQuery("#spanBtnSave").hide();
- jQuery("#spanBtnDelete").hide();
- jQuery("#spanBtnAppReq").hide();
- jQuery("#spanBtnApproval").show();
- jQuery("#spanBtnInvoiceApproval").hide(); //2018.07.09
- jQuery("#spanBtnRejection").show();
- jQuery("#spanComRnnc").hide();
- jQuery("#spanBtnList").show();
-
- jQuery("#spanGubSave").show();
- jQuery("#spanTaxSave").show();
-
- }
-
- if(jQuery("#statusCd").val() == "04"){ //04:결재중상태는 목록 버튼 표시
- jQuery("#spanBtnSave").hide();
- jQuery("#spanBtnDelete").hide();
- jQuery("#spanBtnAppReq").hide();
- jQuery("#spanBtnApproval").hide();
- jQuery("#spanBtnRejection").hide();
- jQuery("#spanComRnnc").hide();
- jQuery("#spanBtnList").show();
-
- jQuery("#spanGubSave").hide();
- jQuery("#spanTaxSave").hide();
-
- }
-
- if(jQuery("#statusCd").val() == "10"){ //10:선급완료상태는 목록 버튼 표시
- jQuery("#spanBtnSave").hide();
- jQuery("#spanBtnDelete").hide();
- jQuery("#spanBtnAppReq").hide();
- jQuery("#spanBtnApproval").hide();
- jQuery("#spanBtnInvoiceApproval").hide();
- jQuery("#spanBtnRejection").hide();
- jQuery("#spanComRnnc").hide();
- jQuery("#spanBtnList").show();
-
- jQuery("#spanGubSave").hide();
- jQuery("#spanTaxSave").hide();
- }
-
- if(jQuery("#statusCd").val() == "11"){ //51:선급포기상태는 목록 버튼 표시
- jQuery("#spanBtnSave").hide();
- jQuery("#spanBtnDelete").hide();
- jQuery("#spanBtnAppReq").hide();
- jQuery("#spanBtnApproval").hide();
- jQuery("#spanBtnInvoiceApproval").hide();
- jQuery("#spanBtnRejection").hide();
- jQuery("#spanComRnnc").hide();
- jQuery("#spanBtnList").show();
-
- jQuery("#spanGubSave").hide();
- jQuery("#spanTaxSave").hide();
- }
-
- if(jQuery("#statusCd").val() == "91" || jQuery("#statusCd").val() == "99"){ //91:반려상태는 목록, 저장 버튼 표시
- jQuery("#spanBtnSave").show();
- if(jQuery("#CNT").val() != "1") {
- jQuery("#spanBtnDelete").show();
- }
- jQuery("#spanBtnAppReq").show();
- jQuery("#spanBtnApproval").hide();
- jQuery("#spanBtnInvoiceApproval").hide();
- jQuery("#spanComRnnc").hide();
- jQuery("#spanBtnRejection").hide();
- jQuery("#spanBtnList").show();
-
- jQuery("#spanGubSave").hide();
- jQuery("#spanTaxSave").hide();
- }
-
- }
-
- }
- function inputReadOnlyset() {
- //분개유형 비활성화
- jQuery('#acct_gb').attr('disabled', 'true');
- jQuery('#proof_cd').attr('disabled', 'true');
- //jQuery('#pay_group').attr('disabled', 'true');2015.11.25 조재윤과장 요청. 비활성화 해제.
-
- if(jQuery("#conCurCd").val() == "KRW"){
- jQuery("#chk_3").attr("disabled",true);
- }
-
- //03:선급신청, 04:결재중, 10:선급완료, 11:선급포기완료
- if (jQuery("#statusCd").val() == "04" || jQuery("#statusCd").val() == "10" || jQuery("#statusCd").val() == "11") { //03:선급신청상태는 목록 버튼 표시
-
- jQuery("#userName").attr("readonly", true);
- jQuery("#userName").css({'background-color' : '#F0F0F0'});
- jQuery("#userName").css({'border' : '1px solid #bcbcbc'});
-
- jQuery("#hp").attr("readonly", true);
- jQuery("#hp").css({'background-color' : '#F0F0F0'});
- jQuery("#hp").css({'border' : '1px solid #bcbcbc'});
-
- jQuery("#eMail").attr("readonly", true);
- jQuery("#eMail").css({'background-color' : '#F0F0F0'});
- jQuery("#eMail").css({'border' : '1px solid #bcbcbc'});
-
- jQuery("#reqPrepaySupplyAmt").attr("readonly", true);
- jQuery("#reqPrepaySupplyAmt").css({'background-color' : '#F0F0F0'});
- jQuery("#reqPrepaySupplyAmt").css({'border' : '1px solid #bcbcbc'});
-
- }
-
- if(jQuery("#statusCd").val() == "03"){
- jQuery("#reqPrepaySupplyAmt").attr("readonly", true);
- jQuery("#reqPrepaySupplyAmt").css({'background-color' : '#F0F0F0'});
- jQuery("#reqPrepaySupplyAmt").css({'border' : '1px solid #bcbcbc'});
- }
- }
-
- function taxDataSet() {
- //통화가KRW가 아니고 분계유형에 증빙종류[기타]이면 invlice고정
- var conCurCd = jQuery("#conCurCd").val();
- var proof_cd = jQuery("#proof_cd option:selected").val();
- if(conCurCd != "KRW" && proof_cd == "Z99"){
- jQuery("#chk_1").attr("disabled",true);
- jQuery("#chk_2").attr("disabled",true);
- }else if(conCurCd != "KRW" && proof_cd != "Z99"){
- jQuery("#chk_3").attr("disabled",true);
- }
-
- var radioCheck = jQuery(':radio[name="chk_info"]:checked').val(); //세금계산서 발행방법
- if (radioCheck == "1") { //역발행
- jQuery("#taxAttachments").hide();
- jQuery("#taxTrRow").hide();
- jQuery("#invoiceAttachments").hide();
- jQuery("#invoiceTrRow").hide();
- } else if (radioCheck == "2"){ //순발행
- jQuery("#taxAttachments").show();
- jQuery("#taxTrRow").show();
- jQuery("#invoiceAttachments").hide();
- jQuery("#invoiceTrRow").hide();
- }else{
- jQuery("#taxAttachments").hide();
- jQuery("#taxTrRow").hide();
- jQuery("#invoiceAttachments").show();
- jQuery("#invoiceTrRow").show();
- }
-
-
- btnCtr();
- }
- function giveDataSet() {
- if (jQuery("#perpayReqDiv option:selected").val() == "1") {
- jQuery("#giveAttachments").hide();
- jQuery("#p_Attach1").show();
- } else {
- jQuery("#giveAttachments").show();
- jQuery("#p_Attach1").hide();
- }
- }
- function inputDataSet() {
- jQuery("#perpayReqDiv").attr("disabled", true);
- if (jQuery("#perpayReqDiv option:selected").val() == "1") {
- jQuery("#giveAmt").val("0"); //선급_포기금액_합계
- jQuery("#reqPrepayAmt").attr("readonly", true);
- jQuery("#reqPrepayAmt").css({'background-color' : '#dedede'});
- jQuery("#reqPrepayAmt").css({'border' : '1px solid #bcbcbc'});
- jQuery("#reqPrepayAmt").val(jQuery("#perpayAmt").val());
- jQuery("#giveSupplyTamt").val("0"); //선급_포기금액_과세
- jQuery("#reqPrepaySupplyTamt").attr("readonly", true);
- jQuery("#reqPrepaySupplyTamt").css({'background-color' : '#dedede'});
- jQuery("#reqPrepaySupplyTamt").css({'border' : '1px solid #bcbcbc'});
- jQuery("#reqPrepaySupplyTamt").val(jQuery("#subPrepaySupplyTamt").val());
- jQuery("#giveSupplyNamt").val("0"); //선급_포기금액_면세
- jQuery("#reqPrepaySupplyNamt").attr("readonly", true);
- jQuery("#reqPrepaySupplyNamt").css({'background-color' : '#dedede'});
- jQuery("#reqPrepaySupplyNamt").css({'border' : '1px solid #bcbcbc'});
- jQuery("#reqPrepaySupplyNamt").val(jQuery("#subPrepaySupplyNamt").val());
- jQuery("#giveSurtaxAmt").val("0"); //선급_포기금액_부가세
- //jQuery("#reqPrepaySurtaxAmt").attr("readonly", true);
- //jQuery("#reqPrepaySurtaxAmt").css({'background-color' : '#dedede'});
- //jQuery("#reqPrepaySurtaxAmt").css({'border' : '1px solid #bcbcbc'});
- //jQuery("#reqPrepaySurtaxAmt").val(jQuery("#subPrepaySurtaxAmt").val());
- jQuery("#givePercent").val("0.0");
- var reqPrepayAmt = jQuery("#reqPrepayAmt").val();
- reqPrepayAmt = reqPrepayAmt.replace(/(\,|\:)/g, "");
- var conAmt = jQuery("#conAmt").val();
- conAmt = conAmt.replace(/(\,|\:)/g, "");
- var givePercent = (reqPrepayAmt / conAmt) * 100;
- jQuery("#reqPrepayPercent").val(givePercent.toFixed(1));
- giveDataSet();
- warrCtr('S'); //S:보이기, H:숨기기
- } else if (jQuery("#perpayReqDiv option:selected").val() == "2") {
- jQuery("#reqPrepayAmt").attr("readonly", true);
- jQuery("#reqPrepayAmt").css({'background-color' : '#dedede'});
- jQuery("#reqPrepayAmt").css({'border' : '1px solid #bcbcbc'});
- jQuery("#reqPrepaySupplyTamt").attr("readonly", false);
- jQuery("#reqPrepaySupplyTamt").css({'background-color' : '#ffffff'});
- jQuery("#reqPrepaySupplyTamt").css({'border' : '1px solid #595a5a'});
- if (jQuery("#conSupplyNamt").val() == "0") {
- jQuery("#reqPrepaySupplyNamt").attr("readonly", true);
- jQuery("#reqPrepaySupplyNamt").css({'background-color' : '#dedede'});
- jQuery("#reqPrepaySupplyNamt").css({'border' : '1px solid #bcbcbc'});
- } else {
- jQuery("#reqPrepaySupplyNamt").attr("readonly", false);
- jQuery("#reqPrepaySupplyNamt").css({'background-color' : '#ffffff'});
- jQuery("#reqPrepaySupplyNamt").css({'border' : '1px solid #595a5a'});
- }
- //jQuery("#reqPrepaySurtaxAmt").attr("readonly", true);
- //jQuery("#reqPrepaySurtaxAmt").css({'background-color' : '#dedede'});
- //jQuery("#reqPrepaySurtaxAmt").css({'border' : '1px solid #bcbcbc'});
- jQuery("#reqPrepaySupplyTamt").val(jQuery("#orgReqPrepaySupplyTamt").val());
- jQuery("#reqPrepaySupplyNamt").val(jQuery("#orgReqPrepaySupplyNamt").val());
- jQuery("#reqPrepaySupplyTamt").blur();
- giveDataSet();
- warrCtr('S'); //S:보이기, H:숨기기
- } else if (jQuery("#perpayReqDiv option:selected").val() == "3") {
- jQuery("#reqPrepayAmt").val("0"); //선급_신청금액_합계
- jQuery("#reqPrepayAmt").attr("readonly", true);
- jQuery("#reqPrepayAmt").css({'background-color' : '#dedede'});
- jQuery("#reqPrepayAmt").css({'border' : '1px solid #bcbcbc'});
- jQuery("#giveAmt").val(jQuery("#perpayAmt").val());
- jQuery("#reqPrepaySupplyTamt").val("0"); //선급_신청금액_과세
- jQuery("#reqPrepaySupplyTamt").attr("readonly", true);
- jQuery("#reqPrepaySupplyTamt").css({'background-color' : '#dedede'});
- jQuery("#reqPrepaySupplyTamt").css({'border' : '1px solid #bcbcbc'});
- jQuery("#giveSupplyTamt").val(jQuery("#subPrepaySupplyTamt").val());
- jQuery("#reqPrepaySupplyNamt").val("0"); //선급_신청금액_면세
- jQuery("#reqPrepaySupplyNamt").attr("readonly", true);
- jQuery("#reqPrepaySupplyNamt").css({'background-color' : '#dedede'});
- jQuery("#reqPrepaySupplyNamt").css({'border' : '1px solid #bcbcbc'});
- jQuery("#giveSupplyNamt").val(jQuery("#subPrepaySupplyNamt").val());
- jQuery("#reqPrepaySurtaxAmt").val("0"); //선급_신청금액_부가세
- //jQuery("#reqPrepaySurtaxAmt").attr("readonly", true);
- //jQuery("#reqPrepaySurtaxAmt").css({'background-color' : '#dedede'});
- //jQuery("#reqPrepaySurtaxAmt").css({'border' : '1px solid #bcbcbc'});
- jQuery("#giveSurtaxAmt").val(jQuery("#subPrepaySurtaxAmt").val());
- jQuery("#reqPrepayPercent").val("0.0");
- var giveAmt = jQuery("#giveAmt").val();
- giveAmt = giveAmt.replace(/(\,|\:)/g, "");
- var conAmt = jQuery("#conAmt").val();
- conAmt = conAmt.replace(/(\,|\:)/g, "");
- var givePercent = (giveAmt / conAmt) * 100;
- jQuery("#givePercent").val(givePercent.toFixed(1));
- giveDataSet();
- //포기일때 보증정보는 필요없으므로 숨김처ㅣ
- warrCtr('H'); //S:보이기, H:숨기기
- }
- }
- function warrCtr(gubun) {
- if(jQuery("#statusCd").val() == "10" && jQuery("#warrWgno").val() == ""){
-
- jQuery('#warr1').hide();
- jQuery('#warr2').hide();
-
- }else{
- if (gubun == "H") { //숨김
- var warrWamt = jQuery("#warrWamt").val().replace(/(\,|\:)/g, "");
- if(warrWamt == "0" || warrWamt == ""){
-
- jQuery('#warr1').slideUp();
- jQuery('#warr2').slideUp();
-
- }else{
-
- alert("보증정보가 존재합니다.");
- }
-
- } else {
-
- jQuery('#warr1').show("slow");
- jQuery('#warr2').show("slow");
-
- }
- }
- }
- function reDisplay() {
-
- jQuery("#fevent").val("");
- jQuery("#form1").attr("action", "/payment/purchase/Prepayments.screen");
- jQuery("#form1").attr("target", "_self");
- jQuery("#form1").attr("method", "post");
- jQuery("#form1").submit();
-
- }
-
- //저장 및 선급금 신청시 필수항목 Check
- function requiredItemsCheck() {
- var date1 = jQuery('#date1').val(); //작성일자(증빙일자)
- var userName = jQuery('#userName').val(); //담당자명
- var hp = jQuery('#hp').val(); //담당자 핸드폰번호
- var eMail = jQuery('#eMail').val(); //담당자 이메일
- if (date1 == "") {
- alert("입력필수입니다.");
- jQuery('#date1').focus();
- return false;
- }
- if (userName == "") {
- alert("담당자명은 입력필수입니다.");
- jQuery('#userName').focus();
- return false;
- }
- if (hp == "") {
- alert("담당자 핸드폰 번호는 입력필수입니다.");
- jQuery('#hp').focus();
- return false;
- } else {
- var rgEx = /(01[016789])[-](\d{4}|\d{3})[-]\d{4}$/g;
- var strValue = hp;
- var chkFlg = rgEx.test(strValue);
- if (!chkFlg) {
- alert("올바른 휴대폰번호가 아닙니다.");
- jQuery('#hp').focus();
- return false;
- }
- }
- if (eMail == "") {
- alert("담당자 이메일은 입력필수입니다.");
- jQuery('#eMail').focus();
- return false;
- } else {
- 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})(\]?)$/;
- if (!regEmail.test(eMail)) {
- alert('올바른 이메일 주소가 아닙니다.');
- jQuery('#eMail').focus();
- return false;
- }
- }
-
- //2018.07.12 계약서 선급금액과 상이한 경우 사유작성 필수
- if (jQuery("#subPrepaySupplyAmt").val() + " (부가세 별도)" != jQuery("#conPrepayAmt").val() && jQuery("#chgReason").val()=="") {
- alert("선급금 변경 사유를 작성하십시요.");
- jQuery('#chgReason').focus();
- return false;
- }
-
- if (jQuery("#btnAppReqSelect").val() == "1") { //선급금신청요청시에는 해당하는 첨부파일이 모두 등록되어있어야함.
- //01:작성중, 02:선급금 신청요청, 21:선금금 포기요청, 03:선급금 신청, 04:결재중, 10:선금완료, 11:포기완료, 91:반려
- if (jQuery("#perpayReqDiv").val() == "1") { //선급신청
- jQuery("#selectStatusCd").val("02");
-
- //선급금 포기각서 파일첨부 존재를 check한다.
- if(jQuery.trim(jQuery("#p_AttachFile1").text()) != "") {
- alert("선급금 포기각서 첨부가 존재합니다.");
- return false;
- }
-
- } else if (jQuery("#perpayReqDiv").val() == "2") { //부분신청
- jQuery("#selectStatusCd").val("02");
- /* if(jQuery("#warrWgno").val() != ""){
- var warrWamtValue = jQuery("#warrWamt").val().replace(/(\,|\:)/g, "");
- var reqPrepayAmtValue = jQuery("#reqPrepayAmt").val().replace(/(\,|\:)/g, "");
- if(reqPrepayAmtValue != warrWamtValue){
- alert("선급금신청금액과 보증금액이 다릅니다.");
- return false;
- }
- } */
-
- } else if (jQuery("#perpayReqDiv").val() == "3") { //포기신청
- jQuery("#selectStatusCd").val("02");
- /* if(jQuery("#warrWgno").val() != ""){
- alert("보증정보가 존재합니다.");
- return false;
- } */
- } else {
- alert("신청구분을 선택하세요");
- return;
- }
- }
- }
- function doResult(resultObj) {
- try {
- if (resultObj.getRequestEvent() == "SAVE_DATA" || resultObj.getRequestEvent() == "SAVE_SEGUM" || resultObj.getRequestEvent() == "SAVE_GUA" ) {
- if (resultObj.getSuccess()) {
- document.form1.isSubmit = false;
- if (jQuery("#btnAppReqSelect").val() == "0") {
- alert("저장되었습니다.");
-
- reSearch();
-
- } else if (jQuery("#btnAppReqSelect").val() == "1"){
- jQuery("#btnAppReqSelect").val("0");
- btnAppReqProcess();
- } else {
-
- jQuery("#btnAppReqSelect").val("0");
- runApproval();
- }
- } else {
- dlgErrorMsg(resultObj);
- }
- document.form1.isSubmit = false;
- }
- if (resultObj.getRequestEvent() == "DELETE_DATA") {
- if (resultObj.getSuccess()) {
- alert("삭제되었습니다.");
- jQuery("#btnList").click();
- } else {
- dlgErrorMsg(resultObj);
- }
- document.form1.isSubmit = false;
- }
- if (resultObj.getRequestEvent() == "REQ_DATA") {
- if (resultObj.getSuccess()) {
- alert("신청요청하였습니다.");
- jQuery("#btnList").click();
- } else {
- dlgErrorMsg(resultObj);
- }
- document.form1.isSubmit = false;
- }
-
- if( resultObj.getRequestEvent() == "CHK_REJECT" ) {
- var vo = resultObj.getValueObject();
- var check = vo.get('checkFlag');
- if(check == 0){ //가능
-
- document.form1.isSubmit = false;
- runRejection();
-
- }else{
-
- document.form1.isSubmit = false;
- alert("이미 결제중입니다.");
-
- }
- }
- if( resultObj.getRequestEvent() == "CHK_APPVAR" ) {
- var vo = resultObj.getValueObject();
- var check = vo.get('checkFlag');
- if(check == 0){ //가능
-
- document.form1.isSubmit = false;
-
- if (jQuery("#btnAppReqSelect").val() == "2") { //Invoice결재
- runInvoice();
-
- } else {
- jQuery("#btnAppReqSelect").val("0");
- runApproval();
- }
-
- }else{
-
- document.form1.isSubmit = false;
- alert("이미 결제중입니다.");
-
- }
- }
-
- if( resultObj.getRequestEvent() == "GET_RATE" ) {
- var vo = resultObj.getValueObject();
- document.form1.isSubmit = false;
- var rate = vo.get('rate');
- var rateAmt = vo.get('rateAmt');
- var rateVamt = vo.get('rateVamt');
-
- jQuery("#rateEx").val(rate);
- jQuery("#rateAmt").val(rateAmt);
- jQuery("#rateVamt").val(rateVamt);
- jQuery("#rateEx, #rateAmt, #rateVamt").each(function(index) {
- jQuery(this).val(jQuery(this).val().split(/(?=(?:\d{3})+(?:\.|$))/g).join(','));
- });
-
- }
-
-
- if (resultObj.getRequestEvent() == "GET_DATA") {
- if (resultObj.getSuccess()) {
- var subContId = resultObj.getValueObject().get("SUB_CONT_ID");
- if (subContId != "") {
- jQuery("#subContId").val(subContId);
- var causeCode = resultObj.getValueObject().get("CAUSECODE");
- jQuery("#causeCode").val("당초");
- var guarOnoffYn = resultObj.getValueObject().get("GUAR_ONOFF_YN");
- jQuery("#guarOnoffYn").val(guarOnoffYn);
- var warrGoffice = resultObj.getValueObject().get("WARR_GOFFICE");
- jQuery("#warrGoffice").val(warrGoffice);
- var guarStatus = resultObj.getValueObject().get("GUAR_STATUS");
- jQuery("#guarStatus").val(guarStatus);
- var paperDate = resultObj.getValueObject().get("PAPERDATE");
- jQuery("#paperDate").val(paperDate);
- var warrWgno = resultObj.getValueObject().get("WARR_WGNO");
- jQuery("#warrWgno").val(warrWgno);
- var warrWamt = resultObj.getValueObject().get("WARR_WAMT");
- jQuery("#warrWamt").val(warrWamt);
- jQuery("#warrWamt").each(function(index) {
- jQuery(this).val(jQuery(this).val().split(/(?=(?:\d{3})+(?:\.|$))/g).join(','));
- });
- var warrSdateEdate = resultObj.getValueObject().get("WARR_SDATE_EDATE");
- jQuery("#warrSdateEdate").val(warrSdateEdate);
- }
- } else {
- dlgErrorMsg(resultObj);
- }
- document.form1.isSubmit = false;
- }
- if( resultObj.getRequestEvent() == "RNNC_DATA" ) {
- if( resultObj.getSuccess() ) {
- alert("포기완료 되었습니다.");
- jQuery("#btnList").click();
- }else{
- dlgErrorMsg(resultObj);
- }
- document.form1.isSubmit = false;
- }
-
- } catch (errorObject) {
- showErrorDlg("doResult()", errorObject);
- }
- }
- //저장 후 선급신청 처리
- function btnAppReqProcess() {
- var f = document.form1;
- jQuery("#fevent").val("REQ_DATA");
- submitXmlRequest("/payment/purchase/Prepayments_form.screen","REQ_DATA", f, "SUCCESS");
- }
- //상세화면 재조회
- function reSearch() {
- jQuery("#fevent").val("");
- jQuery("#form1").attr("action", "/payment/purchase/Prepayments.screen");
- jQuery("#form1").attr("target", "_self");
- jQuery("#form1").attr("method", "post");
- jQuery("#form1").submit();
- }
-
- function doKeyPress() {
- if (event.keyCode == 13) {
- doSearch(document.all.sheet1)
- }
- }
- function calendar(thisDayObj) {
- dlgCalendar(thisDayObj);
-
- }
-
- //첨부파일
- function doAttachFile(obj, No) {
- if (obj.value == '') {
- //alert("After you have saved, you can attach a file.");
- alert("데이터를 저장 후, 파일을 첨부할 수가 있습니다.");
- } else if (obj.value != '') {
- var upLoadFlg = "Y";
- if (jQuery("#statusCd").val() == "04" || jQuery("#statusCd").val() == "10" || jQuery("#statusCd").val() == "11") { //선급금 상태값이 03:선급금신청, 04:결재중, 10:선급완료, 11:폰기완료면 다운만
- upLoadFlg = "N";
- }
- if('<%= user.get("ACCT_TYPE_CODE")%>' == "ADMIN"){
- upLoadFlg = "Y";
- }
-
-
- if (No == 1) {
- viewFileListNew('PREPAYMENTS_GIVEUP', obj.value, document.getElementById("p_AttachFile1"), upLoadFlg, "prepay/purchase/"+obj.value);
- } else if (No == 2) {
- viewFileListNew('TAX_BILL', obj.value, document.getElementById("p_AttachFile2"), upLoadFlg, "prepay/purchase/"+obj.value);
- } else if (No == 3) {
- viewFileListNew('PREPAYMENTS_INVOICE', obj.value, document.getElementById("p_AttachFile3"), upLoadFlg, "prepay/purchase/"+obj.value);
- } else {
- viewFileListNew('PREPAYMENTS_BILLING', obj.value, document.getElementById("p_AttachFile4"), upLoadFlg, "prepay/purchase/"+obj.value);
- }
- }
- }
- //보증정보 조회
- function callback_getContWarr() {
- var f = document.form1;
- jQuery("#fevent").val("GET_DATA");
- submitXmlRequest("/portal/payment/AdvencePayRequest_form.screen","GET_DATA", f, "VALUEOBJECT");
- }
- //보증정보팝업 호출
- function popContWarr(wG, wSeq, wCauseCd) {
- if (jQuery("#prepayId").val() == "") {
- alert("데이터를 저장 후, 보증정보를 입력할 수가 있습니다.");
- return;
- }
-
- var win_id = "contPurWarrPopup";
- var param = "";
- var param = "?purContModId=" + jQuery("#subContModId").val();
- var param = param + "&warrGubun=" + wG;
- var param = param + "&warrSeq=" + wSeq;
- var param = param + "&causeCode=" + wCauseCd;
- var param = param + "&viewDiv=PREPAY";
- var param = param + "&prepayId=" + jQuery("#prepayId").val();
- var param = param + "&pop_win_id=" + win_id;
- var param = param + "&sModule=EB";
-
- var url = "/portal/guar/contPurWarrPopup.screen"+param;
-
- fLayerPop(win_id, url, 560,380, '','', 'NO');
- }
- //보증정보팝업 종료후 액션
- function popContWarrClose(returnValue){
- if(returnValue == null){
- fLayerPopClose('contPurWarrPopup');
- }else{
- fLayerPopClose('contPurWarrPopup');
- reDisplay();
- }
- }
- function doAttachFilePop(obj, No, fObj, fileGB, fileDir) {
- var editFile = "";
- if(obj==''){
- alert("After you have saved, you can attach a file.");
- }
- else if(obj != ''){
- if(fObj.guarStatus.value != "02"){editFile="N";}else{editFile="Y";}
- if('<%= user.get("ACCT_TYPE_CODE")%>' == "ADMIN"){
- editFile = "Y";
- }
-
- viewFileListNew(fileGB, obj.value, fObj.p_AttachFileGuar1, editFile, fileDir, "contPurWarrPopup");
- }
- }
- //결재
- function dlgSignForm( sign_class_cd, uri ) {
-
- var f = document.form1;
- var sheet1 = document.all.sheet1;
- var tmpslip_prepayId = f.prepayId.value;
- var tmpslip_subContModId = f.subContModId.value;
- var url = "/slipSign/preSign_form.screen";
- url += "?sign_class_cd=" + sign_class_cd;
- url += "&uri=" + uri;
- url += "&tmpslip_prepayId=" + tmpslip_prepayId;
- url += "&tmpslip_subContModId=" + tmpslip_subContModId;
- url += "&slip_dept=" + f.dept_cd.value;
- url += "&slip_dt=" + f.date1.value;
- url += "&acct_type=1";
-
- if(confirm("결재 하시겠습니까?") ){
- //f.slip_dt.value = '';
- //f.sign_chk.value = "Y";
- //openWindowCenter(url, "sign_form", 200, 100, "");
- window.open(url, "_blank","width=200,height=100,SCROLLBARS=no");
- }else{
- return;
- }
- }
- function runApproval(){
-
- document.form1.isSubmit = false;
- var f = document.form1;
- var tmpslip_prepayId = f.prepayId.value;
- var tmpslip_subContModId = f.subContModId.value;
- dlgSignForm('ebid_pprpyD', '/payment/purchase/PreRequestSign.screen?tmpslip_prepayId='+tmpslip_prepayId+'^tmpslip_subContModId='+tmpslip_subContModId+'^acct_type=1^sign_type=1' );
- }
-
- function runRejection(){
-
- var win_id = "Rejection";
- var link = "/payment/outside/RejectionPopup.screen";
- link += "?pop_win_id="+win_id;
- link += "&prepayId=" + jQuery("#prepayId").val();
- link += "&pageDiv=3"
- fLayerPop(win_id, link, 620, 220, '', '', 'NO');
-
- }
- //
- function runInvoice(){
-
- var f = document.form1;
- jQuery("#btnAppReqSelect").val("2"); //0:저장처리, 1:선급신청처리
- jQuery("#fevent").val("SAVE_DATA");
-
- submitXmlRequest("/payment/purchase/Prepayments_form.screen", "SAVE_DATA", f, "SUCCESS");
- }
-
- function RejectionPopupClose(){
- //alert();
- setTimeout(function(){fLayerPopClose('Rejection');},100);
- reDisplay();
- }
-
- /**
- * 첨부파일 예약 함수
- */
- function fileDown(file_id){
- var url="/common/file/FileDownloadServlet";
- url += "?file_id=" + file_id;
-
- 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")
- }
-
- function gubSave(div){
- if(div == '0'){ //분계유형저장
- var pKey = jQuery("#subContModId").val();
- var f = document.form1;
- jQuery("#pKey").val(pKey);
- //분계유형 저장
- if (confirm("분계유형을 저장 하시겠습니까?")) {
- jQuery("#fevent").val("SAVE_GUA");
- submitXmlRequest("/payment/purchase/Prepayments_form.screen", "SAVE_GUA", f, "SUCCESS");
- }
- }else{
- var pKey = jQuery("#prepayId").val();
- var f = document.form1;
- jQuery("#pKey").val(pKey);
- //세금계산서정보 저장
- if (confirm("세금계산서정보을 저장 하시겠습니까?")) {
- jQuery("#btnAppReqSelect").val("2");
- jQuery("#fevent").val("SAVE_SEGUM");
- submitXmlRequest("/payment/purchase/Prepayments_form.screen", "SAVE_SEGUM", f, "SUCCESS");
- }
- }
- }
-
- //2017.2.27 외국환거래신고
- function PopClose(win_id,result){
- if( result != null ){
- if(result[0] == 2){ //2017.2.27 외국환거래신고
- setTimeout(function(){ fLayerPopClose(win_id);},100);
- if(result[1].length> 0)alert(result[1]);
- $("#FOREIGN_CHK").val(result[2]);
- $("#FOREIGN_NM").val(result[3]);
- }
- }else{
- setTimeout(function(){ fLayerPopClose(win_id); },100);
- }
-
- }
-
- </SCRIPT>
- <modular:search id="form1">
- <modular:key id="fevent" />
- </modular:search>
- <form id="form1" name="form1" method="post" modular:type="search">
- <INPUT type="hidden" name="fevent" id="fevent" value="">
- <INPUT type="hidden" name="selectSubContModId" id="selectSubContModId" value="<%=params.get("selectSubContModId") %>">
- <INPUT type="hidden" name="subContModId" id="subContModId" value="<%=prePayment.get("SUB_CONT_MOD_ID") %>">
- <INPUT type="hidden" name="prepayId" id="prepayId" value="<%=prePayment.get("PREPAY_ID") %>">
- <INPUT type="hidden" name="corpId" id="corpId" value="<%=prePayment.get("CON_CORP_ID") %>">
- <INPUT type="hidden" name="orgReqPrepaySupplyTamt" id="orgReqPrepaySupplyTamt" value="<%=prePayment.get("REQ_PREPAY_SUPPLY_TAMT") %>">
- <INPUT type="hidden" name="orgReqPrepaySupplyNamt" id="orgReqPrepaySupplyNamt" value="<%=prePayment.get("REQ_PREPAY_SUPPLY_NAMT") %>">
- <INPUT type="hidden" name="statusCd" id="statusCd" value="<%=prePayment.get("STATUS_CD") %>">
- <INPUT type="hidden" name="subContId" id="subContId" value="<%=prePayment.get("SUB_CONT_ID") %>">
- <INPUT type="hidden" name="btnAppReqSelect" id="btnAppReqSelect" value="0">
- <INPUT type="hidden" name="lastDate" id="lastDate" value="">
- <INPUT type='hidden' name="FOREIGN_CHK" value="<%=prePayment.get("FOREIGN_CHK")%>">
- <!-- 기성신청상태구분 -->
- <INPUT type="hidden" name="selectStatusCd" id="selectStatusCd" value="">
- <!-- 기성신청상태 -->
- <INPUT type='hidden' id="signeddata" name="signeddata" value="">
- <INPUT type="hidden" name="creBy" id="creBy" value="<%=creby %>">
- <INPUT type="hidden" name="updBy" id="updBy" value="<%=updby %>">
- <!-- 리스트 페이지 검색 조건 -->
- <INPUT type='hidden' id="searchBuildName" name="searchBuildName" value="<%=params.get("searchBuildName") %>"> <!-- 계약명 -->
- <INPUT type='hidden' id="searchStatusCd" name="searchStatusCd" value="<%=params.get("searchStatusCd") %>"> <!-- 상태값 -->
- <INPUT type='hidden' id="searchDeptCd" name="searchDeptCd" value="<%=params.get("searchDeptCd") %>">
- <INPUT type='hidden' id="searchDeptNm" name="searchDeptNm" value="<%=params.get("searchDeptNm") %>">
- <INPUT type='hidden' id="searchSignDt_from" name="searchSignDt_from" value="<%=params.get("searchSignDt_from") %>">
- <INPUT type='hidden' id="searchSignDt_to" name="searchSignDt_to" value="<%=params.get("searchSignDt_to") %>">
- <INPUT type='hidden' id="resultListDiv" name="resultListDiv" value="<%=params.get("resultListDiv") %>">
-
- <INPUT type='hidden' id="pKey" name="pKey" value="">
-
- <INPUT type='hidden' id="dept_cd" name="dept_cd" value="<%=prePayment.get("dept_cd") %>"> <!-- 현장코드 -->
-
- <INPUT type='hidden' id="resUserName" name="resUserName" value="<%=prePayment.get("RES_USER_NAME") %>"> <!-- 계약담당자 -->
- <INPUT type='hidden' id="resHp" name="resHp" value="<%=prePayment.get("RES_HP") %>"> <!-- 계약담당자 핸드폰번호 -->
- <INPUT type='hidden' id="resEmail" name="resEmail" value="<%=prePayment.get("RES_EMAIL") %>"> <!-- 계약담당자 이메일 -->
- <INPUT type='hidden' id="resDivision" name="resDivision" value="<%=prePayment.get("RES_DIVISION") %>">
- <INPUT type='hidden' id="conDocNo" name="conDocNo" value="<%=prePayment.get("CON_DOC_NO") %>"> <!-- 발주계약번호 -->
- <INPUT type="hidden" name="bugase" id="bugase" value="<%=prePayment.get("CHG_CODE10") %>">
- <INPUT type="hidden" name="CNT" id="CNT" value="<%=prePayment.get("CNT") %>">
- <INPUT type="hidden" name="SUPP_DIRECT_YN" id="SUPP_DIRECT_YN" value="N"> <!-- 하도급직불여부 제거 -->
-
- <!-- 제목 및 버튼 -->
- <table width="100%">
- <colgroup>
- <col width="500" />
- <col width="*" />
- </colgroup>
- <tr>
- <th>
- <div align="left" id="title">
- <ul>
- <li>구매_선급금현황 상세(<span style="font-size: 11px"><%=prePayment.get("STATUS_NM")%></span>)</li>
- </ul>
- </div>
- </th>
- <td align="right">
- <span id="spanBtnSave" class="btnSearch center" style="display: none"><a href="javascript:void(0);" id="btnSave">저장</a></span>
- <span id="spanBtnDelete" class="btnSearch center" style="display: none"><a href="javascript:void(0);" id="btnDelete">삭제</a></span>
- <span id="spanBtnAppReq" class="btnSearch center" style="display: none"><a href="javascript:void(0);" id="btnText">신청요청</a></span>
- <span id="spanComRnnc" class="btnSearch center" style="display: none"><a href="javascript:void(0);" id="btnComRnnc">선급금 포기완료</a></span>
- <span id="spanBtnApproval" class="btnSearch center" style="display: none"><a href="javascript:void(0);" id="btnApproval">결재</a></span>
- <span id="spanBtnInvoiceApproval" class="btnSearch center" style="display: none"><a href="javascript:void(0);" id="btnInvoiceApproval">결재</a></span>
- <span id="spanBtnRejection" class="btnSearch center" style="display: none"><a href="javascript:void(0);" id="btnRejection">반려</a></span>
- <span id="spanBtnList" class="btnSearch center" style="display: none"><a href="javascript:void(0);" id="btnList">목록</a></span>
- </td>
- </tr>
- </table>
- <%
- if(!prePayment.get("RTN_REASON").equals("")){
- %>
- <div class="application-info magT10">
- <div class="application-sub-title">
- <span class="title">반려정보</span>
- </div>
- <div class="application-location"></div>
- </div>
- <TABLE class="form-table">
- <colgroup>
- <col width="13%" />
- <col width="*" />
- </colgroup>
- <TR height="25">
- <th style="text-align: left;">반려일</th>
- <TD><%=prePayment.get("RTN_DATE")%></TD>
- </TR>
- <TR>
- <th style="text-align: left;">반려사유</th>
- <TD><%=prePayment.get("RTN_REASON")%></TD>
- </TR>
- </TABLE>
- <%
- }else if(!prePayment.get("TAX_RTN_REASON").equals("")){
- %>
- <div class="application-info magT10">
- <div class="application-sub-title">
- <span class="title">반려정보</span>
- </div>
- <div class="application-location"></div>
- </div>
- <TABLE class="form-table">
- <colgroup>
- <col width="13%" />
- <col width="*" />
- </colgroup>
- <TR height="25">
- <th style="text-align: left;">반려일</th>
- <TD><%=prePayment.get("TAX_RTN_DATE")%></TD>
- </TR>
- <TR>
- <th style="text-align: left;">반려사유</th>
- <TD><%=prePayment.get("TAX_RTN_REASON")%></TD>
- </TR>
- </TABLE>
- <%
- }
- %>
- <div class="application-info magT10">
- <div class="application-sub-title">
- <span class="title">기본정보</span>
- </div>
- <div class="application-location"></div>
- </div>
- <TABLE class="form-table">
- <colgroup>
- <col width="13%" />
- <col width="20%" />
- <col width="13%" />
- <col width="20%" />
- <col width="13%" />
- <col width="*" />
- </colgroup>
- <TR height="25">
- <th style="text-align: left;">현장명</th>
- <TD><%= InputText.get("deptName", prePayment.get("DEPT_NAME"), 100, 30, "class=input_blank, readOnly=white, string, left, perSize, tabIndex=-1", "string") %></TD>
- <th style="text-align: left;">계약명</th>
- <TD><%= InputText.get("buildName", prePayment.get("BUILD_NAME"), 100, 30, "class=input_blank, readOnly=white, string, left, perSize, tabIndex=-1", "string") %></TD>
- <th style="text-align: left;">통화</th>
- <TD><%= InputText.get("conCurCd", prePayment.get("CON_CUR_CD"), 100, 30, "class=input_blank, readOnly=white, string, left, perSize, tabIndex=-1", "string") %></TD>
- </TR>
- <TR>
- <th style="text-align: left;">사업자번호</th>
- <TD><%= InputText.get("vendCd", prePayment.get("CORP_REG_NO"), 100, 30, "class=input_blank, readOnly=white, string, left, perSize, tabIndex=-1", "string") %></TD>
- <th style="text-align: left;">계약업체명</th>
- <TD><%= InputText.get("memberName", prePayment.get("CORP_KOR"), 100, 30, "class=input_blank, readOnly=white, string, left, perSize, tabIndex=-1", "string") %></TD>
- <th style="text-align: left;">대표이사</th>
- <TD><%= InputText.get("bossName", prePayment.get("BOSS_NAME"), 100, 30, "class=input_blank, readOnly=white, string, left, perSize, tabIndex=-1", "string") %></TD>
- </TR>
- <TR>
- <th style="text-align: left;">공사기간</th>
- <TD><%= InputText.get("startEndWorkDate", prePayment.get("START_END_WORK_DATE"), 100, 30, "class=input_blank, readOnly=white, string, left, perSize, tabIndex=-1", "string") %></TD>
- <th style="text-align: left;">계약금액</th>
- <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>
- <th style="text-align: left;">선급금액</th><!--2018.07.11 PREPAY_SUPPLY_AMT -->
- <TD><%= InputText.get("conPrepayAmt", Formatter2.currency(prePayment.get("ORG_SUPPLY_AMT"), intDigit)+" (부가세 별도)", 100, 30, "class=input_blank, readOnly=white, string, left, perSize, tabIndex=-1", "string") %></TD>
- </TR>
- <TR>
- <th style="text-align: left;">외국환거래 신고대상</th>
- <TD>
- <%if (prePayment.get("CON_CUR_CD").equals("KRW")) { %>
- 비대상
- <%}else{ %>
- <%= InputText.get("FOREIGN_NM", prePayment.get("FOREIGN_NM"), 10, 10, "readOnly") %>
- <span class="btnSearch center" id="btn_foreign"><a href="javascript:void(0);">검토</a></span>
- <%} %></TD>
- <th style="text-align: left;">선급금액 변경사유</th>
- <TD colspan = "3"><%= InputText.get("chgReason", prePayment.get("CHG_REASON"), 99, 1000, "string, left, perSize ", "string") %>
- </TD>
- </TR>
- </TABLE>
- <%
- // PayGroup_PaymentTerms Mapping Object 구하기
- ContCodeManager payGroupMappingUtil = new ContCodeManager();
- storage.addObject("category", payGroupMappingUtil.getJSONNotation());
- String category = (String)storage.getObject("category");
- //System.out.println(category);
- %>
- <script>
- var gCategoryJSON = null;
- var rawData = <%= category%>; // 서버로부터 JSON 표현식 받기
- gCategoryJSON = eval( rawData ); // JSON객체를 만들어 global 변수에 저장
- function changePaymentTerms(selObj) {
- var ct = getCategory(selObj.value); // JSON 객체에서 해당하는 PAYMENT TERMS 데이타 꺼내기
- if (!ct) {
- dlgAlert('오류가 발생하였습니다.<br>전산실로 연락주세요.');
- return false;
- }
- injectSelect(document.getElementById("payment_terms_id"), ct); // PAYMENT TERMS Select Box 채우기
- jQuery('#payment_terms_id').attr('disabled', 'true');
- }
-
- // JSON 객체에서 해당하는 PAYMENT TERMS 데이타 꺼내기
- function getCategory(payGroup) {
- return gCategoryJSON.paymentTerms[payGroup];
- }
- //직군 데이타를 Select Box에 주입
- function injectSelect(elSel, rows) {
- elSel.length = 0; // clear
-
- for (var i=0; i<rows.length; i++) {
- var row = rows[i];
- var elOptNew = document.createElement('option');
- elOptNew.value = row.CODE; // 코드
- elOptNew.text = row.NAME; // 명칭
- try {
- elSel.add(elOptNew, null); // standards compliant; doesn't work in IE
- } catch(ex) {
- elSel.add(elOptNew); // IE only
- }
-
- if(jQuery("#payTerms").val() == row.CODE){
- elSel.options[i].selected = true;
- }
- }
- }
- /**
- * 집행내역코드 검색(공무)
- */
- function popSearchPayItem()
- {
- var win_id = "_searchPayItemPopup";
- var link = "/cont/outside/payItemCodePopup.screen";
- link += "?pop_win_id="+win_id;
- link += "&gb=SUB";
- link += "&req=0";
- link += "&site=" + document.form1.dept_cd.value;
- fLayerPop(win_id, link, 600,400, '', '', 'NO');
- }
- //f.dept_cd, f.pay_item, f.cost_code, f.cost_type, f.estdesc, '', f.estamt
- function SearchPayItemClose(result){
- if(result != null){
- $("#pay_item").val(result[0]);
- $("#cost_code").val(result[1]);
- $("#cost_type").val(result[2]);
- $("#estdesc").val(result[3]);
- //obj_estamt.value = result[4];
- }
- fLayerPopClose('_searchPayItemPopup');
- }
-
- function chProofCd(obj){
-
- //통화가KRW가 아니고 분계유형에 증빙종류[기타]이면 invlice고정
- var conCurCd = jQuery("#conCurCd").val();
- var proof_cd = obj.value
-
- if(conCurCd != "KRW"){
- if(proof_cd == "Z99"){
- jQuery("#chk_1").prop("checked", false);
- jQuery("#chk_2").prop("checked", false);
- jQuery("#chk_3").prop("checked", true);
- jQuery("#chk_1").attr("disabled",true);
- jQuery("#chk_2").attr("disabled",true);
- jQuery("#chk_3").attr("disabled",false);
- btnCtr();
- }else if(proof_cd != "Z99"){
- jQuery("#chk_1").prop("checked", true);
- jQuery("#chk_2").prop("checked", false);
- jQuery("#chk_3").prop("checked", false);
-
- jQuery("#chk_1").attr("disabled",false);
- jQuery("#chk_2").attr("disabled",false);
- jQuery("#chk_3").attr("disabled",true);
- btnCtr();
- }
-
- var radioCheck = jQuery(':radio[name="chk_info"]:checked').val(); //세금계산서 발행방법
- if (radioCheck == "1") { //역발행
- jQuery("#taxAttachments").hide();
- jQuery("#taxTrRow").hide();
- jQuery("#invoiceAttachments").hide();
- jQuery("#invoiceTrRow").hide();
- } else if (radioCheck == "2"){ //순발행
- jQuery("#taxAttachments").show();
- jQuery("#taxTrRow").show();
- jQuery("#invoiceAttachments").hide();
- jQuery("#invoiceTrRow").hide();
- }else{
- jQuery("#taxAttachments").hide();
- jQuery("#taxTrRow").hide();
- jQuery("#invoiceAttachments").show();
- jQuery("#invoiceTrRow").show();
- }
- }
- }
- </script>
- <!-- 분개유형 -->
- <div class="application-info magT10">
- <div class="application-sub-title">
- <span class="title">분개유형</span>
- </div>
- <div class="application-location">
- <span id="spanGubSave" class="btnSearch center" style="display: none"><!-- <a href="javascript:void(0);" onclick="gubSave('0');" id="btnGubSave">분계유형저장</a> --></span>
- </div>
- </div>
- <TABLE class="form-table">
- <colgroup>
- <col width="13%" />
- <col width="20%"/>
- <col width="13%" />
- <col width="20%"/>
- <col width="13%" />
- <col width="*" />
- </colgroup>
- <TR height="25">
- <TH>분개유형</TH>
- <%-- <TD><%= ContCodeManager.getCcsifSelectCodeList("SUB_ACCT_GB", "acct_gb", "width:100%;", "", ContInfo.get("acct_gb")) %></TD> --%> <!-- 외주 분계유형 -->
- <TD><%= ContCodeManager.getCcsifSelectCodeList("PUR-ACCT_GB", "acct_gb", "width:100%;", "", ContInfo.get("acct_gb"), ContInfo.get("dept_cd"), ContInfo.get("pay_div")) %></TD>
- <TH>증빙종류</TH>
- <TD><%= ContCodeManager.getProofCdSelectTag("proof_cd", "width:100%;", "onchange=chProofCd(this);", "", ContInfo.get("GUA_GB"), "Y") %></TD>
- <TH>PAY GROUP</TH>
- <input type="hidden" id="payTerms" name="payTerms" value="<%=ContInfo.get("PAYMENT_TERMS")%>">
- <TD><%= ContCodeManager.getPayGroupSelectTag("pay_group", "width:100%;", "onchange=changePaymentTerms(this);", "", ContInfo.get("pay_group"), ContInfo.get("ac_unit_cd")) %></TD>
- </TR>
- <TR height="25">
- <TH>PAYMENT TERMS</TH>
- <TD colspan="5">
- <SELECT class='input_select' id='payment_terms_id' name='payment_terms_id' style='width:20%;'>
- </SELECT>
- </TD>
- </TR>
- </TABLE>
- <script>
- changePaymentTerms(document.form1.pay_group);
- setSelect(document.form1.payment_terms_id, '<%= ContInfo.get("payment_terms") %>');
- </script>
- <div class="application-info magT10">
- <div class="application-sub-title">
- <span class="title">세금계산서 정보</span>
- </div>
- <div class="application-location">
- <span id="spanTaxSave" class="btnSearch center" style="display: none"><a href="javascript:void(0);" onclick="gubSave('1');" id="btnGubSave">세금계산서저장</a></span>
- </div>
- </div>
- <TABLE class="form-table">
- <colgroup>
- <col width="13%" />
- <col width="20%" />
- <col width="13%" />
- <col width="20%" />
- <col width="13%" />
- <col width="*" />
- </colgroup>
- <TR>
- <th style="text-align: left;">세금계산서 발행방법</th>
- <TD colspan="3">
- <input type="radio" id="chk_1" name="chk_info" value="1" onclick="taxDataSet();" <%= check1 %>> 역발행(SGC이앤씨 발행)
- <input type="radio" id="chk_2" name="chk_info" value="2" onclick="taxDataSet();" <%= check2 %>> 순발행(업체직접 발행)
- <input type="radio" id="chk_3" name="chk_info" value="3" onclick="taxDataSet();" <%= check3 %>> Invoice
- </TD>
- <th style="text-align: left;">작성일자(증빙일자)</th>
- <TD><%= InputText.get("date1", Formatter.formatDate(prePayment.get("TAX_DY"), "-"), 30, 10, "Center, date, PerSize, readonly", "date", "") %>
- <A href="JavaScript:calendar('date1');"><IMG src="/img/supplier/template/bt_calender.gif" alt="달력" border="0" align="absmiddle"></A>
- </TD>
- </TR>
- <TR>
- <th class="required" style="text-align: left;">담당자명</th>
- <TD><%= InputText.get("userName", taxChargNm, 98, 6, "string, left, perSize", "string") %></TD>
- <th class="required" style="text-align: left;">담당자 핸드폰번호</th>
- <TD><input type="text" class="input" id="hp" name="hp" value="<%=taxChargHp %>" style="width: 44%" size="13" maxlength="13" alt="left"> ex)010-0000-0000</TD>
- <th class="required" style="text-align: left;">담당자 이메일</th>
- <TD><%= InputText.get("eMail", taxChargEmail, 98, 40, "string, left, perSize", "string") %></TD>
- </TR>
- <TR>
- <TH>환율</th>
- <TD>
- <%-- <%= InputText.get("rateEx", Formatter2.currency(prePayment.get("rateEx"), intDigit), 98, 30, "class=input_blank, readOnly=white, string, left, perSize, tabIndex=-1", "string") %> --%>
- <%= InputText.get("rateEx", Formatter2.currency(prePayment.get("rateEx"), currency_digit), 98, 30, "class=input_blank, readOnly=white, string, left, perSize, tabIndex=-1", "string") %>
- </TD>
- <TH>환율연산금액</th><!-- 2017.1.31 환율연산 소수점제외 intDigit-->
- <TD colspan="3">공급가:<%= InputText.get("rateAmt", Formatter2.currency(prePayment.get("rateAmt"), 0), 20, 30, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %>, 부가세:<%= InputText.get("rateVamt", Formatter2.currency(prePayment.get("rateVamt"), 0), 20, 30, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %>
-
- </TD>
- </TR>
- </TABLE>
- <!-- 세금계산서정보 : 끝 -->
- <div class="application-info magT15">
- <div class="application-sub-title">
- <span class="title">선급금정보</span>
- </div>
- </div>
- <TABLE class="form-table">
- <colgroup>
- <col width="13%" />
- <col width="20%" />
- <col width="13%" />
- <col width="20%" />
- <col width="13%" />
- <col width="*" />
- </colgroup>
- <TR>
- <th style="text-align: left;">신청구분</th>
- <TD><%= HTMLMaker.getSelectTag(perpayReqDivComboList, "DETAILCD", "DETAILNM", "perpayReqDiv", "width:80%;height=18;' onChange='inputDataSet();", "", prePayment.get("REQ_DIV_CD")) %></TD>
- <%-- <th style="text-align: left;">하도급직불여부</th>
- <TD> <input type="radio" name="SUPP_DIRECT_YN" value="Y" <%=prePayment.get("SUPP_DIRECT_YN").equals("Y") ? "checked=\"checked\"" : ""%>>예
- <input type="radio" name="SUPP_DIRECT_YN" value="N" <%=prePayment.get("SUPP_DIRECT_YN").equals("N") ? "checked=\"checked\"" : ""%>>아니오
- </TD> --%>
- <th style="text-align: left;">신청(서명)일시</th>
- <TD colspan="2"><%= InputText.get("custSignDate", prePayment.get("CUST_SIGN_DATE"), 100, 50, "class=input_blank, readOnly=white, string, left, perSize, tabIndex=-1", "string") %></TD>
- </TR>
- </TABLE>
- <img src="/img/com/blank.gif" height="10px" />
- <TABLE class="form-table" style="table-layout: fixed;">
- <colgroup>
- <col width="10%">
- <col width="10%">
- <col width="20%">
- <col width="10%">
- <col width="10%">
- <col width="10%">
- <col width="10%">
- <col width="10%">
- <col width="*">
- </colgroup>
- <TR>
- <th rowspan="1" colspan="2" style="text-align: center;">구분</th>
- <th rowspan="1" style="text-align: center;">합계</Th>
- <th colspan="2" style="text-align: center;">공급가액</Th>
- <th colspan="2" style="text-align: center;">부가세</Th>
- <th colspan="2" style="text-align: center;">요율</Th>
- </TR>
- <TR>
- <th rowspan="2" style="text-align: center;">계약</Th>
- <th style="text-align: center;">계약금액</Th>
- <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>
- <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>
- <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>
- <TD colspan="2" align="right"><%= InputText.get("conAmtPercent", "100.0", 98, 16, "class=input_blank, readOnly=white, string, right, perSize, tabIndex=-1", "string") %></TD>
- </TR>
- <TR>
- <th style="text-align: center;">선급금액</Th>
- <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>
- <TD colspan="2" align="right"><%= InputText.get("subPrepaySupplyAmt", Formatter2.currency(prePayment.get("PREPAY_SUPPLY_AMT"), intDigit), 98, 16, " float, right, perSize ", "float") %></TD>
- <TD colspan="2" align="right"><%= InputText.get("subPrepaySurtaxAmt", Formatter2.currency(prePayment.get("PREPAY_SURTAX_AMT"), intDigit), 98, 16, " float, right, perSize ", "float") %></TD>
- <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>
- </TR>
- <TR>
- <th rowspan="2" style="text-align: center;">선급</Th>
- <th style="text-align: center;">신청금액</Th>
- <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>
- <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>
- <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>
- <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>
- </TR>
- <TR>
- <th style="text-align: center;">포기금액</Th>
- <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>
- <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>
- <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>
- <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>
- </TR>
- </TABLE>
- <div class="application-info magT15">
- <div class="application-sub-title">
- <span class="title">첨부파일</span>
- </div>
- </div>
- <!-- 첨부파일 : 시작 -->
- <TABLE class="form-table">
- <colgroup>
- <col width="5%">
- <col width="6%">
- <col width="11%">
- <col width="11%">
- <col width="11%">
- <col width="11%">
- <col width="11%">
- <col width="11%">
- <col width="*">
- </colgroup>
- <TR>
- <th colspan="2" style="text-align: center;">구분</Th>
- <th colspan="5" style="text-align: center;">첨부파일명</Th>
- <th colspan="2" style="text-align: center;">첨부파일</Th>
- </TR>
- <TR>
- <TD colspan="2">선급금 포기각서<span id="p_Attach1">(해당없음)</span></TD>
- <%-- <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> --%>
- <TD colspan="5" align="left">
- <table width="100%">
- <colgroup>
- <col width="99%" />
- </colgroup>
- <tr>
- <td>
- <div id="p_AttachFile1" class="attach_file_view">
- <%=FileManager.getFileListForDiv("PREPAYMENTS_GIVEUP", prePayment.get("PREPAY_ID")) %>
- </div>
- </td>
- <tr>
- </table>
- </TD>
- <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>
- </TR>
- <TR id="taxTrRow">
- <TD colspan="2" align="center">세금계산서</TD>
- <%-- <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> --%>
- <TD colspan="5" align="left">
- <table width="100%">
- <colgroup>
- <col width="99%" />
- </colgroup>
- <tr>
- <td>
- <div id="p_AttachFile2" class="attach_file_view">
- <%=FileManager.getFileListForDiv("TAX_BILL", prePayment.get("PREPAY_ID")) %>
- </div>
- </td>
- <tr>
- </table>
- </TD>
- <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>
- </TR>
- <TR id="invoiceTrRow">
- <TD colspan="2" align="center">Invoice</TD>
- <TD colspan="5" align="left">
- <table width="100%">
- <colgroup>
- <col width="99%" />
- </colgroup>
- <tr>
- <td>
- <div id="p_AttachFile3" class="attach_file_view">
- <%=FileManager.getFileListForDiv("PREPAYMENTS_INVOICE", prePayment.get("PREPAY_ID")) %>
- </div>
- </td>
- <tr>
- </table>
- </TD>
- <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>
- </TR>
- <TR>
- <TD colspan="2">대금청구</TD>
- <TD colspan="5" align="left">
- <table width="100%">
- <colgroup>
- <col width="99%" />
- </colgroup>
- <tr>
- <td>
- <div id="p_AttachFile4" class="attach_file_view">
- <%=FileManager.getFileListForDiv("PREPAYMENTS_BILLING", prePayment.get("PREPAY_ID")) %>
- </div>
- </td>
- <tr>
- </table>
- </TD>
- <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>
- </TR>
- </TABLE>
- <!-- 첨부파일 : 끝 -->
-
- <%if(warrList.size()>0){%>
- <%
- /*
- 보증 목록을 include 시킴 (2014-10-16) 김명호
- */
- %>
- <%@ include file="/jsp/ko_KR/buyer/cont/purchase/guarList.jsp" %>
- <%
- }
- %>
- </FORM>
|