This commit is contained in:
kdh0120 2020-12-08 23:54:54 +00:00
parent 8dcee39196
commit 80777e7b10
8 changed files with 323 additions and 9 deletions

View File

@ -513,6 +513,10 @@ namespace NP.Base.Controllers
{
var rtn = new Hashtable() { };
var h = Dao.Get<Pay>("pay.pay", new Hashtable() { { "payno", payno }, { "userno", SUserInfo.UserNo },{"pstatus",1 },{ "rstatusnot",2} }).FirstOrDefault();
if(h == null)
{
return JsonBack(new JsonRtn() { code = -1 });
}
rtn.Add("h", h);
if (h != null)
{
@ -569,7 +573,25 @@ namespace NP.Base.Controllers
return JsonOK(Dao.Save("pay.payrfdcancel.up", p));
}
[HttpPost]
public JsonResult ShowPayTax(Int64 payno)
{
var rtn = new Hashtable() { };
var PayTaxes = Dao.Get<PayTax>("cr.paytaxes", new Hashtable() { { "payno",payno } });
if(PayTaxes.Count() < 1)
{
return JsonBack(new JsonRtn() { code = -1 });
}
var paytax = Dao.Get<PayTax>("cr.paytaxes", new Hashtable() { { "payno", payno } }).FirstOrDefault();
rtn.Add("paytax", paytax);
IList<File> filelist = new List<File>() { };
if (paytax.fgno != null)
{
filelist = GetFiles(paytax.fgno.Value);
}
rtn.Add("filelist", filelist);
return JsonBack(rtn);
}
}
}

View File

@ -1363,10 +1363,11 @@
,c.tyear,c.tseq
,u.username,u.userid
,ass.asname
,e.payno,e.pstatus,e.payamt,e.ptype,e.ispg,e.pgkey
,e.payno,e.pstatus,e.payamt,e.ptype,e.ispg,e.pgkey,e.payoktime,e.rstatus
,e2.pino,e2.payamt pipayamt,e2.itemname
,f.estart,f.eend
,cc.cname studyplacename
,pt.taxno,pt.taxdate
,pt.taxno,pt.taxdate taxdate2
,a.cdt
,row_number() over(order by a.cdt desc) rno
,count(a.lectno) over() pagetotalcount
@ -1374,6 +1375,18 @@
inner join cm b on b.cmno = a.cmno
inner join term c on c.tmno = b.tmno
inner join pay e on e.payno = a.payno
left outer join(
select c.payno,c.pino,c.payamt
,case c.ptype when 0 then c0.cname when 2 then c2.bkname when 4 then c0.cname when 3 then c3.exname else '-' end itemname
from lect a
inner join pay b on b.payno = a.payno
left outer join payitem c on c.payno = b.payno
left outer join cm c0 on c.ptype in (0,1,4) and c0.cmno=c.itemno
left outer join book c2 on c.ptype=2 and c2.bkno=c.itemno
left outer join exam c3 on c.ptype=3 and c3.exno=c.itemno
where a.status=1 and a.ischanged = 0 <isNotNull property="userno">and a.userno = #userno#</isNotNull>
group by a.payno
) e2 on e2.payno = e.payno
left outer join users u on u.userno = a.userno
left outer join assign ass on ass.asno = u.asno
left outer join cminningscd f on f.cmisno = a.cmisno

View File

@ -12,7 +12,7 @@
<database>
<provider name="MySql" />
<!--테스트서버-->
<dataSource name="mysqlcon" connectionString="Server=218.232.111.111;Database=lmsynicte;User ID=ynicteadmin;password=dev1@#" />
<dataSource name="mysqlcon" connectionString="Server=218.232.111.111; Port=3306;Database=lmsynicte;User ID=ynicteadmin;password=dev1@#" />
</database>

View File

