123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623 |
- /***************************************************************************************************************
- *
- * racfGetCashAcntCd 현금계정코드를 반환한다.
- *
- * racfAcntValidCheck 계정코드 엔터 및 값변경시 조회 함수
- * racfDeptValidCheck 부서코드 엔터 및 값변경시 조회 함수
- * racfNoteValidCheck 기재사항 엔터 및 값변경시 조회 함수
- * racfCustValidCheck 사업번호 엔터 및 값변경시 조회 함수 ex)
- * - 리턴값 : 사업자등록번호, 거래처명, 대표자명, 전화번호, 주소, 업태, 종목, 시작일자, 종료일자.
- * - 사용예 :
- * 1. 사업자 등록번호, 거래처명만 가져오고 싶을경우
- * racfCustValidCheck("사업자등록번호 노드명,거래처명 노드명");
- *
- * 2. 사업자 등록번호, 거래처명, 주소를 가져오고 싶을경우
- * (이경우는 대표자명과, 전화번호를 넘어가야하기 때문에 뿌려질 노드의 같은경로에 임의의 노드를 만들어 준다.
- * 만일 임의의 노드가 temp1, temp2 일경우라고 가정한 예)
- * racfCustValidCheck("사업자등록번호 노드명,거래처명 노드명,temp1,temp2,주소");
- *
- * racfAactValidCheck 계좌번호 엔터 및 값변경시 조회 함수
- *
- * racfValidCheck 몇몇 코드들에 대한 코드 or 값을 조회한다.
- *
- * racfGetCadlYmd 기수 관리 테이블에 있는 회계년도를 조회한다.
- *
- * racfGetSupAcntPrAcntListCombo SupAcntCd4 별로 AcntCd List를 조회한다.
- *
- *
- *
- *
- *
- *
- *
- *
- ***************************************************************************************************************/
- var cashacntcd = "1110101";
- function racfGetCashAcntCd()
- {
- return cashacntcd;
- }
- // 계정코드 및 계정명시 조회 함수
- /*
- * recvlist : 저장될 인스턴스 경로;
- */
- function racfAcntValidCheck(recvlist, pKind)
- {
- if (document.controls(event.currentTarget).elementName != "xforms:datagrid")
- {
- if(event.name == "onkeypress")
- {
- if(document.controls(event.currentTarget).value == document.controls(event.currentTarget).currentText) return;
- }
- document.controls(event.currentTarget).value = document.controls(event.currentTarget).currentText;
- }
-
- racfValidCheck("05", "", recvlist, null, null, pKind);
- model.refresh();
- }
- // 예산코드 조회 함수
- /*
- * recvlist : 저장될 인스턴스 경로;
- */
- function racfBugtAcntValidCheck(recvlist, pKind)
- {
- if (document.controls(event.currentTarget).elementName != "xforms:datagrid")
- {
- if(event.name == "onkeypress")
- {
- if(document.controls(event.currentTarget).value == document.controls(event.currentTarget).currentText) return;
- }
- document.controls(event.currentTarget).value = document.controls(event.currentTarget).currentText;
- }
-
- racfValidCheck("10", "", recvlist, null, null, pKind);
- model.refresh();
- }
- // 부서코드 및 부서명 입력시 조회 함수
- /*
- * recvlist : 저장될 인스턴스 경로;
- */
- function racfDeptValidCheck(recvlist, pKind)
- {
- if (document.controls(event.currentTarget).elementName != "xforms:datagrid")
- {
- if(event.name == "onkeypress")
- {
- if(document.controls(event.currentTarget).value == document.controls(event.currentTarget).currentText) return;
- }
-
- document.controls(event.currentTarget).value = document.controls(event.currentTarget).currentText;
- }
-
- racfValidCheck("02", "", recvlist, null, null, pKind);
- model.refresh();
- }
- // 예산 부서코드 및 예산 부서명 입력시 조회 함수
- /*
- * recvlist : 저장될 인스턴스 경로;
- */
- function racfBugtDeptValidCheck(recvlist, pKind)
- {
- if (document.controls(event.currentTarget).elementName != "xforms:datagrid")
- {
- if(event.name == "onkeypress")
- {
- if(document.controls(event.currentTarget).value == document.controls(event.currentTarget).currentText) return;
- }
-
- document.controls(event.currentTarget).value = document.controls(event.currentTarget).currentText;
- }
-
- racfValidCheck("11", "", recvlist, null, null, pKind);
- model.refresh();
- }
- // 기재사항코드 및 기재사항명값 입력시 조회 함수
- /*
- * recvlist : 저장될 인스턴스 경로;
- */
- function racfNoteValidCheck(recvlist, pKind)
- {
- if (document.controls(event.currentTarget).elementName != "xforms:datagrid")
- {
- if(event.name == "onkeypress")
- {
- if(document.controls(event.currentTarget).value == document.controls(event.currentTarget).currentText) return;
- }
- document.controls(event.currentTarget).value = document.controls(event.currentTarget).currentText;
- }
- racfValidCheck("06", "", recvlist, null, null, pKind);
- model.refresh();
- }
- // 거래처코드 및 거래처명 입력시 조회 함수
- /*
- * recvlist : 저장될 인스턴스 경로;
- */
- function racfCustValidCheck(recvlist, pKind)
- {
- if (document.controls(event.currentTarget).elementName != "xforms:datagrid")
- {
- if(event.name == "onkeypress")
- {
- if(document.controls(event.currentTarget).value == document.controls(event.currentTarget).currentText) return;
- }
- document.controls(event.currentTarget).value = document.controls(event.currentTarget).currentText.replace("-", "").replace("-", "");
- }
- racfValidCheck("14", "", recvlist, null, null, pKind);
- model.refresh();
- }
- // 계좌코드 및 계좌번호 입력시 조회 함수
- /*
- * recvlist : 저장될 인스턴스 경로;
- */
- function racfAactValidCheck(recvlist, pKind)
- {
- if (document.controls(event.currentTarget).elementName != "xforms:datagrid")
- {
- if(event.name == "onkeypress")
- {
- if(document.controls(event.currentTarget).value == document.controls(event.currentTarget).currentText) return;
- }
- document.controls(event.currentTarget).value = document.controls(event.currentTarget).currentText;
- }
- racfValidCheck("15", "", recvlist, null, null, pKind);
- model.refresh();
- }
- // 기수 관리 테이블에 있는 회계년도를 조회한다.
- /*
- * pInstacePath : 데이터 노드경로
- * pRecvList : 저장될 인스턴스 경로;
- */
- function racfGetCadlYmd(pInstacePath, pRecvList)
- {
- var sRecvNode = "cadldd";
- var sParamsNode = "/root/send";
- var sRsltNode = "/root/rslt";
-
- model.removeNodeset(sRsltNode);
- model.makeNode(sRsltNode);
- model.removeNodeset(pRecvList);
- model.makeNode(pRecvList);
-
- var sRsltNodePath = "";
- var arrRsltNodes = pRecvList.split('/');
- for(var i=1; i<arrRsltNodes.length -1; i++)
- {
- sRsltNodePath = sRsltNodePath + "/" + arrRsltNodes[i];
- }
-
- model.removeChild("TRRAC90205");
- model.createChild("xforms:submission", "id:TRRAC90205;mediatype:application/x-www-form-urlencoded; method:post; ref:" + sParamsNode + "; resultref:" + sRsltNode + "; ");
- submit("TRRAC90205");
-
- var rslt_node = new Array();
- var node = instance1.selectNodes(sRsltNode + "/*");
- for (var j = 0; j < node.length; j++)
- {
- model.makeValue(pRecvList + "/" + node.item(j).nodeName, model. getValue(sRsltNode + "/" + node.item(j).nodeName));
- }
- }
- //코드 Validation Check한다.
- /*
- pvali_kind : Validation 종류(부서코드, 공통코드, 우편번호...)
- "01" - 사번조회
- "02" - 부서코드
- "03" - 공통코드
- "04" - 우편번호
- "05" - 계정코드
- "09" - 근무코드
- precv_list : 자료를 받을 Instance Node(콤마로 분류해서 넘기면됨)
- */
- function racfValidCheck(pvali_kind, pcdgrupid, precv_list, pValueControl, pNodeNames, pKind)
- {
- var objID = event.currentTarget;
- var obj = document.controls(objID);
-
- var arrCtrlNames = null;
- var arrNodeNames = null;
-
- if(obj != null && obj.elementName == "xforms:group")
- {
- objID = event.Target;
- obj = document.controls(objID);
- }
-
- if(pValueControl != null && pValueControl != "")
- {
- arrCtrlNames = pValueControl.split(",");
- }
-
- if(pNodeNames != null && pValueControl != "")
- {
- arrNodeNames = pValueControl.split(",");
- }
- var vali_kind = pvali_kind.substr(0,2);
- var validation_node = "/root/send/validation";
- var validation_rsltnode = "/root/init/validation";
-
- var recv_node = precv_list.split(",");
- model.removeNodeset(validation_node);
- model.removeNodeset(validation_rsltnode);
- model.makeNode(validation_node);
- model.makeValue(validation_node + "/cdgrupid", pcdgrupid);
- model.makeNode(validation_rsltnode);
-
- var result_path = "";
- if (obj.elementName == "xforms:datagrid")
- {
- result_path = obj.nodeset;
- model.makeValue(validation_node + "/getcond", model.getValue(result_path + "[" + (obj.row - obj.fixedRows + 1) + "]/" + obj.colAttribute(obj.col,"ref")));
- model.makeValue(validation_node + "/retrkind", pKind);
- }
- else
- {
- var node_path = obj.attribute("ref").split("/");
- result_path = "/root";
-
- for (var i = 2 ; i < node_path.length - 1; i++)
- {
- result_path = result_path + "/" + node_path[i];
- }
-
- model.makeValue(validation_node + "/getcond", model.getValue(obj.attribute("ref")));
- model.makeValue(validation_node + "/retrkind", pKind);
- }
-
- if(model.getValue(validation_node + "/getcond") == null || model.getValue(validation_node + "/getcond") == "") {
- for (var i = 0; i < recv_node.length; i++) {
- if (obj.elementName == "xforms:datagrid") {
- model.setValue(result_path + "[" + (obj.row - obj.fixedRows + 1) + "]/" + recv_node[i], "");
- }
- else {
- model.setValue(result_path + "/" + recv_node[i], "");
- }
- }
- return;
- }
- if(pvali_kind == "02") { //부서코드
- model.removeChild("TRRPZ00202");
- model.createChild("xforms:submission", "id:TRRPZ00202;mediatype:application/x-www-form-urlencoded; method:post; ref:" + validation_node + "; resultref:" + validation_rsltnode + "; ");
-
- submit("TRRPZ00202");
-
- var rslt_node = new Array();
- var node = instance1.selectNodes(validation_rsltnode + "/deptcodelist" + "/*");
- for (var j = 0; j < node.length; j++) {
- if (obj.elementName == "xforms:datagrid") {
- rslt_node[j] = model.getValue(validation_rsltnode + "/deptcodelist" + "[1]/" + node.item(j).nodeName);
- }
- else {
- rslt_node[j] = model.getValue(validation_rsltnode + "/deptcodelist" + "/" + node.item(j).nodeName);
- }
- }
- }
- else if(pvali_kind == "03") { //공통코드
- model.removeChild("TRRPZ00303");
- model.createChild("xforms:submission", "id:TRRPZ00303;mediatype:application/x-www-form-urlencoded; method:post; ref:" + validation_node + "; resultref:" + validation_rsltnode + "; ");
- submit("TRRPZ00303");
-
- var rslt_node = new Array();
- var node = instance1.selectNodes(validation_rsltnode + "/comcodelist" + "/*");
- for (var j = 0; j < node.length; j++) {
- if (obj.elementName == "xforms:datagrid") {
- rslt_node[j] = model.getValue(validation_rsltnode + "/comcodelist" + "[1]/" + node.item(j).nodeName);
- }
- else {
- rslt_node[j] = model.getValue(validation_rsltnode + "/comcodelist" + "/" + node.item(j).nodeName);
- }
- }
- }
- else if(pvali_kind == "05") //계정코드
- {
- model.removeChild("TRRAC90105");
- model.createChild("xforms:submission", "id:TRRAC90105;mediatype:application/x-www-form-urlencoded; method:post; ref:" + validation_node + "; resultref:" + validation_rsltnode + "; ");
- submit("TRRAC90105");
-
- var rslt_node = new Array();
- var node = instance1.selectNodes(validation_rsltnode + "/acntlist" + "/*");
-
- for (var j = 0; j < node.length; j++)
- {
- if (obj.elementName == "xforms:datagrid")
- {
- rslt_node[j] = model.getValue(validation_rsltnode + "/acntlist" + "[1]/" + node.item(j).nodeName);
- }
- else
- {
- rslt_node[j] = model.getValue(validation_rsltnode + "/acntlist" + "/" + node.item(j).nodeName);
- }
- }
- }
- else if(pvali_kind == "06") //기재사항코드
- {
- model.removeChild("TRRAC90305");
- model.createChild("xforms:submission", "id:TRRAC90305;mediatype:application/x-www-form-urlencoded; method:post; ref:" + validation_node + "; resultref:" + validation_rsltnode + "; ");
- submit("TRRAC90305");
-
- var rslt_node = new Array();
- var node = instance1.selectNodes(validation_rsltnode + "/notelist" + "/*");
-
- for (var j = 0; j < node.length; j++)
- {
-
- if (obj.elementName == "xforms:datagrid")
- {
- rslt_node[j] = model.getValue(validation_rsltnode + "/notelist" + "[1]/" + node.item(j).nodeName);
- }
- else
- {
- rslt_node[j] = model.getValue(validation_rsltnode + "/notelist" + "/" + node.item(j).nodeName);
- }
- }
- }
- else if(pvali_kind == "10") //예산코드
- {
- model.removeChild("TRRAC90805");
- model.createChild("xforms:submission", "id:TRRAC90805;mediatype:application/x-www-form-urlencoded; method:post; ref:" + validation_node + "; resultref:" + validation_rsltnode + "; ");
- submit("TRRAC90805");
-
- var rslt_node = new Array();
- var node = instance1.selectNodes(validation_rsltnode + "/acntcodelist" + "/*");
-
- for (var j = 0; j < node.length; j++)
- {
- if (obj.elementName == "xforms:datagrid")
- {
- rslt_node[j] = model.getValue(validation_rsltnode + "/acntcodelist" + "[1]/" + node.item(j).nodeName);
- }
- else
- {
- rslt_node[j] = model.getValue(validation_rsltnode + "/acntcodelist" + "/" + node.item(j).nodeName);
- }
- }
- }
- else if(pvali_kind == "14") // 거래처
- {
- model.removeChild("TRRAC90605");
- model.createChild("xforms:submission", "id:TRRAC90605;mediatype:application/x-www-form-urlencoded; method:post; ref:" + validation_node + "; resultref:" + validation_rsltnode + "; ");
- submit("TRRAC90605");
-
- var rslt_node = new Array();
- var node = instance1.selectNodes(validation_rsltnode + "/custlist" + "/*");
-
- for (var j = 0; j < node.length; j++)
- {
-
- if (obj.elementName == "xforms:datagrid")
- {
- rslt_node[j] = model.getValue(validation_rsltnode + "/custlist" + "[1]/" + node.item(j).nodeName);
- }
- else
- {
- rslt_node[j] = model.getValue(validation_rsltnode + "/custlist" + "/" + node.item(j).nodeName);
- }
- }
- }
- else if (pvali_kind == "15") // 계좌번호
- {
- var oCtrl
- if(arrCtrlNames != null && arrNodeNames != null)
- {
- for(var i=0; i<arrCtrlNames.length; i++)
- {
- oCtrl = document.controls(arrCtrlNames[i]);
- model.makeValue(validation_node + "/" + arrNodeNames[i], model.getValue(oCtrl.attribute("ref")));
- }
- }
-
- model.removeChild("TRRAC90405");
- model.createChild("xforms:submission", "id:TRRAC90405;mediatype:application/x-www-form-urlencoded; method:post; ref:" + validation_node + "; resultref:" + validation_rsltnode + "; ");
- submit("TRRAC90405");
-
- var rslt_node = new Array();
- var node = instance1.selectNodes(validation_rsltnode + "/aactlist" + "/*");
-
- for (var j = 0; j < node.length; j++)
- {
-
- if (obj.elementName == "xforms:datagrid")
- {
- rslt_node[j] = model.getValue(validation_rsltnode + "/aactlist" + "[1]/" + node.item(j).nodeName);
- }
- else
- {
- rslt_node[j] = model.getValue(validation_rsltnode + "/aactlist" + "/" + node.item(j).nodeName);
- }
- }
- }
- else if(pvali_kind == "11") // 예산 부서 코드
- {
- model.removeChild("TRRAC90705");
- model.createChild("xforms:submission", "id:TRRAC90705;mediatype:application/x-www-form-urlencoded; method:post; ref:" + validation_node + "; resultref:" + validation_rsltnode + "; ");
- submit("TRRAC90705");
-
- var rslt_node = new Array();
- var node = instance1.selectNodes(validation_rsltnode + "/bugtdeptlist" + "/*");
-
- //alert(node.length);
-
- for (var j = 0; j < node.length; j++)
- {
-
- if (obj.elementName == "xforms:datagrid")
- {
- rslt_node[j] = model.getValue(validation_rsltnode + "/bugtdeptlist" + "[1]/" + node.item(j).nodeName);
- }
- else
- {
- rslt_node[j] = model.getValue(validation_rsltnode + "/bugtdeptlist" + "/" + node.item(j).nodeName);
- }
- }
- }
- var node1 = instance1.selectNodes(validation_rsltnode + "/*");
- //alert(node1.length);
- if (node1.length != 1)
- {
- model.removeNodeset("/root/source/validation");
- model.makeNode("/root/source/validation")
- model.copyNode("/root/source/validation", validation_rsltnode);
- misfOpenPopUpList(vali_kind, obj, "", precv_list, pValueControl, pNodeNames)
- }
- else
- {
- for (var i = 0; i < recv_node.length; i++)
- {
- if (obj.elementName == "xforms:datagrid")
- {
- model.setValue(result_path + "[" + (obj.row - obj.fixedRows + 1) + "]/" + recv_node[i], rslt_node[i]);
- }
- else
- {
- model.setValue(result_path + "/" + recv_node[i], rslt_node[i]);
- }
- }
- }
- }
- // 상위계정코드4 단위의 계정코드 조회 콤보
- function racfGetSupAcntPrAcntListCombo(pParamValue, pControl, pall)
- {
- var control_id = pControl.attribute("id");
-
- var sParamsNode = "/root/send/paramref";
- var sRsltNode = "/root/init/acnt";
- var sItemSet = "/root/init/" + control_id;
-
- model.removeNodeset(sParamsNode);
- model.removeNodeset(sItemSet);
-
- model.makeNode(sParamsNode);
-
- model.makeNode(sRsltNode);
- model.makeNode(sItemSet);
-
- model.makeValue(sParamsNode + "/supacntcd4", pParamValue);
-
- pControl.choices.itemset.attribute("nodeset") = sItemSet + "/acntlist";
- pControl.choices.itemset.value.attribute("ref") = "acntcd";
- pControl.choices.itemset.label.attribute("ref") = "acntnm";
- pControl.refresh();
-
- model.removeChild("TRRAD00809");
- model.createChild("xforms:submission", "id:TRRAD00809;mediatype:application/x-www-form-urlencoded; method:post; ref:" + sParamsNode + "; resultref:" + sRsltNode + "; ");
- submit("TRRAD00809");
-
- if(pall != null && pall == "Y")
- {
- model.makeValue(sItemSet + "/acntlist[" + 1 + "]/acntcd", "");
- model.makeValue(sItemSet + "/acntlist[" + 1 + "]/acntnm", "");
-
- sourcenode = document.models(0).instances(0).selectSingleNode(sRsltNode);
- tarnode = document.models(0).instances(0).selectSingleNode(sItemSet);
-
- cnt = 1;
- var sourcenodelist = sourcenode.childNodes;
- while (childNode = sourcenodelist.nextNode())
- {
- model.makeValue(sItemSet + "/acntlist[" + (cnt + 1) + "]/acntcd", childNode.getXPathString(sRsltNode + "/acntlist[" + cnt + "]/acntcd"));
- model.makeValue(sItemSet + "/acntlist[" + (cnt + 1) + "]/acntnm", childNode.getXPathString(sRsltNode + "/acntlist[" + cnt + "]/acntnm"));
- cnt++;
- }
- }
- else
- {
- model.copyNode(sItemSet, sRsltNode);
- }
-
- model.refresh();
- }
- // 상위계정코드4 단위의 계정코드 조회 콤보
- function racfAcntMngtListCombo(pParamValue, pInstCd, pControl, pall)
- {
- var control_id = pControl.attribute("id");
-
- var sParamsNode = "/root/send/paramref";
- var sRsltNode = "/root/init/code";
- var sItemSet = "/root/init/" + control_id;
-
- model.removeNodeset(sParamsNode);
- model.removeNodeset(sItemSet);
-
- model.makeNode(sParamsNode);
-
- model.makeNode(sRsltNode);
- model.makeNode(sItemSet);
- // ParamaterValue Setting
- model.makeValue(sParamsNode + "/mngtcd", pParamValue);
-
- if(pInstCd == null && pInstCd == "")
- {
- model.makeValue(sParamsNode + "/instcd", "");
- }
- else
- {
- model.makeValue(sParamsNode + "/instcd", pInstCd);
- }
-
- pControl.choices.itemset.attribute("nodeset") = sItemSet + "/codelist";
- pControl.choices.itemset.value.attribute("ref") = "cdid";
- pControl.choices.itemset.label.attribute("ref") = "cdnm";
- pControl.refresh();
-
- model.removeChild("TRRAZ00001");
- model.createChild("xforms:submission", "id:TRRAZ00001;mediatype:application/x-www-form-urlencoded; method:post; ref:" + sParamsNode + "; resultref:" + sRsltNode + "; ");
- submit("TRRAZ00001");
-
- if(pall != null && pall == "Y")
- {
- model.makeValue(sItemSet + "/codelist[" + 1 + "]/cdid", "");
- model.makeValue(sItemSet + "/codelist[" + 1 + "]/cdnm", "");
- sourcenode = document.models(0).instances(0).selectSingleNode(sRsltNode);
- tarnode = document.models(0).instances(0).selectSingleNode(sItemSet);
- cnt = 1;
- var sourcenodelist = sourcenode.childNodes;
- while (childNode = sourcenodelist.nextNode())
- {
- model.makeValue(sItemSet + "/codelist[" + (cnt + 1) + "]/cdid", childNode.getXPathString(sRsltNode + "/codelist[" + cnt + "]/cdid"));
- model.makeValue(sItemSet + "/codelist[" + (cnt + 1) + "]/cdnm", childNode.getXPathString(sRsltNode + "/codelist[" + cnt + "]/cdnm"));
- cnt++;
- }
- }
- else
- {
- model.copyNode(sItemSet, sRsltNode);
- }
-
- model.refresh();
- }
|