1. 지출결의서 비고 명칭 변경(지출결의서의 비고(내용,수량,단가 등)을 사용내역(상세내역 작성필수) 으로 변경) 2. 면접원수당 및 내근직수당 검토/승인(관리부서) 단계 활성화
995 lines
37 KiB
Plaintext
995 lines
37 KiB
Plaintext
<!-- #include virtual = "include/header.asp" -->
|
|
<!-- #include virtual = "include/left.asp" -->
|
|
<OBJECT RUNAT=Server PROGID=ADODB.Recordset id=rsp></OBJECT>
|
|
<%
|
|
dim tmpstr
|
|
dim Query
|
|
dim i
|
|
dim user_name(4) '현재 사용자,0:사원코드, 1:이름,2:직급,3:전화번호, 4:부서코드(명)
|
|
dim Max_Width
|
|
dim title
|
|
dim Curr_date '오늘날짜
|
|
dim Company(6)
|
|
dim cnt
|
|
dim pay_type(4)
|
|
dim db_table_name
|
|
dim title_type
|
|
dim p_depart
|
|
|
|
db_table_name = "문서내용"
|
|
|
|
title="지 출 결 의 서"
|
|
|
|
title_type = mid(replace(title," ",""), 1, 2)
|
|
|
|
Max_Width =650
|
|
Curr_date = year(date) & "년 " & month(date) & "월 " & day(date) & "일"
|
|
|
|
pay_type(1) = "카드/현금"
|
|
pay_type(2) = "세금계산서"
|
|
pay_type(4) = "인건비"
|
|
|
|
''//===============
|
|
''회사 회사명, 사업자등록번호, 대표자명, 주소 가져오기
|
|
Query = "select * from company"
|
|
adoRs.open Query, adoconn,adopenstatic, adlockreadonly
|
|
Company(1) = adors("com_name")
|
|
Company(2) = adors("사업자등록번호")
|
|
Company(3) = adors("대표자명")
|
|
Company(4) = adors("주소")
|
|
Company(5) = adors("법인등록번호")
|
|
Company(6) = adors("회사대표전화번호")
|
|
adoRs.close
|
|
|
|
''///===============
|
|
''로그인 사용자 정보
|
|
user_name(0) = Session("User_Number")
|
|
Query = "SELECT p_name, p_team_name, p_rank_name, p_tel3 FROM project2.dbo.V_Person WHERE p_no = '" & user_name(0) & "'"
|
|
adoRs.open Query, adoconn,adopenstatic, adlockreadonly
|
|
user_name(1) = adoRs("p_name") '이름
|
|
user_name(2) = adoRs("p_rank_name") '직위 코드
|
|
user_name(3) = adoRs("p_tel3") '직통 전화
|
|
user_name(4) = adoRs("p_team_name") '부서코드
|
|
adoRs.close
|
|
|
|
|
|
p_depart = Session("Depart_Code")
|
|
|
|
If Trim(request("cost_type")) = "" Or isnull(request("cost_type")) = true Then
|
|
cost_type = 2
|
|
d_cost_type = "common"
|
|
Else
|
|
cost_type = request("cost_type")
|
|
If request("cost_type") = 1 Then
|
|
d_cost_type = "support"
|
|
Else
|
|
d_cost_type = "common"
|
|
End if
|
|
|
|
End If
|
|
%>
|
|
<!-- Content Wrapper. Contains page content -->
|
|
<div class="content-wrapper">
|
|
<style>
|
|
.imgPreviewItem{
|
|
width:20%;
|
|
height:150px;
|
|
border: 1px solid #ccc;
|
|
box-shadow: 1px 1px 2px 1px #b9b9b9;
|
|
justify-content: center;
|
|
align-items: center;
|
|
cursor:pointer;
|
|
}
|
|
.imgPreviewItem > img{
|
|
max-height: 100%;
|
|
max-width: 100%;
|
|
}
|
|
.popover{
|
|
max-width:none;
|
|
}
|
|
.imgView{
|
|
max-height: 800px;
|
|
max-width: 800px;
|
|
}
|
|
.blink {
|
|
-webkit-animation: blink 0.3s linear infinite;
|
|
}
|
|
@keyframes blink {
|
|
/*0% 부터 100% 까지*/
|
|
0% { color:#C25E5E; border-color:#9DED85; }
|
|
5% { color:#C05683; border-color:#2DDAA7; }
|
|
10% { color:#A45EAA; border-color:#00C2C3; }
|
|
15% { color:#656EC9; border-color:#00A5CE; }
|
|
20% { color:#007CD3; border-color:#0085C1; }
|
|
25% { color:#0085C1; border-color:#007CD3; }
|
|
30% { color:#00A5CE; border-color:#656EC9; }
|
|
35% { color:#00C2C3; border-color:#A45EAA; }
|
|
40% { color:#2DDAA7; border-color:#C05683; }
|
|
55% { color:#9DED85; border-color:#C05683; }
|
|
60% { color:#2DDAA7; border-color:#A45EAA; }
|
|
65% { color:#00C2C3; border-color:#656EC9; }
|
|
70% { color:#00A5CE; border-color:#007CD3; }
|
|
75% { color:#0085C1; border-color:#0085C1; }
|
|
80% { color:#007CD3; border-color:#00A5CE; }
|
|
85% { color:#656EC9; border-color:#00C2C3; }
|
|
100% { color:#A45EAA; border-color:#2DDAA7; }
|
|
/*from부터 to 까지
|
|
from {color:#00a0e9;}
|
|
to {color:#000;}
|
|
*/
|
|
}
|
|
</style>
|
|
<!-- Content Header (Page header) -->
|
|
<div class="content-header">
|
|
<h1>문서 작성</h1>
|
|
</div>
|
|
<!-- /.content-header -->
|
|
<!-- Main content -->
|
|
<div class="content-body">
|
|
<div class="content">
|
|
<div class="container-fluid">
|
|
<div class="row">
|
|
<div class="col-12">
|
|
<table width="800px" cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="py-2">
|
|
<font class="brown"><%=title_type%>결의서 작성페이지입니다.(일반비용) 프로젝트명에 특수문자를 사용하실 수 없습니다.</font>
|
|
<button type="button" class="float-right blink" onclick="window.open('/approval/pdf/220929_세금계산서 지출결의서 작성안내(최종).pdf')"><i class="fas fa-question"></i></button>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td align="center" style="padding:10;border-left:1px solid #dedede;border-right:1px solid #dedede;">
|
|
<form method='post' name='frm_money' enctype='multipart/form-data'>
|
|
<input type="hidden" name="title_type" value='<%=title_type%>' >
|
|
<input type="hidden" name="d_cost_type" value='<%=d_cost_type%>' >
|
|
<input type="hidden" name="print_type" value='1' >
|
|
<input type="hidden" name="expence_taxtype" value=''>
|
|
<input type="hidden" name="expence_item" value=''>
|
|
<input type="hidden" name="k_company" value=''>
|
|
<table class="table table-sm table-sm2 table-bordered table-head tr-colors">
|
|
<!-- 18: 경영전략식, 12: DIN 프로젝트 비용 리스트도 떠야해서 수정함. 241216 jelee -->
|
|
<% If int(Session("Depart_Code")) = 18 or int(Session("Depart_Code")) = 12 Then %>
|
|
<tr>
|
|
<td colspan="4" class="text-center">
|
|
<input type="radio" class="none" name='cost_type' value='1' onclick="expense_Type_Change(1)" <% If cost_type = 1 Then %> checked <% End If %> >프로젝트비용 <!-- style="display:none;" -->
|
|
<input type="radio" class="none" name='cost_type' value='2' onclick="expense_Type_Change(2)" <% If cost_type = 2 Then %> checked <% End If %>>일반비용
|
|
</td>
|
|
</tr>
|
|
<% End If %>
|
|
<tr height="24">
|
|
<td align="center" colspan="4" style="font-size:12px;">하기의 프로젝트(업무)와 관련하여 <%=title_type%>을 결의하오니 승인하여 주시기 바랍니다. </td>
|
|
</tr>
|
|
<tr>
|
|
<td width="15%" align="center" >비용항목</td>
|
|
<td width="35%" >
|
|
<select name="hangmok" id="hangmok" tabindex="4" ><!--== 비용항목 ==-->
|
|
<option value=''>선택</option>
|
|
<%
|
|
If cost_type = 1 Then
|
|
query = "select * from direct_costcode where d_cost_kind = 'support' and d_cost_parents = 0 and d_cost_useyn = 'Y' order by d_cost_kind, d_cost_parents "
|
|
else
|
|
query = "select * from direct_costcode where d_cost_kind = 'common' and d_cost_parents = 0 and d_cost_useyn = 'Y' order by d_cost_kind, d_cost_parents "
|
|
End if
|
|
|
|
rsp.Open query, adoConn, 1
|
|
|
|
for i=1 to rsp.recordCount %>
|
|
<option value='<%=rsp("id")%>'><%=rsp("d_cost_name")%></option>
|
|
<% rsp.movenext
|
|
next
|
|
rsp.close %>
|
|
</select>
|
|
</td>
|
|
<td width="15%" align="center" >세부내용</td>
|
|
<td width="35%" >
|
|
<select name="sebu" id="sebu" tabindex="4"><!--== 세부내용 ==-->
|
|
<option value=''>선택</option>
|
|
</select>
|
|
<label class="ml-2 d-none" for="boolgong"><input type="checkbox" id="boolgong" /> 불공여부</label>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td align="center" >거래처</td>
|
|
<td >
|
|
<input type="text" class="gray" style="width:200px;" name="expence_company" value='' />
|
|
<input type="hidden" name="expence_company_num" value=''>
|
|
</td>
|
|
<td align="center" >증빙일자</td>
|
|
<td >
|
|
<input type="text" class="selectDate" style="width:150;text-align:right;cursor:pointer;" name="expence_date" id="expence_date" value="" readonly>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="15%" align="center" >증빙서류</td>
|
|
<td width="35%">
|
|
<select name="expence_way" id="expence_way" tabindex="4" onchange="bugaNoChange()">
|
|
<%for i=1 to 4%>
|
|
<%if pay_type(i) <> "" Then%>
|
|
<option value="<%=pay_type(i)%>"><%=pay_type(i)%></option>
|
|
<%End If %>
|
|
<%next%>
|
|
</select>
|
|
</td>
|
|
<td align="center">입금계좌</td>
|
|
<td>첨부파일 참조</td>
|
|
</tr>
|
|
<tr>
|
|
<td align="center" valign="middle">지급일자</td>
|
|
<td>
|
|
<input type="text" class="selectPaymentDate" style="width:150;text-align:right;cursor:pointer;" name="payment_date" id="payment_date" value="" readonly>
|
|
</td>
|
|
<td align="left" colspan="3" style="color:royalblue;">* 지급일자는 회사의 비용 지급 기준에 맞춰 작성(월별 비용 마감 안내 메일 확인)<br>
|
|
예외적으로 지급일자 변경이 필요한 경우 비고란에 사유 기재</td>
|
|
</tr>
|
|
<tr>
|
|
<td align="center" class="attach_doc_layer">품의문서</td>
|
|
<td class="attach_doc_layer">
|
|
<input type="text" class="gray" style="width:150;" name="txt_d_no" value='' readonly>
|
|
<img src="/images/common/btn_smallsrch2.gif" align="absmiddle" onclick="docopen('con','txt_d_no');" style="CURSOR:pointer;">
|
|
</td>
|
|
<td width="15%" align="center" class='expence_num_td d-none'>증빙번호</td>
|
|
<td width="35%" class='expence_num_td d-none'>
|
|
<input type="text" class="gray" style="width:150;text-align:left;" name="expence_num" id="expence_num" value='' readonly />
|
|
<button type="button" id="taxBtn" class="btn btn-primary btn-sm py-0 border-0" style="height: 21px;margin-top: -3px;"><i class="fas fa-search"></i></button>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="15%" align="center" class="align-middle">증빙첨부</td>
|
|
<td colspan="3">
|
|
<button type="button" class="btn btn-sm btn-primary" onclick="addDocAttach();">추가</button>
|
|
<input type="file" accept="image/*,application/pdf" id="doc_attach" class="d-none"/>
|
|
<input type="file" name="doc_attach" multiple="multiple" class="d-none" />
|
|
</td>
|
|
</tr>
|
|
<tr id="imgPreviews" style="display:none;">
|
|
<td colspan="4">
|
|
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<div class="d-none bg-gray" id="writeAbleDiv">
|
|
<div class="">
|
|
공급가액 : <span class="" id="ThisAmountTotal">0</span>/<span class="mr-3 font-weight-bold" id="MaxAmountTotal">0</span>
|
|
부가세액 : <span class="" id="ThisTaxTotal">0</span>/<span class="font-weight-bold" id="MaxTaxTotal">0</span>
|
|
</div>
|
|
</div>
|
|
<table id="tableContents" class="table table-sm table-sm2 table-bordered table-head tr-colors">
|
|
<tr>
|
|
<td align="center" rowspan="2" width="18px;">지출결의(1)</td>
|
|
<td align="center" >프로젝트 번호</td>
|
|
<td >
|
|
<input type="text" class="gray" style="width:200px;display:none;" name="p_subject" id="p_subject1" value='' readonly>
|
|
<img src="/images/common/btn_smallsrch2.gif" align="absmiddle" onclick="winnewopen('1');" style="CURSOR:pointer;">
|
|
<input type="text" class="gray" style="width:80px;" name="p_sn" id="p_sn1" value=''
|
|
<% If int(Session("Depart_Code")) <> 18 Then %> readonly <% End If %>
|
|
/>
|
|
</td>
|
|
<td align="center" >공급가액</td>
|
|
<td >
|
|
<input type="text" id="val_supply1" class="gray" style="width:80px;text-align:right;" OnKeyup="OnlyNumber(this);check_comma(this.value,'1', '1');" name="expence_money" value='0'> 원
|
|
</td>
|
|
<td align="center" >부가세액<br /><input type="button" value="자동계산" onclick="vat_auto('1');" /></td>
|
|
<td >
|
|
<input type="text" class="gray" style="width:80px;text-align:right;" OnKeyup="OnlyNumber(this);check_comma(this.value,'2', '1');" name="expence_vat" id="expence_vat1" value='0'> 원
|
|
</td>
|
|
<td align="center" ><%=title_type%>총액</td>
|
|
<td >
|
|
<input type="text" class="gray" style="width:80px;text-align:right;" name="expence_sum" id="expence_sum1" readonly value='0'> 원
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td align="center" class="tit_left tit_right">사용내역<br>(상세내역 작성필수)</td>
|
|
<td align="center" colspan="7">
|
|
<TEXTAREA rows="3" cols="80" name="expence_reason" id="expence_reason1" style="width:100%;height:50;"></TEXTAREA>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<input type="hidden" name="contents_cnt" value='1'/>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td align="center">
|
|
<button type="button" class="btn btn-secondary" onclick="addContents();">내용추가</button>
|
|
<button type="button" class="btn btn-success" onclick="addAutoInsert();">일괄등록</button>
|
|
</td>
|
|
</tr>
|
|
<tr id="autoAddRowContainer" style="display:none;">
|
|
<td align="center">
|
|
<table width="100%" cellpadding="0" cellspacing="0" border="0" style="border-collapse:collapse;">
|
|
<tr>
|
|
<td>
|
|
아래와 같이 엑셀 내역을 작성하고, 복사하여 붙여넣기 한다.<br>
|
|
(작성 예제) * 꼭 엑셀을 이용하여 주십시오.<br>
|
|
<table class="table table-sm table-sm2 table-bordered table-head tr-colors mb-0" style="font-size:12px;">
|
|
<tr>
|
|
<td align="center">프로젝트번호</td>
|
|
<td align="center">공급가액</td>
|
|
<td align="center">부가세액</td>
|
|
<td align="center">지출총액</td>
|
|
<td align="center">사용내역(상세내역 작성필수)</td>
|
|
<tr>
|
|
<tr>
|
|
<td align="right">2201001_C01</td>
|
|
<td align="right">111,111</td>
|
|
<td align="right">1,111</td>
|
|
<td align="right">112,222</td>
|
|
<td align="left">comment</td>
|
|
<tr>
|
|
<tr>
|
|
<td align="right">2201001_C02</td>
|
|
<td align="right">222,222</td>
|
|
<td align="right">2,222</td>
|
|
<td align="right">224,444</td>
|
|
<td align="left">comment</td>
|
|
<tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<TEXTAREA rows="3" class="align-middle" style="width:calc(100% - 200px);" name="parseTxt" id="parseTxt"></TEXTAREA>
|
|
<button type="button" class="btn btn-dark align-middle" style="width:194px;" onclick="dataAutoInert();">입력</button>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="padding-top:10px;" align="center">
|
|
<button type="button" class="btn btn-primary" onclick="goPrint();">입력하기</button>
|
|
<button type="button" class="btn btn-info" onclick="history.back(-1);">취소하기</button>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<canvas id="pdf-canvas" width="400" class="d-none"></canvas>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- /.content -->
|
|
<!-- REQUIRED SCRIPTS -->
|
|
<script>
|
|
var fileArray = [];
|
|
var AmountTotal = 0;
|
|
var TaxTotal = 0;
|
|
var TotalAmount = 0;
|
|
var MaxAmountTotal = 0;
|
|
var MaxTaxTotal = 0;
|
|
$(function () {
|
|
currentMenu("/approval/doc_select.asp", "");
|
|
$(".selectDate").datepicker();
|
|
$(".selectPaymentDate").datepicker();
|
|
var d_cost_type = document.frm_money.d_cost_type.value;
|
|
|
|
if(d_cost_type == "common"){
|
|
$(".attach_doc_layer").removeClass("d-none");
|
|
}else{
|
|
$(".attach_doc_layer").addClass("d-none");
|
|
}
|
|
|
|
$('#hangmok').change(function () {
|
|
var cost_type = $("input[name='cost_type']").length > 0 ? $("input[name='cost_type']:checked").val() : 0;
|
|
|
|
ajaxCallJson("doc_expense2_ajax_sebu_2014.asp", { hangmok: $("#hangmok option:selected").val(), d_cost_type: d_cost_type, cost_type: cost_type}, null, "post", "sebureturnFunc()");
|
|
});
|
|
|
|
$("#doc_attach").on("change", function(e){
|
|
if(e.target.files.length > 0){
|
|
if(e.target.files[0].type == "application/pdf"){
|
|
pdfToImg(e.target.files[0]);
|
|
}else{
|
|
fileArray.push(e.target.files[0]);
|
|
}
|
|
}
|
|
imgPreviewSetting(fileArray);
|
|
});
|
|
|
|
$(document).on("click", ".imgPreviewItem", function(){
|
|
var idx = +$(this).data("idx");
|
|
if(confirm("선택하신 첨부파일을 삭제하시겠습니까?")){
|
|
$(this).popover('dispose');
|
|
fileArray.splice(idx, 1);
|
|
imgPreviewSetting(fileArray);
|
|
}
|
|
});
|
|
|
|
$("#taxBtn").on("click", function(){
|
|
$.confirm({
|
|
title:"",
|
|
content:"전자세금계산서를 조회할 사업장을 선택해주세요.",
|
|
buttons:{
|
|
"KRi":function(){
|
|
window.open("./doc_expense_taxList.asp?cutmenu=1&company=kri", "", "left=150, top=150, menubar=no, location=no, status=no, toolbar=no, width=1330px, height=580px, scrollbars=yes ,resizable=no");
|
|
},
|
|
"KRc":function(){
|
|
window.open("./doc_expense_taxList.asp?cutmenu=1&company=krc", "", "left=150, top=150, menubar=no, location=no, status=no, toolbar=no, width=1330px, height=580px, scrollbars=yes ,resizable=no");
|
|
},
|
|
"KRd":function(){
|
|
window.open("./doc_expense_taxList.asp?cutmenu=1&company=krd", "", "left=150, top=150, menubar=no, location=no, status=no, toolbar=no, width=1330px, height=580px, scrollbars=yes ,resizable=no");
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
$("#boolgong").on("click", function(){
|
|
if($(this).prop("checked") == true){
|
|
$("input[name=expence_vat]").val("0");
|
|
$("input[name=expence_vat]").trigger("keyup");
|
|
$("input[name=expence_vat]").attr("readonly", true);
|
|
$("input[value='자동계산']").hide();
|
|
MaxAmountTotal = AmountTotal + TaxTotal;
|
|
MaxTaxTotal = 0;
|
|
}else{
|
|
$("input[name=expence_vat]").removeAttr("readonly");
|
|
$("input[value='자동계산']").show();
|
|
MaxAmountTotal = AmountTotal;
|
|
MaxTaxTotal = TaxTotal;
|
|
}
|
|
$("#MaxAmountTotal").html(commify(MaxAmountTotal));
|
|
$("#MaxTaxTotal").html(commify(MaxTaxTotal));
|
|
});
|
|
});
|
|
|
|
function addDocAttach(){
|
|
$("#doc_attach").click();
|
|
}
|
|
|
|
function imgPreviewSetting(files){
|
|
if(files.length > 0){
|
|
var tmpHTML = "";
|
|
tmpHTML = "<div id='imgPreviewDiv' class='d-flex'></div>";
|
|
$("#imgPreviews").children("td").html(tmpHTML);
|
|
$.each(files, function(i, f){
|
|
$("#imgPreviewDiv").append(
|
|
"<div class='d-flex p-1 m-1 imgPreviewItem' data-idx='" + i + "'>"+
|
|
"<img src='' alt='첨부' class='' id='preview_" + (i+1) + "' />"+
|
|
"</div>"
|
|
);
|
|
var reader = new FileReader();
|
|
reader.onload = function(e){
|
|
$("#preview_" + (i+1)).attr("src", e.target.result);
|
|
$("#preview_" + (i+1)).parent().popover({
|
|
html: true,
|
|
trigger: 'hover',
|
|
container: 'body',
|
|
placement: 'right',
|
|
content: function () { return '<img class="imgView" src="' + e.target.result + '" />'; }
|
|
});
|
|
}
|
|
reader.readAsDataURL(f);
|
|
});
|
|
|
|
$("#imgPreviews").show();
|
|
}else{
|
|
$("#imgPreviews").hide();
|
|
}
|
|
}
|
|
|
|
function btn_del(index){
|
|
//var cnt = parseInt(document.frm_money.contents_cnt.value, 10);
|
|
$("#addRow_Top_"+index).remove();
|
|
$("#addRow_Bottom_"+index).remove();
|
|
//document.frm_money.contents_cnt.value = cnt - 1;
|
|
}
|
|
|
|
function addContents(){
|
|
var contents_count = 0;
|
|
contents_count = parseInt(document.frm_money.contents_cnt.value, 10);
|
|
|
|
if(contents_count < 30){
|
|
contents_count = contents_count + 1;
|
|
|
|
var temp_html = '<tr id="addRow_Top_'+contents_count+'">'+
|
|
'<td align="center" rowspan="2" width="18px;">지출결의('+contents_count+')'+
|
|
'<img src="/images/business/icon_del.gif" onclick="btn_del('+contents_count+');" style="CURSOR:pointer; width:18px;" title="삭제">'+
|
|
'</td>'+
|
|
'<td align="center" >프로젝트 번호</td>'+
|
|
'<td >'+
|
|
'<input type="text" class="gray" style="width:200px;display:none;" name="p_subject" id="p_subject' + contents_count + '" value="" readonly>' +
|
|
'<img src="/images/common/btn_smallsrch2.gif" align="absmiddle" onclick="winnewopen('+contents_count+');" style="CURSOR:pointer;">'+
|
|
'<input type="text" class="gray" style="width:80px;" name="p_sn" id="p_sn' + contents_count + '" value=""/>'+
|
|
'</td>'+
|
|
'<td align="center" >공급가액</td>'+
|
|
'<td >'+
|
|
'<input type="text" class="gray" id="val_supply' + contents_count + '" style="width:80px;text-align:right;" OnKeyup="OnlyNumber(this);check_comma(this.value,1, ' + contents_count + ');" name="expence_money" value="0"> 원' +
|
|
'</td>'+
|
|
'<td align="center" >부가세액<br />' + ($("#boolgong").prop("checked") == true ? '' : '<input type="button" value="자동계산" onclick="vat_auto('+contents_count+');" />') + '</td>'+
|
|
'<td >'+
|
|
'<input type="text" class="gray" style="width:80px;text-align:right;" OnKeyup="OnlyNumber(this);check_comma(this.value,2, ' + contents_count + ');" '+
|
|
($("#boolgong").prop("checked") == true ? 'readonly' : '') + ' name="expence_vat" id="expence_vat' + contents_count + '" value="0"> 원' +
|
|
'</td>'+
|
|
'<td align="center" ><%=title_type%>총액</td>'+
|
|
'<td >'+
|
|
'<input type="text" class="gray" style="width:80px;text-align:right;" name="expence_sum" id="expence_sum' + contents_count + '" readonly value="0"> 원' +
|
|
'</td>'+
|
|
'</tr>'+
|
|
'<tr id="addRow_Bottom_'+contents_count+'">'+
|
|
'<td align="center" class="tit_left tit_right">비고<br>(내용, 수량,<br>단가 등)</td>'+
|
|
'<td align="center" colspan="7">'+
|
|
'<TEXTAREA rows="3" cols="80" name="expence_reason" id="expence_reason' + contents_count + '" style="width:100%;height:50;"></TEXTAREA>'+
|
|
'</td>'+
|
|
'</tr>';
|
|
|
|
$("#tableContents").append(temp_html);
|
|
document.frm_money.contents_cnt.value = contents_count;
|
|
}else{
|
|
alert("입력 가능한 지출결의서 내용은 30개가 최대 입니다.");
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
function expense_Type_Change(type) {
|
|
var url = "doc_expense2_2014.asp?title=지출결의서&cost_type="+type;
|
|
location.href = url;
|
|
}
|
|
|
|
function addAutoInsert(){
|
|
if($("#autoAddRowContainer").css("display") == "none"){
|
|
$("#autoAddRowContainer").css("display", "");
|
|
}else{
|
|
$("#autoAddRowContainer").css("display", "none");
|
|
}
|
|
|
|
}
|
|
|
|
function dataAutoInert(){
|
|
if(confirm("현재 미리 입력 하신 데이터가 존재 한다면 삭제 됩니다.\n진행 하시겠습니까?")){
|
|
var rowData = $("#parseTxt").val().split(/\n/gi);
|
|
//alert($("#parseTxt").val()+"\n"+rowData.length);
|
|
var titleLine = false;
|
|
var rowCount = 0;
|
|
var addindex = 0;
|
|
|
|
if(rowData != "" || rowData.length > 0){
|
|
rowCount = rowData.length;
|
|
for(var i=0; i<rowData.length; i++){
|
|
//alert(rowData[i]);
|
|
var items = rowData[i].split(/\t/gi);
|
|
|
|
if(items != "" || items.length > 0){
|
|
var item_length = items.length;
|
|
if(item_length > 5){
|
|
item_length = 5
|
|
}
|
|
|
|
for(var j=0; j<item_length; j++){
|
|
if(i == 0){ //첫번재 줄 데이터 일 경우
|
|
if(items[j].indexOf("프로젝트") > -1){
|
|
//alert("제목줄이다~!");
|
|
titleLine = true;
|
|
}else if(items[j].indexOf("공급가") > -1){
|
|
//alert("제목줄이다~!");
|
|
titleLine = true;
|
|
}else if(items[j].indexOf("부가") > -1){
|
|
//alert("제목줄이다~!");
|
|
titleLine = true;
|
|
}else if(items[j].indexOf("지출") > -1){
|
|
//alert("제목줄이다~!");
|
|
titleLine = true;
|
|
}else if(items[j].indexOf("비고") > -1){
|
|
//alert("제목줄이다~!");
|
|
titleLine = true;
|
|
}
|
|
}
|
|
|
|
if(titleLine == false){
|
|
//alert("addindex : " + addindex+"//"+items[j]);
|
|
if (addindex > 0){
|
|
if(j == 0){
|
|
if(addContents()){
|
|
//alert("j : "+j+"//"+items[j]);
|
|
document.frm_money.p_sn[addindex].value = items[j];
|
|
}
|
|
}else if(j == 1){
|
|
//alert("j : "+j+"//"+items[j]);
|
|
document.frm_money.expence_money[addindex].value = items[j];
|
|
}else if(j == 2){
|
|
//alert("j : "+j+"//"+items[j]);
|
|
document.frm_money.expence_vat[addindex].value = items[j];
|
|
}else if(j == 3){
|
|
//alert("j : "+j+"//"+items[j]);
|
|
document.frm_money.expence_sum[addindex].value = items[j];
|
|
}else if(j == 4){
|
|
//alert("j : "+j+"//"+items[j]);
|
|
document.frm_money.expence_reason[addindex].value = items[j];
|
|
}
|
|
}else{
|
|
if(j == 0){
|
|
document.frm_money.p_sn.value = items[j];
|
|
}else if(j == 1){
|
|
document.frm_money.expence_money.value = items[j];
|
|
}else if(j == 2){
|
|
document.frm_money.expence_vat.value = items[j];
|
|
}else if(j == 3){
|
|
document.frm_money.expence_sum.value = items[j];
|
|
}else if(j == 4){
|
|
document.frm_money.expence_reason.value = items[j];
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
if(titleLine == true){
|
|
//alert("제목줄이다~!");
|
|
rowCount = rowCount - 1;
|
|
titleLine = false;
|
|
}else{
|
|
addindex = addindex + 1;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
$("#autoAddRowContainer").css("display", "none");
|
|
//---################################################################################################
|
|
//---------------------------------------------------------------------
|
|
checkSum();
|
|
}
|
|
}
|
|
|
|
function checkSum(){
|
|
// 일괄등록값 체크 (공급가액 + 부가세액 = 지출총액)
|
|
var a,b,c;
|
|
var xmsg="";
|
|
|
|
var xxmoney=document.frm_money.expence_money;
|
|
if(xxmoney.length!=undefined){
|
|
|
|
for(k=0;document.frm_money.expence_money.length>k;k++){
|
|
|
|
if(document.frm_money.expence_money[k].value!=""){
|
|
a=document.frm_money.expence_money[k].value;
|
|
b=document.frm_money.expence_vat[k].value;
|
|
c=document.frm_money.expence_sum[k].value;
|
|
a=a.replace(/,/gi, "");
|
|
b=b.replace(/,/gi, "");
|
|
c=c.replace(/,/gi, "");
|
|
|
|
if((Number(a)+Number(b))!=Number(c)){
|
|
if(xmsg==""){ xmsg="공급가액 + 부가세액의 합계금액이 지출총액과 틀립니다. 확인하시기 바랍니다 "; }
|
|
}
|
|
}
|
|
}
|
|
}else{
|
|
a=document.frm_money.expence_money.value;
|
|
b=document.frm_money.expence_vat.value;
|
|
c=document.frm_money.expence_sum.value;
|
|
a=a.replace(/,/gi, "");
|
|
b=b.replace(/,/gi, "");
|
|
c=c.replace(/,/gi, "");
|
|
|
|
if(document.frm_money.expence_money.value!=""){
|
|
if((Number(a)+Number(b))!=Number(c)){
|
|
if(xmsg==""){ xmsg="공급가액 + 부가세액의 합계금액이 지출총액과 틀립니다. 확인하시기 바랍니다 "; }
|
|
}
|
|
}
|
|
}
|
|
if(xmsg!=""){
|
|
alert(xmsg);
|
|
return false;
|
|
}else{
|
|
return true;
|
|
}
|
|
}
|
|
|
|
function bugaNoChange() {
|
|
if ($("#expence_way").val() != "세금계산서") {
|
|
$("#boolgong").parent().addClass("d-none");
|
|
$("#boolgong").prop("checked", false);
|
|
$("#expence_num").val("");
|
|
$(".expence_num_td").addClass("d-none");
|
|
$("#writeAbleDiv").addClass("d-none");
|
|
//$(".expence_sum_td").attr("rowspan", "2");
|
|
} else {
|
|
$("#boolgong").parent().removeClass("d-none");
|
|
$(".expence_num_td").removeClass("d-none");
|
|
$("#writeAbleDiv").removeClass("d-none");
|
|
//$(".expence_sum_td").attr("rowspan", "1");
|
|
|
|
}
|
|
}
|
|
|
|
function winnewopen(index){
|
|
var contents_count = parseInt(document.frm_money.contents_cnt.value, 10);
|
|
var cost_type = $("input[name='cost_type']").length > 0 ? $("input[name='cost_type']:checked").val() : 0;
|
|
|
|
var url = "/project_list/project_list_2014.asp";
|
|
url = url + "?d_cost_type="+document.frm_money.d_cost_type.value+"&type=common&cost_type="+cost_type+"&index="+index+"&count="+contents_count;
|
|
|
|
window.open(url,"wins","left=50, top=50, menubar=no, location=no, status=no, toolbar=no, width=850, height=600, scrollbars=yes ,resizable=no");
|
|
}
|
|
|
|
function docopen(a, b)
|
|
{
|
|
var url = "/project_list/document_list.asp";
|
|
url = url + "?d_name=" + a;
|
|
url = url + "&txt_d_no=" + b;
|
|
|
|
window.open(url,"wins","left=50, top=50, menubar=no, location=no, status=no, toolbar=no, width=800, height=350, scrollbars=yes ,resizable=no");
|
|
}
|
|
|
|
function goPrint() {//프린트 하기
|
|
var vat_check_boolean = vat_check();
|
|
if (vat_check_boolean == false) {
|
|
alert("부가세를 다시 검토하세요.");
|
|
return false;
|
|
}
|
|
if(checkSum() == false){
|
|
return false;
|
|
}
|
|
|
|
var hangmok = document.frm_money.hangmok.value;
|
|
var sebu = document.frm_money.sebu.value;
|
|
var expence_company = document.frm_money.expence_company.value;
|
|
var expence_date = document.frm_money.expence_date.value;
|
|
var payment_date = document.frm_money.payment_date.value;
|
|
var expence_way = document.frm_money.expence_way.value;
|
|
var txt_d_no = document.frm_money.txt_d_no.value;
|
|
|
|
if(expence_way == "세금계산서"){
|
|
if(MaxAmountTotal < +($("#ThisAmountTotal").html().replace(/,/gi, ''))){
|
|
alert("입력가능한 공급가액을 초과하였습니다.\n"+commify(MaxAmountTotal)+" 원 이하로 입력해주세요");
|
|
return;
|
|
}
|
|
if(MaxTaxTotal < +($("#ThisTaxTotal").html().replace(/,/gi, ''))){
|
|
alert("입력가능한 부가세액을 초과하였습니다.\n"+commify(MaxTaxTotal)+" 원 이하로 입력해주세요");
|
|
return;
|
|
}
|
|
if(MaxTaxTotal != +($("#ThisTaxTotal").html().replace(/,/gi, ''))){
|
|
alert("부가세액의 합계가 최대가 되도록 입력해주세요.\n"+commify(MaxTaxTotal)+" 원을 맞춰 입력해주세요");
|
|
return;
|
|
}
|
|
}
|
|
|
|
var p_subject = "";
|
|
var p_sn = "";
|
|
var expence_money = "";
|
|
var expence_vat = "";
|
|
var expence_sum = "";
|
|
var expence_reason = "";
|
|
|
|
for (i = 0; i < $("input[name=p_subject]").length ; i++) {
|
|
p_subject = $("input[name=p_subject]").eq(i).val();
|
|
p_subject = p_subject.replace(/&/gi, '@NPER@');
|
|
p_sn = $("input[name=p_sn]").eq(i).val();
|
|
expence_money = $("input[name=expence_money]").eq(i).val();
|
|
expence_vat = $("input[name=expence_vat]").eq(i).val();
|
|
expence_sum = $("input[name=expence_sum]").eq(i).val();
|
|
expence_reason = $("textarea[name=expence_reason]").eq(i).val();
|
|
|
|
if (!validationParam(hangmok, sebu, expence_company, expence_date, p_sn, expence_money, expence_vat, expence_reason)) {
|
|
return false;
|
|
}
|
|
}
|
|
|
|
var title_type = document.frm_money.title_type.value;
|
|
var d_cost_type = document.frm_money.d_cost_type.value;
|
|
|
|
var cost_type = $("input[name='cost_type']").length > 0 ? $("input[name='cost_type']:checked").val() : 0;
|
|
|
|
|
|
var agt = navigator.userAgent.toLowerCase();
|
|
var txt = "";
|
|
for (var k = 0; k < $("textarea[name=expence_reason]").length; k++) {
|
|
txt = $("textarea[name=expence_reason]").eq(k).val();
|
|
//alert(txt);
|
|
for (var i = 0; i < txt.length; i++) {
|
|
var uniCode = txt.charCodeAt(i);
|
|
if (agt.indexOf("msie") != -1) {
|
|
if ((uniCode == 13 && txt.charCodeAt(i + 1) == 10)) {
|
|
txt = txt.replace(txt.charAt(i) + txt.charAt(i + 1), "<br>");
|
|
}
|
|
} else if (agt.indexOf("chrome") != -1) {
|
|
if (uniCode == 10) {
|
|
txt = txt.replace(txt.charAt(i), "<br>");
|
|
}
|
|
}
|
|
}
|
|
//alert(txt);
|
|
$("textarea[name=expence_reason]").eq(k).val(txt);
|
|
}
|
|
|
|
var form = document.frm_money;
|
|
|
|
if($("#boolgong").prop("checked") == true){
|
|
$("input[name=expence_taxtype]").val("4");
|
|
}
|
|
|
|
if(fileArray.length > 0){
|
|
var fdt = new DataTransfer();
|
|
fileArray.forEach(function(f){
|
|
fdt.items.add(f);
|
|
});
|
|
$("input[name='doc_attach']")[0].files = fdt.files;
|
|
}
|
|
var url = "doc_expense2_print_2014.asp";
|
|
window.open("" ,"doc_expense2_print_2014","left=50 ,top=0, menubar=no, location=no ,status=no ,toolbar=no ,width=800, height=850 ,scrollbars=yes ,resizable=yes");
|
|
form.action =url;
|
|
form.method="post";
|
|
form.target = "doc_expense2_print_2014";
|
|
form.submit();
|
|
}
|
|
|
|
function validationParam(hangmok, sebu, expence_company, expence_date, p_sn, expence_money, expence_vat, expence_reason) {
|
|
if (hangmok == "") {
|
|
alert("비용항목을 선택하세요!");
|
|
return false;
|
|
}
|
|
if (sebu == "") {
|
|
alert("세부내용을 선택하세요!");
|
|
return false;
|
|
}
|
|
if (expence_company == "") {
|
|
alert("거래처를 입력하세요!");
|
|
return false;
|
|
}
|
|
if (expence_date == "") {
|
|
alert("증빙일자를 입력하세요!");
|
|
return false;
|
|
}
|
|
|
|
if (p_sn == "") {
|
|
alert("프로젝트를 선택 또는 입력 하십시오!");
|
|
return false;
|
|
}else{
|
|
var cost_type = $("input[name='cost_type']").length > 0 ? $("input[name='cost_type']:checked").val() : 0;
|
|
|
|
//alert(p_sn.substring(0, 4));
|
|
if(cost_type == 1){
|
|
if(p_sn.substring(0, 4) == "9999"){
|
|
alert("프로젝트 비용일 경우(직접비 관련)\n부서별 공통경비코드("+p_sn+")를 입력 할 수 없습니다.");
|
|
return false;
|
|
}
|
|
}else{
|
|
if(p_sn.substring(0, 4) != "9999"){
|
|
alert("일반경비는 해당 프로젝트번호("+p_sn+")에 입력 할 수 없습니다.\n공통경비코드에서 선택하세요.");
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
|
|
if (expence_money == "") {
|
|
alert("공급가액을 입력하세요!");
|
|
return false;
|
|
}
|
|
if (expence_vat == "") {
|
|
alert("부가세액을 입력하세요!");
|
|
return false;
|
|
}
|
|
if (expence_reason == "") {
|
|
alert("지출할 내역에 대한 비고 내용을 입력하세요!");
|
|
return false;
|
|
}
|
|
|
|
var expence_vat = document.frm_money.expence_vat.value;
|
|
if (expence_vat == "") {
|
|
document.frm_money.expence_vat.value = 0;
|
|
}
|
|
|
|
for (var i=0;i<expence_reason.length;i++)
|
|
{
|
|
var uniCode = expence_reason.charCodeAt(i);
|
|
if(uniCode == 13 && expence_reason.charCodeAt(i+1) == 10){
|
|
expence_reason = expence_reason.replace(expence_reason.charAt(i)+expence_reason.charAt(i+1),"<br>");
|
|
}
|
|
}
|
|
if (expence_reason == "#" || expence_reason == "$" || expence_reason == "%" || expence_reason == "&" || expence_reason == "\"" || expence_reason == "'" || expence_reason == "_" ) {
|
|
alert("특수 문자를 입력하면 안됩니다. (#,$,%,&,',\",_)를 제거하고 다시 작성해주세요");
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
function check_comma(txt,txt2, index) {
|
|
txt = allTrim(txt);
|
|
|
|
for(var i=0;i<txt.length;i++){
|
|
txt = txt.replace(',','')
|
|
txt = txt.replace(' ','')
|
|
}
|
|
|
|
if(eval(txt2)==1){
|
|
$("#val_supply"+index).val(allTrim(commify(txt)));
|
|
}else if(eval(txt2)==2){
|
|
$("#expence_vat"+index).val(allTrim(commify(txt)));
|
|
}
|
|
|
|
var expence_money = $("#val_supply"+index).val();
|
|
var expence_vat = $("#expence_vat"+index).val();
|
|
|
|
for(var i=0;i<expence_money.length;i++){
|
|
expence_money = expence_money.replace(',','')
|
|
expence_money = expence_money.replace(' ','')
|
|
}
|
|
for(var i=0;i<expence_vat.length;i++){
|
|
expence_vat = expence_vat.replace(',','')
|
|
expence_vat = expence_vat.replace(' ','')
|
|
}
|
|
|
|
if (expence_money == ""){
|
|
txt = expence_vat;
|
|
}else if(expence_vat == ""){
|
|
txt = expence_money;
|
|
}else{
|
|
txt = eval(expence_money) + eval(expence_vat);
|
|
}
|
|
|
|
$("#expence_sum"+index).val(allTrim(commify(txt)));
|
|
|
|
var totalSumMoney = $("input[name=expence_money]").toArray().map(function(o){ return +($(o).val().replace(/,/g, "")); }).reduce(function(a, b){ return a+b; });
|
|
var totalSumVat = $("input[name=expence_vat]").toArray().map(function(o){ return +($(o).val().replace(/,/g, "")); }).reduce(function(a, b){ return a+b; });
|
|
|
|
$("#ThisAmountTotal").html(commify(totalSumMoney));
|
|
$("#ThisTaxTotal").html(commify(totalSumVat));
|
|
}
|
|
|
|
function sebureturnFunc() {
|
|
$("#sebu option").remove();
|
|
$("#sebu").append(ajaxResponse);
|
|
}
|
|
|
|
function hangmokreturnFunc() {
|
|
$("#hangmok option").remove();
|
|
$("#sebu option").remove();
|
|
$("#hangmok").append(ajaxResponse);
|
|
}
|
|
|
|
function pdfToImg(file){
|
|
var pdf_url = URL.createObjectURL(file);
|
|
var pdfTask = PDFJS.getDocument({ url: pdf_url });
|
|
pdfTask.onPassword = passwordCB;
|
|
pdfTask.promise.then(function(pdf_doc) {
|
|
pdfGetPage(pdf_doc, 1, pdf_doc.numPages);
|
|
}).catch(function(error) {
|
|
alert(error.message);
|
|
});
|
|
}
|
|
|
|
function passwordCB(passwordFunc, reason){
|
|
if (reason === 1) { // need a password
|
|
var new_password = prompt('암호를 입력해주세요.');
|
|
} else { // Invalid password
|
|
var new_password = prompt('암호가 일치하지 않습니다!\n다시 입력해주세요.');
|
|
}
|
|
passwordFunc(new_password);
|
|
}
|
|
|
|
function pdfGetPage(pdf_doc, currentPage, pdfMaxPage){
|
|
pdf_doc.getPage(currentPage).then(function(page){
|
|
var scale = 1.5;
|
|
var viewport = page.getViewport(scale);
|
|
var canvas = $("#pdf-canvas")[0];
|
|
var context = canvas.getContext('2d');
|
|
canvas.width = Math.floor(viewport.width);
|
|
canvas.height = Math.floor(viewport.height);
|
|
canvas.style.width = Math.floor(viewport.width) + "px";
|
|
canvas.style.height = Math.floor(viewport.height) + "px";
|
|
var renderContext = {
|
|
canvasContext: context,
|
|
viewport: viewport
|
|
};
|
|
page.render(renderContext).then(function(){
|
|
var imgDataUrl = canvas.toDataURL('image/jpeg', 1.0);
|
|
var blobBin = atob(imgDataUrl.split(',')[1]); // base64 데이터 디코딩
|
|
var array = [];
|
|
for (var i = 0; i < blobBin.length; i++) {
|
|
array.push(blobBin.charCodeAt(i));
|
|
}
|
|
var file = new File([new Uint8Array(array)], "tmpfile.jpg", {type: 'image/jpeg'});
|
|
fileArray.push(file);
|
|
if(pdfMaxPage > currentPage){
|
|
pdfGetPage(pdf_doc, currentPage + 1, pdfMaxPage);
|
|
}else{
|
|
imgPreviewSetting(fileArray);
|
|
}
|
|
});
|
|
});
|
|
}
|
|
|
|
</script>
|
|
</div>
|
|
<!-- /.content-wrapper -->
|
|
<!-- #include virtual = "include/footer.asp" --> |