SPPAO00800_감액입력.xfdl 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <FDL version="1.5">
  3. <TypeDefinition url="..\..\..\default_typedef.xml"/>
  4. <Form id="SPPAO00800" position="absolute 0 0 526 317" titletext="감액입력" onload="SPPAO00800_onload">
  5. <Layouts>
  6. <Layout>
  7. <Shape id="line1" class="line_1" position="absolute 0 25 517 31" style="strokepen:3 solid #33bbbbff;"/>
  8. <Grid id="datagrid1" taborder="1" binddataset="ds_main_h_dcgm" useinputpanel="false" autofittype="col" position="absolute 0 29 518 261" ontextchanged="datagrid1_ontextchanged" autoenter="select">
  9. <Formats>
  10. <Format id="default">
  11. <Columns>
  12. <Column size="0"/>
  13. <Column size="0"/>
  14. <Column size="0"/>
  15. <Column size="0"/>
  16. <Column size="0"/>
  17. <Column size="0"/>
  18. <Column size="0"/>
  19. <Column size="0"/>
  20. <Column size="0"/>
  21. <Column size="0"/>
  22. <Column size="0"/>
  23. <Column size="63"/>
  24. <Column size="114"/>
  25. <Column size="101"/>
  26. <Column size="216"/>
  27. <Column size="0"/>
  28. <Column size="0"/>
  29. <Column size="0"/>
  30. <Column size="0"/>
  31. <Column size="0"/>
  32. <Column size="0"/>
  33. <Column size="0"/>
  34. <Column size="0"/>
  35. </Columns>
  36. <Rows>
  37. <Row size="24" band="head"/>
  38. <Row size="24"/>
  39. </Rows>
  40. <Band id="head">
  41. <Cell text="pid"/>
  42. <Cell col="1" text="orddd"/>
  43. <Cell col="2" text="cretno"/>
  44. <Cell col="3" text="rcptdd"/>
  45. <Cell col="4" text="rcptno"/>
  46. <Cell col="5" text="seqno"/>
  47. <Cell col="6" text="rcptseqno"/>
  48. <Cell col="7" text="instcd"/>
  49. <Cell col="8" text="rcptstat"/>
  50. <Cell col="9" text="ordtype"/>
  51. <Cell col="10" text="discreduflag"/>
  52. <Cell col="11" text="감액코드"/>
  53. <Cell col="12" text="감액명칭"/>
  54. <Cell col="13" text="감액"/>
  55. <Cell col="14" text="적용사유"/>
  56. <Cell col="15" text="rcptexecdd"/>
  57. <Cell col="16" text="rcpttm"/>
  58. <Cell col="17" text="remfact"/>
  59. <Cell col="18" text="rcptrid"/>
  60. <Cell col="19" text="fstrgstrid"/>
  61. <Cell col="20" text="fstrgstdt"/>
  62. <Cell col="21" text="lastupdtrid"/>
  63. <Cell col="22" text="lastupdtdt"/>
  64. </Band>
  65. <Band id="body">
  66. <Cell text="bind:dcgm_pid"/>
  67. <Cell col="1" text="bind:dcgm_orddd"/>
  68. <Cell col="2" text="bind:dcgm_cretno"/>
  69. <Cell col="3" text="bind:dcgm_rcptdd"/>
  70. <Cell col="4" text="bind:dcgm_rcptno"/>
  71. <Cell col="5" text="bind:dcgm_seqno"/>
  72. <Cell col="6" text="bind:dcgm_rcptseqno"/>
  73. <Cell col="7" text="bind:dcgm_instcd"/>
  74. <Cell col="8" text="bind:dcgm_rcptstat"/>
  75. <Cell col="9" text="bind:dcgm_ordtype"/>
  76. <Cell col="10" text="bind:dcgm_discreduflag"/>
  77. <Cell col="11" displaytype="text" edittype="text" text="bind:dcgm_discreducd"/>
  78. <Cell col="12" displaytype="combo" edittype="combo" text="bind:dcgm_discreducd2" combocodecol="cd" combodatacol="nm"/>
  79. <Cell col="13" displaytype="number" edittype="normal" editfilter="number" style="align:right middle;" text="bind:dcgm_discreduamt" mask="9,999"/>
  80. <Cell col="14" displaytype="text" edittype="text" text="bind:dcgm_apprsn"/>
  81. <Cell col="15" text="bind:dcgm_rcptexecdd"/>
  82. <Cell col="16" text="bind:dcgm_rcpttm"/>
  83. <Cell col="17" text="bind:dcgm_remfact"/>
  84. <Cell col="18" text="bind:dcgm_rcptrid"/>
  85. <Cell col="19" text="bind:dcgm_fstrgstrid"/>
  86. <Cell col="20" text="bind:dcgm_fstrgstdt"/>
  87. <Cell col="21" text="bind:dcgm_lastupdtrid"/>
  88. <Cell col="22" text="bind:dcgm_lastupdtdt"/>
  89. </Band>
  90. </Format>
  91. </Formats>
  92. </Grid>
  93. <Button id="button1" taborder="2" text="행삭제" class="btn2" position="absolute 464 5 517 24" onclick="button1_onclick"/>
  94. <Button id="btn_addrow" taborder="3" text="행추가" class="btn2" position="absolute 408 5 461 24" onclick="btn_addrow_onclick"/>
  95. <Static id="caption3" text="수납금액" class="cell_1" position="absolute 187 264 247 287" style="padding:0 0 0 0;align:center middle;"/>
  96. <Static id="caption4" text="감액총액" class="cell_1" position="absolute 354 264 414 287" style="padding:0 0 0 0;align:center middle;"/>
  97. <MaskEdit id="output2" taborder="4" readonly="true" mask="(-)#,###" position="absolute 250 265 350 284"/>
  98. <MaskEdit id="output3" taborder="5" readonly="true" mask="(-)#,###" position="absolute 417 265 517 284"/>
  99. <Static id="caption1" text="감액내역" class="tit_2" position="absolute 5 9 113 24"/>
  100. <Edit id="input1" taborder="6" position="absolute 135 265 165 284" onkeydown="input1_onkeydown"/>
  101. <Static id="caption2" text="%" position="absolute 165 265 185 285"/>
  102. <Button id="btn_confirm" taborder="7" text="확인" class="btn4" position="absolute 402 292 458 314" onclick="btn_confirm_onclick"/>
  103. <Button id="btn_cancel" taborder="8" text="취소" class="btn4" position="absolute 461 292 517 314" onclick="btn_cancel_onclick"/>
  104. <Shape id="line88" linetype="horizontal" class="line_6" position="absolute 0 287 518 293"/>
  105. </Layout>
  106. </Layouts>
  107. <Objects>
  108. <Dataset id="ds_main_h_dcgm" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" reversesubsum="false">
  109. <ColumnInfo>
  110. <Column id="dcgm_pid" type="STRING"/>
  111. <Column id="dcgm_orddd" type="STRING"/>
  112. <Column id="dcgm_cretno" type="STRING"/>
  113. <Column id="dcgm_rcptdd" type="STRING"/>
  114. <Column id="dcgm_rcptno" type="STRING"/>
  115. <Column id="dcgm_seqno" type="STRING"/>
  116. <Column id="dcgm_rcptseqno" type="STRING"/>
  117. <Column id="dcgm_instcd" type="STRING"/>
  118. <Column id="dcgm_rcptstat" type="STRING"/>
  119. <Column id="dcgm_ordtype" type="STRING"/>
  120. <Column id="dcgm_discreduflag" type="STRING"/>
  121. <Column id="dcgm_discreducd" type="STRING"/>
  122. <Column id="dcgm_discreducd2" type="STRING"/>
  123. <Column id="dcgm_discreduamt" type="INT"/>
  124. <Column id="dcgm_apprsn" type="STRING"/>
  125. <Column id="dcgm_rcptexecdd" type="STRING"/>
  126. <Column id="dcgm_rcpttm" type="STRING"/>
  127. <Column id="dcgm_remfact" type="STRING"/>
  128. <Column id="dcgm_rcptrid" type="STRING"/>
  129. <Column id="dcgm_fstrgstrid" type="STRING"/>
  130. <Column id="dcgm_fstrgstdt" type="STRING"/>
  131. <Column id="dcgm_lastupdtrid" type="STRING"/>
  132. <Column id="dcgm_lastupdtdt" type="STRING"/>
  133. </ColumnInfo>
  134. </Dataset>
  135. <Dataset id="ds_hidden_session" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false"/>
  136. <Dataset id="ds_main_dcgm" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
  137. <ColumnInfo>
  138. <Column id="totrcptamt" type="INT" size="256"/>
  139. <Column id="totreduamt" type="INT" size="256"/>
  140. <Column id="percent" type="STRING" size="256"/>
  141. </ColumnInfo>
  142. </Dataset>
  143. <Dataset id="ds_tmp" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false"/>
  144. <Dataset id="ds_init_reducd" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false"/>
  145. </Objects>
  146. <Bind>
  147. <BindItem id="item0" compid="input1" propid="value" datasetid="ds_main_dcgm" columnid="percent"/>
  148. <BindItem id="item1" compid="output2" propid="value" datasetid="ds_main_dcgm" columnid="totrcptamt"/>
  149. <BindItem id="item2" compid="output3" propid="value" datasetid="ds_main_dcgm" columnid="totreduamt"/>
  150. </Bind>
  151. <Script type="xscript4.0"><![CDATA[/***************************************************************************************
  152. * System Name :
  153. * Job Name :
  154. * Creator :
  155. * Make Date : 2016-05-24
  156. * Description :
  157. *---------------------------------------------------------------------------------------
  158. * Modify Date Modifier Modify Description
  159. *---------------------------------------------------------------------------------------
  160. * 2016-05-24 Live Converter TF->XP
  161. *
  162. *---------------------------------------------------------------------------------------
  163. ****************************************************************************************/
  164. //=======================================================================================
  165. // Lib Include
  166. //---------------------------------------------------------------------------------------
  167. include 'com_commonxp::comm_main.xjs';
  168. include 'pam_opatmngtxp::PMOCOM.xjs';
  169. //=======================================================================================
  170. // Local variables
  171. //---------------------------------------------------------------------------------------
  172. var gOrddd, gTotrcptamt, strSend, strRcv;
  173. //=======================================================================================
  174. // Local methods
  175. //---------------------------------------------------------------------------------------
  176. /****************************************************************************************
  177. * Argument :
  178. * Description :
  179. ****************************************************************************************/
  180. function fInit(){
  181. ds_main_dcgm.clearData();
  182. ds_main_dcgm.addRow();
  183. ds_main_dcgm.setColumn(0, 'totrcptamt', '0');
  184. ds_main_dcgm.setColumn(0, 'totreduamt', '0');
  185. ds_main_h_dcgm.clearData();
  186. }
  187. /****************************************************************************************
  188. * Argument :
  189. * Description :
  190. ****************************************************************************************/
  191. function fReduamtCalc(){
  192. var rowcnt = ds_main_h_dcgm.rowcount;
  193. if(rowcnt > 0){
  194. var dcgm_discreduamt = 0;
  195. var totrcptamt = parseInt(ds_main_dcgm.getColumn(0, 'totrcptamt'));
  196. for(var i = 0; i < rowcnt; i++){
  197. dcgm_discreduamt += parseInt(ds_main_h_dcgm.getColumn(i, 'dcgm_discreduamt'));
  198. }
  199. if(totrcptamt < dcgm_discreduamt){
  200. sysf_messageBox('감액총액이 수납금액을 초과합니다!', 'E999');
  201. }
  202. ds_main_dcgm.setColumn(0, 'totreduamt', dcgm_discreduamt);
  203. }
  204. else{
  205. ds_main_dcgm.setColumn(0, 'totreduamt', '0');
  206. }
  207. return true;
  208. }
  209. //=======================================================================================
  210. // Events
  211. //---------------------------------------------------------------------------------------
  212. /****************************************************************************************
  213. * Argument :
  214. * Description : onload
  215. ****************************************************************************************/
  216. function SPPAO00800_onload(obj:Form, e:LoadEventInfo){
  217. // 폼 초기화
  218. frmf_initForm(obj);
  219. fInit();
  220. // ds_hidden_session 데이터셋에 값을 셋팅
  221. fGetUserInfosSampling();
  222. dsf_createDsRow('ds_in', [
  223. { col: 'sess_posinstcd', type: 'string', size: 256, val: ds_hidden_session.getColumn(0, 'sess_posinstcd') }
  224. ], false);
  225. ds_init_reducd.clearData();
  226. var oParam = {};
  227. oParam.id = "TRPAMCOM01";
  228. oParam.service = "pamcomnapp.PamComn";
  229. oParam.method = "reqGetComCD";
  230. oParam.inds = "req=ds_in";
  231. oParam.outds = 'ds_init_reducd=reducd';//"ds_=disccd ds_=insukind ds_=suppkind ds_=orddeptcd ds_=orddrid ds_=reducd ds_=uncocd ds_=proccd ds_=subjno ds_=rcptflag";
  232. oParam.async = false;
  233. //oParam.callback = "cf_TRPAMCOM01";
  234. tranf_submit(oParam);
  235. if(frmf_checkOpener()){
  236. var params = String(opener.frmf_getParameter('SPPAO00800_PARM')).split('▦');
  237. gOrddd = params[0];
  238. gTotrcptamt = params[1];
  239. strSend = params[2];
  240. strRcv = params[3];
  241. ds_main_dcgm.setColumn(0, 'totrcptamt', gTotrcptamt);
  242. if(!utlf_isNull(strSend) /*&& strSend != '' && strSend != ' ' && strSend != '-'*/){
  243. //dsf_setCSVToDs(ds_tmp, strSend);
  244. ds_main_h_dcgm.clearData();
  245. ds_main_h_dcgm.copyRow(ds_main_h_dcgm.addRow(), arg_str_send, 0);
  246. dsf_setDefaultVal(ds_main_h_dcgm, "dcgm_discreducd:-,dcgm_discreduamt:0");
  247. //ds_main_h_dcgm.copyData(arg_str_send);
  248. // 2008-09-26 이동식 추가
  249. for(var i = 0; i < ds_main_h_dcgm.rowcount; i++){
  250. ds_main_h_dcgm.setColumn(i, 'dcgm_discreducd2', ds_main_h_dcgm.getColumn(i, 'dcgm_discreducd'));
  251. }
  252. fReduamtCalc();
  253. }
  254. // 파라미터 초기화
  255. opener.frmf_setParameter('SPPAO00800_PARM', '');
  256. }
  257. else{
  258. gOrddd = PMO001_TODAY;
  259. ds_main_dcgm.setColumn(0, '', 0);
  260. }
  261. // 2007-09-04 이동식 추가 - 화면 오프시점에 자동 행추가.
  262. if(ds_main_h_dcgm.rowcount < 1){
  263. btn_addrow.click();
  264. }
  265. }
  266. /****************************************************************************************
  267. * Argument :
  268. * Description : 행추가 버튼 클릭 이벤트
  269. ****************************************************************************************/
  270. function btn_addrow_onclick(obj:Button, e:ClickEventInfo){
  271. if(utlf_isNull(gOrddd) || gOrddd == '' || gOrddd == ' ' || gOrddd == '-' || String(gOrddd).length != 8){
  272. sysf_messageBox('[임시] 개발자 여러분 진료일자를 넘겨주십시요!', 'E999');
  273. return;
  274. }
  275. var currow = ds_main_h_dcgm.addRow();
  276. ds_main_h_dcgm.setColumn(currow, 'dcgm_discreducd', '-');
  277. ds_main_h_dcgm.setColumn(currow, 'dcgm_discreducd2', '-');
  278. ds_main_h_dcgm.setColumn(currow, 'dcgm_discreduflag', 'G');
  279. ds_main_h_dcgm.setColumn(currow, 'dcgm_discreduamt', '0');
  280. }
  281. /****************************************************************************************
  282. * Argument :
  283. * Description : 행삭제 버튼 클릭 이벤트
  284. ****************************************************************************************/
  285. function button1_onclick(obj:Button, e:ClickEventInfo){
  286. var currow = datagrid1.currentrow;
  287. if(currow < 0){
  288. sysf_messageBox('먼저 삭제할 내역을 선택하십시요!', 'E999');
  289. return;
  290. }
  291. ds_main_h_dcgm.deleteRow(currow);
  292. fReduamtCalc();
  293. }
  294. /****************************************************************************************
  295. * Argument :
  296. * Description : 감액내역 그리드 편집 후 이벤트
  297. ****************************************************************************************/
  298. function datagrid1_ontextchanged(obj:Grid, e:GridEditTextChangedEventInfo){
  299. obj.updateToDataset();
  300. var currow = obj.currentrow;
  301. var curcol = obj.currentcell;
  302. var colId = lf_getBindCellName(obj, curcol);
  303. if(colId == 'dcgm_discreducd'){
  304. ds_main_h_dcgm.setColumn(currow, 'dcgm_discreducd2', ds_main_h_dcgm.getColumn(currow, 'dcgm_discreducd'));
  305. }
  306. if(colId == 'dcgm_discreducd2'){
  307. ds_main_h_dcgm.setColumn(currow, 'dcgm_discreducd', ds_main_h_dcgm.getColumn(currow, 'dcgm_discreducd2'));
  308. }
  309. if(colId == 'dcgm_discreduamt'){
  310. if(!fReduamtCalc()){
  311. ds_main_h_dcgm.setColumn(currow, curcol, '0');
  312. }
  313. }
  314. }
  315. /****************************************************************************************
  316. * Argument :
  317. * Description : 퍼센트 키 입력 이벤트
  318. ****************************************************************************************/
  319. function input1_onkeydown(obj:Edit, e:KeyEventInfo){
  320. if(e.keycode == '13'){
  321. obj.updateToDataset();
  322. if(ds_main_h_dcgm.rowcount < 1){
  323. ds_main_dcgm.setColumn(0, 'percent', '0');
  324. return;
  325. }
  326. if(datagrid1.currentrow < 0){
  327. ds_main_dcgm.setColumn(0, 'percent', '0');
  328. sysf_messageBox('적용할 감액 행을 선택하십시요!', 'E999');
  329. return;
  330. }
  331. var percent = utlf_transNullToEmpty(ds_main_dcgm.getColumn(0, 'percent'));
  332. if(!percent.isNumber()){
  333. ds_main_dcgm.setColumn(0, 'percent', '0');
  334. sysf_messageBox('숫자형태만 입력가능합니다!', 'E999');
  335. return;
  336. }
  337. var percent = parseInt(percent);
  338. if(percent < 1 || percent > 100){
  339. ds_main_dcgm.setColumn(0, 'percent', '0');
  340. sysf_messageBox('1 ~100 까지만 입력가능합니다!', 'E999');
  341. return;
  342. }
  343. var totrcptamt = utlf_transNullToEmpty(ds_main_dcgm.getColumn(0, 'totrcptamt'));
  344. if(!totrcptamt.isNumber()){
  345. sysf_messageBox('수납금액이 올바르지 않습니다!', 'E999');
  346. return;
  347. }
  348. totrcptamt = parseInt(totrcptamt);
  349. var reduamt = totrcptamt * percent / 100;
  350. var currow = datagrid1.currentrow
  351. ds_main_h_dcgm.setColumn(currow, 'dcgm_discreduamt', reduamt);
  352. if(!fReduamtCalc()){
  353. ds_main_h_dcgm.setColumn(currow, 'dcgm_discreduamt', 0);
  354. }
  355. }
  356. }
  357. /****************************************************************************************
  358. * Argument :
  359. * Description : 확인 버튼 클릭 이벤트
  360. ****************************************************************************************/
  361. function btn_confirm_onclick(obj:Button, e:ClickEventInfo){
  362. if(frmf_checkOpener()){
  363. var dcgm_discreducd;
  364. var dcgm_discreduamt;
  365. var totalDiscReduAmt = 0;
  366. for(var i = 0; i < ds_main_h_dcgm.rowcount; i++){
  367. dcgm_discreducd = ds_main_h_dcgm.getColumn(i, 'dcgm_discreducd');
  368. dcgm_discreduamt = ds_main_h_dcgm.getColumn(i, 'dcgm_discreduamt');
  369. // 2008-09-26 이동식 추가
  370. totalDiscReduAmt += parseInt(dcgm_discreducd) + parseInt(dcgm_discreduamt);
  371. if(utlf_isNull(dcgm_discreducd) || dcgm_discreducd == '' || dcgm_discreducd == ' ' || dcgm_discreducd == '-'){
  372. sysf_messageBox('감액명칭 중 미선택된 행이 존재합니다!', 'E999');
  373. return;
  374. }
  375. if(!String(dcgm_discreduamt).isNumber()){
  376. sysf_messageBox('감액 중 수치형이 아닌 행이 존재합니다!', 'E999');
  377. return;
  378. }
  379. }
  380. //2008-09-26 이동식 추가
  381. for(var i = 0; i < ds_main_h_dcgm.rowcount; i++){
  382. ds_main_h_dcgm.setColumn(i, 'dcgm_discreducd2', '0');
  383. }
  384. opener.frmf_setParameter('SPPAO00800_RTN', 'Y');
  385. opener.frmf_setParameter('SPPAO00800_TotReduAmt', totalDiscReduAmt);
  386. if(!utlf_isNull(strRcv) /*&& strRcv != '' && strRcv != ' ' && strRcv != '-'*/ && frmf_checkOpener()){
  387. //strRcv.copyData(ds_main_h_dcgm, true);
  388. opener.ds_main_admi_info_dcgm.copyData(ds_main_h_dcgm, false);
  389. }
  390. this.close();
  391. }
  392. }
  393. /****************************************************************************************
  394. * Argument :
  395. * Description : 취소 버튼 클릭 이벤트
  396. ****************************************************************************************/
  397. function btn_cancel_onclick(obj:Button, e:ClickEventInfo){
  398. if(frmf_checkOpener()){
  399. opener.frmf_setParameter('SPPAO00800_RTN', 'N');
  400. this.close();
  401. }
  402. }
  403. function lf_getBindCellName(oTrgtGrid, nColumnIndx){
  404. var sRtnText = "";
  405. var sTrgtText = oTrgtGrid.getCellProperty("body", nColumnIndx, "text");
  406. if(!utlf_isNull( sTrgtText)){
  407. sRtnText = sTrgtText.replace("bind:", "");
  408. }
  409. return sRtnText;
  410. }
  411. ]]></Script>
  412. </Form>
  413. </FDL>