123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442 |
- /* ---------------------------------------------------------------------
-
- SMRSI02713_정산확정조회밎재무처리.xrw (SMRSI02713.xrw - JScript )
-
- - Version :
- 1) : Ver.1.00.01
- : Create By Francis Choi
- : 2015.05.02
- ---------------------------------------------------------------------- */
-
- var gTabIdx = "0"; //TAB INDEX
-
- // --------------------------------------------------
- // 화면 Control을 초기화한다
- // --------------------------------------------------
- function fInit() {
- fInitialize();
-
- return;
- }
- // --------------------------------------------------------------
- // 화면 open시와 초기화 버튼 클릭시 화면 초기화 기능을 수행한다.
- // --------------------------------------------------------------
- function fInitialize() {
-
- // 사용자 기관 List
- model.setValue(opt_instcd.attribute("ref" ), getUserInfo("dutplceinstcd"));
- model.setValue(opt_instcdnm.attribute("ref" ), getUserInfo("dutplceinstnm"));
- model.setValue(opt_jobdeptcd.attribute("ref" ), getUserInfo("dutplcecd" ));
- model.setValue(opt_jobdeptcdnm.attribute("ref"), getUserInfo("dutplcenm" ));
- model.setValue(opt_jobuser.attribute("ref" ), getUserInfo("userid" ));
- model.setValue(opt_jobusernm.attribute("ref" ), getUserInfo("usernm" ));
-
- model.setValue("/root/send/inlist/instcd" , getUserInfo("dutplceinstcd")); // 기관코드
- model.setValue("/root/send/outlist/instcd" , getUserInfo("dutplceinstcd")); // 기관코드
-
- model.setValue(ipt_jobmonth.attribute("ref") , getCurrentDate().substr(0,6)); // 정산년월
- model.setValue("/root/send/cnflist/instcd" , getUserInfo("dutplceinstcd")); // 기관코드
- model.setValue(ckb_goodflagyn.attribute("ref") , "Y"); // 물품구분
- model.setValue(ckb_paycondyn.attribute("ref") , "Y"); // 지불필구분
- model.setValue(ckb_suplplcecdyn.attribute("ref"), "Y"); // 주거래처
- model.setValue(ckb_suppcustcdyn.attribute("ref"), "Y"); // 보조거래처
- model.setValue("/root/send/cnflist/queryflag" , "1"); // 조회구분
-
- model.refresh();
- }
-
- // --------------------------------------------------
- // Data 조회
- // --------------------------------------------------
- function fDataSearchClick() {
- switch(gTabIdx) {
- case "0" :
- fConfirmDataView();
- break;
- case "1" :
- fSlipDataView("I",grd_inconfirmlist);
- break;
- case "2" :
- fSlipDataView("O", grd_outconfirmlist);
- }
- }
-
- // --------------------------------------------------
- // Grid Excel 저장
- // --------------------------------------------------
- function fExcelDataSave() {
- switch(gTabIdx) {
- case "0" :
- misfSaveExcel(grd_confirmlist);
- break;
- case "1" :
- misfSaveExcel(grd_inconfirmlist);
- break;
- case "2" :
- misfSaveExcel(grd_outconfirmlist);
- break;
- }
- }
-
-
- // --------------------------------------------------
- // View Option 처리하는 함수
- // --------------------------------------------------
- function fSumViewOption(pGrid,pOption, pCol) {
-
- // misfGridInit(pGrid);
-
- // pGrid.colHidden(pGrid.colRef(pCol)) = (pOption.value =="Y") ? false : true;
-
- grd_confirmlist.colHidden(grd_confirmlist.colRef(pCol)) = (pOption.value =="Y") ? false : true;
-
- // btn_search.dispatch("DOMActivate");
-
- // pGrid.refresh();grd_confirmlist
- }
-
- // --------------------------------------------------
- // View Option 처리하는 함수
- // --------------------------------------------------
- function fConfirmDataView() {
- if (ipt_jobmonth.value == "") {
- alert("작업년월를 입력 하십시요!!" );
- return;
- }
-
- misfGridInit(grd_confirmlist);
- model.setValue("/root/send/cnflist/jobmonth", model.getValue(ipt_jobmonth.attribute("ref")));
- model.setValue("/root/send/cnflist/fromdd" , model.getValue(ipt_jobmonth.attribute("ref")) + "01")
- model.setValue("/root/send/cnflist/todd" , model.getValue(ipt_jobmonth.attribute("ref")) + "31")
-
- submit("TRRSI02715");
-
- //<!-- 02 물품구분 --> <col ref="goodflag" visibility="hidden"/>
- //<!-- 03 물품구분(R0025) --> <col ref="goodflagnm" style="vertical-align:top; "/>
- //<!-- 04 1:정상, 2:지불필 3:외자 --> <col ref="paycond" visibility="hidden"/>
- //<!-- 05 지불필구분명 --> <col ref="paycondnm" style="vertical-align:top; "/>
- //<!-- 06 공급처코드 --> <col ref="suplplcecd" format="999-99-99999" style="text-align:center; vertical-align:top; "/>
- //<!-- 07 주거래처 --> <col ref="suplplcenm" style="vertical-align:top; "/>
- //<!-- 08 보조거래처코드 --> <col ref="suppcustcd" format="999-99-99999" style="text-align:center; vertical-align:top; "/>
- //<!-- 09 보조거래처 --> <col ref="suppcustnm" style="vertical-align:top; "/>
- //subtotal 을 수행한다.
- var SubViewCnt = 0;
- var SubTot = "instcd";
- var SubTotCol = "instcd";
- var SubTotName = "-총계-";
- var SubTotName2 = "";
- var SubTotName3 = "";
-
- SubViewCnt += (ckb_goodflagyn.value =="Y") ? 1 : 0; // 물품구분
- SubViewCnt += (ckb_paycondyn.value =="Y") ? 2 : 0; // 지불필구분
- SubViewCnt += (ckb_suplplcecdyn.value =="Y") ? 4 : 0; // 주거래처
- SubViewCnt += (ckb_suppcustcdyn.value =="Y") ? 8 : 0; // 보조거래처
- var SubTot = "instcd";
- SubTot = (SubViewCnt == 1 ) ? "instcd" : SubTot; // 물품구분
- SubTot = (SubViewCnt == 2 ) ? "instcd" : SubTot; // 지불필구분
- SubTot = (SubViewCnt == 4 ) ? "instcd" : SubTot; // 주거래처
- SubTot = (SubViewCnt == 8 ) ? "instcd" : SubTot; // 보조거래처
- SubTotCol = (SubViewCnt == 1 ) ? "goodflagnm" : SubTotCol; // 물품구분
- SubTotCol = (SubViewCnt == 2 ) ? "paycondnm" : SubTotCol; // 지불필구분
- SubTotCol = (SubViewCnt == 4 ) ? "suplplcenm" : SubTotCol; // 주거래처
- SubTotCol = (SubViewCnt == 8 ) ? "suppcustnm" : SubTotCol; // 보조거래처
- SubTotName = (SubViewCnt == 1 ) ? "- 물품구분 계" : SubTotName; // 물품구분
- SubTotName = (SubViewCnt == 2 ) ? "- 지불필 계" : SubTotName; // 지불필구분
- SubTotName = (SubViewCnt == 4 ) ? "- 주거래처 계" : SubTotName; // 주거래처
- SubTotName = (SubViewCnt == 8 ) ? "- 보조거래처 계" : SubTotName; // 보조거래처
- var sRowCnt = grd_confirmlist.rows-grd_confirmlist.fixedRows;
-
- for(var i=1; i<= sRowCnt; i++){
- if (parseFloat(model.getValue(grd_confirmlist.nodeset+"["+ i +"]/windelvqty" )) != 0 ) {
- grd_confirmlist.cellstyle("background-color", i, grd_confirmlist.colRef("winamt"), i, grd_confirmlist.colRef("winqty" )) = "yellow";
- grd_confirmlist.cellstyle("color" , i, grd_confirmlist.colRef("winamt"), i, grd_confirmlist.colRef("winqty" )) = "red";
- grd_confirmlist.cellstyle("background-color", i, grd_confirmlist.colRef("winamt"), i, grd_confirmlist.colRef("winamt" )) = "yellow";
- grd_confirmlist.cellstyle("color" , i, grd_confirmlist.colRef("winamt"), i, grd_confirmlist.colRef("winamt" )) = "red";
- grd_confirmlist.cellstyle("background-color", i, grd_confirmlist.colRef("winamt"), i, grd_confirmlist.colRef("delvqty" )) = "yellow";
- grd_confirmlist.cellstyle("color" , i, grd_confirmlist.colRef("winamt"), i, grd_confirmlist.colRef("delvqty" )) = "red";
- grd_confirmlist.cellstyle("background-color", i, grd_confirmlist.colRef("winamt"), i, grd_confirmlist.colRef("windelvqty")) = "yellow";
- grd_confirmlist.cellstyle("color" , i, grd_confirmlist.colRef("winamt"), i, grd_confirmlist.colRef("windelvqty")) = "red";
- }
- }
-
- //if (SubViewCnt%2 ==1 && SubViewCnt != 1) SubTotName = "goodflag"; // 물품구분
- //if (SubViewCnt == 12 || SubViewCnt == 14 || SubViewCnt == 15) SubTotName2 = "suplplcecd"; // 물품구분
-
- if (SubViewCnt != 0 ) {
- grd_confirmlist.subtotal("clear", 0, 0);
- grd_confirmlist.subtotal("sum", grd_confirmlist.colRef(SubTot), grd_confirmlist.colRef("winqty" ) , "#,###", "font-weight:bold; background-color:#ccffcc;",grd_confirmlist.colRef(SubTotCol),SubTotName);
- grd_confirmlist.subtotal("sum", grd_confirmlist.colRef(SubTot), grd_confirmlist.colRef("winamt" ) , "#,###", "font-weight:bold; background-color:#ccffcc;",grd_confirmlist.colRef(SubTotCol),"");
- grd_confirmlist.subtotal("sum", grd_confirmlist.colRef(SubTot), grd_confirmlist.colRef("delvqty") , "#,###", "font-weight:bold; background-color:#ccffcc;",grd_confirmlist.colRef(SubTotCol),"");
- grd_confirmlist.subtotal("sum", grd_confirmlist.colRef(SubTot), grd_confirmlist.colRef("windelvqty"), "#,###", "font-weight:bold; background-color:#ccffcc;",grd_confirmlist.colRef(SubTotCol),"");
-
- // grd_confirmlist.subtotal("clear", 0, 0);
- if (SubTotName2 != "") {
- grd_confirmlist.subtotal("sum", grd_confirmlist.colRef(SubTotName2), grd_confirmlist.colRef("winqty" ) , "#,###", "font-weight:bold; background-color:#ccffcc;",grd_confirmlist.colRef(SubTotName2),"");
- grd_confirmlist.subtotal("sum", grd_confirmlist.colRef(SubTotName2), grd_confirmlist.colRef("winamt" ) , "#,###", "font-weight:bold; background-color:#ccffcc;",grd_confirmlist.colRef(SubTotName2),"- 거래처계");
- grd_confirmlist.subtotal("sum", grd_confirmlist.colRef(SubTotName2), grd_confirmlist.colRef("delvqty") , "#,###", "font-weight:bold; background-color:#ccffcc;",grd_confirmlist.colRef(SubTotName2),"");
- grd_confirmlist.subtotal("sum", grd_confirmlist.colRef(SubTotName2), grd_confirmlist.colRef("windelvqty"), "#,###", "font-weight:bold; background-color:#ccffcc;",grd_confirmlist.colRef(SubTotName2),"");
- }
- }
- grd_confirmlist.refresh();
- }
-
- // --------------------------------------------------
- // 전표대상자료 보여주기 함수
- // --------------------------------------------------
- function fSlipDataView(pFlag, pGrid) {
- var iPath = "/root/send/inlist/";
- var oPath = "/root/send/outlist/";
-
- if (model.getValue("/root/send/jobmonth") == "") {
- alert("작업일자를 입력 하십시요!!" );
- return;
- }
-
- misfGridInit(pGrid);
- model.setValue(iPath+"frcalccnfmdd", model.getValue("/root/send/jobmonth")+"01");
- model.setValue(iPath+"tocalccnfmdd", model.getValue("/root/send/jobmonth")+"31");
-
- model.setValue(oPath+"endmonth" , model.getValue("/root/send/jobmonth"));
- model.setValue(oPath+"frcalccnfmdd", model.getValue("/root/send/jobmonth")+"01");
- model.setValue(oPath+"tocalccnfmdd", model.getValue("/root/send/jobmonth")+"31");
-
- if (pFlag == "I") {
- submit("TRRSI02716");
-
- pGrid.subtotal("sum", pGrid.colRef(""), pGrid.colRef("totamt" ) , "#,###", "font-weight:bold; background-color:#ccffcc;",pGrid.colRef("acntflagnm"),"- 합계 - ");
- pGrid.subtotal("sum", pGrid.colRef(""), pGrid.colRef("suplamt" ) , "#,###", "font-weight:bold; background-color:#ccffcc;",pGrid.colRef(""),"");
- pGrid.subtotal("sum", pGrid.colRef(""), pGrid.colRef("valaddtax") , "#,###", "font-weight:bold; background-color:#ccffcc;",pGrid.colRef(""),"");
-
- } else {
- submit("TRRSI02717");
-
- pGrid.subtotal("sum", pGrid.colRef(""), pGrid.colRef("winqty" ) , "#,###", "font-weight:bold; background-color:#ccffcc;",pGrid.colRef("acntflagnm"),"- 합계 - ");
- pGrid.subtotal("sum", pGrid.colRef(""), pGrid.colRef("winamt" ) , "#,###", "font-weight:bold; background-color:#ccffcc;",pGrid.colRef(""),"");
- }
- }
-
- // --------------------------------------------------
- // 전표처리 함수
- // --------------------------------------------------
- function fUpdateDataView(pFlag) {
- var sPath = "/root/send/";
- var tPath = "/root/send/slipdata/";
- var cPath = "/root/main/SlipLists/sliplist/";
- if (model.getValue(ipt_jobmonth.attribute("ref")) == "") {
- alert("작업년월을 입력 하십시요!!" );
- return;
- }
-
- //
- var vYear = model.getValue(ipt_jobmonth.attribute("ref")).substr(0,4); // 정산년월
- var vMonth = model.getValue(ipt_jobmonth.attribute("ref")).substr(4,2); // 정산년월
- vToDay = new Date(vYear,vMonth,0);
- var vDay = vToDay.getDate()+"";
-
- grp_main.disabled = true;
-
- //
- if (fRsihinptSlipCheck()) {
- grp_main.disabled = false;
- return;
- }
- //
- if (pFlag == "S") {
- cpt_slip.visible = true;
- cpt_cancel.visible = false;
- bbt_slip_proc.visible = true;
- bbt_slip_proc.disabled = false;
- bbt_cancel_proc.visible = false;
-
- } else {
- cpt_slip.visible = false;
- cpt_cancel.visible = true;
- bbt_slip_proc.visible = false;
- bbt_cancel_proc.visible = true;
- bbt_cancel_proc.disabled = false;
- }
- //
- model.setValue(tPath+"jobcls" , pFlag ); // 작업구분 S:전표처리, C:전표취소
- model.setValue(tPath+"slipdd" , model.getValue(cPath+"slipdd" )); // 전표일자
- model.setValue(tPath+"slipno" , model.getValue(cPath+"slipno" )); // 전표번호
- model.setValue(tPath+"slipddno" , model.getValue(cPath+"slipddno" )); // 전표번호조합
- model.setValue(tPath+"sanctyn" , model.getValue(cPath+"sanctyn" )); // 전표 출력여부
- model.setValue(tPath+"bizpk" , model.getValue(cPath+"bizpk" )); // 생성 KEY
-
- grp_slip.visible = true
-
- if (pFlag == "S") {
- if (model.getValue(cPath + "calccnfmdd") == "") {
- alert(vYear+" 년 "+ vMonth+" 월의 확정 자료가 없습니다. 확인 하십시요!!");
- bbt_slip_proc.disabled = true;
- } else {
- //
- if (model.getValue(cPath + "slipdd") != "") {
- if (model.getValue(cPath + "sanctyn") == "Y") {
- alert(vYear+" 년 "+ vMonth+" 월의 확정 자료가 이미 전표출력이 되었습니다. 재무출력취소 후 재처리 하십시요!!");
-
- } else {
- alert(vYear+" 년 "+ vMonth+" 월의 확정 자료가 이미 전표 처리 되었습니다. 결재취소 후 재처리 하십시요!!");
- }
- bbt_slip_proc.disabled = true;
- }
- }
- } else {
- if (model.getValue(cPath + "calccnfmdd") == "") {
- alert(vYear+" 년 "+ vMonth+" 월의 확정 자료가 없습니다. 확인 하십시요!!");
- bbt_cancel_proc.disabled = true;
- } else {
- if (model.getValue(cPath + "slipdd") == "") {
- alert(vYear+" 년 "+ vMonth+" 월의 확정 자료가 미전표처리이 되었습니다. 전표 처리 하십시요!!");
- bbt_cancel_proc.disabled = true;
- } else {
-
- if (model.getValue(cPath + "sanctyn") == "Y") {
- alert(vYear+" 년 "+ vMonth+" 월의 확정 자료가 이미 전표출력이 되었습니다. 재무출력취소 후 재처리 하십시요!!");
- bbt_cancel_proc.disabled = true;
- }
- }
- }
- }
- model.refresh();
-
- }
-
- // --------------------------------------------------
- // 전표처리전 Data Cehck 함수
- // --------------------------------------------------
- function fRsihinptSlipCheck() {
- var sPath = "/root/send/";
- var tPath = "/root/send/slipdata/";
- var cPath = "/root/main/SlipLists/sliplist/";
-
- var vYear = model.getValue(ipt_jobmonth.attribute("ref")).substr(0,4); // 정산년월
- var vMonth = model.getValue(ipt_jobmonth.attribute("ref")).substr(4,2); // 정산년월
-
- vToDay = new Date(vYear,vMonth,0);
- var vDay = vToDay.getDate()+"";
-
- // misfGridInit(pGrid);
- model.setValue(tPath+"jobmonth" , model.getValue(ipt_jobmonth.attribute("ref") ));
- model.setValue(tPath+"instcd" , model.getValue(sPath+"instcd" ));
- model.setValue(tPath+"instcdnm" , model.getValue(sPath+"instcdnm" ));
- model.setValue(tPath+"jobmonth" , model.getValue(ipt_jobmonth.attribute("ref") ));
- model.setValue(tPath+"genrdd" , model.getValue(ipt_jobmonth.attribute("ref"))+vDay);
- // model.setValue(tPath+"slipflag" , model.getValue(sPath+"slipflag" ));
- // model.setValue(tPath+"bizpk" , model.getValue(sPath+"bizpk" ));
-
- model.setValue(tPath+"slipdeptcd" , model.getValue(sPath+"purcdeptcd" ));
- model.setValue(tPath+"slipdeptcdnm", model.getValue(sPath+"purcdeptnm" ));
- model.setValue(tPath+"frcalccnfmdd", model.getValue(ipt_jobmonth.attribute("ref"))+"01");
- model.setValue(tPath+"tocalccnfmdd", model.getValue(ipt_jobmonth.attribute("ref"))+vDay);
- model.setValue(tPath+"unslwrit" , model.getValue(sPath+"jobuserid" ));
- model.setValue(tPath+"unslwritnm" , model.getValue(sPath+"jobuseridnm" ));
-
- model.setValue(tPath+"endmonth" , model.getValue(ipt_jobmonth.attribute("ref")) ); // 작업년월
- model.setValue(tPath+"usedd" , model.getValue(ipt_jobmonth.attribute("ref"))+"01");
- model.setValue(tPath+"defrayreqdd" , model.getValue(ipt_jobmonth.attribute("ref"))+vDay);
-
- // model.setValue(tPath+"slipcmt" , model.getValue(sPath+"slipcmt" ));
- // model.setValue(tPath+"slipcheck1" , model.getValue(sPath+"slipcheck1" ));
- // model.setValue(tPath+"slipcheck2" , model.getValue(sPath+"slipcheck2" ));
- // model.setValue(tPath+"slipcheck3" , model.getValue(sPath+"slipcheck3" ));
- submit("TRRSI02719");
-
- if (model.getValue(gvErrorMsgPath + "/type") == "error") {
- alert("작업처리 중 오류 운영팀에 문의 要 !!!");
- return true;
- }
-
- model.setValue(tPath+"slipdd" , model.getValue(cPath+"slipdd" )); // 전표일자
- model.setValue(tPath+"slipno" , model.getValue(cPath+"slipno" )); // 전표번호
- model.setValue(tPath+"slipddno" , model.getValue(cPath+"slipddno" )); // 전표번호조합
- model.setValue(tPath+"sanctyn" , model.getValue(cPath+"sanctyn" )); // 전표 출력여부
- model.setValue(tPath+"bizpk" , model.getValue(cPath+"bizpk" )); // 생성 KEY
-
- model.refresh();
-
- return false;
-
- }
-
- // --------------------------------------------------
- // 전표처리 함수
- // --------------------------------------------------
- function fSlipProcess(pFlag) {
-
- var vdate = new Date();
-
- var vTime = lpad(vdate.getHours() +"",2,"0")
- + lpad(vdate.getMinutes()+"",2,"0")
- + lpad(vdate.getSeconds()+"",2,"0");
-
- var tPath = "/root/send/slipdata/";
-
-
- if (pFlag == "S") { // 전표처리
- var vCheck = "Y";
- vCheck = (model.getValue(tPath+"slipcheck1") == "Y") ? vCheck : "N";
- vCheck = (model.getValue(tPath+"slipcheck2") == "Y") ? vCheck : "N";
- vCheck = (model.getValue(tPath+"slipcheck3") == "Y") ? vCheck : "N";
-
- if (vCheck == "N") {
- alert("작업 Check를 확인하십시요!!");
- return;
- }
-
- var vSlipCmt = model.getValue(tPath+"genrdd").substr(0,4) + "."
- + model.getValue(tPath+"genrdd").substr(4,2) ;
-
- var vBizpk = getUserInfo("dutplceinstcd") +"_" // 기관
- + model.getValue(tPath+"genrdd") +"_" // 기표일자
- + getCurrentDate()+ vTime ; // 작업일시
-
- model.setValue(tPath+"bizpk_i" , vBizpk + "_I_PURC" ); // 입고생성 KEY
- model.setValue(tPath+"bizpk_o" , vBizpk + "_O_PURC" ); // 출고생성 KEY
- model.setValue(tPath+"slipflag_i" , "6" ); // 입고 전표구분 (1:일반전표, 2:입원수익전표 3:외래수익전표 4:건진수익전표 5:급여전표 6:물류입고전표 7:물류출고전표 8:감가상각전표)
- model.setValue(tPath+"slipflag_o" , "7" ); // 출고 전표구분
- model.setValue(tPath+"slipcmt_i" , vSlipCmt + " 물품 구입대금지급내역"); // 대표적용
- model.setValue(tPath+"slipcmt_o" , vSlipCmt + " 월분 물품 사용 내역" ); // 대표적용
-
- } else { // 전표취소
- var retMes = messageBox("재무전표 취소처리 작업을 하시겠습니까?", "Q999");
- if (retMes != 6) {
- return;
- }
- }
-
- submit("TXRSI02717"); //월정산확정입고,출고자료 재무기표처리 및 취소를 관리한다.
-
- if (model.getValue(gvErrorMsgPath + "/type") == "error") {
- alert("작업처리 중 오류 운영팀에 문의 要 !!!");
- return true;
- } else {
- alert("자료처리 완료!!! 수고 하셨습니다.");
- }
-
- grp_slip.visible = false;
- grp_main.disabled = false;
- }
-
-
- /* ------------------------------------------------- */
- /* ------End Of List ------------------------------- */
- /* -------------------------------------------------- */
|