/home/mjc1/public_html/emillennium/curl_send_soap_process.php


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
<?php include("./_common.php"); ?>
<?php header
("Content-type:text/html;charset=utf-8"); ?>
<?php

$connect_tax    
= @mysql_connect($DB_HOSTtax,$DB_USERtax,$DB_PWDtax);
@
mysql_select_db$DB_NAMEtax,$connect_tax);    

Require_once(
'./nusoap/lib/nusoap.php');

if(
$_REQUEST['eid2']==''){
    
$res_msg "error:5:e천년경영 로그인 후에 이용가능합니다.";
    echo 
$res_msg; exit;
}

$all_sql "";

$rSMScheck $_REQUEST['rSMScheck'];

/* 수정계산서시 넘어와야할 변수 */
$ChangeReason $_REQUEST['ChangeReason'];
$ChangeBillAPPV $_REQUEST['ChangeBillAPPV'];
$ChangeBillDate $_REQUEST['ChangeBillDate'];
/* 수정계산서시 넘어와야할 변수 끝 */

$m_nBillPubCodeCnt 0;
$ServiceProcess "DocumentService";
$tstamp date("Ymd_His",time());

function 
add_zero($v,$len){
    
$tmp "";
    for(
$i=$len;$i>strlen($v);$i--){
        
$tmp .= "0";
    }
    return 
$tmp.$v;
}

function 
CreateMessageID(){
    
$datetime date("YmdHis",time())."000-";
    
$rand32 "";
    for(
$i=0;$i<32;$i++){
        
$rand rand(1,15);
        if(
$rand<10){ $rand32.=$rand; }
        else {
            
$rand32.=dechex($rand);
        }
    }
    return 
$datetime.$rand32;

}

function 
make_SubmitID($biz_num=""){
    
$todaydate date("Ymd",time());
    
//if($biz_num==""){ $biz_num = "5021894746"; }
    
$rand23 "";
    for(
$i=0;$i<23;$i++){
        
$rand rand(1,15);
        if(
$rand<10){ $rand23.=$rand; }
        else {
            
$rand23.=dechex($rand);
        }
    }
    return 
$todaydate.$biz_num.$rand23;
}

function 
GetEBillPubCode($biz_num="",$sUserCode="00"){
    Global 
$m_nBillPubCodeCnt;
    Global 
$connect_tax;

    
$todaydatetime date("ymdHi",time());
    
//if($biz_num==""){ $biz_num = "5021894746"; }
    
$sUserCode $sUserCode// 사용자 코드

    
$pubcode $todaydatetime.$biz_num.$sUserCode;

    
$sql "select max(SRVC_BUSN_MGMT_NO) as num from tn_eaaa where SRVC_BUSN_MGMT_NO like '{$pubcode}%' ";
    
$res mysql_query($sql,$connect_tax);
    
$info mysql_fetch_array($res);

    if(
$info['num']!=''){
        
$pubcodeseq substr($info['num'],22,2);
        
$pubcodeseq = ($pubcodeseq*1)+1;
    } else {
        
$pubcodeseq $m_nBillPubCodeCnt+1;
    }
    
$newseq add_zero($pubcodeseq,2);

    return 
$todaydatetime.$biz_num.$sUserCode.$newseq;
}

$tax_code $_REQUEST['tax_code'];

if(
$ChangeReason!=''){
    if(
$ChangeBillAPPV==''){
        
$res_msg "error:5:변경코드는 있는데 변경원장 appv_no가 없습니다.";
        echo 
$res_msg; exit;
    }
}

    
$sql "select * from offices where 1=1 limit 1";
    
$res mysql_query($sql,$connect_e1000y); $all_sql .= $sql;
    
$office_info mysql_fetch_array($res);
    
