123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442 |
- <%--
- - FileName : payResultList.jsp
- - Author(s) : ok
- - Date : 2014.08.28
- - Copyright : Copyright (c) 2013 www.udapsoft.co.kr, Inc.
- - Description: 대금관리 구매 대금지급현황
- --%>
- <%@ page contentType="text/html; charset=utf-8" %>
- <%@ page import="com.udapsoft.waf.system.HandlerStorage" %>
- <%@ page import="com.udapsoft.waf.common.ui.*" %>
- <%@ page import="kr.co.hsnc.common.util.*"%>
- <%@ page import="kr.co.hsnc.common.sql.*" %>
- <%@ page import="com.udapsoft.waf.common.util.DateUtil" %>
- <%@ include file="/jsp/work/taglib.jsp" %>
- <jsp:useBean id="ctx" class="com.udapsoft.waf.system.context.SessionContext" scope="session" />
- <%
- ctx.init(request, response);
- HandlerStorage storage = ctx.getHandlerStorage();
- ValueObject params = storage.getParams();
- ValueObject user = storage.getUser();
- String event = storage.getEvent();
-
- RowSet statusComboList = storage.getRowSet("statusComboList"); //상태 ComboList Data
-
- //상태 sheetComboList Data
- String statusSheetComboListText = (String)storage.getObject("selectText");
- String statusSheetComboListValue = (String)storage.getObject("selectValue");
-
- //검색조건 현장 설정
- String initSearchDeptCd = params.get("searchDeptCd");
- String initSearchDeptNm = params.get("searchDeptNm");
- //검색조건 계약명 설정
- String initSearchBuildName = params.get("searchBuildName");
- //검색조건 작성일
- String initSearchDateStart = params.get("searchDateStart");
- String initSearchDateEnd = params.get("searchDateEnd");
-
- //com.udapsoft.waf.common.util.DateUtil
- ValueObject defaultDate = DateUtil.getDefaultPeriod();
- if("".equals(initSearchDateStart)){
- initSearchDateStart = defaultDate.get("START_DATE");
- }
- if("".equals(initSearchDateEnd)){
- initSearchDateEnd = defaultDate.get("END_DATE");
- }
-
- //검색조건 상태 설정
- String initStatusCd = params.get("searchStatusCd");
- if(initStatusCd == null || initStatusCd == ""){
- initStatusCd = "";
- }
-
- %>
- <SCRIPT language="JavaScript">
- /*예약함수*/
- var sheet1;
- var sheet1Row;
- var sheet1PageNo = 1;
- var pageLastRowIndex = 1;
- var validationResult = false;
- var filterShow = false;
-
- function _onReady(){
- /**
- * IBSheet object initialize
- */
- gridInit(sheet1);
-
- autoResize();
-
- /**
- * Application Initialize
- */
- jQuery("#btnSearch").click(function() {
- if(jQuery("#searchDeptCd").val() == ""){
- alert("현장을 선택해주세요.");
- jQuery("#searchDeptCd").focus();
- return;
- }
-
- jQuery("#fevent").val("GET_DATA");
- var url = Modular.model.PageContext.CONTEXT_ROOT + "/payment/purchase/PayResultList_sheet.screen";
- Modular.view.IBSheet7.doSearch(sheet1, url, jQuery("#form1"), 30, "");
-
- });
-
- pageinit();
-
- }
-
- function pageinit(){
-
- //달력 조건에 당해년도1월, 당해년도당월 셋팅
- setSearchDate();
-
- //jQuery("#btnSearch").click();
-
- }
-
- /**
- * IBSheet object initialize
- */
- function gridInit(sheetName){
- var init_sheet = {};
- init_sheet.Cfg = {SearchMode:2, Page:100, MergeSheet:7};
- init_sheet.Cols = [
- {Header:'상태|상태', Type:"Status", SaveName:"STATUS", Width:0, Align:"Center", Hidden:"True"},
- {Header:'현장명|현장명', Type:"Text", SaveName:"DEPT_NAME", Width:200, Align:"Left",Hidden:"True"},
- {Header:'계약번호|계약번호', Type:"Text", SaveName:"ORD_DOC_NO", Width:200, Align:"Left"},
- {Header:'계약명|계약명', Type:"Text", SaveName:"CST_DOC_NAME", Width:200, Align:"Left"},
- {Header:'업체명|업체명', Type:"Text", SaveName:"CORP_KOR", Width:200, Align:"Left"},
- {Header:'계약기간|계약기간', Type:"Text", SaveName:"ORD_DATE", Width:200, Align:"Left"},
- {Header:'계약금액|계약금액', Type:"Text", SaveName:"ORD_AMT", Width:100, Align:"Right" },
- {Header:'대금구분|대금구분', Type:"Text", SaveName:"PAY_DIV_NM", Width:80, Align:"Center", Hidden:""},
- {Header:'통화|통화', Type:"Text", SaveName:"CURRENCY_GB", Width:60, Align:"Center"},
- {Header:'지급구분|지급구분', Type:"Text", SaveName:"DEPOSIT_NM", Width:80, Align:"Center"},
- {Header:'지급차수|지급차수', Type:"Text", SaveName:"DEPOSIT_SEQ", Width:60, Align:"Center"},
- {Header:'증빙일자|증빙일자', Type:"Text", SaveName:"REQ_DATE", Width:80, Align:"Center"},
- {Header:'대금|선급공제액', Type:"AutoSum", SaveName:"CUR_PREPAY_APPLYAMT", Width:100, Align:"Right", Format:"Integer"},
- {Header:'대금|청구액', Type:"AutoSum", SaveName:"CUR_REQ_AMT", Width:100, Align:"Right", Format:"Integer"},
- {Header:'대금|잔여', Type:"Float", SaveName:"REMAINDER_ACMP_SUPPLYAMT",Width:100, Align:"Right", Format:"Float"},
- {Header:'대금|잔여', Type:"Float", SaveName:"REMAINDER_SUPPLYAMT", Width:100, Align:"Right", Format:"Float", Hidden:"True"},
- {Header:'대금|지급율', Type:"Float", SaveName:"CUR_ACMP_PERCENT", Width:50, Align:"Right", Format:"##0.00",Hidden:"True"},
- {Header:'상태|상태', Type:"Combo", SaveName:"REQ_STATUS", Width:70, Align:"Center", ComboText:"<%=statusSheetComboListText%>", ComboCode:"<%=statusSheetComboListValue%>"},
- {Header:'계약ID|계약ID', Type:"Text", SaveName:"PUR_CONT_ID", Width:70, Align:"Center", Hidden:"True"}
- ];
- init_sheet.HeaderMode = {Sort:1};
- IBS_InitSheet(sheetName, init_sheet);
- sheetName.SetDataAutoTrim(0);
- sheetName.SetEditable(false);
-
- var info = [{StdCol:2, SumCols:"CUR_PREPAY_APPLYAMT|CUR_REQ_AMT", ShowCumulate:0,Sort:0,CaptionCol:1}];
- //[{StdCol:13, SumCols:"CUR_REQ_AMT", ShowCumulate:0,Sort:0,CaptionCol:1}];
- //,{StdCol:2, SumCols:"CON_AMT|FUND_AMT|FUND_RATE", ShowCumulate:0,Sort:0,CaptionCol:2}];
- sheetName.ShowSubSum(info);
- sheetName.SetCountPosition(4);
- sheetName.SetActionMenu("ExcelDown");
- setGridSize();
- }
- function sheet1_OnSelectMenu(Text, Code) {
- // text 또는 code값으로 Action수행
- switch(Text) {
- case "ExcelDown":
- sheetExcelDown(sheet1,$('li').html());
- break;
- }
- }
-
- /**
- * IBSheet Event: Search End(IBSheet 데이터 조회 CallBack)
- */
- function sheet1_OnSearchEnd(code, message) {
- if(code == 0) {
-
- sheet1.SetSumValue(0,"합 계");
- sheet1.SetCellAlign(sheet1.LastRow(),0,"Center");
- sheet1.SetMergeCell (sheet1.LastRow(), 0, 1,2);
-
- var lr = sheet1.LastRow();
- var str = "";
- var startrow = 2;
- var endrow = 1;
- var backColor = "";
-
- var totalConAmtValue = 0;
- var totalModAmtValue = 0;
- var totalRatAmtValue = 0.00;
-
- for(var i=1; i <= lr; i++){
- str = sheet1.GetCellText(i,1);
- if(str.indexOf("소계:") > -1){
-
- sheet1.SetCellAlign(i,1,"Center");
-
- sheet1.SetCellText(i,1, "소계");
-
- //sheet1.SetRangeBackColor(i,1,i,12,"#e0ffff");
- //alert(startrow);
- //alert(endrow);
-
- sheet1.SetMergeCell(startrow , 1, endrow + 1, 1);
- sheet1.SetMergeCell(i,1,1,5);
- sheet1.SetMergeCell(i,7,1,2);
-
- //var remainderAcmpSupplyamt = sheet1.GetCellValue(i-1, "REMAINDER_ACMP_SUPPLYAMT"); //잔여
- var remainderAcmpSupplyamt = sheet1.GetCellValue(i-1, "REMAINDER_SUPPLYAMT"); //잔여
- var curAcmpPercent = sheet1.GetCellValue(i-1, "CUR_ACMP_PERCENT"); //지급율
-
- sheet1.SetCellValue(i, "REMAINDER_ACMP_SUPPLYAMT", remainderAcmpSupplyamt);
- sheet1.SetCellValue(i, "CUR_ACMP_PERCENT", curAcmpPercent.toFixed(2));
-
- totalConAmtValue = 0;
- totalModAmtValue = 0;
- totalRatAmtValue = 0.00;
-
- startrow = i + 1;
- }
-
- //var info = {Type: "Int", Align: "Right", Format:"Integer"};
- var info = {Type: "Float", Align: "Right", Format:"##0.00"};
- sheet1.InitCellProperty(i, "CUR_ACMP_PERCENT", info);
- var info2 = {Type: "Int", Align: "Right", Format:"Integer"};
- sheet1.InitCellProperty(i, "REMAINDER_ACMP_SUPPLYAMT", info2);
-
- }
-
- setGridSize();
- } else {
- //조회 에러 수행
- alert(message);
- }
- }
-
- /**
- * IBSheet Event: Save End(IBSheet 데이터 저장 CallBack)
- */
- function sheet1_OnSaveEnd(code, msg) {
- if(code >= 0) {
- alert("저장 성공");
- } else {
- alert(msg);
- }
- }
-
- /**
- * IBSheet Event: Click
- */
- function sheet1_OnClick(Row, Col, Value, CellX, CellY, CellW, CellH) {
- //masterSheetRow = Row;
- }
-
- /**
- * IBSheet size setting
- */
- function setGridSize() {
- sheet1.FitColWidth();
- }
-
- /**
- * IBSheet Event: DBLCLICK
- */
- function sheet1_OnDblClick(Row, Col, Value, CellX, CellY, CellW, CellH) {
- }
- function doResult(resultObj) {
- try {
- if( resultObj.getRequestEvent() == "" ) {
- if( resultObj.getSuccess() ) {
- var f = document.form1;
- f.action = "/main.screen";
- f.target = "_parent";
- f.submit();
- }
- else {
- dlgErrorMsg(resultObj);
- }
- document.form1.isSubmit = false;
- }else if( resultObj.getRequestEvent() == "GET_EHR_DATA" ) {
- if( resultObj.getSuccess() ) {
- alert("EHR Synchronize Complete");
- doSearch(document.all.sheet1);
- }
- else {
- dlgErrorMsg(resultObj);
- }
- document.form1.isSubmit = false;
- }
- }
- catch(errorObject) {
- showErrorDlg("doResult()", errorObject);
- }
- }
- function searchAccDept(p_dept_cd, p_dept_nm){
-
- result = window.showModalDialog(getDummyUrl('/lib/dlgSearchAccDept.screen'),'부서 찾기','dialogWidth:620px;dialogHeight:460px; center:yes; help:no; status:no; scroll:no; resizable:no');
-
- if( result == null ){
- document.form1.p_dept_cd.value = ""; //부서코드
- document.form1.p_dept_nm.value = ""; //부서명
- }else{
- document.form1.p_dept_cd.value = result[0]; //부서코드
- document.form1.p_dept_nm.value = result[1]; //부서명
- }
- }
- function doKeyPress() {
-
- if( event.keyCode == 13 ) {
- doSearch(document.all.sheet1)
- }
- }
- function calendar(thisDayObj){
- dlgCalendar(thisDayObj);
-
- }
-
- //검색조건에 기성년월 초기 설정
- function setSearchDate(){
-
- //검색조건 시작일
- var startDate = get_year() +'-'+ get_month() +'-'+ '01';
- if(jQuery('#searchDateStart').val() == ""){
- jQuery('#searchDateStart').val(startDate);
- }
-
- //검색조건 종료일
- var nowYearMonth = new Date( get_year(), get_month(), "");
- var lastDay = nowYearMonth.getDate();
- var endDate = get_year() +'-'+ get_month() +'-'+ lastDay;
- if(jQuery('#searchDateEnd').val() == ""){
- jQuery('#searchDateEnd').val(endDate);
- }
-
- }
- function sheet1_OnSmartResize(Width, Height) {
- sheet1.FitColWidth();
- autoResize();
- }
-
- function autoResize(){
- /* var t1_height = document.getElementById("t1").scrollHeight + 10;
- var iframeHeight= document.body.scrollHeight - t1_height;
- var iframeWidth= document.body.scrollWidth;
-
- sheet1.SetSheetHeight(iframeHeight); */
- var t1_height = document.getElementById("search-table").scrollHeight + document.getElementById("title").scrollHeight + 54;
- var iframeHeight= document.body.scrollHeight - t1_height;
- var iframeWidth= document.body.scrollWidth;
-
-
- sheet1.SetSheetHeight(iframeHeight);
- }
-
- function searchSite() {
-
- var win_id = "_searchSite";
- var link = "/lib/dlgSearchSpotDept_Unitcd.screen";
- link += "?pop_win_id="+win_id;
- fLayerPop(win_id, link, 550,500, '', '', 'NO');
-
- }
-
- function searchSiteClose(result) {
- if( result == null ){
- document.form1.searchDeptCd.value = ""; //부서코드
- document.form1.searchDeptNm.value = ""; //부서명
- }else{
- document.form1.searchDeptCd.value = result[0]; //부서코드
- document.form1.searchDeptNm.value = result[1]; //부서명
- }
- fLayerPopClose('_searchSite');
- }
-
- </SCRIPT>
- <modular:search id="form1">
- <modular:key id="fevent" />
- </modular:search>
- <BODY onresize="autoResize()" >
- <form id="form1" name="form1" method="post" modular:type="search">
- <INPUT type="hidden" name="fevent" id="fevent" value="">
-
- <div align="left" id="title">
- <ul>
- <li>대금지급현황</li>
- </ul>
- </div>
- <!-- 검색조건 영역 : 시작 -->
- <table id="search-table" class="search-form-table">
- <colgroup>
- <col width="100px">
- <col width="40%">
- <col width="100px">
- <col/>
- <col width="100px">
- </colgroup>
- <TR>
- <Th>현장</Th>
- <TD>
- <%--<%=InputText.getSiteCode("searchDeptCd", "searchDeptNm", "", user, initSearchDeptCd, initSearchDeptNm)%> --%>
- <%=InputText.getSiteCodeNew("searchDeptCd", "searchDeptNm", "", user, initSearchDeptCd, initSearchDeptNm)%>
- </TD>
- <Th>계약명</Th>
- <TD>
- <INPUT type="text" id="searchBuildName" name="searchBuildName" value="<%=initSearchBuildName%>" maxlength="50" class="input" style="IME-MODE : active;width:95%;" desc='계약명' onKeyPress="doKeyPress();">
- </TD>
- <TD class="button" rowspan="3">
- <!-- 검색버튼 영역 : 시작 -->
- <span class="btnSearch center"><a href="javascript:void(0);" id="btnSearch">검색</a></span>
- <!-- 검색버튼 영역 : 종료 -->
- </TD>
- </TR>
- <TR>
- <Th>증빙일</Th>
- <TD>
- <%= InputText.get("searchDateStart", initSearchDateStart, 15, 10, "Center, date, PerSize, readonly", "date", "") %>
- <a href="JavaScript:calendar('searchDateStart');"><img src="/img/buyer/button/bt_calender.gif" alt="달력" border="0" align="absmiddle" /></a>
- ~
- <%= InputText.get("searchDateEnd", initSearchDateEnd, 15, 10, "Center, date, PerSize, readonly", "date", "") %>
- <a href="JavaScript:calendar('searchDateEnd');"><img src="/img/buyer/button/bt_calender.gif" alt="달력" border="0" align="absmiddle" /></a>
- </TD>
- <th>상태</th>
- <td colspan="1">
- <%= HTMLMaker.getSelectTag(statusComboList, "DETAILCD", "DETAILNM", "searchStatusCd", "width:25%;height=18;", "<option value=''>--전체--</option>", initStatusCd) %>
- </td>
- </TR>
- <TR>
- <TH>업체명</TH>
- <TD colspan="3">
- <INPUT type="text" id="searchCorp" name="searchCorp" value="" maxlength="50" class="input" style="IME-MODE : active; width:42%;" desc='업체명' onKeyPress="doKeyPress();">
- </TD>
- </TR>
- </TABLE>
- <img src="/img/com/blank.gif" height="5px" />
- <div align="right" id="bugase">
- <ul>
- <li valign="bottom"><span style="color: red;">* 부가세별도</span></li>
- </ul>
- </div>
- <div id="sheet1_div" style="padding-top:5px; height: auto; min-height: 350px; overflow: auto;">
- <script>createIBSheet('sheet1','100%', '350px');</script>
- </div>
- </FORM>
- </body>
|