1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
|
<?php $dir = "."; include_once($dir."/_common.php"); include('./include/header.php');
$connect_tax = @mysql_connect($DB_HOSTtax,$DB_USERtax,$DB_PWDtax); @mysql_select_db( $DB_NAMEtax,$connect_tax);
if($eid==''){ alert('e천년경영 로그인 후에 이용가능합니다.',"index.php"); exit; }
$office_info = get_office_info(); // 공급처정보 가져옴
//ck_category_init(); // 첫 사용자 카테고리 초기화
/*$sql = "select * from sale_m "; $res = mysql_query($sql,$connect_e1000y); while($info=mysql_fetch_array($res)){ $sql = "insert into sale_u set pcode = '{$info['code']}', Mid = '{$eid}' "; //_pr($sql); mysql_query($sql,$connect_e1000y); }*/
if($sdate==''){ $sdate = date("Y-m-",time())."01"; } if($edate==''){ $edate = date("Y-m-d",time()); }
$sdate2 = str_replace("-","",$sdate)."000000"; $edate2 = str_replace("-","",$edate)."235959";
$where = "";
if($stx!=''){ if($sti=='a.DMDER_BUSNID_ID'){ $stx = str_replace("-","",$stx); $where .= " and {$sti} = FN_GET_BIZNO('$stx') "; } else { $where .= " and {$sti} = '$stx' "; } }
if($st_mail!=''){ $where .= " and a.EMAIL_CHECK = '{$st_mail}' "; }
if($st_nts!=''){ if(substr($st_nts,0,1) == 'E'){ $v = explode("^",$st_nts); if($v[1]=='SUC001'){ $where .= " and a.SND_STATUS_CD = '{$v[0]}' and s.RESULT_CD = 'SUC001' "; } else if($v[1]=='NULL'){ $where .= " and a.SND_STATUS_CD = '{$v[0]}' and (s.RESULT_CD is NULL or s.RESULT_CD = '') "; } else { $where .= " and a.SND_STATUS_CD = '{$v[0]}' and not (s.RESULT_CD = 'SUC001' or s.RESULT_CD is NULL or s.RESULT_CD = '') "; } } else { $where .= " and a.SND_STATUS_CD = '{$st_nts}' "; } }
if($st_kind!=''){ if(strlen($st_kind)==2){ $where .= " and a.ETAXBIL_CL_CD = '{$st_kind}' "; } else { $where .= " and a.ETAXBIL_CL_CD = '".substr($st_kind,0,2)."' and ETAXBIL_KND_CD = '".substr($st_kind,2,2)."' "; } }
$comp_sn = str_replace("-","",$office_info['comp_sn']);
$sql = "SELECT count(*) as cnt FROM tn_eaaa AS a INNER JOIN tn_aaaa AS t1 ON a.SUPLER_BUSNID_ID = t1.BUSNID_ID INNER JOIN tn_eaab AS b ON a.ETAXBIL_APPV_NO = b.ETAXBIL_APPV_NO and BUSN_KND_CD = '02' LEFT JOIN tn_baab as s ON a.ETAXBIL_APPV_NO = s.ETAXBIL_APPV_NO AND a.SUBMIT_ID = s.SUBMIT_ID WHERE a.ISU_DATE BETWEEN '{$sdate2}' AND '{$edate2}' and t1.BUSNID = '{$comp_sn}' $where "; $result = mysql_query($sql,$connect_tax); $row = mysql_fetch_array($result); $total_count = $row['cnt'];
$list_num = 15; if($_COOKIE['page_line']!=''){ $list_num = $_COOKIE['page_line']; } $total_page = ceil($total_count / $list_num); // 전체 페이지 계산 if ($page < 1) { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지) $from_record = ($page - 1) * $list_num; // 시작 열을 구함
$sql = "SELECT a.ETAXBIL_CL_CD, a.ETAXBIL_KND_CD, a.ETAXBIL_APPV_NO, a.WRITE_DT, a.ISU_DATE, a.SND_DT, DECODE(b.BUSNID,'12345678') AS BUSNID, b.SUB_BD_NO , DECODE(b.TRADE_NM,'12345678') AS TRADE_NM, DECODE(b.CHIEF_NM,'12345678') AS CHIEF_NM, DECODE(a.SUP_AMT_SM,'12345678') AS SUP_AMT_SM, DECODE(a.TX_SM,'12345678') AS TX_SM, DECODE(a.TOT_AMT,'12345678') AS TOT_AMT , a.SND_STATUS_CD, a.EMAIL_SND_YN, a.EMAIL_CHECK, a.ETAXBIL_CL_CD , b.MAIN_TX_OFFCR_EMAIL_ADDR, b.BUSN_KND_CD, s.RESULT_CD, p.THNG_NM, a.ETAXBIL_NOTE, a.ETAXBIL_RVS_CS_CD, a.SRVC_BUSN_MGMT_NO
FROM tn_eaaa AS a INNER JOIN tn_aaaa AS t1 ON a.SUPLER_BUSNID_ID = t1.BUSNID_ID INNER JOIN tn_eaab AS b ON a.ETAXBIL_APPV_NO = b.ETAXBIL_APPV_NO and BUSN_KND_CD = '02' LEFT JOIN tn_baab as s ON a.ETAXBIL_APPV_NO = s.ETAXBIL_APPV_NO AND a.SUBMIT_ID = s.SUBMIT_ID left join tn_eaac as p on a.ETAXBIL_APPV_NO = p.ETAXBIL_APPV_NO and p.THNG_SEQNO = '1' WHERE a.ISU_DATE BETWEEN '{$sdate2}' AND '{$edate2}' and t1.BUSNID = '{$comp_sn}' $where
order by a.ETAXBIL_APPV_NO DESC limit $from_record, $list_num "; $result = mysql_query($sql,$connect_tax);
//_pr($sql); while($cus_info=mysql_fetch_array($result)){ $list_array[] = $cus_info; }
//_pr($list_array);
$qstr = $_SERVER['QUERY_STRING'];
$sql = "select a.code, a.comp_name from customers a where 1=1 and (a.biztype = 1 or a.biztype = 2) order by comp_name"; $result = mysql_query($sql,$connect_e1000y); while($cus_info=mysql_fetch_array($result)){ $comp_array[] = $cus_info; }
@mysql_close($connect_tax);
?> <style> .order-sheet2 { font-size:0.9em; } .bigo_class { font-size:0.8em; line-height:20px !important; } </style> <!--<div id="contents" style="background:#999"><img src="http://placehold.it/960x150" alt="롤링배너"></div>--> <div id="contents" style="height:2px;border-bottom:1px solid #eee;background:#2f6ba9"> <span class="screen_out">header 하단 선</span> </div>
<div id="wrap"> <div id="sub-title"> <h2>세금계산서</h2> <div class="sub-location"> <a href="./index.php" class="home"><span class="screen_out">홈</span></a> <span class="location-gt"></span> <a>세금계산서</a> <span class="location-gt"></span> <a>세금계산서 리스트</a> </div> </div> <form name='tax_search_form' method='get'> <input type='hidden' name='biztype' size='' value='<?php echo $biztype;?>'> <input type='hidden' name='smode' size='' value='<?php echo $smode;?>'> <div id="sub-contents-area"> <div class="sub-btn-area"> <div class="sub-btn"> <a class="lignt-blue-btn" id='btn_nts_send'>국세청전송</a><a class="blue-btn" id='btn_send_cancel'>전송취소</a><a class="blue-btn" id='btn_resend_email'>e메일재전송</a><a class="lignt-blue-btn" id='btn_nts_xml'>XML다운</a><a class="lignt-blue-btn" id='btn_nts_edit' style='width:120px;'>수정계산서 발행</a><a class="gray-btn" id='xls_down'>엑셀</a> </div> </div> <div class="sub-btn-area"> <div class="sub-btn sub-btn-search" style='width:1200px;margin-left:0px;'> 라인수 <?php echo paging_select($list_num);?> <!--<a class='blue-btn sum_btn_class'>집계</a> <a class='gray-btn detail_btn_class'>상세</a> --> 기간 : <input type='text' name='sdate' id='sdate' value='<?php echo $sdate;?>' class='width_80'> ~ <input type='text' name='edate' id='edate' value='<?php echo $edate;?>' class='width_80'> <select name='st_mail'> <option value='' <?php if($st_mail==''){?>selected<?php }?>>메일전체</option> <option value='0' <?php if($st_mail=='0'){?>selected<?php }?>>미확인</option> <option value='3' <?php if($st_mail=='3'){?>selected<?php }?>>수신확인</option> </select> <select name='st_nts'> <option value='' <?php if($st_nts==''){?>selected<?php }?>>국세청상태</option> <option value='I' <?php if($st_nts=='I'){?>selected<?php }?>>미전송</option> <option value='S' <?php if($st_nts=='S'){?>selected<?php }?>>전송요청</option> <option value='E^NULL' <?php if($st_nts=='E^NULL'){?>selected<?php }?>>접수중</option> <option value='E^SUC001' <?php if($st_nts=='E^SUC001'){?>selected<?php }?>>전송성공</option> <option value='E^' <?php if($st_nts=='E^'){?>selected<?php }?>>전송실패</option> <option value='D' <?php if($st_nts=='D'){?>selected<?php }?>>전송취소</option> </select> <select name='st_kind'> <option value='' <?php if($st_kind==''){?>selected<?php }?>>계산서종류</option> <option value='0101' <?php if($st_kind=='0101'){?>selected<?php }?>>과세</option> <option value='03' <?php if($st_kind=='03'){?>selected<?php }?>>면세</option> <option value='0102' <?php if($st_kind=='0102'){?>selected<?php }?>>영세</option> <option value='0201' <?php if($st_kind=='0201'){?>selected<?php }?>>수정과세</option> <option value='04' <?php if($st_kind=='04'){?>selected<?php }?>>수정면세</option> <option value='0202' <?php if($st_kind=='0202'){?>selected<?php }?>>수정영세</option> </select> <select name='sti' style='width:130px;'> <option value='a.DMDER_BUSNID_ID' <?php if($sti=='a.comp_name'){?>selected<?php }?>>거래처사업자번호</option> <option value='a.ETAXBIL_APPV_NO' <?php if($sti=='a.code1'){?>selected<?php }?>>승인번호</option> <option value='a.SRVC_BUSN_MGMT_NO' <?php if($sti=='a.comp_sn'){?>selected<?php }?>>관리번호</option> </select> <input type='text' id='stx' name='stx' size='' value='<?php echo $stx;?>' class="stx_class"> <a href="#" class="black-btn" id='search_btn_press'>검색</a> </div> </div> </div> </form> <div class="item_tab"> <div class="item_tab_navi"> <a value='0' ><span>발행대기건</span></a> <a value='1' ><span>발행내역건</span></a> <a value='2' class="on"><span>국세청발행내역</span></a> </div> </div>
<form name='tax_list_form' method='post'> <input type='hidden' name='sel_mode' value='sum'> <input type='hidden' name='sdate' value='<?php echo $sdate?>'> <input type='hidden' name='edate' value='<?php echo $edate?>'> <input type='hidden' name='RequestCode' value=''> <input type='hidden' name='new_email' value=''> <input type="hidden" name="edit_type" id="edit_type" value=""> <div class="div-list-area"> <div class="cust-list-area"> <table class="order-sheet2"> <caption class="screen_out">매출처 원장 조회<caption> <colgroup> <col style="width:30px;"> <col style="width:80px;"><col style="width:80px;"><col style="width:80px;"> <col style="width:90px;"><col style="width:90px;"><col style="width:90px;"> <col style="width:120px;"><col style="width:80px;"> <col style="width:90px;"><col style="width:50px;"><col style="width:140px;"> <col style="width:90px;"><col style="width:80px;"><col style="width:100px;"> <col style="width:80px;"><col style="width:400px;"> <col style="width:150px;"><col style="width:180px;"><col style="width:180px;"> </colgroup>
<thead> <tr> <th scope="col"><input type='checkbox' name='ck_all' class='check_all_class'></th> <th scope="col">작성일자</th><th scope="col">발행일자</th><th scope="col">전송일자</th> <th scope="col">처리결과</th><th scope="col">계산서구분</th><th scope="col">메일수신</th> <th scope="col">회사명</th><th scope="col">대표자</th> <th scope="col">사업자번호</th><th scope="col">종사업장</th><th scope="col">거래내용</th> <th scope="col">공급가액</th><th scope="col">부가세</th><th scope="col">합계금액</th> <th scope="col">수정사유</th><th scope="col">비고</th> <th scope="col">e메일</th><th scope="col">승인번호</th><th scope="col">관리번호</th> </tr> </thead> <tbody> <?php for($i=0;$i<count($list_array);$i++){ $info = $list_array[$i]; $info = array_utf8($info); $s_posi = ""; $c_posi = ""; $e_posi = ""; $m_posi = "";
$WRITE_DT = substr($info['WRITE_DT'],0,4)."-".substr($info['WRITE_DT'],4,2)."-".substr($info['WRITE_DT'],6,2); $ISU_DATE = substr($info['ISU_DATE'],0,4)."-".substr($info['ISU_DATE'],4,2)."-".substr($info['ISU_DATE'],6,2); $SND_DT = substr($info['SND_DT'],0,4)."-".substr($info['SND_DT'],4,2)."-".substr($info['SND_DT'],6,2); if($info[ETAXBIL_CL_CD] == "01" && $info[ETAXBIL_KND_CD] == "01"){ // 계산서구분 처리 $tax_type_btn = "<input type='button' name='statebt' class='blue1' value='일반'>"; } else if($info[ETAXBIL_CL_CD] == "03"){ $tax_type_btn = "<input type='button' name='statebt' class='orange1' value='면세'>"; } else if($info[ETAXBIL_CL_CD] == "01" && $info[ETAXBIL_KND_CD] == "02"){ $tax_type_btn = "<input type='button' name='statebt' class='green1' value='영세'>"; } else if($info[ETAXBIL_CL_CD] == "02" && $info[ETAXBIL_KND_CD] == "01"){ $tax_type_btn = "<input type='button' name='statebt' class='blue1' value='일반수정'>"; } else if($info[ETAXBIL_CL_CD] == "04"){ $tax_type_btn = "<input type='button' name='statebt' class='orange1' value='면세수정'>"; } else if($info[ETAXBIL_CL_CD] == "02" && $info[ETAXBIL_KND_CD] == "02"){ $tax_type_btn = "<input type='button' name='statebt' class='green1' value='영세수정'>"; } if($info[SND_STATUS_CD]=='E'){ // 처리결과처리 if($info[RESULT_CD]==NULL || $info[RESULT_CD]==''){ $taxstate = "<input type='button' name='statebt' class='green1' value='접수중'>"; $e_posi = "Y"; $m_posi = "Y"; // 이메일,수정 가능 } else if($info[RESULT_CD]=='SUC001'){ $taxstate = "<input type='button' name='statebt' class='blue1' value='전송성공'>"; $e_posi = "Y"; $m_posi = "Y"; // 이메일, 수정 가능 } else { $taxstate = "<input type='button' name='statebt' class='red1 show_errorview' value='전송실패 {$info[RESULT_CD]}'>"; $c_posi = "Y"; // 취소가능 } } else if($info[SND_STATUS_CD]=='S'){ $taxstate = "<input type='button' name='statebt' class='green1' value='전송요청'>"; $e_posi = "Y"; $m_posi = "Y"; // 이메일,수정 가능 } else if($info[SND_STATUS_CD]=='I'){ $taxstate = "<input type='button' name='statebt' class='green1' value='미전송'>"; $s_posi = "Y"; $c_posi = "Y"; $e_posi = "Y"; // 전송가능, 취소가능, 이메일가능 } else if($info[SND_STATUS_CD]=='D'){ $taxstate = "<input type='button' name='statebt' class='black1' value='전송취소'>"; } if($info[EMAIL_CHECK] == "0"){ $emailstate ="<input type='button' name='statebt' class='blue1' value='미확인'>"; } else if($info[EMAIL_CHECK] == "1"){ $emailstate ="<input type='button' name='statebt' class='green1' value='미개봉'>"; } else if($info[EMAIL_CHECK] == "2"){ $emailstate ="<input type='button' name='statebt' class='orange1' value='개봉'>"; } else if($info[EMAIL_CHECK] == "3"){ $emailstate ="<input type='button' name='statebt' class='red1' value='수신확인'>"; } else if($info[EMAIL_CHECK] == "4"){ $emailstate ="<input type='button' name='statebt' class='blue1' value='반송요청'>"; } else if($info[EMAIL_CHECK] == "5"){ $emailstate ="<input type='button' name='statebt' class='green1' value='반송확인'>"; }
if($info['ETAXBIL_RVS_CS_CD']=='01'){ $ch_reason = "기재사항 착오"; } else if($info['ETAXBIL_RVS_CS_CD']=='06'){ $ch_reason = "이중발행 정정"; } else if($info['ETAXBIL_RVS_CS_CD']=='02'){ $ch_reason = "공급가액 차감"; } else if($info['ETAXBIL_RVS_CS_CD']=='03'){ $ch_reason = "재화환입"; } else if($info['ETAXBIL_RVS_CS_CD']=='04'){ $ch_reason = "계약의 해제"; } else if($info['ETAXBIL_RVS_CS_CD']=='05'){ $ch_reason = "내국신용장"; } ?> <tr style='height:40px;' id='xxx_<?php echo $i?>'> <td class="tcenter "> <input type='checkbox' name='code_idx[]' value='<?php echo $i;?>'> <input type='hidden' name='appv_no_list[]' value='<?php echo $info['ETAXBIL_APPV_NO'];?>'> <input type='hidden' name='mgmt_no_list[]' value='<?php echo $info['SRVC_BUSN_MGMT_NO'];?>'> <input type='hidden' name='comp_sn_list[]' value='<?php echo $info['BUSNID'];?>'> <input type='hidden' name='isu_date_list[]' value='<?php echo $info['ISU_DATE'];?>'> <input type='hidden' name='send_do_posi[]' value='<?php echo $s_posi;?>'> <input type='hidden' name='cancel_do_posi[]' value='<?php echo $c_posi;?>'> <input type='hidden' name='email_do_posi[]' value='<?php echo $e_posi;?>'> <input type='hidden' name='edit_do_posi[]' value='<?php echo $m_posi;?>'> <input type='hidden' name='email[]' value='<?php echo $info['MAIN_TX_OFFCR_EMAIL_ADDR'];?>'> </td> <td class="tcenter "><?php echo $WRITE_DT;?></td> <td class="tcenter "><?php echo $ISU_DATE;?></td> <td class="tcenter "><?php echo $SND_DT;?></td> <td class="tcenter"><?php echo $taxstate;?></td> <td class="tcenter"><?php echo $tax_type_btn;?></td> <td class="tcenter"><?php echo $emailstate;?></td> <td class="linetxt click_edit"><?php echo $info['TRADE_NM'];?></td> <td class="tcenter "><?php echo $info['CHIEF_NM'];?></td> <td class="tcenter "><?php echo $info['BUSNID'];?></td> <td class="tcenter "><?php echo $info['SUB_BD_NO'];?></td> <td class="linetxt "><?php echo $info['THNG_NM'];?></td> <td class="cost "><?php echo number_format($info['SUP_AMT_SM']);?></td> <td class="cost "><?php echo number_format($info['TX_SM']);?></td> <td class="cost "><?php echo number_format($info['TOT_AMT']);?></td> <td class="tcenter "><?php echo $ch_reason;?></td> <td class="tcenter bigo_class"><?php echo $info['ETAXBIL_NOTE'];?></td> <td class="linetxt "><?php echo $info['MAIN_TX_OFFCR_EMAIL_ADDR'];?></td> <td class="tcenter "><?php echo $info['ETAXBIL_APPV_NO'];?></td> <td class="tcenter "><?php echo $info['SRVC_BUSN_MGMT_NO'];?></td> </tr> <?php } ?> </tbody> </table> </div> </div> </form>
<div class='pg_wrap' style='padding-top:0px;'> <?php echo get_paging($list_num, $page, $total_page, "?$qstr");?> </div>
</div><!--//wrap-->
<script> var qstr = '<?php echo $qstr;?>'; $(function(){ $(".item_tab_navi a").click(function(){ //네비게이션 탭 처리 v = $(this).attr("value"); if(v==0){ document.location.href="./taxbill.php"; } else if(v==1){ document.location.href="./taxbill_detail.php?smode=comp"; } else if(v==2){ document.location.href="./taxbill_nts.php"; } });
$(".click_edit").css("cursor","pointer").click(function(){ // 전표상세보기 수정 var code = $(this).closest("tr").find("input[name='appv_no_list[]']").val(); $.get("taxbill_nts_reg.inc.php?code="+code,function(rtn){ $("#modal_member_box").html(rtn).dialog({ resizable: true, height:650, width:740, modal: true, title: "국세청발행내역 [보기]", buttons: { 닫기: function() { $(this).dialog( "close" ); } } }); }); });
$(".check_all_class").click(function(){ // 전체선택 전체선택 해제 if($(this).is(":checked")){ $("input[name='code_idx[]']").prop("checked",true); } else { $("input[name='code_idx[]']").prop("checked",false); } });
$("select[name='st_mail'], select[name='st_nts'], select[name='st_kind']").change(function(){ // 검색 select 변경만해도 검색되게 처리 $("#search_btn_press").click(); });
$("#xls_down").click(function(){ // 엑셀다운로드 document.tax_search_form.action='taxbill_nts_xls_down.php'; document.tax_search_form.target = '_blank'; document.tax_search_form.submit(); document.tax_search_form.action='?'; document.tax_search_form.target = ''; });
$("#search_btn_press").click(function(){ // 검색버튼 누를때 document.tax_search_form.action='?'; document.tax_search_form.target = ''; document.tax_search_form.submit(); });
$(".stx_class").keypress(function(){ if(event.keyCode==13) { $("#search_btn_press").click(); } });
$("#btn_nts_xml").click(function(){ // XML다운로드 var ck_cnt = $("input[name='code_idx[]']:checked").size(); if(ck_cnt==0){ alert('XML다운로드를 할 계산서를 선택하시기 바랍니다.'); return; } if(ck_cnt>1){ alert('XML다운로드는 1건씩만 가능합니다.'); return; }
document.tax_list_form.action='taxbill_xml_down.php'; document.tax_list_form.target = '_blank'; document.tax_list_form.submit(); document.tax_list_form.action='?'; document.tax_list_form.target = ''; });
$("#btn_nts_edit").click(function(){ // 수정 세금계산서 발행 var ck_cnt = $("input[name='code_idx[]']:checked").size(); if(ck_cnt==0){ alert('수정할 계산서를 선택하시기 바랍니다.'); return; } if(ck_cnt>1){ alert('수정세금계산서는 1건씩만 가능합니다.'); return; } $this = $("input[name='code_idx[]']:checked").eq(0); $tr_obj = $this.closest("tr"); $edit_do_posi = $tr_obj.find("input[name='edit_do_posi[]']").val(); if($edit_do_posi!='Y'){ alert('[전송중],[접수중]이거나 [전송완료]된 계산서만 수정계산서 발급 가능합니다.'); return; }
$.get("taxbill_edit_reg.inc.php",function(rtn){ $("#modal_member_box").html(rtn).dialog({ resizable: true, height:600, width:820, modal: true, title: "수정세금계산서 종류 [선택]", buttons: { 닫기: function() { $(this).dialog( "close" ); } } }); }); });
$("#btn_nts_send").click(function(){ // 국세청 전송 var ck_cnt = 0; var posi_cnt = 0; $("input[name='code_idx[]']").each(function(){ if($(this).is(":checked")==true){ $tr_obj = $(this).closest("tr"); if($tr_obj.find("input[name='send_do_posi[]']").val()=='Y'){ posi_cnt++; } ck_cnt++; } }); if(ck_cnt==0){ alert('국세천전송할 항목을 선택하시기 바랍니다.'); return; } if(ck_cnt>posi_cnt){ alert('국세청 전송상태가 [미전송]인 상태만 국세청 전송이 가능합니다.'); return; }
if(confirm('정말로 국세청으로 바로 전송 하시겠습니까?')){ $("input[name='RequestCode']").val("02"); // 국세청 전송 코드 tax_nts_process(); } });
$("#btn_send_cancel").click(function(){ // 전송취소 var ck_cnt = 0; var posi_cnt = 0; $("input[name='code_idx[]']").each(function(){ if($(this).is(":checked")==true){ $tr_obj = $(this).closest("tr"); if($tr_obj.find("input[name='cancel_do_posi[]']").val()=='Y'){ posi_cnt++; } ck_cnt++; } }); if(ck_cnt==0){ alert('전송취소할 항목을 선택하시기 바랍니다.'); return; } if(ck_cnt>posi_cnt){ alert('국세청 전송상태가 [미전송]이나 [전송실패]인 자료만 전송취소 가능합니다.'); return; } if(confirm('정말로 전송취소 하시겠습니까?')){ $("input[name='RequestCode']").val("04"); // 취소 코드 tax_nts_process(); } });
$("#btn_resend_email").click(function(){ // e메일 재전송 var ck_cnt = 0; var posi_cnt = 0; var tmp_comp_sn = ""; var comp_diff = "N"; $("input[name='code_idx[]']").each(function(){ if($(this).is(":checked")==true){ $tr_obj = $(this).closest("tr"); if($tr_obj.find("input[name='email_do_posi[]']").val()=='Y'){ posi_cnt++; } if(tmp_comp_sn==''){ tmp_comp_sn = $tr_obj.find("input[name='comp_sn_list[]']").val(); } else if(tmp_comp_sn!=$tr_obj.find("input[name='comp_sn_list[]']").val()){ comp_diff = "Y"; } new_email = $tr_obj.find("input[name='email[]']").val() ck_cnt++; } }); if(ck_cnt==0){ alert('e메일 재전송할 항목을 선택하시기 바랍니다.'); return; } if(ck_cnt>posi_cnt){ alert('국세청 전송상태가 [미전송]이나 [전송완료일]인 e메일재전송 가능합니다.'); return; } if(comp_diff=='Y'){ alert('e메일 재전송은 같은 업체만 선택하셔서 보낼수 있습니다.'); return; }
$("input[name='old_email']").val(new_email); $(".change-pwd-container").fadeIn(); });
$(document).on("click",".tax_edit_close",function(){ // 수정게산서 팝업 닫기 $("#modal_member_box").dialog("close"); });
$(document).on("click",".tax_edit_close2",function(){ // 수정게산서 팝업 닫기 $("#modal_member_box2").dialog("close"); });
});
function tax_nts_process(){ // 세금계산서 처리
var form_data = $("form[name='tax_list_form']").serialize();
$.ajax({type:"post", url:"ajax.tax_nts_process.php", data:form_data, async:false, dataType : "xml", success:function(xml){ var v_mode = $(xml).find("mode").text(); var v_mode_ok = $(xml).find("mode_ok").text(); var v_msg = $(xml).find("msg").text(); var v_file_name = $(xml).find("file_name").text(); if(v_mode_ok!='Y'){ alert(v_msg); } else { document.location.reload(); } }, error:function(rtn,status,error){ alert(error); } }); }
function tax_remail_proc(){ // e메일 재전송 처리 alert('asdasd'); var n_email = $("input[name='old_email']").val(); $("input[name='new_email']").val(n_email); $("input[name='RequestCode']").val("03"); // e메일 재전송 코드
tax_nts_process();
}
</script> <?php include('./include/footer.php'); ?> <div id="modal_member_box" title="1차모달" style="display:;width:100%; height:100%; padding-top:3px;padding-left:3px;background-color:#FFFFFF;position:relative;"></div> <div id="modal_member_box2" title="2차모달" style="display:none;width:100%; height:100%; padding-top:3px;padding-left:3px;background-color:#FFFFFF;position:relative;"></div> <?php include("taxbill_email.inc.php");?>
|