Method: StatementService#attachStatement

Defined in:
lib/popbill/statement.rb

#attachStatement(corpNum, itemCode, mgtKey, subItemCode, subMgtKey, userID = '') ⇒ Object



430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
# File 'lib/popbill/statement.rb', line 430

def attachStatement(corpNum, itemCode, mgtKey, subItemCode, subMgtKey, 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 subItemCode.to_s == ''
    raise PopbillException.new('-99999999', '전자명세서 종류코드가 입력되지 않았습니다.')
  end
  if subMgtKey.to_s == ''
    raise PopbillException.new('-99999999', '전자명세서 문서번호가 입력되지 않았습니다.')
  end

  postData = {}
  postData["ItemCode"] = subItemCode
  postData["MgtKey"] = subMgtKey
  postData = postData.to_json

  httppost("/Statement/#{itemCode}/#{mgtKey}/AttachStmt", corpNum, postData, "", userID)
end