@ -84,7 +84,7 @@
}
</td>
<td class="ltaBtn" data-th="계산서/영수증 : ">
@if (item.pstatus == 1)
@if (item.pstatus == 1 && item.rstatus == 0)
{
if (item.ptype == 6)
{
@ -92,21 +92,29 @@
}
else if (item.ptype == 1 && item.ispg == 1)
{
<a href="#">[카드사 매출전표]</a>
<a href="#" onclick="javascript:viewtax(@(item.pgkey))">[영수증]</a>
}
else if (item.ptype == 3 && item.ispg == 1)
{
<a href="#">[서마터빌]</a>
//일단대체?
<a href="#" onclick="javascript:viewtax(@(item.pgkey))">[영수증]</a>
}
else
{
if (item.taxno > 0)
{
<a href="#">[@(item.taxdate == null ? "신청중" : "발행")]</a>
<a href="#" onclick="showtax(@(item.payno))">[@(item.taxdate2 == null ? "신청중" : "발행")]</a>
}
else
{
<a href="#">[요청]</a>
if (Convert.ToDateTime(Convert.ToDateTime(item.payoktime).ToString("yyyy-MM-dd")) <= Convert.ToDateTime(DateTime.Now.AddMonths(1).ToString("yyyy-MM-dd")))
{
<a href="#" onclick="calltax(@(item.payno),'@(string.Format("{0}:{1}:{2}:{3}:{4}:{5}:{6}",item.payamt.ToString("#,0")+"원",item.payoktime.ToString("yy-MM-dd"),item.ptypename2,item.ispg == 1 ? "PG" : "현장결제",item.itemname,item.pipayamt.ToString("#,0")+"원",item.pino))')">[요청]</a>
}
else
{
<a href="#" onclick="alert('계산서 요청 기한이 지나 신청이 불가능합니다.'); return;">[요청]</a>
}
}
}
}
@ -119,6 +127,150 @@
}
</tbody>
</table>
<div class="mpgPop mpgPopFull" style="display:none;" id="pop1">
<div>
<div>
<div class="mpgPopWrap wdth650">
<div class="mpgPopTitle"><h5>계산서발행요청</h5><a href="#" onclick="javascript:mpgPopClose();"></a></div>
<div class="mpgPopScroll">
<div class="odrPop pop1box">
<h4 class="bskTitle">상품선택</h4>
<table class="odrTable th150">
<tr><th>총결제액/입금일</th><td id="mpttxt1"></td></tr>
<tr><th>결제방법</th><td id="mpttxt2"></td></tr>
<tr>
<th>신청강좌</th>
<td id="mpttxt3"></td>
</tr>
<tr>
<th>발행요청금액</th>
<td id="mpttxt4"></td>
</tr>
<tr>
<th>청구구분</th>
<td>
<input type="hidden" name="isreceipt" id="isreceipt" />
<ul class="bakRadio">
<li><input type="radio" name="isreceipts" id="isreceipt1" checked="checked" /><label for="isreceipt1">영수</label></li>
<li><input type="radio" name="isreceipts" id="isreceipt0" /><label for="isreceipts0">청구</label></li>
</ul>
</td>
</tr>
</table>
<form id="mform" method="post" enctype="multipart/form-data">
<input type="hidden" id="pinos" name="pinos" value=""/>
<input type="hidden" id="mptpayno" name="payno" value="" />
<h4 class="bskTitle">발행업체 정보</h4>
<table class="odrTable th150">
<tr class="pd5"><th>회사명</th><td><input type="text" name="asname" id="asname" value="" /></td></tr>
<tr class="pd5">
<th>대표자</th>
<td><input type="text" name="ceoname" id="ceoname" value="" /></td>
</tr>
<tr class="pd5">
<th>사업자등록번호</th>
<td><input type="text" name="brno" id="brno" value="" maxlength="12" /></td>
</tr>
<tr class="pd5">
<th>법인등록번호</th>
<td><input type="text" name="grno" id="grno" value="" maxlength="14" /></td>
</tr>
<tr class="pd5">
<th>업태</th>
<td><input type="text" name="btype" id="btype" value="" /></td>
</tr>
<tr class="pd5">
<th>종목</th>
<td><input type="text" name="bkind" id="bkind" value="" /></td>
</tr>
<tr class="pd5">
<th>담당자</th>
<td><input type="text" name="manname" id="manname" value="" /></td>
</tr>
<tr class="pd5">
<th>연락처</th>
<td><input type="text" name="telno" id="telno" value="" /></td>
</tr>
<tr class="pd5">
<th>이메일주소</th>
<td><input type="text" name="email" id="email" value="" /></td>
</tr>
<tr class="pd5" id="file">
<th>사업자등록증첨부</th>
<td><input type="file" name="file1" id="file1" value="" /></td>
</tr>
<tr class="pd5">
<th>기재사항</th>
<td><input type="text" name="taxinfo" id="taxinfo" value="" /></td>
</tr>
</table>
</form>
<ul class="odrPopBtn col1" id="paytaxbtn">
<li><a href="#" onclick="save()" class="bk">계산서 발행요청</a></li>
</ul>
</div><!-- clsPopCont -->
</div>
</div><!-- clsPopWrap -->
</div>
</div>
</div>
<div class="mpgPop mpgPopFull" style="display:none;" id="pop2">
<div>
<div>
<div class="mpgPopWrap wdth650">
<div class="mpgPopTitle"><h5>계산서발행요청</h5><a href="#" onclick="javascript:mpgPopClose();"></a></div>
<div class="mpgPopScroll">
<div class="odrPop pop2box">
<h4 class="bskTitle">발행업체 정보</h4>
<table class="odrTable th150">
<tr class="pd5"><th>회사명</th><td><input type="text" name="tasname" id="tasname" disabled value="" /></td></tr>
<tr class="pd5">
<th>대표자</th>
<td><input type="text" name="tceoname" id="tceoname" disabled value="" /></td>
</tr>
<tr class="pd5">
<th>사업자등록번호</th>
<td><input type="text" name="tbrno" id="tbrno" disabled value="" maxlength="12" /></td>
</tr>
<tr class="pd5">
<th>법인등록번호</th>
<td><input type="text" name="tgrno" id="tgrno" disabled value="" maxlength="14" /></td>
</tr>
<tr class="pd5">
<th>업태</th>
<td><input type="text" name="tbtype" id="tbtype" disabled value="" /></td>
</tr>
<tr class="pd5">
<th>종목</th>
<td><input type="text" name="tbkind" id="tbkind" disabled value="" /></td>
</tr>
<tr class="pd5">
<th>담당자</th>
<td><input type="text" name="tmanname" id="tmanname" disabled value="" /></td>
</tr>
<tr class="pd5">
<th>연락처</th>
<td><input type="text" name="ttelno" id="ttelno" disabled value="" /></td>
</tr>
<tr class="pd5">
<th>이메일주소</th>
<td><input type="text" name="temail" id="temail" disabled value="" /></td>
</tr>
<tr class="pd5" id="file">
<th>사업자등록증첨부</th>
<td id="tfile"></td>
</tr>
<tr class="pd5">
<th>기재사항</th>
<td><input type="text" name="ttaxinfo" id="ttaxinfo" disabled value="" /></td>
</tr>
</table>
</div><!-- clsPopCont -->
</div>
</div><!-- clsPopWrap -->
</div>
</div>
</div>
@Html.Pager2((int)Model.pagenum, 10, Model.pagerowcount, Model.pagetotalcount)
@section scripts{
<script>
@ -143,6 +295,124 @@
function viewtax(pgkey) {
showReceiptByTID('@(ViewBag.mid)', pgkey, @(ViewBag.mid)+pakey+@(ViewBag.mertkey));
}
function calltax(payno, datas) {
if (datas != null) {
$("#mpttxt1").text(datas.split(':')[0] + " (" + datas.split(':')[1] + ")");
$("#mpttxt2").text(datas.split(':')[2] + " (" + datas.split(':')[3] + ")");
$("#mpttxt3").text(datas.split(':')[4]);
$("#mpttxt4").text(datas.split(':')[5]);
$("#pinos").val(datas.split(':')[6])
$("#mptpayno").val(payno);
capp("/fcommon/paytaxget", { payno: payno}, "cbpaytaxget");
} else {
$("#mpttxt1").text("");
$("#mpttxt2").text("");
$("#mpttxt3").text("");
$("#mpttxt4").text("");
$("#pinos").val("")
$("#mptpayno").val("");
msg("결제완료내역만 계산서요청하실 수 있습니다.");
}
}
function cbpaytaxget() {
var h = capResult.obj.h;
var d = capResult.obj.d;
if (h != null && d.length > 0) {
setv("asname", h.asname);
setv("ceoname", h.ceoname);
setv("brno", h.brno);
setv("grno", h.grno);
setv("btype", h.btype);
setv("bkind", h.bkind);
setv("manname", h.manname);
setv("telno", h.telno);
setv("email", h.email);
$('html, body').addClass('lock');
$("#pop1").fadeIn("fast", function () {
$(".pop1box").scrollTop(0);
});
} else {
msg("이미 계산서를 접수중이거나 환불된 결제건입니다.");
}
}
function save() {
if (check("asname", null, "회사명을 입력해주세요.")) { }
else if (check("ceoname", null, "대표자명을 입력해주세요.")) { }
else if (check("brno", null, "사업자등록번호를 입력해주세요.")) { }
else if (check("grno", null, "법인등록번호를 입력해주세요.")) { }
else if (check("btype", null, "업태를 입력해주세요.")) { }
else if (check("bkind", null, "종목을 입력해주세요.")) { }
else if (check("manname", null, "담당자를 입력해주세요.")) { }
else if (check("telno", null, "연락처를 입력해주세요.")) { }
else if (check("email", null, "이메일주소를 입력해주세요.")) { }
else if (!isemail(val("email"))) { msg("이메일 형식이 올바르지 않습니다. 다시 입력해주세요."); }
else {
setv("isreceipt", $("#isreceipt1").prop("checked") ? 1 : 0);
confirmtoggle(true, "계산서발행요청 이후, 수정 및 철회는 고객문의 게시판을 이용해주십시오. 계산서 발행 요청을 완료하시겠습니까?", "gogo()");
}
}
function gogo() {
capfileform('/fcommon/paytaxsave', 'mform', 'cbgogo');
}
function cbgogo() {
if (capResult.code == 1000) {
msg("접수되었습니다.");
setTimeout(function () {
$("#mform").attr("action", "/My/Document").submit()
}, 1000);
} else if (capResult.code == -1) {
msg("이미 신청된 계산서가 존재합니다.");
}
}
function showtax(payno) {
$("#tasname").val("");
$("#tceoname").val("");
$("#tbrno").val("");
$("#tgrno").val("");
$("#tbtype").val("");
$("#tbkind").val("");
$("#tmanname").val("");
$("#ttelno").val("");
$("#temail").val("");
$("#ttaxinfo").val("");
$("#tfile").html("");
capp('/fcommon/showpaytax', { payno: payno }, "cbshowtax");
}
function cbshowtax() {
var paytax = capResult.obj.paytax;
var filelist = capResult.obj.filelist;
if (capResult.code == 1000) {
if (paytax != null) {
$("#tasname").val(paytax.asname);
$("#tceoname").val(paytax.ceoname);
$("#tbrno").val(paytax.brno);
$("#tgrno").val(paytax.grno);
$("#tbtype").val(paytax.btype);
$("#tbkind").val(paytax.bkind);
$("#tmanname").val(paytax.manname);
$("#ttelno").val(paytax.telno);
$("#temail").val(paytax.email);
$("#ttaxinfo").val(paytax.taxinfo);
$('html, body').addClass('lock');
if (filelist.length > 0) {
var file = "";
$.each(filelist, function (i, d) {
file += "<a href=\"/focommon/downfile?fno=" + d.fileno + "\">" + d.orgname + "</a><br/>";
});
$("#tfile").html(file);
}
$("#pop2").fadeIn("fast", function () {
$(".pop2box").scrollTop(0);
});
} else {
msg("신청된 계산서가 없습니다.");
}
} else {
msg("신청된 계산서가 없습니다.");
}
}
</script>
@if (ViewBag.isPayTest == "1")
{

View File

@ -922,10 +922,17 @@ namespace NP.Model
public int ptype { get; set; }
public int ispg { get; set; }
public String ptypename { get; set; }
public String ptypename2 {
get
{
return ptype == 1 ? "신용카드" : ptype == 2 ? "계좌이체" : ptype == 3 ? "가상계좌" : ptype == 4 ? "현금" : ptype == 5 ? "복합" : ptype == 6 ? "무료" : ptype == 9 ? "위탁" : "-";
}
}
public int? pcno { get; set; }
public String pcno2 { get; set; }
public String pcname { get; set; }
public int payamt { get; set; }
public int pipayamt { get; set; }
public int payamtcash { get; set; }
public int payamtcard { get; set; }
public String payamt2 { get; set; }
@ -1080,6 +1087,7 @@ namespace NP.Model
public String studyplacename { get; set; }
public int taxno { get; set; }
public DateTime taxdate { get; set; }
public DateTime? taxdate2 { get; set; }
public Int64 cmisno { get; set; }
/// <summary>
/// 기술인분류
@ -1103,6 +1111,7 @@ namespace NP.Model
}
}
public String pgkey { get; set; }
public String itemname { get; set; }
}
/// <summary>
/// 자격검정시험