|
@@ -651,6 +651,10 @@ public class SalaryManagementServiceImpl extends ServiceImpl<SalaryManagementMap
|
|
|
|
|
|
StringBuffer sb = new StringBuffer("本次执行(月度工资单):");
|
|
|
|
|
|
+ String name = o.getName();
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
String userId = o.getUserId();
|
|
|
String orgName = o.getOrgName();
|
|
|
String wages = o.getWages();
|
|
@@ -704,9 +708,13 @@ public class SalaryManagementServiceImpl extends ServiceImpl<SalaryManagementMap
|
|
|
salaryManagementDetail.setTransportation(o.getTransportation());
|
|
|
salaryManagementDetail.setFullAttendance(o.getFullAttendance());
|
|
|
|
|
|
+
|
|
|
+ BigDecimal totalPriceAndTax = new BigDecimal("0");
|
|
|
+
|
|
|
|
|
|
BigDecimal totalPayable = new BigDecimal("0");
|
|
|
totalPayable = bigWages.add(phoneBill).add(lunch).add(housingSubsidies).add(transportation).add(fullAttendance).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
+
|
|
|
|
|
|
String totalPayableText = AesEncryptUtil.encrypt(totalPayable.toString());
|
|
|
salaryManagementDetail.setTotalPayable(totalPayableText);
|
|
@@ -745,9 +753,7 @@ public class SalaryManagementServiceImpl extends ServiceImpl<SalaryManagementMap
|
|
|
|
|
|
BigDecimal payTaxes = new BigDecimal("0");
|
|
|
payTaxes = totalPayable.subtract(socialSecurity).subtract(accumulationFund).subtract(new BigDecimal("5000")).subtract(deduction)
|
|
|
- .subtract(personalCost).subtract(sickCost).subtract(latenessCost).setScale(2, BigDecimal.ROUND_HALF_UP);;
|
|
|
-
|
|
|
-
|
|
|
+ .subtract(personalCost).subtract(sickCost).subtract(latenessCost).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
|
|
|
|
|
|
|
|
@@ -773,6 +779,8 @@ public class SalaryManagementServiceImpl extends ServiceImpl<SalaryManagementMap
|
|
|
hisPayTaxes = AesEncryptUtil.desEncrypt(hisPayTaxes).trim();
|
|
|
BigDecimal bigPayTaxes = new BigDecimal(hisPayTaxes);
|
|
|
extraTax = extraTax.add(bigPayTaxes);
|
|
|
+
|
|
|
+
|
|
|
|
|
|
}
|
|
|
|
|
@@ -781,10 +789,10 @@ public class SalaryManagementServiceImpl extends ServiceImpl<SalaryManagementMap
|
|
|
sb.append(withMonth + "年度,此时之前(" + yearWithMonth + ")有效福利现金" + extra.size() + "条,共计金额"+extraTax+"已计入应纳税所得额与累计所得额中;");
|
|
|
payTaxes = payTaxes.add(extraTax);
|
|
|
|
|
|
- if(payTaxes.compareTo(BigDecimal.ZERO) < 0){
|
|
|
- sb.append("实际应纳税所得额为"+payTaxes+"故默认为0!!");
|
|
|
- payTaxes = new BigDecimal("0");
|
|
|
- }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
String payTaxesText = AesEncryptUtil.encrypt(payTaxes.toString());
|
|
|
salaryManagementDetail.setPayTaxes(payTaxesText);
|
|
@@ -792,13 +800,25 @@ public class SalaryManagementServiceImpl extends ServiceImpl<SalaryManagementMap
|
|
|
if (cumulativeList.size() > 0) {
|
|
|
for (SalaryManagementDetail detail : cumulativeList) {
|
|
|
|
|
|
+ String hisGetTotalPayable = detail.getTotalPayable();
|
|
|
+ hisGetTotalPayable = AesEncryptUtil.desEncrypt(hisGetTotalPayable).trim();
|
|
|
+
|
|
|
+ BigDecimal getTotalPayable = new BigDecimal(hisGetTotalPayable);
|
|
|
+
|
|
|
+ BigDecimal totalDeduction = detail.getTotalDeduction();
|
|
|
+
|
|
|
+
|
|
|
BigDecimal personalTax = detail.getPersonalTax() == null ? BigDecimal.ZERO : detail.getPersonalTax();
|
|
|
+
|
|
|
+
|
|
|
+ totalPriceAndTax = getTotalPayable.subtract(totalDeduction).add(personalTax);
|
|
|
+
|
|
|
cumulativeTax = cumulativeTax.add(personalTax);
|
|
|
|
|
|
- String hisPayTaxes = detail.getPayTaxes();
|
|
|
- hisPayTaxes = AesEncryptUtil.desEncrypt(hisPayTaxes).trim();
|
|
|
- BigDecimal bigPayTaxes = new BigDecimal(hisPayTaxes);
|
|
|
- cumulative = cumulative.add(bigPayTaxes);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -813,7 +833,9 @@ public class SalaryManagementServiceImpl extends ServiceImpl<SalaryManagementMap
|
|
|
String hisPayTaxes = detail.getPayTaxes();
|
|
|
hisPayTaxes = AesEncryptUtil.desEncrypt(hisPayTaxes).trim();
|
|
|
BigDecimal bigPayTaxes = new BigDecimal(hisPayTaxes);
|
|
|
- cumulative = cumulative.add(bigPayTaxes);
|
|
|
+
|
|
|
+
|
|
|
+ totalPriceAndTax = totalPriceAndTax.add(bigPayTaxes);
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -828,19 +850,27 @@ public class SalaryManagementServiceImpl extends ServiceImpl<SalaryManagementMap
|
|
|
String hisPayTaxes = detail.getPayTaxes();
|
|
|
hisPayTaxes = AesEncryptUtil.desEncrypt(hisPayTaxes).trim();
|
|
|
BigDecimal bigPayTaxes = new BigDecimal(hisPayTaxes);
|
|
|
- cumulative = cumulative.add(bigPayTaxes);
|
|
|
+
|
|
|
+
|
|
|
+ totalPriceAndTax = totalPriceAndTax.add(bigPayTaxes);
|
|
|
}
|
|
|
}
|
|
|
sb.append(withMonth + "年度,此时之前(" + yearWithMonth + ")有效加班工资单" + cumulativeOvertimeList.size() + "条,已累计入累计所得额中;");
|
|
|
- cumulative = cumulative.add(payTaxes).setScale(2, BigDecimal.ROUND_HALF_UP);;
|
|
|
- String cumulativeText = AesEncryptUtil.encrypt(cumulative.toString());
|
|
|
+
|
|
|
+
|
|
|
+ totalPriceAndTax = totalPriceAndTax.add(payTaxes).setScale(2, BigDecimal.ROUND_HALF_UP);;
|
|
|
+ cumulative = cumulative.add(totalPriceAndTax);
|
|
|
+
|
|
|
+ String cumulativeText = AesEncryptUtil.encrypt(totalPriceAndTax.toString());
|
|
|
salaryManagementDetail.setCumulative(cumulativeText);
|
|
|
|
|
|
|
|
|
BigDecimal personalTax = new BigDecimal("0");
|
|
|
|
|
|
- if(cumulative.compareTo(BigDecimal.ZERO) == 0){
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+ if(cumulative.compareTo(BigDecimal.ZERO) <= 0){
|
|
|
+
|
|
|
}else{
|
|
|
if (top36000.compareTo(cumulative) != -1) {
|
|
|
personalTax = cumulative.multiply(tax003).subtract(cumulativeTax);
|
|
@@ -1039,17 +1069,48 @@ public class SalaryManagementServiceImpl extends ServiceImpl<SalaryManagementMap
|
|
|
List<SalaryManagementWorkOvertime> cumulativeOvertimeList = salaryManagementWorkOvertimeMapper.selectByUser(userId, newYear, null);
|
|
|
|
|
|
if (cumulativeList.size() > 0) {
|
|
|
+
|
|
|
+ BigDecimal deduction = new BigDecimal("0");
|
|
|
+ Date createTime = null;
|
|
|
+
|
|
|
+ for (SalaryManagementDetail detail : cumulativeList) {
|
|
|
+ Date createTime1 = detail.getCreateTime();
|
|
|
+ BigDecimal deduction1 = detail.getDeduction() == null ? BigDecimal.ZERO : detail.getDeduction();
|
|
|
+
|
|
|
+ if(createTime == null){
|
|
|
+ createTime = createTime1;
|
|
|
+ deduction = deduction1;
|
|
|
+ }else{
|
|
|
+
|
|
|
+ if(createTime.before(createTime1)){
|
|
|
+ createTime = createTime1;
|
|
|
+ deduction = deduction1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
for (SalaryManagementDetail detail : cumulativeList) {
|
|
|
|
|
|
BigDecimal personalTax = detail.getPersonalTax() == null ? BigDecimal.ZERO : detail.getPersonalTax();
|
|
|
cumulativeTax = cumulativeTax.add(personalTax);
|
|
|
|
|
|
- String hisPayTaxes = detail.getPayTaxes();
|
|
|
- hisPayTaxes = AesEncryptUtil.desEncrypt(hisPayTaxes).trim();
|
|
|
- BigDecimal bigPayTaxes = new BigDecimal(hisPayTaxes);
|
|
|
- cumulative = cumulative.add(bigPayTaxes);
|
|
|
- }
|
|
|
+ String hisGetTotalPayable = detail.getTotalPayable();
|
|
|
+ hisGetTotalPayable = AesEncryptUtil.desEncrypt(hisGetTotalPayable).trim();
|
|
|
+
|
|
|
+ BigDecimal getTotalPayable = new BigDecimal(hisGetTotalPayable);
|
|
|
|
|
|
+ BigDecimal totalDeduction = detail.getTotalDeduction();
|
|
|
+
|
|
|
+
|
|
|
+ cumulative = cumulative.add(getTotalPayable.subtract(totalDeduction).add(personalTax));
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ cumulative = cumulative.subtract(deduction);
|
|
|
}
|
|
|
sb.append(withMonth + "年度,此时之前(" + newYear + ")有效月度工资单" + cumulativeList.size() + "条,已累计入累计所得额中;");
|
|
|
|
|
@@ -1076,7 +1137,7 @@ public class SalaryManagementServiceImpl extends ServiceImpl<SalaryManagementMap
|
|
|
|
|
|
|
|
|
BigDecimal personalTax = new BigDecimal("0");
|
|
|
- if(cumulative.compareTo(BigDecimal.ZERO) == 0){
|
|
|
+ if(cumulative.compareTo(BigDecimal.ZERO) <= 0){
|
|
|
|
|
|
}else{
|
|
|
if (top36000.compareTo(cumulative) != -1) {
|
|
@@ -1261,17 +1322,50 @@ public class SalaryManagementServiceImpl extends ServiceImpl<SalaryManagementMap
|
|
|
List<SalaryManagementHoliday> holidayList = salaryManagementHolidayMapper.selectByUser(userId,withMonth);
|
|
|
|
|
|
if (cumulativeList.size() > 0) {
|
|
|
+
|
|
|
+ BigDecimal deduction = new BigDecimal("0");
|
|
|
+ Date createTime = null;
|
|
|
+
|
|
|
+ for (SalaryManagementDetail detail : cumulativeList) {
|
|
|
+ Date createTime1 = detail.getCreateTime();
|
|
|
+ BigDecimal deduction1 = detail.getDeduction() == null ? BigDecimal.ZERO : detail.getDeduction();;
|
|
|
+
|
|
|
+ if(createTime == null){
|
|
|
+ createTime = createTime1;
|
|
|
+ deduction = deduction1;
|
|
|
+ }else{
|
|
|
+
|
|
|
+ if(createTime.before(createTime1)){
|
|
|
+ createTime = createTime1;
|
|
|
+ deduction = deduction1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
for (SalaryManagementDetail detail : cumulativeList) {
|
|
|
|
|
|
BigDecimal personalTax = detail.getPersonalTax() == null ? BigDecimal.ZERO : detail.getPersonalTax();
|
|
|
cumulativeTax = cumulativeTax.add(personalTax);
|
|
|
|
|
|
- String hisPayTaxes = detail.getPayTaxes();
|
|
|
- hisPayTaxes = AesEncryptUtil.desEncrypt(hisPayTaxes).trim();
|
|
|
- BigDecimal bigPayTaxes = new BigDecimal(hisPayTaxes);
|
|
|
- cumulative = cumulative.add(bigPayTaxes);
|
|
|
- }
|
|
|
+ cumulativeTax = cumulativeTax.add(personalTax);
|
|
|
+
|
|
|
+ String hisGetTotalPayable = detail.getTotalPayable();
|
|
|
+ hisGetTotalPayable = AesEncryptUtil.desEncrypt(hisGetTotalPayable).trim();
|
|
|
+
|
|
|
+ BigDecimal getTotalPayable = new BigDecimal(hisGetTotalPayable);
|
|
|
|
|
|
+ BigDecimal totalDeduction = detail.getTotalDeduction();
|
|
|
+
|
|
|
+
|
|
|
+ cumulative = cumulative.add(getTotalPayable.subtract(totalDeduction).add(personalTax));
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ cumulative = cumulative.subtract(deduction);
|
|
|
}
|
|
|
sb.append(withMonth + "年度,此时之前(" + yearWithMonth + ")有效月度工资单" + cumulativeList.size() + "条,已累计入累计所得额中;");
|
|
|
|
|
@@ -1315,7 +1409,7 @@ public class SalaryManagementServiceImpl extends ServiceImpl<SalaryManagementMap
|
|
|
|
|
|
BigDecimal personalTax = new BigDecimal("0");
|
|
|
|
|
|
- if(cumulative.compareTo(BigDecimal.ZERO) == 0){
|
|
|
+ if(cumulative.compareTo(BigDecimal.ZERO) <= 0){
|
|
|
|
|
|
}else{
|
|
|
|