diff --git a/BO/Controllers/croomController.cs b/BO/Controllers/croomController.cs index 4a3a5c3..14494a9 100644 --- a/BO/Controllers/croomController.cs +++ b/BO/Controllers/croomController.cs @@ -876,6 +876,7 @@ namespace NP.BO.Controllers ht.Add("etaxdate", string.IsNullOrEmpty(vm.stringval9) ? null : (vm.stringval9 + " 23:59:59")); ht.Add("pstatus", vm.stringval10); ht.Add("taxnos", vm.stringval11); + ht.Add("ischeck", vm.stringval12); if (!string.IsNullOrEmpty(vm.stringval3)) { if(vm.stringval3 == "2") diff --git a/BO/Views/croom/tax.cshtml b/BO/Views/croom/tax.cshtml index 74f6a9f..169c9ad 100644 --- a/BO/Views/croom/tax.cshtml +++ b/BO/Views/croom/tax.cshtml @@ -43,6 +43,7 @@ @Html.Partial("./Partial/Select", null, new ViewDataDictionary { { "valuetext", ":발행상태;0:미발행;1:발행;2:발행취소" }, { "name", "stringval3" }, { "selected", Model.stringval3 } }) @Html.Partial("./Partial/Select", null, new ViewDataDictionary { { "valuetext", ":결제상태;p21:결제대기;p22:입금대기;p1:결제완료;rf1:환불요청;r1:부분환불;r2:전액환불;p41,42,43:결제취소" }, { "name", "stringval10" }, { "selected", Model.stringval10 } }) + @Html.Partial("./Partial/Select", null, new ViewDataDictionary { { "valuetext", ":확인상태;1:확인;0:미확인" }, { "name", "stringval12" }, { "selected", Model.stringval12 } }) @Html.Partial("./Partial/Select", null, new ViewDataDictionary { { "valuetext", ":전체검색;username:신청자이름;userid:신청자ID;manname:담당자이름;itemname:상품명;cname:교육과정명;paynos:결제번호;asname:회사명" }, { "name", "stringval4" }, { "selected", Model.stringval4 } }) @Html.Partial("./Partial/Text", Model.stringval5, Helpers.DicText(new NP.Model.TextDic() { Name = "stringval5", Value = Model.stringval5, PH = "", CssClass = "ff" })) @Html.Partial("./Partial/Button", new NP.Model.Button() { Special = "search" }) @@ -57,6 +58,8 @@ @Html.Partial("./Partial/pagerow", new ViewDataDictionary { { "tbodyid", "tbody1" }, { "searchmethod", "submit()" }, { "pagesize", Model.pagerowcount } }) @*엑셀다운로드*@ 엑셀다운로드 + 일괄확인 + 일괄확인취소
@@ -78,13 +81,14 @@ 발행한날 영수구분 상태 + 확인상태 @foreach (var d in Model.PayTaxes) { - + @d.rno @d.payno @Html.Raw(string.Format("{1} {2}", d.isjoin, d.isjoin == 1 ? "정" : "비", d.asname)) @@ -99,6 +103,7 @@ @(d.realtaxdate == null ? "" : d.realtaxdate.Value.ToString("yyyy-MM-dd")) @(d.isreceipt == 0 ? "청구" : "영수") @(d.status) + @(d.ischeckname) } @@ -152,5 +157,84 @@ exceldown('mform', '/croom/tax', 'tbody1', '계산서요청'); } } + function taxcheck() { + if ($("#tbody1 tr td input.autocheck:checked").length < 1) { + msg("확인 처리 할 요청서가 없습니다."); + } else { + var taxnos = ""; + var chk = false; + var cnt = 0; + $.each($("#tbody1 tr td input.autocheck:checked"), function (i, c) { + if ($(c).attr("data-ischeck") == 1) { + chk = false; + return false; + } else { + chk = true; + cnt++; + taxnos += "," + $(c).val(); + } + }); + if (chk == false) { + msg("확인 완료 건이 포함되어 있습니다. 다시 확인해주세요."); + } else { + if(confirm("선택한 "+cnt+"건을 확인 처리 하시겠습니까?")) + capp("/acommon/taxcheck", { taxnos: taxnos.substr(1), ischeck: 1 }, "cbtaxcheck"); + } + } + } + function cbtaxcheck() { + if (capResult.code == 1000) { + if (capResult.obj == -1) { + msg("확인 처리 할 요청서가 없습니다."); + } else if (capResult.obj == -2) { + //우연의 확률.. + msg("확인 완료 건이 포함되어 있습니다. 다시 확인해주세요.", null, null, null, null, "submit()"); + } else { + msg("일괄확인 처리 되었습니다.", null, null, null, null, "submit();"); + } + } else { + msgdev(); + } + } + function taxuncheck() { + if ($("#tbody1 tr td input.autocheck:checked").length < 1) { + msg("확인 취소 할 요청서가 없습니다."); + } else { + var taxnos = ""; + var chk = false; + var cnt = 0; + $.each($("#tbody1 tr td input.autocheck:checked"), function (i, c) { + if ($(c).attr("data-ischeck") == 0) { + chk = false; + return false; + } else { + chk = true; + cnt++; + taxnos += "," + $(c).val(); + } + }); + if (chk == false) { + msg("미확인 건이 포함되어 있습니다. 다시 확인해주세요."); + } else { + if (confirm("선택한 " + cnt + "건을 일괄로 확인취소 처리 하시겠습니까?")) { + capp("/acommon/taxcheck", { taxnos: taxnos.substr(1), ischeck: 0 }, "cbtaxuncheck"); + } + } + } + } + function cbtaxuncheck() { + if (capResult.code == 1000) { + if (capResult.obj == -1) { + msg("확인 취소 할 요청서가 없습니다."); + } else if (capResult.obj == -2) { + //우연의 확률.. + msg("미확인 건이 포함되어 있습니다. 다시 확인해주세요.", null, null, null, null, "submit()"); + } else { + msg("일괄확인취소 처리 되었습니다.", null, null, null, null, "submit();"); + } + } else { + msgdev(); + } + } } \ No newline at end of file diff --git a/BO/Views/croom/taxdetail.cshtml b/BO/Views/croom/taxdetail.cshtml index 5046966..2be3582 100644 --- a/BO/Views/croom/taxdetail.cshtml +++ b/BO/Views/croom/taxdetail.cshtml @@ -23,10 +23,14 @@ 상품명 수량
(인원) 발행요청금액 + 결제상태 신청일 계산서날짜 + 실제날짜 발행일 + 영수구분 상태 + 확인상태 @@ -39,10 +43,14 @@ @d.itemname @(d.ccount > 1 ? string.Format("외 {0}건", d.ccount - 1) : "") @d.pcnt @d.taxamt.ToString("#,0") + @d.pstatusname2 @d.cdtymd @(d.taxdatereq == null ? "" : d.taxdatereq.Value.ToString("yyyy-MM-dd")) @(d.taxdate == null ? "" : d.taxdate.Value.ToString("yyyy-MM-dd")) + @(d.realtaxdate == null ? "" : d.realtaxdate.Value.ToString("yyyy-MM-dd")) + @(d.isreceipt == 0 ? "청구" : "영수") @(d.status) + @(d.ischeckname) } @@ -222,7 +230,7 @@
- + @@ -231,12 +239,19 @@
+ @if(t.ischeck == 1) + { + 관리자확인취소 + } + else + { + 관리자확인 + } @if (t.iscancel == null || t.iscancel.Value != 1) { - if (t.statecode == 0) { - 저장 + 저장 임시저장 계산서 즉시발행 } @@ -416,5 +431,30 @@ } } } + var txt = ""; + var txt2 = ""; + function taxcheck(ischeck) { + txt = (ischeck == 0 ? "확인취소" : "확인"); + txt2 = (ischeck == 0 ? "미확인" : "확인완료"); + if (confirm(txt + " 처리 하시겠습니까?")) { + capp("/acommon/taxcheck", { taxno: $("#taxno").val(), ischeck: ischeck }, "cbtaxcheck"); + } + } + function cbtaxcheck() { + if (capResult.code == 1000) { + if (capResult.obj == -1) { + msg(txt + "할 요청서가 없습니다."); + txt = ""; + txt2 = ""; + } else if (capResult.obj == -2) { + //우연의 확률.. + msg(txt2 + " 건이 포함되어 있습니다. 다시 확인해주세요.", null, null, null, null, "rfs(0,'sform');"); + } else { + msg(txt + " 처리 되었습니다.", null, null, null, null, "rfs(0,'sform');"); + } + } else { + msgdev(); + } + } } \ No newline at end of file diff --git a/Base/Controller/ACommonCRoom.cs b/Base/Controller/ACommonCRoom.cs index d797b6a..81c55d7 100644 --- a/Base/Controller/ACommonCRoom.cs +++ b/Base/Controller/ACommonCRoom.cs @@ -1508,5 +1508,18 @@ namespace NP.Base.Controllers { return JsonOK(Dao.Save("pay.untax", new Hashtable() { { "payno", payno }, { "uno", SUserInfo.UserNo }, { "uip", GetUserIP() } })); } + [HttpPost] + public JsonResult taxcheck(String taxnos,int ischeck,int? taxno) + { + if (string.IsNullOrEmpty(taxnos) && taxno == null) + { + return JsonBack(new JsonRtn() { code = 1000, obj = -1 }); + } + if(Dao.Get("cr.paytax.byischeck", new Hashtable() { { "taxnos", taxnos },{"taxno",taxno }, { "ischeck",ischeck } }).FirstOrDefault() > 0) + { + return JsonBack(new JsonRtn() {code = 1000, obj = -2 }); + } + return JsonOK(Dao.Save("pay.taxcheck", new Hashtable() { { "taxnos", taxnos }, { "taxno", taxno }, {"ischeck",ischeck }, { "uno", SUserInfo.UserNo }, { "uip", GetUserIP() } })); + } } } \ No newline at end of file diff --git a/Dao/DB/DB1.Scheme.txt b/Dao/DB/DB1.Scheme.txt index 978fdfb..6bd429e 100644 --- a/Dao/DB/DB1.Scheme.txt +++ b/Dao/DB/DB1.Scheme.txt @@ -1014,6 +1014,7 @@ create table paytax ( ,taxdatereq datetime ,statecode INT(11) NULL DEFAULT NULL ,realtaxdate datetime default null + ,ischeck tinyint(4) NOT NULL DEFAULT 0 ,primary key(taxno)); create table paytaxitem ( diff --git a/Dao/MyBatis/Maps/CRoom.xml b/Dao/MyBatis/Maps/CRoom.xml index b10a13d..35a7aa7 100644 --- a/Dao/MyBatis/Maps/CRoom.xml +++ b/Dao/MyBatis/Maps/CRoom.xml @@ -1290,7 +1290,7 @@ select a.* from ( select a.taxno,ifnull(a.cname, ifnull(a.exname, a.bkname)) itemname,a.asaddr,a.pcnt,a.ccount,b.iscancel - ,b.payno,b.asname,b.taxamt,b.cdt,b.taxdate,b.ceoname,b.brno,b.grno,b.btype,b.bkind,b.manname,b.fgno,b.taxinfo,b.isreceipt,b.mgtkey,b.taxdatereq,b.realtaxdate,b.statecode + ,b.payno,b.asname,b.taxamt,b.cdt,b.taxdate,b.ceoname,b.brno,b.grno,b.btype,b.bkind,b.manname,b.fgno,b.taxinfo,b.isreceipt,b.mgtkey,b.taxdatereq,b.realtaxdate,b.statecode,b.ischeck ,CAST(AES_DECRYPT(UNHEX(b.telno), ) AS char) telno ,CAST(AES_DECRYPT(UNHEX(b.email), ) AS char) email ,u.userno cno,u.username,u.userid,CAST(AES_DECRYPT(UNHEX(u.mobile), ) AS char) mobile @@ -1334,6 +1334,7 @@ a.taxdate >= #staxdate# a.taxdate <= #etaxdate# a.asname like concat('%',#asname#,'%') + a.ischeck = #ischeck# a.taxno in ($taxnos$) group by a.taxno @@ -1362,6 +1363,26 @@ order by rno + + + update paytax a + set a.ischeck = #ischeck# + ,a.udt = now() + ,a.uno = #uno# + ,a.uip = #uip# + + a.taxno in ($taxnos$) + a.taxno = #taxno# + +