예제 #1
0
        // 현금영수증 임시저장
        private void btnRegister_Click(object sender, EventArgs e)
        {
            Cashbill cashbill = new Cashbill();

            cashbill.mgtKey            = txtMgtKey.Text;  // 문서관리번호, 발행자별 고유번호 할당, 1~24자리 영문,숫자조합으로 중복없이 구성.
            cashbill.tradeType         = "승인거래";          // 승인거래 or 취소거래
            cashbill.franchiseCorpNum  = txtCorpNum.Text; // 가맹점 사업자번호
            cashbill.franchiseCorpName = "발행자 상호";
            cashbill.franchiseCEOName  = "발행자 대표자";
            cashbill.franchiseAddr     = "발행자 주소";
            cashbill.franchiseTEL      = "070-1234-1234";
            cashbill.identityNum       = "01041680206"; // 거래처 식별번호
            cashbill.customerName      = "고객명";
            cashbill.itemName          = "상품명";
            cashbill.orderNumber       = "주문번호";
            cashbill.email             = "*****@*****.**";
            cashbill.hp           = "111-1234-1234";
            cashbill.fax          = "777-444-3333";
            cashbill.serviceFee   = "0";       // 봉사료
            cashbill.supplyCost   = "10000";   // 공급가액
            cashbill.tax          = "1000";    // 세액
            cashbill.totalAmount  = "11000";   // 합계금액
            cashbill.tradeUsage   = "소득공제용";   // 소득공제용 or 지출증빙용
            cashbill.taxationType = "과세";      // 세 or 비과세

            cashbill.smssendYN = false;

            try
            {
                Response response = cashbillService.Register(txtCorpNum.Text, cashbill, txtUserId.Text);

                MessageBox.Show(response.message);
            }
            catch (PopbillException ex)
            {
                MessageBox.Show(ex.code.ToString() + " | " + ex.Message);
            }
        }
        /*
         * 1건의 현금영수증을 [임시저장]합니다.
         * - [임시저장] 상태의 현금영수증은 발행(Issue API)을 호출해야만 국세청에 전송됩니다.
         */
        public IActionResult Register()
        {
            // 현금영수증 정보 객체
            Cashbill cashbill = new Cashbill();

            // 문서번호, 사업자별로 중복되지 않도록 문서번호 할당
            // 1~24자리 영문,숫자,'-','_' 조합 구성
            cashbill.mgtKey = "20211227-CoreR001";

            // [취소거래시 필수] 원본 현금영수증 국세청승인번호
            cashbill.orgConfirmNum = "";

            // [취소거래시 필수] 원본 현금영수증 거래일자
            cashbill.orgTradeDate = "";

            // 문서형태, { 승인거래, 취소거래 } 중 기재
            cashbill.tradeType = "승인거래";

            // 거래구분, { 소득공제용, 지출증빙용 } 중 기재
            cashbill.tradeUsage = "소득공제용";

            // 거래유형, { 일반, 도서공연, 대중교통 } 중 기재
            cashbill.tradeOpt = "도서공연";

            // 과세형태, { 과세, 비과세 } 중 기재
            cashbill.taxationType = "과세";

            // 거래금액 ( 공급가액 + 세액 + 봉사료 )
            cashbill.totalAmount = "11000";

            // 공급가액
            cashbill.supplyCost = "10000";

            // 부가세
            cashbill.tax = "1000";

            // 봉사료
            cashbill.serviceFee = "0";

            // 가맹점 사업자번호
            cashbill.franchiseCorpNum = corpNum;

            // 가맹점 종사업장 식별번호
            cashbill.franchiseTaxRegID = "";

            // 가맹점 상호
            cashbill.franchiseCorpName = "가맹점 상호";

            // 가맹점 대표자 성명
            cashbill.franchiseCEOName = "가맹점 대표자";

            // 가맹점 주소
            cashbill.franchiseAddr = "가맹점 주소";

            // 가맹점 전화번호
            cashbill.franchiseTEL = "070-1234-1234";

            // 식별번호
            // 거래구분(tradeUsage) - '소득공제용' 인 경우 주민등록/휴대폰/카드번호 기재 가능
            // 거래구분(tradeUsage) - '지출증빙용' 인 경우 사업자번호/주민등록/휴대폰/카드번호 기재 가능
            cashbill.identityNum = "2";

            // 주문자명
            cashbill.customerName = "주문자명";

            // 주문상품명
            cashbill.itemName = "주문상품명";

            // 주문번호
            cashbill.orderNumber = "주문번호";

            // 주문자 이메일
            // 팝빌 개발환경에서 테스트하는 경우에도 안내 메일이 전송되므로,
            // 실제 거래처의 메일주소가 기재되지 않도록 주의
            cashbill.email = "";

            // 주문자 휴대폰
            cashbill.hp = "";

            // 주문자 팩스번호
            cashbill.fax = "";

            // 발행시 알림문자 전송여부
            cashbill.smssendYN = false;

            try
            {
                var response = _cashbillService.Register(corpNum, cashbill, userID);
                return(View("Response", response));
            }
            catch (PopbillException pe)
            {
                return(View("Exception", pe));
            }
        }