diff --git a/BO/Views/croom/lectreg.cshtml b/BO/Views/croom/lectreg.cshtml index 0aa3ca6..f6486c4 100644 --- a/BO/Views/croom/lectreg.cshtml +++ b/BO/Views/croom/lectreg.cshtml @@ -129,7 +129,7 @@
-
@Html.Partial("./Partial/Radio", null, new ViewDataDictionary() { { "valuetext", "6:무료;1:신용카드;3:무통장입금(가상계좌);4:현금" }, { "checked", 6 }, { "name", "ptype" } })
+
@Html.Partial("./Partial/Radio", null, new ViewDataDictionary() { { "valuetext", "6:무료;1:신용카드;3:무통장입금(가상계좌);4:현금;0:결제대기" }, { "checked", 6 }, { "name", "ptype" } })
@@ -324,6 +324,14 @@ $(a).closest("li").remove(); } function save() { + var ta = 0; + var tcash = 0; + var tcard = 0; + $.each($("#layertable tbody tr"), function (i, r) { + ta += getint($(r).find("td.payamt input").val()); + tcash += getint($(r).find("td.payamtcash input").val()); + tcard += getint($(r).find("td.payamtcard input").val()); + }); var isrebate = $("input:radio[name='isrebate']:checked").val() == "1" ? true : false; var iscompany= $("input:radio[name='iscompany']:checked").val() == "1" ? true : false; if (check("cmno", null, "강좌ID를 선택해주세요.")) { } @@ -337,7 +345,7 @@ else if (isrebate && check("rbankowner", null, "예금주를 등록해주세요.")) { } else if (check("userno", null, "신청자ID를 선택해주세요.")) { } else if (iscompany && check("asno", null, "회사정보를 선택해주세요.")) { } - else if (getrv("ptype") != "6" && val("payamt") < 1) { msg("결제금액을 입력해주세요."); } + else if (getrv("ptype") != "6" && getrv("ptype") != "0" && ta < 1) { msg("결제금액을 입력해주세요."); } else if (confirm("교육생을 등록하시겠습니까?")) { var pplog = {}; pplog.cmno = val("cmno"); diff --git a/Base/Controller/ACommonCRoom.cs b/Base/Controller/ACommonCRoom.cs index bd44e4d..94e92fa 100644 --- a/Base/Controller/ACommonCRoom.cs +++ b/Base/Controller/ACommonCRoom.cs @@ -240,9 +240,11 @@ namespace NP.Base.Controllers isinmoney = 1, payamt = payitems.Sum(s => s.payamt), PIs = payitems, + cmno = Convert.ToInt32(payitems.First().itemno), cmnos = string.Join(",", payitems.Select(s => s.itemno)), iscashrct = 0, - pplno = pplog.pplno, + pplno = pplog.pplno, + cmisno = pplog.cmisno, uno = SUserInfo.UserNo, uip = GetUserIP() }; @@ -258,6 +260,23 @@ namespace NP.Base.Controllers { return JsonOK(-4); } + if(pay.ptype == 0) + { + Dao.Insert("pay.standbypay.admin", pay); + int bcnt = 0; + if (pay.payno > 0) + { + foreach (var d in pay.PIs) + { + bcnt++; + d.payno = pay.payno; + } + } + if (Dao.Save("pay.standbypayitem.admin", pay) == bcnt + 1) + { + return JsonOK(pay.payno); + } + } return JsonOK(Dao.SavePay(pay, true, true)); } /// diff --git a/Dao/MyBatis/Maps/Pay.xml b/Dao/MyBatis/Maps/Pay.xml index 6945796..2dd5201 100644 --- a/Dao/MyBatis/Maps/Pay.xml +++ b/Dao/MyBatis/Maps/Pay.xml @@ -335,12 +335,44 @@ update pay a inner join users b on b.userno=a.userno set a.ptype=#ptype#,a.paylimit=#paylimit#,a.orgamt=#orgamt#,a.payamt=#payamt#,a.isbill=#isbill# + ,a.pstatus = case when #ptype# = 6 then 1 else a.pstatus end + ,a.payoktime = case when #ptype# = 6 then now() else a.payoktime end where a.payno=#payno# and a.userno=#userno# and a.pstatus=21; update payitem a inner join users b on b.userno=a.userno set a.orgamt=#orgamt#,a.payamt=#payamt# + ,a.pstatus = case when #ptype# = 6 then 1 else a.pstatus end + ,a.rstatus = 0 where a.payno=#payno# and a.userno=#userno# and a.pstatus=21; + + update lect a + inner join users b on b.userno = a.userno + set a.status = case when #ptype# = 6 then 1 else a.status end + where a.payno=#payno# and a.userno = #userno#; + + update lect a + inner join cm b on a.cmno = b.cmno + inner join pay c on a.payno = c.payno + left outer join cminningscd d on d.cmisno = a.cmisno + set + a.sdate = case when b.cshape <> 1 then date_format(a.cdt,'%Y-%m-%d 00:00:00') + else + case when date_format(b.retime,'%Y-%m-%d')='2099-12-31' then date_format(c.payoktime,'%Y-%m-%d 00:00:00') + else b.sstime end + end, + a.edate = case when b.cshape <> 1 then + case when d.eend is not null then date_format(d.eend,'%Y-%m-%d 23:59:59') + else + case when date_format(b.retime,'%Y-%m-%d')='2099-12-31' then date_format(date_add(c.payoktime,interval b.studydays day),'%Y-%m-%d 23:59:59') + else b.setime end + end + else + case when date_format(b.retime,'%Y-%m-%d')='2099-12-31' then date_format(date_add(c.payoktime,interval b.studydays day),'%Y-%m-%d 23:59:59') + else b.setime + end + end + where a.payno = #payno# and c.pstatus = 1 and c.payoktime is not null;