SPRAT00100_세금계산서Excel입력.xrw 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386
  1. <?xml version="1.0" encoding="EUC-KR"?>
  2. <?xml-stylesheet type="text/css" href="../../../com/commonweb/css/common.css" ?>
  3. <xhtml:html xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2002/01/xforms" xmlns:ev="http://www.w3.org/2001/xml-events">
  4. <xhtml:head>
  5. <xhtml:title>세금계산서Excel입력</xhtml:title>
  6. <model id="model1">
  7. <instance id="instance1">
  8. <root xmlns="">
  9. <main>
  10. <list>
  11. <taxbilllist/>
  12. </list>
  13. <custlist/>
  14. </main>
  15. <send>
  16. <list>
  17. <taxbilllist/>
  18. </list>
  19. <condition>
  20. <instcd/>
  21. <entrregno/>
  22. </condition>
  23. </send>
  24. <hidden>
  25. <list>
  26. <taxbillchecklist/>
  27. </list>
  28. <condition>
  29. <instcd/>
  30. </condition>
  31. </hidden>
  32. <init>
  33. </init>
  34. <temp>
  35. </temp>
  36. </root>
  37. </instance>
  38. <submission id="TRZBC00101" method="urlencoded-post" replace="instance"/>
  39. <bind id="bind_totamt" ref="/root/hidden/totamt" calculate="(/root/main/orch_one/paytotamt) - (/root/main/orch_one/incmtax) -(/root/main/orch_one/resdntax)"/>
  40. <bind id="bind_amt" ref="/root/hidden/orchreturn/amt" calculate="sum(/root/main/list/orchlist/paytotamt)"/>
  41. <bind id="bind_incmtax" ref="/root/hidden/orchreturn/incmtax" calculate="sum(/root/main/list/orchlist/incmtax)"/>
  42. <bind id="bind_resdntax" ref="/root/hidden/orchreturn/resdntax" calculate="sum(/root/main/list/orchlist/resdntax)"/>
  43. <submission id="TXRAT00102" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send/list" resultref="/root/temp"/>
  44. <submission id="TRRAC00601" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send/condition" resultref="/root/main/custlist"/>
  45. </model>
  46. <script type="javascript" src="../../../com/commonweb/js/common.js"/>
  47. <script type="javascript" src="../../../com/commonweb/js/stringHelper.js"/>
  48. <script type="javascript" src="../../../com/commonweb/js/dateHelper.js"/>
  49. <script type="javascript" src="../../../com/commonweb/js/tfHelper.js"/>
  50. <script type="javascript" src="../../../com/basiccodeweb/js/ZBC001.js"/>
  51. <script type="javascript" src="../../../mis/miscommonweb/js/MIS.js"/>
  52. <script type="javascript" src="../../../mis/miscommonweb/js/RAC001.js"/>
  53. <script type="javascript" src="../../../mis/acntcommonweb/js/RAD001.js"/>
  54. <script type="javascript" ev:event="xforms-ready">
  55. <![CDATA[
  56. fInitialize();
  57. ]]>
  58. </script>
  59. <script type="javascript">
  60. <![CDATA[
  61. function fInitialize()
  62. {
  63. misfComboComCdList("Z0007", cmb_instcd, "N");
  64. model.setValue(cmb_instcd.attribute("ref"), getUserInfo("dutplceinstcd"));
  65. model.removenode(grd_taxchecklist.nodeset);
  66. model.removenode(grd_taxlist.nodeset);
  67. model.refresh();
  68. model.setFocus("ipt_name");
  69. }
  70. function fSave()
  71. {
  72. var updtdata = getGridUpdateData(grd_taxlist);
  73. if (updtdata == "")
  74. {
  75. return false;
  76. }
  77. model.copyNode("/root/send/list", "/root/main/list");
  78. submit("TXRAT00102");
  79. grd_taxchecklist.clearStatus();
  80. grd_taxlist.clearStatus();
  81. }
  82. //========================================================================================
  83. // 거래처 존재여부 검사
  84. //========================================================================================
  85. function CheckExistCust()
  86. {
  87. model.removeNodeset(grd_taxchecklist.nodeset);
  88. model.removeNodeset(grd_taxlist.nodeset);
  89. grd_taxchecklist.refresh();
  90. grd_taxlist.refresh();
  91. fInputExcel(grd_taxchecklist);
  92. btn_save.disabled = true;
  93. btn_check.disabled = false;
  94. var instcd = getUserInfo("dutplceinstcd")
  95. bflag = true; // 모든 자료가 유효해야 true를 return 한다.
  96. model.setValue("/root/send/condition/instcd", cmb_instcd.value);
  97. for(var i = grd_taxchecklist.fixedRows ; i < grd_taxchecklist.rows ; i++)
  98. {
  99. //alert(i);
  100. sValidYN = grd_taxchecklist.valueMatrix(i, grd_taxchecklist.colRef("validyn"));
  101. if(sValidYN == "D") continue;
  102. if(sValidYN != "Y")
  103. {
  104. messageBox("유효구분은 모두 Y로 입력해야합니다.", "I000");
  105. return false;
  106. }
  107. sEntrregno = grd_taxchecklist.valueMatrix(i, grd_taxchecklist.colRef("entrregno"));
  108. model.setValue("/root/send/condition/entrregno", sEntrregno);
  109. submit("TRRAC00601");
  110. var vEntrregno = model.getValue("/root/main/custlist/entrregno");
  111. var vCustnm = model.getValue("/root/main/custlist/custnm");
  112. var vCustPrsd = model.getValue("/root/main/custlist/prsdnm");
  113. var vCustBizcont = model.getValue("/root/main/custlist/bizcont");
  114. var vCustItem = model.getValue("/root/main/custlist/item");
  115. var vCustAddr = model.getValue("/root/main/custlist/supaddr") + " " + model.getValue("/root/main/custlist/infaddr");
  116. if(vEntrregno == "")
  117. {
  118. grd_taxchecklist.cellStyle("background-color", i, grd_taxchecklist.colRef("entrregno")) = "#ff6600";
  119. model.setValue(grd_taxchecklist.nodeset + "[" + i + "]/validyn", "E");
  120. bflag = false;
  121. }
  122. else
  123. {
  124. model.setValue(grd_taxchecklist.nodeset + "[" + i + "]/custnm", vCustnm);
  125. model.setValue(grd_taxchecklist.nodeset + "[" + i + "]/custaddr", vCustAddr);
  126. model.setValue(grd_taxchecklist.nodeset + "[" + i + "]/custprsd", vCustPrsd);
  127. model.setValue(grd_taxchecklist.nodeset + "[" + i + "]/custbizcond", vCustBizcont);
  128. model.setValue(grd_taxchecklist.nodeset + "[" + i + "]/custitem", vCustItem);
  129. for(var j = i+1 ; j < grd_taxchecklist.rows ; j++)
  130. {
  131. if(sEntrregno == grd_taxchecklist.valueMatrix(j, grd_taxchecklist.colRef("entrregno")))
  132. {
  133. grd_taxchecklist.valueMatrix(j, grd_taxchecklist.colRef("validyn")) = "D";
  134. grd_taxchecklist.rowStyle(j, "data", "background-color") = "#99ccff";
  135. model.setValue(grd_taxchecklist.nodeset + "[" + j + "]/custnm", vCustnm);
  136. model.setValue(grd_taxchecklist.nodeset + "[" + j + "]/custaddr", vCustAddr);
  137. model.setValue(grd_taxchecklist.nodeset + "[" + j + "]/custprsd", vCustPrsd);
  138. model.setValue(grd_taxchecklist.nodeset + "[" + j + "]/custbizcond", vCustBizcont);
  139. model.setValue(grd_taxchecklist.nodeset + "[" + j + "]/custitem", vCustItem);
  140. }
  141. }
  142. }
  143. }
  144. return bflag;
  145. }
  146. //========================================================================================
  147. //not null check
  148. //========================================================================================
  149. function fDataCheck()
  150. {
  151. if(grd_taxlist.fixedRows == grd_taxlist.rows)
  152. {
  153. return;
  154. }
  155. var bDataValidFlag = true;
  156. var bflag = true;
  157. for(var i = grd_taxlist.fixedRows ; i < grd_taxlist.rows ; i++)
  158. {
  159. bflag = true;
  160. sGenrdd = grd_taxlist.valueMatrix(i, grd_taxlist.colRef("genrdd"));
  161. if(!isValidDateTime(sGenrdd, "YYYYMMDD"))
  162. {
  163. grd_taxlist.cellStyle("background-color", i, grd_taxlist.colRef("genrdd")) = "#ff0000";
  164. bflag = false;
  165. }
  166. else
  167. {
  168. grd_taxlist.cellStyle("background-color", i, grd_taxlist.colRef("genrdd")) = "#ffff00";
  169. }
  170. if(bflag == false)
  171. {
  172. grd_taxlist.valueMatrix(i, grd_taxlist.colRef("validyn")) = "N";
  173. bDataValidFlag = false;
  174. }
  175. else
  176. {
  177. grd_taxlist.valueMatrix(i, grd_taxlist.colRef("validyn")) = "Y";
  178. }
  179. }
  180. if(bDataValidFlag == true)
  181. {
  182. btn_save.disabled = false;
  183. btn_check.disabled = true;
  184. for(var i = grd_taxlist.fixedRows ; i < grd_taxlist.rows ; i++)
  185. {
  186. grd_taxlist.rowStatus(i) = 1;
  187. }
  188. }
  189. }
  190. //엑셀 입력
  191. function fInputExcel(pGrid)
  192. {
  193. var fileName = window.fileDialog("open", ",", false, "", "xls", "All Files (*.*)|*.*|Excel Files(*.xls)|*.xls");
  194. if(fileName != "")
  195. {
  196. pGrid.loadExcel(fileName, 1, true);
  197. pGrid.deleteRow(1);
  198. for(i = 1; i < pGrid.rows; i++)
  199. {
  200. pGrid.rowStatus(i) = 1;
  201. }
  202. pGrid.refresh();
  203. }
  204. }
  205. ]]>
  206. </script>
  207. </xhtml:head>
  208. <xhtml:body pagewidth="1211" pageheight="784" style="margin-left:8; margin-top:8; margin-right:8; margin-bottom:8; ">
  209. <group id="group1" style="left:0px; top:0px; width:1042px; height:13px; ">
  210. <caption id="caption6" class="tit_1" style="left:0px; top:0px; width:190px; height:14px; ">세금계산서 Excel 입력</caption>
  211. </group>
  212. <group id="group2" scroll="auto" style="left:0px; top:12px; width:1195px; height:753px; ">
  213. <line id="line2" class="line_1" style="x1:0px; y1:9px; x2:1195px; y2:9px; "/>
  214. <datagrid id="grd_taxchecklist" nodeset="/root/hidden/list/taxbillchecklist" caption="계산서구분^구분코드^계산서종류^부가세신고년도^부가세신고기간^신고유형^사업자등록번호^거래처명^주소^대표자^업태^종목^작성일자^공급금액^부가가치세^합계금액^마감여부^고정자산매입구분^매입세액공제여부^비고^사업자발행유형^과세유형^세금계산서발행처^공제받지몫할세액항목^기타공제매입세액항목^내역(면세공급가액)^정산(면세사업확정비율)^정산(기불공제 매입세액)^재계산(경감률)^재계산(중감면세공급가액비율)^유효구분" colwidth="100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100" dataheight="25" ellipsis="true" extendlastcol="scroll" frozencols="4" mergecellsfixedrows="bycolrec" rowheader="update" rowheight="25" rowsep="|" style="left:0px; top:35px; width:1195px; height:240px; ">
  215. <col ref="taxbillflag"/>
  216. <col ref="flagcd"/>
  217. <col ref="taxbillkind"/>
  218. <col ref="addtaxyy"/>
  219. <col ref="addtaxpnt"/>
  220. <col ref="reptkind"/>
  221. <col ref="entrregno"/>
  222. <col ref="custnm"/>
  223. <col ref="custaddr"/>
  224. <col ref="custprsd"/>
  225. <col ref="custbizcond"/>
  226. <col ref="custitem"/>
  227. <col ref="genrdd"/>
  228. <col ref="suplamt"/>
  229. <col ref="valaddtax"/>
  230. <col ref="amt"/>
  231. <col ref="closyn"/>
  232. <col ref="fixasetflag"/>
  233. <col ref="deduyn"/>
  234. <col ref="cmt"/>
  235. <col ref="isskind"/>
  236. <col ref="taxkind"/>
  237. <col ref="isscust"/>
  238. <col ref="nonrcpttax"/>
  239. <col ref="remintax"/>
  240. <col ref="exptsuplamt"/>
  241. <col ref="expttaxrate"/>
  242. <col ref="bfnontax"/>
  243. <col ref="lowrate"/>
  244. <col ref="elvtsubtrrate"/>
  245. <col ref="validyn"/>
  246. </datagrid>
  247. <button id="btn_check" class="btn2_letter2" navindex="-1" style="left:1070px; top:15px; width:42px; height:19px; ">
  248. <caption>검사</caption>
  249. <script type="javascript" ev:event="DOMActivate">
  250. <![CDATA[
  251. fDataCheck();
  252. ]]>
  253. </script>
  254. </button>
  255. <button id="button1" class="btn2_letter7" navindex="-1" style="left:965px; top:15px; width:97px; height:19px; ">
  256. <caption>Excel 불러오기</caption>
  257. <script type="javascript" ev:event="DOMActivate">
  258. <![CDATA[
  259. if(CheckExistCust())
  260. {
  261. // alert(grd_taxchecklist.fixedRows);
  262. // alert(grd_taxchecklist.rows);
  263. // alert(grd_taxchecklist.valueMatrix(0, grd_taxchecklist.colRef("custnm")));
  264. for(var i = grd_taxchecklist.fixedRows ; i < grd_taxchecklist.rows ; i++)
  265. {
  266. model.makeNode(grd_taxlist.nodeset + "[" + i + "]");
  267. model.copyNode(grd_taxlist.nodeset + "[" + i + "]", grd_taxchecklist.nodeset + "[" + i + "]");
  268. model.makeValue(grd_taxlist.nodeset + "[" + i + "]/status", "i");
  269. model.makeValue(grd_taxlist.nodeset + "[" + i + "]/instcd", cmb_instcd.value);
  270. }
  271. }
  272. grd_taxlist.refresh();
  273. ]]>
  274. </script>
  275. </button>
  276. <button id="btn_save" class="btn4_letter2" disabled="true" navindex="-1" style="left:1135px; top:14px; width:56px; height:22px; ">
  277. <caption>저장</caption>
  278. <script type="javascript" ev:event="DOMActivate">
  279. <![CDATA[
  280. fSave();
  281. ]]>
  282. </script>
  283. </button>
  284. <datagrid id="grd_taxlist" nodeset="/root/main/list/taxbilllist" caption="계산서구분^구분코드^계산서종류^부가세신고년도^부가세신고기간^신고유형^사업자등록번호^거래처명^주소^대표자^업태^종목^작성일자^공급금액^부가가치세^합계금액^마감여부^고정자산매입구분^매입세액공제여부^비고^사업자발행유형^과세유형^세금계산서발행처^공제받지몫할세액항목^기타공제매입세액항목^내역(면세공급가액)^정산(면세사업확정비율)^정산(기불공제 매입세액)^재계산(경감률)^재계산(중감면세공급가액비율)^유효구분^상태" colwidth="100,100,100,100,100,100,100,100,100,100,100,100, 100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100" dataheight="25" ellipsis="true" extendlastcol="scroll" frozencols="4" mergecellsfixedrows="bycolrec" rowheader="update" rowheight="25" rowsep="|" style="left:0px; top:281px; width:1195px; height:469px; ">
  285. <col ref="taxbillflag"/>
  286. <col ref="flagcd"/>
  287. <col ref="taxbillkind"/>
  288. <col ref="addtaxyy"/>
  289. <col ref="addtaxpnt"/>
  290. <col ref="reptkind"/>
  291. <col ref="entrregno"/>
  292. <col ref="custnm"/>
  293. <col ref="custaddr"/>
  294. <col ref="custprsd"/>
  295. <col ref="custbizcond"/>
  296. <col ref="custitem"/>
  297. <col ref="genrdd"/>
  298. <col ref="suplamt"/>
  299. <col ref="valaddtax"/>
  300. <col ref="amt"/>
  301. <col ref="closyn"/>
  302. <col ref="fixasetflag"/>
  303. <col ref="deduyn"/>
  304. <col ref="cmt"/>
  305. <col ref="isskind"/>
  306. <col ref="taxkind"/>
  307. <col ref="isscust"/>
  308. <col ref="nonrcpttax"/>
  309. <col ref="remintax"/>
  310. <col ref="exptsuplamt"/>
  311. <col ref="expttaxrate"/>
  312. <col ref="bfnontax"/>
  313. <col ref="lowrate"/>
  314. <col ref="elvtsubtrrate"/>
  315. <col ref="validyn"/>
  316. <col ref="status"/>
  317. </datagrid>
  318. <line id="line1" class="line_1" style="x1:0px; y1:276px; x2:1195px; y2:276px; "/>
  319. <button id="button2" class="btn2_letter9" navindex="-1" style="left:5px; top:15px; width:97px; height:19px; ">
  320. <caption>Excel 출력(오류분)</caption>
  321. <script type="javascript" ev:event="DOMActivate">
  322. <![CDATA[
  323. misfSaveExcel(grd_taxchecklist);
  324. ]]>
  325. </script>
  326. </button>
  327. <button id="button3" class="btn2_letter9" navindex="-1" style="left:127px; top:15px; width:119px; height:19px; ">
  328. <caption>Excel 출력(입력분)</caption>
  329. <script type="javascript" ev:event="DOMActivate">
  330. <![CDATA[
  331. misfSaveExcel(grd_taxlist);
  332. ]]>
  333. </script>
  334. </button>
  335. <select1 id="cmb_instcd" ref="/root/hidden/condition/instcd" class="combo_s_essential" disabled="true" navindex="1" appearance="minimal" style="left:340px; top:15px; width:175px; height:19px; ">
  336. <choices>
  337. <itemset>
  338. <label/>
  339. <value/>
  340. </itemset>
  341. </choices>
  342. </select1>
  343. <caption id="caption7" class="search_name" style="left:251px; top:15px; width:86px; height:17px; ">기 관 :</caption>
  344. </group>
  345. </xhtml:body>
  346. </xhtml:html>