From 33c85d107279c12dd80453cd8d2679cda37f2bb2 Mon Sep 17 00:00:00 2001 From: lch Date: Wed, 28 Apr 2021 06:36:20 +0000 Subject: [PATCH] =?UTF-8?q?=EC=84=B8=EA=B8=88=EA=B3=84=EC=82=B0=EC=84=9C?= =?UTF-8?q?=20=EC=9E=91=EC=97=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Base/Controller/FCommonPay.cs | 30 ++++- Dao/MyBatis/Maps/CM.xml | 2 +- Dao/MyBatis/Maps/Lect.xml | 6 +- Dao/MyBatis/Maps/Pay.xml | 33 ++--- FO/Controllers/FOBaseController.cs | 51 +++++++- FO/Views/Course/ApplyPay.cshtml | 17 +-- FO/Views/My/Document.cshtml | 185 +++++++++++++++++++++-------- Model/CM.cs | 17 +++ Model/PPLog.cs | 1 + Model/Pay.cs | 12 ++ 10 files changed, 273 insertions(+), 81 deletions(-) diff --git a/Base/Controller/FCommonPay.cs b/Base/Controller/FCommonPay.cs index 5e25306..062fb5b 100644 --- a/Base/Controller/FCommonPay.cs +++ b/Base/Controller/FCommonPay.cs @@ -594,6 +594,34 @@ namespace NP.Base.Controllers rtn.Add("filelist", filelist); return JsonBack(rtn); } + #region 세금계산서 조회(팝빌 세금계산서 인쇄 url 리턴) + /// + /// 세금계산서 조회(팝빌 세금계산서 인쇄 url 리턴) + /// + /// + /// + [HttpPost] + public JsonResult PayTaxinvoiceView(long payno) + { + var payTax = Dao.Get("cr.paytaxes", new Hashtable() { { "payno", payno } }).Where(w=> w.cno == SUserInfo.UserNo).FirstOrDefault(); + if (payTax != null) + { + var result = Popbill.PopbillService.GetEPrintURL(payTax.mgtkey); + if (result.IsSuccess) + { + return JsonObj(result.Data); + } + else + { + return JsonError(JSONCode.Error, result.Message, result); + } + } + else + { + return JsonBack(new JsonRtn() { code = -1 }); + } + } + #endregion } - + } \ No newline at end of file diff --git a/Dao/MyBatis/Maps/CM.xml b/Dao/MyBatis/Maps/CM.xml index 046256f..20a2356 100644 --- a/Dao/MyBatis/Maps/CM.xml +++ b/Dao/MyBatis/Maps/CM.xml @@ -1888,7 +1888,7 @@ ,address2=#address2# ,btype =#btype# ,bkind =#bkind# - ,fgnobno=#fgnobno# + ,fgnobno=#fgnobno# ,eino=#eino# ,mname=#mname# ,mphone =case when #mphone# is not null then HEX(AES_ENCRYPT(#mphone#, )) else mphone end diff --git a/Dao/MyBatis/Maps/Lect.xml b/Dao/MyBatis/Maps/Lect.xml index 1e828da..23983aa 100644 --- a/Dao/MyBatis/Maps/Lect.xml +++ b/Dao/MyBatis/Maps/Lect.xml @@ -1508,15 +1508,15 @@ ,c.tyear,c.tseq ,u.username,u.userid ,ass.asname - ,e.payno,e.pstatus,e.payamt,e.ptype,e.ispg,e.pgkey,e.payoktime,e.rstatus + ,e.payno,e.pstatus,e.payamt,e.ptype,e.ispg,e.pgkey,e.payoktime,e.rstatus,e.iscashrct, e.isbill ,e2.pino,e2.payamt pipayamt,e2.itemname ,f.estart,f.eend ,cc.cname studyplacename ,cc.ccode studyplace - ,pt.taxno,pt.taxdate taxdate2 + ,pt.taxno,pt.taxdate taxdate2,pt.mgtkey,pt.iscancel ,a.cdt ,row_number() over(order by a.cdt desc) rno - ,count(a.lectno) over() pagetotalcount + ,count(a.lectno) over() pagetotalcount from lect a inner join cm b on b.cmno = a.cmno inner join term c on c.tmno = b.tmno diff --git a/Dao/MyBatis/Maps/Pay.xml b/Dao/MyBatis/Maps/Pay.xml index ff81a54..e5564ae 100644 --- a/Dao/MyBatis/Maps/Pay.xml +++ b/Dao/MyBatis/Maps/Pay.xml @@ -719,20 +719,18 @@ - select a.pplno,a.isready,a.cmno,a.cmisno,a.isrebate,a.rbankname,a.rbankacc,a.rbankowner,a.isaccommodation - ,b.payno,b.pstatus - ,a2.infee,a2.accommofee - from pplog a - inner join cm a2 on a2.cmno=a.cmno - left outer join pay b on b.pplno=a.pplno - + select a.pplno,a.isready,a.cmno,a.cmisno,a.isrebate,a.rbankname,a.rbankacc,a.rbankowner,a.isaccommodation + ,b.payno,b.pstatus + ,a2.infee,a2.accommofee + ,b.isbill + ,a.asname, a.ceoname, a.brno, a.btype, a.bkind, a.mname, a.post, a.address1, a.address2 + ,CAST(AES_DECRYPT(UNHEX(a.mphone), ) AS char) mphone + ,CAST(AES_DECRYPT(UNHEX(a.taxemail), ) AS char) taxemail + from pplog a + inner join cm a2 on a2.cmno=a.cmno + left outer join pay b on b.pplno=a.pplno + a.pplno=#pplno# a.userno=#userno# @@ -916,6 +918,7 @@ +
    • @@ -110,6 +110,7 @@ @Html.HiddenFor(m => m.exno) @Html.Hidden("pplno", Model.PPLog.pplno) + @@ -154,28 +155,22 @@ } else { $(".cashnot").addClass("hide"); } - }); - $("input[name='isbill']").on("change", function () { - if ($("#pay0203").prop("checked")) { - $("#pay0203").val(1); - } - else { - $("#pay0203").val(0); - } - }); + }); }); function save() { $("#cashrcthp").val(""); + $("#isbill").val(""); if ($("input[name='ptype']:checked").length > 0 && $("input[name='ptype']:checked").val() == 1) { $("#pay0201").prop("checked", true); } else if ($("input[name='ptype']:checked").length > 0 && $("input[name='ptype']:checked").val() == 3 && $("input[name='iscashrct']:checked").length == 1 && $("input[name='iscashrct']:checked").val() == 1) { $("#cashrcthp").val($("#hp1").val() + $("#hp2").val() + $("#hp3").val()); + } else if ($("input[name='ptype']:checked").length > 0 && $("input[name='ptype']:checked").val() == 3 && $("input[name='iscashrct']:checked").length == 1 && $("input[name='iscashrct']:checked").val() == 2) { + $("#isbill").val("1"); } if ($("input[name='ptype']:checked").length < 1) { msg("결제방법을 선택해주세요."); } else if ($("input[name='ptype']:checked").val() == 3 && $("input[name='iscashrct']:checked").length < 1) { msg("현금영수증 발행여부를 선택해주세요."); - $("#pay0203").prop("checked", false); } else if ($("input[name='ptype']:checked").val() == 3 && $("input[name='iscashrct']:checked").val() == 1 && !ismobilenumber($("#cashrcthp").val())) { msg("현금영수증 발행 핸드폰번호를 올바르게 입력해주세요."); } diff --git a/FO/Views/My/Document.cshtml b/FO/Views/My/Document.cshtml index faaff3b..947f515 100644 --- a/FO/Views/My/Document.cshtml +++ b/FO/Views/My/Document.cshtml @@ -20,7 +20,7 @@
    -@Html.HiddenFor(w=>w.tabidx) + @Html.HiddenFor(w => w.tabidx)
    신규과정 |  @@ -109,31 +109,43 @@ { @Html.Raw("-") } - else if (item.ptype == 1 && item.ispg == 1) + else if (item.ptype == 1 && item.ispg == 1) /*신용카드*/ { - [영수증] + [인쇄] } - //현금영수증안붙었음 - @*else if (item.ptype == 3 && item.ispg == 1) - { - //일단대체? - [영수증] - }*@ - else + else if (item.ptype == 3 && item.ispg == 1) /*가상계좌*/ { - if (item.taxno > 0) + if (item.iscashrct == 1) /*현금영수증신청*/ { - [@(item.taxdate2 == null ? "신청중" : "발행")] + [인쇄] } else { - if (Convert.ToDateTime(Convert.ToDateTime(item.payoktime).ToString("yyyy-MM-dd")) <= Convert.ToDateTime(DateTime.Now.AddMonths(1).ToString("yyyy-MM-dd"))) + if (item.taxno > 0) /*세금계산서신청*/ { - [요청] + if (item.iscancel != 1 && item.taxdate2 != null && !string.IsNullOrEmpty(item.mgtkey)) /*취소 and 발행일 and 세금계산서문서번호 */ + { + [인쇄] + } + else if (item.iscancel == 1) /*취소시 일반영수증*/ + { + [인쇄] + } + else + { + [신청중] + } } else { - [요청] + if (item.payoktime < Convert.ToDateTime(DateTime.Now.AddMonths(1).ToString("yyyy-MM-11"))) /*입금확인후 익월 10일 이내까지 요청가능*/ + { + [요청] + } + else + { + [인쇄] + } } } } @@ -194,32 +206,32 @@ else
    계산서발행요청
    -

    상품선택

    - - - - - - - - - - - - - - - -
    총결제액/입금일
    결제방법
    신청강좌
    발행요청금액
    청구구분 - -
      -
    • -
    • -
    -
    + +

    상품선택

    + + + + + + + + + + + + + + + +
    총결제액/입금일
    결제방법
    신청강좌
    발행요청금액
    청구구분 +
      +
    • +
    • +
    +

    발행업체 정보

    @@ -255,6 +267,23 @@ else + + + + + + + + + + @@ -264,10 +293,10 @@ else
    회사명
    이메일주소
    사업장주소 + + 우편번호검색 +
    + +
    + +
    사업자등록증첨부
    -
    - + +
    @@ -316,14 +345,27 @@ else 이메일주소 + + 사업장주소 + + - 사업자등록증첨부 - + 사업자등록증첨부 + 기재사항 + + 청구구분 + +
      +
    • +
    • +
    + + @@ -331,8 +373,27 @@ else + @Html.Pager2((int)Model.pagenum, 10, Model.pagerowcount, Model.pagetotalcount) +@section styles{ + +} @section scripts{ + @Html.Partial("./Partial/ScriptPost") + } else { diff --git a/Model/CM.cs b/Model/CM.cs index 1d4deb1..44400c7 100644 --- a/Model/CM.cs +++ b/Model/CM.cs @@ -1189,6 +1189,23 @@ namespace NP.Model public int typegrade { get; set; } public int typejob { get; set; } public Int64 pplno { get; set; } + /// + /// 현금영수증발행여부 0:미발행,1:발행 + /// + public int iscashrct { get; set; } + /// + /// 계산서발행여부 0:미발행,1:발행 + /// + public int isbill { get; set; } + /// + /// 세금계산서문서번호(팝빌연동용) + /// + public string mgtkey { get; set; } + /// + /// 발행취소 0:정상, 1:취소 + /// + public int iscancel { get; set; } + } /// /// 자격검정시험 diff --git a/Model/PPLog.cs b/Model/PPLog.cs index f2e2e88..4584772 100644 --- a/Model/PPLog.cs +++ b/Model/PPLog.cs @@ -56,5 +56,6 @@ namespace NP.Model public int infee { get; set; } public int accommofee { get; set; } public int? isaccommodation { get; set; } + public int isbill { get; set; } } } diff --git a/Model/Pay.cs b/Model/Pay.cs index a712ec2..6476db1 100644 --- a/Model/Pay.cs +++ b/Model/Pay.cs @@ -919,6 +919,18 @@ namespace NP.Model /// 세금계산서 문서번호 예)2020-01-01-L00001 {년도-월(2자리)-일(2자리)-L발행순서 일련번호(5자리)} /// public String mgtkey { get; set; } + /// + /// 사업장우편번호 + /// + public String post { get; set; } + /// + /// 사업장주소 + /// + public String address1 { get; set; } + /// + /// 사업장상세주소 + /// + public String address2 { get; set; } } [Serializable] public class PayRfd : BaseModel