123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568 |
- /* ---------------------------------------------------------------------
-
- 구매계약관리 공통
- - Version :
- 1) : Ver.1.00.01
- : Create By Chungpd
- : 2010.10.06
- ---------------------------------------------------------------------- */
- // 초기화하기
- function fInitialize(teamflag)
- {
- // 금일 날자 설정
- var curdate = getCurrentDate();
- var cvtdate = curdate.toDate("YYYYMMDD");
- misfComboComCdList("030M0005",cmb_teamflag);
- misfComboComCdList("030M0013",cmb_conflag);
- misfComboComCdList("030M0001",cmb_wareflag_search);
- misfComboComCdList("030M0008",cmb_deftconratecd);
- addComboItem( "cmb_wareflag_search", "전체", "", "above");
- //misfComboCopyItemSet(cmb_wareflag ,"" , cmb_wareflag_search, ""); //창고구분
- misfComboComCdListMulti("Z0007","cmb_instcd");
- model.setValue("/root/send/search/instcd", getUserInfo("dutplceinstcd")); // 기관 설정
- // 병원정보를 가져오기
- rszfRscsysinftLists(getUserInfo("dutplceinstcd"));
- //model.setValue(ipt_windtfrom.attribute("ref") ,cvtdate.getAddDate(-10,"D").getDateFormat("YYYYMMDD"));
- model.setValue(cal_purccondd_search.attribute("ref") , curdate);
-
- model.setValue("/root/send/nosearch/instcd" , model.getValue(cmb_instcd.attribute("ref")));
- model.setValue("/root/send/nosearch/purccondd" , model.getValue(cal_purccondd_search.attribute("ref")));
- if (submit("TRRSP00102")){
- var purcconno = model.getValue("/root/main/list/purcconnoinfo/maxpurcconno/purcconno");
- model.setValue(ipt_purcconno_search.attribute("ref"), purcconno);
- }
- model.setValue("/root/send/nosearch/instcd" , "");
- model.setValue("/root/send/nosearch/purccondd" , "");
-
- model.setValue(ipt_teamflag.attribute("ref"), teamflag);
-
- btn_search.dispatch("DOMActivate");
- model.refresh();
-
- }
- // 조회하기
- function fSearch()
- {
- var spath = "/root/main/list/purcconinfo"
- model.removeNodeset(spath);
- if (submit("TRRSP00101")){
- model.removeNodeset("/root/submain/list/purcconinfo");
- model.makeNode("/root/submain/list/purcconinfo");
- model.copyNode("/root/submain/list/purcconinfo", "/root/main/list/purcconinfo");
- }
- var vInstance = document.models(0).instances(0);
- var cnt = vInstance.selectNodes("/root/main/list/purcconinfo/purcconmainlist").length;
- if (cnt == 0){
- var spath = "/root/main/list/purcconinfo/purcconmainlist";
-
- model.makeNode(spath+"/purccondd" );
- model.makeNode(spath+"/purcconno" );
- model.makeNode(spath+"/goodkindcnt" );
- model.makeNode(spath+"/teamflag" );
- model.makeNode(spath+"/acntcd" );
- model.makeNode(spath+"/acntnm" );
- model.makeNode(spath+"/notino" );
- model.makeNode(spath+"/suplplcecd" );
- model.makeNode(spath+"/suplplcenm" );
- model.makeNode(spath+"/supdd" );
- model.makeNode(spath+"/chrgid" );
- model.makeNode(spath+"/chrgnm" );
- model.makeNode(spath+"/flwrpirtermyy");
- model.makeNode(spath+"/flwrpirper" );
- model.makeNode(spath+"/suppos" );
- model.makeNode(spath+"/conflag" );
- model.makeNode(spath+"/totconamt" );
- model.makeNode(spath+"/goodcntnm" );
- model.makeNode(spath+"/congrntamt" );
- model.makeNode(spath+"/grntexchrate" );
- model.makeNode(spath+"/expsschedate" );
- model.makeNode(spath+"/deftconratecd");
- model.makeNode(spath+"/cmt" );
- model.makeNode(spath+"/contermfromdd");
- model.makeNode(spath+"/contermtodd" );
- model.makeNode(spath+"/newyn" );
- model.makeNode(spath+"/updtgoodcntyn");
- model.makeNode(spath+"/titlecd");
- }
-
- if (model.getValue(cal_purccondd.attribute("ref")).getTrim() == ""){
- fConDisabledControl(true);
- }else{
- fConDisabledControl(false);
- }
-
- fDisabledControl(true);
-
- ipt_goodcntnm.disabled = true;
- fCalcAmt();
- fDispSumAmt();
- model.refresh();
- }
- // 행별 삭제
- function fRowDel(){
- var prestatus = grd_purccon.valueMatrix(grd_purccon.row,grd_purccon.colRef("prestatus"));
- if (prestatus == "U"){
- if (grd_purccon.valueMatrix(grd_purccon.row, grd_purccon.colRef("lastwindd")) != ""){
- messageBox(grd_purccon.row+"번째는 입고 처리된", "I009");
- }else{
- grd_purccon.rowStatus(grd_purccon.row) = "4";
- }
-
- }else{
- grd_purccon.deleteRow(grd_purccon.row);
- }
- fGetGoodcntnm();
- }
- // (신규 계약건) 입력하기
- function fInpt(teamflag) {
- // 금일 날자 설정
- var curdate = getCurrentDate();
- var cvtdate = curdate.toDate("YYYYMMDD");
-
- ipt_acntcd.disabled = false;
- btn_acntcd.disabled = false;
- fConDisabledControl(false);
- fDisabledControl(false);
- model.resetInstanceNode("/root/main/list/purcconinfo/purcconmainlist");
- model.makeValue(ipt_newyn.attribute("ref"), "Y");
- model.removeNodeset("/root/main/list/purcconinfo/purcconsublist");
- model.setValue(cmb_teamflag.attribute("ref") , teamflag);
- model.refresh();
-
- model.setValue(cal_purccondd.attribute("ref") , curdate);
- model.setValue(ipt_chrgid.attribute("ref") , getUserInfo("userid"));
- model.setValue(ipt_chrgnm.attribute("ref") , getUserInfo("usernm"));
- model.setValue(cmb_deftconratecd.attribute("ref") , "2");
- model.setValue(cal_supdd.attribute("ref") , curdate);
- model.setValue(cal_contermfromdd.attribute("ref") , curdate);
- model.setValue(cal_contermtodd.attribute("ref") , cvtdate.getAddDate(1,"M").getDateFormat("YYYYMMDD"));
- cal_purccondd.dispatch("xforms-value-changed");
- }
- // 계약 세부 내역에서 특정 계약금 혹은 계약수량 변경시 해당 계약금이 자동으로 연산 되는 기능
- function fCalcAmt()
- {
- if( grd_purccon.col == grd_purccon.colRef("conqty")
- || grd_purccon.col == grd_purccon.colRef("congoodunitcost")){
- var conamt;
- var congoodunitcost = grd_purccon.valueMatrix(grd_purccon.row, grd_purccon.colRef("congoodunitcost"));
- var conqty = grd_purccon.valueMatrix(grd_purccon.row, grd_purccon.colRef("conqty"));
-
- conamt = parseFloat(congoodunitcost) * parseFloat(conqty);
- grd_purccon.valueMatrix(grd_purccon.row, grd_purccon.colRef("conamt")) = parseFloat(conamt);
-
- }
-
- model.refresh();
-
- }
- // 공통에 변경된 사항이 있는지를 인지하기 위한 함수 (불필요한 transaction을 줄이고자하는 의도로 작성했음)
- function fCmprChngVal()
- {
- var bfpath = "/root/submain/list/purcconinfo/purcconmainlist";
- var prestpath = "/root/main/list/purcconinfo/purcconmainlist";
- var chngflag = false;
- if ( model.getValue(bfpath+"/purccondd" ) != model.getValue(prestpath+"/purccondd" ) // 계약년월일
- || model.getValue(bfpath+"/purcconno" ) != model.getValue(prestpath+"/purcconno" ) // 계약번호
- || model.getValue(bfpath+"/goodkindcnt" ) != model.getValue(prestpath+"/goodkindcnt" ) // 제종
- || model.getValue(bfpath+"/teamflag" ) != model.getValue(prestpath+"/teamflag" ) // 팀구분
- || model.getValue(bfpath+"/acntcd" ) != model.getValue(prestpath+"/acntcd" ) // 계정코드
- || model.getValue(bfpath+"/acntnm" ) != model.getValue(prestpath+"/acntnm" ) // 계정코드명
- || model.getValue(bfpath+"/notino" ) != model.getValue(prestpath+"/notino" ) // 공고번호
- || model.getValue(bfpath+"/suplplcecd" ) != model.getValue(prestpath+"/suplplcecd" ) // 납품처코드
- || model.getValue(bfpath+"/suplplcenm" ) != model.getValue(prestpath+"/suplplcenm" ) // 납품처명
- || model.getValue(bfpath+"/supdd" ) != model.getValue(prestpath+"/supdd" ) // 납품일
- || model.getValue(bfpath+"/chrgid" ) != model.getValue(prestpath+"/chrgid" ) // 담당자id
- || model.getValue(bfpath+"/chrgnm" ) != model.getValue(prestpath+"/chrgnm" ) // 담당자
- || model.getValue(bfpath+"/flwrpirtermyy") != model.getValue(prestpath+"/flwrpirtermyy") // 하자보수년수
- || model.getValue(bfpath+"/flwrpirper" ) != model.getValue(prestpath+"/flwrpirper" ) // 하자보수퍼센트
- || model.getValue(bfpath+"/suppos" ) != model.getValue(prestpath+"/suppos" ) // 납품장소
- || model.getValue(bfpath+"/conflag" ) != model.getValue(prestpath+"/conflag" ) // 계약구분
- || model.getValue(bfpath+"/totconamt" ) != model.getValue(prestpath+"/totconamt" ) // 총계약금액
- || model.getValue(bfpath+"/goodcntnm" ) != model.getValue(prestpath+"/goodcntnm" ) // 품건명
- || model.getValue(bfpath+"/congrntamt" ) != model.getValue(prestpath+"/congrntamt" ) // 보증금
- || model.getValue(bfpath+"/grntexchrate" ) != model.getValue(prestpath+"/grntexchrate" ) // 보증금환율
- || model.getValue(bfpath+"/expsschedate" ) != model.getValue(prestpath+"/expsschedate" ) // 지출예정일
- || model.getValue(bfpath+"/deftconratecd") != model.getValue(prestpath+"/deftconratecd") // 지체상금코드
- || model.getValue(bfpath+"/cmt" ) != model.getValue(prestpath+"/cmt" ) // 기타조건
- || model.getValue(bfpath+"/contermfromdd") != model.getValue(prestpath+"/contermfromdd") // 계약기간(from)
- || model.getValue(bfpath+"/contermtodd" ) != model.getValue(prestpath+"/contermtodd" )){ // 계약기간(to)
- chngflag = true;
-
- }
- return chngflag;
-
- }
- // 저장 - 공통항목으로 Grouping된 것을 하위단에 풀어주며 풀린 데이타를 서버 PGM으로 넘기는 기능이 함수에 녹아있음.
- function fSave(){
- var updtdata = "", rowno = "";
- if (fSaveValiChk() == false) return;
-
- for(i=1;i<grd_purccon.rows;i++){
-
- if (fCmprChngVal() == true){
- if (grd_purccon.rowStatus(i) == "0"){
- grd_purccon.rowStatus(i) = "2";
- }
-
- grd_purccon.valueMatrix(i, grd_purccon.colRef("purccondd" )) = model.getValue(cal_purccondd.attribute("ref"));
- grd_purccon.valueMatrix(i, grd_purccon.colRef("purcconno" )) = model.getValue(ipt_purcconno.attribute("ref"));
- grd_purccon.valueMatrix(i, grd_purccon.colRef("goodkindcnt" )) = model.getValue(ipt_goodkindcnt.attribute("ref"));
- grd_purccon.valueMatrix(i, grd_purccon.colRef("teamflag" )) = model.getValue(cmb_teamflag.attribute("ref"));
- grd_purccon.valueMatrix(i, grd_purccon.colRef("notino" )) = model.getValue(ipt_notino.attribute("ref"));
- grd_purccon.valueMatrix(i, grd_purccon.colRef("suplplcecd" )) = model.getValue(ipt_suplplcecd.attribute("ref"));
- grd_purccon.valueMatrix(i, grd_purccon.colRef("supdd" )) = model.getValue(cal_supdd.attribute("ref"));
- grd_purccon.valueMatrix(i, grd_purccon.colRef("chrgid" )) = model.getValue(ipt_chrgid.attribute("ref"));
- grd_purccon.valueMatrix(i, grd_purccon.colRef("flwrpirtermyy")) = model.getValue(ipt_flwrpirtermyy.attribute("ref"));
- grd_purccon.valueMatrix(i, grd_purccon.colRef("flwrpirper" )) = model.getValue(ipt_flwrpirper.attribute("ref"));
- grd_purccon.valueMatrix(i, grd_purccon.colRef("suppos" )) = model.getValue(ipt_suppos.attribute("ref"));
- grd_purccon.valueMatrix(i, grd_purccon.colRef("conflag" )) = model.getValue(cmb_conflag.attribute("ref"));
- grd_purccon.valueMatrix(i, grd_purccon.colRef("totconamt" )) = model.getValue(ipt_totconamt.attribute("ref"));
- grd_purccon.valueMatrix(i, grd_purccon.colRef("goodcntnm" )) = model.getValue(ipt_goodcntnm.attribute("ref"));
- grd_purccon.valueMatrix(i, grd_purccon.colRef("congrntamt" )) = model.getValue(ipt_congrntamt.attribute("ref"));
- grd_purccon.valueMatrix(i, grd_purccon.colRef("grntexchrate" )) = model.getValue(ipt_grntexchrate.attribute("ref"));
- grd_purccon.valueMatrix(i, grd_purccon.colRef("expsschedate" )) = model.getValue(cal_expsschedate.attribute("ref"));
- grd_purccon.valueMatrix(i, grd_purccon.colRef("deftconratecd")) = model.getValue(cmb_deftconratecd.attribute("ref"));
- grd_purccon.valueMatrix(i, grd_purccon.colRef("cmt" )) = model.getValue(ipt_cmt.attribute("ref"));
- grd_purccon.valueMatrix(i, grd_purccon.colRef("contermfromdd")) = model.getValue(cal_contermfromdd.attribute("ref"));
- grd_purccon.valueMatrix(i, grd_purccon.colRef("contermtodd" )) = model.getValue(cal_contermtodd.attribute("ref"));
- grd_purccon.valueMatrix(i, grd_purccon.colRef("newyn" )) = model.getValue(ipt_newyn.attribute("ref"));
-
- }
- }
-
- updtdata = getGridUpdateData(grd_purccon);
-
- if(updtdata == ""){
- messageBox("저장할 데이타가 ","E014");
- return false;
- }
-
- if (rowno != ""){
- messageBox(rowno.substr(1, rowno.length-1)+"번째건의 수량이 입력되지 ", "I011");
- return false;
- }
- model.setValue("/root/send/save/purcconlist", updtdata);
- if (submit("TXRSP00101")){
- messageBox("저장이","I002");
- }else{
- messageBox("저장","E009");
- return;
- }
- model.setValue(cal_purccondd_search.attribute("ref") , model.getValue(cal_purccondd.attribute("ref")));
- model.setValue(ipt_purcconno_search.attribute("ref") , model.getValue(ipt_purcconno.attribute("ref")));
-
- btn_search.dispatch("DOMActivate");
- }
- // 품의 내역조회에 있는 데이타를 끌고 온다.(데이타의 유효성도 체크한다.)
- function fDataSet(pnode, nodename)
- {
- var flag = "Y", rowno = "", wflag = "Y", wrowno = "";
- var codynode = instance1.selectNodes(pnode + "/*");
- var vInstance = document.models(0).instances(0);
- var cnt = vInstance.selectNodes("/root/main/list/purcconinfo/purcconsublist").length;
- for (var j = 1; j <= codynode.length ; j++) {
-
- for (var i=1 ; i<= cnt;i++){
-
- var srcgoodcd = model.getValue(pnode +"/" + nodename + "[" + j + "]/goodcd");
- var goodcd = model.getValue(grd_purccon.nodeset + "[" + i + "]/goodcd");
-
- var srcallsizespecid = model.getValue(pnode +"/" + nodename + "[" + j + "]/allsizespecid");
- var allsizespecid = model.getValue(grd_purccon.nodeset + "[" + i + "]/allsizespecid");
-
- if (srcgoodcd == goodcd && srcallsizespecid == allsizespecid){
-
- flag = "N";
- rowno = rowno + ","+i; // 이미 존재하는 코드 check
-
- //messageBox("물품조회 "+i+"번째에 동일 물품이 존재합니다.", "I");
-
- }
-
- }
- wflag = "Y";
- var srcacntcd = model.getValue(pnode +"/" + nodename + "[" + j + "]/acntcd" );
- var acntcd = grd_purccon.valueMatrix(grd_purccon.rows-1,grd_purccon.colRef("acntcd"));
-
- if (flag == "Y"){
-
- if (srcacntcd != acntcd && grd_purccon.rows - grd_purccon.fixedRows != 0 ){
-
- wflag = "N";
- wrowno = wrowno + ","+i; // 다른 입고계정 존재
-
- }else{
- grd_purccon.addRow(false);
- model.makeValue(grd_purccon.nodeset + "[" + (grd_purccon.row) + "]/prestatus" , "I");
- model.makeValue(grd_purccon.nodeset + "[" + (grd_purccon.row) + "]/purccnsttndd" , model.getValue(pnode +"/" + nodename + "[" + j + "]/purccnsttndd" )); // 품의일자
- model.makeValue(grd_purccon.nodeset + "[" + (grd_purccon.row) + "]/purccnsttnno" , model.getValue(pnode +"/" + nodename + "[" + j + "]/purccnsttnno" )); // 품의번호
- model.makeValue(grd_purccon.nodeset + "[" + (grd_purccon.row) + "]/purccnsttnseq" , model.getValue(pnode +"/" + nodename + "[" + j + "]/purccnsttnseq" )); // 품의순번
- model.makeValue(grd_purccon.nodeset + "[" + (grd_purccon.row) + "]/goodcd" , model.getValue(pnode +"/" + nodename + "[" + j + "]/goodcd" )); // 물품코드
- model.makeValue(grd_purccon.nodeset + "[" + (grd_purccon.row) + "]/allsizespecid" , model.getValue(pnode +"/" + nodename + "[" + j + "]/allsizespecid" )); // 규격코드
- model.makeValue(grd_purccon.nodeset + "[" + (grd_purccon.row) + "]/goodnm" , model.getValue(pnode +"/" + nodename + "[" + j + "]/goodnm" )); // 물품명
- model.makeValue(grd_purccon.nodeset + "[" + (grd_purccon.row) + "]/goodspec" , model.getValue(pnode +"/" + nodename + "[" + j + "]/goodspec" )); // 규격
- model.makeValue(grd_purccon.nodeset + "[" + (grd_purccon.row) + "]/conunit" , model.getValue(pnode +"/" + nodename + "[" + j + "]/cnsttnunit" )); // 품의단위
- model.makeValue(grd_purccon.nodeset + "[" + (grd_purccon.row) + "]/cnsttnqty" , model.getValue(pnode +"/" + nodename + "[" + j + "]/cnsttnqty" )); // 품의수량
- model.makeValue(grd_purccon.nodeset + "[" + (grd_purccon.row) + "]/conqty" , model.getValue(pnode +"/" + nodename + "[" + j + "]/conqty" )); // 계약량
- model.makeValue(grd_purccon.nodeset + "[" + (grd_purccon.row) + "]/cnsttngoodunitcost" , model.getValue(pnode +"/" + nodename + "[" + j + "]/cnsttngoodunitcost")); // 품의단가
- model.makeValue(grd_purccon.nodeset + "[" + (grd_purccon.row) + "]/congoodunitcost" , model.getValue(pnode +"/" + nodename + "[" + j + "]/congoodunitcost" )); // 계약단가
- model.makeValue(grd_purccon.nodeset + "[" + (grd_purccon.row) + "]/conamt" , model.getValue(pnode +"/" + nodename + "[" + j + "]/conamt" )); // 계약금액
- model.makeValue(grd_purccon.nodeset + "[" + (grd_purccon.row) + "]/acntcd" , model.getValue(pnode +"/" + nodename + "[" + j + "]/acntcd" )); // 계정과목
- model.makeValue(grd_purccon.nodeset + "[" + (grd_purccon.row) + "]/acntnm" , model.getValue(pnode +"/" + nodename + "[" + j + "]/acntnm" )); // 계정과목명
- model.makeValue(grd_purccon.nodeset + "[" + (grd_purccon.row) + "]/purcconfullno" , model.getValue(pnode +"/" + nodename + "[" + j + "]/purcconfullno" )); // 계약번호(Full)
- model.makeValue(grd_purccon.nodeset + "[" + (grd_purccon.row) + "]/purccondd" , model.getValue(pnode +"/" + nodename + "[" + j + "]/purccondd" )); // 계약일
- model.makeValue(grd_purccon.nodeset + "[" + (grd_purccon.row) + "]/purcconno" , model.getValue(pnode +"/" + nodename + "[" + j + "]/purcconno" )); // 계약번호
- model.makeValue(grd_purccon.nodeset + "[" + (grd_purccon.row) + "]/purcconseq" , model.getValue(pnode +"/" + nodename + "[" + j + "]/purcconseq" )); // 계약일련번호
- model.makeValue(grd_purccon.nodeset + "[" + (grd_purccon.row) + "]/reqpackcntperunit" , model.getValue(pnode +"/" + nodename + "[" + j + "]/reqpackcntperunit" )); // 요구포장단위당갯수
- model.makeValue(grd_purccon.nodeset + "[" + (grd_purccon.row) + "]/fullpurcunit" , model.getValue(pnode +"/" + nodename + "[" + j + "]/fullpurcunit" )); // 구매단위(FULL)
- model.makeValue(grd_purccon.nodeset + "[" + (grd_purccon.row) + "]/instcd" , model.getValue(pnode +"/" + nodename + "[" + j + "]/instcd" )); // 기관코드
- model.makeValue(grd_purccon.nodeset + "[" + (grd_purccon.row) + "]/goodflag" , model.getValue(pnode +"/" + nodename + "[" + j + "]/goodflag" )); // 물품구분
- model.makeValue(grd_purccon.nodeset + "[" + (grd_purccon.row) + "]/reqdeptcd" , model.getValue(pnode +"/" + nodename + "[" + j + "]/reqdeptcd" )); // 구매요구부서
- model.setValue(ipt_suplplcecd.attribute("ref") , model.getValue(pnode +"/" + nodename + "[" + j + "]/suplplcecd"));
- model.setValue(opt_suplplcenm.attribute("ref") , model.getValue(pnode +"/" + nodename + "[" + j + "]/suplplcenm"));
- grd_purccon.cellAttribute("disabled", grd_purccon.row , grd_purccon.colRef("chkyn")) = "true";
-
- }
-
- }
-
- flag = "Y";
-
- }
-
- if (rowno != ""){
- messageBox("품의요구 내역 "+rowno.substr(1, rowno.length-1)+"번째에 동일 물품이 존재합니다.", "I");
- }
- if (wrowno != ""){
- messageBox("이미 입력된 건의 입고계정과 "+wrowno.substr(1, wrowno.length-1)+"번째의 물품코드의 입고계정이 일치하지 않습니다.", "I");
- }
-
- grd_purccon.refresh();
-
- }
- // 품의 내역 조회 전에 필수 입력 항목 check (계정과목은 품의 내역과 계약 내역의 동기화를 위해 꼭 필요함)
- function fDataValiChk()
- {
- var smsg = "";
-
- if(cal_purccondd.value.getTrim() == "") smsg += "계약일자, ";
- if(ipt_purcconno.value.getTrim() == "") smsg += "계약번호, ";
- if(ipt_acntcd.value.getTrim() == "") smsg += "계정과목, ";
- if (smsg == ""){
- return true;
- }else{
- messageBox(smsg.substr(0, smsg.length-2) + "은(는)","I003");
- return false;
-
- }
- }
- // 저장하기전에 필수항목 점검
- function fSaveValiChk()
- {
- var smsg = "";
-
- if(cal_purccondd.value.getTrim() == "") smsg += "계약일자, ";
- if(ipt_purcconno.value.getTrim() == "") smsg += "계약번호, ";
- if(cmb_teamflag.value.getTrim() == "") smsg += "팀구분, ";
- if(ipt_acntcd.value.getTrim() == "") smsg += "계정과목, ";
- if(ipt_suplplcecd.value.getTrim() == "") smsg += "납품처, ";
- if(cmb_conflag.value.getTrim() == "") smsg += "계약방법, ";
- if(ipt_goodcntnm.value.getTrim() == "") smsg += "품건명, ";
- //if(cal_contermfromdd.value.getTrim() == "") smsg += "계약기간(시작일), ";
- //if(cal_contermtodd.value.getTrim() == "") smsg += "계약기간(마감일), ";
- if (smsg == ""){
- return true;
- }else{
- messageBox(smsg.substr(0, smsg.length-2) + "은(는)","I003");
- return false;
- }
- }
- // 다중 선택해서 삭제 가능하도록 처리(현재는 사용하지 않음)
- function fDelSetting(pGrid)
- {
-
- var rowIdx, rowInval="";
-
- if (pGrid.selectedRows > 0) {
- var selectedRows = Array(pGrid.selectedRows);
- for(i=0;i< pGrid.selectedRows;i++) {
- selectedRows[i] = pGrid.selectedRow(i);
- }
- }else{
- messageBox("삭제할 데이타가 ","E014");
- return;
- }
-
- for ( var i= 0; i < selectedRows.length; i++){
-
- rowIdx = selectedRows[i];
- if (pGrid.valueMatrix(rowIdx, pGrid.colRef("purcconno")) == ""){
- pGrid.rowStatus(rowIdx) = "4";
- }else{
- rowInval += rowIdx + ","
- }
- }
- if (rowInval != ""){
- messageBox(rowInval.substr(0, rowInval.length-1)+"번째는 계약처리된", "I009");
-
- }
- model.refresh();
- }
- // 데이타의 무결성을 위해 수정시 기본키로 잡혀 있는 계약일자와 번호는 절대 수정 불가능 상태로 만드는 기능
- function fDisabledControl(state)
- {
- cal_purccondd.disabled = state;
- ipt_purcconno.disabled = state;
- }
- // 데이타가 없으면 입력과 관련된 버튼들을 불능 상태로 만드는 기능
- function fConDisabledControl(state)
- {
- btn_purccon.disabled = state;
- btn_choidel.disabled = state;
- btn_save.disabled = state;
- }
- // 계약에 대한 출력화면일 경우, 조회버튼을 제외한 나머지 입력,저장,품의요구,행삭제 버튼 컨트롤을 불능상태로 만드는 기능
- function fPrtConDisabledControl(state)
- {
- btn_save.disabled = state;
- btn_insert.disabled = state;
- btn_purccon.disabled = state;
- btn_choidel.disabled = state;
- btn_save.disabled = state;
- }
- // 계약 세부 내역에서 계약금 혹은 계약수량 변경시 공통에 있는 전체계약금에 합산되는 기능
- function fDispSumAmt()
- {
- var totconamt = 0, bfconamt = 0, totbfconamt = 0;
-
- for(var currow = grd_purccon.fixedRows ; currow < grd_purccon.rows ; currow++)
- {
- totconamt += parseFloat(grd_purccon.valueMatrix(currow , grd_purccon.colRef("conamt")));
- totbfconamt += bfconamt;
-
-
- }
-
- //총금액
- model.setValue(ipt_totconamt.attribute("ref"),totconamt);
-
- model.refresh();
- }
- // 물품명 변경시 품건명도 연계되어 변경하는 기능
- function fGetGoodcntnm()
- {
- var goodnm = "", fstflag = "N", cnt = 0;
- for(var i=grd_purccon.fixedRows; i < grd_purccon.rows;i++){
- if (grd_purccon.rowStatus(i) != "4"){
- if (fstflag == "N"){
- var goodnm = grd_purccon.valueMatrix(i, grd_purccon.colRef("goodnm"));
- var fstflag = "Y";
- }
- cnt++
- }
- }
- if (cnt == 1){
- model.setValue(ipt_goodcntnm.attribute("ref"), goodnm);
- }else{
- model.setValue(ipt_goodcntnm.attribute("ref"), goodnm+"외 "+ (cnt-1)+"건");
- }
- model.refresh();
- }
- // 출력물 생성시 임시 노드에 지정 노드값 복사는 가능 (미사용 향후 개발의 편의성을 위해 추가한 기능)
- function freqlistprint() {
- var Path = "/root/send/winregstprnt/winregstprntlist";
- model.removenode(Path);
- model.makeNode(Path);
-
- copyNodesetType(Path, grd_winregst.nodeset+ "[chk='Y']");
- exeReportPreview("RPRSP00100","XMLSTR");
- }
|