class TaxinvoiceService

팝빌 세금계산서 API Service Implementation

Public Class Methods

instance(linkID, secretKey) click to toggle source
Calls superclass method BaseService::instance
# File lib/popbill/taxinvoice.rb, line 6
def instance(linkID, secretKey)
  super(linkID, secretKey)
  @instance ||= new
  @instance.addScope("110")
  return @instance
end

Public Instance Methods

accept(corpNum, mgtKeyType, mgtKey, memo = '', userID = '') click to toggle source
# File lib/popbill/taxinvoice.rb, line 217
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 = '') click to toggle source
# File lib/popbill/taxinvoice.rb, line 697
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 = '') click to toggle source
# File lib/popbill/taxinvoice.rb, line 474
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 = '') click to toggle source
# File lib/popbill/taxinvoice.rb, line 653
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 = '') click to toggle source
# File lib/popbill/taxinvoice.rb, line 283
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 = '') click to toggle source
# File lib/popbill/taxinvoice.rb, line 354
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 = '') click to toggle source
# File lib/popbill/taxinvoice.rb, line 198
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 = '') click to toggle source
# File lib/popbill/taxinvoice.rb, line 734
def checkCertValidation(corpNum, userID = '')
  if corpNum.length != 10
    raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
  end

  httpget("/Taxinvoice/CertCheck", corpNum, userID)
end
checkMgtKeyInUse(corpNum, mgtKeyType, mgtKey) click to toggle source
# File lib/popbill/taxinvoice.rb, line 51
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 = '') click to toggle source
# File lib/popbill/taxinvoice.rb, line 163
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 = '') click to toggle source
# File lib/popbill/taxinvoice.rb, line 498
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 = '') click to toggle source
# File lib/popbill/taxinvoice.rb, line 236
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 = '') click to toggle source
# File lib/popbill/taxinvoice.rb, line 675
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) click to toggle source
# File lib/popbill/taxinvoice.rb, line 37
def getCertificateExpireDate(corpNum)
  if corpNum.length != 10
    raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
  end
  httpget("/Taxinvoice?cfg=CERT", corpNum)['certificateExpiration']
end
getChargeInfo(corpNum, userID = "") click to toggle source
# File lib/popbill/taxinvoice.rb, line 16
def getChargeInfo(corpNum, userID = "")
  if corpNum.length != 10
    raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
  end
  httpget("/Taxinvoice/ChargeInfo", corpNum, userID)
end
getDetailInfo(corpNum, mgtKeyType, mgtKey, userID = '') click to toggle source
# File lib/popbill/taxinvoice.rb, line 151
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
getEPrintURL(corpNum, mgtKeyType, mgtKey, userID = '') click to toggle source
# File lib/popbill/taxinvoice.rb, line 556
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
getEmailPublicKeys(corpNum) click to toggle source
# File lib/popbill/taxinvoice.rb, line 44
def getEmailPublicKeys(corpNum)
  if corpNum.length != 10
    raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
  end
  httpget("/Taxinvoice/EmailPublicKeys", corpNum)
end
getFiles(corpNum, mgtKeyType, mgtKey, userID = '') click to toggle source
# File lib/popbill/taxinvoice.rb, line 486
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 = '') click to toggle source
# File lib/popbill/taxinvoice.rb, line 126
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 = '') click to toggle source
# File lib/popbill/taxinvoice.rb, line 137
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 = '') click to toggle source
# File lib/popbill/taxinvoice.rb, line 462
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 = '') click to toggle source
# File lib/popbill/taxinvoice.rb, line 567
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 = '') click to toggle source
# File lib/popbill/taxinvoice.rb, line 578
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
getPDFURL(corpNum, mgtKeyType, mgtKey, userID = '') click to toggle source
# File lib/popbill/taxinvoice.rb, line 534
def getPDFURL(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=PDF", corpNum, userID)['url']
end
getPopUpURL(corpNum, mgtKeyType, mgtKey, userID = '') click to toggle source
# File lib/popbill/taxinvoice.rb, line 512
def getPopUpURL(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 = '') click to toggle source
# File lib/popbill/taxinvoice.rb, line 523
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) click to toggle source

팝빌 인감 및 첨부문서 등록 URL

# File lib/popbill/taxinvoice.rb, line 743
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) click to toggle source

공인인증서 등록 URL

# File lib/popbill/taxinvoice.rb, line 753
def getTaxCertURL(corpNum, userID)
  if corpNum.length != 10
    raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
  end

  response = httpget("/?TG=CERT", corpNum, userID)
  response['url']
end
getURL(corpNum, togo, userID = "") click to toggle source
# File lib/popbill/taxinvoice.rb, line 23
def getURL(corpNum, togo, userID = "")
  if corpNum.length != 10
    raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
  end
  httpget("/Taxinvoice/?TG=" + togo, corpNum, userID)['url']
end
getUnitCost(corpNum) click to toggle source
# File lib/popbill/taxinvoice.rb, line 30
def getUnitCost(corpNum)
  if corpNum.length != 10
    raise PopbillException.new('-99999999', '사업자등록번호가 올바르지 않습니다.')
  end
  httpget("/Taxinvoice?cfg=UNITCOST", corpNum)['unitCost']
end
getViewURL(corpNum, mgtKeyType, mgtKey, userID = '') click to toggle source
# File lib/popbill/taxinvoice.rb, line 545
def getViewURL(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=VIEW", corpNum, userID)['url']
end
issue(corpNum, mgtKeyType, mgtKey, forceIssue = false, memo = '', emailSubject = '', userID) click to toggle source
# File lib/popbill/taxinvoice.rb, line 255
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 = '') click to toggle source
# File lib/popbill/taxinvoice.rb, line 710
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 = '') click to toggle source
# File lib/popbill/taxinvoice.rb, line 335
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
registIssue(corpNum, taxinvoice, writeSpecification = false, forceIssue = false, dealInvoiceMgtKey = '', memo = '', emailSubject = '', userID = '') click to toggle source
# File lib/popbill/taxinvoice.rb, line 82
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 = '') click to toggle source
# File lib/popbill/taxinvoice.rb, line 302
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
register(corpNum, taxinvoice, writeSpecification = false, userID = '') click to toggle source
# File lib/popbill/taxinvoice.rb, line 70
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
request(corpNum, mgtKeyType, mgtKey, memo = '', userID = '') click to toggle source
# File lib/popbill/taxinvoice.rb, line 316
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
send(corpNum, mgtKeyType, mgtKey, memo = '', emailSubject = '', userID = '') click to toggle source
# File lib/popbill/taxinvoice.rb, line 175
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 = '') click to toggle source
# File lib/popbill/taxinvoice.rb, line 386
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 = '') click to toggle source
# File lib/popbill/taxinvoice.rb, line 436
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 = '') click to toggle source
# File lib/popbill/taxinvoice.rb, line 405
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 = '') click to toggle source
# File lib/popbill/taxinvoice.rb, line 374
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 = '') click to toggle source
# File lib/popbill/taxinvoice.rb, line 113
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 = '') click to toggle source
# File lib/popbill/taxinvoice.rb, line 718
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