[etc] 수수료계산 - VAT 계산 하기 > 팁앤테크

본문 바로가기
사이트 내 전체검색

팁앤테크

[etc] 수수료계산 - VAT 계산 하기

페이지 정보

본문

<script language='JavaScript'>
/// VAT 계산 하기 //////////
//////////////////////// 문자열 치환 //////////////////////
function replace(str,sstr,rstr) { // 문자열 치환
return String(str).replace(new RegExp(sstr,"ig"),rstr);
}
//////////////////////// 문자열 치환 //////////////////////

//////////// 실시간 콤마 /////////////////////
function tagin_net_comma(tagin_net_str) {
var t_align = "right"; // 텍스트 필드 정렬
var t_num = tagin_net_str.value.substring(0,1); // 첫글자 확인 변수
var num = /^[/,/,0,1,2,3,4,5,6,7,8,9,/]/; // 숫자와 , 만 가능
var tagin_netValue = "";
var tagin_netValue2 = "";

if (!num.test(tagin_net_str.value)) {
alert('숫자만 입력하십시오.nn특수문자와 한글/영문은 사용할수 없습니다.');
tagin_net_str.value="";
tagin_net_str.focus();
return false;
}

if ((t_num < "0" || "9" < t_num)){
alert("숫자만 입력하십시오.");
tagin_net_str.value="";
tagin_net_str.focus();
return false;
}

for(i=0; i<tagin_net_str.value.length; i++) {
if(tagin_net_str.value.charAt(tagin_net_str.value.length - i -1) != ",") {
tagin_netValue2 = tagin_net_str.value.charAt(tagin_net_str.value.length - i -1) + tagin_netValue2;
}
}

for(i=0; i<tagin_netValue2.length; i++) {

if(i > 0 && (i%3)==0) {
tagin_netValue = tagin_netValue2.charAt(tagin_netValue2.length - i -1) + "," + tagin_netValue;
} else {
tagin_netValue = tagin_netValue2.charAt(tagin_netValue2.length - i -1) + tagin_netValue;
}
}

tagin_net_str.value = tagin_netValue;
tagin_net_str.style.textAlign = t_align;
}
//////////// 실시간 콤마 /////////////////////

///////////////// 콤마 나누는 부분 ////////////////
function commaSplit(srcNumber) {
var txtNumber = '' + srcNumber;
var rxSplit = new RegExp('([0-9])([0-9][0-9][0-9][,.])');
var arrNumber = txtNumber.split('.');
arrNumber[0] += '.';
do {
arrNumber[0] = arrNumber[0].replace(rxSplit, '$1,$2');
}
while (rxSplit.test(arrNumber[0]));
if (arrNumber.length > 1) {
return arrNumber.join('');
}
else {
return arrNumber[0].split('.')[0];
}
}
///////////////// 콤마 나누는 부분 ////////////////

function tagin_net_vat(){
var f = document.tagin_netform;
var tagin_net_vat_rate = (f.tagin_net_rate.value/100);
var tagin_net_money = replace(f.tagin_net_money.value,',','');
var tagin_net_vat_money= (tagin_net_money * tagin_net_vat_rate);
var tagin_net_vat_money_plus = (tagin_net_vat_money - (tagin_net_money * -1));
f.tagin_net_vat_money.value = commaSplit(parseInt(tagin_net_vat_money));
f.tagin_net_vat_money_plus.value = commaSplit(parseInt(tagin_net_vat_money_plus));
}
</script>
<form name="tagin_netform">
<table border="0" bgcolor="#CCCCCC" cellpadding="5" cellspacing="1" align="center">
<tr align="center" bgcolor="white"><td colspan="2">VAT 계산 하기</td></tr>
<tr align="center" bgcolor="white">
<td>금액</td><td align="left"><input type="text" size="15" name="tagin_net_money" value=""onKeyUp="tagin_net_comma(this);tagin_net_vat()"> 원</td>
</tr>
<tr align="center" bgcolor="white">
<td>VAT 요율</td><td align="left"><input type="text" size="15" name="tagin_net_rate" value="10"  onFocus="this.select()" onKeyUp="tagin_net_vat()" style="text-align:right;"> %</td>
</tr>
<tr align="center" bgcolor="white">
<td>VAT 금액</td><td align="left"><input type="text" size="15" name="tagin_net_vat_money" value="" onFocus="this.blur()" readonly style="text-align:right;"> 원</td>
</tr>
<tr align="center" bgcolor="white">
<td>VAT 포함 금액</td><td align="left"><input type="text" size="15" name="tagin_net_vat_money_plus" value=""  onFocus="this.blur()" readonly style="text-align:right;"> 원</td>
</tr>
</table>
</form>

<!-- Script Size : 4.789 Bytes -->
추천0

댓글목록

등록된 댓글이 없습니다.

Total 114건 3 페이지
  • RSS
팁앤테크 목록
번호 제목 글쓴이 조회 추천 날짜
64 제로쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 13871 0 01-22
63 쎄엠쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 15900 0 02-08
62 제로쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 13965 0 12-05
61 제로쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 15780 0 10-22
60 제로쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 17125 0 09-21
59 제로쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 13547 0 12-09
58 제로쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 13149 0 01-04
57 제로쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 13881 0 05-09
56 쎄엠쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 13594 0 02-29
55 명예쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 14054 0 12-16
54 귀여운현호쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 12299 0 10-23
53 제로쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 14783 0 10-23
52 제로쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 13125 0 12-09
51 제로쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 19892 0 01-31
50 제로쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 16704 0 06-11
49 쎄엠쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 15513 0 03-06
48 월드컵쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 27356 0 12-22
47 힘쓰쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 14785 0 01-03
46 제로쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 12922 0 11-12
45 제로쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 12912 0 12-14
44 제로쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 19623 0 02-08
43 제로쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 15019 0 06-11
42 제로쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 18031 0 03-21
41 귀여운현호쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 12901 0 10-24
열람중 제로쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 16723 0 01-08

검색

회원로그인

회원가입

사이트 정보

株式会社YHPLUS / 대표 : ZERO
〒140-0011 東京都品川区東大井2-5-9-203
050-5539-7787
오픈카카오톡 (YHPLUS) :
https://open.kakao.com/o/slfDj15d

접속자집계

오늘
4,024
어제
8,087
최대
8,087
전체
1,418,662
Copyright (c) 株式会社YHPLUS. All rights reserved.