resolutionFinishList.jsp 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773
  1. <%--
  2. - FileName : resolutionFinishList.jsp
  3. - Author(s) : ok
  4. - Date : 2014.07.18
  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. <%@ include file="/jsp/work/taglib.jsp" %>
  14. <jsp:useBean id="ctx" class="com.udapsoft.waf.system.context.SessionContext" scope="session" />
  15. <%
  16. ctx.init(request, response);
  17. HandlerStorage storage = ctx.getHandlerStorage();
  18. ValueObject params = storage.getParams();
  19. ValueObject user = storage.getUser();
  20. String event = storage.getEvent();
  21. //String deptCd = user.get("site_code");
  22. //String deptName = user.get("site_name");
  23. //deptCd = params.get("buseo");
  24. //RowSet rowSet = storage.getRowSet("ROWSET");
  25. //RowSet acctTypeRowSet = storage.getRowSet("AcctTypeRowSet"); //계정 타입
  26. //System.out.println("acctyType:"+acctTypeRowSet);
  27. //상태
  28. String statusSheetComboListText = (String)storage.getObject("selectText");
  29. String statusSheetComboListValue = (String)storage.getObject("selectValue");
  30. %>
  31. <SCRIPT language="JavaScript">
  32. /*예약함수*/
  33. var sheet1;
  34. var sheet1Row;
  35. var sheet1PageNo = 1;
  36. var sheet2;
  37. var sheet2Row;
  38. var sheet2PageNo = 1;
  39. var pageLastRowIndex = 1;
  40. var validationResult = false;
  41. var filterShow = false;
  42. function _onReady(){
  43. /**
  44. * IBSheet object initialize
  45. */
  46. gridInit(sheet1);
  47. grid2Init(sheet2);
  48. autoResize();
  49. /**
  50. * Application Initialize
  51. */
  52. jQuery("#btnSearch").click(function() {
  53. if(jQuery("#searchDeptCd").val() == ""){
  54. alert("현장을 선택해주세요.");
  55. jQuery("#searchDeptCd").focus();
  56. return;
  57. }
  58. if($('#surtaxGb').val() == '1'){
  59. jQuery("#fevent").val("GET_DATA");
  60. var url = Modular.model.PageContext.CONTEXT_ROOT + "/payment/outside/ResolutionFinishList_sheet.screen";
  61. Modular.view.IBSheet7.doSearch(sheet1, url, jQuery("#form1"), 10, "");
  62. } else {
  63. jQuery("#fevent").val("GET_DATA2");
  64. var url = Modular.model.PageContext.CONTEXT_ROOT + "/payment/outside/ResolutionFinishList_sheet.screen";
  65. Modular.view.IBSheet7.doSearch(sheet2, url, jQuery("#form1"), 10, "");
  66. }
  67. });
  68. pageinit();
  69. }
  70. function pageinit(){
  71. //달력 조건에 당해년도1월, 당해년도당월 셋팅
  72. setSearchDate();
  73. //jQuery("#btnSearch").click();
  74. }
  75. /**
  76. * IBSheet object initialize
  77. */
  78. function gridInit(sheetName){
  79. var init_sheet = {};
  80. init_sheet.Cfg = {SearchMode:2, Page:10, MergeSheet:7,PrevColumnMergeMode:0};
  81. init_sheet.Cols = [
  82. {Header:'상태|상태', Type:"Status", SaveName:"Status", Width:100, Align:"Left", Hidden:"True"},
  83. {Header:'현장명|현장명', Type:"Text", SaveName:"DEPT_NAME", Width:100, Align:"Left"},
  84. {Header:'계약번호|계약번호', Type:"Text", SaveName:"CON_DOC_NO", Width:120, Align:"Left", Hidden:"True"},
  85. {Header:'계약명|계약명', Type:"Text", SaveName:"BUILD_NAME", Width:110, Align:"Left"},
  86. {Header:'업체명|업체명', Type:"Text", SaveName:"MEMBER_NAME", Width:100, Align:"Left"},
  87. {Header:'공사기간|공사기간', Type:"Text", SaveName:"START_END_WORK_DATE", Width:130, Align:"Left"},
  88. {Header:'통화구분|통화구분', Type:"Text", SaveName:"CURRENCY_GB", Width:55, Align:"Center"},
  89. {Header:'통화구분자리|통화구분자리', Type:"Int", SaveName:"CURRENCY_DIGIT", Width:100, Align:"Left", Hidden:"True"},
  90. {Header:'계약금액|계약금액', Type:"Int", SaveName:"CON_SUPPLY_AMT", Width:80, Align:"Right"},
  91. {Header:'계약금액|합계', Type:"Int", SaveName:"CON_AMT", Width:40, Align:"Right", Hidden:"True"},
  92. {Header:'계약상선급금|계약상선급금', Type:"Int", SaveName:"PREPAY_SUPPLY_AMT", Width:80, Align:"Right"},
  93. {Header:'선급금발생|선급금발생', Type:"Int", SaveName:"REQ_PREPAY_SUPPLY_AMT", Width:80, Align:"Right"},
  94. {Header:'선급금\n신청날짜|선급금\n신청날짜',Type:"Text", SaveName:"PREPAY_DATE", Width:65, Align:"Right"},
  95. {Header:'기성년월|기성년월', Type:"Text", SaveName:"ACMP_YYYYMM", Width:50, Align:"Right"},
  96. {Header:'지급\n차수|지급\n차수', Type:"Int", SaveName:"ACMP_NO", Width:40, Align:"Right"},
  97. {Header:'기성액|금회기성', Type:"Int", SaveName:"FUND_AMT", Width:80, Align:"Right"},
  98. {Header:'기성액|선급금공제', Type:"Int", SaveName:"PAY_DEDUCT_AMT", Width:80, Align:"Right"},
  99. {Header:'기성액|실지불액', Type:"Int", SaveName:"REQU_SUPPLY_AMT", Width:80, Align:"Right"},
  100. {Header:'기성액|잔여기성', Type:"Int", SaveName:"MOD_FUND_AMT", Width:80, Align:"Right"},
  101. {Header:'기성율\n(%)|기성율\n(%)', Type:"Float", SaveName:"FUND_RATE", Width:40, Align:"Right", Format:"##0.00"},
  102. {Header:'상태|상태', Type:"Combo", SaveName:"STATUS_CD", Width:50, Align:"Center", ComboText:"<%=statusSheetComboListText%>", ComboCode:"<%=statusSheetComboListValue%>"}
  103. ];
  104. init_sheet.HeaderMode = {Sort:1};
  105. IBS_InitSheet(sheetName, init_sheet);
  106. sheetName.SetDataAutoTrim(0);
  107. sheetName.SetEditable(false);
  108. var info = [{StdCol:1, SumCols:"CON_AMT|FUND_AMT", ShowCumulate:0,Sort:0,CaptionCol:1}
  109. ,{StdCol:2, SumCols:"CON_AMT|FUND_AMT|PAY_DEDUCT_AMT|REQU_SUPPLY_AMT|FUND_RATE", ShowCumulate:0,Sort:0,CaptionCol:2}];
  110. sheetName.ShowSubSum(info);
  111. sheetName.SetActionMenu("ExcelDown");
  112. setGridSize();
  113. }
  114. function sheet1_OnSelectMenu(Text, Code) {
  115. // text 또는 code값으로 Action수행
  116. switch(Text) {
  117. case "ExcelDown":
  118. sheetExcelDown(sheet1,$('li').html());
  119. break;
  120. }
  121. }
  122. /**
  123. * IBSheet Event: Search End(IBSheet 데이터 조회 CallBack)
  124. */
  125. function sheet1_OnSearchEnd(code, message) {
  126. if(code == 0) {
  127. //sheet1.SetSumValue(0,"합 계");
  128. //sheet1.SetCellAlign(sheet1.LastRow(),0,"Center");
  129. //sheet1.SetMergeCell (sheet1.LastRow(), 0, 1,11);
  130. var lr = sheet1.LastRow();
  131. var str = "";
  132. var startrow = 2;
  133. var endrow = 0;
  134. var backColor = "";
  135. var totalConAmtValue = 0;
  136. var totalModAmtValue = 0;
  137. var totalRatAmtValue = 0.00;
  138. for(var i=2; i <= lr; i++){
  139. endrow = endrow + 1;
  140. str = sheet1.GetCellText(i,2);
  141. if(str.indexOf("소계:") > -1){
  142. var digit = sheet1.GetCellValue(i -1 , "CURRENCY_DIGIT");
  143. sheet1.SetCellAlign(i,3,"Center");
  144. sheet1.SetCellText(i,3, "소계");
  145. //sheet1.SetRangeBackColor(i,2,i,12,"#fffacd");
  146. sheet1.SetMergeCell(i,3,1,12);
  147. var conAmtValue = sheet1.GetCellValue(i - 1, "CON_AMT");
  148. var conAmtValue2 = sheet1.GetCellValue(i - 1, "CON_SUPPLY_AMT");
  149. totalConAmtValue = Number(totalConAmtValue) + Number(conAmtValue2);
  150. sheet1.SetCellValue(i, "CON_AMT", conAmtValue.toFixed(digit));
  151. var modAmtValue = sheet1.GetCellValue(i - 1, "MOD_FUND_AMT");
  152. totalModAmtValue = Number(totalModAmtValue) + Number(modAmtValue);
  153. sheet1.SetCellValue(i, "MOD_FUND_AMT", Number(modAmtValue).toFixed(digit));
  154. if( sheet1.GetCellValue(i, "MOD_FUND_AMT") == "0" ) { sheet1.SetCellValue(i, "FUND_RATE", "100"); }
  155. //var test = sheet1.GetCellValue(i - 1, "DEPT_NAME");
  156. //sheet1.SetCellValue(i, "DEPT_NAME", test);
  157. //endrow = i - startrow;
  158. if(digit == 0){
  159. var info = {Type: "Int" , Format:"Integer"};
  160. sheet1.InitCellProperty(i , "FUND_AMT", info);
  161. sheet1.InitCellProperty(i , "PAY_DEDUCT_AMT", info);
  162. sheet1.InitCellProperty(i , "REQU_SUPPLY_AMT", info);
  163. sheet1.InitCellProperty(i , "MOD_FUND_AMT", info);
  164. }else{
  165. var info = {Type: "Float" , PointCount:digit};
  166. sheet1.InitCellProperty(i , "FUND_AMT", info);
  167. sheet1.InitCellProperty(i , "PAY_DEDUCT_AMT", info);
  168. sheet1.InitCellProperty(i , "REQU_SUPPLY_AMT", info);
  169. sheet1.InitCellProperty(i , "MOD_FUND_AMT", info);
  170. }
  171. }
  172. str = sheet1.GetCellText(i,1);
  173. if(str.indexOf("소계:") > -1){
  174. sheet1.SetCellAlign(i,1,"Center");
  175. sheet1.SetCellText(i,1, "소계");
  176. //sheet1.SetRangeBackColor(i,1,i,12,"#e0ffff");
  177. //alert(startrow);
  178. //alert(endrow);
  179. sheet1.SetMergeCell(startrow, 1, endrow, 1);
  180. sheet1.SetMergeCell(i,1,1,14);
  181. var fundAmtValue = sheet1.GetCellValue(i, "FUND_AMT");
  182. totalRatAmtValue = Number(fundAmtValue) / Number(totalConAmtValue) * 100;
  183. sheet1.SetCellValue(i, "CON_AMT", totalConAmtValue);
  184. sheet1.SetCellValue(i, "MOD_FUND_AMT", totalModAmtValue);
  185. sheet1.SetCellValue(i, "FUND_RATE", totalRatAmtValue.toFixed(2));
  186. var info = {Type: "Int" , Format:"Integer"};
  187. sheet1.InitCellProperty(i , "CON_AMT", info);
  188. sheet1.InitCellProperty(i , "MOD_FUND_AMT", info);
  189. totalConAmtValue = 0;
  190. totalModAmtValue = 0;
  191. totalRatAmtValue = 0.00;
  192. startrow = i + 1;
  193. endrow = 0;
  194. }
  195. if(sheet1.GetCellValue(i , "CURRENCY_DIGIT") != ""){
  196. if(sheet1.GetCellValue(i , "CURRENCY_DIGIT") > 0){
  197. var digit = sheet1.GetCellValue(i, "CURRENCY_DIGIT");
  198. var info = {Type: "Float" , PointCount:digit};
  199. sheet1.InitCellProperty(i , "CON_SUPPLY_AMT", info);
  200. sheet1.InitCellProperty(i , "CON_AMT", info);
  201. sheet1.InitCellProperty(i , "PREPAY_SUPPLY_AMT", info);
  202. sheet1.InitCellProperty(i , "REQ_PREPAY_SUPPLY_AMT", info);
  203. sheet1.InitCellProperty(i , "PREPAY_DATE", info);
  204. sheet1.InitCellProperty(i , "FUND_AMT", info);
  205. sheet1.InitCellProperty(i , "PAY_DEDUCT_AMT", info);
  206. sheet1.InitCellProperty(i , "REQU_SUPPLY_AMT", info);
  207. sheet1.InitCellProperty(i , "MOD_FUND_AMT", info);
  208. }else{
  209. var info = {Type: "Int" , PointCount:digit};
  210. sheet1.InitCellProperty(i , "CON_SUPPLY_AMT", info);
  211. sheet1.InitCellProperty(i , "CON_AMT", info);
  212. sheet1.InitCellProperty(i , "PREPAY_SUPPLY_AMT", info);
  213. sheet1.InitCellProperty(i , "REQ_PREPAY_SUPPLY_AMT", info);
  214. sheet1.InitCellProperty(i , "PREPAY_DATE", info);
  215. sheet1.InitCellProperty(i , "FUND_AMT", info);
  216. sheet1.InitCellProperty(i , "PAY_DEDUCT_AMT", info);
  217. sheet1.InitCellProperty(i , "REQU_SUPPLY_AMT", info);
  218. sheet1.InitCellProperty(i , "MOD_FUND_AMT", info);
  219. }
  220. }
  221. /* var info = {Type: "Int", Align: "Right", Format:"Integer"};
  222. sheet1.InitCellProperty(i, "CON_AMT", info);
  223. info = {Type: "Int", Align: "Right", Format:"Integer"};
  224. sheet1.InitCellProperty(i, "MOD_FUND_AMT", info);
  225. */
  226. }
  227. setGridSize();
  228. } else {
  229. //조회 에러 수행
  230. alert(message);
  231. }
  232. }
  233. /**
  234. * IBSheet Event: Save End(IBSheet 데이터 저장 CallBack)
  235. */
  236. function sheet1_OnSaveEnd(code, msg) {
  237. if(code >= 0) {
  238. alert("저장 성공");
  239. } else {
  240. alert(msg);
  241. }
  242. }
  243. /**
  244. * IBSheet Event: Click
  245. */
  246. function sheet1_OnClick(Row, Col, Value, CellX, CellY, CellW, CellH) {
  247. //masterSheetRow = Row;
  248. }
  249. /**
  250. * IBSheet size setting
  251. */
  252. function setGridSize() {
  253. sheet1.FitColWidth();
  254. }
  255. /**
  256. * IBSheet Event: DBLCLICK
  257. */
  258. function sheet1_OnDblClick(Row, Col, Value, CellX, CellY, CellW, CellH) {
  259. }
  260. function doResult(resultObj) {
  261. try {
  262. if( resultObj.getRequestEvent() == "" ) {
  263. if( resultObj.getSuccess() ) {
  264. var f = document.form1;
  265. f.action = "/main.screen";
  266. f.target = "_parent";
  267. f.submit();
  268. }
  269. else {
  270. dlgErrorMsg(resultObj);
  271. }
  272. document.form1.isSubmit = false;
  273. }else if( resultObj.getRequestEvent() == "GET_EHR_DATA" ) {
  274. if( resultObj.getSuccess() ) {
  275. alert("EHR Synchronize Complete");
  276. doSearch(document.all.sheet1);
  277. }
  278. else {
  279. dlgErrorMsg(resultObj);
  280. }
  281. document.form1.isSubmit = false;
  282. }
  283. }
  284. catch(errorObject) {
  285. showErrorDlg("doResult()", errorObject);
  286. }
  287. }
  288. function searchAccDept(p_dept_cd, p_dept_nm){
  289. result = window.showModalDialog(getDummyUrl('/lib/dlgSearchAccDept.screen'),'부서 찾기','dialogWidth:620px;dialogHeight:460px; center:yes; help:no; status:no; scroll:no; resizable:no');
  290. if( result == null ){
  291. document.form1.p_dept_cd.value = ""; //부서코드
  292. document.form1.p_dept_nm.value = ""; //부서명
  293. }else{
  294. document.form1.p_dept_cd.value = result[0]; //부서코드
  295. document.form1.p_dept_nm.value = result[1]; //부서명
  296. }
  297. }
  298. function doKeyPress() {
  299. if( event.keyCode == 13 ) {
  300. jQuery("#btnSearch").click();
  301. }
  302. }
  303. function calendar(thisDayObj){
  304. dlgMCalendar(thisDayObj);
  305. }
  306. //검색조건에 기성년월 초기 설정
  307. function setSearchDate(){
  308. var newDay = new Date( get_year(), get_month(), "");
  309. var lastDay = newDay.getDate();
  310. //var yyyymmbeginning = get_year() +'-'+ get_month() +'-'+ '01';
  311. //var yyyymmlast = get_year() +'-'+ get_month() +'-'+ lastDay;
  312. var searchFromDate = get_year() +'-'+ '01';
  313. var searchToDate = get_year() +'-'+ get_month();
  314. jQuery('#searchFromDate').val(searchFromDate);
  315. jQuery('#searchToDate').val(searchToDate);
  316. }
  317. function sheet1_OnSmartResize(Width, Height) {
  318. sheet1.FitColWidth();
  319. autoResize();
  320. }
  321. function autoResize(){
  322. var t1_height = document.getElementById("search-table").scrollHeight + document.getElementById("bugase").scrollHeight + document.getElementById("title").scrollHeight + 54;
  323. var iframeHeight= document.body.scrollHeight - t1_height;
  324. var iframeWidth= document.body.scrollWidth;
  325. sheet1.SetSheetHeight(iframeHeight);
  326. }
  327. function searchSite() {
  328. var win_id = "_searchSite";
  329. var link = "/lib/dlgSearchSpotDept_Unitcd.screen";
  330. link += "?pop_win_id="+win_id;
  331. fLayerPop(win_id, link, 550,500, '', '', 'NO');
  332. }
  333. function searchSiteClose(result) {
  334. if( result == null ){
  335. document.form1.searchDeptCd.value = ""; //부서코드
  336. document.form1.searchDeptNm.value = ""; //부서명
  337. }else{
  338. document.form1.searchDeptCd.value = result[0]; //부서코드
  339. document.form1.searchDeptNm.value = result[1]; //부서명
  340. }
  341. fLayerPopClose('_searchSite');
  342. }
  343. function chgSurtaxGb(val){
  344. if(val == '1'){
  345. $('#spnSurtaxGb').text('별도');
  346. jQuery('#sheet2_div').hide();
  347. jQuery('#sheet1_div').show();
  348. } else {
  349. $('#spnSurtaxGb').text('포함');
  350. jQuery('#sheet1_div').hide();
  351. jQuery('#sheet2_div').show();
  352. }
  353. }
  354. /**
  355. * IBSheet object initialize
  356. */
  357. function grid2Init(sheetName){
  358. var init_sheet = {};
  359. init_sheet.Cfg = {SearchMode:2, Page:10, MergeSheet:7,PrevColumnMergeMode:0};
  360. init_sheet.Cols = [
  361. {Header:'상태|상태|상태', Type:"Status", SaveName:"Status", Width:100, Align:"Left", Hidden:"True"},
  362. {Header:'현장명|현장명|현장명', Type:"Text", SaveName:"DEPT_NAME", Width:100, Align:"Left"},
  363. {Header:'계약번호|계약번호|계약번호', Type:"Text", SaveName:"CON_DOC_NO", Width:120, Align:"Left", Hidden:"True"},
  364. {Header:'계약명|계약명|계약명', Type:"Text", SaveName:"BUILD_NAME", Width:110, Align:"Left"},
  365. {Header:'업체명|업체명|업체명', Type:"Text", SaveName:"MEMBER_NAME", Width:100, Align:"Left"},
  366. {Header:'공사기간|공사기간|공사기간', Type:"Text", SaveName:"START_END_WORK_DATE", Width:130, Align:"Left"},
  367. {Header:'통화구분|통화구분|통화구분', Type:"Text", SaveName:"CURRENCY_GB", Width:55, Align:"Center"},
  368. {Header:'통화구분자리|통화구분자리|통화구분자리', Type:"Int", SaveName:"CURRENCY_DIGIT", Width:100, Align:"Left", Hidden:"True"},
  369. {Header:'계약금액|공급가|공급가', Type:"Int", SaveName:"CON_SUPPLY_AMT", Width:80, Align:"Right"},
  370. {Header:'계약금액|부가세|부가세', Type:"Int", SaveName:"CON_SURTAX_AMT", Width:80, Align:"Right"},
  371. {Header:'계약금액|합계|합계', Type:"Int", SaveName:"CON_AMT", Width:80, Align:"Right"},
  372. {Header:'계약상선급금|공급가|공급가', Type:"Int", SaveName:"PREPAY_SUPPLY_AMT", Width:80, Align:"Right"},
  373. {Header:'계약상선급금|부가세|부가세', Type:"Int", SaveName:"PREPAY_SURTAX_AMT", Width:80, Align:"Right"},
  374. {Header:'선급금발생|공급가|공급가', Type:"Int", SaveName:"REQ_PREPAY_SUPPLY_AMT", Width:80, Align:"Right"},
  375. {Header:'선급금발생|부가세|부가세', Type:"Int", SaveName:"REQ_PREPAY_SURTAX_AMT", Width:80, Align:"Right"},
  376. {Header:'선급금\n신청날짜|선급금\n신청날짜|선급금\n신청날짜',Type:"Text", SaveName:"PREPAY_DATE", Width:65, Align:"Right"},
  377. {Header:'기성년월|기성년월|기성년월', Type:"Text", SaveName:"ACMP_YYYYMM", Width:50, Align:"Right"},
  378. {Header:'지급\n차수|지급\n차수|지급\n차수', Type:"Int", SaveName:"ACMP_NO", Width:40, Align:"Right"},
  379. {Header:'기성액|금회기성|금회기성', Type:"Int", SaveName:"FUND_AMT", Width:80, Align:"Right"},
  380. {Header:'기성액|선급금공제|선급금공제', Type:"Int", SaveName:"PAY_DEDUCT_AMT", Width:80, Align:"Right"},
  381. {Header:'기성액|실지불액|공급가', Type:"Int", SaveName:"REQU_SUPPLY_AMT", Width:80, Align:"Right"},
  382. {Header:'기성액|실지불액|부가세', Type:"Int", SaveName:"REQU_SURTAX_AMT", Width:80, Align:"Right"},
  383. {Header:'기성액|실지불액|합계', Type:"Int", SaveName:"REQU_AMT", Width:80, Align:"Right"},
  384. {Header:'기성액|잔여기성|공급가', Type:"Int", SaveName:"MOD_FUND_AMT", Width:80, Align:"Right"},
  385. {Header:'기성액|잔여기성|부가세', Type:"Int", SaveName:"MOD_SURTAX_AMT", Width:80, Align:"Right"},
  386. {Header:'기성액|잔여기성|합계', Type:"Int", SaveName:"MOD_AMT", Width:80, Align:"Right"},
  387. {Header:'기성율\n(%)|기성율\n(%)|기성율\n(%)', Type:"Float", SaveName:"FUND_RATE", Width:40, Align:"Right", Format:"##0.00"},
  388. {Header:'상태|상태|상태', Type:"Combo", SaveName:"STATUS_CD", Width:50, Align:"Center", ComboText:"<%=statusSheetComboListText%>", ComboCode:"<%=statusSheetComboListValue%>"}
  389. ];
  390. init_sheet.HeaderMode = {Sort:1};
  391. IBS_InitSheet(sheetName, init_sheet);
  392. sheetName.SetDataAutoTrim(0);
  393. sheetName.SetEditable(false);
  394. var info = [{StdCol:1, SumCols:"CON_AMT|FUND_AMT", ShowCumulate:0,Sort:0,CaptionCol:1}
  395. ,{StdCol:2, SumCols:"CON_AMT|FUND_AMT|PAY_DEDUCT_AMT|REQU_SUPPLY_AMT|REQU_SURTAX_AMT|REQU_AMT|FUND_RATE", ShowCumulate:0,Sort:0,CaptionCol:2}];
  396. sheetName.ShowSubSum(info);
  397. sheetName.SetActionMenu("ExcelDown");
  398. setGrid2Size();
  399. }
  400. /**
  401. * IBSheet size setting
  402. */
  403. function setGrid2Size() {
  404. sheet2.FitColWidth();
  405. }
  406. function sheet2_OnSelectMenu(Text, Code) {
  407. // text 또는 code값으로 Action수행
  408. switch(Text) {
  409. case "ExcelDown":
  410. sheetExcelDown(sheet2,$('li').html());
  411. break;
  412. }
  413. }
  414. /**
  415. * IBSheet Event: Search End(IBSheet 데이터 조회 CallBack)
  416. */
  417. function sheet2_OnSearchEnd(code, message) {
  418. if(code == 0) {
  419. //sheet1.SetSumValue(0,"합 계");
  420. //sheet1.SetCellAlign(sheet1.LastRow(),0,"Center");
  421. //sheet1.SetMergeCell (sheet1.LastRow(), 0, 1,11);
  422. var lr = sheet2.LastRow();
  423. var str = "";
  424. var startrow = 3;
  425. var endrow = 0;
  426. var backColor = "";
  427. var totalConAmtValue = 0;
  428. var totalModAmtValue = 0;
  429. var totalModSurtaxAmtValue = 0;
  430. var totalModValue = 0;
  431. var totalRatAmtValue = 0.00;
  432. for(var i=3; i <= lr; i++){
  433. endrow = endrow + 1;
  434. str = sheet2.GetCellText(i,2);
  435. if(str.indexOf("소계:") > -1){
  436. var digit = sheet2.GetCellValue(i -1 , "CURRENCY_DIGIT");
  437. sheet2.SetCellAlign(i,3,"Center");
  438. sheet2.SetCellText(i,3, "소계");
  439. //sheet1.SetRangeBackColor(i,2,i,12,"#fffacd");
  440. sheet2.SetMergeCell(i,3,1,15);
  441. var conAmtValue = sheet2.GetCellValue(i - 1, "CON_AMT");
  442. var conAmtValue2 = sheet2.GetCellValue(i - 1, "CON_SUPPLY_AMT");
  443. totalConAmtValue = Number(totalConAmtValue) + Number(conAmtValue2);
  444. sheet2.SetCellValue(i, "CON_AMT", conAmtValue.toFixed(digit));
  445. var modAmtValue = sheet2.GetCellValue(i - 1, "MOD_FUND_AMT");
  446. totalModAmtValue = Number(totalModAmtValue) + Number(modAmtValue);
  447. sheet2.SetCellValue(i, "MOD_FUND_AMT", Number(modAmtValue).toFixed(digit));
  448. var modSurtaxValue = sheet2.GetCellValue(i - 1, "MOD_SURTAX_AMT");
  449. totalModSurtaxAmtValue = Number(totalModSurtaxAmtValue) + Number(modSurtaxValue);
  450. sheet2.SetCellValue(i, "MOD_SURTAX_AMT", Number(modSurtaxValue).toFixed(digit));
  451. var modValue = sheet2.GetCellValue(i - 1, "MOD_AMT");
  452. totalModValue = Number(totalModValue) + Number(modValue);
  453. sheet2.SetCellValue(i, "MOD_AMT", Number(modValue).toFixed(digit));
  454. if( sheet2.GetCellValue(i, "MOD_FUND_AMT") == "0" ) { sheet2.SetCellValue(i, "FUND_RATE", "100"); }
  455. //var test = sheet1.GetCellValue(i - 1, "DEPT_NAME");
  456. //sheet1.SetCellValue(i, "DEPT_NAME", test);
  457. //endrow = i - startrow;
  458. if(digit == 0){
  459. var info = {Type: "Int" , Format:"Integer"};
  460. sheet2.InitCellProperty(i , "FUND_AMT", info);
  461. sheet2.InitCellProperty(i , "PAY_DEDUCT_AMT", info);
  462. sheet2.InitCellProperty(i , "REQU_SUPPLY_AMT", info);
  463. sheet2.InitCellProperty(i , "REQU_SURTAX_AMT", info);
  464. sheet2.InitCellProperty(i , "REQU_AMT", info);
  465. sheet2.InitCellProperty(i , "MOD_FUND_AMT", info);
  466. sheet2.InitCellProperty(i , "MOD_SURTAX_AMT", info);
  467. sheet2.InitCellProperty(i , "MOD_AMT", info);
  468. }else{
  469. var info = {Type: "Float" , PointCount:digit};
  470. sheet2.InitCellProperty(i , "FUND_AMT", info);
  471. sheet2.InitCellProperty(i , "PAY_DEDUCT_AMT", info);
  472. sheet2.InitCellProperty(i , "REQU_SUPPLY_AMT", info);
  473. sheet2.InitCellProperty(i , "REQU_SURTAX_AMT", info);
  474. sheet2.InitCellProperty(i , "REQU_AMT", info);
  475. sheet2.InitCellProperty(i , "MOD_FUND_AMT", info);
  476. sheet2.InitCellProperty(i , "MOD_SURTAX_AMT", info);
  477. sheet2.InitCellProperty(i , "MOD_AMT", info);
  478. }
  479. }
  480. str = sheet2.GetCellText(i,1);
  481. if(str.indexOf("소계:") > -1){
  482. sheet2.SetCellAlign(i,1,"Center");
  483. sheet2.SetCellText(i,1, "소계");
  484. //sheet1.SetRangeBackColor(i,1,i,12,"#e0ffff");
  485. //alert(startrow);
  486. //alert(endrow);
  487. sheet2.SetMergeCell(startrow, 1, endrow, 1);
  488. sheet2.SetMergeCell(i,1,1,17);
  489. var fundAmtValue = sheet2.GetCellValue(i, "FUND_AMT");
  490. totalRatAmtValue = Number(fundAmtValue) / Number(totalConAmtValue) * 100;
  491. //sheet2.SetCellValue(i, "CON_AMT", totalConAmtValue);
  492. sheet2.SetCellValue(i, "MOD_FUND_AMT", totalModAmtValue);
  493. sheet2.SetCellValue(i, "FUND_RATE", totalRatAmtValue.toFixed(2));
  494. var info = {Type: "Int" , Format:"Integer"};
  495. //sheet2.InitCellProperty(i , "CON_AMT", info);
  496. sheet2.InitCellProperty(i , "MOD_FUND_AMT", info);
  497. totalConAmtValue = 0;
  498. totalModAmtValue = 0;
  499. totalRatAmtValue = 0.00;
  500. startrow = i + 1;
  501. endrow = 0;
  502. }
  503. if(sheet2.GetCellValue(i , "CURRENCY_DIGIT") != ""){
  504. if(sheet2.GetCellValue(i , "CURRENCY_DIGIT") > 0){
  505. var digit = sheet2.GetCellValue(i, "CURRENCY_DIGIT");
  506. var info = {Type: "Float" , PointCount:digit};
  507. sheet2.InitCellProperty(i , "CON_SUPPLY_AMT", info);
  508. sheet2.InitCellProperty(i , "CON_SURTAX_AMT", info);
  509. sheet2.InitCellProperty(i , "CON_AMT", info);
  510. sheet2.InitCellProperty(i , "PREPAY_SUPPLY_AMT", info);
  511. sheet2.InitCellProperty(i , "PREPAY_SURTAX_AMT", info);
  512. sheet2.InitCellProperty(i , "REQ_PREPAY_SUPPLY_AMT", info);
  513. sheet2.InitCellProperty(i , "REQ_PREPAY_SURTAX_AMT", info);
  514. sheet2.InitCellProperty(i , "PREPAY_DATE", info);
  515. sheet2.InitCellProperty(i , "FUND_AMT", info);
  516. sheet2.InitCellProperty(i , "PAY_DEDUCT_AMT", info);
  517. sheet2.InitCellProperty(i , "REQU_SUPPLY_AMT", info);
  518. sheet2.InitCellProperty(i , "REQU_SURTAX_AMT", info);
  519. sheet2.InitCellProperty(i , "REQU_AMT", info);
  520. sheet2.InitCellProperty(i , "MOD_FUND_AMT", info);
  521. sheet2.InitCellProperty(i , "MOD_SURTAX_AMT", info);
  522. sheet2.InitCellProperty(i , "MOD_AMT", info);
  523. }else{
  524. var info = {Type: "Int" , PointCount:digit};
  525. sheet2.InitCellProperty(i , "CON_SUPPLY_AMT", info);
  526. sheet2.InitCellProperty(i , "CON_SURTAX_AMT", info);
  527. sheet2.InitCellProperty(i , "CON_AMT", info);
  528. sheet2.InitCellProperty(i , "PREPAY_SUPPLY_AMT", info);
  529. sheet2.InitCellProperty(i , "PREPAY_SURTAX_AMT", info);
  530. sheet2.InitCellProperty(i , "REQ_PREPAY_SUPPLY_AMT", info);
  531. sheet2.InitCellProperty(i , "REQ_PREPAY_SURTAX_AMT", info);
  532. sheet2.InitCellProperty(i , "PREPAY_DATE", info);
  533. sheet2.InitCellProperty(i , "FUND_AMT", info);
  534. sheet2.InitCellProperty(i , "PAY_DEDUCT_AMT", info);
  535. sheet2.InitCellProperty(i , "REQU_SUPPLY_AMT", info);
  536. sheet2.InitCellProperty(i , "REQU_SURTAX_AMT", info);
  537. sheet2.InitCellProperty(i , "REQU_AMT", info);
  538. sheet2.InitCellProperty(i , "MOD_FUND_AMT", info);
  539. sheet2.InitCellProperty(i , "MOD_SURTAX_AMT", info);
  540. sheet2.InitCellProperty(i , "MOD_AMT", info);
  541. }
  542. }
  543. /* var info = {Type: "Int", Align: "Right", Format:"Integer"};
  544. sheet2.InitCellProperty(i, "CON_AMT", info);
  545. info = {Type: "Int", Align: "Right", Format:"Integer"};
  546. sheet2.InitCellProperty(i, "MOD_FUND_AMT", info);
  547. */
  548. }
  549. setGrid2Size();
  550. } else {
  551. //조회 에러 수행
  552. alert(message);
  553. }
  554. }
  555. function sheet2_OnSmartResize(Width, Height) {
  556. sheet2.FitColWidth();
  557. auto2Resize();
  558. }
  559. function auto2Resize(){
  560. var t1_height = document.getElementById("search-table").scrollHeight + document.getElementById("bugase").scrollHeight + document.getElementById("title").scrollHeight + 24;
  561. var iframeHeight= document.body.scrollHeight - t1_height;
  562. var iframeWidth= document.body.scrollWidth;
  563. sheet2.SetSheetHeight(iframeHeight);
  564. }
  565. </SCRIPT>
  566. <modular:search id="form1">
  567. <modular:key id="fevent" />
  568. </modular:search>
  569. <BODY onresize="autoResize()" >
  570. <form id="form1" name="form1" method="post" modular:type="search">
  571. <INPUT type="hidden" name="fevent" id="fevent" value="">
  572. <INPUT type="hidden" name="formdata1" id="formdata1" value="formdata1Test">
  573. <div align="left" id="title">
  574. <ul>
  575. <li>외주_기성완료현황</li>
  576. </ul>
  577. </div>
  578. <!-- 검색조건 영역 : 시작 -->
  579. <table id="search-table" class="search-form-table">
  580. <colgroup>
  581. <col width="100px">
  582. <col width="*">
  583. <col width="100px">
  584. <col width="*">
  585. <col width="100px">
  586. <col width="*">
  587. <col width="100px">
  588. </colgroup>
  589. <TR>
  590. <Th>현장</Th>
  591. <TD>
  592. <%=InputText.getSiteCodeNew("searchDeptCd", "searchDeptNm", "", user, "", "")%>
  593. <%-- <%= InputText.get("searchDeptCd", "", 12, 10, "ID,ReadOnly,PerSize") %>
  594. <%= InputText.get("searchDeptNm", "", 17, 30, "ID,PerSize,ReadOnly") %>
  595. <IMG onclick="searchSite();" src="/img/buyer/button/bt_search_right.gif" alt="현장찾기" border="0" align="absmiddle" style="cursor:hand;"> --%>
  596. </TD>
  597. <TH>업체명</TH>
  598. <TD colspan="3">
  599. <INPUT type="text" id="searchCorp" name="searchCorp" value="" maxlength="50" class="input" style="IME-MODE : active; width:90%;" desc='업체명' onKeyPress="doKeyPress();">
  600. </TD>
  601. <TD class="button" rowspan="2">
  602. <!-- 검색버튼 영역 : 시작 -->
  603. <span class="btnSearch center"><a href="javascript:void(0);" id="btnSearch">검색</a></span>
  604. <!-- 검색버튼 영역 : 종료 -->
  605. </TD>
  606. </TR>
  607. <TR>
  608. <Th>계약명</Th>
  609. <TD>
  610. <INPUT type="text" id="searchBuldNm" name="searchBuldNm" value="" maxlength="50" class="input" style="IME-MODE : active; width:90%;" desc='계약명' onKeyPress="doKeyPress();">
  611. </TD>
  612. <Th>기성년월</Th>
  613. <TD>
  614. <%= InputText.get("searchFromDate", "", 10, 50, "hangule,center, desc=기성년월, ReadOnly") %>
  615. <IMG name="start_img" id="calender_from" src="/img/buyer/button/bt_calender.gif" border="0" align="absmiddle" style="cursor:pointer;" onClick="JavaScript:dlgMCalendar('searchFromDate');">
  616. ~
  617. <%= InputText.get("searchToDate", "", 10, 50, "hangule,center, desc=기성년월, ReadOnly") %>
  618. <IMG name="start_img" id="calender_to" src="/img/buyer/button/bt_calender.gif" border="0" align="absmiddle" style="cursor:pointer;" onClick="JavaScript:dlgMCalendar('searchToDate');">
  619. <!-- <input type="text" id="searchFromDate" name="searchFromDate" value="" readonly style="width:15%; text-align: center;" maxlength="7">
  620. <A href="JavaScript:calendar('searchFromDate');"><IMG src="/img/buyer/button/bt_calender.gif" alt="달력" border="0" align="absmiddle"></A>
  621. &nbsp;~&nbsp;&nbsp;
  622. <input type="text" id="searchToDate" name="searchToDate" value="" readonly style="width:15%; text-align: center;" maxlength="7">
  623. <A href="JavaScript:calendar('searchToDate');"><IMG src="/img/buyer/button/bt_calender.gif" alt="달력" border="0" align="absmiddle"></A> -->
  624. </TD>
  625. <Th>부가세</Th>
  626. <TD>
  627. <select name="surtaxGb" id="surtaxGb" style="width: 70px;" onChange="chgSurtaxGb(this.value);">
  628. <option value="1">별도</option>
  629. <option value="2">포함</option>
  630. </select>
  631. </TD>
  632. </TR>
  633. </TABLE>
  634. <img src="/img/com/blank.gif" height="5px" />
  635. <div align="right" id="bugase">
  636. <ul>
  637. <li valign="bottom"><span style="color: red;">* 부가세<span id="spnSurtaxGb">별도</span></span></li>
  638. </ul>
  639. </div>
  640. <div id="sheet1_div" style="padding-top:5px; height: auto; min-height: 350px; overflow: auto;">
  641. <script>createIBSheet('sheet1','100%', '350px');</script>
  642. </div>
  643. <div id="sheet2_div" style="padding-top:5px; height: auto; min-height: 350px; overflow: auto; display:none;">
  644. <script>createIBSheet('sheet2','100%', '350px');</script>
  645. </div>
  646. </FORM>
  647. </body>