//税金和税费合计的计算
function countTaxe(index) {
var money =$.trim($('#money_' + index).val()); //实付金额
var flag = true;
var taxe = 0;
var totalMoney = 0;
if (money != null && money != "") {
if (checkMoney(money)) {
var amount = parseFloat(money, 10);
if (0 < amount && amount <= 3360) {
taxe = amount / 4 - 200;
} else if (3360 < amount && amount <= 21000) {
taxe = amount * 4 / 21;
} else if (21000 < amount && amount <= 49500) {
taxe = (amount-2000) * 6 / 19 - 2000;
alert(taxe);
} else if (amount > 49500) {
taxe = (amount-7000) * 8 / 17 - 7000;
}
if (taxe < 0) {
taxe = 0;
} else {
taxe = Math.round(taxe * 100)/100;
}
} else {
alert("实付金额应该是正数,请您输入正确的数字!");
flag = false;
}
if (flag) {
$('#taxe_' + index).val(taxe);
totalMoney = parseFloat(taxe, 10) + amount;
$('#totalMoney_' + index).val(totalMoney);
}
}
function countTaxe(index) {
var money =$.trim($('#money_' + index).val()); //实付金额
var flag = true;
var taxe = 0;
var totalMoney = 0;
if (money != null && money != "") {
if (checkMoney(money)) {
var amount = parseFloat(money, 10);
if (0 < amount && amount <= 3360) {
taxe = amount / 4 - 200;
} else if (3360 < amount && amount <= 21000) {
taxe = amount * 4 / 21;
} else if (21000 < amount && amount <= 49500) {
taxe = (amount-2000) * 6 / 19 - 2000;
alert(taxe);
} else if (amount > 49500) {
taxe = (amount-7000) * 8 / 17 - 7000;
}
if (taxe < 0) {
taxe = 0;
} else {
taxe = Math.round(taxe * 100)/100;
}
} else {
alert("实付金额应该是正数,请您输入正确的数字!");
flag = false;
}
if (flag) {
$('#taxe_' + index).val(taxe);
totalMoney = parseFloat(taxe, 10) + amount;
$('#totalMoney_' + index).val(totalMoney);
}
}
}
如果你看到这了,就点个赞再走吧!
如果你点完赞觉得不过瘾,那就赏一杯咖啡喝吧,他们都说咖啡好喝,俺都没有喝过呢
。