123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628 |
- <?xml version="1.0" encoding="utf-8"?>
- <FDL version="1.5">
- <TypeDefinition url="..\..\..\default_typedef.xml"/>
- <Form id="SMRNB00500" inheritanceid="" position="absolute 0 0 1024 665" titletext="식권판매관리" onload="SMRNB00500_onload" ontimer="SMRNB00500_ontimer">
- <Layouts>
- <Layout>
- <Static id="caption6" text="식권판매관리" class="tit_1" position="absolute 0 0 120 25"/>
- <Static id="cap_time" position="absolute 758 1 1023 24" style="background:darkseagreen;padding:0 0 0 4;align:center middle;font:Dotum,10,bold;" anchor="top right"/>
- <Button id="btn_save" taborder="29" text="저장" class="btn4" position="absolute 968 26 1023 48" anchor="top right" onclick="btn_save_onclick"/>
- <Static id="cap_messege_title" position="absolute 72 638 229 661" anchor="left bottom" style="background:lightblue;padding:0 0 0 4;"/>
- <Static id="cap_messege" position="absolute 231 638 948 661" anchor="left bottom" style="background:lightblue;padding:0 0 0 4;font:Dotum,9,bold;"/>
- <Shape id="line7" class="line_6" position="absolute 0 47 1023 53" anchor="left top right"/>
- <Grid id="grd_food0108list" taborder="31" useinputpanel="false" position="absolute 0 120 1023 633" binddataset="ds_main_food0108list" autofittype="col" selecttype="row" autoenter="select" onenterdown="grd_food0108list_onenterdown" anchor="all" summarytype="top">
- <Formats>
- <Format id="default">
- <Columns>
- <Column size="25" band="left"/>
- <Column size="25" band="left"/>
- <Column size="80"/>
- <Column size="80"/>
- <Column size="159"/>
- <Column size="100"/>
- <Column size="100"/>
- <Column size="80"/>
- <Column size="80"/>
- <Column size="120"/>
- <Column size="80"/>
- </Columns>
- <Rows>
- <Row size="24" band="head"/>
- <Row size="24"/>
- <Row size="24" band="summ"/>
- </Rows>
- <Band id="head">
- <Cell/>
- <Cell col="1"/>
- <Cell col="2" displaytype="normal" text="직원번호"/>
- <Cell col="3" text="성명"/>
- <Cell col="4" text="소속"/>
- <Cell col="5" text="직급"/>
- <Cell col="6" text="판매금액"/>
- <Cell col="7" text="후 잔량"/>
- <Cell col="8" text="직전잔량"/>
- <Cell col="9" text="직전판매일"/>
- <Cell col="10" text="M잔량"/>
- </Band>
- <Band id="body">
- <Cell celltype="head"/>
- <Cell col="1" celltype="head" text="expr:currow+1"/>
- <Cell col="2" displaytype="text" edittype="expr:getRowType(currow) == 2 ? 'text' : 'none'" editfilter="upper,number" text="bind:id" edituseime="none" editautoselect="true"/>
- <Cell col="3" displaytype="text" text="bind:name"/>
- <Cell col="4" displaytype="text" text="bind:departname"/>
- <Cell col="5" style="align:left;" text="bind:grade"/>
- <Cell col="6" displaytype="number" edittype="expr:getRowType(currow) == 2 || btn_save.enable == true ? 'masknumber' : 'none'" text="bind:amt" editautoselect="true"/>
- <Cell col="7" displaytype="number" text="bind:new_remain" editautoselect="true"/>
- <Cell col="8" displaytype="number" text="bind:old_remain"/>
- <Cell col="9" displaytype="expr:utlf_isNull(old_ibgo_date) || old_ibgo_date == '-' ? 'normal' : 'date'" style="align:center middle;" text="bind:old_ibgo_date"/>
- <Cell col="10" displaytype="number" text="bind:cremain" editautoselect="true"/>
- </Band>
- <Band id="summary">
- <Cell/>
- <Cell col="1"/>
- <Cell col="2"/>
- <Cell col="3"/>
- <Cell col="4"/>
- <Cell col="5" style="font:Dotum,9,bold;" text="합계"/>
- <Cell col="6" displaytype="number" style="font:Dotum,9,bold;" text="expr:getSum('amt')"/>
- <Cell col="7"/>
- <Cell col="8"/>
- <Cell col="9"/>
- <Cell col="10"/>
- </Band>
- </Format>
- </Formats>
- </Grid>
- <Static id="caption1" text="식권판매 리스트" class="tit_2" position="absolute 0 99 157 115"/>
- <Shape id="line1" class="line_10" position="absolute 0 115 1023 121" anchor="left top right"/>
- <Div id="grp_search" taborder="34" class="div_SA2" position="absolute 0 51 1023 91" anchor="left top right">
- <Layouts>
- <Layout>
- <Static id="cap_ibgodd" text="판매일자" class="search_name" position="absolute 10 12 84 29" anchor="default"/>
- <Button id="btn_search" taborder="4" text="조회" onclick="grp_search_btn_search_onclick" class="btn1" position="absolute 953 9 1009 31" style="align:center;" anchor="top right"/>
- <Shape id="line7" linetype="vertical" class="line_4" position="absolute 938 7 941 34" anchor="top right"/>
- <Calendar id="ipt_ibgodd" taborder="5" autoselect="true" class="input_essential" position="absolute 81 9 199 30" onchanged="grp_search_ipt_ibgodd_onchanged" anchor="default"/>
- <Edit id="ipt_id" taborder="6" autoselect="true" position="absolute 323 10 439 30" onkeydown="grp_search_ipt_id_onkeydown" inputmode="upper" useime="none"/>
- <Static id="cap_id" text="직원번호" class="search_name" position="absolute 253 12 327 29"/>
- </Layout>
- </Layouts>
- </Div>
- <Static id="caption00" text="합계" class="tit_3" position="absolute 456 97 509 113" visible="false"/>
- <MaskEdit id="ipt_sum" taborder="35" position="absolute 511 95 629 115" readonly="true" mask="9,999" anchor="left top right" visible="false"/>
- <Button id="btn_insert" taborder="36" text="행추가" class="btn2" position="absolute 915 95 968 114" onclick="btn_insert_onclick"/>
- <Button id="btn_delete" taborder="37" text="행삭제" class="btn2" position="absolute 970 95 1023 114" onclick="btn_delete_onclick"/>
- <Button id="btn_close" taborder="38" text="마감" class="btn5" position="absolute 854 26 899 48" anchor="top right" onclick="btn_close_onclick"/>
- <Button id="btn_closeCancer" taborder="39" text="마감취소" class="btn5" position="absolute 901 26 966 48" anchor="top right" enable="false" onclick="btn_closeCancer_onclick"/>
- </Layout>
- </Layouts>
- <Bind>
- <BindItem id="item19" compid="cap_messege" propid="text" datasetid="ds_messege" columnid="cmt"/>
- <BindItem id="item15" compid="grp_search.ipt_ibgodd" propid="value" datasetid="ds_send" columnid="ibgo_date"/>
- <BindItem id="item3" compid="grp_search.ipt_id" propid="value" datasetid="ds_send" columnid="id"/>
- </Bind>
- <Objects>
- <Dataset id="ds_send" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
- <ColumnInfo>
- <Column id="instcd" type="STRING" size="256"/>
- <Column id="userid" type="STRING" size="256"/>
- <Column id="ibgo_date" type="STRING" size="256"/>
- <Column id="id" type="STRING" size="256"/>
- </ColumnInfo>
- <Rows>
- <Row/>
- </Rows>
- </Dataset>
- <Dataset id="ds_main_food0108list" firefirstcount="0" firenextcount="0" useclientlayout="true" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false" oncolumnchanged="ds_main_food0108list_oncolumnchanged">
- <ColumnInfo>
- <Column id="user_id" type="STRING" size="256"/>
- <Column id="ibgo_date" type="STRING" size="256"/>
- <Column id="id" type="STRING" size="256"/>
- <Column id="amt" type="INT" size="256"/>
- <Column id="old_remain" type="STRING" size="256"/>
- <Column id="old_expandfood" type="STRING" size="256"/>
- <Column id="old_ibgo_date" type="STRING" size="256"/>
- <Column id="new_remain" type="STRING" size="256"/>
- <Column id="new_expandfood" type="STRING" size="256"/>
- <Column id="name" type="STRING" size="256"/>
- <Column id="departname" type="STRING" size="256"/>
- <Column id="grade" type="STRING" size="256"/>
- <Column id="payfood" type="STRING" size="256"/>
- <Column id="expandfood" type="STRING" size="256"/>
- <Column id="remain" type="STRING" size="256"/>
- <Column id="cremain" type="STRING" size="256"/>
- <Column id="magam" type="STRING" size="256"/>
- <Column id="bfpayfood" type="STRING" size="256"/>
- </ColumnInfo>
- </Dataset>
- <Dataset id="ds_temp_foodremaininfo" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false"/>
- <Dataset id="ds_save_food0108list" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
- <ColumnInfo>
- <Column id="user_id" type="STRING" size="256"/>
- <Column id="ibgo_date" type="STRING" size="256"/>
- <Column id="id" type="STRING" size="256"/>
- <Column id="amt" type="STRING" size="256"/>
- <Column id="old_remain" type="STRING" size="256"/>
- <Column id="old_expandfood" type="STRING" size="256"/>
- <Column id="old_ibgo_date" type="STRING" size="256"/>
- <Column id="new_remain" type="STRING" size="256"/>
- <Column id="new_expandfood" type="STRING" size="256"/>
- <Column id="instcd" type="STRING" size="256"/>
- <Column id="status" type="STRING" size="256"/>
- <Column id="bfpayfood" type="STRING" size="256"/>
- </ColumnInfo>
- </Dataset>
- <Dataset id="ds_save_foodmaster" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
- <ColumnInfo>
- <Column id="id" type="STRING" size="256"/>
- <Column id="payfood" type="STRING" size="256"/>
- <Column id="expandfood" type="STRING" size="256"/>
- <Column id="remain" type="STRING" size="256"/>
- <Column id="hiredate" type="STRING" size="256"/>
- <Column id="instcd" type="STRING" size="256"/>
- <Column id="status" type="STRING" size="256"/>
- <Column id="old_ibgo_date" type="STRING" size="256"/>
- <Column id="old_remain" type="STRING" size="256"/>
- <Column id="bfpayfood" type="STRING" size="256"/>
- <Column id="old_expandfood" type="STRING" size="256"/>
- </ColumnInfo>
- </Dataset>
- <Dataset id="ds_magam" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
- <ColumnInfo>
- <Column id="instcd" type="STRING" size="256"/>
- <Column id="flag" type="STRING" size="256"/>
- <Column id="magamdd" type="STRING" size="256"/>
- <Column id="ibgodate" type="STRING" size="256"/>
- </ColumnInfo>
- <Rows>
- <Row/>
- </Rows>
- </Dataset>
- </Objects>
- <Script type="xscript4.0"><![CDATA[/***************************************************************************************
- * System Name :
- * Job Name :
- * Creator :
- * Make Date : 2017-12-04
- * Description :
- *---------------------------------------------------------------------------------------
- * Modify Date Modifier Modify Description
- *---------------------------------------------------------------------------------------
- * 2017-06-19 Live Converter TF->XP
- *
- *---------------------------------------------------------------------------------------
- ****************************************************************************************/
- //=======================================================================================
- // Lib Include
- //---------------------------------------------------------------------------------------
- include "com_commonxp::comm_main.xjs";
- include "mis_miscommonxp::MIS.xjs";
- //=======================================================================================
- // Global Form Variable
- //---------------------------------------------------------------------------------------
- var arErrorCode = new HashArray();
- //=======================================================================================
- // Function
- //---------------------------------------------------------------------------------------
- /****************************************************************************************
- * Argument : N/A
- * Description : 시간설정
- ****************************************************************************************/
- function lf_setTime() {
- var cTime = utlf_getCurrentDateTime();
- cap_time.text = cTime.substr(0,4)+"/"+cTime.substr(4,2)+"/"+cTime.substr(6,2)+" "+cTime.substr(9,2)+":"+cTime.substr(11,2)+":"+cTime.substr(13,2);
- }
- /****************************************************************************************
- * Argument : N/A
- * Description : 합계
- ****************************************************************************************/
- function lf_sum() {
- // var sumAmt = 0;
- // for(var i = 0 ; i < ds_main_food0108list.rowcount ; i++) {
- // sumAmt = sumAmt + parseInt(ds_main_food0108list.getColumn(i,"amt"));
- // }
- // ipt_sum.value = sumAmt;
- }
- //=======================================================================================
- // Event
- //---------------------------------------------------------------------------------------
- /****************************************************************************************
- * Components : Form
- * Description : 화면 처음 초기화시 폼초기화
- ****************************************************************************************/
- function SMRNB00500_onload(obj:Form, e:LoadEventInfo)
- {
- frmf_initForm(obj);
-
- grdf_setGridSort(grd_food0108list);
- grdf_setRowTypeIcon(grd_food0108list, 0);
-
- var sInstcd = sysf_getUserInfo("dutplceinstcd");
- ds_send.setColumn(0, "instcd", sInstcd);
- ds_send.setColumn(0, "ibgo_date", utlf_getCurrentDate());
-
- lf_setTime();
- this.setTimer(0, 1000);
-
- grp_search.btn_search.click();
- }
- /****************************************************************************************
- * Components : Form
- * Description : 화면 타이머 설정 시계표시
- ****************************************************************************************/
- function SMRNB00500_ontimer(obj:Form, e:TimerEventInfo)
- {
- if(e.timerid == 0) {
- lf_setTime();
- }
- }
- /****************************************************************************************
- * Components : Button
- * Description : 입력(입력란초기화)
- ****************************************************************************************/
- function btn_insert_onclick(obj:Button, e:ClickEventInfo)
- {
- cap_messege_title.style.background = "lightblue";
- cap_messege.text = "";
-
- ds_main_food0108list.insertRow(0);
- grd_food0108list.setFocus();
- grd_food0108list.setCellPos(grd_food0108list.getBindCellIndex("body","id"));
- grd_food0108list.showEditor(true);
- }
- /****************************************************************************************
- * Components : Button
- * Description : 삭제
- ****************************************************************************************/
- function btn_delete_onclick(obj:Button, e:ClickEventInfo)
- {
- if(ds_main_food0108list.rowposition < 0) return;
-
- if(ds_main_food0108list.getRowType(ds_main_food0108list.rowposition) == 2) ds_main_food0108list.deleteRow(ds_main_food0108list.rowposition);
- else {
- cap_messege_title.style.background = "lightblue";
- cap_messege.text = "";
-
- if( Number(ds_main_food0108list.getColumn(ds_main_food0108list.rowposition, "new_remain")) > Number(ds_main_food0108list.getColumn(ds_main_food0108list.rowposition, "cremain")) ){
- cap_messege_title.style.background = "lightblue";
- cap_messege.text = "판매금액보다 현재 남은 잔량이 적어 삭제할 수 없습니다.";
-
- sysf_messageBox("판매금액보다 현재 남은 잔량이 적어 삭제", "E001");
- }else if( utlf_isNull(grp_search.ipt_ibgodd.value) || utlf_diffDate(grp_search.ipt_ibgodd.value, utlf_getCurrentDate()) > 1 ){
- cap_messege_title.style.background = "lightblue";
- cap_messege.text = "판매일에서 2일이내만 삭제가능합니다.";
-
- sysf_messageBox("판매일에서 2일이내만 삭제", "I006");
- }else{
- ds_main_food0108list.enableevent = false;
- ds_main_food0108list.updatecontrol = false;
-
- ds_main_food0108list.setRowType(ds_main_food0108list.rowposition, 8);
-
- ds_main_food0108list.updatecontrol = true;
- ds_main_food0108list.enableevent = true;
- }
- }
- }
- /****************************************************************************************
- * Components : Button
- * Description : 저장
- ****************************************************************************************/
- function btn_save_onclick(obj:Button, e:ClickEventInfo)
- {
- var dsUpdate = grdf_getGridUpdateData(grd_food0108list, "all");
- if( !utlf_isNull(dsUpdate) && dsUpdate.rowcount > 0 ) {
- ds_save_food0108list.clearData();
- ds_save_foodmaster.clearData();
-
- for(var i = ds_main_food0108list.rowcount-1 ; i >= 0 ; i--) {
- if( utlf_isNull(ds_main_food0108list.getColumn(i, "id")) || utlf_transNullToEmpty(ds_main_food0108list.getColumn(i, "id")).length < 5 ){
- ds_main_food0108list.rowposition = i;
- grd_food0108list.setCellPos(2);
- grd_food0108list.setFocus();
- sysf_messageBox("직원번호는 5자리이상", "C001");
-
- return false;
- }
-
- if(utlf_isNull(ds_main_food0108list.getColumn(i, "name"))){
- sysf_messageBox("성명이 누락된 리스트가 있습니다. 식수인사마스터에 등록여부를", "I007");
- return false;
- }
-
- var status = ds_main_food0108list.getRowType(i);
- if(status == 2) status = "i";
- else if(status == 4) status = "u";
- else if(status == 8) status = "d";
- else continue;
-
- if(utlf_isNull(ds_main_food0108list.getColumn(i,"amt"))) {
- ds_main_food0108list.deleteRow(i);
- } else {
- var nRow = ds_save_food0108list.addRow();
- ds_save_food0108list.setColumn(nRow, "user_id", "영양실");
- ds_save_food0108list.setColumn(nRow, "ibgo_date", ds_send.getColumn(0,"ibgo_date"));
- ds_save_food0108list.setColumn(nRow, "id", ds_main_food0108list.getColumn(i, "id"));
- ds_save_food0108list.setColumn(nRow, "amt", ds_main_food0108list.getColumn(i, "amt"));
- ds_save_food0108list.setColumn(nRow, "old_remain", ds_main_food0108list.getColumn(i, "old_remain"));
- ds_save_food0108list.setColumn(nRow, "new_remain", ds_main_food0108list.getColumn(i, "new_remain"));
- ds_save_food0108list.setColumn(nRow, "old_expandfood", ds_main_food0108list.getColumn(i, "old_expandfood"));
- ds_save_food0108list.setColumn(nRow, "new_expandfood", 0);
- ds_save_food0108list.setColumn(nRow, "old_ibgo_date", ds_main_food0108list.getColumn(i, "old_ibgo_date"));
- ds_save_food0108list.setColumn(nRow, "instcd", ds_send.getColumn(0,"instcd"));
- ds_save_food0108list.setColumn(nRow, "status", status);
- ds_save_food0108list.setColumn(nRow, "bfpayfood", ds_main_food0108list.getColumn(i, "bfpayfood"));
-
- var nRowm = ds_save_foodmaster.addRow();
- ds_save_foodmaster.setColumn(nRowm, "id", ds_main_food0108list.getColumn(i, "id"));
- ds_save_foodmaster.setColumn(nRowm, "payfood", ds_main_food0108list.getColumn(i, "payfood"));
- ds_save_foodmaster.setColumn(nRowm, "expandfood", 0);
- ds_save_foodmaster.setColumn(nRowm, "remain", ds_main_food0108list.getColumn(i, "new_remain"));
- ds_save_foodmaster.setColumn(nRowm, "hiredate", ds_send.getColumn(0,"ibgo_date"));
- ds_save_foodmaster.setColumn(nRowm, "instcd", ds_send.getColumn(0,"instcd"));
- ds_save_foodmaster.setColumn(nRowm, "status", status);
- ds_save_foodmaster.setColumn(nRowm, "old_ibgo_date", utlf_transNullToEmpty(ds_main_food0108list.getColumn(i, "old_ibgo_date")).substr(0, 8));
- ds_save_foodmaster.setColumn(nRowm, "old_remain", ds_main_food0108list.getColumn(i, "old_remain"));
- ds_save_foodmaster.setColumn(nRowm, "bfpayfood", ds_main_food0108list.getColumn(i, "bfpayfood"));
- ds_save_foodmaster.setColumn(nRowm, "old_expandfood", ds_main_food0108list.getColumn(i, "old_expandfood"));
- }
- }
-
- dsf_setTypeFormat(ds_save_food0108list, "amt:INT^old_remain:INT^new_remain:INT^old_expandfood:INT^new_expandfood:INT^ibgo_date:DATE^old_ibgo_date:DATE");
- dsf_setTypeFormat(ds_save_foodmaster, "payfood:INT^expandfood:INT^remain:INT^hiredate:DATE");
- var oParam = {};
- oParam.id = "TXRNB00004";
- oParam.service = "sicksuapp.SicksuMngt";
- oParam.method = "reqSetFoodsaleInfo";
- oParam.inds = "food0108=ds_save_food0108list foodmaster=ds_save_foodmaster";
- //oParam.outds = "ds_hidden=temp";
- oParam.async = false;
- oParam.callback = "cf_TXRNB00004";
- tranf_submit(oParam);
-
- if(arErrorCode.pop("TXRNB00004") > -1) {
- cap_messege_title.style.background = "lightblue";
- cap_messege.text = "저장이 완료되었습니다!";
- grp_search.btn_search.click();
- } else {
- cap_messege_title.style.background = "red";
- cap_messege.text = "저장에 실패하였습니다!";
- }
- } else {
- cap_messege_title.style.background = "lightblue";
- cap_messege.text = "저장할 내역이 없습니다!";
- }
- }
- function cf_TXRNB00004(sSvcId, nErrorCode, sErrorMsg) {
- arErrorCode.push(sSvcId, nErrorCode);
- }
- /****************************************************************************************
- * Components : Dataset
- * Description : ID입력후 정보조회
- ****************************************************************************************/
- function ds_main_food0108list_oncolumnchanged(obj:Dataset, e:DSColChangeEventInfo)
- {
- if(e.columnid == "id") {
- for(var i = 0 ; i < obj.rowcount ; i++) {
- if(i != e.row && obj.getColumn(i, "id") == e.newvalue) {
- cap_messege_title.style.background = "red";
- cap_messege.text = "이미 입력된 ID입니다. 확인해 주세요!";
- return;
- }
- }
-
- dsf_createDsRow("ds_req", [
- {col:"id", type:"STRING", size:256, val:e.newvalue}
- ,{col:"instcd", type:"STRING", size:256, val:ds_send.getColumn(0,"instcd")}
- ]);
- var oParam = {};
- oParam.id = "TRRNB00007";
- oParam.service = "sicksuapp.SicksuMngt";
- oParam.method = "reqGetFoodRemainInfo";
- oParam.inds = "req=ds_req";
- oParam.outds = "ds_temp_foodremaininfo=foodremaininfo";
- oParam.async = false;
- oParam.callback = "cf_TRRNB00007";
- tranf_submit(oParam);
-
- if(arErrorCode.pop("TRRNB00007") > -1) {
- if(ds_temp_foodremaininfo.rowcount > 0) {
- obj.copyRow(e.row, ds_temp_foodremaininfo, 0);
- obj.setColumn(e.row, "amt", 0);
- cap_messege_title.style.background = "lightblue";
- cap_messege.text = "";
- } else {
- obj.setColumn(e.row, "name", "");
- obj.setColumn(e.row, "departname", "");
- obj.setColumn(e.row, "grade", "");
- obj.setColumn(e.row, "amt", 0);
- obj.setColumn(e.row, "new_remain", "");
- obj.setColumn(e.row, "old_remain", "");
- cap_messege_title.style.background = "red";
- cap_messege.text = "잘못된 직원ID 입니다. 확인 후 처리 하세요!";
- }
- }
- }
-
- if(e.columnid == "amt") {
- var baseCash = 1000;
- if(obj.getColumn(e.row, "id").substr(0,2) == "A0") baseCash = 1200; //간병인
- else if(obj.getColumn(e.row, "id").substr(0,2) == "A1") baseCash = 2500; //실습생
- amt = parseFloat(e.newvalue) - utlf_transNull(e.oldvalue,0);
- var cnt = amt / baseCash;
- var payfoodCnt = parseFloat(e.newvalue) / baseCash;
- obj.setColumn(e.row, "new_remain", parseFloat(obj.getColumn(e.row, "new_remain")) + cnt);
- obj.setColumn(e.row, "payfood", payfoodCnt);
- obj.setColumn(e.row, "old_expandfood", obj.getColumn(e.row, "expandfood"));
- // lf_sum();
- }
- }
- function cf_TRRNB00007(sSvcId, nErrorCode, sErrorMsg) {
- arErrorCode.push(sSvcId, nErrorCode);
- }
- /****************************************************************************************
- * Components : Grid
- * Description : 입력칸에서 엔터시 다음 입력칸으로 이동
- ****************************************************************************************/
- function grd_food0108list_onenterdown(obj:Grid, e:GridEditEventInfo)
- {
- if(e.col == obj.getBindCellIndex("body","id")) {
- obj.setCellPos(obj.getBindCellIndex("body","amt"));
- obj.showEditor(true);
- }
-
- if(e.col == obj.getBindCellIndex("body","amt")) {
- if(e.row + 1 < obj.rowcount) {
- ds_main_food0108list.rowposition = e.row + 1;
- obj.setCellPos(obj.getBindCellIndex("body","id"));
- obj.showEditor(true);
- }
- }
- }
- /****************************************************************************************
- * Components : Button
- * Description : 판매리스트조회
- ****************************************************************************************/
- function grp_search_btn_search_onclick(obj:Button, e:ClickEventInfo)
- {
- var oParam = {};
- oParam.id = "TRRNB00008";
- oParam.service = "sicksuapp.SicksuMngt";
- oParam.method = "reqGetFoodSaleList";
- oParam.inds = "req=ds_send";
- oParam.outds = "ds_main_food0108list=foodsalelist";
- oParam.async = false;
- oParam.callback = "cf_TRRNB00008";
- tranf_submit(oParam);
-
- if(arErrorCode.pop("TRRNB00008") > -1) {
- cap_messege_title.style.background = "lightblue";
- cap_messege.text = "";
-
- if( ds_main_food0108list.rowcount < 1 || ds_main_food0108list.getColumn(0, "magam") != "Y" ){
- btn_close.enable = true;
- btn_closeCancer.enable = false;
- btn_save.enable = true;
- btn_insert.enable = true;
- btn_delete.enable = true;
- }else{
- btn_close.enable = false;
- btn_closeCancer.enable = true;
- btn_save.enable = false;
- btn_insert.enable = false;
- btn_delete.enable = false;
- }
- }
- // lf_sum();
- }
- function cf_TRRNB00008(sSvcId, nErrorCode, sErrorMsg) {
- arErrorCode.push(sSvcId, nErrorCode);
- }
- function cf_TRRNB00009(sSvcId, nErrorCode, sErrorMsg) {
- arErrorCode.push(sSvcId, nErrorCode);
- }
- function grp_search_ipt_ibgodd_onchanged(obj:Calendar, e:ChangeEventInfo)
- {
- // if(e.postvalue == utlf_getCurrentDate()) btn_insert.enable = true;
- // else btn_insert.enable = false;
-
- obj.updateToDataset();
- grp_search.btn_search.click();
- }
- function btn_close_onclick(obj:Button, e:ClickEventInfo)
- {
- ds_magam.setColumn(0, "instcd", sysf_getUserInfo("dutplceinstcd"));
- ds_magam.setColumn(0, "flag", "M");
- ds_magam.setColumn(0, "magamdd", utlf_getCurrentDate());
- ds_magam.setColumn(0, "ibgodate", grp_search.ipt_ibgodd.value);
-
- var oParam = {};
- oParam.id = "TXRNB00009";
- oParam.service = "sicksuapp.SicksuMngt";
- oParam.method = "reqSetFoodMagam";
- oParam.inds = "req=ds_magam";
- oParam.outds = "";
- oParam.async = false;
- oParam.callback = "cf_TXRNB00009";
-
- tranf_submit(oParam);
-
- if( arErrorCode.pop("TXRNB00009") > -1 ){
- btn_close.enable = false;
- btn_closeCancer.enable = true;
- btn_save.enable = false;
- btn_insert.enable = false;
- btn_delete.enable = false;
-
- grp_search.btn_search.click();
- }
- }
- function cf_TXRNB00009(sSvcId, nErrorCode, sErrorMsg) {
- arErrorCode.push(sSvcId, nErrorCode);
- }
- function btn_closeCancer_onclick(obj:Button, e:ClickEventInfo)
- {
- ds_magam.setColumn(0, "instcd", sysf_getUserInfo("dutplceinstcd"));
- ds_magam.setColumn(0, "flag", "C");
- ds_magam.setColumn(0, "magamdd", utlf_getCurrentDate());
- ds_magam.setColumn(0, "ibgodate", grp_search.ipt_ibgodd.value);
-
- var oParam = {};
- oParam.id = "TXRNB00009";
- oParam.service = "sicksuapp.SicksuMngt";
- oParam.method = "reqSetFoodMagam";
- oParam.inds = "req=ds_magam";
- oParam.outds = "";
- oParam.async = false;
- oParam.callback = "cf_TXRNB00009";
-
- tranf_submit(oParam);
-
- if( arErrorCode.pop("TXRNB00009") > -1 ){
- btn_close.enable = true;
- btn_closeCancer.enable = false;
- btn_save.enable = true;
- btn_insert.enable = true;
- btn_delete.enable = true;
-
- grp_search.btn_search.click();
- }
- }
- function grp_search_ipt_id_onkeydown(obj:Edit, e:KeyEventInfo)
- {
- if( e.keycode == 13 ){
- if( utlf_transNullToEmpty(grp_search.ipt_id.value).length < 5 ){
- grp_search.ipt_id.setFocus();
-
- sysf_messageBox("직원번호는 5자리이상", "C001");
- }else{
- obj.updateToDataset();
- grp_search.btn_search.click();
- }
- }
- }
- ]]></Script>
- </Form>
- </FDL>
|