ComparePayplanActual.jsp 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423
  1. <%--
  2. - FileName : ComparePayplanActual.jsp
  3. - Author(s) : ok
  4. - Date : 2019.08.08
  5. - Copyright : Copyright (c) 2013 www.udapsoft.co.kr, Inc.
  6. - Description: 구매 계획분할 - 대금계획과 실제비교.
  7. --%>
  8. <%@ page contentType="text/html; charset=utf-8" %>
  9. <%@ page import="com.udapsoft.waf.system.HandlerStorage" %>
  10. <%@ page import="com.udapsoft.waf.common.ui.*" %>
  11. <%@ page import="kr.co.hsnc.common.util.*"%>
  12. <%@ page import="kr.co.hsnc.common.sql.*" %>
  13. <%@ page import="com.udapsoft.waf.common.util.DateUtil" %>
  14. <%@ include file="/jsp/work/taglib.jsp" %>
  15. <jsp:useBean id="ctx" class="com.udapsoft.waf.system.context.SessionContext" scope="session" />
  16. <%
  17. ctx.init(request, response);
  18. HandlerStorage storage = ctx.getHandlerStorage();
  19. ValueObject params = storage.getParams();
  20. ValueObject user = storage.getUser();
  21. String event = storage.getEvent();
  22. //상태 sheetComboList Data
  23. String statusSheetComboListText = (String)storage.getObject("selectText");
  24. String statusSheetComboListValue = (String)storage.getObject("selectValue");
  25. //검색조건 현장 설정
  26. String initSearchDeptCd = params.get("searchDeptCd");
  27. String initSearchDeptNm = params.get("searchDeptNm");
  28. //검색조건 계약명 설정
  29. String initSearchBuildName = params.get("searchBuildName");
  30. //검색조건 작성일
  31. String initSearchDateStart = params.get("searchDateStart");
  32. String initSearchDateEnd = params.get("searchDateEnd");
  33. //com.udapsoft.waf.common.util.DateUtil
  34. ValueObject defaultDate = DateUtil.getDefaultPeriod();
  35. if("".equals(initSearchDateStart)){
  36. initSearchDateStart = defaultDate.get("START_DATE");
  37. }
  38. if("".equals(initSearchDateEnd)){
  39. initSearchDateEnd = defaultDate.get("END_DATE");
  40. }
  41. %>
  42. <SCRIPT language="JavaScript">
  43. /*예약함수*/
  44. var sheet1;
  45. var sheet1Row;
  46. var sheet1PageNo = 1;
  47. var pageLastRowIndex = 1;
  48. var validationResult = false;
  49. var filterShow = false;
  50. function _onReady(){
  51. /**
  52. * IBSheet object initialize
  53. */
  54. gridInit(sheet1);
  55. autoResize();
  56. /**
  57. * Application Initialize
  58. */
  59. jQuery("#btnSearch").click(function() {
  60. jQuery("#fevent").val("GET_DATA");
  61. var url = Modular.model.PageContext.CONTEXT_ROOT + "/payment/purchase/ComparePayplanActual_sheet.screen";
  62. Modular.view.IBSheet7.doSearch(sheet1, url, jQuery("#form1"), 30, "");
  63. });
  64. $("#chk_all").click(function() {
  65. if($("#chk_all").is(":checked") == true){
  66. $("#chk_all").val("Y");
  67. }else{
  68. $("#chk_all").val("N");
  69. }
  70. });
  71. pageinit();
  72. }
  73. function pageinit(){
  74. //달력 조건에 당해년도1월, 당해년도당월 셋팅
  75. setSearchDate();
  76. //jQuery("#btnSearch").click();
  77. }
  78. /**
  79. * IBSheet object initialize
  80. */
  81. function gridInit(sheetName){
  82. var init_sheet = {};
  83. init_sheet.Cfg = {SearchMode:2, Page:100, MergeSheet:7};
  84. init_sheet.Cols = [
  85. {Header:'상태', Type:"Status", SaveName:"STATUS", Width:0, Align:"Center", Hidden:"True"},
  86. {Header:'현장|코드', Type:"Text", SaveName:"DEPT_CD", Width:200, Align:"Left", Hidden:"True"},
  87. {Header:'현장명|현장명', Type:"Text", SaveName:"DEPT_NAME", Width:200, Align:"Left"},
  88. {Header:'계약번호|계약번호', Type:"Text", SaveName:"ORD_DOC_NO", Width:200, Align:"Left"},
  89. {Header:'최종차수|최종차수', Type:"Text", SaveName:"MOD_NO", Width:60, Align:"Center"},
  90. {Header:'계약명|계약명', Type:"Text", SaveName:"CST_DOC_NAME", Width:200, Align:"Left"},
  91. {Header:'대금|구분', Type:"Text", SaveName:"GB", Width:60, Align:"Left"},
  92. {Header:'대금|일자', Type:"Text", SaveName:"A_REQ_DATE", Width:80, Align:"Center"},
  93. {Header:'대금|금액', Type:"Float", SaveName:"A_AMT", Width:80, Align:"Right", Format:"Integer"},
  94. {Header:'대금|횟수', Type:"Text", SaveName:"A_CNT", Width:40, Align:"Center"},
  95. {Header:'계획|금액', Type:"Float", SaveName:"P_AMT", Width:80, Align:"Right", Format:"Integer"},
  96. {Header:'계획|지급여부', Type:"Text", SaveName:"P_PAY_YN", Width:40, Align:"Center"},
  97. {Header:'계획|횟수', Type:"Text", SaveName:"P_CNT", Width:40, Align:"Center"},
  98. {Header:'차액|차액', Type:"Float", SaveName:"DIFF", Width:80, Align:"Right", Format:"Integer"},
  99. {Header:'대금|계약번호', Type:"AutoSum", SaveName:"PUR_CONT_MOD_ID", Width:100, Align:"Center" ,Hidden:"True"},
  100. {Header:'대금|계약번호', Type:"Text", SaveName:"PUR_CONT_ID", Width:100, Align:"Center" ,Hidden:"True"},
  101. {Header:'대금|지급번호', Type:"Float", SaveName:"PAYREQ_ID", Width:50, Align:"Center",Hidden:"True"}
  102. ];
  103. init_sheet.HeaderMode = {Sort:1};
  104. IBS_InitSheet(sheetName, init_sheet);
  105. sheetName.SetDataAutoTrim(0);
  106. sheetName.SetEditable(false);
  107. sheetName.SetActionMenu("ExcelDown");
  108. setGridSize();
  109. }
  110. function sheet1_OnSelectMenu(Text, Code) {
  111. // text 또는 code값으로 Action수행
  112. switch(Text) {
  113. case "ExcelDown":
  114. sheetExcelDown(sheet1,$('li').html());
  115. break;
  116. }
  117. }
  118. /**
  119. * IBSheet Event: Search End(IBSheet 데이터 조회 CallBack)
  120. */
  121. function sheet1_OnSearchEnd(code, message) {
  122. if(code == 0) {
  123. sheet1.SetSumValue(0,"합 계");
  124. sheet1.SetCellAlign(sheet1.LastRow(),0,"Center");
  125. sheet1.SetMergeCell (sheet1.LastRow(), 0, 1,2);
  126. var lr = sheet1.LastRow();
  127. var str = "";
  128. var startrow = 2;
  129. var endrow = 1;
  130. var backColor = "";
  131. var totalConAmtValue = 0;
  132. var totalModAmtValue = 0;
  133. var totalRatAmtValue = 0.00;
  134. for(var i=1; i <= lr; i++){
  135. str = sheet1.GetCellText(i,1);
  136. if(str.indexOf("소계:") > -1){
  137. sheet1.SetCellAlign(i,1,"Center");
  138. sheet1.SetCellText(i,1, "소계");
  139. //sheet1.SetRangeBackColor(i,1,i,12,"#e0ffff");
  140. //alert(startrow);
  141. //alert(endrow);
  142. sheet1.SetMergeCell(startrow , 1, endrow + 1, 1);
  143. sheet1.SetMergeCell(i,1,1,5);
  144. sheet1.SetMergeCell(i,7,1,2);
  145. var remainderAcmpSupplyamt = sheet1.GetCellValue(i-1, "REMAINDER_ACMP_SUPPLYAMT"); //잔여
  146. var curAcmpPercent = sheet1.GetCellValue(i-1, "CUR_ACMP_PERCENT"); //지급율
  147. sheet1.SetCellValue(i, "REMAINDER_ACMP_SUPPLYAMT", remainderAcmpSupplyamt);
  148. sheet1.SetCellValue(i, "CUR_ACMP_PERCENT", curAcmpPercent.toFixed(2));
  149. totalConAmtValue = 0;
  150. totalModAmtValue = 0;
  151. totalRatAmtValue = 0.00;
  152. startrow = i + 1;
  153. }
  154. //var info = {Type: "Int", Align: "Right", Format:"Integer"};
  155. var info = {Type: "Float", Align: "Right", Format:"##0.00"};
  156. sheet1.InitCellProperty(i, "CUR_ACMP_PERCENT", info);
  157. var info2 = {Type: "Int", Align: "Right", Format:"Integer"};
  158. sheet1.InitCellProperty(i, "REMAINDER_ACMP_SUPPLYAMT", info2);
  159. }
  160. setGridSize();
  161. } else {
  162. //조회 에러 수행
  163. alert(message);
  164. }
  165. }
  166. /**
  167. * IBSheet Event: Save End(IBSheet 데이터 저장 CallBack)
  168. */
  169. function sheet1_OnSaveEnd(code, msg) {
  170. if(code >= 0) {
  171. alert("저장 성공");
  172. } else {
  173. alert(msg);
  174. }
  175. }
  176. /**
  177. * IBSheet Event: Click
  178. */
  179. function sheet1_OnClick(Row, Col, Value, CellX, CellY, CellW, CellH) {
  180. //masterSheetRow = Row;
  181. }
  182. /**
  183. * IBSheet size setting
  184. */
  185. function setGridSize() {
  186. sheet1.FitColWidth();
  187. }
  188. /**
  189. * IBSheet Event: DBLCLICK
  190. */
  191. function sheet1_OnDblClick(Row, Col, Value, CellX, CellY, CellW, CellH) {
  192. }
  193. function doResult(resultObj) {
  194. try {
  195. if( resultObj.getRequestEvent() == "" ) {
  196. if( resultObj.getSuccess() ) {
  197. var f = document.form1;
  198. f.action = "/main.screen";
  199. f.target = "_parent";
  200. f.submit();
  201. }
  202. else {
  203. dlgErrorMsg(resultObj);
  204. }
  205. document.form1.isSubmit = false;
  206. }else if( resultObj.getRequestEvent() == "GET_EHR_DATA" ) {
  207. if( resultObj.getSuccess() ) {
  208. alert("EHR Synchronize Complete");
  209. doSearch(document.all.sheet1);
  210. }
  211. else {
  212. dlgErrorMsg(resultObj);
  213. }
  214. document.form1.isSubmit = false;
  215. }
  216. }
  217. catch(errorObject) {
  218. showErrorDlg("doResult()", errorObject);
  219. }
  220. }
  221. function searchAccDept(p_dept_cd, p_dept_nm){
  222. result = window.showModalDialog(getDummyUrl('/lib/dlgSearchAccDept.screen'),'부서 찾기','dialogWidth:620px;dialogHeight:460px; center:yes; help:no; status:no; scroll:no; resizable:no');
  223. if( result == null ){
  224. document.form1.p_dept_cd.value = ""; //부서코드
  225. document.form1.p_dept_nm.value = ""; //부서명
  226. }else{
  227. document.form1.p_dept_cd.value = result[0]; //부서코드
  228. document.form1.p_dept_nm.value = result[1]; //부서명
  229. }
  230. }
  231. function doKeyPress() {
  232. if( event.keyCode == 13 ) {
  233. doSearch(document.all.sheet1)
  234. }
  235. }
  236. function calendar(thisDayObj){
  237. dlgCalendar(thisDayObj);
  238. }
  239. //검색조건에 기성년월 초기 설정
  240. function setSearchDate(){
  241. //검색조건 시작일
  242. var startDate = get_year() +'-'+ get_month() +'-'+ '01';
  243. if(jQuery('#searchDateStart').val() == ""){
  244. jQuery('#searchDateStart').val(startDate);
  245. }
  246. //검색조건 종료일
  247. var nowYearMonth = new Date( get_year(), get_month(), "");
  248. var lastDay = nowYearMonth.getDate();
  249. var endDate = get_year() +'-'+ get_month() +'-'+ lastDay;
  250. if(jQuery('#searchDateEnd').val() == ""){
  251. jQuery('#searchDateEnd').val(endDate);
  252. }
  253. }
  254. function sheet1_OnSmartResize(Width, Height) {
  255. sheet1.FitColWidth();
  256. autoResize();
  257. }
  258. function autoResize(){
  259. /* var t1_height = document.getElementById("t1").scrollHeight + 10;
  260. var iframeHeight= document.body.scrollHeight - t1_height;
  261. var iframeWidth= document.body.scrollWidth;
  262. sheet1.SetSheetHeight(iframeHeight); */
  263. var t1_height = document.getElementById("search-table").scrollHeight + document.getElementById("title").scrollHeight + 54;
  264. var iframeHeight= document.body.scrollHeight - t1_height;
  265. var iframeWidth= document.body.scrollWidth;
  266. sheet1.SetSheetHeight(iframeHeight);
  267. }
  268. function searchSite() {
  269. var win_id = "_searchSite";
  270. var link = "/lib/dlgSearchSpotDept_Unitcd.screen";
  271. link += "?pop_win_id="+win_id;
  272. fLayerPop(win_id, link, 550,500, '', '', 'NO');
  273. }
  274. function searchSiteClose(result) {
  275. if( result == null ){
  276. document.form1.searchDeptCd.value = ""; //부서코드
  277. document.form1.searchDeptNm.value = ""; //부서명
  278. }else{
  279. document.form1.searchDeptCd.value = result[0]; //부서코드
  280. document.form1.searchDeptNm.value = result[1]; //부서명
  281. }
  282. fLayerPopClose('_searchSite');
  283. }
  284. </SCRIPT>
  285. <modular:search id="form1">
  286. <modular:key id="fevent" />
  287. </modular:search>
  288. <BODY onresize="autoResize()" >
  289. <form id="form1" name="form1" method="post" modular:type="search">
  290. <INPUT type="hidden" name="fevent" id="fevent" value="">
  291. <div align="left" id="title">
  292. <ul>
  293. <li>대금계획과 지급현황 비교</li>
  294. </ul>
  295. </div>
  296. <!-- 검색조건 영역 : 시작 -->
  297. <table id="search-table" class="search-form-table">
  298. <colgroup>
  299. <col width="100px">
  300. <col width="40%">
  301. <col width="100px">
  302. <col width="*" />
  303. <col width="100px">
  304. </colgroup>
  305. <TR>
  306. <Th>현장</Th>
  307. <TD>
  308. <%--<%=InputText.getSiteCode("searchDeptCd", "searchDeptNm", "", user, initSearchDeptCd, initSearchDeptNm)%> --%>
  309. <%=InputText.getSiteCodeNew("searchDeptCd", "searchDeptNm", "", user, initSearchDeptCd, initSearchDeptNm)%>
  310. </TD>
  311. <Th>계약명</Th>
  312. <TD>
  313. <INPUT type="text" id="searchBuildName" name="searchBuildName" value="<%=initSearchBuildName%>" maxlength="50" class="input" style="IME-MODE : active;width:95%;" desc='계약명' onKeyPress="doKeyPress();">
  314. </TD>
  315. <TD class="button" rowspan="2">
  316. <!-- 검색버튼 영역 : 시작 -->
  317. <span class="btnSearch center"><a href="javascript:void(0);" id="btnSearch">검색</a></span>
  318. <!-- 검색버튼 영역 : 종료 -->
  319. </TD>
  320. </TR>
  321. <TR>
  322. <Th>증빙일</Th>
  323. <TD>
  324. <%= InputText.get("searchDateStart", initSearchDateStart, 15, 10, "Center, date, PerSize, readonly", "date", "") %>
  325. <a href="JavaScript:calendar('searchDateStart');"><img src="/img/buyer/button/bt_calender.gif" alt="달력" border="0" align="absmiddle" /></a>
  326. &nbsp;~&nbsp;
  327. <%= InputText.get("searchDateEnd", initSearchDateEnd, 15, 10, "Center, date, PerSize, readonly", "date", "") %>
  328. <a href="JavaScript:calendar('searchDateEnd');"><img src="/img/buyer/button/bt_calender.gif" alt="달력" border="0" align="absmiddle" /></a>
  329. </TD>
  330. <th>전체조회</th>
  331. <td>
  332. <input type="checkbox" id="chk_all" name="chk_all" value="N">
  333. </td>
  334. </TR>
  335. </TABLE>
  336. <img src="/img/com/blank.gif" height="5px" />
  337. <div align="right" id="bugase">
  338. <ul>
  339. <li valign="bottom"><span style="color: red;">지급완료된 기준으로 대금계획 확인(대금지급 되었는데 계획에 없으면 초과지급 발생함)* 부가세별도</span></li>
  340. </ul>
  341. </div>
  342. <div id="sheet1_div" style="padding-top:5px; height: auto; min-height: 350px; overflow: auto;">
  343. <script>createIBSheet('sheet1','100%', '350px');</script>
  344. </div>
  345. </FORM>
  346. </body>