Method: TaxinvoiceService#attachStatement

Defined in:
lib/popbill/taxinvoice.rb

#attachStatement(corpNum, mgtKeyType, mgtKey, itemCode, stmtMgtKey, userID = '') ⇒ Object



696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
# File 'lib/popbill/taxinvoice.rb', line 696

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