123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469 |
- <?xml version="1.0" encoding="utf-8"?>
- <FDL version="1.5">
- <TypeDefinition url="..\..\..\default_typedef.xml"/>
- <Form id="SPPAO00800" position="absolute 0 0 526 317" titletext="감액입력" onload="SPPAO00800_onload">
- <Layouts>
- <Layout>
- <Shape id="line1" class="line_1" position="absolute 0 25 517 31" style="strokepen:3 solid #33bbbbff;"/>
- <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">
- <Formats>
- <Format id="default">
- <Columns>
- <Column size="0"/>
- <Column size="0"/>
- <Column size="0"/>
- <Column size="0"/>
- <Column size="0"/>
- <Column size="0"/>
- <Column size="0"/>
- <Column size="0"/>
- <Column size="0"/>
- <Column size="0"/>
- <Column size="0"/>
- <Column size="63"/>
- <Column size="114"/>
- <Column size="101"/>
- <Column size="216"/>
- <Column size="0"/>
- <Column size="0"/>
- <Column size="0"/>
- <Column size="0"/>
- <Column size="0"/>
- <Column size="0"/>
- <Column size="0"/>
- <Column size="0"/>
- </Columns>
- <Rows>
- <Row size="24" band="head"/>
- <Row size="24"/>
- </Rows>
- <Band id="head">
- <Cell text="pid"/>
- <Cell col="1" text="orddd"/>
- <Cell col="2" text="cretno"/>
- <Cell col="3" text="rcptdd"/>
- <Cell col="4" text="rcptno"/>
- <Cell col="5" text="seqno"/>
- <Cell col="6" text="rcptseqno"/>
- <Cell col="7" text="instcd"/>
- <Cell col="8" text="rcptstat"/>
- <Cell col="9" text="ordtype"/>
- <Cell col="10" text="discreduflag"/>
- <Cell col="11" text="감액코드"/>
- <Cell col="12" text="감액명칭"/>
- <Cell col="13" text="감액"/>
- <Cell col="14" text="적용사유"/>
- <Cell col="15" text="rcptexecdd"/>
- <Cell col="16" text="rcpttm"/>
- <Cell col="17" text="remfact"/>
- <Cell col="18" text="rcptrid"/>
- <Cell col="19" text="fstrgstrid"/>
- <Cell col="20" text="fstrgstdt"/>
- <Cell col="21" text="lastupdtrid"/>
- <Cell col="22" text="lastupdtdt"/>
- </Band>
- <Band id="body">
- <Cell text="bind:dcgm_pid"/>
- <Cell col="1" text="bind:dcgm_orddd"/>
- <Cell col="2" text="bind:dcgm_cretno"/>
- <Cell col="3" text="bind:dcgm_rcptdd"/>
- <Cell col="4" text="bind:dcgm_rcptno"/>
- <Cell col="5" text="bind:dcgm_seqno"/>
- <Cell col="6" text="bind:dcgm_rcptseqno"/>
- <Cell col="7" text="bind:dcgm_instcd"/>
- <Cell col="8" text="bind:dcgm_rcptstat"/>
- <Cell col="9" text="bind:dcgm_ordtype"/>
- <Cell col="10" text="bind:dcgm_discreduflag"/>
- <Cell col="11" displaytype="text" edittype="text" text="bind:dcgm_discreducd"/>
- <Cell col="12" displaytype="combo" edittype="combo" text="bind:dcgm_discreducd2" combocodecol="cd" combodatacol="nm"/>
- <Cell col="13" displaytype="number" edittype="normal" editfilter="number" style="align:right middle;" text="bind:dcgm_discreduamt" mask="9,999"/>
- <Cell col="14" displaytype="text" edittype="text" text="bind:dcgm_apprsn"/>
- <Cell col="15" text="bind:dcgm_rcptexecdd"/>
- <Cell col="16" text="bind:dcgm_rcpttm"/>
- <Cell col="17" text="bind:dcgm_remfact"/>
- <Cell col="18" text="bind:dcgm_rcptrid"/>
- <Cell col="19" text="bind:dcgm_fstrgstrid"/>
- <Cell col="20" text="bind:dcgm_fstrgstdt"/>
- <Cell col="21" text="bind:dcgm_lastupdtrid"/>
- <Cell col="22" text="bind:dcgm_lastupdtdt"/>
- </Band>
- </Format>
- </Formats>
- </Grid>
- <Button id="button1" taborder="2" text="행삭제" class="btn2" position="absolute 464 5 517 24" onclick="button1_onclick"/>
- <Button id="btn_addrow" taborder="3" text="행추가" class="btn2" position="absolute 408 5 461 24" onclick="btn_addrow_onclick"/>
- <Static id="caption3" text="수납금액" class="cell_1" position="absolute 187 264 247 287" style="padding:0 0 0 0;align:center middle;"/>
- <Static id="caption4" text="감액총액" class="cell_1" position="absolute 354 264 414 287" style="padding:0 0 0 0;align:center middle;"/>
- <MaskEdit id="output2" taborder="4" readonly="true" mask="(-)#,###" position="absolute 250 265 350 284"/>
- <MaskEdit id="output3" taborder="5" readonly="true" mask="(-)#,###" position="absolute 417 265 517 284"/>
- <Static id="caption1" text="감액내역" class="tit_2" position="absolute 5 9 113 24"/>
- <Edit id="input1" taborder="6" position="absolute 135 265 165 284" onkeydown="input1_onkeydown"/>
- <Static id="caption2" text="%" position="absolute 165 265 185 285"/>
- <Button id="btn_confirm" taborder="7" text="확인" class="btn4" position="absolute 402 292 458 314" onclick="btn_confirm_onclick"/>
- <Button id="btn_cancel" taborder="8" text="취소" class="btn4" position="absolute 461 292 517 314" onclick="btn_cancel_onclick"/>
- <Shape id="line88" linetype="horizontal" class="line_6" position="absolute 0 287 518 293"/>
- </Layout>
- </Layouts>
- <Objects>
- <Dataset id="ds_main_h_dcgm" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" reversesubsum="false">
- <ColumnInfo>
- <Column id="dcgm_pid" type="STRING"/>
- <Column id="dcgm_orddd" type="STRING"/>
- <Column id="dcgm_cretno" type="STRING"/>
- <Column id="dcgm_rcptdd" type="STRING"/>
- <Column id="dcgm_rcptno" type="STRING"/>
- <Column id="dcgm_seqno" type="STRING"/>
- <Column id="dcgm_rcptseqno" type="STRING"/>
- <Column id="dcgm_instcd" type="STRING"/>
- <Column id="dcgm_rcptstat" type="STRING"/>
- <Column id="dcgm_ordtype" type="STRING"/>
- <Column id="dcgm_discreduflag" type="STRING"/>
- <Column id="dcgm_discreducd" type="STRING"/>
- <Column id="dcgm_discreducd2" type="STRING"/>
- <Column id="dcgm_discreduamt" type="INT"/>
- <Column id="dcgm_apprsn" type="STRING"/>
- <Column id="dcgm_rcptexecdd" type="STRING"/>
- <Column id="dcgm_rcpttm" type="STRING"/>
- <Column id="dcgm_remfact" type="STRING"/>
- <Column id="dcgm_rcptrid" type="STRING"/>
- <Column id="dcgm_fstrgstrid" type="STRING"/>
- <Column id="dcgm_fstrgstdt" type="STRING"/>
- <Column id="dcgm_lastupdtrid" type="STRING"/>
- <Column id="dcgm_lastupdtdt" type="STRING"/>
- </ColumnInfo>
- </Dataset>
- <Dataset id="ds_hidden_session" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false"/>
- <Dataset id="ds_main_dcgm" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
- <ColumnInfo>
- <Column id="totrcptamt" type="INT" size="256"/>
- <Column id="totreduamt" type="INT" size="256"/>
- <Column id="percent" type="STRING" size="256"/>
- </ColumnInfo>
- </Dataset>
- <Dataset id="ds_tmp" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false"/>
- <Dataset id="ds_init_reducd" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false"/>
- </Objects>
- <Bind>
- <BindItem id="item0" compid="input1" propid="value" datasetid="ds_main_dcgm" columnid="percent"/>
- <BindItem id="item1" compid="output2" propid="value" datasetid="ds_main_dcgm" columnid="totrcptamt"/>
- <BindItem id="item2" compid="output3" propid="value" datasetid="ds_main_dcgm" columnid="totreduamt"/>
- </Bind>
- <Script type="xscript4.0"><![CDATA[/***************************************************************************************
- * System Name :
- * Job Name :
- * Creator :
- * Make Date : 2016-05-24
- * Description :
- *---------------------------------------------------------------------------------------
- * Modify Date Modifier Modify Description
- *---------------------------------------------------------------------------------------
- * 2016-05-24 Live Converter TF->XP
- *
- *---------------------------------------------------------------------------------------
- ****************************************************************************************/
- //=======================================================================================
- // Lib Include
- //---------------------------------------------------------------------------------------
- include 'com_commonxp::comm_main.xjs';
- include 'pam_opatmngtxp::PMOCOM.xjs';
- //=======================================================================================
- // Local variables
- //---------------------------------------------------------------------------------------
- var gOrddd, gTotrcptamt, strSend, strRcv;
- //=======================================================================================
- // Local methods
- //---------------------------------------------------------------------------------------
- /****************************************************************************************
- * Argument :
- * Description :
- ****************************************************************************************/
- function fInit(){
- ds_main_dcgm.clearData();
- ds_main_dcgm.addRow();
- ds_main_dcgm.setColumn(0, 'totrcptamt', '0');
- ds_main_dcgm.setColumn(0, 'totreduamt', '0');
- ds_main_h_dcgm.clearData();
- }
- /****************************************************************************************
- * Argument :
- * Description :
- ****************************************************************************************/
- function fReduamtCalc(){
- var rowcnt = ds_main_h_dcgm.rowcount;
- if(rowcnt > 0){
- var dcgm_discreduamt = 0;
- var totrcptamt = parseInt(ds_main_dcgm.getColumn(0, 'totrcptamt'));
- for(var i = 0; i < rowcnt; i++){
- dcgm_discreduamt += parseInt(ds_main_h_dcgm.getColumn(i, 'dcgm_discreduamt'));
- }
- if(totrcptamt < dcgm_discreduamt){
- sysf_messageBox('감액총액이 수납금액을 초과합니다!', 'E999');
- }
- ds_main_dcgm.setColumn(0, 'totreduamt', dcgm_discreduamt);
- }
- else{
- ds_main_dcgm.setColumn(0, 'totreduamt', '0');
- }
- return true;
- }
- //=======================================================================================
- // Events
- //---------------------------------------------------------------------------------------
- /****************************************************************************************
- * Argument :
- * Description : onload
- ****************************************************************************************/
- function SPPAO00800_onload(obj:Form, e:LoadEventInfo){
- // 폼 초기화
- frmf_initForm(obj);
- fInit();
- // ds_hidden_session 데이터셋에 값을 셋팅
- fGetUserInfosSampling();
- dsf_createDsRow('ds_in', [
- { col: 'sess_posinstcd', type: 'string', size: 256, val: ds_hidden_session.getColumn(0, 'sess_posinstcd') }
- ], false);
- ds_init_reducd.clearData();
- var oParam = {};
- oParam.id = "TRPAMCOM01";
- oParam.service = "pamcomnapp.PamComn";
- oParam.method = "reqGetComCD";
- oParam.inds = "req=ds_in";
- 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";
- oParam.async = false;
- //oParam.callback = "cf_TRPAMCOM01";
- tranf_submit(oParam);
- if(frmf_checkOpener()){
- var params = String(opener.frmf_getParameter('SPPAO00800_PARM')).split('▦');
- gOrddd = params[0];
- gTotrcptamt = params[1];
- strSend = params[2];
- strRcv = params[3];
- ds_main_dcgm.setColumn(0, 'totrcptamt', gTotrcptamt);
-
- if(!utlf_isNull(strSend) /*&& strSend != '' && strSend != ' ' && strSend != '-'*/){
- //dsf_setCSVToDs(ds_tmp, strSend);
- ds_main_h_dcgm.clearData();
-
- ds_main_h_dcgm.copyRow(ds_main_h_dcgm.addRow(), arg_str_send, 0);
- dsf_setDefaultVal(ds_main_h_dcgm, "dcgm_discreducd:-,dcgm_discreduamt:0");
- //ds_main_h_dcgm.copyData(arg_str_send);
- // 2008-09-26 이동식 추가
- for(var i = 0; i < ds_main_h_dcgm.rowcount; i++){
- ds_main_h_dcgm.setColumn(i, 'dcgm_discreducd2', ds_main_h_dcgm.getColumn(i, 'dcgm_discreducd'));
- }
- fReduamtCalc();
- }
- // 파라미터 초기화
- opener.frmf_setParameter('SPPAO00800_PARM', '');
- }
- else{
- gOrddd = PMO001_TODAY;
- ds_main_dcgm.setColumn(0, '', 0);
- }
- // 2007-09-04 이동식 추가 - 화면 오프시점에 자동 행추가.
- if(ds_main_h_dcgm.rowcount < 1){
- btn_addrow.click();
- }
- }
- /****************************************************************************************
- * Argument :
- * Description : 행추가 버튼 클릭 이벤트
- ****************************************************************************************/
- function btn_addrow_onclick(obj:Button, e:ClickEventInfo){
- if(utlf_isNull(gOrddd) || gOrddd == '' || gOrddd == ' ' || gOrddd == '-' || String(gOrddd).length != 8){
- sysf_messageBox('[임시] 개발자 여러분 진료일자를 넘겨주십시요!', 'E999');
- return;
- }
- var currow = ds_main_h_dcgm.addRow();
- ds_main_h_dcgm.setColumn(currow, 'dcgm_discreducd', '-');
- ds_main_h_dcgm.setColumn(currow, 'dcgm_discreducd2', '-');
- ds_main_h_dcgm.setColumn(currow, 'dcgm_discreduflag', 'G');
- ds_main_h_dcgm.setColumn(currow, 'dcgm_discreduamt', '0');
- }
- /****************************************************************************************
- * Argument :
- * Description : 행삭제 버튼 클릭 이벤트
- ****************************************************************************************/
- function button1_onclick(obj:Button, e:ClickEventInfo){
- var currow = datagrid1.currentrow;
- if(currow < 0){
- sysf_messageBox('먼저 삭제할 내역을 선택하십시요!', 'E999');
- return;
- }
- ds_main_h_dcgm.deleteRow(currow);
- fReduamtCalc();
- }
- /****************************************************************************************
- * Argument :
- * Description : 감액내역 그리드 편집 후 이벤트
- ****************************************************************************************/
- function datagrid1_ontextchanged(obj:Grid, e:GridEditTextChangedEventInfo){
- obj.updateToDataset();
-
- var currow = obj.currentrow;
- var curcol = obj.currentcell;
-
-
- var colId = lf_getBindCellName(obj, curcol);
- if(colId == 'dcgm_discreducd'){
- ds_main_h_dcgm.setColumn(currow, 'dcgm_discreducd2', ds_main_h_dcgm.getColumn(currow, 'dcgm_discreducd'));
- }
- if(colId == 'dcgm_discreducd2'){
- ds_main_h_dcgm.setColumn(currow, 'dcgm_discreducd', ds_main_h_dcgm.getColumn(currow, 'dcgm_discreducd2'));
- }
- if(colId == 'dcgm_discreduamt'){
- if(!fReduamtCalc()){
- ds_main_h_dcgm.setColumn(currow, curcol, '0');
- }
- }
- }
- /****************************************************************************************
- * Argument :
- * Description : 퍼센트 키 입력 이벤트
- ****************************************************************************************/
- function input1_onkeydown(obj:Edit, e:KeyEventInfo){
- if(e.keycode == '13'){
- obj.updateToDataset();
- if(ds_main_h_dcgm.rowcount < 1){
- ds_main_dcgm.setColumn(0, 'percent', '0');
- return;
- }
- if(datagrid1.currentrow < 0){
- ds_main_dcgm.setColumn(0, 'percent', '0');
- sysf_messageBox('적용할 감액 행을 선택하십시요!', 'E999');
- return;
- }
- var percent = utlf_transNullToEmpty(ds_main_dcgm.getColumn(0, 'percent'));
- if(!percent.isNumber()){
- ds_main_dcgm.setColumn(0, 'percent', '0');
- sysf_messageBox('숫자형태만 입력가능합니다!', 'E999');
- return;
- }
- var percent = parseInt(percent);
- if(percent < 1 || percent > 100){
- ds_main_dcgm.setColumn(0, 'percent', '0');
- sysf_messageBox('1 ~100 까지만 입력가능합니다!', 'E999');
- return;
- }
- var totrcptamt = utlf_transNullToEmpty(ds_main_dcgm.getColumn(0, 'totrcptamt'));
- if(!totrcptamt.isNumber()){
- sysf_messageBox('수납금액이 올바르지 않습니다!', 'E999');
- return;
- }
- totrcptamt = parseInt(totrcptamt);
- var reduamt = totrcptamt * percent / 100;
- var currow = datagrid1.currentrow
- ds_main_h_dcgm.setColumn(currow, 'dcgm_discreduamt', reduamt);
- if(!fReduamtCalc()){
- ds_main_h_dcgm.setColumn(currow, 'dcgm_discreduamt', 0);
- }
- }
- }
- /****************************************************************************************
- * Argument :
- * Description : 확인 버튼 클릭 이벤트
- ****************************************************************************************/
- function btn_confirm_onclick(obj:Button, e:ClickEventInfo){
- if(frmf_checkOpener()){
- var dcgm_discreducd;
- var dcgm_discreduamt;
- var totalDiscReduAmt = 0;
- for(var i = 0; i < ds_main_h_dcgm.rowcount; i++){
- dcgm_discreducd = ds_main_h_dcgm.getColumn(i, 'dcgm_discreducd');
- dcgm_discreduamt = ds_main_h_dcgm.getColumn(i, 'dcgm_discreduamt');
-
- // 2008-09-26 이동식 추가
- totalDiscReduAmt += parseInt(dcgm_discreducd) + parseInt(dcgm_discreduamt);
- if(utlf_isNull(dcgm_discreducd) || dcgm_discreducd == '' || dcgm_discreducd == ' ' || dcgm_discreducd == '-'){
- sysf_messageBox('감액명칭 중 미선택된 행이 존재합니다!', 'E999');
- return;
- }
- if(!String(dcgm_discreduamt).isNumber()){
- sysf_messageBox('감액 중 수치형이 아닌 행이 존재합니다!', 'E999');
- return;
- }
- }
- //2008-09-26 이동식 추가
- for(var i = 0; i < ds_main_h_dcgm.rowcount; i++){
- ds_main_h_dcgm.setColumn(i, 'dcgm_discreducd2', '0');
- }
- opener.frmf_setParameter('SPPAO00800_RTN', 'Y');
- opener.frmf_setParameter('SPPAO00800_TotReduAmt', totalDiscReduAmt);
- if(!utlf_isNull(strRcv) /*&& strRcv != '' && strRcv != ' ' && strRcv != '-'*/ && frmf_checkOpener()){
- //strRcv.copyData(ds_main_h_dcgm, true);
- opener.ds_main_admi_info_dcgm.copyData(ds_main_h_dcgm, false);
- }
- this.close();
- }
- }
- /****************************************************************************************
- * Argument :
- * Description : 취소 버튼 클릭 이벤트
- ****************************************************************************************/
- function btn_cancel_onclick(obj:Button, e:ClickEventInfo){
- if(frmf_checkOpener()){
- opener.frmf_setParameter('SPPAO00800_RTN', 'N');
- this.close();
- }
- }
- function lf_getBindCellName(oTrgtGrid, nColumnIndx){
- var sRtnText = "";
- var sTrgtText = oTrgtGrid.getCellProperty("body", nColumnIndx, "text");
- if(!utlf_isNull( sTrgtText)){
- sRtnText = sTrgtText.replace("bind:", "");
- }
-
- return sRtnText;
- }
- ]]></Script>
- </Form>
- </FDL>
|