Exemple #1
0
        private void btnUpdate_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.Update(txtCorpNum.Text, txtMgtKey.Text, cashbill, txtUserId.Text);

                MessageBox.Show(response.message);
            }
            catch (PopbillException ex)
            {
                MessageBox.Show(ex.code.ToString() + " | " + ex.Message);
            }
        }
        /*
         * 1건의 현금영수증을 [수정]합니다.
         * - [임시저장] 상태의 현금영수증만 수정할 수 있습니다.
         * - 국세청에 신고된 현금영수증은 수정할 수 없으며, 취소 현금영수증을 발행하여 취소처리 할 수 있습니다.
         */
        public IActionResult Update()
        {
            // 수정할 현금영수증 문서번호
            string mgtKey = "20211222-002";

            // 현금영수증 정보 객체
            Cashbill cashbill = new Cashbill();

            // [취소거래시 필수] 원본 현금영수증 국세청승인번호
            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.Update(corpNum, mgtKey, cashbill, userID);
                return(View("Response", response));
            }
            catch (PopbillException pe)
            {
                return(View("Exception", pe));
            }
        }