Files
sake/src/main/webapp/WEB-INF/views/sopmal/ordr/PayKcpCashRegC.jsp
2025-10-29 17:08:05 +09:00

415 lines
18 KiB
Plaintext

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui"%>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld"%>
<%--
Class Name : PayKcpCashRegC.jsp
Description : kcp현금영수증발급
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-06-12 이경숙 최초 생성
--%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>현금영수증 발급 샘플페이지</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=yes, target-densitydpi=medium-dpi">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="-1">
<link href="../static/css/style.css" rel="stylesheet" type="text/css" id="cssLink"/>
<script src="<c:url value='/pc/vendor/jquery-3.7.1.min.js'/>"></script>
<script src="<c:url value='/pc/vendor/jquery-ui/jquery-ui.min.js'/>"></script>
<script type="text/javascript">
/**************************************************************
* 현금영수증 발급
****************************************************************/
$(document).ready(function() {
$('#content').hide();
$('#payment-button').on('click', function(event) {
const url = '<c:url value="/sopmal/pay/CashReceipt"/>';
event.preventDefault(); // 기본 폼 제출 동작 취소
$.ajax({
type: 'post',
url: url,
data:$('#registForm').serialize(),
success : function(data) {
if (data.resBody != null) {
const result = JSON.parse(data.resBody.result);
$('#rstTitle').text("현금영수증 발급");
$('#app_time').text(result.response.app_time);
$('#reg_stat').text(result.response.reg_stat);
$('#self_force_yn').text(result.response.self_force_yn);
$('#res_msg').text(result.response.res_msg);
$('#receipt_no').text(result.response.receipt_no);
$('#reg_desc').text(result.response.reg_desc);
$('#cash_no').text(result.response.cash_no);
$('#res_cd').text(result.response.res_cd);
$('#content').show();
}
console.log('response.receiptKey:', result.response.receiptKey);
},
error: function(error) {
console.error('Error fetching data:', error);
}
});
});
});
// 주문번호 생성 예제
function init_orderid()
{
var today = new Date();
var year = today.getFullYear();
var month = today.getMonth()+ 1;
var date = today.getDate();
var time = today.getTime();
let hours = today.getHours();
let minutes = today.getMinutes();
let seconds = today.getSeconds();
if(parseInt(month) < 10) { month = "0" + month; }
if(parseInt(date) < 10) { date = "0" + date; }
hours = hours < 10 ? '0' + hours : hours;
minutes = minutes < 10 ? '0' + minutes : minutes;
seconds = seconds < 10 ? '0' + seconds : seconds;
//var vOrderID = "TEST" + year + "" + month + "" + date + "" + time;
var vOrderID = "TEST" + year + "" + month + "" + date + "" + hours + "" + minutes + "" + seconds;
document.forms[0].orderId.value = vOrderID;
}
//발행 용도에 따른 신분확인 ID 입력값 변경 예제
function jsf__chk_tr_code( form )
{
var span_tr_code_0 = document.getElementById( "span_tr_code_0" );
var span_tr_code_1 = document.getElementById( "span_tr_code_1" );
if ( form.tr_code[0].checked )
{
span_tr_code_0.style.display = "block";
span_tr_code_1.style.display = "none";
}
else if (form.tr_code[1].checked )
{
span_tr_code_0.style.display = "none";
span_tr_code_1.style.display = "block";
}
}
// 입점용 판매 화면 로직
function typeChk( form )
{
if (form.corp_type[0].checked )
{
cash_type.style.display = "none";
}
else if (form.corp_type[1].checked)
{
cash_type.style.display = "block";
}
}
</script>
</head>
<body onload="init_orderid();">
<div class="wrap">
<form name="registForm" id="registForm">
<input type="hidden" name="shopMallCd" value="NC"/>
<!-- header -->
<div class="header">
<h1 class="title">현금영수증 발급 SAMPLE</h1>
</div>
<!-- //header -->
<!-- 타이틀 Start -->
<div id="skipCont" class="contents">
<p class="txt-type-1">이 페이지는 현금영수증 발급 요청하는 샘플(예시) 페이지입니다.</p>
<p class="txt-type-2">소스 수정 시 [※ 필수] 또는 [※ 옵션] 표시가 포함된 문장은 가맹점의 상황에 맞게 적절히 수정 적용하시기 바랍니다.</p>
<!-- 타이틀 End -->
<!-- 상단 테이블 Start -->
<div class="sample">
<!-- 상단 테이블 End -->
<h2 class="title-type-3">현금영수증 등록 요청 정보</h2>
<ul class="list-type-1">
<li>
<div class="left"><p class="title">주문번호</p></div>
<div class="right">
<div class="ipt-type-1 pc-wd-2">
<input type="text" name="orderId" value="" maxlength="40" />
<a href="#none" class="btn-clear"></a>
</div>
</div>
</li>
<li>
<div class="left"><p class="title">상품명</p></div>
<div class="right">
<div class="ipt-type-1 pc-wd-2">
<input type="text" name="orderName" value="핸드폰" maxlength="40" />
<a href="#none" class="btn-clear"></a>
</div>
</div>
</li>
<li>
<div class="left"><p class="title">주문자 이름</p></div>
<div class="right">
<div class="ipt-type-1 pc-wd-2">
<input type="text" name="buyrName" value="홍길동" maxlength="40" />
<a href="#none" class="btn-clear"></a>
</div>
</div>
</li>
<li>
<div class="left"><p class="title">주문자 E-Mail</p></div>
<div class="right">
<div class="ipt-type-1 pc-wd-2">
<input type="text" name="buyrMail" value="test@kcp.co.kr" maxlength="40" />
<a href="#none" class="btn-clear"></a>
</div>
</div>
</li>
</ul>
<!-- 현금영수증 정보 출력 테이블 End -->
<!-- 현금영수증 발급 정보 테이블 Start -->
<h2 class="title-type-3">현금영수증 발급 요청 정보</h2>
<ul class="list-type-1">
<li>
<div class="left"><p class="title">사업장 구분</p></div>
<div class="right">
<div class="ipt-type-1 pc-wd-2">
<input type="radio" id="radio-2-1" class="ipt-radio-1" name="corpType" value="0" onchange="javascript:typeChk(this.form);" checked/>
<label for="radio-2-1"><span class="ico-radio"><span></span></span>직접 판매</label>
<input type="radio" id="radio-2-2" class="ipt-radio-1" name="corpType" value="1" onchange="javascript:typeChk(this.form);"/>
<label for="radio-2-2"><span class="ico-radio"><span></span></span>입점용 판매</label>
</div>
</div>
</li>
<li>
<div class="left"><p class="title">원 거래 시각</p></div>
<div class="right">
<div class="ipt-type-1 pc-wd-2">
<input type="text" name="tradTime" value="" maxlength="40" placeholder="YYYYMMDDHHMMSS"/>
<a href="#none" class="btn-clear"></a>
</div>
</div>
</li>
<li>
<div class="left"><p class="title">발행 용도</p></div>
<div class="right">
<div class="ipt-type-1 pc-wd-2">
<input type="radio" id="radio-2-5" class="ipt-radio-1" name="trCode" value="0" onClick="jsf__chk_tr_code( this.form )" checked/>
<label for="radio-2-5"><span class="ico-radio"><span></span></span>소득공제용</label>
<input type="radio" id="radio-2-6" class="ipt-radio-1" name="trCode" value="1" onClick="jsf__chk_tr_code( this.form )"/>
<label for="radio-2-6"><span class="ico-radio"><span></span></span>지출증빙용</label>
</div>
</div>
</li>
<li>
<div class="left"><p class="title">
<span id="span_tr_code_0" style="display:block;">휴대폰번호/현금영수증 카드</span>
<span id="span_tr_code_1" style="display:none;">사업자번호</span>
</p></div>
<div class="right">
<div class="ipt-type-1 pc-wd-2">
<input type="text" name="idInfo" value="" maxlength="20" placeholder="입력 시 '-' 제외" />
<a href="#none" class="btn-clear"></a>
</div>
</div>
</li>
<li>
<div class="left"><p class="title">거래금액 총합</p></div>
<div class="right">
<div class="ipt-type-1 pc-wd-2">
<input type="text" name="amtTot" value="" maxlength="40" placeholder="총 거래금액" />
<a href="#none" class="btn-clear"></a>
</div>
</div>
</li>
<li>
<div class="left"><p class="title">공급가액</p></div>
<div class="right">
<div class="ipt-type-1 pc-wd-2">
<input type="text" name="amtSup" value="" maxlength="40" placeholder="거래 총금액 / 1.1" />
<a href="#none" class="btn-clear"></a>
</div>
</div>
</li>
<li>
<div class="left"><p class="title">부가가치세</p></div>
<div class="right">
<div class="ipt-type-1 pc-wd-2">
<input type="text" name="amtTax" value="" maxlength="40" placeholder="공급가액의 10%"/>
<a href="#none" class="btn-clear"></a>
</div>
</div>
</li>
</ul><!--
<span id="cash_type" style="display:none">
<h2 class="title-type-3">입점몰 현금영수증 발행 정보</h2>
<ul class="list-type-1">
<li>
<div class="left"><p class="title">과세/면세 구분</p></div>
<div class="right">
<div class="ipt-type-1 pc-wd-2">
<input type="text" name="corp_tax_type" value="" maxlength="40" placeholder="TG01(과세) / TG02(면세)" />
<a href="#none" class="btn-clear"></a>
</div>
</div>
</li>
<li>
<div class="left"><p class="title">발행 사업자 번호</p></div>
<div class="right">
<div class="ipt-type-1 pc-wd-2">
<input type="text" name="corp_tax_no" value="" maxlength="40" placeholder="1234567890"/>
<a href="#none" class="btn-clear"></a>
</div>
</div>
</li>
<li>
<div class="left"><p class="title">입점몰 사업자 번호</p></div>
<div class="right">
<div class="ipt-type-1 pc-wd-2">
<input type="text" name="corp_sell_tax_no" value="" maxlength="40" placeholder="1234567890"/>
<a href="#none" class="btn-clear"></a>
</div>
</div>
</li>
<li>
<div class="left"><p class="title">입점몰 상호</p></div>
<div class="right">
<div class="ipt-type-1 pc-wd-2">
<input type="text" name="corp_nm" value="NHN KCP" maxlength="40" />
<a href="#none" class="btn-clear"></a>
</div>
</div>
</li>
<li>
<div class="left"><p class="title">입점몰 대표자명</p></div>
<div class="right">
<div class="ipt-type-1 pc-wd-2">
<input type="text" name="corp_owner_nm" value="홍길동" maxlength="40" />
<a href="#none" class="btn-clear"></a>
</div>
</div>
</li>
<li>
<div class="left"><p class="title">입점몰 사업장 주소</p></div>
<div class="right">
<div class="ipt-type-1 pc-wd-2">
<input type="text" name="corp_addr" value="서울시 구로구 구로동" maxlength="40" />
<a href="#none" class="btn-clear"></a>
</div>
</div>
</li>
<li>
<div class="left"><p class="title">입점몰 사업장 연락처</p></div>
<div class="right">
<div class="ipt-type-1 pc-wd-2">
<input type="text" name="corp_telno" value="02-0000-0000" maxlength="40" />
<a href="#none" class="btn-clear"></a>
</div>
</div>
</li>
<li>
<div class="left"><p class="title">입점몰 사업장 사이트 주소</p></div>
<div class="right">
<div class="ipt-type-1 pc-wd-2">
<input type="text" name="corp_site_url" value="" maxlength="40" placeholder="www.kcp.co.kr" />
<a href="#none" class="btn-clear"></a>
</div>
</div>
</li>
</ul>
</span> -->
<!-- 가맹점 정보 출력 테이블 End -->
<!-- 결제 버튼 테이블 Start -->
<div Class="Line-Type-1"></div>
<ul class="list-btn-2">
<li><input name="payment-button" id="payment-button" type="button" value="발급요청" class="btn-type-2 pc-wd-3"/></li>
</ul>
</div>
<!-- //contents -->
<div class="grid-footer">
<div class="inner">
<!-- footer -->
<div class="footer">
ⓒ NHN KCP Corp.
</div>
<!-- //footer -->
</div>
</div>
<!-- 요청종류 등록 요청시 사용 -->
<input type="hidden" name="req_tx" value="reg"/>
</form>
<br/><br/>===========================<br/><br/>
<div id="content">
<br/><span id="rstTitle"></span> 결과출력 <br/>
<p>app_time: <span id="app_time"></span></p>
<p>reg_stat: <span id="reg_stat"></span></p>
<p>self_force_yn: <span id="self_force_yn"></span></p>
<p>res_msg: <span id="res_msg"></span></p>
<p>receipt_no: <span id="receipt_no"></span></p>
<p>reg_desc: <span id="reg_desc"></span></p>
<p>cash_no: <span id="cash_no"></span></p>
<p>res_cd: <span id="res_cd"></span></p>
</div>
<!-- {"app_time":"20240613143756","reg_stat":"NTRW","self_force_yn":"N","res_msg":"정상처리","receipt_no":"591634528","reg_desc":"KCP등록완료","cash_no":"24415127242686","res_cd":"0000"} -->
</div>
</body>
</html>