$biz_num trim(str_replace("-","",$office_info['comp_sn']));

    if(
$office_info['comp_sn']!=''){

        
$sql "select a.*, b.sum_amt, b.sum_vat
                    from sale_tax_m a left join (select midx, sum(sup_amt) as sum_amt, sum(vat) as sum_vat from sale_tax_d 
                    where midx = '
{$tax_code}' group by midx) b on a.midx = b.midx where a.midx = '{$tax_code}' ;         "// 메인정보
        
$res mysql_query($sql,$connect_e1000y); $all_sql .= $sql;
        
$tax_m_info mysql_fetch_array($res);
        
$ccode $tax_m_info['ccode'];
        if(
$tax_m_info['midx']!=''){ 

            if(
$tax_m_info['tax_type']==&& $ChangeReason==''){     $tax_type1='01'$tax_type2='01'; } // 과세 첫발행
            
if($tax_m_info['tax_type']==&& $ChangeReason!=''){     $tax_type1='02'$tax_type2='01'; } // 과세 수정발행
            
if($tax_m_info['tax_type']==&& $ChangeReason==''){     $tax_type1='03'$tax_type2='01'; } // 면세 첫발행
            
if($tax_m_info['tax_type']==&& $ChangeReason!=''){     $tax_type1='04'$tax_type2='01'; } // 면세 수정발행
            
if($tax_m_info['tax_type']==&& $ChangeReason==''){     $tax_type1='01'$tax_type2='02'; } // 영세 첫발행
            
if($tax_m_info['tax_type']==&& $ChangeReason!=''){     $tax_type1='02'$tax_type2='02'; } // 영세 수정발행

            
$sql "select * from sale_tax_d where midx = '$tax_code'"// 상품정보
            
$res mysql_query($sql,$connect_e1000y);
            
$res_num mysql_num_rows($res);
            if(
$res_num>0){
                while(    
$tax_d_info mysql_fetch_array($res)){
                    if(
strlen($tax_d_info['dealdate'])!=10){ 
                        
$res_msg "error:5:거래일자의 자릿수에 문제가 있습니다. {$tax_d_info['dealdate']}";
                        echo 
$res_msg; exit; 
                    }
                    
$tax_d_array[] = $tax_d_info;
                }

                
$sql "select * from customers where code = '$ccode' "// 공급받는자 정보
                
$res mysql_query($sql,$connect_e1000y);
                
$tax_c_info mysql_fetch_array($res);
                if(
$tax_c_info['code']!=''){

/* 변수 정리 구간 */
                    
$SubmitID  make_SubmitID($biz_num);
                    
$iCount 1;
                    
$PubCode GetEBillPubCode($biz_num);
                    
$IssueDateTime1 date("YmdHis",time()); // 발행일자
                    
if($rSMScheck=='on'){
                        
$m_sAppcode "160704000200T"// 뭔지모르겠음 SMSSend보내기 "T", "F"
                    
} else {
                        
$m_sAppcode "160704000200F"// 뭔지모르겠음 SMSSend보내기 "T", "F"
                    
}
                    
$IssueStatus "S"//발행초기값: I-무시, S-발행
                    
$debud_mode "Y"// 삭제 재발행모드를 위해서 I 모드로 기본으로 가기로 함
                    
if($debud_mode=="Y"){ // 개발자 모드에서는 국세청에 전송하지 않습니다.
                        
$SendStatus "I"//국세청 전송 초기값: I-무시, S-전송
                    
} else {
                        
$SendStatus "S";
                    }
                    
$SendEmail "N"//이메일 전송 초기값: Y-무시, N-전송 (코드값과 의미가 반대임을 주의)

                    
$DescriptionText $tax_m_info['remarks']; // 수정사유 비고

                    
if($ChangeReason!=''){
                        if(
$ChangeReason=='01' || $ChangeReason=='06'){ // 01   기재사항 착오 06   이중발행 정정

                        
} else if($ChangeReason=='02' || $ChangeReason=='03'){  // 02 공급가액 차감 03   재화환입
                            
$DescriptionText "당초 작성일자 ({$ChangeBillDate})";
                        } else if(
$ChangeReason=='04'){ // 04   계약의 해제
                            
$DescriptionText "당초 작성일자 ({$ChangeBillDate})";
                        } else if(
$ChangeReason=='05'){ // 05   내국신용장

                        
}
                        
$ChangeBillAPPV2 substr($ChangeBillAPPV,0,8)."-".substr($ChangeBillAPPV,8,8)."-".substr($ChangeBillAPPV,16,8);
                        
$DescriptionText $DescriptionText."당초 승인번호 ({$ChangeBillAPPV2})";                        
                    }

                    
$DescriptionText_xml "";
                    if(
$DescriptionText!=''){
                        
$DescriptionText_xml "<DescriptionText>{$DescriptionText}</DescriptionText>";
                    }

                    if(
$ChangeReason!=''){
                        
$AmendmentStatusCode_xml "<AmendmentStatusCode>{$ChangeReason}</AmendmentStatusCode>";
                        
$OriginalIssueID_xml "<OriginalIssueID>{$ChangeBillAPPV}</OriginalIssueID>";
                    }

                    
$IssueDateTime2 str_replace("-","",$tax_m_info['writedate']); // 작성일자

                    
$TaxType $tax_type1.$tax_type2//01,02 과세 03,04 면세 그리고 4자리 되어야함 0101 db select 시엔 tn_eaaa테이블의 ETAXBIL_CL_CD필드와 ETAXBIL_KND_CD의 합임..2자리식 4자리
                    
if($tax_m_info['recved_yn']=='0')
                        
$DemandTag '02'// 01 영수, 02 청구 구분
                    
} else if($tax_m_info['recved_yn']=='1'){
                        
$DemandTag '01'// 01 영수, 02 청구 구분
                    
}

                    
$sCompanyNum str_replace("-","",$office_info['comp_sn']); //"5021894746";
                    
$sCompanyName $office_info['comp_name']; //"MJSOFT";
                    
$sChiefName $office_info['ceo_name']; //"박성원";
                    
$sPerson $office_info['tax_charge_name']; //"박성원";
                    
$sEmail $office_info['tax_charge_email']; //"ryunen@chol.com";
                    
$sPhone $office_info['tax_charge_hpno']; //"010";
                    
$sCompanyAddr $office_info['addr_m']." ".$office_info['addr_d']; //"서울 송파구 오금동 46-9";
                    
$sUptae $office_info['biz_status']; //"도소매";
                    
$sJongmok $office_info['biz_item']; //"일반의약품";
                    
$sSubcode $office_info['sub_comp_sn']; //공급자 종사업자코드;

                    
$rCompanyNum str_replace("-","",$tax_c_info['comp_sn']); //"5021894746";
                    
$rCompanyName $tax_c_info['comp_name']; //"미진유통";
                    
$rChiefName $tax_c_info['ceo_name']; //"이미진";
                    
$rPerson $tax_c_info['tax_charge_name']; //"박성원";
                    
$rEmail $tax_c_info['tax_charge_email']; //"ryunen@chol.com";
                    
$rPhone $tax_c_info['tax_charge_hpno']; //"010-9357-0525";
                    
$rCompanyAddr $tax_c_info['addr_m']." ".$tax_c_info['addr_d']; //"서울 강동구 천호3동 223-3334445";
                    
$rUptae $tax_c_info['biz_status']; //"도소매2";
                    
$rJongmok $tax_c_info['biz_item']; //"일반의약품2";
                    
$rSubcode $tax_c_info['sub_comp_sn']; //받는자 종사업자코드;

                    
$BusinessTypeCode "01"// 01(사업자등록번호),02(주민등록번호), 03(외국인)

                    
$totalprice $tax_m_info['sum_amt'];
                    
$billprice $tax_m_info['sum_vat'];
                    
//면세(일반 계산서)와 수정 계산서의 경우에는 세액합계를 표기하지 않음
                    //echo $TaxType."-".$billprice;
                    
if($TaxType=='0101' || $TaxType=='0201'){
                        
$totaltax $billprice;
                    } else {
                        
$totaltax 0;
                    }
                    
$sumprice $totalprice+$totaltax;

                    
$item_xml "";
                    for(
$i=0;$i<count($tax_d_array);$i++){
                        
$seqnum $i+1;
                        
// $tax_d_array[$i]['dealdate'] <- 거래일자
                        
$tax_d_array[$i]['dealdate'] = str_replace("-","",$tax_d_array[$i]['dealdate']);
                        
$item_xml .= "<TaxInvoiceTradeLineItem>
                                            <SequenceNumeric>
{$seqnum}</SequenceNumeric>
                                            <InvoiceAmount>
{$tax_d_array[$i]['sup_amt']}</InvoiceAmount>
                                            <ChargeableUnitQuantity>
{$tax_d_array[$i]['qty']}</ChargeableUnitQuantity>
                                            <NameText>
{$tax_d_array[$i]['pname']}</NameText>
                                            <InformationText>
{$tax_d_array[$i]['pnorm']}</InformationText>
                                            <PurchaseExpiryDateTime>
{$tax_d_array[$i]['dealdate']}</PurchaseExpiryDateTime>
                                            <DescriptionText>
{$tax_d_array[$i]['remarks']}</DescriptionText>
                                            <TotalTax>
                                                <CalculatedAmount>
{$tax_d_array[$i]['vat']}</CalculatedAmount>
                                            </TotalTax>
                                            <UnitPrice>
                                                <UnitAmount>
{$tax_d_array[$i]['price']}</UnitAmount>
                                            </UnitPrice>
                                        </TaxInvoiceTradeLineItem>"
;
                    }
    
/* 변수 정리 구간 끝 */

    /* XML 입력 구간 */

                        //$body_string = <<<XML
                        
$body_string "
                            <SubmitID>
{$SubmitID}</SubmitID>
                            <TotalCount>
{$iCount}</TotalCount>
                            <Document>
                                <TaxInvoice>
                                    <ExchangedDocument>
                                        <ID>
{$PubCode}</ID>
                                        <IssueDateTime>
{$IssueDateTime1}</IssueDateTime>
                                        <ReferencedDocument>
                                            <ID>
{$m_sAppcode}</ID>
                                        </ReferencedDocument>
                                        <IssueStatus>
{$IssueStatus}</IssueStatus>
                                        <SendStatus>
{$SendStatus}</SendStatus>
                                        <SendEmail>
{$SendEmail}</SendEmail>
                                    </ExchangedDocument>
                                    <TaxInvoiceDocument>
                                        <IssueID/>
                                        <TypeCode>
{$TaxType}</TypeCode>
                                        
{$DescriptionText_xml}
                                        <IssueDateTime>
{$IssueDateTime2}</IssueDateTime>
                                        
{$AmendmentStatusCode_xml}
                                        
{$OriginalIssueID_xml}
                                        <PurposeCode>
{$DemandTag}</PurposeCode>
                                    </TaxInvoiceDocument>
                                    <TaxInvoiceTradeSettlement>
                                        <InvoicerParty>
                                            <ID>
{$sCompanyNum}</ID>
                                            <TypeCode>
{$sUptae}</TypeCode>
                                            <NameText>
{$sCompanyName}</NameText>
                                            <ClassificationCode>
{$sJongmok}</ClassificationCode>
                                            <SpecifiedOrganization>
                                                <TaxRegistrationID>
{$sSubcode}</TaxRegistrationID>
                                            </SpecifiedOrganization>
                                            <SpecifiedPerson>
                                                <NameText>
{$sChiefName}</NameText>
                                            </SpecifiedPerson>
                                            <DefinedContact>
                                                <PersonNameText>
{$sPerson}</PersonNameText>
                                                <TelephoneCommunication>
{$sPhone}</TelephoneCommunication>
                                                <URICommunication>
{$sEmail}</URICommunication>
                                            </DefinedContact>
                                            <SpecifiedAddress>
                                                <LineOneText>
{$sCompanyAddr}</LineOneText>
                                            </SpecifiedAddress>
                                        </InvoicerParty>
                                        <InvoiceeParty>
                                            <ID>
{$rCompanyNum}</ID>
                                            <TypeCode>
{$rUptae}</TypeCode>
                                            <NameText>
{$rCompanyName}</NameText>
                                            <ClassificationCode>
{$rJongmok}</ClassificationCode>
                                            <SpecifiedOrganization>
                                                <TaxRegistrationID>
{$rSubcode}</TaxRegistrationID>
                                                <BusinessTypeCode>
{$BusinessTypeCode}</BusinessTypeCode>
                                            </SpecifiedOrganization>
                                            <SpecifiedPerson>
                                                <NameText>
{$rChiefName}</NameText>
                                            </SpecifiedPerson>
                                            <PrimaryDefinedContact>
                                                <PersonNameText>
{$rPerson}</PersonNameText>
                                                <TelephoneCommunication>
{$rPhone}</TelephoneCommunication>
                                                <URICommunication>
{$rEmail}</URICommunication>
                                            </PrimaryDefinedContact>
                                            <SpecifiedAddress>
                                                <LineOneText>
{$rCompanyAddr}</LineOneText>
                                            </SpecifiedAddress>
                                        </InvoiceeParty>
                                        <SpecifiedMonetarySummation>
                                            <ChargeTotalAmount>
{$totalprice}</ChargeTotalAmount>
                                            <TaxTotalAmount>
{$totaltax}</TaxTotalAmount>
                                            <GrandTotalAmount>
{$sumprice}</GrandTotalAmount>
                                        </SpecifiedMonetarySummation>
                                    </TaxInvoiceTradeSettlement>
                                    
{$item_xml}
                                </TaxInvoice>
                            </Document>
                            "
;
    
//                    XML;

    /* XML 입력 구간 끝 */

                        //echo "<textarea>";    echo $body_string;    echo "</textarea>";     //exit;

                        
$proxyhost = isset($_REQUEST['proxyhost']) ? $_REQUEST['proxyhost'] : '';
                        
$proxyport = isset($_REQUEST['proxyport']) ? $_REQUEST['proxyport'] : '';
                        
$proxyusername = isset($_REQUEST['proxyusername']) ? $_REQUEST['proxyusername'] : '';
                        
$proxypassword = isset($_REQUEST['proxypassword']) ? $_REQUEST['proxypassword'] : '';
                        
$useCURL = isset($_REQUEST['usecurl']) ? $_REQUEST['usecurl'] : '0';
                        
$client = new nusoap_client("http://{$DB_HOSTtax}:7000/axis2/services/{$ServiceProcess}"false,
                                                
$proxyhost$proxyport$proxyusername$proxypassword);
                        
$err $client->getError();
                        if (
$err) {
                            echo 
'<h2>Constructor error</h2><pre>' $err '</pre>';
                            echo 
'<h2>Debug</h2><pre>' htmlspecialchars($client->getDebug(), ENT_QUOTES) . '</pre>';
                            exit();
                        }
                        
$client->setUseCurl($useCURL);

                        
$MessageID CreateMessageID(); // "20160727171205000-d60512a264a907ecae38ebe53cd7df1e";
                        
$TimeStamp date("Y-m-d",time())."T".date("H:i:s")."000Z";
                        
$headers "
                            <wsa:MessageID>
{$MessageID}</wsa:MessageID>
                            <wsa:To>http://
{$DB_HOSTtax}:7000/axis2/services/{$ServiceProcess}</wsa:To>
                            <wsa:Action>http://soap.openet.com</wsa:Action>
                            <MessageHeader>
                            <Version>3.0</Version>
                            <From>
                                <PartyID>1208646911</PartyID>
                                <PartyName>미진소프트</PartyName>
                            </From>
                            <To>
                                <PartyID>1234567890</PartyID>
                                <PartyName>TestBed</PartyName>
                            </To>
                            <ReplyTo>http://220.90.215.20:7000/axis2/services/TaxService</ReplyTo>
                            <OperationType>01</OperationType>
                            <MessageType>01</MessageType>
                            <TimeStamp>
{$TimeStamp}</TimeStamp>
                            </MessageHeader>
                        "


                        
//echo "<textarea>";    echo $headers;    echo "</textarea>";
                        
$xml_cont $headers.$body_string;

                        
//_pr($xml_cont);
                        
                        // 생성한 xml 로그
                        
$xml_file_name $eid2."_{$tax_code}_make_{$tstamp}.xml";
                        
xml_file_log($tax_code.":".$xml_cont,$xml_file_name);

                        
$client->setHeaders($headers); 
                        
$client->soap_defencoding "utf-8";
                        
$client->decode_utf8 false;

                        
$params $body_string// object 배열로 던지거나 xml스트링으로 던져도 됨

                        
$result $client->call('RequestMessage'$params'''');

                        if (
$client->fault) {
                            
//echo '<h2>Fault (Expect - The request contains an invalid SOAP body)</h2><pre>'; print_r($result); echo '</pre>';
                        
} else {
                            
$err $client->getError();
                            if (
$err) {
                                
//echo '<h2>Error</h2><pre>' . $err . '</pre>';
                            
} else {
                                
//echo '<h2>Result</h2><pre>'; print_r($result); echo '</pre>';
                                
if($result['ReturnCode']=='01'){
                                    
$v explode("|",$result['ResponseMsg']);
                                    
$resmsg trim($v[0]);
                                    
$mgmt_no substr($resmsg,0,24);
                                    
$appv_no substr($resmsg,24,24);
                                    
//$sql = "update taxlist_m set appv_no = '{$appv_no}', mgmt_no = '{$mgmt_no}' where code = '{$tax_code}' ";
                                    
$sql "update sale_tax_m set etax_appv_no = '{$appv_no}', etax_srvc_no = '{$mgmt_no}', cng_reason = '{$ChangeReason}'
                                                where midx = '
{$tax_code}'
                                    "
;
                                    
$res mysql_query($sql,$connect_e1000y);

                                    
$sql "insert into tn_eaaa_mjdata set
                                                ETAXBIL_APPV_NO = '
{$appv_no}', PC_IP = '{$_SERVER['REMOTE_ADDR']}', PC_MAC = '', 
                                                PC_NAME = '
{$eid2}', APP_CODE = '80', APP_VER = '1.0'
                                    "
;
                                    
$res mysql_query($sql,$connect_tax);                                    

                                    
$res_msg "ok:{$tax_code}:{$appv_no}:{$mgmt_no}";
                                } else {
                                    
$res_msg "error:{$tax_code}:{$result['ResponseMsg']}";
                                }
                            }
                        }
                        
                        
// soap에 request된 xml 로그
                        
$xml_file_name $eid2."_{$tax_code}_make_req_{$tstamp}.xml";
                        
xml_file_log($client->request,$xml_file_name);

                        
// soap에서 response된 xml 로그
                        
$xml_file_name $eid2."_{$tax_code}_make_res_{$tstamp}.xml";
                        
xml_file_log($client->response,$xml_file_name);

                        
/*echo '<h2>Request</h2><pre>' . htmlspecialchars($client->request, ENT_QUOTES) . '</pre>';
                        echo '<h2>Response</h2><pre>' . htmlspecialchars($client->response, ENT_QUOTES) . '</pre>';
                        echo '<h2>Debug</h2><pre>' . htmlspecialchars($client->getDebug(), ENT_QUOTES) . '</pre>';*/


                
} else {
                    
//echo "error:1:해당되는 전자세금계산서의 공급받는자번호가 없습니다.";    
                    
$res_msg "error:1:해당되는 전자세금계산서의 공급받는자번호가 없습니다.";
                }
            } else { 
// 상품 계산서 자료가 없을경우
                //echo "error:2:해당되는 전자세금계산서의 상품정보가 없습니다.";    
                
$res_msg "error:2:해당되는 전자세금계산서의 상품정보가 없습니다.";
            }
    } else {
        
//echo "error:4:공급하는자 정보가 없습니다.";
        
$res_msg "error:4:공급하는자 정보가 없습니다.";
    }

    @
mysql_close($connect_tax);

    echo 
$res_msg;

?>