SMRNB00500_식권판매관리.xfdl 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <FDL version="1.5">
  3. <TypeDefinition url="..\..\..\default_typedef.xml"/>
  4. <Form id="SMRNB00500" inheritanceid="" position="absolute 0 0 1024 665" titletext="식권판매관리" onload="SMRNB00500_onload" ontimer="SMRNB00500_ontimer">
  5. <Layouts>
  6. <Layout>
  7. <Static id="caption6" text="식권판매관리" class="tit_1" position="absolute 0 0 120 25"/>
  8. <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"/>
  9. <Button id="btn_save" taborder="29" text="저장" class="btn4" position="absolute 968 26 1023 48" anchor="top right" onclick="btn_save_onclick"/>
  10. <Static id="cap_messege_title" position="absolute 72 638 229 661" anchor="left bottom" style="background:lightblue;padding:0 0 0 4;"/>
  11. <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;"/>
  12. <Shape id="line7" class="line_6" position="absolute 0 47 1023 53" anchor="left top right"/>
  13. <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">
  14. <Formats>
  15. <Format id="default">
  16. <Columns>
  17. <Column size="25" band="left"/>
  18. <Column size="25" band="left"/>
  19. <Column size="80"/>
  20. <Column size="80"/>
  21. <Column size="159"/>
  22. <Column size="100"/>
  23. <Column size="100"/>
  24. <Column size="80"/>
  25. <Column size="80"/>
  26. <Column size="120"/>
  27. <Column size="80"/>
  28. </Columns>
  29. <Rows>
  30. <Row size="24" band="head"/>
  31. <Row size="24"/>
  32. <Row size="24" band="summ"/>
  33. </Rows>
  34. <Band id="head">
  35. <Cell/>
  36. <Cell col="1"/>
  37. <Cell col="2" displaytype="normal" text="직원번호"/>
  38. <Cell col="3" text="성명"/>
  39. <Cell col="4" text="소속"/>
  40. <Cell col="5" text="직급"/>
  41. <Cell col="6" text="판매금액"/>
  42. <Cell col="7" text="후 잔량"/>
  43. <Cell col="8" text="직전잔량"/>
  44. <Cell col="9" text="직전판매일"/>
  45. <Cell col="10" text="M잔량"/>
  46. </Band>
  47. <Band id="body">
  48. <Cell celltype="head"/>
  49. <Cell col="1" celltype="head" text="expr:currow+1"/>
  50. <Cell col="2" displaytype="text" edittype="expr:getRowType(currow) == 2 ? 'text' : 'none'" editfilter="upper,number" text="bind:id" edituseime="none" editautoselect="true"/>
  51. <Cell col="3" displaytype="text" text="bind:name"/>
  52. <Cell col="4" displaytype="text" text="bind:departname"/>
  53. <Cell col="5" style="align:left;" text="bind:grade"/>
  54. <Cell col="6" displaytype="number" edittype="expr:getRowType(currow) == 2 || btn_save.enable == true ? 'masknumber' : 'none'" text="bind:amt" editautoselect="true"/>
  55. <Cell col="7" displaytype="number" text="bind:new_remain" editautoselect="true"/>
  56. <Cell col="8" displaytype="number" text="bind:old_remain"/>
  57. <Cell col="9" displaytype="expr:utlf_isNull(old_ibgo_date) || old_ibgo_date == '-' ? 'normal' : 'date'" style="align:center middle;" text="bind:old_ibgo_date"/>
  58. <Cell col="10" displaytype="number" text="bind:cremain" editautoselect="true"/>
  59. </Band>
  60. <Band id="summary">
  61. <Cell/>
  62. <Cell col="1"/>
  63. <Cell col="2"/>
  64. <Cell col="3"/>
  65. <Cell col="4"/>
  66. <Cell col="5" style="font:Dotum,9,bold;" text="합계"/>
  67. <Cell col="6" displaytype="number" style="font:Dotum,9,bold;" text="expr:getSum('amt')"/>
  68. <Cell col="7"/>
  69. <Cell col="8"/>
  70. <Cell col="9"/>
  71. <Cell col="10"/>
  72. </Band>
  73. </Format>
  74. </Formats>
  75. </Grid>
  76. <Static id="caption1" text="식권판매 리스트" class="tit_2" position="absolute 0 99 157 115"/>
  77. <Shape id="line1" class="line_10" position="absolute 0 115 1023 121" anchor="left top right"/>
  78. <Div id="grp_search" taborder="34" class="div_SA2" position="absolute 0 51 1023 91" anchor="left top right">
  79. <Layouts>
  80. <Layout>
  81. <Static id="cap_ibgodd" text="판매일자" class="search_name" position="absolute 10 12 84 29" anchor="default"/>
  82. <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"/>
  83. <Shape id="line7" linetype="vertical" class="line_4" position="absolute 938 7 941 34" anchor="top right"/>
  84. <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"/>
  85. <Edit id="ipt_id" taborder="6" autoselect="true" position="absolute 323 10 439 30" onkeydown="grp_search_ipt_id_onkeydown" inputmode="upper" useime="none"/>
  86. <Static id="cap_id" text="직원번호" class="search_name" position="absolute 253 12 327 29"/>
  87. </Layout>
  88. </Layouts>
  89. </Div>
  90. <Static id="caption00" text="합계" class="tit_3" position="absolute 456 97 509 113" visible="false"/>
  91. <MaskEdit id="ipt_sum" taborder="35" position="absolute 511 95 629 115" readonly="true" mask="9,999" anchor="left top right" visible="false"/>
  92. <Button id="btn_insert" taborder="36" text="행추가" class="btn2" position="absolute 915 95 968 114" onclick="btn_insert_onclick"/>
  93. <Button id="btn_delete" taborder="37" text="행삭제" class="btn2" position="absolute 970 95 1023 114" onclick="btn_delete_onclick"/>
  94. <Button id="btn_close" taborder="38" text="마감" class="btn5" position="absolute 854 26 899 48" anchor="top right" onclick="btn_close_onclick"/>
  95. <Button id="btn_closeCancer" taborder="39" text="마감취소" class="btn5" position="absolute 901 26 966 48" anchor="top right" enable="false" onclick="btn_closeCancer_onclick"/>
  96. </Layout>
  97. </Layouts>
  98. <Bind>
  99. <BindItem id="item19" compid="cap_messege" propid="text" datasetid="ds_messege" columnid="cmt"/>
  100. <BindItem id="item15" compid="grp_search.ipt_ibgodd" propid="value" datasetid="ds_send" columnid="ibgo_date"/>
  101. <BindItem id="item3" compid="grp_search.ipt_id" propid="value" datasetid="ds_send" columnid="id"/>
  102. </Bind>
  103. <Objects>
  104. <Dataset id="ds_send" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
  105. <ColumnInfo>
  106. <Column id="instcd" type="STRING" size="256"/>
  107. <Column id="userid" type="STRING" size="256"/>
  108. <Column id="ibgo_date" type="STRING" size="256"/>
  109. <Column id="id" type="STRING" size="256"/>
  110. </ColumnInfo>
  111. <Rows>
  112. <Row/>
  113. </Rows>
  114. </Dataset>
  115. <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">
  116. <ColumnInfo>
  117. <Column id="user_id" type="STRING" size="256"/>
  118. <Column id="ibgo_date" type="STRING" size="256"/>
  119. <Column id="id" type="STRING" size="256"/>
  120. <Column id="amt" type="INT" size="256"/>
  121. <Column id="old_remain" type="STRING" size="256"/>
  122. <Column id="old_expandfood" type="STRING" size="256"/>
  123. <Column id="old_ibgo_date" type="STRING" size="256"/>
  124. <Column id="new_remain" type="STRING" size="256"/>
  125. <Column id="new_expandfood" type="STRING" size="256"/>
  126. <Column id="name" type="STRING" size="256"/>
  127. <Column id="departname" type="STRING" size="256"/>
  128. <Column id="grade" type="STRING" size="256"/>
  129. <Column id="payfood" type="STRING" size="256"/>
  130. <Column id="expandfood" type="STRING" size="256"/>
  131. <Column id="remain" type="STRING" size="256"/>
  132. <Column id="cremain" type="STRING" size="256"/>
  133. <Column id="magam" type="STRING" size="256"/>
  134. <Column id="bfpayfood" type="STRING" size="256"/>
  135. </ColumnInfo>
  136. </Dataset>
  137. <Dataset id="ds_temp_foodremaininfo" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false"/>
  138. <Dataset id="ds_save_food0108list" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
  139. <ColumnInfo>
  140. <Column id="user_id" type="STRING" size="256"/>
  141. <Column id="ibgo_date" type="STRING" size="256"/>
  142. <Column id="id" type="STRING" size="256"/>
  143. <Column id="amt" type="STRING" size="256"/>
  144. <Column id="old_remain" type="STRING" size="256"/>
  145. <Column id="old_expandfood" type="STRING" size="256"/>
  146. <Column id="old_ibgo_date" type="STRING" size="256"/>
  147. <Column id="new_remain" type="STRING" size="256"/>
  148. <Column id="new_expandfood" type="STRING" size="256"/>
  149. <Column id="instcd" type="STRING" size="256"/>
  150. <Column id="status" type="STRING" size="256"/>
  151. <Column id="bfpayfood" type="STRING" size="256"/>
  152. </ColumnInfo>
  153. </Dataset>
  154. <Dataset id="ds_save_foodmaster" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
  155. <ColumnInfo>
  156. <Column id="id" type="STRING" size="256"/>
  157. <Column id="payfood" type="STRING" size="256"/>
  158. <Column id="expandfood" type="STRING" size="256"/>
  159. <Column id="remain" type="STRING" size="256"/>
  160. <Column id="hiredate" type="STRING" size="256"/>
  161. <Column id="instcd" type="STRING" size="256"/>
  162. <Column id="status" type="STRING" size="256"/>
  163. <Column id="old_ibgo_date" type="STRING" size="256"/>
  164. <Column id="old_remain" type="STRING" size="256"/>
  165. <Column id="bfpayfood" type="STRING" size="256"/>
  166. <Column id="old_expandfood" type="STRING" size="256"/>
  167. </ColumnInfo>
  168. </Dataset>
  169. <Dataset id="ds_magam" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
  170. <ColumnInfo>
  171. <Column id="instcd" type="STRING" size="256"/>
  172. <Column id="flag" type="STRING" size="256"/>
  173. <Column id="magamdd" type="STRING" size="256"/>
  174. <Column id="ibgodate" type="STRING" size="256"/>
  175. </ColumnInfo>
  176. <Rows>
  177. <Row/>
  178. </Rows>
  179. </Dataset>
  180. </Objects>
  181. <Script type="xscript4.0"><![CDATA[/***************************************************************************************
  182. * System Name :
  183. * Job Name :
  184. * Creator :
  185. * Make Date : 2017-12-04
  186. * Description :
  187. *---------------------------------------------------------------------------------------
  188. * Modify Date Modifier Modify Description
  189. *---------------------------------------------------------------------------------------
  190. * 2017-06-19 Live Converter TF->XP
  191. *
  192. *---------------------------------------------------------------------------------------
  193. ****************************************************************************************/
  194. //=======================================================================================
  195. // Lib Include
  196. //---------------------------------------------------------------------------------------
  197. include "com_commonxp::comm_main.xjs";
  198. include "mis_miscommonxp::MIS.xjs";
  199. //=======================================================================================
  200. // Global Form Variable
  201. //---------------------------------------------------------------------------------------
  202. var arErrorCode = new HashArray();
  203. //=======================================================================================
  204. // Function
  205. //---------------------------------------------------------------------------------------
  206. /****************************************************************************************
  207. * Argument : N/A
  208. * Description : 시간설정
  209. ****************************************************************************************/
  210. function lf_setTime() {
  211. var cTime = utlf_getCurrentDateTime();
  212. 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);
  213. }
  214. /****************************************************************************************
  215. * Argument : N/A
  216. * Description : 합계
  217. ****************************************************************************************/
  218. function lf_sum() {
  219. // var sumAmt = 0;
  220. // for(var i = 0 ; i < ds_main_food0108list.rowcount ; i++) {
  221. // sumAmt = sumAmt + parseInt(ds_main_food0108list.getColumn(i,"amt"));
  222. // }
  223. // ipt_sum.value = sumAmt;
  224. }
  225. //=======================================================================================
  226. // Event
  227. //---------------------------------------------------------------------------------------
  228. /****************************************************************************************
  229. * Components : Form
  230. * Description : 화면 처음 초기화시 폼초기화
  231. ****************************************************************************************/
  232. function SMRNB00500_onload(obj:Form, e:LoadEventInfo)
  233. {
  234. frmf_initForm(obj);
  235. grdf_setGridSort(grd_food0108list);
  236. grdf_setRowTypeIcon(grd_food0108list, 0);
  237. var sInstcd = sysf_getUserInfo("dutplceinstcd");
  238. ds_send.setColumn(0, "instcd", sInstcd);
  239. ds_send.setColumn(0, "ibgo_date", utlf_getCurrentDate());
  240. lf_setTime();
  241. this.setTimer(0, 1000);
  242. grp_search.btn_search.click();
  243. }
  244. /****************************************************************************************
  245. * Components : Form
  246. * Description : 화면 타이머 설정 시계표시
  247. ****************************************************************************************/
  248. function SMRNB00500_ontimer(obj:Form, e:TimerEventInfo)
  249. {
  250. if(e.timerid == 0) {
  251. lf_setTime();
  252. }
  253. }
  254. /****************************************************************************************
  255. * Components : Button
  256. * Description : 입력(입력란초기화)
  257. ****************************************************************************************/
  258. function btn_insert_onclick(obj:Button, e:ClickEventInfo)
  259. {
  260. cap_messege_title.style.background = "lightblue";
  261. cap_messege.text = "";
  262. ds_main_food0108list.insertRow(0);
  263. grd_food0108list.setFocus();
  264. grd_food0108list.setCellPos(grd_food0108list.getBindCellIndex("body","id"));
  265. grd_food0108list.showEditor(true);
  266. }
  267. /****************************************************************************************
  268. * Components : Button
  269. * Description : 삭제
  270. ****************************************************************************************/
  271. function btn_delete_onclick(obj:Button, e:ClickEventInfo)
  272. {
  273. if(ds_main_food0108list.rowposition < 0) return;
  274. if(ds_main_food0108list.getRowType(ds_main_food0108list.rowposition) == 2) ds_main_food0108list.deleteRow(ds_main_food0108list.rowposition);
  275. else {
  276. cap_messege_title.style.background = "lightblue";
  277. cap_messege.text = "";
  278. if( Number(ds_main_food0108list.getColumn(ds_main_food0108list.rowposition, "new_remain")) > Number(ds_main_food0108list.getColumn(ds_main_food0108list.rowposition, "cremain")) ){
  279. cap_messege_title.style.background = "lightblue";
  280. cap_messege.text = "판매금액보다 현재 남은 잔량이 적어 삭제할 수 없습니다.";
  281. sysf_messageBox("판매금액보다 현재 남은 잔량이 적어 삭제", "E001");
  282. }else if( utlf_isNull(grp_search.ipt_ibgodd.value) || utlf_diffDate(grp_search.ipt_ibgodd.value, utlf_getCurrentDate()) > 1 ){
  283. cap_messege_title.style.background = "lightblue";
  284. cap_messege.text = "판매일에서 2일이내만 삭제가능합니다.";
  285. sysf_messageBox("판매일에서 2일이내만 삭제", "I006");
  286. }else{
  287. ds_main_food0108list.enableevent = false;
  288. ds_main_food0108list.updatecontrol = false;
  289. ds_main_food0108list.setRowType(ds_main_food0108list.rowposition, 8);
  290. ds_main_food0108list.updatecontrol = true;
  291. ds_main_food0108list.enableevent = true;
  292. }
  293. }
  294. }
  295. /****************************************************************************************
  296. * Components : Button
  297. * Description : 저장
  298. ****************************************************************************************/
  299. function btn_save_onclick(obj:Button, e:ClickEventInfo)
  300. {
  301. var dsUpdate = grdf_getGridUpdateData(grd_food0108list, "all");
  302. if( !utlf_isNull(dsUpdate) && dsUpdate.rowcount > 0 ) {
  303. ds_save_food0108list.clearData();
  304. ds_save_foodmaster.clearData();
  305. for(var i = ds_main_food0108list.rowcount-1 ; i >= 0 ; i--) {
  306. if( utlf_isNull(ds_main_food0108list.getColumn(i, "id")) || utlf_transNullToEmpty(ds_main_food0108list.getColumn(i, "id")).length < 5 ){
  307. ds_main_food0108list.rowposition = i;
  308. grd_food0108list.setCellPos(2);
  309. grd_food0108list.setFocus();
  310. sysf_messageBox("직원번호는 5자리이상", "C001");
  311. return false;
  312. }
  313. if(utlf_isNull(ds_main_food0108list.getColumn(i, "name"))){
  314. sysf_messageBox("성명이 누락된 리스트가 있습니다. 식수인사마스터에 등록여부를", "I007");
  315. return false;
  316. }
  317. var status = ds_main_food0108list.getRowType(i);
  318. if(status == 2) status = "i";
  319. else if(status == 4) status = "u";
  320. else if(status == 8) status = "d";
  321. else continue;
  322. if(utlf_isNull(ds_main_food0108list.getColumn(i,"amt"))) {
  323. ds_main_food0108list.deleteRow(i);
  324. } else {
  325. var nRow = ds_save_food0108list.addRow();
  326. ds_save_food0108list.setColumn(nRow, "user_id", "영양실");
  327. ds_save_food0108list.setColumn(nRow, "ibgo_date", ds_send.getColumn(0,"ibgo_date"));
  328. ds_save_food0108list.setColumn(nRow, "id", ds_main_food0108list.getColumn(i, "id"));
  329. ds_save_food0108list.setColumn(nRow, "amt", ds_main_food0108list.getColumn(i, "amt"));
  330. ds_save_food0108list.setColumn(nRow, "old_remain", ds_main_food0108list.getColumn(i, "old_remain"));
  331. ds_save_food0108list.setColumn(nRow, "new_remain", ds_main_food0108list.getColumn(i, "new_remain"));
  332. ds_save_food0108list.setColumn(nRow, "old_expandfood", ds_main_food0108list.getColumn(i, "old_expandfood"));
  333. ds_save_food0108list.setColumn(nRow, "new_expandfood", 0);
  334. ds_save_food0108list.setColumn(nRow, "old_ibgo_date", ds_main_food0108list.getColumn(i, "old_ibgo_date"));
  335. ds_save_food0108list.setColumn(nRow, "instcd", ds_send.getColumn(0,"instcd"));
  336. ds_save_food0108list.setColumn(nRow, "status", status);
  337. ds_save_food0108list.setColumn(nRow, "bfpayfood", ds_main_food0108list.getColumn(i, "bfpayfood"));
  338. var nRowm = ds_save_foodmaster.addRow();
  339. ds_save_foodmaster.setColumn(nRowm, "id", ds_main_food0108list.getColumn(i, "id"));
  340. ds_save_foodmaster.setColumn(nRowm, "payfood", ds_main_food0108list.getColumn(i, "payfood"));
  341. ds_save_foodmaster.setColumn(nRowm, "expandfood", 0);
  342. ds_save_foodmaster.setColumn(nRowm, "remain", ds_main_food0108list.getColumn(i, "new_remain"));
  343. ds_save_foodmaster.setColumn(nRowm, "hiredate", ds_send.getColumn(0,"ibgo_date"));
  344. ds_save_foodmaster.setColumn(nRowm, "instcd", ds_send.getColumn(0,"instcd"));
  345. ds_save_foodmaster.setColumn(nRowm, "status", status);
  346. ds_save_foodmaster.setColumn(nRowm, "old_ibgo_date", utlf_transNullToEmpty(ds_main_food0108list.getColumn(i, "old_ibgo_date")).substr(0, 8));
  347. ds_save_foodmaster.setColumn(nRowm, "old_remain", ds_main_food0108list.getColumn(i, "old_remain"));
  348. ds_save_foodmaster.setColumn(nRowm, "bfpayfood", ds_main_food0108list.getColumn(i, "bfpayfood"));
  349. ds_save_foodmaster.setColumn(nRowm, "old_expandfood", ds_main_food0108list.getColumn(i, "old_expandfood"));
  350. }
  351. }
  352. 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");
  353. dsf_setTypeFormat(ds_save_foodmaster, "payfood:INT^expandfood:INT^remain:INT^hiredate:DATE");
  354. var oParam = {};
  355. oParam.id = "TXRNB00004";
  356. oParam.service = "sicksuapp.SicksuMngt";
  357. oParam.method = "reqSetFoodsaleInfo";
  358. oParam.inds = "food0108=ds_save_food0108list foodmaster=ds_save_foodmaster";
  359. //oParam.outds = "ds_hidden=temp";
  360. oParam.async = false;
  361. oParam.callback = "cf_TXRNB00004";
  362. tranf_submit(oParam);
  363. if(arErrorCode.pop("TXRNB00004") > -1) {
  364. cap_messege_title.style.background = "lightblue";
  365. cap_messege.text = "저장이 완료되었습니다!";
  366. grp_search.btn_search.click();
  367. } else {
  368. cap_messege_title.style.background = "red";
  369. cap_messege.text = "저장에 실패하였습니다!";
  370. }
  371. } else {
  372. cap_messege_title.style.background = "lightblue";
  373. cap_messege.text = "저장할 내역이 없습니다!";
  374. }
  375. }
  376. function cf_TXRNB00004(sSvcId, nErrorCode, sErrorMsg) {
  377. arErrorCode.push(sSvcId, nErrorCode);
  378. }
  379. /****************************************************************************************
  380. * Components : Dataset
  381. * Description : ID입력후 정보조회
  382. ****************************************************************************************/
  383. function ds_main_food0108list_oncolumnchanged(obj:Dataset, e:DSColChangeEventInfo)
  384. {
  385. if(e.columnid == "id") {
  386. for(var i = 0 ; i < obj.rowcount ; i++) {
  387. if(i != e.row && obj.getColumn(i, "id") == e.newvalue) {
  388. cap_messege_title.style.background = "red";
  389. cap_messege.text = "이미 입력된 ID입니다. 확인해 주세요!";
  390. return;
  391. }
  392. }
  393. dsf_createDsRow("ds_req", [
  394. {col:"id", type:"STRING", size:256, val:e.newvalue}
  395. ,{col:"instcd", type:"STRING", size:256, val:ds_send.getColumn(0,"instcd")}
  396. ]);
  397. var oParam = {};
  398. oParam.id = "TRRNB00007";
  399. oParam.service = "sicksuapp.SicksuMngt";
  400. oParam.method = "reqGetFoodRemainInfo";
  401. oParam.inds = "req=ds_req";
  402. oParam.outds = "ds_temp_foodremaininfo=foodremaininfo";
  403. oParam.async = false;
  404. oParam.callback = "cf_TRRNB00007";
  405. tranf_submit(oParam);
  406. if(arErrorCode.pop("TRRNB00007") > -1) {
  407. if(ds_temp_foodremaininfo.rowcount > 0) {
  408. obj.copyRow(e.row, ds_temp_foodremaininfo, 0);
  409. obj.setColumn(e.row, "amt", 0);
  410. cap_messege_title.style.background = "lightblue";
  411. cap_messege.text = "";
  412. } else {
  413. obj.setColumn(e.row, "name", "");
  414. obj.setColumn(e.row, "departname", "");
  415. obj.setColumn(e.row, "grade", "");
  416. obj.setColumn(e.row, "amt", 0);
  417. obj.setColumn(e.row, "new_remain", "");
  418. obj.setColumn(e.row, "old_remain", "");
  419. cap_messege_title.style.background = "red";
  420. cap_messege.text = "잘못된 직원ID 입니다. 확인 후 처리 하세요!";
  421. }
  422. }
  423. }
  424. if(e.columnid == "amt") {
  425. var baseCash = 1000;
  426. if(obj.getColumn(e.row, "id").substr(0,2) == "A0") baseCash = 1200; //간병인
  427. else if(obj.getColumn(e.row, "id").substr(0,2) == "A1") baseCash = 2500; //실습생
  428. amt = parseFloat(e.newvalue) - utlf_transNull(e.oldvalue,0);
  429. var cnt = amt / baseCash;
  430. var payfoodCnt = parseFloat(e.newvalue) / baseCash;
  431. obj.setColumn(e.row, "new_remain", parseFloat(obj.getColumn(e.row, "new_remain")) + cnt);
  432. obj.setColumn(e.row, "payfood", payfoodCnt);
  433. obj.setColumn(e.row, "old_expandfood", obj.getColumn(e.row, "expandfood"));
  434. // lf_sum();
  435. }
  436. }
  437. function cf_TRRNB00007(sSvcId, nErrorCode, sErrorMsg) {
  438. arErrorCode.push(sSvcId, nErrorCode);
  439. }
  440. /****************************************************************************************
  441. * Components : Grid
  442. * Description : 입력칸에서 엔터시 다음 입력칸으로 이동
  443. ****************************************************************************************/
  444. function grd_food0108list_onenterdown(obj:Grid, e:GridEditEventInfo)
  445. {
  446. if(e.col == obj.getBindCellIndex("body","id")) {
  447. obj.setCellPos(obj.getBindCellIndex("body","amt"));
  448. obj.showEditor(true);
  449. }
  450. if(e.col == obj.getBindCellIndex("body","amt")) {
  451. if(e.row + 1 < obj.rowcount) {
  452. ds_main_food0108list.rowposition = e.row + 1;
  453. obj.setCellPos(obj.getBindCellIndex("body","id"));
  454. obj.showEditor(true);
  455. }
  456. }
  457. }
  458. /****************************************************************************************
  459. * Components : Button
  460. * Description : 판매리스트조회
  461. ****************************************************************************************/
  462. function grp_search_btn_search_onclick(obj:Button, e:ClickEventInfo)
  463. {
  464. var oParam = {};
  465. oParam.id = "TRRNB00008";
  466. oParam.service = "sicksuapp.SicksuMngt";
  467. oParam.method = "reqGetFoodSaleList";
  468. oParam.inds = "req=ds_send";
  469. oParam.outds = "ds_main_food0108list=foodsalelist";
  470. oParam.async = false;
  471. oParam.callback = "cf_TRRNB00008";
  472. tranf_submit(oParam);
  473. if(arErrorCode.pop("TRRNB00008") > -1) {
  474. cap_messege_title.style.background = "lightblue";
  475. cap_messege.text = "";
  476. if( ds_main_food0108list.rowcount < 1 || ds_main_food0108list.getColumn(0, "magam") != "Y" ){
  477. btn_close.enable = true;
  478. btn_closeCancer.enable = false;
  479. btn_save.enable = true;
  480. btn_insert.enable = true;
  481. btn_delete.enable = true;
  482. }else{
  483. btn_close.enable = false;
  484. btn_closeCancer.enable = true;
  485. btn_save.enable = false;
  486. btn_insert.enable = false;
  487. btn_delete.enable = false;
  488. }
  489. }
  490. // lf_sum();
  491. }
  492. function cf_TRRNB00008(sSvcId, nErrorCode, sErrorMsg) {
  493. arErrorCode.push(sSvcId, nErrorCode);
  494. }
  495. function cf_TRRNB00009(sSvcId, nErrorCode, sErrorMsg) {
  496. arErrorCode.push(sSvcId, nErrorCode);
  497. }
  498. function grp_search_ipt_ibgodd_onchanged(obj:Calendar, e:ChangeEventInfo)
  499. {
  500. // if(e.postvalue == utlf_getCurrentDate()) btn_insert.enable = true;
  501. // else btn_insert.enable = false;
  502. obj.updateToDataset();
  503. grp_search.btn_search.click();
  504. }
  505. function btn_close_onclick(obj:Button, e:ClickEventInfo)
  506. {
  507. ds_magam.setColumn(0, "instcd", sysf_getUserInfo("dutplceinstcd"));
  508. ds_magam.setColumn(0, "flag", "M");
  509. ds_magam.setColumn(0, "magamdd", utlf_getCurrentDate());
  510. ds_magam.setColumn(0, "ibgodate", grp_search.ipt_ibgodd.value);
  511. var oParam = {};
  512. oParam.id = "TXRNB00009";
  513. oParam.service = "sicksuapp.SicksuMngt";
  514. oParam.method = "reqSetFoodMagam";
  515. oParam.inds = "req=ds_magam";
  516. oParam.outds = "";
  517. oParam.async = false;
  518. oParam.callback = "cf_TXRNB00009";
  519. tranf_submit(oParam);
  520. if( arErrorCode.pop("TXRNB00009") > -1 ){
  521. btn_close.enable = false;
  522. btn_closeCancer.enable = true;
  523. btn_save.enable = false;
  524. btn_insert.enable = false;
  525. btn_delete.enable = false;
  526. grp_search.btn_search.click();
  527. }
  528. }
  529. function cf_TXRNB00009(sSvcId, nErrorCode, sErrorMsg) {
  530. arErrorCode.push(sSvcId, nErrorCode);
  531. }
  532. function btn_closeCancer_onclick(obj:Button, e:ClickEventInfo)
  533. {
  534. ds_magam.setColumn(0, "instcd", sysf_getUserInfo("dutplceinstcd"));
  535. ds_magam.setColumn(0, "flag", "C");
  536. ds_magam.setColumn(0, "magamdd", utlf_getCurrentDate());
  537. ds_magam.setColumn(0, "ibgodate", grp_search.ipt_ibgodd.value);
  538. var oParam = {};
  539. oParam.id = "TXRNB00009";
  540. oParam.service = "sicksuapp.SicksuMngt";
  541. oParam.method = "reqSetFoodMagam";
  542. oParam.inds = "req=ds_magam";
  543. oParam.outds = "";
  544. oParam.async = false;
  545. oParam.callback = "cf_TXRNB00009";
  546. tranf_submit(oParam);
  547. if( arErrorCode.pop("TXRNB00009") > -1 ){
  548. btn_close.enable = true;
  549. btn_closeCancer.enable = false;
  550. btn_save.enable = true;
  551. btn_insert.enable = true;
  552. btn_delete.enable = true;
  553. grp_search.btn_search.click();
  554. }
  555. }
  556. function grp_search_ipt_id_onkeydown(obj:Edit, e:KeyEventInfo)
  557. {
  558. if( e.keycode == 13 ){
  559. if( utlf_transNullToEmpty(grp_search.ipt_id.value).length < 5 ){
  560. grp_search.ipt_id.setFocus();
  561. sysf_messageBox("직원번호는 5자리이상", "C001");
  562. }else{
  563. obj.updateToDataset();
  564. grp_search.btn_search.click();
  565. }
  566. }
  567. }
  568. ]]></Script>
  569. </Form>
  570. </FDL>