최초커밋
This commit is contained in:
733
approval/doc_expense_taxList.asp
Normal file
733
approval/doc_expense_taxList.asp
Normal file
@@ -0,0 +1,733 @@
|
||||
<!-- #include virtual = "include/header.asp" -->
|
||||
<!-- #include virtual = "include/left.asp" -->
|
||||
<%
|
||||
Dim Query, i, j
|
||||
Dim sMonth, NTSConfirmNum, Company
|
||||
NTSConfirmNum = Request("NTSConfirmNum")
|
||||
sMonth = Request("sMonth")
|
||||
Company = Request("Company")
|
||||
If sMonth = "" Then
|
||||
If day(date) >= 5 Then
|
||||
sMonth = Left(date, 7)
|
||||
Else
|
||||
sMonth = Left(DateAdd("M", -1, date), 7)
|
||||
End If
|
||||
End If
|
||||
userEmail = ""
|
||||
If Session("N_Depart") <> "M" Then
|
||||
userEmail = Session("User_Mail")
|
||||
End If
|
||||
%>
|
||||
<!-- Content Wrapper. Contains page content -->
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<style>
|
||||
.page-link{
|
||||
color: #6d7b90;
|
||||
border: 1px solid #6d7b90;
|
||||
}
|
||||
.page-item.active .page-link{
|
||||
color: #fff;
|
||||
background-color: #6d7b90;
|
||||
border-color: #6d7b90;
|
||||
}
|
||||
.page-item.disabled .page-link{
|
||||
color: #b7c0cd;
|
||||
background-color: transparent;
|
||||
border-color: #b7c0cd;
|
||||
}
|
||||
#resultTb > tbody > tr:hover > td{
|
||||
background-color: #d7dfeb;
|
||||
}
|
||||
#resultTb > tbody > tr > td:nth-child(7),
|
||||
#resultTb > tbody > tr > td:nth-child(8),
|
||||
#resultTb > tbody > tr > td:nth-child(9),
|
||||
#resultTb > tbody > tr > td:nth-child(10){
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
#filterMail{
|
||||
width: 300px;
|
||||
display: inline-flex;
|
||||
}
|
||||
#paperItem .input-group-text{
|
||||
width:100px;
|
||||
}
|
||||
#paperItem input, #paperItem select{
|
||||
width:120px;
|
||||
}
|
||||
|
||||
</style>
|
||||
<!-- Main content -->
|
||||
<div class="content-body p-2">
|
||||
<div class="content pb-2">
|
||||
<div class="container-fluid">
|
||||
<div class="row row-0">
|
||||
<div class="col-12">
|
||||
<label for="searchType_num" class="m-2"><input type="radio" id="searchType_num" name="searchType" value="num" /> <20><><EFBFBD><EFBFBD>û <20><><EFBFBD>ι<EFBFBD>ȣ</label>
|
||||
<label for="searchType_month" class="m-2"><input type="radio" id="searchType_month" name="searchType" value="month" /> <20><><EFBFBD><EFBFBD></label>
|
||||
<label for="searchType_paper" class="m-2"><input type="radio" id="searchType_paper" name="searchType" value="paper" /> <20><><EFBFBD>̼<EFBFBD><CCBC>ݰ<EFBFBD><DDB0>꼭</label>
|
||||
<button class="btn btn-danger float-right d-none ml-2" type="button" id="deleteBtn"><3E><><EFBFBD><EFBFBD></button>
|
||||
<button class="btn btn-secondary float-right" type="button" id="selectBtn"><3E><><EFBFBD><EFBFBD></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row row-0 mt-1">
|
||||
<div class="col-12">
|
||||
<div class="input-group d-none searchItem" id="numItem">
|
||||
<input type="text" class="form-control border" id="NTSConfirmNum" />
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-primary p-0" type="button" id="searchBtn"><i class="fas fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-group d-none searchItem" id="monthItem">
|
||||
<select class="form-control" id="sMonth">
|
||||
<%
|
||||
For i = 0 To -5 Step -1
|
||||
%>
|
||||
<option value="<%= Left(DateAdd("M", i, date), 7)%>" <%= iif(sMonth = Left(DateAdd("M", i, date), 7),"selected", "") %>><%= Left(DateAdd("M", i, date), 7)%></option>
|
||||
<%
|
||||
Next
|
||||
%>
|
||||
</select>
|
||||
<div class="input-group-prepend ml-2">
|
||||
<span class="input-group-text bg-cyan"><3E><><EFBFBD><EFBFBD><EFBFBD>ڸ<EFBFBD><DAB8><EFBFBD></span>
|
||||
</div>
|
||||
<input type="text" class="form-control border" id="searchType_filter" value="<%= userEmail %>" placeholder="<22><><EFBFBD><EFBFBD><EFBFBD>ڸ<EFBFBD><DAB8><EFBFBD><EFBFBD><EFBFBD> <20>Է<EFBFBD><D4B7><EFBFBD><EFBFBD>ּ<EFBFBD><D6BC><EFBFBD>" />
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-primary p-0" type="button" id="searchFilterBtn"><i class="fas fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-group searchItem d-none" id="paperItem">
|
||||
<span class="flex-fill">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend ml-1">
|
||||
<span class="input-group-text bg-lightblue justify-content-center"><3E>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD></span>
|
||||
</div>
|
||||
<input type="text" class="form-control border" id="p-WriteDate" value="" style="cursor:pointer;" readonly>
|
||||
<div class="input-group-prepend ml-1">
|
||||
<span class="input-group-text bg-lightblue justify-content-center"><3E><><EFBFBD><EFBFBD><EFBFBD>ڹ<EFBFBD>ȣ</span>
|
||||
</div>
|
||||
<input type="text" class="form-control border" id="p-CorpNum" value="" maxlength="12">
|
||||
<div class="input-group-prepend ml-1">
|
||||
<span class="input-group-text bg-lightblue justify-content-center"><3E><>ȣ</span>
|
||||
</div>
|
||||
<input type="text" class="form-control border" id="p-CorpName" value="">
|
||||
<div class="input-group-prepend ml-1">
|
||||
<span class="input-group-text bg-lightblue justify-content-center"><3E><>ǥ<EFBFBD>ڸ<EFBFBD></span>
|
||||
</div>
|
||||
<input type="text" class="form-control border" id="p-CEOName" value="">
|
||||
<div class="input-group-prepend ml-1">
|
||||
<span class="input-group-text bg-lightblue justify-content-center"><3E><><EFBFBD><EFBFBD><EFBFBD>ڸ<EFBFBD><DAB8><EFBFBD></span>
|
||||
</div>
|
||||
<input type="text" class="form-control border" id="p-WriteUser" value="<%= Session("User_Mail")%>" readonly>
|
||||
</div>
|
||||
<div class="input-group mt-1">
|
||||
<div class="input-group-prepend ml-1">
|
||||
<span class="input-group-text bg-lightblue justify-content-center"><3E><>ǥǰ<C7A5><C7B0><EFBFBD><EFBFBD></span>
|
||||
</div>
|
||||
<input type="text" class="form-control border" id="p-Items" value="">
|
||||
<div class="input-group-prepend ml-1">
|
||||
<span class="input-group-text bg-lightblue justify-content-center"><3E>հ<EFBFBD><D5B0>ݾ<EFBFBD></span>
|
||||
</div>
|
||||
<input type="text" class="form-control border" id="p-TotalAmount" value="0" readonly="">
|
||||
<div class="input-group-prepend ml-1">
|
||||
<span class="input-group-text bg-lightblue justify-content-center"><3E><><EFBFBD>ް<EFBFBD><DEB0><EFBFBD></span>
|
||||
</div>
|
||||
<input type="text" class="form-control border" id="p-AmountTotal" value="0">
|
||||
<div class="input-group-prepend ml-1">
|
||||
<span class="input-group-text bg-lightblue justify-content-center"><3E><><EFBFBD><EFBFBD></span>
|
||||
</div>
|
||||
<input type="text" class="form-control border" id="p-TaxTotal" value="0">
|
||||
<div class="input-group-prepend ml-1">
|
||||
<span class="input-group-text bg-lightblue justify-content-center">ȸ<><C8B8></span>
|
||||
</div>
|
||||
<select class="form-control" id="p-Company">
|
||||
<option value="KRi">KRi</option>
|
||||
<option value="KRc">KRc</option>
|
||||
<option value="KRd">KRd</option>
|
||||
</select>
|
||||
</div>
|
||||
</span>
|
||||
<div class="input-group-addon ml-1">
|
||||
<button class="btn btn-success px-2 h-100" type="button" id="addPaperTax"><3E><><br><3E><></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row row-0 mt-0">
|
||||
<div class="col-12">
|
||||
<table class="table table-sm table-sm2 table-bordered table-head tr-colors mt-2" id="resultTb" style="table-layout:fixed;font-size:12px;">
|
||||
<colgroup>
|
||||
<col width="35px" />
|
||||
<col width="35px" />
|
||||
<col width="85px" />
|
||||
<col width="85px" />
|
||||
<col width="85px" />
|
||||
<col width="100px" />
|
||||
<col width="120px" />
|
||||
<col width="100px" />
|
||||
<col width="" />
|
||||
<col width="100px" />
|
||||
<col width="86px" />
|
||||
<col width="86px" />
|
||||
<col width="86px" />
|
||||
<col width="86px" />
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="text-center"><3E><><EFBFBD><EFBFBD></td>
|
||||
<td class="text-center">ȸ<><C8B8></td>
|
||||
<td class="text-center"><3E>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD></td>
|
||||
<td class="text-center"><3E>߱<EFBFBD><DFB1><EFBFBD><EFBFBD><EFBFBD></td>
|
||||
<td class="text-center"><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD></td>
|
||||
<td class="text-center"><3E><><EFBFBD><EFBFBD><EFBFBD>ڹ<EFBFBD>ȣ</td>
|
||||
<td class="text-center"><3E><>ȣ</td>
|
||||
<td class="text-center"><3E><>ǥ<EFBFBD>ڸ<EFBFBD></td>
|
||||
<td class="text-center"><3E><>ǥǰ<C7A5><C7B0><EFBFBD><EFBFBD></td>
|
||||
<td class="text-center"><3E><><EFBFBD><EFBFBD><EFBFBD>ڸ<EFBFBD><DAB8><EFBFBD></td>
|
||||
<td class="text-center"><3E>հ<EFBFBD><D5B0>ݾ<EFBFBD></td>
|
||||
<td class="text-center"><3E><><EFBFBD>ް<EFBFBD><DEB0><EFBFBD></td>
|
||||
<td class="text-center"><3E><><EFBFBD><EFBFBD></td>
|
||||
<td class="text-center"><3E>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD>ɱݾ<C9B1></td>
|
||||
<td class="d-none"><3E>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD>ɺΰ<C9BA><CEB0><EFBFBD></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
<nav aria-label="Page navigation" id="pageNav">
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.content -->
|
||||
<%
|
||||
|
||||
%>
|
||||
<!-- REQUIRED SCRIPTS -->
|
||||
<script>
|
||||
var Company = "<%=Company%>";
|
||||
var MonthlyTaxLIst = [];
|
||||
var countPerPage = 10;
|
||||
var taxHistory = [];
|
||||
function taxInvoiceSetting(NTSSendKey){
|
||||
var tmpTaxHistory;
|
||||
$.ajax({
|
||||
url: "/barobill/baro_api.asp",
|
||||
type: "POST",
|
||||
async: false,
|
||||
data: {"command":"GetTaxInvoiceHistory", "NTSConfirmNum":NTSSendKey},
|
||||
success: function(ret){
|
||||
tmpTaxHistory = JSON.parse(ret);
|
||||
}
|
||||
});
|
||||
var taxInfo = JSON.parse(ajaxResponse);
|
||||
var tmpHTML = "";
|
||||
var tmpAmount = tmpTaxHistory.length > 0 ? taxInfo.AmountTotal - +tmpTaxHistory[0].AmountTotal : +taxInfo.AmountTotal;
|
||||
var tmpTax = tmpTaxHistory.length > 0 ? taxInfo.TaxTotal - +tmpTaxHistory[0].TaxTotal : +taxInfo.TaxTotal;
|
||||
var tmpBgClass = "";
|
||||
if(tmpAmount <= 0){
|
||||
tmpBgClass = "bg-danger";
|
||||
}else if((tmpAmount + tmpTax) != +taxInfo.TotalAmount){
|
||||
tmpBgClass = "bg-blue";
|
||||
}
|
||||
|
||||
tmpHTML += "<tr style='cursor:pointer;' class='taxTr' data-sendkey='"+ NTSSendKey +"'>";
|
||||
tmpHTML += "<td class='py-3 text-center "+ tmpBgClass +"'><input type='radio' name='selTax' value='"+ NTSSendKey +"' data-deal='"+ taxInfo.TaxType +"' "+ (tmpAmount <= 0 ? "disabled" : "") +"/></td>";
|
||||
tmpHTML += "<td class='py-3 text-center "+ tmpBgClass +"'>"+ Company.replace("kr", "KR") +"</td>";
|
||||
tmpHTML += "<td class='py-3 text-center "+ tmpBgClass +"'>"+ left(taxInfo.WriteDate, 8).replace(/(\d{4})(\d{2})(\d{2})/, '$1-$2-$3') +"</td>";
|
||||
tmpHTML += "<td class='py-3 text-center "+ tmpBgClass +"'></td>";
|
||||
tmpHTML += "<td class='py-3 text-center "+ tmpBgClass +"'></td>";
|
||||
tmpHTML += "<td class='py-3 text-center "+ tmpBgClass +"'>"+ taxInfo.InvoicerParty.CorpNum.replace(/(\d{3})(\d{2})(\d{5})/, '$1-$2-$3') +"</td>";
|
||||
tmpHTML += "<td class='py-3 text-center "+ tmpBgClass +"'>"+ taxInfo.InvoicerParty.CorpName +"</td>";
|
||||
tmpHTML += "<td class='py-3 text-center "+ tmpBgClass +"'>"+ taxInfo.InvoicerParty.CEOName +"</td>";
|
||||
tmpHTML += "<td class='py-3 text-center "+ tmpBgClass +"'>"+ taxInfo.TaxInvoiceTradeLineItems[0].Name +"</td>";
|
||||
tmpHTML += "<td class='py-3 text-center "+ tmpBgClass +"'>"+ taxInfo.InvoiceeParty.Email +"</td>";
|
||||
tmpHTML += "<td class='py-3 text-center "+ tmpBgClass +"'>"+ commify(taxInfo.TotalAmount) +"</td>";
|
||||
tmpHTML += "<td class='py-3 text-center "+ tmpBgClass +"'>"+ commify(taxInfo.AmountTotal) +"</td>";
|
||||
tmpHTML += "<td class='py-3 text-center "+ tmpBgClass +"'>"+ commify(taxInfo.TaxTotal) +"</td>";
|
||||
tmpHTML += "<td class='py-3 text-center "+ tmpBgClass +"'>"+ commify(tmpAmount) +"</td>";
|
||||
tmpHTML += "<td class='d-none'>"+ commify(tmpTax) +"</td>";
|
||||
tmpHTML += "</tr>";
|
||||
$("#resultTb > tbody").html(tmpHTML);
|
||||
|
||||
$(".taxTr > td:nth-child(n + 2)").on("click", function(){
|
||||
var NTSConfirmNum = $(this).parent().data("sendkey");
|
||||
ajaxCallJson("/barobill/baro_api.asp", {"command":"GetTaxInvoicePopUpURLNK", "NTSConfirmNum":NTSConfirmNum, "Company":Company}, "", "POST", "taxInvoiceView()");
|
||||
});
|
||||
/*
|
||||
NTSSendKey // <20><><EFBFBD><EFBFBD>û<EFBFBD><C3BB><EFBFBD>ι<EFBFBD>ȣ : "2022080414010700p0000000"
|
||||
taxInfo.InvoicerParty.CorpName // <20><>ȣ : "Ȩ<>ý<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ó" *************
|
||||
taxInfo.InvoicerParty.CorpNum // <20><><EFBFBD><EFBFBD><EFBFBD>ڹ<EFBFBD>ȣ : "0000000000" *************
|
||||
taxInfo.WriteDate // <20>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD> : "20220804" *************
|
||||
taxInfo.AmountTotal // <20><><EFBFBD>ް<EFBFBD><DEB0><EFBFBD> : "100000" *************
|
||||
taxInfo.TaxTotal // <20><><EFBFBD><EFBFBD> : "10000" *************
|
||||
taxInfo.TotalAmount // <20>հ<EFBFBD><D5B0>ݾ<EFBFBD> : "110000" *************
|
||||
*/
|
||||
}
|
||||
|
||||
function taxInvoiceView(){
|
||||
window.open(ajaxResponse, "", "left=150, top=150, menubar=no, location=no, status=no, toolbar=no, width=960, height=800, scrollbars=yes ,resizable=no");
|
||||
}
|
||||
|
||||
function monTaxInvoiceSetting(cPage){
|
||||
<% If Session("N_depart") <> "M" Then %>
|
||||
if($("#searchType_filter").val().trim().length < 3) {
|
||||
alert("3<><33><EFBFBD><EFBFBD> <20>̻<EFBFBD> <20>Է<EFBFBD> <20><> <20>˻<EFBFBD><CBBB><EFBFBD><EFBFBD>ּ<EFBFBD><D6BC><EFBFBD>.");
|
||||
return false;
|
||||
}
|
||||
<% End If %>
|
||||
var sMonth = $("#sMonth").children("option:selected").val();
|
||||
var tmpHTML = "";
|
||||
var filterMail = $("#searchType_filter").val();
|
||||
var tmpFilterList = $.grep(MonthlyTaxLIst, function(o, i){ return o.InvoiceeEmail.indexOf(filterMail) > -1; });
|
||||
var taxList = $.grep(tmpFilterList, function(o, i){ return i >= (cPage-1) * countPerPage && i < cPage * countPerPage; });
|
||||
$.each(taxList, function(i, obj){
|
||||
var tmpTaxHistory = $.grep(taxHistory, function(o, i){ return o.taxNum == obj.NTSSendKey; });
|
||||
var tmpAmount = tmpTaxHistory.length > 0 ? obj.AmountTotal - +tmpTaxHistory[0].AmountTotal : +obj.AmountTotal;
|
||||
var tmpTax = tmpTaxHistory.length > 0 ? obj.TaxTotal - +tmpTaxHistory[0].TaxTotal : +obj.TaxTotal;
|
||||
var tmpBgClass = "";
|
||||
if(tmpAmount <= 0){
|
||||
tmpBgClass = "bg-danger";
|
||||
}else if((tmpAmount + tmpTax) != +obj.TotalAmount){
|
||||
tmpBgClass = "bg-blue";
|
||||
}
|
||||
tmpHTML += "<tr style='cursor:pointer;' class='taxTr' data-sendkey='"+ obj.NTSSendKey +"'>";
|
||||
tmpHTML += "<td class='py-2 text-center "+ tmpBgClass +"'><input type='radio' name='selTax' value='"+ obj.NTSSendKey +"' data-deal='"+ obj.TaxType +"' "+ (tmpAmount <= 0 ? "disabled" : "") +"/></td>";
|
||||
tmpHTML += "<td class='py-2 text-center "+ tmpBgClass +"'>"+ Company.replace("kr", "KR") +"</td>";
|
||||
tmpHTML += "<td class='py-2 text-center "+ tmpBgClass +"'>"+ left(obj.WriteDate, 8).replace(/(\d{4})(\d{2})(\d{2})/, '$1-$2-$3') +"</td>";
|
||||
tmpHTML += "<td class='py-2 text-center "+ tmpBgClass +"'>"+ left(obj.IssueDT, 8).replace(/(\d{4})(\d{2})(\d{2})/, '$1-$2-$3') +"</td>";
|
||||
tmpHTML += "<td class='py-2 text-center "+ tmpBgClass +"'>"+ left(obj.NTSSendDT, 8).replace(/(\d{4})(\d{2})(\d{2})/, '$1-$2-$3') +"</td>";
|
||||
tmpHTML += "<td class='py-2 text-center "+ tmpBgClass +"'>"+ obj.InvoicerCorpNum.replace(/(\d{3})(\d{2})(\d{5})/, '$1-$2-$3') +"</td>";
|
||||
tmpHTML += "<td class='py-2 text-center "+ tmpBgClass +"'>"+ obj.InvoicerCorpName +"</td>";
|
||||
tmpHTML += "<td class='py-2 text-center "+ tmpBgClass +"'>"+ obj.InvoicerCEOName +"</td>";
|
||||
tmpHTML += "<td class='py-2 text-center "+ tmpBgClass +"'>"+ obj.ItemName +"</td>";
|
||||
tmpHTML += "<td class='py-2 text-center "+ tmpBgClass +"'>"+ obj.InvoiceeEmail +"</td>";
|
||||
tmpHTML += "<td class='py-2 text-center "+ tmpBgClass +"'>"+ commify(obj.TotalAmount) +"</td>";
|
||||
tmpHTML += "<td class='py-2 text-center "+ tmpBgClass +"'>"+ commify(obj.AmountTotal) +"</td>";
|
||||
tmpHTML += "<td class='py-2 text-center "+ tmpBgClass +"'>"+ commify(obj.TaxTotal) +"</td>";
|
||||
tmpHTML += "<td class='py-2 text-center "+ tmpBgClass +"'>"+ commify(tmpAmount) +"</td>";
|
||||
tmpHTML += "<td class='d-none'>"+ commify(tmpTax) +"</td>";
|
||||
/*
|
||||
obj.NTSSendKey // <20><><EFBFBD><EFBFBD>û<EFBFBD><C3BB><EFBFBD>ι<EFBFBD>ȣ : "2022080414010700p0000000" *************
|
||||
obj.InvoiceeEmail // <20≯<EFBFBD><CCB8><EFBFBD> : dskim@kric.com
|
||||
obj.InvoicerCorpName // <20><>ȣ : "Ȩ<>ý<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ó" *************
|
||||
obj.InvoicerCorpNum // <20><><EFBFBD><EFBFBD><EFBFBD>ڹ<EFBFBD>ȣ : "0000000000" *************
|
||||
obj.InvoicerCEOName // <20><>ǥ<EFBFBD>ڸ<EFBFBD> : "ȫ<>浿"
|
||||
obj.WriteDate // <20>ۼ<EFBFBD><DBBC><EFBFBD><EFBFBD><EFBFBD> : "20220804" *************
|
||||
obj.IssueDT // <20>߱<EFBFBD><DFB1><EFBFBD><EFBFBD><EFBFBD> : "20220804140107"
|
||||
obj.NTSSendDT // <20><><EFBFBD>۳<EFBFBD>¥ : "20220804140107"
|
||||
obj.ItemName // <20><>ǥ ǰ<><C7B0> : "<22><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>"
|
||||
obj.AmountTotal // <20><><EFBFBD>ް<EFBFBD><DEB0><EFBFBD> : "100000" *************
|
||||
obj.TaxTotal // <20><><EFBFBD><EFBFBD> : "10000" *************
|
||||
obj.TotalAmount // <20>հ<EFBFBD><D5B0>ݾ<EFBFBD> : "110000" *************
|
||||
*/
|
||||
tmpHTML += "</tr>";
|
||||
});
|
||||
|
||||
if(taxList.length == 0){
|
||||
tmpHTML = "<tr><td class='text-center py-3' colspan='14'><3E><>ȸ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD></td></tr>";
|
||||
}
|
||||
|
||||
$("#resultTb > tbody").html(tmpHTML);
|
||||
|
||||
$(".taxTr > td:nth-child(n + 2)").on("click", function(){
|
||||
var NTSConfirmNum = $(this).parent().data("sendkey");
|
||||
ajaxCallJson("/barobill/baro_api.asp", {"command":"GetTaxInvoicePopUpURLNK", "NTSConfirmNum":NTSConfirmNum, "Company":Company}, "", "POST", "taxInvoiceView()");
|
||||
});
|
||||
|
||||
paginationSetting(cPage, Math.ceil(tmpFilterList.length / countPerPage));
|
||||
}
|
||||
|
||||
function paginationSetting(cPage, maxPage){
|
||||
$("#pageNav").html("");
|
||||
if(maxPage == 0) return false;
|
||||
var tmpHTML = "<ul class='pagination justify-content-center'>";
|
||||
tmpHTML += "<li class='page-item "+(cPage == "1" ? "disabled" : "")+"'><a class='page-link' href='#' data-page='-'><i class='fas fa-chevron-left'></i></a></li>";
|
||||
for(var i=1; i<=maxPage; i++){
|
||||
tmpHTML += "<li class='page-item " + (i == cPage ? "active" : "") + "'><a class='page-link' href='#' data-page='" + i + "'>" + i + "</a></li>";
|
||||
}
|
||||
tmpHTML += "<li class='page-item "+(cPage == maxPage ? "disabled" : "")+"'><a class='page-link' href='#' data-page='+'><i class='fas fa-chevron-right'></i></a></li>";
|
||||
$("#pageNav").html(tmpHTML);
|
||||
}
|
||||
|
||||
function getMonthlyTaxs(sMonth){
|
||||
MonthlyTaxLIst = [];
|
||||
taxHistory = [];
|
||||
ajaxCallJson("/barobill/baro_api.asp", {"command":"GetMonthlyTaxInvoicePurchaseList", "sMonth":sMonth, "sPage":"1", "Company":Company}, "", "POST", "settingMonthlyTaxList('"+ sMonth +"', '1')");
|
||||
$.ajax({
|
||||
url: "/barobill/baro_api.asp",
|
||||
type: "POST",
|
||||
async: false,
|
||||
data: {"command":"GetTaxInvoiceHistory", "sMonth":sMonth},
|
||||
success: function(ret){
|
||||
taxHistory = JSON.parse(ret);
|
||||
}
|
||||
});
|
||||
}
|
||||
function settingMonthlyTaxList(sMonth, cPage){
|
||||
ajaxResponse = ajaxResponse.replace(/"ItemName":"([^"]*)(["]+)([^"]*)",/g, function(match, value) {
|
||||
var fixedValue = match.replace('"ItemName":"','');
|
||||
fixedValue = fixedValue.replace('",','');
|
||||
fixedValue = fixedValue.replace(/"/g," ");
|
||||
fixedValue = '"ItemName":"'+fixedValue+'",';
|
||||
return fixedValue;
|
||||
});
|
||||
var resultJson = JSON.parse(ajaxResponse.replace(/("ItemName":")(\d+)"/g, '$1$2'));
|
||||
MonthlyTaxLIst = MonthlyTaxLIst.concat(resultJson.SimpleTaxInvoiceExList);
|
||||
if(+resultJson.CurrentPage <= +resultJson.MaxPageNum){
|
||||
ajaxCallJson("/barobill/baro_api.asp", {"command":"GetMonthlyTaxInvoicePurchaseList", "sMonth":sMonth, "sPage":(+cPage+1), "Company":Company}, "", "POST", "settingMonthlyTaxList('"+ sMonth +"', '"+ (+cPage+1) +"')");
|
||||
}
|
||||
}
|
||||
|
||||
function getPaperTaxList(){
|
||||
ajaxCallJson("/barobill/baro_api.asp", {"command":"GetPaperTax"}, "", "POST", "settingPaperTaxList('1')");
|
||||
}
|
||||
|
||||
function settingPaperTaxList(cPage){
|
||||
var resultJson = JSON.parse(ajaxResponse);
|
||||
$.ajax({
|
||||
url: "/barobill/baro_api.asp",
|
||||
type: "POST",
|
||||
async: false,
|
||||
data: {"command":"GetTaxInvoiceHistory", "NTSConfirmNum":"K%"},
|
||||
success: function(ret){
|
||||
taxHistory = JSON.parse(ret);
|
||||
}
|
||||
});
|
||||
|
||||
var tmpHTML = "";
|
||||
var taxList = $.grep(resultJson, function(o, i){ return i >= (cPage-1) * countPerPage && i < cPage * countPerPage; });
|
||||
$.each(taxList, function(i, obj){
|
||||
var tmpTaxHistory = $.grep(taxHistory, function(o, i){ return o.taxNum == obj.paperTaxNum; });
|
||||
var tmpAmount = tmpTaxHistory.length > 0 ? obj.AmountTotal - +tmpTaxHistory[0].AmountTotal : +obj.AmountTotal;
|
||||
var tmpTax = tmpTaxHistory.length > 0 ? obj.TaxTotal - +tmpTaxHistory[0].TaxTotal : +obj.TaxTotal;
|
||||
var tmpBgClass = "";
|
||||
if(tmpAmount <= 0){
|
||||
tmpBgClass = "bg-danger";
|
||||
}else if((tmpAmount + tmpTax) != +obj.TotalAmount){
|
||||
tmpBgClass = "bg-blue";
|
||||
}
|
||||
tmpHTML += "<tr style='cursor:pointer;' class='taxTr' data-id='"+ obj.id +"'>";
|
||||
tmpHTML += "<td class='py-2 text-center "+ tmpBgClass +"'><input type='radio' name='selTax' value='"+ obj.paperTaxNum +"' data-deal='1' "+ (tmpAmount <= 0 ? "disabled" : "") +"/></td>";
|
||||
tmpHTML += "<td class='py-2 text-center "+ tmpBgClass +"'>"+ obj.Company.replace("kr", "KR") +"</td>";
|
||||
tmpHTML += "<td class='py-2 text-center "+ tmpBgClass +"'>"+ obj.WriteDate +"</td>";
|
||||
tmpHTML += "<td class='py-2 text-center "+ tmpBgClass +"'></td>";
|
||||
tmpHTML += "<td class='py-2 text-center "+ tmpBgClass +"'></td>";
|
||||
tmpHTML += "<td class='py-2 text-center "+ tmpBgClass +"'>"+ obj.CorpNum +"</td>";
|
||||
tmpHTML += "<td class='py-2 text-center "+ tmpBgClass +"'>"+ obj.CorpName +"</td>";
|
||||
tmpHTML += "<td class='py-2 text-center "+ tmpBgClass +"'>"+ obj.CEOName +"</td>";
|
||||
tmpHTML += "<td class='py-2 text-center "+ tmpBgClass +"'>"+ obj.Items +"</td>";
|
||||
tmpHTML += "<td class='py-2 text-center "+ tmpBgClass +"'>"+ obj.WriteUser +"</td>";
|
||||
tmpHTML += "<td class='py-2 text-center "+ tmpBgClass +"'>"+ commify(obj.TotalAmount) +"</td>";
|
||||
tmpHTML += "<td class='py-2 text-center "+ tmpBgClass +"'>"+ commify(obj.AmountTotal) +"</td>";
|
||||
tmpHTML += "<td class='py-2 text-center "+ tmpBgClass +"'>"+ commify(obj.TaxTotal) +"</td>";
|
||||
tmpHTML += "<td class='py-2 text-center "+ tmpBgClass +"'>"+ commify(tmpAmount) + (tmpTax != 0 && tmpAmount != +obj.AmountTotal ? "<br>" + commify(tmpTax) : "") +"</td>";
|
||||
tmpHTML += "</tr>";
|
||||
});
|
||||
|
||||
if(resultJson.length == 0){
|
||||
tmpHTML = "<tr><td class='text-center py-3' colspan='14'><3E><>ȸ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD></td></tr>";
|
||||
}
|
||||
|
||||
$("#resultTb > tbody").html(tmpHTML);
|
||||
|
||||
paginationSetting(cPage, Math.ceil(resultJson.length / countPerPage));
|
||||
}
|
||||
|
||||
function paperTaxComplete(divi){
|
||||
if(divi == "1"){ // <20><><EFBFBD><EFBFBD> <20>Ϸ<EFBFBD>
|
||||
if(ajaxResponse == "1"){
|
||||
alert("<22><><EFBFBD>̼<EFBFBD><CCBC>ݰ<EFBFBD><DDB0>꼭 <20>ۼ<EFBFBD><DBBC><EFBFBD> <20>Ϸ<EFBFBD> <20>Ǿ<EFBFBD><C7BE><EFBFBD><EFBFBD>ϴ<EFBFBD>.");
|
||||
getPaperTaxList();
|
||||
}
|
||||
}else if(divi == "2"){ // <20><><EFBFBD><EFBFBD> <20>Ϸ<EFBFBD>
|
||||
if(ajaxResponse == "1"){
|
||||
alert("<22><><EFBFBD>̼<EFBFBD><CCBC>ݰ<EFBFBD><DDB0>꼭 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>Ϸ<EFBFBD> <20>Ǿ<EFBFBD><C7BE><EFBFBD><EFBFBD>ϴ<EFBFBD>.");
|
||||
getPaperTaxList();
|
||||
}
|
||||
}
|
||||
|
||||
if(ajaxResponse == "0"){
|
||||
alert("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD><DFBB>Ͽ<EFBFBD><CFBF><EFBFBD><EFBFBD>ϴ<EFBFBD>.\n<><6E><EFBFBD><EFBFBD><EFBFBD>ڿ<EFBFBD><DABF><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ּ<EFBFBD><D6BC><EFBFBD>.");
|
||||
}
|
||||
}
|
||||
|
||||
$(function(){
|
||||
cutmenu();
|
||||
|
||||
$("#p-WriteDate").datepicker();
|
||||
|
||||
$("input[name='searchType']").on("click", function(){
|
||||
$(".searchItem").addClass("d-none");
|
||||
$("#deleteBtn").addClass("d-none");
|
||||
$("#NTSConfirmNum").val("");
|
||||
$("#resultTb > tbody").html("");
|
||||
$("#pageNav").html("");
|
||||
if($(this).val() == "num"){
|
||||
$("#numItem").removeClass("d-none");
|
||||
}else if($(this).val() == "month"){
|
||||
$("#monthItem").removeClass("d-none");
|
||||
$("#sMonth").trigger("change");
|
||||
}else if($(this).val() == "paper"){
|
||||
$("#paperItem").removeClass("d-none");
|
||||
$("#deleteBtn").removeClass("d-none");
|
||||
getPaperTaxList();
|
||||
}
|
||||
});
|
||||
|
||||
$("#searchBtn").on("click", function(){
|
||||
var NTSConfirmNum = $("#NTSConfirmNum").val();
|
||||
if($.trim(NTSConfirmNum) == ""){
|
||||
alert("<22><><EFBFBD><EFBFBD>û <20><><EFBFBD>ι<EFBFBD>ȣ<EFBFBD><C8A3> <20>Է<EFBFBD><D4B7><EFBFBD><EFBFBD>ּ<EFBFBD><D6BC><EFBFBD>.");
|
||||
$("#NTSConfirmNum").val("");
|
||||
return false;
|
||||
}
|
||||
ajaxCallJson("/barobill/baro_api.asp", {"command":"GetTaxInvoiceNK", "NTSConfirmNum":NTSConfirmNum, "Company":Company}, "", "POST", "taxInvoiceSetting('" + NTSConfirmNum + "')");
|
||||
});
|
||||
|
||||
$("#NTSConfirmNum").on("keydown", function(e){
|
||||
if(e){
|
||||
var keycode = e.which ? e.which : e.keyCode;
|
||||
if(keycode == 13){
|
||||
$("#searchBtn").trigger("click");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$("#searchType_filter").on("keydown", function(e){
|
||||
if(e){
|
||||
var keycode = e.which ? e.which : e.keyCode;
|
||||
if(keycode == 13){
|
||||
$("#searchFilterBtn").click();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$("#sMonth").on("change", function(){
|
||||
var sMonth = $("#sMonth").children("option:selected").val();
|
||||
getMonthlyTaxs(sMonth);
|
||||
});
|
||||
|
||||
$("#searchFilterBtn").on("click", function(){
|
||||
monTaxInvoiceSetting(1);
|
||||
});
|
||||
|
||||
$("#p-CorpNum").on("keyup", function(){
|
||||
$(this).val(autoHypenPhoneNum($(this).val()));
|
||||
});
|
||||
|
||||
$("#p-AmountTotal, #p-TaxTotal").on("keyup", function(){
|
||||
var sum = +($("#p-AmountTotal").val().replace(/[^0-9]/g, '') || "0") + +($("#p-TaxTotal").val().replace(/[^0-9]/g, '') || "0");
|
||||
$(this).val(commify(+($(this).val().replace(/[^0-9]/g, '') || "0")));
|
||||
$("#p-TotalAmount").val(commify(sum));
|
||||
});
|
||||
|
||||
<% If NTSConfirmNum <> "" Then %>
|
||||
$("#searchType_num").click();
|
||||
$("#NTSConfirmNum").val("<%=NTSConfirmNum%>");
|
||||
$("#searchBtn").trigger("click");
|
||||
<% Else %>
|
||||
$("#searchType_month").click();
|
||||
setTimeout(function(){
|
||||
$("#searchFilterBtn").click();
|
||||
}, 0);
|
||||
<% End If %>
|
||||
|
||||
$(document).on("click", ".page-link", function(){
|
||||
var page = $(this).data("page");
|
||||
if(page == "-" || page == "+"){
|
||||
page = eval($(".page-item.active > .page-link").data("page") + page + "1");
|
||||
}
|
||||
if($("input[name='searchType']:checked").val() == "month"){
|
||||
monTaxInvoiceSetting(page);
|
||||
}else if($("input[name='searchType']:checked").val() == "paper"){
|
||||
settingPaperTaxList(page);
|
||||
}
|
||||
});
|
||||
|
||||
$("#addPaperTax").on("click", function(){
|
||||
var chk = true;
|
||||
var params = {};
|
||||
$("#paperItem").find("input,select").each(function(){
|
||||
var thisVal = "";
|
||||
if($(this)[0].nodeName == "SELECT"){
|
||||
thisVal = $(this).children("option:selected").val();
|
||||
}else{
|
||||
thisVal = $(this).val();
|
||||
}
|
||||
thisVal = (thisVal || "").trim();
|
||||
if(thisVal == ""){
|
||||
chk = false;
|
||||
alert($(this).prev().children().text() + " <20><EFBFBD><D7B8><EFBFBD> <20>Է<EFBFBD><D4B7><EFBFBD><EFBFBD>ּ<EFBFBD><D6BC><EFBFBD>.");
|
||||
return false;
|
||||
}else if($(this).attr("id") == "p-AmountTotal" && thisVal == "0"){
|
||||
chk = false;
|
||||
alert("<22><><EFBFBD>ް<EFBFBD><DEB0><EFBFBD><EFBFBD><EFBFBD> <20>Է<EFBFBD><D4B7><EFBFBD><EFBFBD>ּ<EFBFBD><D6BC><EFBFBD>.");
|
||||
return false;
|
||||
}
|
||||
|
||||
params[$(this).attr("id").replace("p-", "")] = thisVal;
|
||||
});
|
||||
|
||||
if(!chk) return false;
|
||||
|
||||
if(checkCompRegNum($("#p-CorpNum").val()) == false){
|
||||
alert("<22><><EFBFBD><EFBFBD><EFBFBD>ڹ<EFBFBD>ȣ<EFBFBD><C8A3> <20><>ȿ<EFBFBD><C8BF><EFBFBD><EFBFBD> <20>ʽ<EFBFBD><CABD>ϴ<EFBFBD>.");
|
||||
return false;
|
||||
}
|
||||
params.AmountTotal = params.AmountTotal.replace(/,/g, '');
|
||||
params.TaxTotal = params.TaxTotal.replace(/,/g, '');
|
||||
params.TotalAmount = params.TotalAmount .replace(/,/g, '');
|
||||
|
||||
params.CorpName = encodeURIComponent(params.CorpName);
|
||||
params.CEOName = encodeURIComponent(params.CEOName);
|
||||
params.Items = encodeURIComponent(params.Items);
|
||||
|
||||
params.paperTaxNum = "K" + new Date().format("yyyyMMddHHmmss") + randomRange(1, 999).zf(3) + "_" + randomRange(1, 99999).zf(5); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
ajaxCallJson("/barobill/baro_api.asp", Object.assign({"command":"SetPaperTax"}, params), "", "POST", "paperTaxComplete('1')");
|
||||
});
|
||||
|
||||
$("#deleteBtn").on("click", function(){
|
||||
if($("input[name=selTax]:checked").length == 0){
|
||||
alert("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>ݰ<EFBFBD><DDB0>꼭<EFBFBD><EABCAD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ּ<EFBFBD><D6BC><EFBFBD>.");
|
||||
return false;
|
||||
}else{
|
||||
if(!confirm("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>ݰ<EFBFBD><DDB0>꼭<EFBFBD><EABCAD> <20><><EFBFBD><EFBFBD><EFBFBD>Ͻðڽ<C3B0><DABD>ϱ<EFBFBD>?")){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
var targetTr = $("input[name=selTax]:checked").parent().parent();
|
||||
var tmpId = $(targetTr).data("id");
|
||||
if($(targetTr).children("td").eq(9).text() != "<%= Session("User_Mail")%>"){
|
||||
alert("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>ݰ<EFBFBD><DDB0>꼭<EFBFBD><EABCAD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>մϴ<D5B4>.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if($(targetTr).children("td").eq(0).hasClass("bg-danger") || $(targetTr).children("td").eq(0).hasClass("bg-blue")){
|
||||
alert("<22>ش<EFBFBD> <20><><EFBFBD>ݰ<EFBFBD><DDB0>꼭<EFBFBD><EABCAD> <20>ۼ<EFBFBD><DBBC><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ǽ<EFBFBD><C7BC><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>մϴ<D5B4>.");
|
||||
return false;
|
||||
}
|
||||
|
||||
ajaxCallJson("/barobill/baro_api.asp", {"command":"DeletePaperTax", "id":tmpId}, "", "POST", "paperTaxComplete('2')");
|
||||
});
|
||||
|
||||
$("#selectBtn").on("click", function(){
|
||||
if($("input[name=selTax]:checked").length == 0){
|
||||
alert("<22><><EFBFBD>ݰ<EFBFBD><DDB0>꼭<EFBFBD><EABCAD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ּ<EFBFBD><D6BC><EFBFBD>.");
|
||||
return false;
|
||||
}else{
|
||||
if(!confirm("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>ݰ<EFBFBD><DDB0>꼭 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n<><6E><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ǽ<EFBFBD><C7BC><EFBFBD> <20>ۼ<EFBFBD><DBBC>Ͻðڽ<C3B0><DABD>ϱ<EFBFBD>?")){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
var taxTr = $("input[name=selTax]:checked").parent().parent();
|
||||
|
||||
var NTSSendKey = $("input[name=selTax]:checked").val();
|
||||
var TaxType = $("input[name=selTax]:checked").data("deal");
|
||||
var CompName = $(taxTr).children("td").eq(1).text();
|
||||
var InvoicerCorpName = $(taxTr).children("td").eq(6).text();
|
||||
var InvoicerCorpNum = $(taxTr).children("td").eq(5).text();
|
||||
var WriteDate = $(taxTr).children("td").eq(2).text();
|
||||
var AmountTotal = $(taxTr).children("td").eq(11).text();
|
||||
var TaxTotal = $(taxTr).children("td").eq(12).text();
|
||||
var TotalAmount = $(taxTr).children("td").eq(10).text();
|
||||
var ItemName = $(taxTr).children("td").eq(8).text();
|
||||
var WriteAbleAmount = $(taxTr).children("td").eq(13).text();
|
||||
var WriteAbleTax = $(taxTr).children("td").eq(14).text();
|
||||
|
||||
//console.log(NTSSendKey,InvoicerCorpName,InvoicerCorpNum,WriteDate,AmountTotal,TaxTotal,TotalAmount);
|
||||
|
||||
$(opener.document).find("input[name=expence_num]").val(NTSSendKey);
|
||||
$(opener.document).find("input[name=k_company]").val(CompName);
|
||||
$(opener.document).find("input[name=expence_company]").val(InvoicerCorpName);
|
||||
$(opener.document).find("input[name=expence_company]").attr("readonly", true);
|
||||
$(opener.document).find("input[name=expence_company_num]").val(InvoicerCorpNum);
|
||||
$(opener.document).find("input[name=expence_date]").val(WriteDate);
|
||||
$(opener.document).find("input[name=expence_date]").off("focus");
|
||||
$(opener.document).find("input[name=expence_taxtype]").val(TaxType);
|
||||
$(opener.document).find("input[name=expence_item]").val(ItemName);
|
||||
|
||||
$(opener.document).find("input[name=expence_money]").val("0");
|
||||
$(opener.document).find("input[name=expence_vat]").val("0");
|
||||
$(opener.document).find("input[name=expence_sum]").val("0");
|
||||
|
||||
if(WriteAbleAmount == AmountTotal){
|
||||
opener.AmountTotal = +(AmountTotal.replace(/,/gi, ''));
|
||||
opener.TaxTotal = +(TaxTotal.replace(/,/gi, ''));
|
||||
opener.TotalAmount = +(TotalAmount.replace(/,/gi, ''));
|
||||
|
||||
if($(opener.document).find("#boolgong").prop("checked") == true){
|
||||
if($(opener.document).find("#writeAbleDiv").length == 0){
|
||||
$(opener.document).find("input[name=expence_money]").val(TotalAmount);
|
||||
$(opener.document).find("input[name=expence_vat]").val("0");
|
||||
$(opener.document).find("input[name=expence_sum]").val(TotalAmount);
|
||||
}
|
||||
opener.MaxAmountTotal = +(TotalAmount.replace(/,/gi, ''));
|
||||
opener.MaxTaxTotal = 0;
|
||||
}else{
|
||||
if($(opener.document).find("#writeAbleDiv").length == 0){
|
||||
$(opener.document).find("input[name=expence_money]").val(AmountTotal);
|
||||
$(opener.document).find("input[name=expence_vat]").val(TaxTotal);
|
||||
$(opener.document).find("input[name=expence_sum]").val(TotalAmount);
|
||||
}
|
||||
opener.MaxAmountTotal = +(AmountTotal.replace(/,/gi, ''));
|
||||
opener.MaxTaxTotal = +(TaxTotal.replace(/,/gi, ''));
|
||||
}
|
||||
}else{
|
||||
if($(opener.document).find("#writeAbleDiv").length == 0){
|
||||
$(opener.document).find("input[name=expence_money]").val(WriteAbleAmount);
|
||||
$(opener.document).find("input[name=expence_vat]").val(WriteAbleTax);
|
||||
$(opener.document).find("input[name=expence_sum]").val(commify(+(WriteAbleAmount.replace(/,/gi, '')) + +(WriteAbleTax.replace(/,/gi, ''))));
|
||||
}
|
||||
opener.AmountTotal = +(WriteAbleAmount.replace(/,/gi, ''));
|
||||
opener.TaxTotal = +(WriteAbleTax.replace(/,/gi, ''));
|
||||
opener.TotalAmount = +(WriteAbleAmount.replace(/,/gi, '')) + +(WriteAbleTax.replace(/,/gi, ''));
|
||||
opener.MaxAmountTotal = +(WriteAbleAmount.replace(/,/gi, ''));
|
||||
opener.MaxTaxTotal = +(WriteAbleTax.replace(/,/gi, ''));
|
||||
}
|
||||
|
||||
if($(opener.document).find("#writeAbleDiv").length == 0){
|
||||
$(opener.document).find("input[name=expence_vat]").attr("readonly", true);
|
||||
opener.check_comma($(opener.document).find("input[name=expence_money]").val(), '1');
|
||||
}else{
|
||||
$(opener.document).find("#MaxAmountTotal").html(commify(opener.MaxAmountTotal));
|
||||
$(opener.document).find("#MaxTaxTotal").html(commify(opener.MaxTaxTotal));
|
||||
opener.check_comma('', '3', 1);
|
||||
}
|
||||
|
||||
$(opener.document).find("select[name=expence_way]").hide();
|
||||
$(opener.document).find("select[name=expence_way]").next().remove();
|
||||
$(opener.document).find("select[name=expence_way]").after("<span><3E><><EFBFBD>ݰ<EFBFBD><DDB0>꼭</span>");
|
||||
|
||||
self.close();
|
||||
});
|
||||
});
|
||||
|
||||
function autoHypenPhoneNum(str){
|
||||
str = str.replace(/[^0-9]/g, '');
|
||||
var tmp = '';
|
||||
if( str.length < 4){
|
||||
return str;
|
||||
}else if(str.length < 7){
|
||||
tmp += str.substr(0, 3);
|
||||
tmp += '-';
|
||||
tmp += str.substr(3);
|
||||
return tmp;
|
||||
}else{
|
||||
tmp += str.substr(0, 3);
|
||||
tmp += '-';
|
||||
tmp += str.substr(3, 2);
|
||||
tmp += '-';
|
||||
tmp += str.substr(5);
|
||||
return tmp;
|
||||
}
|
||||
return str;
|
||||
}
|
||||
</script>
|
||||
</div>
|
||||
<!-- /.content-wrapper -->
|
||||
<!-- #include virtual = "include/footer.asp" -->
|
||||
Reference in New Issue
Block a user