Class: TaxinvoiceService
Overview
팝빌 세금계산서 API Service Implementation
Constant Summary
Constants inherited
from BaseService
BaseService::BOUNDARY, BaseService::POPBILL_APIVersion, BaseService::ServiceID_REAL, BaseService::ServiceID_TEST, BaseService::ServiceURL_REAL, BaseService::ServiceURL_TEST
Instance Attribute Summary
Attributes inherited from BaseService
#isTest, #linkhub, #scopes, #token_table
Class Method Summary
collapse
Instance Method Summary
collapse
-
#accept(corpNum, mgtKeyType, mgtKey, memo = '', userID = '') ⇒ Object
-
#assignMgtKey(corpNum, mgtKeyType, itemKey, mgtKey, userID = '') ⇒ Object
-
#attachFile(corpNum, mgtKeyType, mgtKey, filePath, userID = '') ⇒ Object
-
#attachStatement(corpNum, mgtKeyType, mgtKey, itemCode, stmtMgtKey, userID = '') ⇒ Object
-
#cancelIssue(corpNum, mgtKeyType, mgtKey, memo = '', userID = '') ⇒ Object
-
#cancelRequest(corpNum, mgtKeyType, mgtKey, memo = '', userID = '') ⇒ Object
-
#cancelSend(corpNum, mgtKeyType, mgtKey, memo = '', userID = '') ⇒ Object
-
#checkCertValidation(corpNum, userID = '') ⇒ Object
-
#checkMgtKeyInUse(corpNum, mgtKeyType, mgtKey) ⇒ Object
-
#delete(corpNum, mgtKeyType, mgtKey, userID = '') ⇒ Object
-
#deleteFile(corpNum, mgtKeyType, mgtKey, fileID, userID = '') ⇒ Object
-
#deny(corpNum, mgtKeyType, mgtKey, memo = '', userID = '') ⇒ Object
-
#detachStatement(corpNum, mgtKeyType, mgtKey, itemCode, stmtMgtKey, userID = '') ⇒ Object
-
#getCertificateExpireDate(corpNum) ⇒ Object
-
#getChargeInfo(corpNum, userID = "") ⇒ Object
-
#getDetailInfo(corpNum, mgtKeyType, mgtKey, userID = '') ⇒ Object
-
#getEmailPublicKeys(corpNum) ⇒ Object
-
#getEPrintURL(corpNum, mgtKeyType, mgtKey, userID = '') ⇒ Object
-
#getFiles(corpNum, mgtKeyType, mgtKey, userID = '') ⇒ Object
-
#getInfo(corpNum, mgtKeyType, mgtKey, userID = '') ⇒ Object
-
#getInfos(corpNum, mgtKeyType, mgtKeyList, userID = '') ⇒ Object
-
#getLogs(corpNum, mgtKeyType, mgtKey, userID = '') ⇒ Object
-
#getMailURL(corpNum, mgtKeyType, mgtKey, userID = '') ⇒ Object
-
#getMassPrintURL(corpNum, mgtKeyType, mgtKeyList, userID = '') ⇒ Object
-
#getPopUpURL(corpNum, mgtKeyType, mgtKey, userID = '') ⇒ Object
-
#getPrintURL(corpNum, mgtKeyType, mgtKey, userID = '') ⇒ Object
-
#getSealURL(corpNum, userID) ⇒ Object
-
#getTaxCertURL(corpNum, userID) ⇒ Object
-
#getUnitCost(corpNum) ⇒ Object
-
#getURL(corpNum, togo, userID = "") ⇒ Object
-
#issue(corpNum, mgtKeyType, mgtKey, forceIssue = false, memo = '', emailSubject = '', userID) ⇒ Object
-
#listEmailConfig(corpNum, userID = '') ⇒ Object
-
#refuse(corpNum, mgtKeyType, mgtKey, memo = '', userID = '') ⇒ Object
-
#register(corpNum, taxinvoice, writeSpecification = false, userID = '') ⇒ Object
-
#registIssue(corpNum, taxinvoice, writeSpecification = false, forceIssue = false, dealInvoiceMgtKey = '', memo = '', emailSubject = '', userID = '') ⇒ Object
-
#registRequest(corpNum, taxinvoice, memo = '', userID = '') ⇒ Object
-
#request(corpNum, mgtKeyType, mgtKey, memo = '', userID = '') ⇒ Object
-
#search(corpNum, mgtKeyType, dType, sDate, eDate, state, type, taxType, lateOnly, taxRegIDYN, taxRegIDType, taxRegID, page, perPage, order, queryString, userID = '', interOPYN = '', issueType = []) ⇒ Object
-
#send(corpNum, mgtKeyType, mgtKey, memo = '', emailSubject = '', userID = '') ⇒ Object
-
#sendEmail(corpNum, mgtKeyType, mgtKey, receiverMail, userID = '') ⇒ Object
-
#sendFax(corpNum, mgtKeyType, mgtKey, senderNum, receiverNum, userID = '') ⇒ Object
-
#sendSMS(corpNum, mgtKeyType, mgtKey, senderNum, receiverNum, contents, userID = '') ⇒ Object
-
#sendToNTS(corpNum, mgtKeyType, mgtKey, userID = '') ⇒ Object
-
#update(corpNum, mgtKeyType, mgtKey, taxinvoice, userID = '') ⇒ Object
-
#updateEmailConfig(corpNum, emailType, sendYN, userID = '') ⇒ Object
Methods inherited from BaseService
#addScope, #checkID, #checkIsMember, #getAccessURL, #getBalance, #getChargeURL, #getCorpInfo, #getPartnerBalance, #getPartnerURL, #getPopbillURL, #getServiceID, #getServiceURL, #getSession_Token, #gzip_parse, #httpget, #httppost, #httppostfile, #httppostfiles, #joinMember, #listContact, #registContact, #setIsTest, #updateContact, #updateCorpInfo
Class Method Details
.instance(linkID, secretKey) ⇒ Object
7
8
9
10
11
12
|
# File 'lib/popbill/taxinvoice.rb', line 7
def instance(linkID, secretKey)
super(linkID, secretKey)
@instance ||= new
@instance.addScope("110")
return @instance
end
|
Instance Method Details
#accept(corpNum, mgtKeyType, mgtKey, memo = '', userID = '') ⇒ Object
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
|
# File 'lib/popbill/taxinvoice.rb', line 218
def accept(corpNum, mgtKeyType, mgtKey, memo = '', userID = '')
if corpNum.length != 10
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
end
if mgtKey.to_s == ''
raise PopbillException.new('-99999999', '문서관리번호 올바르지 않습니다.')
end
postData = {}
if memo.to_s != ''
postData["memo"] = memo
end
postData = postData.to_json
httppost("/Taxinvoice/#{mgtKeyType}/#{mgtKey}", corpNum, postData, "ACCEPT", userID)
end
|
#assignMgtKey(corpNum, mgtKeyType, itemKey, mgtKey, userID = '') ⇒ Object
663
664
665
666
667
668
669
670
671
672
673
674
|
# File 'lib/popbill/taxinvoice.rb', line 663
def assignMgtKey(corpNum, mgtKeyType, itemKey, mgtKey, userID = '')
if corpNum.length != 10
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
end
if itemKey.to_s == ''
raise PopbillException.new('-99999999', '해당문서의 아이템키가 입력되지 않았습니다.')
end
String postDate = "MgtKey=" + mgtKey
httppost("/Taxinvoice/#{itemKey}/#{mgtKeyType}", corpNum, postDate, "", userID, "application/x-www-form-urlencoded; charset=utf-8")
end
|
#attachFile(corpNum, mgtKeyType, mgtKey, filePath, userID = '') ⇒ Object
475
476
477
478
479
480
481
482
483
484
|
# File 'lib/popbill/taxinvoice.rb', line 475
def attachFile(corpNum, mgtKeyType, mgtKey, filePath, userID = '')
if corpNum.length != 10
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
end
if mgtKey.to_s == ''
raise PopbillException.new('-99999999', '문서관리번호 올바르지 않습니다.')
end
httppostfiles("/Taxinvoice/#{mgtKeyType}/#{mgtKey}/Files", corpNum, '', [filePath], userID)
end
|
#attachStatement(corpNum, mgtKeyType, mgtKey, itemCode, stmtMgtKey, userID = '') ⇒ Object
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
|
# File 'lib/popbill/taxinvoice.rb', line 619
def attachStatement(corpNum, mgtKeyType, mgtKey, itemCode, stmtMgtKey, userID = '')
if corpNum.length != 10
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
end
if mgtKey.to_s == ''
raise PopbillException.new('-99999999', '문서관리번호가 입력되지 않았습니다.')
end
if itemCode.to_s == ''
raise PopbillException.new('-99999999', '전자명세서 종류코드가 입력되지 않았습니다.')
end
if stmtMgtKey.to_s == ''
raise PopbillException.new('-99999999', '전자명세서 문서관리번호가 입력되지 않았습니다.')
end
postData = {}
postData["ItemCode"] = itemCode
postData["MgtKey"] = stmtMgtKey
postData = postData.to_json
httppost("/Taxinvoice/#{mgtKeyType}/#{mgtKey}/AttachStmt", corpNum, postData, "", userID)
end
|
#cancelIssue(corpNum, mgtKeyType, mgtKey, memo = '', userID = '') ⇒ Object
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
|
# File 'lib/popbill/taxinvoice.rb', line 284
def cancelIssue(corpNum, mgtKeyType, mgtKey, memo = '', userID = '')
if corpNum.length != 10
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
end
if mgtKey.to_s == ''
raise PopbillException.new('-99999999', '문서관리번호 올바르지 않습니다.')
end
postData = {}
if memo.to_s != ''
postData["memo"] = memo
end
postData = postData.to_json
httppost("/Taxinvoice/#{mgtKeyType}/#{mgtKey}", corpNum, postData, "CANCELISSUE", userID)
end
|
#cancelRequest(corpNum, mgtKeyType, mgtKey, memo = '', userID = '') ⇒ Object
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
|
# File 'lib/popbill/taxinvoice.rb', line 355
def cancelRequest(corpNum, mgtKeyType, mgtKey, memo = '', userID = '')
if corpNum.length != 10
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
end
if mgtKey.to_s == ''
raise PopbillException.new('-99999999', '문서관리번호 올바르지 않습니다.')
end
postData = {}
if memo.to_s != ''
postData["memo"] = memo
end
postData = postData.to_json
httppost("/Taxinvoice/#{mgtKeyType}/#{mgtKey}", corpNum, postData, "CANCELREQUEST", userID)
end
|
#cancelSend(corpNum, mgtKeyType, mgtKey, memo = '', userID = '') ⇒ Object
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
|
# File 'lib/popbill/taxinvoice.rb', line 199
def cancelSend(corpNum, mgtKeyType, mgtKey, memo = '', userID = '')
if corpNum.length != 10
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
end
if mgtKey.to_s == ''
raise PopbillException.new('-99999999', '문서관리번호 올바르지 않습니다.')
end
postData = {}
if memo.to_s != ''
postData["memo"] = memo
end
postData = postData.to_json
httppost("/Taxinvoice/#{mgtKeyType}/#{mgtKey}", corpNum, postData, "CANCELSEND", userID)
end
|
#checkCertValidation(corpNum, userID = '') ⇒ Object
700
701
702
703
704
705
706
|
# File 'lib/popbill/taxinvoice.rb', line 700
def checkCertValidation(corpNum, userID = '')
if corpNum.length != 10
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
end
httpget("/Taxinvoice/CertCheck", corpNum, userID)
end
|
#checkMgtKeyInUse(corpNum, mgtKeyType, mgtKey) ⇒ Object
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
# File 'lib/popbill/taxinvoice.rb', line 52
def checkMgtKeyInUse(corpNum, mgtKeyType, mgtKey)
if corpNum.length != 10
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
end
if mgtKey.to_s == ''
raise PopbillException.new('-99999999', '문서관리번호 올바르지 않습니다.')
end
begin
response = httpget("/Taxinvoice/#{mgtKeyType}/#{mgtKey}", corpNum)
return response['itemKey'].length != 0
rescue PopbillException => pe
if pe.code == -11000005
return false
end
raise PopbillException.new(pe.code, pe.message)
end
end
|
#delete(corpNum, mgtKeyType, mgtKey, userID = '') ⇒ Object
164
165
166
167
168
169
170
171
172
173
|
# File 'lib/popbill/taxinvoice.rb', line 164
def delete(corpNum, mgtKeyType, mgtKey, userID = '')
if corpNum.length != 10
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
end
if mgtKey.to_s == ''
raise PopbillException.new('-99999999', '문서관리번호 입력되지 않았습니다.')
end
httppost("/Taxinvoice/#{mgtKeyType}/#{mgtKey}", corpNum, '', 'DELETE', userID)
end
|
#deleteFile(corpNum, mgtKeyType, mgtKey, fileID, userID = '') ⇒ Object
499
500
501
502
503
504
505
506
507
508
509
510
511
|
# File 'lib/popbill/taxinvoice.rb', line 499
def deleteFile(corpNum, mgtKeyType, mgtKey, fileID, userID = '')
if corpNum.length != 10
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
end
if mgtKey.to_s == ''
raise PopbillException.new('-99999999', '문서관리번호 올바르지 않습니다.')
end
if fileID.to_s == ''
raise PopbillException.new('-99999999', '파일아이디가 입력되지 않았습니다.')
end
httppost("/Taxinvoice/#{mgtKeyType}/#{mgtKey}/Files/#{fileID}", corpNum, '', "DELETE", userID)
end
|
#deny(corpNum, mgtKeyType, mgtKey, memo = '', userID = '') ⇒ Object
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
|
# File 'lib/popbill/taxinvoice.rb', line 237
def deny(corpNum, mgtKeyType, mgtKey, memo = '', userID = '')
if corpNum.length != 10
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
end
if mgtKey.to_s == ''
raise PopbillException.new('-99999999', '문서관리번호 올바르지 않습니다.')
end
postData = {}
if memo.to_s != ''
postData["memo"] = memo
end
postData = postData.to_json
httppost("/Taxinvoice/#{mgtKeyType}/#{mgtKey}", corpNum, postData, "DENY", userID)
end
|
#detachStatement(corpNum, mgtKeyType, mgtKey, itemCode, stmtMgtKey, userID = '') ⇒ Object
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
|
# File 'lib/popbill/taxinvoice.rb', line 641
def detachStatement(corpNum, mgtKeyType, mgtKey, itemCode, stmtMgtKey, userID = '')
if corpNum.length != 10
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
end
if mgtKey.to_s == ''
raise PopbillException.new('-99999999', '문서관리번호가 입력되지 않았습니다.')
end
if itemCode.to_s == ''
raise PopbillException.new('-99999999', '전자명세서 종류코드가 입력되지 않았습니다.')
end
if stmtMgtKey.to_s == ''
raise PopbillException.new('-99999999', '전자명세서 문서관리번호가 입력되지 않았습니다.')
end
postData = {}
postData["ItemCode"] = itemCode
postData["MgtKey"] = stmtMgtKey
postData = postData.to_json
httppost("/Taxinvoice/#{mgtKeyType}/#{mgtKey}/DetachStmt", corpNum, postData, "", userID)
end
|
#getCertificateExpireDate(corpNum) ⇒ Object
38
39
40
41
42
43
|
# File 'lib/popbill/taxinvoice.rb', line 38
def getCertificateExpireDate(corpNum)
if corpNum.length != 10
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
end
httpget("/Taxinvoice?cfg=CERT", corpNum)['certificateExpiration']
end
|
#getChargeInfo(corpNum, userID = "") ⇒ Object
17
18
19
20
21
22
|
# File 'lib/popbill/taxinvoice.rb', line 17
def getChargeInfo(corpNum, userID = "")
if corpNum.length != 10
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
end
httpget("/Taxinvoice/ChargeInfo", corpNum, userID)
end
|
#getDetailInfo(corpNum, mgtKeyType, mgtKey, userID = '') ⇒ Object
152
153
154
155
156
157
158
159
160
161
|
# File 'lib/popbill/taxinvoice.rb', line 152
def getDetailInfo(corpNum, mgtKeyType, mgtKey, userID = '')
if corpNum.length != 10
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
end
if mgtKey.to_s == ''
raise PopbillException.new('-99999999', '문서관리번호 올바르지 않습니다.')
end
httpget("/Taxinvoice/#{mgtKeyType}/#{mgtKey}?Detail", corpNum, userID)
end
|
#getEmailPublicKeys(corpNum) ⇒ Object
45
46
47
48
49
50
|
# File 'lib/popbill/taxinvoice.rb', line 45
def getEmailPublicKeys(corpNum)
if corpNum.length != 10
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
end
httpget("/Taxinvoice/EmailPublicKeys", corpNum)
end
|
#getEPrintURL(corpNum, mgtKeyType, mgtKey, userID = '') ⇒ Object
535
536
537
538
539
540
541
542
543
544
|
# File 'lib/popbill/taxinvoice.rb', line 535
def getEPrintURL(corpNum, mgtKeyType, mgtKey, userID = '')
if corpNum.length != 10
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
end
if mgtKey.to_s == ''
raise PopbillException.new('-99999999', '문서관리번호 올바르지 않습니다.')
end
httpget("/Taxinvoice/#{mgtKeyType}/#{mgtKey}?TG=EPRINT", corpNum, userID)['url']
end
|
#getFiles(corpNum, mgtKeyType, mgtKey, userID = '') ⇒ Object
487
488
489
490
491
492
493
494
495
496
|
# File 'lib/popbill/taxinvoice.rb', line 487
def getFiles(corpNum, mgtKeyType, mgtKey, userID = '')
if corpNum.length != 10
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
end
if mgtKey.to_s == ''
raise PopbillException.new('-99999999', '문서관리번호 올바르지 않습니다.')
end
httpget("/Taxinvoice/#{mgtKeyType}/#{mgtKey}/Files", corpNum)
end
|
#getInfo(corpNum, mgtKeyType, mgtKey, userID = '') ⇒ Object
127
128
129
130
131
132
133
134
135
136
|
# File 'lib/popbill/taxinvoice.rb', line 127
def getInfo(corpNum, mgtKeyType, mgtKey, userID = '')
if corpNum.length != 10
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
end
if mgtKey.to_s == ''
raise PopbillException.new('-99999999', '문서관리번호 올바르지 않습니다.')
end
httpget("/Taxinvoice/#{mgtKeyType}/#{mgtKey}", corpNum, userID)
end
|
#getInfos(corpNum, mgtKeyType, mgtKeyList, userID = '') ⇒ Object
138
139
140
141
142
143
144
145
146
147
148
149
|
# File 'lib/popbill/taxinvoice.rb', line 138
def getInfos(corpNum, mgtKeyType, mgtKeyList, userID = '')
if corpNum.length != 10
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
end
unless mgtKeyList.any?
raise PopbillException.new('-99999999', '문서관리번호 배열이 올바르지 않습니다.')
end
postData = mgtKeyList.to_json
httppost("/Taxinvoice/#{mgtKeyType}", corpNum, postData, "", userID)
end
|
#getLogs(corpNum, mgtKeyType, mgtKey, userID = '') ⇒ Object
463
464
465
466
467
468
469
470
471
472
|
# File 'lib/popbill/taxinvoice.rb', line 463
def getLogs(corpNum, mgtKeyType, mgtKey, userID = '')
if corpNum.length != 10
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
end
if mgtKey.to_s == ''
raise PopbillException.new('-99999999', '문서관리번호 올바르지 않습니다.')
end
httpget("/Taxinvoice/#{mgtKeyType}/#{mgtKey}/Logs", corpNum, userID)
end
|
#getMailURL(corpNum, mgtKeyType, mgtKey, userID = '') ⇒ Object
546
547
548
549
550
551
552
553
554
555
|
# File 'lib/popbill/taxinvoice.rb', line 546
def getMailURL(corpNum, mgtKeyType, mgtKey, userID = '')
if corpNum.length != 10
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
end
if mgtKey.to_s == ''
raise PopbillException.new('-99999999', '문서관리번호 올바르지 않습니다.')
end
httpget("/Taxinvoice/#{mgtKeyType}/#{mgtKey}?TG=MAIL", corpNum, userID)['url']
end
|
#getMassPrintURL(corpNum, mgtKeyType, mgtKeyList, userID = '') ⇒ Object
557
558
559
560
561
562
563
564
565
566
567
|
# File 'lib/popbill/taxinvoice.rb', line 557
def getMassPrintURL(corpNum, mgtKeyType, mgtKeyList, userID = '')
if corpNum.length != 10
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
end
unless mgtKeyList.any?
raise PopbillException.new('-99999999', '문서관리번호 배열이 올바르지 않습니다.')
end
postData = mgtKeyList.to_json
httppost("/Taxinvoice/#{mgtKeyType}?Print", corpNum, postData, "", userID)['url']
end
|
513
514
515
516
517
518
519
520
521
522
|
# File 'lib/popbill/taxinvoice.rb', line 513
def (corpNum, mgtKeyType, mgtKey, userID = '')
if corpNum.length != 10
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
end
if mgtKey.to_s == ''
raise PopbillException.new('-99999999', '문서관리번호 올바르지 않습니다.')
end
httpget("/Taxinvoice/#{mgtKeyType}/#{mgtKey}?TG=POPUP", corpNum, userID)['url']
end
|
#getPrintURL(corpNum, mgtKeyType, mgtKey, userID = '') ⇒ Object
524
525
526
527
528
529
530
531
532
533
|
# File 'lib/popbill/taxinvoice.rb', line 524
def getPrintURL(corpNum, mgtKeyType, mgtKey, userID = '')
if corpNum.length != 10
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
end
if mgtKey.to_s == ''
raise PopbillException.new('-99999999', '문서관리번호 올바르지 않습니다.')
end
httpget("/Taxinvoice/#{mgtKeyType}/#{mgtKey}?TG=PRINT", corpNum, userID)['url']
end
|
#getSealURL(corpNum, userID) ⇒ Object
709
710
711
712
713
714
715
716
|
# File 'lib/popbill/taxinvoice.rb', line 709
def getSealURL(corpNum, userID)
if corpNum.length != 10
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
end
response = httpget("/?TG=SEAL", corpNum, userID)
response['url']
end
|
#getTaxCertURL(corpNum, userID) ⇒ Object
719
720
721
722
723
724
725
726
|
# File 'lib/popbill/taxinvoice.rb', line 719
def getTaxCertURL(corpNum, userID)
if corpNum.length != 10
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
end
response = httpget("/?TG=CERT", corpNum, userID)
response['url']
end
|
#getUnitCost(corpNum) ⇒ Object
31
32
33
34
35
36
|
# File 'lib/popbill/taxinvoice.rb', line 31
def getUnitCost(corpNum)
if corpNum.length != 10
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
end
httpget("/Taxinvoice?cfg=UNITCOST", corpNum)['unitCost']
end
|
#getURL(corpNum, togo, userID = "") ⇒ Object
24
25
26
27
28
29
|
# File 'lib/popbill/taxinvoice.rb', line 24
def getURL(corpNum, togo, userID = "")
if corpNum.length != 10
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
end
httpget("/Taxinvoice/?TG=" + togo, corpNum, userID)['url']
end
|
#issue(corpNum, mgtKeyType, mgtKey, forceIssue = false, memo = '', emailSubject = '', userID) ⇒ Object
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
|
# File 'lib/popbill/taxinvoice.rb', line 256
def issue(corpNum, mgtKeyType, mgtKey, forceIssue = false, memo = '', emailSubject = '', userID)
if corpNum.length != 10
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
end
if mgtKey.to_s == ''
raise PopbillException.new('-99999999', '문서관리번호 올바르지 않습니다.')
end
postData = {}
if forceIssue
postData["forceIssue"] = true
end
if memo.to_s != ''
postData["memo"] = memo
end
if emailSubject.to_s != ''
postData["emailSubject"] = emailSubject
end
postData = postData.to_json
httppost("/Taxinvoice/#{mgtKeyType}/#{mgtKey}", corpNum, postData, "ISSUE", userID)
end
|
#listEmailConfig(corpNum, userID = '') ⇒ Object
676
677
678
679
680
681
682
|
# File 'lib/popbill/taxinvoice.rb', line 676
def listEmailConfig(corpNum, userID = '')
if corpNum.length != 10
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
end
httpget("/Taxinvoice/EmailSendConfig", corpNum, userID)
end
|
#refuse(corpNum, mgtKeyType, mgtKey, memo = '', userID = '') ⇒ Object
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
|
# File 'lib/popbill/taxinvoice.rb', line 336
def refuse(corpNum, mgtKeyType, mgtKey, memo = '', userID = '')
if corpNum.length != 10
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
end
if mgtKey.to_s == ''
raise PopbillException.new('-99999999', '문서관리번호 올바르지 않습니다.')
end
postData = {}
if memo.to_s != ''
postData["memo"] = memo
end
postData = postData.to_json
httppost("/Taxinvoice/#{mgtKeyType}/#{mgtKey}", corpNum, postData, "REFUSE", userID)
end
|
#register(corpNum, taxinvoice, writeSpecification = false, userID = '') ⇒ Object
71
72
73
74
75
76
77
78
79
80
81
|
# File 'lib/popbill/taxinvoice.rb', line 71
def register(corpNum, taxinvoice, writeSpecification = false, userID = '')
if corpNum.length != 10
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
end
if writeSpecification
taxinvoice["writeSpecification"] = true
end
postData = taxinvoice.to_json
httppost("/Taxinvoice", corpNum, postData, "", userID)
end
|
#registIssue(corpNum, taxinvoice, writeSpecification = false, forceIssue = false, dealInvoiceMgtKey = '', memo = '', emailSubject = '', userID = '') ⇒ Object
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
|
# File 'lib/popbill/taxinvoice.rb', line 83
def registIssue(corpNum, taxinvoice, writeSpecification = false, forceIssue = false, dealInvoiceMgtKey = '', memo = '', emailSubject = '', userID = '')
if corpNum.length != 10
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
end
if writeSpecification
taxinvoice["writeSpecification"] = true
end
if forceIssue
taxinvoice["forceIssue"] = true
end
if dealInvoiceMgtKey.to_s != ''
taxinvoice["dealInvoiceMgtKey"] = dealInvoiceMgtKey
end
if memo.to_s != ''
taxinvoice["memo"] = memo
end
if emailSubject.to_s != ''
taxinvoice["emailSubject"] = emailSubject
end
postData = taxinvoice.to_json
httppost("/Taxinvoice", corpNum, postData, "ISSUE", userID)
end
|
#registRequest(corpNum, taxinvoice, memo = '', userID = '') ⇒ Object
303
304
305
306
307
308
309
310
311
312
313
314
315
|
# File 'lib/popbill/taxinvoice.rb', line 303
def registRequest(corpNum, taxinvoice, memo = '', userID = '')
if corpNum.length != 10
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
end
if memo.to_s != ''
taxinvoice["memo"] = memo
end
postData = taxinvoice.to_json
httppost("/Taxinvoice", corpNum, postData, "REQUEST", userID)
end
|
#request(corpNum, mgtKeyType, mgtKey, memo = '', userID = '') ⇒ Object
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
|
# File 'lib/popbill/taxinvoice.rb', line 317
def request(corpNum, mgtKeyType, mgtKey, memo = '', userID = '')
if corpNum.length != 10
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
end
if mgtKey.to_s == ''
raise PopbillException.new('-99999999', '문서관리번호 올바르지 않습니다.')
end
postData = {}
if memo.to_s != ''
postData["memo"] = memo
end
postData = postData.to_json
httppost("/Taxinvoice/#{mgtKeyType}/#{mgtKey}", corpNum, postData, "REQUEST", userID)
end
|
#search(corpNum, mgtKeyType, dType, sDate, eDate, state, type, taxType, lateOnly, taxRegIDYN, taxRegIDType, taxRegID, page, perPage, order, queryString, userID = '', interOPYN = '', issueType = []) ⇒ Object
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
|
# File 'lib/popbill/taxinvoice.rb', line 570
def search(corpNum, mgtKeyType, dType, sDate, eDate, state, type, taxType, lateOnly,
taxRegIDYN, taxRegIDType, taxRegID, page, perPage, order, queryString, userID = '', interOPYN = '', issueType = [])
if corpNum.length != 10
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
end
if dType.to_s == ''
raise PopbillException.new('-99999999', '검색일자유형이 입력되지 않았습니다.')
end
if sDate.to_s == ''
raise PopbillException.new('-99999999', '시작일자가 입력되지 않았습니다.')
end
if eDate.to_s == ''
raise PopbillException.new('-99999999', '종료일자가 입력되지 않았습니다.')
end
uri = "/Taxinvoice/#{mgtKeyType}?DType=#{dType}&SDate=#{sDate}&EDate=#{eDate}"
uri += "&State=" + state.join(',')
uri += "&Type=" + type.join(',')
uri += "&TaxType=" + taxType.join(',')
uri += "&TaxRegIDType=" + taxRegIDType
uri += "&TaxRegID=" + taxRegID
uri += "&Page=" + page.to_s
uri += "&PerPage=" + perPage.to_s
uri += "&Order=" + order
uri += "&InterOPYN=" + interOPYN.to_s
if issueType.length > 0
uri += "&IssueType=" + issueType.join(',')
end
if lateOnly.to_s != ''
uri += "&LateOnly=" + lateOnly
end
if taxRegIDYN.to_s != ''
uri += "&TaxRegIDYN=" + taxRegIDYN
end
if queryString.to_s != ''
uri += "&QString=" + queryString
end
httpget(URI.escape(uri), corpNum, userID)
end
|
#send(corpNum, mgtKeyType, mgtKey, memo = '', emailSubject = '', userID = '') ⇒ Object
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
|
# File 'lib/popbill/taxinvoice.rb', line 176
def send(corpNum, mgtKeyType, mgtKey, memo = '', emailSubject = '', userID = '')
if corpNum.length != 10
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
end
if mgtKey.to_s == ''
raise PopbillException.new('-99999999', '문서관리번호 올바르지 않습니다.')
end
postData = {}
if memo.to_s != ''
postData["memo"] = memo
end
if emailSubject.to_s != ''
postData["emailSubject"] = emailSubject
end
postData = postData.to_json
httppost("/Taxinvoice/#{mgtKeyType}/#{mgtKey}", corpNum, postData, "SEND", userID)
end
|
#sendEmail(corpNum, mgtKeyType, mgtKey, receiverMail, userID = '') ⇒ Object
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
|
# File 'lib/popbill/taxinvoice.rb', line 387
def sendEmail(corpNum, mgtKeyType, mgtKey, receiverMail, userID = '')
if corpNum.length != 10
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
end
if mgtKey.to_s == ''
raise PopbillException.new('-99999999', '문서관리번호 올바르지 않습니다.')
end
postData = {}
if receiverMail.to_s != ''
postData["receiver"] = receiverMail
end
postData = postData.to_json
httppost("/Taxinvoice/#{mgtKeyType}/#{mgtKey}", corpNum, postData, "EMAIL", userID)
end
|
#sendFax(corpNum, mgtKeyType, mgtKey, senderNum, receiverNum, userID = '') ⇒ Object
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
|
# File 'lib/popbill/taxinvoice.rb', line 437
def sendFax(corpNum, mgtKeyType, mgtKey, senderNum, receiverNum, userID = '')
if corpNum.length != 10
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
end
if mgtKey.to_s == ''
raise PopbillException.new('-99999999', '문서관리번호 올바르지 않습니다.')
end
if senderNum.to_s == ''
raise PopbillException.new('-99999999', '발신번호가 입력되지 않았습니다.')
end
if receiverNum.to_s == ''
raise PopbillException.new('-99999999', '수신번호가 입력되지 않았습니다.')
end
postData = {}
postData["sender"] = senderNum
postData["receiver"] = receiverNum
postData = postData.to_json
httppost("/Taxinvoice/#{mgtKeyType}/#{mgtKey}", corpNum, postData, "FAX", userID)
end
|
#sendSMS(corpNum, mgtKeyType, mgtKey, senderNum, receiverNum, contents, userID = '') ⇒ Object
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
|
# File 'lib/popbill/taxinvoice.rb', line 406
def sendSMS(corpNum, mgtKeyType, mgtKey, senderNum, receiverNum, contents, userID = '')
if corpNum.length != 10
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
end
if mgtKey.to_s == ''
raise PopbillException.new('-99999999', '문서관리번호 올바르지 않습니다.')
end
if senderNum.to_s == ''
raise PopbillException.new('-99999999', '발신번호가 입력되지 않았습니다.')
end
if receiverNum.to_s == ''
raise PopbillException.new('-99999999', '수신번호가 입력되지 않았습니다.')
end
if contents.to_s == ''
raise PopbillException.new('-99999999', '문자 메시지 내용이 입력되지 않았습니다.')
end
postData = {}
postData["sender"] = senderNum
postData["receiver"] = receiverNum
postData["contents"] = contents
postData = postData.to_json
httppost("/Taxinvoice/#{mgtKeyType}/#{mgtKey}", corpNum, postData, "SMS", userID)
end
|
#sendToNTS(corpNum, mgtKeyType, mgtKey, userID = '') ⇒ Object
375
376
377
378
379
380
381
382
383
384
|
# File 'lib/popbill/taxinvoice.rb', line 375
def sendToNTS(corpNum, mgtKeyType, mgtKey, userID = '')
if corpNum.length != 10
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
end
if mgtKey.to_s == ''
raise PopbillException.new('-99999999', '문서관리번호 올바르지 않습니다.')
end
httppost("/Taxinvoice/#{mgtKeyType}/#{mgtKey}", corpNum, '', "NTS", userID)
end
|
#update(corpNum, mgtKeyType, mgtKey, taxinvoice, userID = '') ⇒ Object
114
115
116
117
118
119
120
121
122
123
124
|
# File 'lib/popbill/taxinvoice.rb', line 114
def update(corpNum, mgtKeyType, mgtKey, taxinvoice, userID = '')
if corpNum.length != 10
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
end
if mgtKey.to_s == ''
raise PopbillException.new('-99999999', '문서관리번호 올바르지 않습니다.')
end
postData = taxinvoice.to_json
httppost("/Taxinvoice/#{mgtKeyType}/#{mgtKey}", corpNum, postData, "PATCH", userID)
end
|
#updateEmailConfig(corpNum, emailType, sendYN, userID = '') ⇒ Object
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
|
# File 'lib/popbill/taxinvoice.rb', line 684
def updateEmailConfig(corpNum, emailType, sendYN, userID = '')
if corpNum.length != 10
raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
end
if emailType.to_s == ''
raise PopbillException.new('-99999999', '메일전송 타입이 입력되지 않았습니다.')
end
if sendYN.to_s == ''
raise PopbillException.new('-99999999', '메일전송 여부 항목이 입력되지 않았습니다.')
end
httppost("/Taxinvoice/EmailSendConfig?EmailType=#{emailType}&SendYN=#{sendYN}", corpNum, userID)
end
|