税率筛选重复的
parent
9fdd766f69
commit
388faa6995
|
@ -167,12 +167,12 @@ public class ProjectController extends BaseController {
|
||||||
String incomeTaxRates;
|
String incomeTaxRates;
|
||||||
for (ProjectBudgetIncomeDetail projectBudgetIncomeDetail : budgetIncomeDetail) {
|
for (ProjectBudgetIncomeDetail projectBudgetIncomeDetail : budgetIncomeDetail) {
|
||||||
if (!rates.contains(projectBudgetIncomeDetail.getTaxRate().toPlainString())) {
|
if (!rates.contains(projectBudgetIncomeDetail.getTaxRate().toPlainString())) {
|
||||||
incomeTaxSb.append(projectBudgetIncomeDetail.getTaxRate().toPlainString()).append(",");
|
incomeTaxSb.append(projectBudgetIncomeDetail.getTaxRate().toPlainString()).append("%,");
|
||||||
rates.add(projectBudgetIncomeDetail.getTaxRate().toPlainString());
|
rates.add(projectBudgetIncomeDetail.getTaxRate().toPlainString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (incomeTaxSb.lastIndexOf(",") > 0 && incomeTaxSb.lastIndexOf(",") == incomeTaxSb.length() - 1) {
|
if (incomeTaxSb.lastIndexOf(",") > 0 && incomeTaxSb.lastIndexOf(",") == incomeTaxSb.length() - 1) {
|
||||||
incomeTaxRates = incomeTaxSb.substring(0, incomeTaxSb.length() - 2);
|
incomeTaxRates = incomeTaxSb.substring(0, incomeTaxSb.length() - 1);
|
||||||
} else {
|
} else {
|
||||||
incomeTaxRates = incomeTaxSb.toString();
|
incomeTaxRates = incomeTaxSb.toString();
|
||||||
}
|
}
|
||||||
|
@ -189,12 +189,12 @@ public class ProjectController extends BaseController {
|
||||||
String costTaxRates;
|
String costTaxRates;
|
||||||
for (ProjectBudgetCostDetail projectBudgetCostDetail : budgetCostDetail) {
|
for (ProjectBudgetCostDetail projectBudgetCostDetail : budgetCostDetail) {
|
||||||
if (!rates2.contains(projectBudgetCostDetail.getTaxRate().toPlainString())) {
|
if (!rates2.contains(projectBudgetCostDetail.getTaxRate().toPlainString())) {
|
||||||
costTaxSb.append(projectBudgetCostDetail.getTaxRate().toPlainString()).append(",");
|
costTaxSb.append(projectBudgetCostDetail.getTaxRate().toPlainString()).append("%,");
|
||||||
rates2.add(projectBudgetCostDetail.getTaxRate().toPlainString());
|
rates2.add(projectBudgetCostDetail.getTaxRate().toPlainString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (costTaxSb.lastIndexOf(",") > 0 && costTaxSb.lastIndexOf(",") == costTaxSb.length() - 1) {
|
if (costTaxSb.lastIndexOf(",") > 0 && costTaxSb.lastIndexOf(",") == costTaxSb.length() - 1) {
|
||||||
costTaxRates = costTaxSb.substring(0, costTaxSb.length() - 2);
|
costTaxRates = costTaxSb.substring(0, costTaxSb.length() - 1);
|
||||||
} else {
|
} else {
|
||||||
costTaxRates = costTaxSb.toString();
|
costTaxRates = costTaxSb.toString();
|
||||||
}
|
}
|
||||||
|
@ -327,12 +327,12 @@ public class ProjectController extends BaseController {
|
||||||
StringBuilder incomeTaxSb = new StringBuilder();
|
StringBuilder incomeTaxSb = new StringBuilder();
|
||||||
for (ProjectBudgetIncomeDetail projectBudgetIncomeDetail : budgetIncomeDetail) {
|
for (ProjectBudgetIncomeDetail projectBudgetIncomeDetail : budgetIncomeDetail) {
|
||||||
if (!rates.contains(projectBudgetIncomeDetail.getTaxRate().toPlainString())) {
|
if (!rates.contains(projectBudgetIncomeDetail.getTaxRate().toPlainString())) {
|
||||||
incomeTaxSb.append(projectBudgetIncomeDetail.getTaxRate().toPlainString()).append(",");
|
incomeTaxSb.append(projectBudgetIncomeDetail.getTaxRate().toPlainString()).append("%,");
|
||||||
rates.add(projectBudgetIncomeDetail.getTaxRate().toPlainString());
|
rates.add(projectBudgetIncomeDetail.getTaxRate().toPlainString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (incomeTaxSb.lastIndexOf(",") > 0 && incomeTaxSb.lastIndexOf(",") == incomeTaxSb.length() - 1) {
|
if (incomeTaxSb.lastIndexOf(",") > 0 && incomeTaxSb.lastIndexOf(",") == incomeTaxSb.length() - 1) {
|
||||||
model.put("incomeTaxRates", incomeTaxSb.substring(0, incomeTaxSb.length() - 2));
|
model.put("incomeTaxRates", incomeTaxSb.substring(0, incomeTaxSb.length() - 1));
|
||||||
} else {
|
} else {
|
||||||
model.put("incomeTaxRates", incomeTaxSb.toString());
|
model.put("incomeTaxRates", incomeTaxSb.toString());
|
||||||
}
|
}
|
||||||
|
@ -344,12 +344,12 @@ public class ProjectController extends BaseController {
|
||||||
StringBuilder costTaxSb = new StringBuilder();
|
StringBuilder costTaxSb = new StringBuilder();
|
||||||
for (ProjectBudgetCostDetail projectBudgetCostDetail : budgetCostDetail) {
|
for (ProjectBudgetCostDetail projectBudgetCostDetail : budgetCostDetail) {
|
||||||
if (!rates2.contains(projectBudgetCostDetail.getTaxRate().toPlainString())) {
|
if (!rates2.contains(projectBudgetCostDetail.getTaxRate().toPlainString())) {
|
||||||
costTaxSb.append(projectBudgetCostDetail.getTaxRate().toPlainString()).append(",");
|
costTaxSb.append(projectBudgetCostDetail.getTaxRate().toPlainString()).append("%,");
|
||||||
rates2.add(projectBudgetCostDetail.getTaxRate().toPlainString());
|
rates2.add(projectBudgetCostDetail.getTaxRate().toPlainString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (costTaxSb.lastIndexOf(",") > 0 && costTaxSb.lastIndexOf(",") == costTaxSb.length() - 1) {
|
if (costTaxSb.lastIndexOf(",") > 0 && costTaxSb.lastIndexOf(",") == costTaxSb.length() - 1) {
|
||||||
model.put("costTaxRates", costTaxSb.substring(0, costTaxSb.length() - 2));
|
model.put("costTaxRates", costTaxSb.substring(0, costTaxSb.length() - 1));
|
||||||
} else {
|
} else {
|
||||||
model.put("costTaxRates", costTaxSb.toString());
|
model.put("costTaxRates", costTaxSb.toString());
|
||||||
}
|
}
|
||||||
|
@ -585,12 +585,12 @@ public class ProjectController extends BaseController {
|
||||||
StringBuilder incomeTaxSb = new StringBuilder();
|
StringBuilder incomeTaxSb = new StringBuilder();
|
||||||
for (ProjectBudgetIncomeDetail projectBudgetIncomeDetail : budgetIncomeDetail) {
|
for (ProjectBudgetIncomeDetail projectBudgetIncomeDetail : budgetIncomeDetail) {
|
||||||
if (!rates.contains(projectBudgetIncomeDetail.getTaxRate().toPlainString())) {
|
if (!rates.contains(projectBudgetIncomeDetail.getTaxRate().toPlainString())) {
|
||||||
incomeTaxSb.append(projectBudgetIncomeDetail.getTaxRate().toPlainString()).append(",");
|
incomeTaxSb.append(projectBudgetIncomeDetail.getTaxRate().toPlainString()).append("%,");
|
||||||
rates.add(projectBudgetIncomeDetail.getTaxRate().toPlainString());
|
rates.add(projectBudgetIncomeDetail.getTaxRate().toPlainString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (incomeTaxSb.lastIndexOf(",") > 0 && incomeTaxSb.lastIndexOf(",") == incomeTaxSb.length() - 1) {
|
if (incomeTaxSb.lastIndexOf(",") > 0 && incomeTaxSb.lastIndexOf(",") == incomeTaxSb.length() - 1) {
|
||||||
model.put("incomeTaxRates", incomeTaxSb.substring(0, incomeTaxSb.length() - 2));
|
model.put("incomeTaxRates", incomeTaxSb.substring(0, incomeTaxSb.length() - 1));
|
||||||
} else {
|
} else {
|
||||||
model.put("incomeTaxRates", incomeTaxSb.toString());
|
model.put("incomeTaxRates", incomeTaxSb.toString());
|
||||||
}
|
}
|
||||||
|
@ -599,12 +599,12 @@ public class ProjectController extends BaseController {
|
||||||
StringBuilder costTaxSb = new StringBuilder();
|
StringBuilder costTaxSb = new StringBuilder();
|
||||||
for (ProjectBudgetCostDetail projectBudgetCostDetail : budgetCostDetail) {
|
for (ProjectBudgetCostDetail projectBudgetCostDetail : budgetCostDetail) {
|
||||||
if (!rates2.contains(projectBudgetCostDetail.getTaxRate().toPlainString())) {
|
if (!rates2.contains(projectBudgetCostDetail.getTaxRate().toPlainString())) {
|
||||||
costTaxSb.append(projectBudgetCostDetail.getTaxRate().toPlainString()).append(",");
|
costTaxSb.append(projectBudgetCostDetail.getTaxRate().toPlainString()).append("%,");
|
||||||
rates2.add(projectBudgetCostDetail.getTaxRate().toPlainString());
|
rates2.add(projectBudgetCostDetail.getTaxRate().toPlainString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (costTaxSb.lastIndexOf(",") > 0 && costTaxSb.lastIndexOf(",") == costTaxSb.length() - 1) {
|
if (costTaxSb.lastIndexOf(",") > 0 && costTaxSb.lastIndexOf(",") == costTaxSb.length() - 1) {
|
||||||
model.put("costTaxRates", costTaxSb.substring(0, costTaxSb.length() - 2));
|
model.put("costTaxRates", costTaxSb.substring(0, costTaxSb.length() - 1));
|
||||||
} else {
|
} else {
|
||||||
model.put("costTaxRates", costTaxSb.toString());
|
model.put("costTaxRates", costTaxSb.toString());
|
||||||
}
|
}
|
||||||
|
|
|
@ -502,6 +502,24 @@ function checkIfFillIn() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断是否重名
|
||||||
|
*/
|
||||||
|
function checkName () {
|
||||||
|
var name = $("#name").val();
|
||||||
|
var id = $("#id").val();
|
||||||
|
$.ajax({
|
||||||
|
url: "${base}/project/checkName",
|
||||||
|
data: {name: name, id: id},
|
||||||
|
type: "post",
|
||||||
|
dataType: "json",
|
||||||
|
async: false,
|
||||||
|
success: function (data) {
|
||||||
|
result = data.status;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 一维数组变二维数组
|
* 一维数组变二维数组
|
||||||
* @param list
|
* @param list
|
||||||
|
|
|
@ -272,6 +272,7 @@ function updateCostData(data, returnData) {
|
||||||
var otherTaxExclude = 0;
|
var otherTaxExclude = 0;
|
||||||
var otherTax = 0;
|
var otherTax = 0;
|
||||||
var costTaxRates = "";
|
var costTaxRates = "";
|
||||||
|
var set = new Set();
|
||||||
details.forEach(function (t, number, ts) {
|
details.forEach(function (t, number, ts) {
|
||||||
if(t["type"] == "1"){
|
if(t["type"] == "1"){
|
||||||
//设备类
|
//设备类
|
||||||
|
@ -294,7 +295,10 @@ function updateCostData(data, returnData) {
|
||||||
otherTaxExclude += f2(t["totalTaxExclude"]);
|
otherTaxExclude += f2(t["totalTaxExclude"]);
|
||||||
otherTax += f2(t["totalTax"]);
|
otherTax += f2(t["totalTax"]);
|
||||||
}
|
}
|
||||||
costTaxRates += t["taxRate"] + "%,";
|
if (!set.has(t["taxRate"])) {
|
||||||
|
costTaxRates += f2Fixed(t["taxRate"]) + "%,";
|
||||||
|
set.add(t["taxRate"]);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
$("input[name='costPurchaseDeviceTaxInclude']").val(f2Fixed(deviceTaxInclude));
|
$("input[name='costPurchaseDeviceTaxInclude']").val(f2Fixed(deviceTaxInclude));
|
||||||
$("input[name='costPurchaseDeviceTaxExclude']").val(f2Fixed(deviceTaxExclude));
|
$("input[name='costPurchaseDeviceTaxExclude']").val(f2Fixed(deviceTaxExclude));
|
||||||
|
|
|
@ -88,6 +88,7 @@ function updateIncomeData(data,returnData) {
|
||||||
var serviceTaxExclude = 0;
|
var serviceTaxExclude = 0;
|
||||||
var serviceTax = 0;
|
var serviceTax = 0;
|
||||||
var incomeTaxRates = "";
|
var incomeTaxRates = "";
|
||||||
|
var set = new Set();
|
||||||
incomeDetails.forEach(function (t, number, ts) {
|
incomeDetails.forEach(function (t, number, ts) {
|
||||||
console.log("income income " + t["type"] + ", " + t["taxRate"] + ", " + t["totalTaxInclude"] + ", " + t["totalTaxExclude"]);
|
console.log("income income " + t["type"] + ", " + t["taxRate"] + ", " + t["totalTaxInclude"] + ", " + t["totalTaxExclude"]);
|
||||||
|
|
||||||
|
@ -107,7 +108,10 @@ function updateIncomeData(data,returnData) {
|
||||||
serviceTaxExclude += f2(t["totalTaxExclude"]);
|
serviceTaxExclude += f2(t["totalTaxExclude"]);
|
||||||
serviceTax += f2(t["totalTax"]);
|
serviceTax += f2(t["totalTax"]);
|
||||||
}
|
}
|
||||||
incomeTaxRates += t["taxRate"] + "%,";
|
if (!set.has(t["taxRate"])) {
|
||||||
|
incomeTaxRates += f2Fixed(t["taxRate"]) + "%,";
|
||||||
|
set.add(t["taxRate"]);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
console.log("incomeTaxRates: " + incomeTaxRates);
|
console.log("incomeTaxRates: " + incomeTaxRates);
|
||||||
$("input[name='incomeDeviceTaxInclude']").val(f2Fixed(deviceTaxInclude));
|
$("input[name='incomeDeviceTaxInclude']").val(f2Fixed(deviceTaxInclude));
|
||||||
|
|
Loading…
Reference in New Issue